aboutsummaryrefslogtreecommitdiffstats
path: root/libDRCdec
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 /libDRCdec
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 'libDRCdec')
-rw-r--r--libDRCdec/include/FDK_drcDecLib.h11
-rw-r--r--libDRCdec/src/FDK_drcDecLib.cpp2
-rw-r--r--libDRCdec/src/drcDec_selectionProcess.cpp11
-rw-r--r--libDRCdec/src/drcDec_selectionProcess.h2
4 files changed, 17 insertions, 9 deletions
diff --git a/libDRCdec/include/FDK_drcDecLib.h b/libDRCdec/include/FDK_drcDecLib.h
index 2d28d23..79f8566 100644
--- a/libDRCdec/include/FDK_drcDecLib.h
+++ b/libDRCdec/include/FDK_drcDecLib.h
@@ -114,6 +114,8 @@ amm-info@iis.fraunhofer.de
extern "C" {
#endif
+#define DRC_DEC_LOUDNESS_NOT_PRESENT (LONG)0x7FFFFFFE
+
typedef struct s_drc_decoder* HANDLE_DRC_DECODER;
typedef struct s_uni_drc_interface* HANDLE_UNI_DRC_INTERFACE;
typedef struct s_selection_process_output* HANDLE_SEL_PROC_OUTPUT;
@@ -150,9 +152,12 @@ typedef enum {
DRC_DEC_IS_ACTIVE, /**< MPEG-D DRC payload is present and at least one of
Dynamic Range Control (DRC) or Loudness Normalization
(LN) is activated */
- DRC_DEC_TARGET_CHANNEL_COUNT_SELECTED /**< number of output channels if
- appropriate downmixInstruction exists
- */
+ DRC_DEC_TARGET_CHANNEL_COUNT_SELECTED, /**< number of output channels if
+ appropriate downmixInstruction
+ exists */
+ DRC_DEC_OUTPUT_LOUDNESS /**< output loudness in dB, with exponent e = 7, or
+ DRC_DEC_LOUDNESS_NOT_PRESENT if no loudness is
+ contained in the bitstream */
} DRC_DEC_USERPARAM;
typedef enum {
diff --git a/libDRCdec/src/FDK_drcDecLib.cpp b/libDRCdec/src/FDK_drcDecLib.cpp
index e43279f..83b5773 100644
--- a/libDRCdec/src/FDK_drcDecLib.cpp
+++ b/libDRCdec/src/FDK_drcDecLib.cpp
@@ -519,6 +519,8 @@ LONG FDK_drcDec_GetParam(HANDLE_DRC_DECODER hDrcDec,
}
case DRC_DEC_TARGET_CHANNEL_COUNT_SELECTED:
return (LONG)hDrcDec->selProcOutput.targetChannelCount;
+ case DRC_DEC_OUTPUT_LOUDNESS:
+ return (LONG)hDrcDec->selProcOutput.outputLoudness;
default:
return 0;
}
diff --git a/libDRCdec/src/drcDec_selectionProcess.cpp b/libDRCdec/src/drcDec_selectionProcess.cpp
index fe6034c..46ed740 100644
--- a/libDRCdec/src/drcDec_selectionProcess.cpp
+++ b/libDRCdec/src/drcDec_selectionProcess.cpp
@@ -103,8 +103,6 @@ amm-info@iis.fraunhofer.de
#include "drcDec_selectionProcess.h"
#include "drcDec_tools.h"
-#define UNDEFINED_LOUDNESS_VALUE (FIXP_DBL) MAXVAL_DBL
-
typedef enum {
DETR_NONE = 0,
DETR_NIGHT = 1,
@@ -1136,9 +1134,8 @@ static DRCDEC_SELECTION_PROCESS_RETURN _preSelectionRequirement8(
FIXP_DBL loudnessDeviationMax =
((FIXP_DBL)hSelProcInput->loudnessDeviationMax) << (DFRACT_BITS - 1 - 7);
- ;
- if (hSelProcInput->loudnessNormalizationOn) {
+ {
retVal = _getLoudness(hLoudnessInfoSet, hSelProcInput->albumMode,
hSelProcInput->loudnessMeasurementMethod,
hSelProcInput->loudnessMeasurementSystem,
@@ -1147,9 +1144,10 @@ static DRCDEC_SELECTION_PROCESS_RETURN _preSelectionRequirement8(
hSelProcInput->downmixIdRequested[downmixIdIndex],
&loudnessNormalizationGainDb, &loudness);
if (retVal) return (retVal);
- } else {
+ }
+
+ if (!hSelProcInput->loudnessNormalizationOn) {
loudnessNormalizationGainDb = (FIXP_DBL)0;
- loudness = UNDEFINED_LOUDNESS_VALUE;
}
retVal = _getSignalPeakLevel(
@@ -2070,6 +2068,7 @@ static DRCDEC_SELECTION_PROCESS_RETURN _generateOutputInfo(
pSelectionData->loudnessNormalizationGainDbAdjusted +
hSelProcInput->loudnessNormalizationGainModificationDb;
hSelProcOutput->outputPeakLevelDb = pSelectionData->outputPeakLevel;
+ hSelProcOutput->outputLoudness = pSelectionData->outputLoudness;
hSelProcOutput->boost = boost;
hSelProcOutput->compress = compress;
diff --git a/libDRCdec/src/drcDec_selectionProcess.h b/libDRCdec/src/drcDec_selectionProcess.h
index 420bae6..0f878cf 100644
--- a/libDRCdec/src/drcDec_selectionProcess.h
+++ b/libDRCdec/src/drcDec_selectionProcess.h
@@ -111,6 +111,8 @@ amm-info@iis.fraunhofer.de
typedef struct s_drcdec_selection_process* HANDLE_DRC_SELECTION_PROCESS;
+#define UNDEFINED_LOUDNESS_VALUE (FIXP_DBL)(MAXVAL_DBL - 1)
+
typedef enum {
DRCDEC_SELECTION_PROCESS_NO_ERROR = 0,