ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Tue Jun 11 20:38:42 2024 +0200| [f694db87cad98720957eef22ac5c02b825cc13cc] | 
committer: Andreas Rheinhardt

avcodec/mpegvideo: Join loops when initializing ScanTable

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f694db87cad98720957eef22ac5c02b825cc13cc
---

 libavcodec/mpegvideo.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 6df669b744..b9a0469335 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -296,20 +296,13 @@ static av_cold void dsp_init(MpegEncContext *s)
 av_cold void ff_init_scantable(const uint8_t *permutation, ScanTable *st,
                                const uint8_t *src_scantable)
 {
-    int end;
-
     st->scantable = src_scantable;
 
-    for (int i = 0; i < 64; i++) {
+    for (int i = 0, end = -1; i < 64; i++) {
         int j = src_scantable[i];
         st->permutated[i] = permutation[j];
-    }
-
-    end = -1;
-    for (int i = 0; i < 64; i++) {
-        int j = st->permutated[i];
-        if (j > end)
-            end = j;
+        if (permutation[j] > end)
+            end = permutation[j];
         st->raster_end[i] = end;
     }
 }

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to