proresenc_anatoliy: use put_sbits()
Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
778bac2788
commit
d8c52f5d04
@ -156,8 +156,7 @@ typedef struct {
|
||||
|
||||
static void encode_codeword(PutBitContext *pb, int val, int codebook)
|
||||
{
|
||||
unsigned int rice_order, exp_order, switch_bits, first_exp, exp, zeros,
|
||||
mask;
|
||||
unsigned int rice_order, exp_order, switch_bits, first_exp, exp, zeros;
|
||||
|
||||
/* number of bits to switch between rice and exp golomb */
|
||||
switch_bits = codebook & 3;
|
||||
@ -174,10 +173,9 @@ static void encode_codeword(PutBitContext *pb, int val, int codebook)
|
||||
put_bits(pb, zeros, 0);
|
||||
put_bits(pb, exp + 1, val);
|
||||
} else if (rice_order) {
|
||||
mask = (1 << rice_order) - 1;
|
||||
put_bits(pb, (val >> rice_order), 0);
|
||||
put_bits(pb, 1, 1);
|
||||
put_bits(pb, rice_order, val & mask);
|
||||
put_sbits(pb, rice_order, val);
|
||||
} else {
|
||||
put_bits(pb, val, 0);
|
||||
put_bits(pb, 1, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user