[Libva] [PATCH 1/4] i965_encoder: consistently represent framerate as a fraction

Xiang, Haihao haihao.xiang at intel.com
Fri Dec 16 01:12:03 UTC 2016


> On 15/12/16 08:54, Xiang, Haihao wrote:
> > 
> > Hi Mark,
> > 
> > Thanks for your patch, is there any benefit to use a fraction?
> > using
> > 100 as framerate_den works well in the driver.
> 
> Everything the driver interacts with directly, on both sides, uses a
> fraction:
> 
> * In VAAPI, VAEncMiscParameterFrameRate contains a 16 / 16 fraction.
> 
> * Newer hardware uses a fraction directly where it requires a
> framerate (gen9_vp9_encoder.c:1204, gen9_vdenc.c:1648).
> 
> * H.264 and H.265 streams contain num_units_in_tick / time_scale.
> 
> * gstreamer (GstVideoInfo.fps_[nd]), libyami
> (VideoFrameRate.frameRate{Num,Denom}) and libavcodec
> (AVCodecContext.{time_base,framerate} are fraction structures) all
> represent framerate as a fraction.
> 
> The driver should use a fraction as well to preserve the exact value
> and be consistent with everything it interacts with.

Agree, the driver should use a fraction. What I mean is that
(frames_per_100s / 100) works well in practice, so I prefer 1 field
instead of 2 fields in the corresponding structure.

Thanks
Haihao

> 
> Do you have any other concerns about the patch?  If there are
> additional references outside the core driver code which I have
> missed somehow then I would be happy to update them as well.
> 
> Thanks,
> 
> - Mark
> 
> _______________________________________________
> Libva mailing list
> Libva at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libva


More information about the Libva mailing list