aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdecoder.h
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-17 15:07:13 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2021-01-14 15:26:24 -0800
commit3495808c8348ca8df31b0fdb051c135656931cb4 (patch)
tree8dbf452c52812a06fac6abe67b4606ea77aa6916 /libAACdec/src/aacdecoder.h
parent9a48d4799826e54915f06ca25bfd4e9d81dcf8c7 (diff)
downloadfdk-aac-3495808c8348ca8df31b0fdb051c135656931cb4.tar.gz
fdk-aac-3495808c8348ca8df31b0fdb051c135656931cb4.tar.bz2
fdk-aac-3495808c8348ca8df31b0fdb051c135656931cb4.zip
Fix USAC time domain limiter latency at config change.
We have observed quality problems regarding config switching for USAC streams. Crossfading did not consider the USAC time domain limiter latency correctly. The limiter memory still contained the last part of the frame before the config change. With this patch we were able to improve the quality by moving the limiter processing to the end of the processing chain (crossfade -> DRC -> limiter). By that we don't have to consider the limiter latency at the crossfader anymore and can resolve the quality issue. Bug: 176246647 Test: atest android.media.cts.DecoderTestAacFormat android.media.cts.DecoderTestXheAac android.media.cts.DecoderTestAacDrc Change-Id: I0dfd3b76ff2b0daf495ad406283f56a39982ad8f Change-Id: I26f5da65ef8344602007e180e837820c6a25f173
Diffstat (limited to 'libAACdec/src/aacdecoder.h')
-rw-r--r--libAACdec/src/aacdecoder.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/libAACdec/src/aacdecoder.h b/libAACdec/src/aacdecoder.h
index bd1f38f..002807f 100644
--- a/libAACdec/src/aacdecoder.h
+++ b/libAACdec/src/aacdecoder.h
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -172,6 +172,12 @@ enum {
AACDEC_RSV60_BUILD_UP_IDLE_IN_BAND = 5
};
+#define AACDEC_CROSSFADE_BITMASK_OFF \
+ ((UCHAR)0) /*!< No cross-fade between frames shall be applied at next \
+ config change. */
+#define AACDEC_CROSSFADE_BITMASK_PREROLL \
+ ((UCHAR)1 << 1) /*!< applyCrossfade is signaled in AudioPreRoll */
+
typedef struct {
/* Usac Extension Elements */
USAC_EXT_ELEMENT_TYPE usacExtElementType[(3)];
@@ -325,7 +331,7 @@ This structure is allocated once for each CPE. */
UINT loudnessInfoSetPosition[3];
SCHAR defaultTargetLoudness;
- INT_PCM
+ PCM_DEC
*pTimeDataFlush[((8) * 2)]; /*!< Pointer to the flushed time data which
will be used for the crossfade in case of
an USAC DASH IPF config change */
@@ -341,8 +347,8 @@ This structure is allocated once for each CPE. */
start position in the
bitstream */
INT accessUnit; /*!< Number of the actual processed preroll accessUnit */
- UCHAR applyCrossfade; /*!< if set crossfade for seamless stream switching is
- applied */
+ UCHAR applyCrossfade; /*!< If any bit is set, cross-fade for seamless stream
+ switching is applied */
FDK_SignalDelay usacResidualDelay; /*!< Delay residual signal to compensate
for eSBR delay of DMX signal in case of
@@ -439,12 +445,12 @@ LINKSPEC_H AAC_DECODER_ERROR CAacDecoder_FreeMem(HANDLE_AACDECODER self,
/* Prepare crossfade for USAC DASH IPF config change */
LINKSPEC_H AAC_DECODER_ERROR CAacDecoder_PrepareCrossFade(
- const INT_PCM *pTimeData, INT_PCM **pTimeDataFlush, const INT numChannels,
+ const PCM_DEC *pTimeData, PCM_DEC **pTimeDataFlush, const INT numChannels,
const INT frameSize, const INT interleaved);
/* Apply crossfade for USAC DASH IPF config change */
LINKSPEC_H AAC_DECODER_ERROR CAacDecoder_ApplyCrossFade(
- INT_PCM *pTimeData, INT_PCM **pTimeDataFlush, const INT numChannels,
+ PCM_DEC *pTimeData, PCM_DEC **pTimeDataFlush, const INT numChannels,
const INT frameSize, const INT interleaved);
/* Set flush and build up mode */