avcodec/m101: Simplify if() condition
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 7 May 2016 01:38:13 +0000 (03:38 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 7 May 2016 02:42:52 +0000 (04:42 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/m101.c

index 93b2417..2b9b8b8 100644 (file)
@@ -88,12 +88,12 @@ static int m101_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
                 const uint8_t *buf_src = buf + src_y*stride + 40*block;
                 for (x = 0; x < 16 && x + 16*block < avctx->width; x++) {
                     int xd = x + 16*block;
                 const uint8_t *buf_src = buf + src_y*stride + 40*block;
                 for (x = 0; x < 16 && x + 16*block < avctx->width; x++) {
                     int xd = x + 16*block;
-                    if (!(x&1)) {
+                    if (x&1) {
+                        luma [xd] = (4*buf_src[2*x + 0]) + ((buf_src[32 + (x>>1)]>>4)&3);
+                    } else {
                         luma [xd] = (4*buf_src[2*x + 0]) +  (buf_src[32 + (x>>1)]    &3);
                         cb[xd>>1] = (4*buf_src[2*x + 1]) + ((buf_src[32 + (x>>1)]>>2)&3);
                         cr[xd>>1] = (4*buf_src[2*x + 3]) +  (buf_src[32 + (x>>1)]>>6);
                         luma [xd] = (4*buf_src[2*x + 0]) +  (buf_src[32 + (x>>1)]    &3);
                         cb[xd>>1] = (4*buf_src[2*x + 1]) + ((buf_src[32 + (x>>1)]>>2)&3);
                         cr[xd>>1] = (4*buf_src[2*x + 3]) +  (buf_src[32 + (x>>1)]>>6);
-                    } else {
-                        luma [xd] = (4*buf_src[2*x + 0]) + ((buf_src[32 + (x>>1)]>>4)&3);
                     }
                 }
             }
                     }
                 }
             }