Commit d7194e3b authored by Alex Converse's avatar Alex Converse
Browse files

aacenc: psy_3gpp_init(): Fix ath for the first line in each sfb.

Fix the MDCT line to frequency calculation for the first line in each sfb.
Use this value to calculate ATH.

Originally committed as revision 24231 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 886385af
...@@ -138,7 +138,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) { ...@@ -138,7 +138,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
} }
start = 0; start = 0;
for (g = 0; g < ctx->num_bands[j]; g++) { for (g = 0; g < ctx->num_bands[j]; g++) {
minscale = ath(ctx->avctx->sample_rate * start / 1024.0, ATH_ADD); minscale = ath(ctx->avctx->sample_rate * start / 1024.0 / 2.0, ATH_ADD);
for (i = 1; i < ctx->bands[j][g]; i++) for (i = 1; i < ctx->bands[j][g]; i++)
minscale = FFMIN(minscale, ath(ctx->avctx->sample_rate * (start + i) / 1024.0 / 2.0, ATH_ADD)); minscale = FFMIN(minscale, ath(ctx->avctx->sample_rate * (start + i) / 1024.0 / 2.0, ATH_ADD));
coeffs->ath[g] = minscale - minath; coeffs->ath[g] = minscale - minath;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment