aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdec_hcr_bit.cpp
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2018-12-10 10:04:51 -0800
committerXin Li <delphij@google.com>2018-12-11 20:26:37 +0000
commitb857efbb106c62241879414628408556a55c852f (patch)
tree558cec2d4bf125448aeac1ccf5c5cec12cde5b75 /libAACdec/src/aacdec_hcr_bit.cpp
parent6e4fe2e06bc33ceb9eddde6e628ea42e7ee3d130 (diff)
parent33acbd97b67a3c740f7b54fae2ce127803b70c20 (diff)
downloadfdk-aac-b857efbb106c62241879414628408556a55c852f.tar.gz
fdk-aac-b857efbb106c62241879414628408556a55c852f.tar.bz2
fdk-aac-b857efbb106c62241879414628408556a55c852f.zip
DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master
Bug: 120502534 Change-Id: I4c81feb609ac0590877ce923099d3ae63577857d
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);
}