From f509a34cef01de8c0f2d3cd332023013143c9bfc Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Mon, 27 Mar 2017 23:58:17 -0700 Subject: [PATCH] change diff_rlgr1/3 to match rlgr1/3 on ending bits --- src/rfxencode_diff_rlgr1.c | 1 + src/rfxencode_diff_rlgr3.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/rfxencode_diff_rlgr1.c b/src/rfxencode_diff_rlgr1.c index cd09f18..de107df 100644 --- a/src/rfxencode_diff_rlgr1.c +++ b/src/rfxencode_diff_rlgr1.c @@ -240,6 +240,7 @@ 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; diff --git a/src/rfxencode_diff_rlgr3.c b/src/rfxencode_diff_rlgr3.c index 0b68db3..1c275dd 100644 --- a/src/rfxencode_diff_rlgr3.c +++ b/src/rfxencode_diff_rlgr3.c @@ -277,6 +277,7 @@ 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;