(CNN)Being called a "bird brain" may be closer to a compliment than an insult.
That's because new research suggests that some birds evolved over time to have smaller bodies and maintain large brains.
Researchers studied the endocasts of skulls belonging to hundreds of dinosaurs and extinct birds.
They used CT scans of the animals' ancient skulls to create endocasts, which act like an imprint of the brain in the skull, reflecting brain sizes (since brains don't fossilize). Then, they compared the brain sizes with brain measurements of modern birds in a large data set.
The brain measurements were analyzed along with body size to compare the scale of brain size to body size.
Together, the evolutionary biologists and paleontologists were able to show the timeline for bird brain evolution. The study published Thursday in the journal Current Biology.
Before the mass extinction event that killed off the dinosaurs 66 million years ago, the researchers discovered that birds and large dinosaurs had brains that were very similar in size.
But some birds went through what the researchers refer to as a "scaling" event after the dinosaurs went extinct.
Birds were some of the first animals to recover and repopulate the empty landscape after the dinosaurs disappeared. They diversified and evolved in this setting, and some of the birds that started out larger in size experienced what's called "a scaling down." Their bodies shrank in size, but they kept the big brains of their larger ancestors.
"Our paper emphasizes that the mass extinction really altered the course of avian brain evolution," said Daniel Ksepka, lead study author and curator of science at the Bruce Museum, in an email to CNN.
"There were profound changes in brain-body scaling in the immediate aftermath of the extinction, and these may have played an important role in modern birds surviving and going on to radiate into the 10,000+ species we have today."
The changes appeared to occur very rapidly after the asteroid impact that caused the dinosaur extinction, Ksepka said. They found at least seven brain-body scaling events in birds right after the mass extinction.
Before the mass extinction event, the similarities between dinosaur and bird brains were almost indistinguishable.
"There is no clear line between the brains of advanced dinosaurs and primitive birds," said Amy Balanoff, study co-author and assistant research professor in Johns Hopkins University's Department of Psychological and Brain Sciences, in a statement.
"Birds like emus and pigeons have the same brain sizes you would expect for a theropod dinosaur of the same body size, and in fact some species like moa have smaller-than-expected brains."
The mass extinction event likely acted as a trigger for these changes. These birds had to evolve to survive.
"In the aftermath of the asteroid impact, it would have been intensely challenging to survive," Ksepka said. "Larger-brained animals tend to have more flexibility in adapting to changing environments.
"Likewise, smaller-bodied animals seem to have had a better chance of surviving in the immediate aftermath since they need less food. So, the altered landscape may have triggered the rapid evolution of new brain-body scaling patterns by favoring both larger brains and smaller bodies."