[FFmpeg-cvslog] avcodec/prosumer: Simplify bit juggling of the c variable in decompress()

Michael Niedermayer git at videolan.org
Sun Nov 4 21:57:57 EET 2018


ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Wed Oct 31 10:19:43 2018 +0100| [2f04b78b95464c46468c1d8c252f2360ffe7c183] | committer: Michael Niedermayer

avcodec/prosumer: Simplify bit juggling of the c variable in decompress()

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 66425add270cd262a22c0fdaf6aad09a0db6f8c0)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/prosumer.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

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



More information about the ffmpeg-cvslog mailing list