summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Grossman <johngro@google.com>2012-09-12 14:08:09 -0700
committerJohn Grossman <johngro@google.com>2012-09-12 14:20:05 -0700
commit34ce250e9075adda4fb8a797c7f47dc049476e8b (patch)
tree1c545f7fbb01b629a9232adb3f3ae66e99c2530e
parent381d69840ad3af2259f0b7ef49236f9ee9c76b76 (diff)
downloadODR-AudioEnc-34ce250e9075adda4fb8a797c7f47dc049476e8b.tar.gz
ODR-AudioEnc-34ce250e9075adda4fb8a797c7f47dc049476e8b.tar.bz2
ODR-AudioEnc-34ce250e9075adda4fb8a797c7f47dc049476e8b.zip
Don't zero out spec coeffs before doing the final IMDCT.
Addresses bug 7140347. When flushing the decoder, you need to make sure to zero out any lingering spectral coefficients as well as zero out the overlap buffer state after decoding the final access unit. Zeroing out the spec coefficients *before* you decode the last block, however, seems like a mistake. If the final block contains any useful information for the stream, then you end up outputting the overlap portion of the second to last decoded block combined with zeros. Because of the shape of the second to last block's windows, this results in what appears to be a fade out, but actually is a zero'ed out final block. Signed-off-by: John Grossman <johngro@google.com> Change-Id: I0fab9ee1a5899811d5519a91dc05631e9bf4963c
-rw-r--r--libAACdec/src/aacdecoder.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index 4cf1391..2843e9f 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -1646,10 +1646,6 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
self->sbrEnabled
);
- if ( flags&AACDEC_FLUSH ) {
- FDKmemclear(pAacDecoderChannelInfo->pSpectralCoefficient, sizeof(FIXP_DBL)*self->streamInfo.aacSamplesPerFrame);
- }
-
switch (pAacDecoderChannelInfo->renderMode)
{
case AACDEC_RENDER_IMDCT:
@@ -1677,6 +1673,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
break;
}
if ( flags&AACDEC_FLUSH ) {
+ FDKmemclear(pAacDecoderChannelInfo->pSpectralCoefficient, sizeof(FIXP_DBL)*self->streamInfo.aacSamplesPerFrame);
FDKmemclear(self->pAacDecoderStaticChannelInfo[c]->pOverlapBuffer, OverlapBufferSize*sizeof(FIXP_DBL));
}
}