diff options
author | Claudio Freire <klaussfreire@gmail.com> | 2013-05-04 18:35:49 -0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-05-14 12:42:03 +0300 |
commit | 7c71ada4cad3c6aab5fa24155c379465c41cfd76 (patch) | |
tree | 1ab2f7b21ce184900635676aa9f5b18a8b87013c | |
parent | d10499a32ab3f3d4d458abfc4ab41c0d746e4eee (diff) | |
download | ffmpeg-7c71ada4cad3c6aab5fa24155c379465c41cfd76.tar.gz |
aacenc: Fix a rounding bug in aacpsy channel bitrate computation
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavcodec/aacpsy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c index 6f1ac05bff..66cf6d5f40 100644 --- a/libavcodec/aacpsy.c +++ b/libavcodec/aacpsy.c @@ -312,7 +312,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; |