[x264-devel] Re: VUI Header - timing info
Loïc Le Loarer
lll+vlc at m4x.org
Sat Apr 8 17:45:44 CEST 2006
Le Friday 07 April 2006 à 10:23:59 +0100, Måns Rullgård a écrit:
>
> 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.
If we don't want this question come back too often, this would deserve a
comment in the code quoting the relevent part of the discussion,
wouldn't it ?
Best regards.
--
Loïc
--
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