aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegaudiodec.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2007-05-20 22:50:29 +0000
committerAurelien Jacobs <aurel@gnuage.org>2007-05-20 22:50:29 +0000
commit08aa2c9bd2a3b5d26693ee3a58c38eedc9ee3246 (patch)
treece95a465fcf9cdd89a5100c7ccc6b683b5d1c2a5 /libavcodec/mpegaudiodec.c
parentca6e50afc13acdd764527c0fcfe13d1ea90b4d98 (diff)
downloadffmpeg-08aa2c9bd2a3b5d26693ee3a58c38eedc9ee3246.tar.gz
remove dependency of mpeg audio encoder over mpeg audio decoder
Originally committed as revision 9082 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r--libavcodec/mpegaudiodec.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index b6fc291cac..bfd54d535a 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1140,28 +1140,6 @@ static int mp_decode_layer1(MPADecodeContext *s)
return 12;
}
-/* bitrate is in kb/s */
-int l2_select_table(int bitrate, int nb_channels, int freq, int lsf)
-{
- int ch_bitrate, table;
-
- ch_bitrate = bitrate / nb_channels;
- if (!lsf) {
- if ((freq == 48000 && ch_bitrate >= 56) ||
- (ch_bitrate >= 56 && ch_bitrate <= 80))
- table = 0;
- else if (freq != 48000 && ch_bitrate >= 96)
- table = 1;
- else if (freq != 32000 && ch_bitrate <= 48)
- table = 2;
- else
- table = 3;
- } else {
- table = 4;
- }
- return table;
-}
-
static int mp_decode_layer2(MPADecodeContext *s)
{
int sblimit; /* number of used subbands */
@@ -1173,7 +1151,7 @@ static int mp_decode_layer2(MPADecodeContext *s)
int scale, qindex, bits, steps, k, l, m, b;
/* select decoding table */
- table = l2_select_table(s->bit_rate / 1000, s->nb_channels,
+ table = ff_mpa_l2_select_table(s->bit_rate / 1000, s->nb_channels,
s->sample_rate, s->lsf);
sblimit = ff_mpa_sblimit_table[table];
alloc_table = ff_mpa_alloc_tables[table];