[x264-devel] Re: VUI Header - timing info

Måns Rullgård mru at inprovide.com
Fri Apr 7 11:23:59 CEST 2006


Sven Dueking said:
> Hi,
>
> Can someone please explain the follwing calculation to me?
>
> if( param->i_fps_num > 0 && param->i_fps_den > 0)
> {
>         sps->vui.b_timing_info_present = 1;
>         sps->vui.i_num_units_in_tick = param->i_fps_den;
>         sps->vui.i_time_scale = param->i_fps_num * 2;
>         sps->vui.b_fixed_frame_rate = 1;
> }
>
> param->i_fps_num = (int)(fps * 1000 + .5);
> where fps is the frame rate and
> param->i_fps_den = 1000;
>
> So, in case that the frame rate is equal to 30
> sps->vui.i_time_scale is 60000
>
> tc = sps->vui.i_num_units_in_tick / sps->vui.i_time_scale
> (C2 in the standard).
>
> tc is a clock tick an is the minimum interval of time can be
> represented in the coded data.
> I am not sure, but I think is is the time interval between
> two frames or in other words something like the display time offset.
> Is this right ? I think in this case the calculation is not correct.
> From my point of view sps->vui.i_time_scale must be equal to
> param->i_fps_num.

The VUI timing info specifies, when fixed_frame_rate_flag is set, the *field*
rate, even for progressive encodings.  This is because a stream may contain
both field and frame pictures, and always specifying the timing in the same
way simplifies the decoder ever so slightly.

Read the list archives for more on this topic.

-- 
Måns Rullgård
mru at inprovide.com

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list