aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdecoder_lib.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-02-13 04:07:22 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-02-13 04:07:22 +0000
commit4e14250c106b98eaf9ad7e417047ad3f6aeddde4 (patch)
treec7e87162565c1b45af14c32d11fa71f2489e760a /libAACdec/src/aacdecoder_lib.cpp
parent0ace500b9e6c6afeebd05730680790d888ae4d3f (diff)
parent31f66f6d3ffcfa429c170b2c35250982d11f5082 (diff)
downloadfdk-aac-4e14250c106b98eaf9ad7e417047ad3f6aeddde4.tar.gz
fdk-aac-4e14250c106b98eaf9ad7e417047ad3f6aeddde4.tar.bz2
fdk-aac-4e14250c106b98eaf9ad7e417047ad3f6aeddde4.zip
Snap for 6203617 from 31f66f6d3ffcfa429c170b2c35250982d11f5082 to rvc-release
Change-Id: Iefbacc1498ce7caf6c6ccb2df4c8b4c6cca4ab76
Diffstat (limited to 'libAACdec/src/aacdecoder_lib.cpp')
-rw-r--r--libAACdec/src/aacdecoder_lib.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp
index e90dbef..2ba0e86 100644
--- a/libAACdec/src/aacdecoder_lib.cpp
+++ b/libAACdec/src/aacdecoder_lib.cpp
@@ -120,7 +120,7 @@ amm-info@iis.fraunhofer.de
/* Decoder library info */
#define AACDECODER_LIB_VL0 3
#define AACDECODER_LIB_VL1 1
-#define AACDECODER_LIB_VL2 2
+#define AACDECODER_LIB_VL2 3
#define AACDECODER_LIB_TITLE "AAC Decoder Lib"
#ifdef __ANDROID__
#define AACDECODER_LIB_BUILD_DATE ""
@@ -1764,6 +1764,38 @@ aacDecoder_DecodeFrame(HANDLE_AACDECODER self, INT_PCM *pTimeData_extern,
}
}
}
+ if (FDK_drcDec_GetParam(self->hUniDrcDecoder, DRC_DEC_IS_ACTIVE)) {
+ /* return output loudness information for MPEG-D DRC */
+ LONG outputLoudness =
+ FDK_drcDec_GetParam(self->hUniDrcDecoder, DRC_DEC_OUTPUT_LOUDNESS);
+ if (outputLoudness == DRC_DEC_LOUDNESS_NOT_PRESENT) {
+ /* no valid MPEG-D DRC loudness value contained */
+ self->streamInfo.outputLoudness = -1;
+ } else {
+ if (outputLoudness > 0) {
+ /* positive output loudness values (very unusual) are limited to 0
+ * dB */
+ self->streamInfo.outputLoudness = 0;
+ } else {
+ self->streamInfo.outputLoudness =
+ -(INT)outputLoudness >>
+ 22; /* negate and scale from e = 7 to e = (31-2) */
+ }
+ }
+ } else {
+ /* return output loudness information for MPEG-4 DRC */
+ if (self->streamInfo.drcProgRefLev <
+ 0) { /* no MPEG-4 DRC loudness metadata contained */
+ self->streamInfo.outputLoudness = -1;
+ } else {
+ if (self->defaultTargetLoudness <
+ 0) { /* loudness normalization is off */
+ self->streamInfo.outputLoudness = self->streamInfo.drcProgRefLev;
+ } else {
+ self->streamInfo.outputLoudness = self->defaultTargetLoudness;
+ }
+ }
+ }
if (self->streamInfo.extAot != AOT_AAC_SLS) {
INT pcmLimiterScale = 0;