diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2007-03-11 02:13:05 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2007-03-11 02:13:05 +0000 |
commit | 050aa8b9bca6a2c29e1c4c914e05aca49007f1d7 (patch) | |
tree | d58da1f718db33a9d243668d4940a60a5d455388 /libavcodec/ac3enc.c | |
parent | 755c18ae5d19f940dfd05d8278637635fd8eece5 (diff) | |
download | ffmpeg-050aa8b9bca6a2c29e1c4c914e05aca49007f1d7.tar.gz |
remove redundancy in AC-3 parser by using common tables from ac3tab.h
Originally committed as revision 8318 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r-- | libavcodec/ac3enc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 4037b91528..623541d23b 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -611,6 +611,8 @@ static int AC3_encode_init(AVCodecContext *avctx) avctx->frame_size = AC3_FRAME_SIZE; + ac3_common_init(); + /* number of channels */ if (channels < 1 || channels > 6) return -1; @@ -644,7 +646,7 @@ static int AC3_encode_init(AVCodecContext *avctx) return -1; s->bit_rate = bitrate; s->frmsizecod = i << 1; - s->frame_size_min = (bitrate * 1000 * AC3_FRAME_SIZE) / (freq * 16); + s->frame_size_min = ff_ac3_frame_sizes[s->frmsizecod][s->fscod]; s->bits_written = 0; s->samples_written = 0; s->frame_size = s->frame_size_min; @@ -663,8 +665,6 @@ static int AC3_encode_init(AVCodecContext *avctx) /* initial snr offset */ s->csnroffst = 40; - ac3_common_init(); - /* mdct init */ fft_init(MDCT_NBITS - 2); for(i=0;i<N/4;i++) { |