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

Git pushed a commit to branch master
in repository ffmpeg.

commit 3783b8f5e1a3ee6f046fa6d3b763f19a6cba8fb3
Author:     Ramiro Polla <[email protected]>
AuthorDate: Tue Sep 23 23:28:49 2025 +0200
Commit:     Ramiro Polla <[email protected]>
CommitDate: Fri Feb 20 16:32:10 2026 +0100

    avcodec/mjpegdec: move vpred initialization out of loop in 
ljpeg_decode_rgb_scan()
    
    The initialization code was only being run when mb_y was 0, so it could
    just as well be moved out of the loop.
    
    I haven't been able to find a bayer sample that has restart markers to
    check whether vpred should be reinitialized at every restart. It would
    seem logical that it should, but I have left this out until we find a
    sample that does have restart markers.
---
 libavcodec/mjpegdec.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index f1402fe74e..0d4c5cabd1 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1143,8 +1143,8 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s)
 
     s->restart_count = s->restart_interval;
 
-    if (s->restart_interval == 0)
-        s->restart_interval = INT_MAX;
+    for (i = 0; i < 6; i++)
+        vpred[i] = 1 << (s->bits-1);
 
     if (s->bayer)
         width = s->mb_width / nb_components; /* Interleaved, width stored is 
the total so need to divide */
@@ -1169,11 +1169,6 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s)
         for (i = 0; i < 4; i++)
             top[i] = left[i] = topleft[i] = buffer[0][i];
 
-        if ((mb_y * s->width) % s->restart_interval == 0) {
-            for (i = 0; i < 6; i++)
-                vpred[i] = 1 << (s->bits-1);
-        }
-
         for (mb_x = 0; mb_x < width; mb_x++) {
             int modified_predictor = predictor;
 

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

Reply via email to