[FFmpeg-devel] [PATCH] avcodec/dca: move EXSS sampling frequency arrays to dca.c

foo86 foobaz86 at gmail.com
Thu May 26 13:29:35 CEST 2016


Avoids unwanted parser dependency on dcadata.
---
 libavcodec/Makefile     | 2 +-
 libavcodec/dca.c        | 9 +++++++++
 libavcodec/dca.h        | 3 +++
 libavcodec/dca_exss.c   | 1 -
 libavcodec/dca_parser.c | 1 -
 libavcodec/dcadata.c    | 9 ---------
 libavcodec/dcadata.h    | 3 ---
 7 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 224ccf7..46dd9e1 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -900,7 +900,7 @@ OBJS-$(CONFIG_ADX_PARSER)              += adx_parser.o adx.o
 OBJS-$(CONFIG_BMP_PARSER)              += bmp_parser.o
 OBJS-$(CONFIG_CAVSVIDEO_PARSER)        += cavs_parser.o
 OBJS-$(CONFIG_COOK_PARSER)             += cook_parser.o
-OBJS-$(CONFIG_DCA_PARSER)              += dca_parser.o dca_exss.o dcadata.o dca.o
+OBJS-$(CONFIG_DCA_PARSER)              += dca_parser.o dca_exss.o dca.o
 OBJS-$(CONFIG_DIRAC_PARSER)            += dirac_parser.o
 OBJS-$(CONFIG_DNXHD_PARSER)            += dnxhd_parser.o
 OBJS-$(CONFIG_DPX_PARSER)              += dpx_parser.o
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 714509b..f11c73c 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -36,6 +36,15 @@ const uint32_t avpriv_dca_sample_rates[16] = {
     12000, 24000, 48000, 96000, 192000
 };
 
+const uint32_t ff_dca_sampling_freqs[16] = {
+      8000,  16000, 32000, 64000, 128000, 22050,  44100,  88200,
+    176400, 352800, 12000, 24000,  48000, 96000, 192000, 384000,
+};
+
+const uint8_t ff_dca_freq_ranges[16] = {
+    0, 1, 2, 3, 4, 1, 2, 3, 4, 4, 0, 1, 2, 3, 4, 4
+};
+
 int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
                              int max_size)
 {
diff --git a/libavcodec/dca.h b/libavcodec/dca.h
index a1ac763..bd96bc9 100644
--- a/libavcodec/dca.h
+++ b/libavcodec/dca.h
@@ -154,6 +154,9 @@ enum DCADownMixType {
 
 extern av_export const uint32_t avpriv_dca_sample_rates[16];
 
+extern const uint32_t ff_dca_sampling_freqs[16];
+extern const uint8_t ff_dca_freq_ranges[16];
+
 /**
  * Convert bitstream to one representation based on sync marker
  */
diff --git a/libavcodec/dca_exss.c b/libavcodec/dca_exss.c
index fcabd07..e873088 100644
--- a/libavcodec/dca_exss.c
+++ b/libavcodec/dca_exss.c
@@ -19,7 +19,6 @@
  */
 
 #include "dcadec.h"
-#include "dcadata.h"
 
 static void parse_xll_parameters(DCAExssParser *s, DCAExssAsset *asset)
 {
diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c
index 6c84575..e5bea33 100644
--- a/libavcodec/dca_parser.c
+++ b/libavcodec/dca_parser.c
@@ -23,7 +23,6 @@
  */
 
 #include "dca.h"
-#include "dcadata.h"
 #include "dca_exss.h"
 #include "dca_syncwords.h"
 #include "get_bits.h"
diff --git a/libavcodec/dcadata.c b/libavcodec/dcadata.c
index 2d533d0..39aea73 100644
--- a/libavcodec/dcadata.c
+++ b/libavcodec/dcadata.c
@@ -8725,15 +8725,6 @@ const int32_t ff_dca_xll_band_coeff[20] = {
      3259333, -5074941,  6928550, -8204883
 };
 
-const uint32_t ff_dca_sampling_freqs[16] = {
-      8000,  16000, 32000, 64000, 128000, 22050,  44100,  88200,
-    176400, 352800, 12000, 24000,  48000, 96000, 192000, 384000,
-};
-
-const uint8_t ff_dca_freq_ranges[16] = {
-    0, 1, 2, 3, 4, 1, 2, 3, 4, 4, 0, 1, 2, 3, 4, 4
-};
-
 const uint16_t ff_dca_avg_g3_freqs[3] = { 16000, 18000, 24000 };
 
 const uint16_t ff_dca_fst_amp[44] = {
diff --git a/libavcodec/dcadata.h b/libavcodec/dcadata.h
index 1ef1342..17aa712 100644
--- a/libavcodec/dcadata.h
+++ b/libavcodec/dcadata.h
@@ -71,9 +71,6 @@ extern const uint16_t ff_dca_xll_refl_coeff[128];
 
 extern const int32_t ff_dca_xll_band_coeff[20];
 
-extern const uint32_t ff_dca_sampling_freqs[16];
-extern const uint8_t ff_dca_freq_ranges[16];
-
 extern const uint16_t ff_dca_avg_g3_freqs[3];
 
 extern const uint16_t ff_dca_fst_amp[44];
-- 
2.8.1



More information about the ffmpeg-devel mailing list