aboutsummaryrefslogtreecommitdiffstats
path: root/libPCMutils/include
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2019-12-19 17:28:15 +0100
committerJean-Michel Trivi <jmtrivi@google.com>2020-02-14 10:53:51 -0800
commite016635f0d3a5c7532b00711ce461f97a13f7bc2 (patch)
tree44d6676c2975eec965bb3e6c2562e1632eaf4385 /libPCMutils/include
parent57c9355de0269afb462ad4a8aa8814f6a6486ff1 (diff)
downloadfdk-aac-e016635f0d3a5c7532b00711ce461f97a13f7bc2.tar.gz
fdk-aac-e016635f0d3a5c7532b00711ce461f97a13f7bc2.tar.bz2
fdk-aac-e016635f0d3a5c7532b00711ce461f97a13f7bc2.zip
Avoid decoder internal clipping by converting the whole audio sample data path from 16 to 32 bit data width (FDKdec v3.2.0).
Bug: 149514474 Test: atest DecoderTestXheAac DecoderTestAacDrc Change-Id: I8a504ab709e42e27a61fe29840212953742283a5
Diffstat (limited to 'libPCMutils/include')
-rw-r--r--libPCMutils/include/limiter.h36
1 files changed, 10 insertions, 26 deletions
diff --git a/libPCMutils/include/limiter.h b/libPCMutils/include/limiter.h
index fab7226..419e891 100644
--- a/libPCMutils/include/limiter.h
+++ b/libPCMutils/include/limiter.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,8 +109,6 @@ amm-info@iis.fraunhofer.de
#define TDL_ATTACK_DEFAULT_MS (15) /* default attack time in ms */
#define TDL_RELEASE_DEFAULT_MS (50) /* default release time in ms */
-#define TDL_GAIN_SCALING (15) /* scaling of gain value. */
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -128,10 +126,7 @@ struct TDLimiter {
unsigned int maxBufIdx, delayBufIdx;
FIXP_DBL smoothState0;
FIXP_DBL minGain;
-
- FIXP_DBL additionalGainPrev;
- FIXP_DBL additionalGainFilterState;
- FIXP_DBL additionalGainFilterState1;
+ INT scaling;
};
typedef enum {
@@ -255,27 +250,16 @@ TDLIMITER_ERROR pcmLimiter_SetThreshold(TDLimiterPtr limiter,
/******************************************************************************
* pcmLimiter_Apply *
- * limiter: limiter handle *
- * pGain : pointer to gains to be applied to the signal before limiting, *
- * which are downscaled by TDL_GAIN_SCALING bit. *
- * These gains are delayed by gain_delay, and smoothed. *
- * Smoothing is done by a butterworth lowpass filter with a cutoff *
- * frequency which is fixed with respect to the sampling rate. *
- * It is a substitute for the smoothing due to windowing and *
- * overlap/add, if a gain is applied in frequency domain. *
- * gain_scale: pointer to scaling exponents to be applied to the signal before *
- * limiting, without delay and without smoothing *
- * gain_size: number of elements in pGain, currently restricted to 1 *
- * gain_delay: delay [samples] with which the gains in pGain shall be applied *
- * gain_delay <= nSamples *
- * samples: input/output buffer containing interleaved samples *
- * precision of output will be DFRACT_BITS-TDL_GAIN_SCALING bits *
- * nSamples: number of samples per channel *
+ * limiter: limiter handle *
+ * samplesIn: pointer to input buffer containing interleaved samples *
+ * samplesOut: pointer to output buffer containing interleaved samples *
+ * pGainPerSample: pointer to gains for each sample *
+ * scaling: scaling of output samples *
+ * nSamples: number of samples per channel *
* returns: error code *
******************************************************************************/
TDLIMITER_ERROR pcmLimiter_Apply(TDLimiterPtr limiter, PCM_LIM* samplesIn,
- INT_PCM* samplesOut, FIXP_DBL* pGain,
- const INT* gain_scale, const UINT gain_size,
- const UINT gain_delay, const UINT nSamples);
+ INT_PCM* samplesOut, FIXP_DBL* pGainPerSample,
+ const INT scaling, const UINT nSamples);
#endif /* #ifndef LIMITER_H */