aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdec_hcr_bit.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-09-10 23:21:17 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-09-10 23:21:17 +0000
commitb97c2a93f288df43dd7cc0c45640509a17dddb18 (patch)
tree66fe1fc4eb2c283bcebf91e53f365c6b22f1b47c /libAACdec/src/aacdec_hcr_bit.cpp
parentf19e863cce96cc1e5f4ad7ce512810d5a2843ea6 (diff)
parent9744e41c40598c6a0b74440f3b5be63f9f3708a5 (diff)
downloadfdk-aac-b97c2a93f288df43dd7cc0c45640509a17dddb18.tar.gz
fdk-aac-b97c2a93f288df43dd7cc0c45640509a17dddb18.tar.bz2
fdk-aac-b97c2a93f288df43dd7cc0c45640509a17dddb18.zip
Merge cherrypicks of [4986743, 4986744, 4987539, 4987168, 4986376, 4986377, 4986378, 4986889, 4986745, 4986746, 4986747, 4986748, 4986749, 4986750, 4986773, 4987169, 4987170, 4987611, 4987631, 4987632, 4987633, 4987634, 4986890, 4987612, 4987651, 4987598, 4987613, 4987614, 4987615, 4987599, 4986379, 4986380, 4987652, 4987653, 4987691, 4986774] into pi-qpr1-release
Change-Id: Ib805bf06d51e2a7e6f0d9bf2676dc1f21b6cbb9e
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);
}