[FFmpeg-cvslog] avcodec/gdv: Simplify first inner loop in rescale()

Michael Niedermayer git at videolan.org
Fri Sep 28 02:29:29 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Aug  5 16:58:35 2018 +0200| [d021729efc1fe3480326c29f7dbb8d0e56ea4c71] | committer: Michael Niedermayer

avcodec/gdv: Simplify first inner loop in rescale()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/gdv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c
index 1efc64b1dc..595d8ff4e4 100644
--- a/libavcodec/gdv.c
+++ b/libavcodec/gdv.c
@@ -85,8 +85,7 @@ static void rescale(GDVContext *gdv, uint8_t *dst, int w, int h, int scale_v, in
             int y = h - j - 1;
             uint8_t *dst1 = dst + PREAMBLE_SIZE + y * w;
             uint8_t *src1 = dst + PREAMBLE_SIZE + (y>>!!gdv->scale_h) * (w>>1);
-            for (i = 0; i < w; i++) {
-                int x = w - i - 1;
+            for (x = w - 1; x >= 0; x--) {
                 dst1[x] = src1[(x>>1)];
             }
         }



More information about the ffmpeg-cvslog mailing list