Skip to content

Commit

Permalink
clear trailing bits in rlgr1/3 old and new
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorg71 committed Apr 2, 2017
1 parent a80938d commit 64add73
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/rfx_bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef struct _RFX_BITSTREAM RFX_BITSTREAM;
b = nbits; \
if (b > bs.bits_left) \
b = bs.bits_left; \
bs.buffer[bs.byte_pos] &= ~(((1 << b) - 1) << (bs.bits_left - b)); \
bs.buffer[bs.byte_pos] &= ~((1 << bs.bits_left) - 1); \
bs.buffer[bs.byte_pos] |= ((bits >> (nbits - b)) & ((1 << b) - 1)) << (bs.bits_left - b); \
bs.bits_left -= b; \
nbits -= b; \
Expand Down
1 change: 0 additions & 1 deletion src/rfxencode_diff_rlgr1.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ rfx_encode_diff_rlgr1(sint16 *coef, uint8 *cdata, int cdata_size)
if (bit_count > 0)
{
bits <<= 8 - bit_count;
bits |= ((1 << (8 - bit_count)) - 1) & *cdata;
*cdata = bits;
cdata++;
bit_count = 0;
Expand Down
1 change: 0 additions & 1 deletion src/rfxencode_diff_rlgr3.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ rfx_encode_diff_rlgr3(sint16 *coef, uint8 *cdata, int cdata_size)
if (bit_count > 0)
{
bits <<= 8 - bit_count;
bits |= ((1 << (8 - bit_count)) - 1) & *cdata;
*cdata = bits;
cdata++;
bit_count = 0;
Expand Down

0 comments on commit 64add73

Please sign in to comment.