summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacpsy.c
diff options
context:
space:
mode:
authorClaudio Freire <klaussfreire@gmail.com>2013-05-04 18:35:49 -0300
committerMichael Niedermayer <michaelni@gmx.at>2013-05-05 01:24:57 +0200
commitc545876d1bcf0f91ab7a2b73a7e9c19057e1a5bd (patch)
tree198c71c572a6571fd371a6fceee97dbe343e5b05 /libavcodec/aacpsy.c
parentadaa7743f5fdca0c0aca0b7ffdebf61c7d868571 (diff)
downloadffmpeg-streaming-c545876d1bcf0f91ab7a2b73a7e9c19057e1a5bd.zip
ffmpeg-streaming-c545876d1bcf0f91ab7a2b73a7e9c19057e1a5bd.tar.gz
AAC encoder: Fixed a rounding bug in psy's channel bitrate computation.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 4d4fb54..51c669a 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -316,7 +316,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
AacPsyCoeffs *coeffs = pctx->psy_coef[j];
const uint8_t *band_sizes = ctx->bands[j];
float line_to_frequency = ctx->avctx->sample_rate / (j ? 256.f : 2048.0f);
- float avg_chan_bits = chan_bitrate / ctx->avctx->sample_rate * (j ? 128.0f : 1024.0f);
+ float avg_chan_bits = chan_bitrate * (j ? 128.0f : 1024.0f) / ctx->avctx->sample_rate;
/* reference encoder uses 2.4% here instead of 60% like the spec says */
float bark_pe = 0.024f * PSY_3GPP_BITS_TO_PE(avg_chan_bits) / num_bark;
float en_spread_low = j ? PSY_3GPP_EN_SPREAD_LOW_S : PSY_3GPP_EN_SPREAD_LOW_L;
OpenPOWER on IntegriCloud