aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-09 17:57:27 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2020-12-28 09:21:16 -0800
commit9f2d1a18d451a3a9c5f0cd05120ddb0eea731d47 (patch)
tree5bcfa953bd0b42bc5b298668c2a0e7b1dc850b4c /libAACdec
parentb1136d1c348261adc1801c8db04d25033a0bdb9f (diff)
downloadfdk-aac-9f2d1a18d451a3a9c5f0cd05120ddb0eea731d47.tar.gz
fdk-aac-9f2d1a18d451a3a9c5f0cd05120ddb0eea731d47.tar.bz2
fdk-aac-9f2d1a18d451a3a9c5f0cd05120ddb0eea731d47.zip
ELD downscale factor 3 is only allowed for framesize 480.
Bug: 176246647 Test: atest DecoderTestXheAac DecoderTestAacDrc Change-Id: I9681942ba39761e4f1d66236ad80c2420ca5abe9
Diffstat (limited to 'libAACdec')
-rw-r--r--libAACdec/src/aacdecoder.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index 414c3e2..08128c0 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -1791,9 +1791,17 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
downscaleFactorInBS =
asc->m_samplingFrequency /
asc->m_sc.m_eldSpecificConfig.m_downscaledSamplingFrequency;
- if (downscaleFactorInBS == 1 || downscaleFactorInBS == 2 ||
- downscaleFactorInBS == 3 || downscaleFactorInBS == 4) {
+ if ((downscaleFactorInBS == 1 || downscaleFactorInBS == 2 ||
+ (downscaleFactorInBS == 3 &&
+ asc->m_sc.m_eldSpecificConfig.m_frameLengthFlag) ||
+ downscaleFactorInBS == 4) &&
+ ((asc->m_samplingFrequency %
+ asc->m_sc.m_eldSpecificConfig.m_downscaledSamplingFrequency) ==
+ 0)) {
downscaleFactor = downscaleFactorInBS;
+ } else {
+ downscaleFactorInBS = 1;
+ downscaleFactor = 1;
}
}
} else {