aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdec_hcr_bit.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-03-04 15:52:49 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-03-04 15:52:49 +0100
commitc7f9c2d1d996ac8f67927e9c86b907196ca6a72d (patch)
treea2dcc8e8cd3df5628f43242243fd475562ea4082 /libAACdec/src/aacdec_hcr_bit.cpp
parentf665ac21b355ebc74c951c09b4774936a74fdca0 (diff)
parent95858d7bd36f19bde4a9595e2bd68f195215b164 (diff)
downloadfdk-aac-c7f9c2d1d996ac8f67927e9c86b907196ca6a72d.tar.gz
fdk-aac-c7f9c2d1d996ac8f67927e9c86b907196ca6a72d.tar.bz2
fdk-aac-c7f9c2d1d996ac8f67927e9c86b907196ca6a72d.zip
Merge remote-tracking branch 'mstorjo/master' into dabplus2
Diffstat (limited to 'libAACdec/src/aacdec_hcr_bit.cpp')
-rw-r--r--libAACdec/src/aacdec_hcr_bit.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libAACdec/src/aacdec_hcr_bit.cpp b/libAACdec/src/aacdec_hcr_bit.cpp
index a53ef16..0198659 100644
--- a/libAACdec/src/aacdec_hcr_bit.cpp
+++ b/libAACdec/src/aacdec_hcr_bit.cpp
@@ -132,13 +132,14 @@ read direction. It is called very often, therefore it makes sense to inline it
return: - bit from bitstream
--------------------------------------------------------------------------------------------
*/
-UINT HcrGetABitFromBitstream(HANDLE_FDK_BITSTREAM bs, INT *pLeftStartOfSegment,
+UINT HcrGetABitFromBitstream(HANDLE_FDK_BITSTREAM bs, const INT bsAnchor,
+ INT *pLeftStartOfSegment,
INT *pRightStartOfSegment, UCHAR readDirection) {
UINT bit;
INT readBitOffset;
if (readDirection == FROM_LEFT_TO_RIGHT) {
- readBitOffset = *pLeftStartOfSegment - FDKgetBitCnt(bs);
+ readBitOffset = (INT)FDKgetValidBits(bs) - bsAnchor + *pLeftStartOfSegment;
if (readBitOffset) {
FDKpushBiDirectional(bs, readBitOffset);
}
@@ -147,7 +148,7 @@ UINT HcrGetABitFromBitstream(HANDLE_FDK_BITSTREAM bs, INT *pLeftStartOfSegment,
*pLeftStartOfSegment += 1;
} else {
- readBitOffset = *pRightStartOfSegment - FDKgetBitCnt(bs);
+ readBitOffset = (INT)FDKgetValidBits(bs) - bsAnchor + *pRightStartOfSegment;
if (readBitOffset) {
FDKpushBiDirectional(bs, readBitOffset);
}