aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec/src
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-09 17:55:17 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2020-12-28 09:21:16 -0800
commit9256cfbb73ead016322637f84254856bbe918493 (patch)
tree0b12397818e7e6f8c90ab75c79683ecdc9030117 /libSBRdec/src
parent293ccc7fbc509cc0ba4d944bd1bb9ad6f79c037d (diff)
downloadfdk-aac-9256cfbb73ead016322637f84254856bbe918493.tar.gz
fdk-aac-9256cfbb73ead016322637f84254856bbe918493.tar.bz2
fdk-aac-9256cfbb73ead016322637f84254856bbe918493.zip
Make sure that alphaValue is correctly initialized in sbrDecoder_drcApplySlot().
Bug: 176246647 Test: atest DecoderTestXheAac DecoderTestAacDrc Change-Id: I5bded2e3d29278bb5df561eaa2a46d963ee21df8
Diffstat (limited to 'libSBRdec/src')
-rw-r--r--libSBRdec/src/sbrdec_drc.cpp53
1 files changed, 34 insertions, 19 deletions
diff --git a/libSBRdec/src/sbrdec_drc.cpp b/libSBRdec/src/sbrdec_drc.cpp
index 2d73f32..089d046 100644
--- a/libSBRdec/src/sbrdec_drc.cpp
+++ b/libSBRdec/src/sbrdec_drc.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -233,14 +233,19 @@ void sbrDecoder_drcApplySlot(HANDLE_SBR_DRC_CHANNEL hDrcData,
if (hDrcData->winSequenceCurr != 2) { /* long window */
int j = col + (numQmfSubSamples >> 1);
- if (hDrcData->drcInterpolationSchemeCurr == 0) {
- INT k = (frameLenFlag) ? 0x4444445 : 0x4000000;
+ if (j < winBorderToColMap[15]) {
+ if (hDrcData->drcInterpolationSchemeCurr == 0) {
+ INT k = (frameLenFlag) ? 0x4444445 : 0x4000000;
- alphaValue = (FIXP_DBL)(j * k);
- } else {
- if (j >= (int)winBorderToColMap[hDrcData->drcInterpolationSchemeCurr]) {
- alphaValue = (FIXP_DBL)MAXVAL_DBL;
+ alphaValue = (FIXP_DBL)(j * k);
+ } else {
+ if (j >=
+ (int)winBorderToColMap[hDrcData->drcInterpolationSchemeCurr]) {
+ alphaValue = (FIXP_DBL)MAXVAL_DBL;
+ }
}
+ } else {
+ alphaValue = (FIXP_DBL)MAXVAL_DBL;
}
} else { /* short windows */
shortDrc = 1;
@@ -254,14 +259,19 @@ void sbrDecoder_drcApplySlot(HANDLE_SBR_DRC_CHANNEL hDrcData,
if (hDrcData->winSequenceNext != 2) { /* next: long window */
int j = col - (numQmfSubSamples >> 1);
- if (hDrcData->drcInterpolationSchemeNext == 0) {
- INT k = (frameLenFlag) ? 0x4444445 : 0x4000000;
+ if (j < winBorderToColMap[15]) {
+ if (hDrcData->drcInterpolationSchemeNext == 0) {
+ INT k = (frameLenFlag) ? 0x4444445 : 0x4000000;
- alphaValue = (FIXP_DBL)(j * k);
- } else {
- if (j >= (int)winBorderToColMap[hDrcData->drcInterpolationSchemeNext]) {
- alphaValue = (FIXP_DBL)MAXVAL_DBL;
+ alphaValue = (FIXP_DBL)(j * k);
+ } else {
+ if (j >=
+ (int)winBorderToColMap[hDrcData->drcInterpolationSchemeNext]) {
+ alphaValue = (FIXP_DBL)MAXVAL_DBL;
+ }
}
+ } else {
+ alphaValue = (FIXP_DBL)MAXVAL_DBL;
}
fact_mag = hDrcData->nextFact_mag;
@@ -289,14 +299,19 @@ void sbrDecoder_drcApplySlot(HANDLE_SBR_DRC_CHANNEL hDrcData,
if (hDrcData->winSequenceNext != 2) { /* long window */
int j = col - (numQmfSubSamples >> 1);
- if (hDrcData->drcInterpolationSchemeNext == 0) {
- INT k = (frameLenFlag) ? 0x4444445 : 0x4000000;
+ if (j < winBorderToColMap[15]) {
+ if (hDrcData->drcInterpolationSchemeNext == 0) {
+ INT k = (frameLenFlag) ? 0x4444445 : 0x4000000;
- alphaValue = (FIXP_DBL)(j * k);
- } else {
- if (j >= (int)winBorderToColMap[hDrcData->drcInterpolationSchemeNext]) {
- alphaValue = (FIXP_DBL)MAXVAL_DBL;
+ alphaValue = (FIXP_DBL)(j * k);
+ } else {
+ if (j >=
+ (int)winBorderToColMap[hDrcData->drcInterpolationSchemeNext]) {
+ alphaValue = (FIXP_DBL)MAXVAL_DBL;
+ }
}
+ } else {
+ alphaValue = (FIXP_DBL)MAXVAL_DBL;
}
} else { /* short windows */
shortDrc = 1;