diff options
author | Wenbin Chen <wenbin.chen-at-intel.com@ffmpeg.org> | 2022-07-04 11:17:34 +0800 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2022-07-09 21:05:02 +0200 |
commit | 76b33704b628248d77ed61cbef9ecd9430a4b6c5 (patch) | |
tree | 1ff94e738113582d97e9d217ecdc8eb9a31d8441 /tests/ref/vsynth | |
parent | 8393c0721a76d72ec73935ce58934c0ae40774e5 (diff) |
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 17a59a634c39b00a680c6ebbaea58db95594d13d.
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 17a59a634c39b00a680c6ebbaea58db95594d13d 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>
Diffstat (limited to 'tests/ref/vsynth')
-rw-r--r-- | tests/ref/vsynth/vsynth1-mpeg2-422 | 8 | ||||
-rw-r--r-- | tests/ref/vsynth/vsynth2-mpeg2-422 | 8 | ||||
-rw-r--r-- | tests/ref/vsynth/vsynth3-mpeg2-422 | 8 | ||||
-rw-r--r-- | tests/ref/vsynth/vsynth_lena-mpeg2-422 | 8 |
4 files changed, 16 insertions, 16 deletions
diff --git a/tests/ref/vsynth/vsynth1-mpeg2-422 b/tests/ref/vsynth/vsynth1-mpeg2-422 index e936ba463e..a39b2b4dce 100644 --- a/tests/ref/vsynth/vsynth1-mpeg2-422 +++ b/tests/ref/vsynth/vsynth1-mpeg2-422 @@ -1,4 +1,4 @@ -6e135a1a27235a320311a932147846b4 *tests/data/fate/vsynth1-mpeg2-422.mpeg2video -730780 tests/data/fate/vsynth1-mpeg2-422.mpeg2video -0273cd8463d1fc115378748239951560 *tests/data/fate/vsynth1-mpeg2-422.out.rawvideo -stddev: 10.27 PSNR: 27.90 MAXDIFF: 162 bytes: 7603200/ 7603200 +651f054730be04257498eeae08b3bdc5 *tests/data/fate/vsynth1-mpeg2-422.mpeg2video +855859 tests/data/fate/vsynth1-mpeg2-422.mpeg2video +10fd55dbd10b08f9271eb89617766be8 *tests/data/fate/vsynth1-mpeg2-422.out.rawvideo +stddev: 9.38 PSNR: 28.68 MAXDIFF: 178 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-mpeg2-422 b/tests/ref/vsynth/vsynth2-mpeg2-422 index ec7244f9f9..5da29b4eac 100644 --- a/tests/ref/vsynth/vsynth2-mpeg2-422 +++ b/tests/ref/vsynth/vsynth2-mpeg2-422 @@ -1,4 +1,4 @@ -b2fa9b73c3547191ecc01b8163abd4e5 *tests/data/fate/vsynth2-mpeg2-422.mpeg2video -379164 tests/data/fate/vsynth2-mpeg2-422.mpeg2video -704f6a96f93c2409219bd48b74169041 *tests/data/fate/vsynth2-mpeg2-422.out.rawvideo -stddev: 4.17 PSNR: 35.73 MAXDIFF: 70 bytes: 7603200/ 7603200 +fcaf6242ca4b706d392e40d9631e3465 *tests/data/fate/vsynth2-mpeg2-422.mpeg2video +383946 tests/data/fate/vsynth2-mpeg2-422.mpeg2video +474bb259f041bfb971691551f678fd09 *tests/data/fate/vsynth2-mpeg2-422.out.rawvideo +stddev: 3.93 PSNR: 36.23 MAXDIFF: 69 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth3-mpeg2-422 b/tests/ref/vsynth/vsynth3-mpeg2-422 index 2247f286e6..e83c23635c 100644 --- a/tests/ref/vsynth/vsynth3-mpeg2-422 +++ b/tests/ref/vsynth/vsynth3-mpeg2-422 @@ -1,4 +1,4 @@ -4d108b861715f1fa010fd70baea91793 *tests/data/fate/vsynth3-mpeg2-422.mpeg2video -68612 tests/data/fate/vsynth3-mpeg2-422.mpeg2video -73b16e906d07b6bbccf4b00d4a25302c *tests/data/fate/vsynth3-mpeg2-422.out.rawvideo -stddev: 4.02 PSNR: 36.05 MAXDIFF: 46 bytes: 86700/ 86700 +96dc854fc40a6410d4edc387b63ded1a *tests/data/fate/vsynth3-mpeg2-422.mpeg2video +75445 tests/data/fate/vsynth3-mpeg2-422.mpeg2video +5337fc0bfb789919cb3325a02d48eb82 *tests/data/fate/vsynth3-mpeg2-422.out.rawvideo +stddev: 3.24 PSNR: 37.90 MAXDIFF: 27 bytes: 86700/ 86700 diff --git a/tests/ref/vsynth/vsynth_lena-mpeg2-422 b/tests/ref/vsynth/vsynth_lena-mpeg2-422 index 5f11d4e7cd..85d598782c 100644 --- a/tests/ref/vsynth/vsynth_lena-mpeg2-422 +++ b/tests/ref/vsynth/vsynth_lena-mpeg2-422 @@ -1,4 +1,4 @@ -521ec92c0b8672011a43dd13db98c400 *tests/data/fate/vsynth_lena-mpeg2-422.mpeg2video -356431 tests/data/fate/vsynth_lena-mpeg2-422.mpeg2video -51ca353620f85db8b5b1c56f1a275add *tests/data/fate/vsynth_lena-mpeg2-422.out.rawvideo -stddev: 3.15 PSNR: 38.14 MAXDIFF: 49 bytes: 7603200/ 7603200 +87e5c69775b363db649c253050536045 *tests/data/fate/vsynth_lena-mpeg2-422.mpeg2video +361341 tests/data/fate/vsynth_lena-mpeg2-422.mpeg2video +93cefcf101e6d0814acfaa626a02be90 *tests/data/fate/vsynth_lena-mpeg2-422.out.rawvideo +stddev: 2.97 PSNR: 38.67 MAXDIFF: 57 bytes: 7603200/ 7603200 |