Some birds are just as smart as apes. Complex cognition is possible without a cortex due to similarities in brain architecture.
Adam Rifkin stashed this in Brain
“The absolute brain weight is not relevant for mental abilities, either.” While ape brains weigh 275 to 500 gram on average, birds, who are just as skilful despite lacking a cortex, only manage 5 to 20 gram.
Sounds like, gram per gram, birds have better brains. I wonder if other dinosaurs did too.