aboutsummaryrefslogtreecommitdiffstats
path: root/libDRCdec/src/drcDec_selectionProcess.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-09-15 16:54:16 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-09-15 16:54:16 +0200
commit97182034e8829014bdfc0449c2116d629196f1d4 (patch)
tree6c3f4e3ef63d33aa16c79e530b46382faf0ab406 /libDRCdec/src/drcDec_selectionProcess.cpp
parentbafe5616b88cc52f9f0ded6403a6b3ec68d8c27c (diff)
parent3a831a5fbc990c83e9b5b804a082bb158364e793 (diff)
downloadfdk-aac-97182034e8829014bdfc0449c2116d629196f1d4.tar.gz
fdk-aac-97182034e8829014bdfc0449c2116d629196f1d4.tar.bz2
fdk-aac-97182034e8829014bdfc0449c2116d629196f1d4.zip
Merge remote-tracking branch 'mstorjo/master' into dabplus2
Diffstat (limited to 'libDRCdec/src/drcDec_selectionProcess.cpp')
-rw-r--r--libDRCdec/src/drcDec_selectionProcess.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/libDRCdec/src/drcDec_selectionProcess.cpp b/libDRCdec/src/drcDec_selectionProcess.cpp
index 9228197..c33bf74 100644
--- a/libDRCdec/src/drcDec_selectionProcess.cpp
+++ b/libDRCdec/src/drcDec_selectionProcess.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 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -555,6 +555,11 @@ drcDec_SelectionProcess_SetParam(HANDLE_DRC_SELECTION_PROCESS hInstance,
diff |= _compAssign(&pSelProcInput->loudnessMeasurementMethod,
requestValueInt);
break;
+ case SEL_PROC_ALBUM_MODE:
+ if ((requestValueInt < 0) || (requestValueInt > 1))
+ return DRCDEC_SELECTION_PROCESS_PARAM_OUT_OF_RANGE;
+ diff |= _compAssign(&pSelProcInput->albumMode, requestValueInt);
+ break;
case SEL_PROC_DOWNMIX_ID:
diff |=
_compAssign(&pSelProcInput->targetConfigRequestType, TCRT_DOWNMIX_ID);
@@ -598,14 +603,21 @@ drcDec_SelectionProcess_SetParam(HANDLE_DRC_SELECTION_PROCESS hInstance,
if ((requestValue < (FIXP_DBL)0) ||
(requestValue > FL2FXCONST_DBL(1.0f / (float)(1 << 1))))
return DRCDEC_SELECTION_PROCESS_PARAM_OUT_OF_RANGE;
- diff |= _compAssign(&pSelProcInput->boost, FX_DBL2FX_SGL(requestValue));
+ diff |= _compAssign(
+ &pSelProcInput->boost,
+ FX_DBL2FX_SGL(
+ requestValue +
+ (FIXP_DBL)(1 << 15))); /* convert to FIXP_SGL with rounding */
break;
case SEL_PROC_COMPRESS:
if ((requestValue < (FIXP_DBL)0) ||
(requestValue > FL2FXCONST_DBL(1.0f / (float)(1 << 1))))
return DRCDEC_SELECTION_PROCESS_PARAM_OUT_OF_RANGE;
- diff |=
- _compAssign(&pSelProcInput->compress, FX_DBL2FX_SGL(requestValue));
+ diff |= _compAssign(
+ &pSelProcInput->compress,
+ FX_DBL2FX_SGL(
+ requestValue +
+ (FIXP_DBL)(1 << 15))); /* convert to FIXP_SGL with rounding */
break;
default:
return DRCDEC_SELECTION_PROCESS_INVALID_PARAM;
@@ -2173,6 +2185,9 @@ static DRCDEC_SELECTION_PROCESS_RETURN _selectDownmixMatrix(
if (hSelProcOutput->activeDownmixId != 0) {
for (i = 0; i < hUniDrcConfig->downmixInstructionsCount; i++) {
DOWNMIX_INSTRUCTIONS* pDown = &(hUniDrcConfig->downmixInstructions[i]);
+ if (pDown->targetChannelCount > 8) {
+ continue;
+ }
if (hSelProcOutput->activeDownmixId == pDown->downmixId) {
hSelProcOutput->targetChannelCount = pDown->targetChannelCount;
@@ -2825,6 +2840,8 @@ static int _downmixCoefficientsArePresent(HANDLE_UNI_DRC_CONFIG hUniDrcConfig,
for (i = 0; i < hUniDrcConfig->downmixInstructionsCount; i++) {
if (hUniDrcConfig->downmixInstructions[i].downmixId == downmixId) {
if (hUniDrcConfig->downmixInstructions[i].downmixCoefficientsPresent) {
+ if (hUniDrcConfig->downmixInstructions[i].targetChannelCount > 8)
+ return 0;
*pIndex = i;
return 1;
}