History

AAC encoder: Fixed a rounding bug in psy's channel bitrate computation.

Claudio Freire committed 13 years ago

Commit c5458761 parent adaa7741 file · +1 −1Browse files

Unified · Split

libavcodec/aacpsy.c+1−1
@@ -316,7 +316,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) { · 315 unmodified lines
316316 AacPsyCoeffs *coeffs = pctx->psy_coef[j];
317317 const uint8_t *band_sizes = ctx->bands[j];
318318 float line_to_frequency = ctx->avctx->sample_rate / (j ? 256.f : 2048.0f);
319− float avg_chan_bits = chan_bitrate / ctx->avctx->sample_rate * (j ? 128.0f : 1024.0f);
319+ float avg_chan_bits = chan_bitrate * (j ? 128.0f : 1024.0f) / ctx->avctx->sample_rate;
320320 /* reference encoder uses 2.4% here instead of 60% like the spec says */
321321 float bark_pe = 0.024f * PSY_3GPP_BITS_TO_PE(avg_chan_bits) / num_bark;
322322 float en_spread_low = j ? PSY_3GPP_EN_SPREAD_LOW_S : PSY_3GPP_EN_SPREAD_LOW_L;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t