How intelligent were dinosaurs?

By measuring the size of the brain cavity in available dinosaur skulls, it's clear that some dinosaurs had relatively larger brains than others and that dinosaurs' brains were not unusually small compared to those of living reptiles, such as crocodiles, turtles and lizards. Does this mean they were equally intelligent? Not necessarily. 

One can also examine the organization of the three main parts of the brain: the stem, which regulates heartbeat, respiration and other functions; the cerebellum, which coordinates muscle movements; and the cerebrum, which is involved with complex sensory functions and memory. In Velociraptor and its close relatives, the cerebrum and cerebellum appear large and bird-like, possibly indicating enhanced abilities.