aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdec_hcr_bit.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-12-13 05:45:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-12-13 05:45:20 +0000
commitc75797cfaa5199247c53cf40dcc3329e6cdf3cce (patch)
tree35b2bf867a84f3a12f791c43de60e55c7e77bfb4 /libAACdec/src/aacdec_hcr_bit.cpp
parentcdaf85d874abe9b772b2a3bbef7fadee9199bdc3 (diff)
parent20c336953febeabbf6deeb38f479ec7642b5a69b (diff)
downloadfdk-aac-c75797cfaa5199247c53cf40dcc3329e6cdf3cce.tar.gz
fdk-aac-c75797cfaa5199247c53cf40dcc3329e6cdf3cce.tar.bz2
fdk-aac-c75797cfaa5199247c53cf40dcc3329e6cdf3cce.zip
Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master"
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);
}