Mercurial > libavcodec.hg
comparison aacpsy.c @ 12160:e0bed2f0f9f9 libavcodec
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.
author | alexc |
---|---|
date | Wed, 14 Jul 2010 04:10:41 +0000 |
parents | 25ac974ce96d |
children | d34f0f3ac678 |
comparison
equal
deleted
inserted
replaced
12159:25ac974ce96d | 12160:e0bed2f0f9f9 |
---|---|
136 coeffs->spread_low[g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_LOW); | 136 coeffs->spread_low[g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_LOW); |
137 coeffs->spread_hi [g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_HI); | 137 coeffs->spread_hi [g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_HI); |
138 } | 138 } |
139 start = 0; | 139 start = 0; |
140 for (g = 0; g < ctx->num_bands[j]; g++) { | 140 for (g = 0; g < ctx->num_bands[j]; g++) { |
141 minscale = ath(ctx->avctx->sample_rate * start / 1024.0, ATH_ADD); | 141 minscale = ath(ctx->avctx->sample_rate * start / 1024.0 / 2.0, ATH_ADD); |
142 for (i = 1; i < ctx->bands[j][g]; i++) | 142 for (i = 1; i < ctx->bands[j][g]; i++) |
143 minscale = FFMIN(minscale, ath(ctx->avctx->sample_rate * (start + i) / 1024.0 / 2.0, ATH_ADD)); | 143 minscale = FFMIN(minscale, ath(ctx->avctx->sample_rate * (start + i) / 1024.0 / 2.0, ATH_ADD)); |
144 coeffs->ath[g] = minscale - minath; | 144 coeffs->ath[g] = minscale - minath; |
145 start += ctx->bands[j][g]; | 145 start += ctx->bands[j][g]; |
146 } | 146 } |