Image caption Archaeopteryx is no longer regarded as the only missing link for the transition from dinosaur to bird

Several ancient dinosaurs evolved the brainpower needed for flight long before they could take to the skies, scientists say.

Non-avian dinosaurs were found to have "bird brains", larger than that of Archaeopteryx, a 150 million-year-old bird-like dinosaur.

Once regarded as a unique transition between dinosaurs and birds, scientists say Archaeopteryx has now lost its pivotal place.

The study is published in Nature.

A recent discovery in China which unveiled the earliest creature yet discovered on the evolutionary line to birds, also placed Archaeopteryx in less of a transitional evolutionary place.

Bird brains tend to be more enlarged compared to their body size than reptiles, vital for providing the vision and coordination needed for flight.

Scientists using high-resolution CT scans have now found that these "hyper-inflated" brains were present in many ancient dinosaurs, and had the neurological hardwiring needed to take to the skies.

This included several bird-like oviraptorosaurs and the troodontids Zanabazar junior, which had larger brains relative to body size than that of Archaeopteryx.

This latest work adds to previous studies which found the presence of feathers and wishbones on ancient dinosaurs.

Image caption Dinosaurs like the troodontid Zanabazar junior had enlarged "bird brains"

"Archaeopteryx has always been set up as a uniquely transitional species between feathered dinosaurs and modern birds," said lead author Amy Balanoff, of the American Museum of Natural History and Stony Brook University.

By studying the brains of closely related dinosaurs, she said that Archaeopteryx "might not have been so special".

"Large forebrains are typically correlated with things like increased cognition and parental care of the young, while not flying, they were definitely doing other things with these enlarged brains.

"A lot of these characteristics that are distinctive within birds evolved much earlier in the history of Theropods . It's interesting that the brain followed this pattern as well. The large brain evolved before flight earlier than was previously thought," Dr Balanoff told BBC News.

Other ancient birds Epidexipteryx - a very small feathered dinosaur discovered in China and first reported in 2008 (above). It had four long tail feathers but there is little evidence that it could fly. Jeholornis - this creature lived 120 million years ago in the Cretaceous. It was a relatively large bird, about the size of a turkey. First discovered in China, and reported in 2002. Sapeornis - lived 110 to 120 million years ago. Another small primitive bird about 33 centimetres in length. It was discovered in China and was first reported in 2002. Xiaotingia, a chicken-sized dinosaur which dates back 155 million years to the Jurassic Period, reported in 2011. Aurornis, which means "dawn bird" lived about 160 million years ago, about 50cm tail to beak reported in China in 2013.

By compiling CT scans, the scientists created 3D reconstructions of dinosaur skulls as well as modern bird brains. They also calculated the total volume of each digital brain and determined the size of major anatomical regions such as the olfactory bulbs, cerebrum, optic lobes and cerebellum.

"The story of brain size is more than its relationship to body size," said co-author Gabriel Bever, of the New York Institute of Technology.

"If we also consider how the different regions of the brain changed relative to each other, we can gain insight into what factors drove brain evolution as well as what developmental mechanisms facilitated those changes."

Adrian Thomas at the department of zoology at Oxford University, who was not involved with the study, said the picture now is much more complicated than "dinosaurs couldn't fly and Archaeopteryx could".

"There were a whole group of more or less distantly related feathered dinosaurs, some were gliding down from trees, some were flapping, and it all seemed to be happening at the same time.

"Rather than a straight [evolutionary] path that led Archaeopteryx to birds, the picture now is that there were lots of dinosaurs exploiting the advantages of gliding and flight. The birds are the ones that carried on successfully to the present day," Prof Thomas told BBC News.

But he added that the "processing power required for flight is relatively simple" compared to walking and running.

"So it is interesting, but not a great surprise, to see increased brain size in these dinosaurs associated with their highly agile lifestyles."