]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mpc8: Unobfuscate sign-extension
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 29 Oct 2020 22:58:51 +0000 (23:58 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 3 Nov 2020 15:21:10 +0000 (16:21 +0100)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/mpc8.c

index 03838a9351c8ffbebd0c2f25a1bbe6cc6fc0ac3c..631bac27532d4435c81daeb7aca86a656828c66b 100644 (file)
@@ -384,7 +384,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
                 for(j = 0; j < SAMPLES_PER_BAND; j += 2){
                     t = get_vlc2(gb, q3_vlc[res - 3].table, MPC8_Q3_BITS, 2) + q3_offsets[res - 3];
                     c->Q[ch][off + j + 1] = t >> 4;
-                    c->Q[ch][off + j + 0] = (t & 8) ? (t & 0xF) - 16 : (t & 0xF);
+                    c->Q[ch][off + j + 0] = sign_extend(t, 4);
                 }
                 break;
             case 5: