From 2d24fce3f8b5a54e77fbea4f917d038ccc829035 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 28 Mar 2017 00:27:27 -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;