This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 6e839cf771 avcodec/mpegvideo_enc: set noise-shaping weights for all 
4:4:4 blocks
6e839cf771 is described below

commit 6e839cf771424ec15c05e6d46401a4b13ebd8911
Author:     Baptiste Coudurier <[email protected]>
AuthorDate: Mon Nov 23 14:31:32 2026 -0800
Commit:     Baptiste Coudurier <[email protected]>
CommitDate: Tue Nov 24 17:42:36 2026 +0000

    avcodec/mpegvideo_enc: set noise-shaping weights for all 4:4:4 blocks
    
    Blocks 6/7 used the 4:2:2 position and 8-11 were left uninitialized.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Baptiste Coudurier <[email protected]>
---
 libavcodec/mpegvideo_enc.c          | 9 ++++++++-
 tests/fate/ffmpeg.mak               | 4 ++++
 tests/ref/fate/ffmpeg-mjpeg-444-qns | 7 +++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 0ada755264..d027b49799 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2543,13 +2543,20 @@ static av_always_inline void 
encode_mb_internal(MPVEncContext *const s,
             get_visual_weight(weight[4], ptr_cb                , wrap_c);
         if (!skip_dct[5])
             get_visual_weight(weight[5], ptr_cr                , wrap_c);
-        if (!chroma_y_shift) { /* 422 */
+        if (chroma_format == CHROMA_422) {
             if (!skip_dct[6])
                 get_visual_weight(weight[6], ptr_cb + uv_dct_offset,
                                   wrap_c);
             if (!skip_dct[7])
                 get_visual_weight(weight[7], ptr_cr + uv_dct_offset,
                                   wrap_c);
+        } else if (chroma_format == CHROMA_444) {
+            for (i = 6; i < 12; i++) {
+                const uint8_t *ptr = i & 1 ? ptr_cr : ptr_cb;
+                if (!skip_dct[i])
+                    get_visual_weight(weight[i], ptr + (i >= 8) * 
uv_dct_offset +
+                                      ((i >> 1) & 1) * 8, wrap_c);
+            }
         }
         memcpy(orig[0], s->block[0], sizeof(int16_t) * 64 * mb_block_count);
     }
diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 9a21550341..dca806bb98 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -554,6 +554,10 @@ FATE_SAMPLES_FFMPEG-$(call FRAMECRC, MOV, HEVC, 
HEVC_PARSER) += fate-ffmpeg-heif
 fate-ffmpeg-heif-merge-filtergraph: CMD = framecrc -i 
$(TARGET_SAMPLES)/heif-conformance/C007.heic -filter_complex 
"sws_flags=+accurate_rnd+bitexact\;[0:g:0]scale=w=1280:h=720[out]" -map "[out]"
 FATE_SAMPLES_FFMPEG-$(call FRAMECRC, MOV, HEVC, HEVC_PARSER SCALE_FILTER) += 
fate-ffmpeg-heif-merge-filtergraph
 
+# Exercise noise-shaping weights for all twelve 4:4:4 blocks.
+FATE_FFMPEG-$(call ALLYES, TESTSRC2_FILTER FORMAT_FILTER NOISE_FILTER 
LAVFI_INDEV WRAPPED_AVFRAME_DECODER MJPEG_ENCODER FRAMECRC_MUXER PIPE_PROTOCOL) 
+= fate-ffmpeg-mjpeg-444-qns
+fate-ffmpeg-mjpeg-444-qns: CMD = framecrc -cpuflags 0 -f lavfi -i 
"testsrc2=s=32x32,format=yuvj444p,noise=alls=100:allf=t+u" -flags +bitexact 
-dct fastint -idct simple -threads 1 -c:v mjpeg -huffman default -q:v 3 
-quantizer_noise_shaping 1 -frames:v 2
+
 # alpha merging
 fate-ffmpeg-heif-merge-alpha: CMD = framecrc -auto_conversion_filters -i 
$(TARGET_SAMPLES)/heif/alpha.heic
 FATE_SAMPLES_FFMPEG-$(call FRAMECRC, MOV, HEVC, HEVC_PARSER SCALE_FILTER) += 
fate-ffmpeg-heif-merge-alpha
diff --git a/tests/ref/fate/ffmpeg-mjpeg-444-qns 
b/tests/ref/fate/ffmpeg-mjpeg-444-qns
new file mode 100644
index 0000000000..bb9bb3c6cc
--- /dev/null
+++ b/tests/ref/fate/ffmpeg-mjpeg-444-qns
@@ -0,0 +1,7 @@
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: mjpeg
+#dimensions 0: 32x32
+#sar 0: 1/1
+0,          0,          0,        1,     1957, 0xc0f86f6f, S=1, Quality stats, 
       8, 0x031b0064
+0,          1,          1,        1,     1990, 0xe8208929, S=1, Quality stats, 
       8, 0x031b0064

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to