1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
FFmpeg/tests/ref
Wenbin Chen 76b33704b6 avcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb()
For 422 frames we should not use hard coded 8 to calculate mb size for
uv plane. Chroma shift should be taken into consideration to be
compatiple with different sampling format.

The error is reported by fate test when av_cpu_max_align() return 64
on the platform supporting AVX512. This is a hidden error and it is
exposed after commit 17a59a634c.

mpeg2enc has a mechanism to reuse frames. When it computes SSE (sum of
squared error) on current mb, reconstructed mb will be wrote to the
previous mb space, so that the memory can be saved. However if the align
is 64, the frame is shared in somewhere else, so the frame cannot be
reused and a new frame to store reconstrued data is created. Because the
height of mb is wrong when compute sse on 422 frame, starting from the
second line of macro block, changed data is read when frame is reused
(we need to read row 16 rather than row 8 if frame is 422), and unchanged
data is read when frame is not reused (a new frame is created so the
original frame will not be changed).

That is why commit 17a59a634c exposes this
issue, because it add av_cpu_max_align() and this function return 64 on
platform supporting AVX512 which lead to creating a frame in mpeg2enc,
and this lead to the different outputs.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-09 21:05:02 +02:00
..
acodec tests/ref: Remove unused reference files 2022-05-03 04:18:06 +02:00
fate fate/h264: Add Active Format Descriptor test 2022-07-09 20:24:31 +02:00
lavf fate: add PFM encoder tests 2022-07-03 15:16:31 +02:00
lavf-fate avformat/matroskaenc: Don't waste bytes to Write Tag length fields 2022-06-20 23:42:28 +02:00
pixfmt
seek avcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb() 2022-07-09 21:05:02 +02:00
vsynth avcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb() 2022-07-09 21:05:02 +02:00