avcodec/gdv: Simplify first inner loop in rescale()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 5 Aug 2018 14:58:35 +0000 (16:58 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 27 Sep 2018 23:25:17 +0000 (01:25 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/gdv.c

index 1efc64b..595d8ff 100644 (file)
@@ -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)];
             }
         }