Small animals hyperventilating before death -- what's going on?

I once had to watch two small critters die (a bird and a chipmunk). In the minutes prior to their deaths, they were lying on their backs, mostly motionless and quiet, but breathing really really quickly. Their chests were pumping furiously, their eyes kinda gazed at nothing in particular, occasionally blinking, and then they died.

Why the fast breathing?

It’s likely that both suffered some sort of head injury immediately prior to death. The chipmunk was caught in a mouse trap and the bird flew into a window at high speed.

It might be agonal respiration. I remember watching my sister as she died, and that’s what her breathing was.

Wikipedia: Agonal respiration.

Probably begins with respiratory compensation for a metabolic acidosis from organ failure and then proceeds to agonal respirations.