Logo Search packages:      
Sourcecode: libtheora version File versions  Download package

int theora_granule_shift ( theora_info ti  ) 

Report the granulepos shift radix

When embedded in Ogg, Theora uses a two-part granulepos, splitting the 64-bit field into two pieces. The more-significant section represents the frame count at the last keyframe, and the less-significant section represents the count of frames since the last keyframe. In this way the overall field is still non-decreasing with time, but usefully encodes a pointer to the last keyframe, which is necessary for correctly restarting decode after a seek.

This function reports the number of bits used to represent the distance to the last keyframe, and thus how the granulepos field must be shifted or masked to obtain the two parts.

Since libtheora returns compressed data in an ogg_packet structure, this may be generally useful even if the Theora packets are not being used in an Ogg container.

ti A previously initialized theora_info struct
The bit shift dividing the two granulepos fields
This function was added in the 1.0alpha5 release.

Definition at line 444 of file toplevel.c.

References theora_info::keyframe_frequency_force, and theora_granule_shift().

Referenced by theora_granule_shift().

  return _ilog(ti->keyframe_frequency_force - 1);

Generated by  Doxygen 1.6.0   Back to index