History

use common aac sample rate tables

Originally committed as revision 12671 to svn://svn.ffmpeg.org/ffmpeg/trunk

Aurelien Jacobs committed 18 years ago

Commit 7bfacd41 parent b2fec0f3 files · +9 −14Browse files

Unified · Split

3 files
  1. libavcodec/Makefile +3 −2
  2. libavformat/matroskadec.c +3 −6
  3. libavformat/matroskaenc.c +3 −6
libavcodec/Makefile+3−2
@@ -306,8 +306,9 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcm.o · 305 unmodified lines
306306
307307 # libavformat dependencies
308308 OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o
309−OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o
310−OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o
309+OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o
310+OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o
311+OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o
311312 OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
312313 OBJS-$(CONFIG_OGG_MUXER) += xiph.o
313314 OBJS-$(CONFIG_RTP_MUXER) += mpegvideo.o
libavformat/matroskadec.c+3−6
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include "riff.h"
3434 #include "intfloat_readwrite.h"
3535 #include "matroska.h"
36+#include "libavcodec/mpeg4audio.h"
3637
3738 typedef struct Track {
3839 MatroskaTrackType type;
@@ -1997,14 +1998,10 @@ matroska_aac_profile (char *codec_id) · 1958 unmodified lines
19971998 static int
19981999 matroska_aac_sri (int samplerate)
19992000 {
2000− static const int aac_sample_rates[] = {
2001− 96000, 88200, 64000, 48000, 44100, 32000,
2002− 24000, 22050, 16000, 12000, 11025, 8000,
2003− };
20042001 int sri;
20052002
2006− for (sri=0; sri<ARRAY_SIZE(aac_sample_rates); sri++)
2007− if (aac_sample_rates[sri] == samplerate)
2003+ for (sri=0; sri<ARRAY_SIZE(ff_mpeg4audio_sample_rates); sri++)
2004+ if (ff_mpeg4audio_sample_rates[sri] == samplerate)
20082005 break;
20092006 return sri;
20102007 }
libavformat/matroskaenc.c+3−6
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include "xiph.h"
2626 #include "matroska.h"
2727 #include "avc.h"
28+#include "libavcodec/mpeg4audio.h"
2829
2930 typedef struct ebml_master {
3031 offset_t pos; ///< absolute offset in the file where the master's elements start
@@ -438,10 +439,6 @@ static int put_flac_codecpriv(AVFormatContext *s, ByteIOContext *pb, AVCodecCont · 407 unmodified lines
438439
439440 static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int *sample_rate, int *output_sample_rate)
440441 {
441− static const int aac_sample_rates[] = {
442− 96000, 88200, 64000, 48000, 44100, 32000,
443− 24000, 22050, 16000, 12000, 11025, 8000,
444− };
445442 int sri;
446443
447444 if (codec->extradata_size < 2) {
@@ -454,7 +451,7 @@ static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int · 6 unmodified lines
454451 av_log(s, AV_LOG_WARNING, "AAC samplerate index out of bounds\n");
455452 return;
456453 }
457− *sample_rate = aac_sample_rates[sri];
454+ *sample_rate = ff_mpeg4audio_sample_rates[sri];
458455
459456 // if sbr, get output sample rate as well
460457 if (codec->extradata_size == 5) {
@@ -463,7 +460,7 @@ static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int · 2 unmodified lines
463460 av_log(s, AV_LOG_WARNING, "AAC output samplerate index out of bounds\n");
464461 return;
465462 }
466− *output_sample_rate = aac_sample_rates[sri];
463+ *output_sample_rate = ff_mpeg4audio_sample_rates[sri];
467464 }
468465 }
469466

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