[FFmpeg-devel] [PATCH] mpeg2dec: Fix motion vector rounding for chroma components

Michael Niedermayer michael at niedermayer.cc
Sun Feb 11 03:33:51 EET 2018


On Sat, Feb 10, 2018 at 06:36:33PM +0900, Nekopanda wrote:
> In 16x8 motion compensation, for lower 16x8 region, the input to mpeg_motion() for motion_y was "motion_y + 16", which causes wrong rounding. For 4:2:0, chroma scaling for y is dividing by two and rounding toward zero. When motion_y < 0 and motion_y + 16 > 0, the rounding direction of "motion_y" and "motion_y + 16" is different and rounding "motion_y + 16" would be incorrect.
> 
> We should input "motion_y" as is to round correctly. I add "is_16x8" flag to do that.
> ---
>  libavcodec/mpegvideo_motion.c        |  30 ++++-----
>  tests/ref/fate/filter-w3fdif-complex |  60 +++++++++---------
>  tests/ref/fate/filter-w3fdif-simple  |  60 +++++++++---------
>  tests/ref/fate/filter-yadif-mode0    |  60 +++++++++---------
>  tests/ref/fate/filter-yadif-mode1    | 118 +++++++++++++++++------------------
>  tests/ref/fate/filter-yadif10        |  60 +++++++++---------
>  tests/ref/fate/filter-yadif16        |  60 +++++++++---------
>  tests/ref/fate/mpeg2-field-enc       |  60 +++++++++---------
>  tests/ref/fate/mpeg2-ticket6677      |  12 ++--
>  9 files changed, 261 insertions(+), 259 deletions(-)

This patch changes 2 fate tests:
make: *** [fate-filter-mcdeint-fast] Error 1
make: *** [fate-filter-mcdeint-medium] Error 1


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180211/e6314256/attachment.sig>


More information about the ffmpeg-devel mailing list