ごちそうさまでした。「gochisousama deshita」 This can be said to the cook. I heard "いただきます!"「itadakimasu」more frequently for a variety of reasons. But it is common to shout out to thank the cook when you leave a restaurant. I became comfortable doing it myself.