summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-07 09:02:51 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-09 19:17:22 +0200
commitbc109a53c722f7b1ce9c3bede906717b4e271496 (patch)
tree924b0542a2dc891aee3cf92086a415fedc462c16 /tests
parent109515e16dfffa6bb34de75c5253b7cbb1f12fa6 (diff)
avcodec/mpegpicture: Move mb_var, mc_mb_var and mb_mean to MpegEncCtx
These tables are only used by encoders and only for the current picture; ergo they need not be put into the picture at all, but rather into the encoder's context. They also don't need to be refcounted, because there is only one owner. In contrast to this, the earlier code refcounts them which incurs unnecessary overhead. These references are not unreferenced in ff_mpeg_unref_picture() (they are kept in order to have something like a buffer pool), so that several buffers are kept at the same time, although only one is needed, thereby wasting memory. The code also propagates references to other pictures not part of the pictures array (namely the copy of the current/next/last picture in the MpegEncContext which get references of their own). These references are not unreferenced in ff_mpeg_unref_picture() (the buffers are probably kept in order to have something like a pool), yet if the current picture is a B-frame, it gets unreferenced at the end of ff_mpv_encode_picture() and its slot in the picture array will therefore be reused the next time; but the copy of the current picture also still has its references and therefore these buffers will be made duplicated in order to make them writable in the next call to ff_mpv_encode_picture(). This is of course unnecessary. Finally, ff_find_unused_picture() is supposed to just return any unused picture and the code is supposed to work with it; yet for the vsynth*-mpeg4-adap tests the result depends upon the content of these buffers; given that this patchset changes the content of these buffers (the initial content is now the state of these buffers after encoding the last frame; before this patch the buffers used came from the last picture that occupied the same slot in the picture array) their ref-files needed to be changed. This points to a bug somewhere (if one removes the initialization, one gets uninitialized reads in adaptive_quantization in ratecontrol.c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/seek/vsynth_lena-mpeg4-adap28
-rw-r--r--tests/ref/vsynth/vsynth1-mpeg4-adap8
-rw-r--r--tests/ref/vsynth/vsynth2-mpeg4-adap8
-rw-r--r--tests/ref/vsynth/vsynth3-mpeg4-adap8
-rw-r--r--tests/ref/vsynth/vsynth_lena-mpeg4-adap8
5 files changed, 30 insertions, 30 deletions
diff --git a/tests/ref/seek/vsynth_lena-mpeg4-adap b/tests/ref/seek/vsynth_lena-mpeg4-adap
index 0611ee4511..fe841ef973 100644
--- a/tests/ref/seek/vsynth_lena-mpeg4-adap
+++ b/tests/ref/seek/vsynth_lena-mpeg4-adap
@@ -2,45 +2,45 @@ ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855
ret: 0 st:-1 flags:0 ts:-1.000000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855
ret: 0 st:-1 flags:1 ts: 1.894167
-ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176
ret: 0 st: 0 flags:0 ts: 0.800000
-ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98220 size: 17063
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 75056 size: 19178
ret:-1 st: 0 flags:1 ts:-0.320000
ret:-1 st:-1 flags:0 ts: 2.576668
ret: 0 st:-1 flags:1 ts: 1.470835
-ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135582 size: 17525
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 118696 size: 20018
ret: 0 st: 0 flags:0 ts: 0.360000
-ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 59446 size: 17261
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 35800 size: 17261
ret:-1 st: 0 flags:1 ts:-0.760000
ret:-1 st:-1 flags:0 ts: 2.153336
ret: 0 st:-1 flags:1 ts: 1.047503
-ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98220 size: 17063
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 75056 size: 19178
ret: 0 st: 0 flags:0 ts:-0.040000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855
ret: 0 st: 0 flags:1 ts: 2.840000
-ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176
ret: 0 st:-1 flags:0 ts: 1.730004
-ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176
ret: 0 st:-1 flags:1 ts: 0.624171
-ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 59446 size: 17261
+ret: 0 st: 0 flags:1 dts: 0.400000 pts: NOPTS pos: 35800 size: 17261
ret: 0 st: 0 flags:0 ts:-0.480000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855
ret: 0 st: 0 flags:1 ts: 2.400000
-ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176
ret: 0 st:-1 flags:0 ts: 1.306672
-ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135582 size: 17525
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 118696 size: 20018
ret: 0 st:-1 flags:1 ts: 0.200839
ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855
ret: 0 st: 0 flags:0 ts:-0.920000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: NOPTS pos: 5652 size: 6855
ret: 0 st: 0 flags:1 ts: 2.000000
-ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 174446 size: 16883
+ret: 0 st: 0 flags:1 dts: 1.840000 pts: NOPTS pos: 161318 size: 19176
ret: 0 st:-1 flags:0 ts: 0.883340
-ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98220 size: 17063
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 75056 size: 19178
ret:-1 st:-1 flags:1 ts:-0.222493
ret:-1 st: 0 flags:0 ts: 2.680000
ret: 0 st: 0 flags:1 ts: 1.560000
-ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 135582 size: 17525
+ret: 0 st: 0 flags:1 dts: 1.360000 pts: NOPTS pos: 118696 size: 20018
ret: 0 st:-1 flags:0 ts: 0.460008
-ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 98220 size: 17063
+ret: 0 st: 0 flags:1 dts: 0.880000 pts: NOPTS pos: 75056 size: 19178
ret:-1 st:-1 flags:1 ts:-0.645825
diff --git a/tests/ref/vsynth/vsynth1-mpeg4-adap b/tests/ref/vsynth/vsynth1-mpeg4-adap
index e6bd6a59bd..67705f0f43 100644
--- a/tests/ref/vsynth/vsynth1-mpeg4-adap
+++ b/tests/ref/vsynth/vsynth1-mpeg4-adap
@@ -1,4 +1,4 @@
-f120f0bf976bb510c5b5305fe7d8159a *tests/data/fate/vsynth1-mpeg4-adap.avi
-403436 tests/data/fate/vsynth1-mpeg4-adap.avi
-fad0b9dc08fe4a95b297af1a7411c1e9 *tests/data/fate/vsynth1-mpeg4-adap.out.rawvideo
-stddev: 14.05 PSNR: 25.17 MAXDIFF: 184 bytes: 7603200/ 7603200
+0f1cbbdc3f9b91f2d9ac3d1fc2cf7d4e *tests/data/fate/vsynth1-mpeg4-adap.avi
+325518 tests/data/fate/vsynth1-mpeg4-adap.avi
+1e6c596f9f491fbf15920ef1bace7fb8 *tests/data/fate/vsynth1-mpeg4-adap.out.rawvideo
+stddev: 14.12 PSNR: 25.13 MAXDIFF: 184 bytes: 7603200/ 7603200
diff --git a/tests/ref/vsynth/vsynth2-mpeg4-adap b/tests/ref/vsynth/vsynth2-mpeg4-adap
index a3223f6363..35b2b6aac9 100644
--- a/tests/ref/vsynth/vsynth2-mpeg4-adap
+++ b/tests/ref/vsynth/vsynth2-mpeg4-adap
@@ -1,4 +1,4 @@
-4bff98da2342836476da817428594403 *tests/data/fate/vsynth2-mpeg4-adap.avi
-213508 tests/data/fate/vsynth2-mpeg4-adap.avi
-0c709f2b81f4593eaa29490332c2cb39 *tests/data/fate/vsynth2-mpeg4-adap.out.rawvideo
-stddev: 4.87 PSNR: 34.36 MAXDIFF: 86 bytes: 7603200/ 7603200
+06a397fe43dab7b6cf56870410fbbbaf *tests/data/fate/vsynth2-mpeg4-adap.avi
+203000 tests/data/fate/vsynth2-mpeg4-adap.avi
+686565d42d8ba5aea790824b04fa0a18 *tests/data/fate/vsynth2-mpeg4-adap.out.rawvideo
+stddev: 4.55 PSNR: 34.95 MAXDIFF: 84 bytes: 7603200/ 7603200
diff --git a/tests/ref/vsynth/vsynth3-mpeg4-adap b/tests/ref/vsynth/vsynth3-mpeg4-adap
index 0942f83015..6386f13466 100644
--- a/tests/ref/vsynth/vsynth3-mpeg4-adap
+++ b/tests/ref/vsynth/vsynth3-mpeg4-adap
@@ -1,4 +1,4 @@
-c16e5c2436ca9953517eadba562768e9 *tests/data/fate/vsynth3-mpeg4-adap.avi
-43706 tests/data/fate/vsynth3-mpeg4-adap.avi
-b42b614e19e7c4859fca1af6d4e36eae *tests/data/fate/vsynth3-mpeg4-adap.out.rawvideo
-stddev: 5.48 PSNR: 33.34 MAXDIFF: 53 bytes: 86700/ 86700
+6b2f641f2e68b11b992fd6ba1ed66a21 *tests/data/fate/vsynth3-mpeg4-adap.avi
+41012 tests/data/fate/vsynth3-mpeg4-adap.avi
+3483a2032cb02c3a37f5e43b128e59ed *tests/data/fate/vsynth3-mpeg4-adap.out.rawvideo
+stddev: 5.79 PSNR: 32.87 MAXDIFF: 49 bytes: 86700/ 86700
diff --git a/tests/ref/vsynth/vsynth_lena-mpeg4-adap b/tests/ref/vsynth/vsynth_lena-mpeg4-adap
index 10af80b397..91edafe9b0 100644
--- a/tests/ref/vsynth/vsynth_lena-mpeg4-adap
+++ b/tests/ref/vsynth/vsynth_lena-mpeg4-adap
@@ -1,4 +1,4 @@
-c6108621b1202d32dac68b1944c5b8c2 *tests/data/fate/vsynth_lena-mpeg4-adap.avi
-198500 tests/data/fate/vsynth_lena-mpeg4-adap.avi
-87b6dbe98d276137fceaae2fa672eced *tests/data/fate/vsynth_lena-mpeg4-adap.out.rawvideo
-stddev: 3.75 PSNR: 36.65 MAXDIFF: 71 bytes: 7603200/ 7603200
+633da125f46391eef33bb031cd728f4b *tests/data/fate/vsynth_lena-mpeg4-adap.avi
+187598 tests/data/fate/vsynth_lena-mpeg4-adap.avi
+21312bfcb28c40299fb27a5b03477f8c *tests/data/fate/vsynth_lena-mpeg4-adap.out.rawvideo
+stddev: 3.63 PSNR: 36.92 MAXDIFF: 71 bytes: 7603200/ 7603200