build: Split WMA frequencies into a separate object file
authorDiego Biurrun <diego@biurrun.de>
Wed, 3 Sep 2014 10:27:27 +0000 (03:27 -0700)
committerDiego Biurrun <diego@biurrun.de>
Thu, 4 Sep 2014 12:19:46 +0000 (05:19 -0700)
These are the only WMA bits shared with binkaudio. Splitting them off
reduces the binnkaudio dependency on general WMA code.

configure
libavcodec/Makefile
libavcodec/binkaudio.c
libavcodec/wma.c
libavcodec/wma.h
libavcodec/wma_freqs.c [new file with mode: 0644]
libavcodec/wma_freqs.h [new file with mode: 0644]
libavcodec/wmadata.h

index af0128a..ba9d7a6 100755 (executable)
--- a/configure
+++ b/configure
@@ -1584,6 +1584,7 @@ CONFIG_EXTRA="
     tpeldsp
     videodsp
     vp3dsp
     tpeldsp
     videodsp
     vp3dsp
+    wma_freqs
 "
 
 CMDLINE_SELECT="
 "
 
 CMDLINE_SELECT="
@@ -1756,8 +1757,8 @@ atrac1_decoder_select="mdct sinewin"
 atrac3_decoder_select="mdct"
 atrac3p_decoder_select="mdct sinewin"
 bink_decoder_select="blockdsp hpeldsp"
 atrac3_decoder_select="mdct"
 atrac3p_decoder_select="mdct sinewin"
 bink_decoder_select="blockdsp hpeldsp"
-binkaudio_dct_decoder_select="mdct rdft dct sinewin"
-binkaudio_rdft_decoder_select="mdct rdft sinewin"
+binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
+binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
 cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
 cllc_decoder_select="bswapdsp"
 comfortnoise_encoder_select="lpc"
 cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
 cllc_decoder_select="bswapdsp"
 comfortnoise_encoder_select="lpc"
@@ -1901,11 +1902,11 @@ vp7_decoder_select="h264pred videodsp"
 vp8_decoder_select="h264pred videodsp"
 vp9_decoder_select="videodsp"
 webp_decoder_select="vp8_decoder"
 vp8_decoder_select="h264pred videodsp"
 vp9_decoder_select="videodsp"
 webp_decoder_select="vp8_decoder"
-wmapro_decoder_select="mdct sinewin"
-wmav1_decoder_select="mdct sinewin"
-wmav1_encoder_select="mdct sinewin"
-wmav2_decoder_select="mdct sinewin"
-wmav2_encoder_select="mdct sinewin"
+wmapro_decoder_select="mdct sinewin wma_freqs"
+wmav1_decoder_select="mdct sinewin wma_freqs"
+wmav1_encoder_select="mdct sinewin wma_freqs"
+wmav2_decoder_select="mdct sinewin wma_freqs"
+wmav2_encoder_select="mdct sinewin wma_freqs"
 wmavoice_decoder_select="lsp rdft dct mdct sinewin"
 wmv1_decoder_select="h263_decoder"
 wmv1_encoder_select="h263_encoder"
 wmavoice_decoder_select="lsp rdft dct mdct sinewin"
 wmv1_decoder_select="h263_decoder"
 wmv1_encoder_select="h263_encoder"
index fd194f4..c8d820b 100644 (file)
@@ -82,6 +82,7 @@ OBJS-$(CONFIG_STARTCODE)               += startcode.o
 OBJS-$(CONFIG_TPELDSP)                 += tpeldsp.o
 OBJS-$(CONFIG_VIDEODSP)                += videodsp.o
 OBJS-$(CONFIG_VP3DSP)                  += vp3dsp.o
 OBJS-$(CONFIG_TPELDSP)                 += tpeldsp.o
 OBJS-$(CONFIG_VIDEODSP)                += videodsp.o
 OBJS-$(CONFIG_VP3DSP)                  += vp3dsp.o
+OBJS-$(CONFIG_WMA_FREQS)               += wma_freqs.o
 
 # decoders/encoders
 OBJS-$(CONFIG_A64MULTI_ENCODER)        += a64multienc.o elbg.o
 
 # decoders/encoders
 OBJS-$(CONFIG_A64MULTI_ENCODER)        += a64multienc.o elbg.o
@@ -130,8 +131,8 @@ OBJS-$(CONFIG_AVS_DECODER)             += avs.o
 OBJS-$(CONFIG_BETHSOFTVID_DECODER)     += bethsoftvideo.o
 OBJS-$(CONFIG_BFI_DECODER)             += bfi.o
 OBJS-$(CONFIG_BINK_DECODER)            += bink.o binkdsp.o
 OBJS-$(CONFIG_BETHSOFTVID_DECODER)     += bethsoftvideo.o
 OBJS-$(CONFIG_BFI_DECODER)             += bfi.o
 OBJS-$(CONFIG_BINK_DECODER)            += bink.o binkdsp.o
-OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER)   += binkaudio.o wma.o wma_common.o
-OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER)  += binkaudio.o wma.o wma_common.o
+OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER)   += binkaudio.o
+OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER)  += binkaudio.o
 OBJS-$(CONFIG_BMP_DECODER)             += bmp.o msrledec.o
 OBJS-$(CONFIG_BMP_ENCODER)             += bmpenc.o
 OBJS-$(CONFIG_BMV_AUDIO_DECODER)       += bmvaudio.o
 OBJS-$(CONFIG_BMP_DECODER)             += bmp.o msrledec.o
 OBJS-$(CONFIG_BMP_ENCODER)             += bmpenc.o
 OBJS-$(CONFIG_BMV_AUDIO_DECODER)       += bmvaudio.o
index ddaa613..eb9cd0a 100644 (file)
@@ -36,7 +36,7 @@
 #include "rdft.h"
 #include "fmtconvert.h"
 #include "internal.h"
 #include "rdft.h"
 #include "fmtconvert.h"
 #include "internal.h"
-#include "wma.h"
+#include "wma_freqs.h"
 #include "libavutil/intfloat.h"
 
 static float quant_table[96];
 #include "libavutil/intfloat.h"
 
 static float quant_table[96];
index 447aba8..cb7a16d 100644 (file)
@@ -25,6 +25,7 @@
 #include "sinewin.h"
 #include "wma.h"
 #include "wma_common.h"
 #include "sinewin.h"
 #include "wma.h"
 #include "wma_common.h"
+#include "wma_freqs.h"
 #include "wmadata.h"
 
 #undef NDEBUG
 #include "wmadata.h"
 
 #undef NDEBUG
index e8c990f..3a9de40 100644 (file)
@@ -139,7 +139,6 @@ typedef struct WMACodecContext {
 #endif /* TRACE */
 } WMACodecContext;
 
 #endif /* TRACE */
 } WMACodecContext;
 
-extern const uint16_t ff_wma_critical_freqs[25];
 extern const uint16_t ff_wma_hgain_huffcodes[37];
 extern const uint8_t ff_wma_hgain_huffbits[37];
 extern const float ff_wma_lsp_codebook[NB_LSP_COEFS][16];
 extern const uint16_t ff_wma_hgain_huffcodes[37];
 extern const uint8_t ff_wma_hgain_huffbits[37];
 extern const float ff_wma_lsp_codebook[NB_LSP_COEFS][16];
diff --git a/libavcodec/wma_freqs.c b/libavcodec/wma_freqs.c
new file mode 100644 (file)
index 0000000..82cef3b
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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 "wma_freqs.h"
+
+const uint16_t ff_wma_critical_freqs[25] = {
+      100,   200,  300,  400,  510,  630,   770,   920,
+     1080,  1270, 1480, 1720, 2000, 2320,  2700,  3150,
+     3700,  4400, 5300, 6400, 7700, 9500, 12000, 15500,
+    24500,
+};
diff --git a/libavcodec/wma_freqs.h b/libavcodec/wma_freqs.h
new file mode 100644 (file)
index 0000000..415c83b
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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
+ */
+
+#ifndef AVCODEC_WMA_FREQS_H
+#define AVCODEC_WMA_FREQS_H
+
+#include <stdint.h>
+
+extern const uint16_t ff_wma_critical_freqs[25];
+
+#endif /* AVCODEC_WMA_FREQS */
index 9a99776..58bffed 100644 (file)
 
 #include "wma.h"
 
 
 #include "wma.h"
 
-const uint16_t ff_wma_critical_freqs[25] = {
-      100,   200,  300,  400,  510,  630,   770,   920,
-     1080,  1270, 1480, 1720, 2000, 2320,  2700,  3150,
-     3700,  4400, 5300, 6400, 7700, 9500, 12000, 15500,
-    24500,
-};
-
 /* first value is number of bands */
 static const uint8_t exponent_band_22050[3][25] = {
     { 10,  4,  8,  4,  8,  8, 12, 20, 24, 24, 16, },
 /* first value is number of bands */
 static const uint8_t exponent_band_22050[3][25] = {
     { 10,  4,  8,  4,  8,  8, 12, 20, 24, 24, 16, },