summaryrefslogtreecommitdiffstats
path: root/fdk-aac/libAACdec/src/aacdec_drc.h
diff options
context:
space:
mode:
Diffstat (limited to 'fdk-aac/libAACdec/src/aacdec_drc.h')
-rw-r--r--fdk-aac/libAACdec/src/aacdec_drc.h51
1 files changed, 49 insertions, 2 deletions
diff --git a/fdk-aac/libAACdec/src/aacdec_drc.h b/fdk-aac/libAACdec/src/aacdec_drc.h
index 924ec6f..76a44d6 100644
--- a/fdk-aac/libAACdec/src/aacdec_drc.h
+++ b/fdk-aac/libAACdec/src/aacdec_drc.h
@@ -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
@@ -109,6 +109,11 @@ amm-info@iis.fraunhofer.de
#include "channel.h"
#include "FDK_bitstream.h"
+#define AACDEC_DRC_GAIN_SCALING (11) /* Scaling of DRC gains */
+#define AACDEC_DRC_GAIN_INIT_VALUE \
+ (FL2FXCONST_DBL( \
+ 1.0f / (1 << AACDEC_DRC_GAIN_SCALING))) /* Init value for DRC gains */
+
#define AACDEC_DRC_DFLT_EXPIRY_FRAMES \
(0) /* Default DRC data expiry time in AAC frames */
@@ -125,7 +130,6 @@ typedef enum {
TARGET_REF_LEVEL,
DRC_BS_DELAY,
DRC_DATA_EXPIRY_FRAME,
- APPLY_NORMALIZATION,
APPLY_HEAVY_COMPRESSION,
DEFAULT_PRESENTATION_MODE,
ENCODER_TARGET_LEVEL,
@@ -136,6 +140,8 @@ typedef enum {
/**
* \brief DRC module interface functions
*/
+void aacDecoder_drcReset(HANDLE_AAC_DRC self);
+
void aacDecoder_drcInit(HANDLE_AAC_DRC self);
void aacDecoder_drcInitChannelData(CDrcChannelData *pDrcChannel);
@@ -189,4 +195,45 @@ int aacDecoder_drcEpilog(
void aacDecoder_drcGetInfo(HANDLE_AAC_DRC self, SCHAR *pPresMode,
SCHAR *pProgRefLevel);
+/**
+ * \brief Apply DRC Level Normalization.
+ *
+ * This function prepares/applies the gain values for the DRC Level
+ * Normalization and returns the exponent of the time data. The following two
+ * cases are handled:
+ *
+ * - Limiter enabled:
+ * The input data must be interleaved.
+ * One gain per sample is written to the buffer pGainPerSample.
+ * If necessary the time data is rescaled.
+ *
+ * - Limiter disabled:
+ * The input data can be interleaved or deinterleaved.
+ * The gain values are applied to the time data.
+ * If necessary the time data is rescaled.
+ *
+ * \param hDrcInfo [i/o] handle to drc data structure.
+ * \param samplesIn [i/o] pointer to time data.
+ * \param pGain [i ] pointer to gain to be applied to
+ * the time data.
+ * \param pGainPerSample [o ] pointer to the gain per sample to
+ * be applied to the time data in the limiter.
+ * \param gain_scale [i ] exponent to be applied to the time
+ * data.
+ * \param gain_delay [i ] delay[samples] with which the gains
+ * in pGain shall be applied (gain_delay <= nSamples).
+ * \param nSamples [i ] number of samples per frame.
+ * \param channels [i ] number of channels.
+ * \param stride [i ] channel stride of time data.
+ * \param limiterEnabled [i ] 1 if limiter is enabled, otherwise
+ * 0.
+ *
+ * \return exponent of time data
+ */
+INT applyDrcLevelNormalization(HANDLE_AAC_DRC hDrcInfo, PCM_DEC *samplesIn,
+ FIXP_DBL *pGain, FIXP_DBL *pGainPerSample,
+ const INT gain_scale, const UINT gain_delay,
+ const UINT nSamples, const UINT channels,
+ const UINT stride, const UINT limiterEnabled);
+
#endif /* AACDEC_DRC_H */