avcodec/prosumer: Simplify bit juggling of the c variable in decompress()
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 31 Oct 2018 09:19:43 +0000 (10:19 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 2 Nov 2018 22:46:31 +0000 (23:46 +0100)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/prosumer.c

index 3125636..505de71 100644 (file)
@@ -69,15 +69,13 @@ static int decompress(GetByteContext *gb, int size, PutByteContext *pb, const ui
             }
             c = b >> 16;
             if (c & 0xFF00u) {
             }
             c = b >> 16;
             if (c & 0xFF00u) {
-                c = (((c >> 8) & 0xFFu) | (c & 0xFF00)) & 0xF00F;
                 fill = lut[2 * idx + 1];
                 fill = lut[2 * idx + 1];
-                if ((c & 0xFF00u) == 0x1000) {
+                if ((c & 0xF000u) == 0x1000) {
                     bytestream2_put_le16(pb, fill);
                     bytestream2_put_le16(pb, fill);
-                    c &= 0xFFFF00FFu;
                 } else {
                     bytestream2_put_le32(pb, fill);
                 } else {
                     bytestream2_put_le32(pb, fill);
-                    c &= 0xFFFF00FFu;
                 }
                 }
+                c = (c >> 8) & 0x0Fu;
             }
             while (c) {
                 a <<= 4;
             }
             while (c) {
                 a <<= 4;