diff options
author | Diego Biurrun <diego@biurrun.de> | 2012-07-31 20:09:23 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2012-08-01 00:17:17 +0200 |
commit | 9e4bca16f89bc12c58b58f4611d580a30d5f9638 (patch) | |
tree | 79a83fbc3226c5739fb2931f1dce0a566c36fa4f /libavcodec | |
parent | 13a79cf84e073d0ca8489047660352eee216d059 (diff) | |
download | ffmpeg-9e4bca16f89bc12c58b58f4611d580a30d5f9638.tar.gz |
dca: Move tables used outside of dcadec.c to a separate file.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/Makefile | 5 | ||||
-rw-r--r-- | libavcodec/dca.c | 29 | ||||
-rw-r--r-- | libavcodec/dca.h | 4 | ||||
-rw-r--r-- | libavcodec/dca_parser.c | 3 | ||||
-rw-r--r-- | libavcodec/dcadata.h | 6 | ||||
-rw-r--r-- | libavcodec/dcadec.c | 2 |
6 files changed, 38 insertions, 11 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 2d0006f74b..7fc50594ff 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -119,7 +119,7 @@ OBJS-$(CONFIG_CLJR_ENCODER) += cljr.o OBJS-$(CONFIG_COOK_DECODER) += cook.o OBJS-$(CONFIG_CSCD_DECODER) += cscd.o OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o -OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dcadsp.o \ +OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \ dca_parser.o synth_filter.o OBJS-$(CONFIG_DFA_DECODER) += dfa.o OBJS-$(CONFIG_DNXHD_DECODER) += dnxhddec.o dnxhddata.o @@ -596,6 +596,7 @@ OBJS-$(CONFIG_OGG_DEMUXER) += xiph.o flac.o flacdata.o \ OBJS-$(CONFIG_OGG_MUXER) += xiph.o flac.o flacdata.o OBJS-$(CONFIG_RTP_MUXER) += mpeg4audio.o mpegvideo.o xiph.o OBJS-$(CONFIG_SPDIF_DEMUXER) += aacadtsdec.o mpeg4audio.o +OBJS-$(CONFIG_SPDIF_MUXER) += dca.o OBJS-$(CONFIG_WEBM_MUXER) += mpeg4audio.o mpegaudiodata.o \ xiph.o flac.o flacdata.o OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o @@ -641,7 +642,7 @@ OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \ OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o OBJS-$(CONFIG_COOK_PARSER) += cook_parser.o -OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o +OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o dca.o OBJS-$(CONFIG_DIRAC_PARSER) += dirac_parser.o OBJS-$(CONFIG_DNXHD_PARSER) += dnxhd_parser.o OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o diff --git a/libavcodec/dca.c b/libavcodec/dca.c new file mode 100644 index 0000000000..4194f58aa9 --- /dev/null +++ b/libavcodec/dca.c @@ -0,0 +1,29 @@ +/* + * DCA compatible decoder data + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> + +#include "dca.h" + +const uint32_t ff_dca_sample_rates[16] = +{ + 0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, + 12000, 24000, 48000, 96000, 192000 +}; diff --git a/libavcodec/dca.h b/libavcodec/dca.h index 8ea6049e0d..9235fa4f0b 100644 --- a/libavcodec/dca.h +++ b/libavcodec/dca.h @@ -25,6 +25,8 @@ #ifndef AVCODEC_DCA_H #define AVCODEC_DCA_H +#include <stdint.h> + /** DCA syncwords, also used for bitstream type detection */ #define DCA_MARKER_RAW_BE 0x7FFE8001 #define DCA_MARKER_RAW_LE 0xFE7F0180 @@ -34,4 +36,6 @@ /** DCA-HD specific block starts with this marker. */ #define DCA_HD_MARKER 0x64582025 +extern const uint32_t ff_dca_sample_rates[16]; + #endif /* AVCODEC_DCA_H */ diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c index e7b2ce42cc..553e69c41c 100644 --- a/libavcodec/dca_parser.c +++ b/libavcodec/dca_parser.c @@ -24,7 +24,6 @@ #include "parser.h" #include "dca.h" -#include "dcadata.h" #include "dca_parser.h" #include "get_bits.h" #include "put_bits.h" @@ -162,7 +161,7 @@ static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration, skip_bits(&gb, 20); sr_code = get_bits(&gb, 4); - *sample_rate = dca_sample_rates[sr_code]; + *sample_rate = ff_dca_sample_rates[sr_code]; if (*sample_rate == 0) return AVERROR_INVALIDDATA; diff --git a/libavcodec/dcadata.h b/libavcodec/dcadata.h index 4b58ef7c38..324e40f104 100644 --- a/libavcodec/dcadata.h +++ b/libavcodec/dcadata.h @@ -28,12 +28,6 @@ /* Generic tables */ -static const uint32_t dca_sample_rates[16] = -{ - 0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, - 12000, 24000, 48000, 96000, 192000 -}; - static const uint32_t dca_bit_rates[32] = { 32000, 56000, 64000, 96000, 112000, 128000, diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index b37dc49d3f..f488da6d3f 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -561,7 +561,7 @@ static int dca_parse_frame_header(DCAContext *s) if (s->frame_size < 95) return AVERROR_INVALIDDATA; s->amode = get_bits(&s->gb, 6); - s->sample_rate = dca_sample_rates[get_bits(&s->gb, 4)]; + s->sample_rate = ff_dca_sample_rates[get_bits(&s->gb, 4)]; if (!s->sample_rate) return AVERROR_INVALIDDATA; s->bit_rate_index = get_bits(&s->gb, 5); |