diff options
author | James Almer <jamrial@gmail.com> | 2015-04-18 18:06:27 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2015-04-18 18:07:54 -0300 |
commit | 5cd21693440663236fc56a0357a5272740bf2982 (patch) | |
tree | ca3a73e5d57ba0f51680a6249b887f2225988c75 /libavcodec/wavpackenc.c | |
parent | df7c2b2f1b75d7043d1f61a896bcc25a11ae1fbb (diff) | |
download | ffmpeg-5cd21693440663236fc56a0357a5272740bf2982.tar.gz |
wavpackenc: use put_sbits()
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/wavpackenc.c')
-rw-r--r-- | libavcodec/wavpackenc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index c1749505e7..87f1445738 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -2143,7 +2143,6 @@ static void pack_int32(WavPackEncodeContext *s, int nb_samples) { const int sent_bits = s->int32_sent_bits; - int32_t value, mask = (1 << sent_bits) - 1; PutBitContext *pb = &s->pb; int i, pre_shift; @@ -2154,15 +2153,12 @@ static void pack_int32(WavPackEncodeContext *s, if (s->flags & WV_MONO_DATA) { for (i = 0; i < nb_samples; i++) { - value = (samples_l[i] >> pre_shift) & mask; - put_bits(pb, sent_bits, value); + put_sbits(pb, sent_bits, samples_l[i] >> pre_shift); } } else { for (i = 0; i < nb_samples; i++) { - value = (samples_l[i] >> pre_shift) & mask; - put_bits(pb, sent_bits, value); - value = (samples_r[i] >> pre_shift) & mask; - put_bits(pb, sent_bits, value); + put_sbits(pb, sent_bits, samples_l[i] >> pre_shift); + put_sbits(pb, sent_bits, samples_r[i] >> pre_shift); } } } |