aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdecoder.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-10-17 03:11:49 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-10-17 03:11:49 +0000
commit56b78e9be81bd98878772b46510c771a5036b70d (patch)
tree8b52c5f90cb1e600434cb98198025c7b2afa37b6 /libAACdec/src/aacdecoder.cpp
parentdcf27337e1865276b5cf73dc42019b48b5687372 (diff)
parent2152ae1a5ef0511e0b38a981745eb910f2af9bca (diff)
downloadfdk-aac-56b78e9be81bd98878772b46510c771a5036b70d.tar.gz
fdk-aac-56b78e9be81bd98878772b46510c771a5036b70d.tar.bz2
fdk-aac-56b78e9be81bd98878772b46510c771a5036b70d.zip
Snap for 5945950 from 2152ae1a5ef0511e0b38a981745eb910f2af9bca to rvc-release
Change-Id: I4945162a10785a18df685897114d3715d75e807d
Diffstat (limited to 'libAACdec/src/aacdecoder.cpp')
-rw-r--r--libAACdec/src/aacdecoder.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index b15fc80..6b5a86c 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -3388,7 +3388,8 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
* LR) */
if ((aacChannels == 2) && bsPseudoLr) {
int i, offset2;
- const FIXP_SGL invSqrt2 = FL2FXCONST_SGL(0.707106781186547f);
+ const FIXP_SGL invSqrt2 =
+ FL2FXCONST_SGL(0.353553390593273f); /* scaled by -1 */
FIXP_PCM *pTD = pTimeData;
offset2 = timeDataChannelOffset;
@@ -3399,11 +3400,14 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
L = fMult(L, invSqrt2);
R = fMult(R, invSqrt2);
#if (SAMPLE_BITS == 16)
- pTD[0] = FX_DBL2FX_PCM(fAddSaturate(L + R, (FIXP_DBL)0x8000));
- pTD[offset2] = FX_DBL2FX_PCM(fAddSaturate(L - R, (FIXP_DBL)0x8000));
+ pTD[0] = (FIXP_SGL)SATURATE_RIGHT_SHIFT(L + R + (FIXP_DBL)(1 << 14),
+ 15, FRACT_BITS);
+ pTD[offset2] = (FIXP_SGL)SATURATE_RIGHT_SHIFT(
+ L - R + (FIXP_DBL)(1 << 14), 15, FRACT_BITS);
#else
- pTD[0] = FX_DBL2FX_PCM(L + R);
- pTD[offset2] = FX_DBL2FX_PCM(L - R);
+ pTD[0] = SATURATE_LEFT_SHIFT(FX_DBL2FX_PCM(L + R), 1, DFRACT_BITS);
+ pTD[offset2] =
+ SATURATE_LEFT_SHIFT(FX_DBL2FX_PCM(L - R), 1, DFRACT_BITS);
#endif
pTD++;
}