Commit 5cd21693 authored by James Almer's avatar James Almer

wavpackenc: use put_sbits()

Reviewed-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent df7c2b2f
......@@ -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);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment