diff options
author | Martin Storsjo <martin@martin.st> | 2019-01-21 15:54:25 +0200 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-01-21 15:54:25 +0200 |
commit | 02103fd6308a40c58013d8ec8610ad8a71075aca (patch) | |
tree | 77e30d296d5cec1f24b5c0e03b49f197d5bf080e /libAACdec/src/aacdec_hcr_bit.cpp | |
parent | 2326faaf8f2cdf2c3a9108ccdaf1d7551aec543e (diff) | |
parent | ed56e77acb1ca4524bf49d9cdec7d11a51f5134d (diff) | |
download | fdk-aac-02103fd6308a40c58013d8ec8610ad8a71075aca.tar.gz fdk-aac-02103fd6308a40c58013d8ec8610ad8a71075aca.tar.bz2 fdk-aac-02103fd6308a40c58013d8ec8610ad8a71075aca.zip |
Merge remote-tracking branch 'aosp/master'
Diffstat (limited to 'libAACdec/src/aacdec_hcr_bit.cpp')
-rw-r--r-- | libAACdec/src/aacdec_hcr_bit.cpp | 7 |
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); } |