Commit Graph

2 Commits

Author SHA1 Message Date
Nekopanda f4d5d7e8de avcodec/mpeg2dec: Fix motion vector rounding for chroma components
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.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-02-11 12:04:47 +01:00
Zhong Li 7e294a1f09 fate: add a test for mpeg2 issue of ticket #6677
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-25 00:18:41 +02:00