avcodec/wavpackenc: use put_sbits
authorJames Almer <jamrial@gmail.com>
Mon, 18 Jan 2016 21:38:18 +0000 (18:38 -0300)
committerJames Almer <jamrial@gmail.com>
Wed, 20 Jan 2016 19:41:19 +0000 (16:41 -0300)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/wavpackenc.c

index 98a011f..979b921 100644 (file)
@@ -2216,8 +2216,7 @@ static void pack_float_sample(WavPackEncodeContext *s, int32_t *sample)
         }
     } else if (shift_count) {
         if (s->float_flags & FLOAT_SHIFT_SENT) {
-            int32_t data = get_mantissa(*sample) & ((1 << shift_count) - 1);
-            put_bits(pb, shift_count, data);
+            put_sbits(pb, shift_count, get_mantissa(*sample));
         } else if (s->float_flags & FLOAT_SHIFT_SAME) {
             put_bits(pb, 1, get_mantissa(*sample) & 1);
         }