aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2007-12-28 05:32:12 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2007-12-28 05:32:12 +0000
commit08ac1e783e5160257fe58aec5b0ca611ab8c7498 (patch)
tree63a3db10cfc4c1a73fcf7671e3ecd3e4fdd5181b /libavcodec
parent359154bc1bb9d935e25dc2a3d818152971ddd133 (diff)
downloadffmpeg-08ac1e783e5160257fe58aec5b0ca611ab8c7498.tar.gz
use bps instead of kbps for bitrate
Originally committed as revision 11337 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ac3enc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index d90df530ff..e84b220dc8 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -669,9 +669,8 @@ static int AC3_encode_init(AVCodecContext *avctx)
s->bitstream_mode = 0; /* complete main audio service */
/* bitrate & frame size */
- bitrate /= 1000;
for(i=0;i<19;i++) {
- if ((ff_ac3_bitrate_tab[i] >> s->sr_shift) == bitrate)
+ if ((ff_ac3_bitrate_tab[i] >> s->sr_shift)*1000 == bitrate)
break;
}
if (i == 19)
@@ -1240,11 +1239,11 @@ static int AC3_encode_frame(AVCodecContext *avctx,
}
/* adjust for fractional frame sizes */
- while(s->bits_written >= s->bit_rate*1000 && s->samples_written >= s->sample_rate) {
- s->bits_written -= s->bit_rate*1000;
+ while(s->bits_written >= s->bit_rate && s->samples_written >= s->sample_rate) {
+ s->bits_written -= s->bit_rate;
s->samples_written -= s->sample_rate;
}
- s->frame_size = s->frame_size_min + (s->bits_written * s->sample_rate < s->samples_written * s->bit_rate*1000);
+ s->frame_size = s->frame_size_min + (s->bits_written * s->sample_rate < s->samples_written * s->bit_rate);
s->bits_written += s->frame_size * 16;
s->samples_written += AC3_FRAME_SIZE;