summaryrefslogtreecommitdiff
path: root/libavcodec/aacpsy.c
diff options
context:
space:
mode:
authorNathan Caldwell <saintdev@gmail.com>2010-10-27 05:54:41 +0000
committerAnton Khirnov <wyskas@gmail.com>2010-10-27 05:54:41 +0000
commiteafadadaf502560d1d3c2a1cb8e8cb9991221e14 (patch)
treed9bcc0c7945ebaed4afdd7f5e25f20c07532bdf0 /libavcodec/aacpsy.c
parent042ca05f0fdc5f4d56a3e9b94bc9cd67bca9a4bc (diff)
aacenc: Fix the conditions under which 3GPP pre-echo control is run.
According to the 3GPP spec: "Thus the pre-echo control is inactive for the first short window (but not all short windows in a short frame) after a start block and for all frames with a stop window sequence." Currently, pre-echo control is only run when the current frame is not a short frame, and the previous frame is not a short frame. patch by Nathan Caldwell saintdev (at) gmail Originally committed as revision 25587 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r--libavcodec/aacpsy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index d5b51f8bea..5b637b8bc3 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -420,7 +420,7 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
band[g].thr = FFMAX(band[g].thr, band[g+1].thr * coeffs->spread_hi [g]);
for (g = 0; g < num_bands; g++) {
band[g].thr_quiet = FFMAX(band[g].thr, coeffs->ath[g]);
- if (wi->num_windows != 8 && wi->window_type[1] != EIGHT_SHORT_SEQUENCE)
+ if (!(wi->window_type[0] == LONG_STOP_SEQUENCE || (wi->window_type[1] == LONG_START_SEQUENCE && !w)))
band[g].thr_quiet = FFMAX(PSY_3GPP_RPEMIN*band[g].thr_quiet,
FFMIN(band[g].thr_quiet,
PSY_3GPP_RPELEV*pch->prev_band[w+g].thr_quiet));