PR #26302 opened by SATVIKsynopsis
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26302
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26302.patch

Signed-off-by: Satvik Upadhyaya <[email protected]>

# Summary of changes

The MJPEG encoder's `force_duplicated_matrix` option had no `FATE` coverage. so 
this pr adds a vsynth test using the same options as the plain `mjpeg test plus 
-force_duplicated_matrix 1`.

the output grows by about 65 bytes per frame as one extra quant table and 
decodes identically to the plain mjpeg test as expected. checked and verified 
on macos arm64 and linux x86 64.

No new FATE samples are needed.

```fate-samples
```


>From 62b5248508761f66f4c20d56efd4a130a0d26e87 Mon Sep 17 00:00:00 2001
From: Satvik Upadhyaya <[email protected]>
Date: Mon, 23 Nov 2026 20:34:16 +0530
Subject: [PATCH] tests/fate/vcodec: added mjpeg force_duplicated_matrix test

Signed-off-by: Satvik Upadhyaya <[email protected]>
---
 tests/fate/vcodec.mak                        | 3 ++-
 tests/ref/vsynth/vsynth1-mjpeg-dupmatrix     | 4 ++++
 tests/ref/vsynth/vsynth2-mjpeg-dupmatrix     | 4 ++++
 tests/ref/vsynth/vsynth3-mjpeg-dupmatrix     | 4 ++++
 tests/ref/vsynth/vsynth_lena-mjpeg-dupmatrix | 4 ++++
 5 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/vsynth/vsynth1-mjpeg-dupmatrix
 create mode 100644 tests/ref/vsynth/vsynth2-mjpeg-dupmatrix
 create mode 100644 tests/ref/vsynth/vsynth3-mjpeg-dupmatrix
 create mode 100644 tests/ref/vsynth/vsynth_lena-mjpeg-dupmatrix

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index 22757ef6ac0..0f9857a89c5 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -251,7 +251,7 @@ fate-mjpeg-slice-rst: CMD = framecrc -lavfi 
testsrc2=size=16x160:rate=1:duration
                                   -c:v mjpeg -dct int -huffman default 
-threads 1 -slices 2
 FATE_FFMPEG += $(FATE_MJPEG_RST-yes)
 
-FATE_VCODEC_SCALE-$(call ENCDEC, MJPEG, AVI) += mjpeg mjpeg-422 mjpeg-444 
mjpeg-trell mjpeg-huffman mjpeg-trell-huffman mjpeg-dcprec
+FATE_VCODEC_SCALE-$(call ENCDEC, MJPEG, AVI) += mjpeg mjpeg-422 mjpeg-444 
mjpeg-trell mjpeg-huffman mjpeg-trell-huffman mjpeg-dcprec mjpeg-dupmatrix
 fate-vsynth%-mjpeg:                   ENCOPTS = -qscale 9 -pix_fmt yuvj420p 
-huffman default -threads 5 -thread_type slice
 fate-vsynth%-mjpeg-422:               ENCOPTS = -qscale 9 -pix_fmt yuvj422p
 fate-vsynth%-mjpeg-444:               ENCOPTS = -qscale 9 -pix_fmt yuvj444p
@@ -259,6 +259,7 @@ fate-vsynth%-mjpeg-trell:             ENCOPTS = -qscale 9 
-pix_fmt yuvj420p -tre
 fate-vsynth%-mjpeg-huffman:           ENCOPTS = -qscale 9 -pix_fmt yuvj420p 
-huffman optimal
 fate-vsynth%-mjpeg-trell-huffman:     ENCOPTS = -qscale 9 -pix_fmt yuvj420p 
-trellis 1 -huffman optimal
 fate-vsynth%-mjpeg-dcprec:            ENCOPTS = -qscale 9 -pix_fmt yuvj420p 
-intra_dc_precision 3 -huffman default -threads 5 -thread_type slice
+fate-vsynth%-mjpeg-dupmatrix:         ENCOPTS = -qscale 9 -pix_fmt yuvj420p 
-huffman default -threads 5 -thread_type slice -force_duplicated_matrix 1
 
 FATE_VCODEC-$(call ENCDEC, MPEG1VIDEO, MPEG1VIDEO MPEGVIDEO) += mpeg1 mpeg1b
 fate-vsynth%-mpeg1:              FMT     = mpeg1video
diff --git a/tests/ref/vsynth/vsynth1-mjpeg-dupmatrix 
b/tests/ref/vsynth/vsynth1-mjpeg-dupmatrix
new file mode 100644
index 00000000000..3d23d878f40
--- /dev/null
+++ b/tests/ref/vsynth/vsynth1-mjpeg-dupmatrix
@@ -0,0 +1,4 @@
+47400aed2806b4941ca4104c9a33859a *tests/data/fate/vsynth1-mjpeg-dupmatrix.avi
+1521076 tests/data/fate/vsynth1-mjpeg-dupmatrix.avi
+b4140bb5b3e8d8efd4a2a198bef821f4 
*tests/data/fate/vsynth1-mjpeg-dupmatrix.out.rawvideo
+stddev:    7.87 PSNR: 30.21 MAXDIFF:   63 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg-dupmatrix 
b/tests/ref/vsynth/vsynth2-mjpeg-dupmatrix
new file mode 100644
index 00000000000..89befa60e3d
--- /dev/null
+++ b/tests/ref/vsynth/vsynth2-mjpeg-dupmatrix
@@ -0,0 +1,4 @@
+33161f02ce0ed3f5cefa1617a98bb391 *tests/data/fate/vsynth2-mjpeg-dupmatrix.avi
+835950 tests/data/fate/vsynth2-mjpeg-dupmatrix.avi
+2b8c59c59e33d6ca7c85d31c5eeab7be 
*tests/data/fate/vsynth2-mjpeg-dupmatrix.out.rawvideo
+stddev:    4.87 PSNR: 34.37 MAXDIFF:   55 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-mjpeg-dupmatrix 
b/tests/ref/vsynth/vsynth3-mjpeg-dupmatrix
new file mode 100644
index 00000000000..9ea99ce2bf9
--- /dev/null
+++ b/tests/ref/vsynth/vsynth3-mjpeg-dupmatrix
@@ -0,0 +1,4 @@
+3df706d7fad0a049452a991cc8c51aae *tests/data/fate/vsynth3-mjpeg-dupmatrix.avi
+68582 tests/data/fate/vsynth3-mjpeg-dupmatrix.avi
+574dfa77aca2f6b2c4acedc8a3706dd0 
*tests/data/fate/vsynth3-mjpeg-dupmatrix.out.rawvideo
+stddev:    8.60 PSNR: 29.43 MAXDIFF:   58 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg-dupmatrix 
b/tests/ref/vsynth/vsynth_lena-mjpeg-dupmatrix
new file mode 100644
index 00000000000..5ec7f7ddccf
--- /dev/null
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg-dupmatrix
@@ -0,0 +1,4 @@
+3e5335a968030478061e822a43d01a22 
*tests/data/fate/vsynth_lena-mjpeg-dupmatrix.avi
+679282 tests/data/fate/vsynth_lena-mjpeg-dupmatrix.avi
+9d4bd90e9abfa18192383b4adc23c8d4 
*tests/data/fate/vsynth_lena-mjpeg-dupmatrix.out.rawvideo
+stddev:    4.32 PSNR: 35.40 MAXDIFF:   49 bytes:  7603200/  7603200
-- 
2.54.1

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to