summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-04-30 12:20:25 +0000
committerMohamed Tarek <mt@rockbox.org>2010-04-30 12:20:25 +0000
commitfe147cec651486d39967f24d0d1bbe6ae1cd067b (patch)
treeef15055d39c17e05c91f591b5d4f264bfd421e5e /apps/codecs
parentcf43e5083b9e0f87de262ea31fd8067225ebfcda (diff)
downloadrockbox-fe147cec651486d39967f24d0d1bbe6ae1cd067b.tar.gz
rockbox-fe147cec651486d39967f24d0d1bbe6ae1cd067b.zip
Modify the ffmpeg source files in apps/codecs/libwmapro in order to compile the codec standalone.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25764 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/libwmapro/Makefile11
-rw-r--r--apps/codecs/libwmapro/README.rockbox33
-rw-r--r--apps/codecs/libwmapro/avcodec.h12
-rw-r--r--apps/codecs/libwmapro/bitstream.c3
-rw-r--r--apps/codecs/libwmapro/dsputil.c49
-rw-r--r--apps/codecs/libwmapro/fft.c4
-rw-r--r--apps/codecs/libwmapro/fft.h2
-rw-r--r--apps/codecs/libwmapro/libavutil/avutil.h6
-rw-r--r--apps/codecs/libwmapro/libavutil/bswap.h2
-rw-r--r--apps/codecs/libwmapro/libavutil/common.h3
-rw-r--r--apps/codecs/libwmapro/libavutil/internal.h6
-rw-r--r--apps/codecs/libwmapro/libavutil/intreadwrite.h2
-rw-r--r--apps/codecs/libwmapro/libavutil/mathematics.c4
-rw-r--r--apps/codecs/libwmapro/libavutil/mathematics.h6
-rw-r--r--apps/codecs/libwmapro/libavutil/mem.c2
-rw-r--r--apps/codecs/libwmapro/mdct_tablegen.h2
-rw-r--r--apps/codecs/libwmapro/wma.c8
-rw-r--r--apps/codecs/libwmapro/wmaprodec.c20
18 files changed, 123 insertions, 52 deletions
diff --git a/apps/codecs/libwmapro/Makefile b/apps/codecs/libwmapro/Makefile
new file mode 100644
index 0000000000..74334ffad5
--- /dev/null
+++ b/apps/codecs/libwmapro/Makefile
@@ -0,0 +1,11 @@
1STD = c99
2LINK = -lm
3CFLAGS = -Wall -std=$(STD)
4TARGET = test
5OBJS = wmaprodec.c wma.c dsputil.c mdct.c fft.c bitstream.c libavutil/log.c libavutil/mem.c libavutil/mathematics.c
6$(TARGET): $(OBJS)
7 gcc $(CFLAGS) $(OBJS) $(LINK) -o $(TARGET)
8
9clean:
10 rm -f $(TARGET) *~ *.o libavutil/*.o
11
diff --git a/apps/codecs/libwmapro/README.rockbox b/apps/codecs/libwmapro/README.rockbox
new file mode 100644
index 0000000000..9b6e7d7507
--- /dev/null
+++ b/apps/codecs/libwmapro/README.rockbox
@@ -0,0 +1,33 @@
1Library: libwmapro
2Imported: 2010-04-30 by Mohamed Tarek
3
4This set of files form the files needed from ffmpeg's libavcodec and libavutil
5to build a standalone wma professional decoder.
6
7LICENSING INFORMATION
8
9ffmpeg is licensed under the Lesser GNU General Public License and the file
10wmaprodec.c is copyright (c) 2007 Baptiste Coudurier, Benjamin Larsson, Ulion
11and copyright (c) 2008 - 2009 Sascha Sommer, Benjamin Larsson.
12
13IMPORT DETAILS
14
15Based on ffmpeg svn r228866 dated 15 April 2010.
16
17Currently, the files contain minimal changes from their original state in order
18to be able to compile cleanly.
19
20The file wmaprodec.c contains a main function that is just a stub to make sure
21linking is done properly and without errors.
22
23COMPILING
24
25A make file is included that would compile and link the files when the "make"
26command is executed without arguments in any Unix-like environment.
27
28The file porduces an output binary called "test" that, as of now (30 April 2010)
29, is still useless.
30
31To clean the compiler output and retain just the source code, the following
32command should be executed:
33make clean
diff --git a/apps/codecs/libwmapro/avcodec.h b/apps/codecs/libwmapro/avcodec.h
index add4b100ae..da67b32fa2 100644
--- a/apps/codecs/libwmapro/avcodec.h
+++ b/apps/codecs/libwmapro/avcodec.h
@@ -1090,7 +1090,7 @@ typedef struct AVCodecContext {
1090 * - encoding: MUST be set by user. 1090 * - encoding: MUST be set by user.
1091 * - decoding: Set by libavcodec. 1091 * - decoding: Set by libavcodec.
1092 */ 1092 */
1093 AVRational time_base; 1093 //AVRational time_base;
1094 1094
1095 /* video only */ 1095 /* video only */
1096 /** 1096 /**
@@ -1116,7 +1116,7 @@ typedef struct AVCodecContext {
1116 * - encoding: Set by user. 1116 * - encoding: Set by user.
1117 * - decoding: Set by libavcodec. 1117 * - decoding: Set by libavcodec.
1118 */ 1118 */
1119 enum PixelFormat pix_fmt; 1119 //enum PixelFormat pix_fmt;
1120 1120
1121 /** 1121 /**
1122 * Frame rate emulation. If not zero, the lower layer (i.e. format handler) 1122 * Frame rate emulation. If not zero, the lower layer (i.e. format handler)
@@ -1660,7 +1660,7 @@ typedef struct AVCodecContext {
1660 * - encoding: Set by user. 1660 * - encoding: Set by user.
1661 * - decoding: Set by libavcodec. 1661 * - decoding: Set by libavcodec.
1662 */ 1662 */
1663 AVRational sample_aspect_ratio; 1663 //AVRational sample_aspect_ratio;
1664 1664
1665 /** 1665 /**
1666 * the picture in the bitstream 1666 * the picture in the bitstream
@@ -2677,7 +2677,7 @@ typedef struct AVCodec {
2677 * Will be called when seeking 2677 * Will be called when seeking
2678 */ 2678 */
2679 void (*flush)(AVCodecContext *); 2679 void (*flush)(AVCodecContext *);
2680 const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} 2680 //const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
2681 const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 2681 const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
2682 /** 2682 /**
2683 * Descriptive name for the codec, meant to be more human readable than name. 2683 * Descriptive name for the codec, meant to be more human readable than name.
@@ -2719,7 +2719,7 @@ typedef struct AVHWAccel {
2719 * 2719 *
2720 * Only hardware accelerated formats are supported here. 2720 * Only hardware accelerated formats are supported here.
2721 */ 2721 */
2722 enum PixelFormat pix_fmt; 2722 //enum PixelFormat pix_fmt;
2723 2723
2724 /** 2724 /**
2725 * Hardware accelerated codec capabilities. 2725 * Hardware accelerated codec capabilities.
@@ -3885,7 +3885,7 @@ int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
3885 * @param[in,out] frame_rate pointer to the AVRational which will contain the detected 3885 * @param[in,out] frame_rate pointer to the AVRational which will contain the detected
3886 * frame rate 3886 * frame rate
3887 */ 3887 */
3888int av_parse_video_frame_rate(AVRational *frame_rate, const char *str); 3888//int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
3889 3889
3890/** 3890/**
3891 * Logs a generic warning message about a missing feature. This function is 3891 * Logs a generic warning message about a missing feature. This function is
diff --git a/apps/codecs/libwmapro/bitstream.c b/apps/codecs/libwmapro/bitstream.c
index 1e24099cc8..47234e10e1 100644
--- a/apps/codecs/libwmapro/bitstream.c
+++ b/apps/codecs/libwmapro/bitstream.c
@@ -65,7 +65,8 @@ void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
65 int i; 65 int i;
66 66
67 if(length==0) return; 67 if(length==0) return;
68 68/* The following define was just added to make the codec (wma pro) compile */
69#define CONFIG_SMALL 0
69 if(CONFIG_SMALL || words < 16 || put_bits_count(pb)&7){ 70 if(CONFIG_SMALL || words < 16 || put_bits_count(pb)&7){
70 for(i=0; i<words; i++) put_bits(pb, 16, AV_RB16(src + 2*i)); 71 for(i=0; i<words; i++) put_bits(pb, 16, AV_RB16(src + 2*i));
71 }else{ 72 }else{
diff --git a/apps/codecs/libwmapro/dsputil.c b/apps/codecs/libwmapro/dsputil.c
index bbfdb6ae8d..b09311925a 100644
--- a/apps/codecs/libwmapro/dsputil.c
+++ b/apps/codecs/libwmapro/dsputil.c
@@ -29,17 +29,18 @@
29 29
30#include "avcodec.h" 30#include "avcodec.h"
31#include "dsputil.h" 31#include "dsputil.h"
32#include "simple_idct.h" 32//#include "simple_idct.h"
33#include "faandct.h" 33//#include "faandct.h"
34#include "faanidct.h" 34//#include "faanidct.h"
35#include "mathops.h" 35#include "mathops.h"
36#include "mpegvideo.h" 36//#include "mpegvideo.h"
37#include "config.h" 37//#include "config.h"
38#include "lpc.h" 38//#include "lpc.h"
39#include "ac3dec.h" 39//#include "ac3dec.h"
40#include "vorbis.h" 40//#include "vorbis.h"
41#include "png.h" 41//#include "png.h"
42 42
43#if 0
43uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP] = {0, }; 44uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP] = {0, };
44uint32_t ff_squareTbl[512] = {0, }; 45uint32_t ff_squareTbl[512] = {0, };
45 46
@@ -3797,6 +3798,8 @@ WRAPPER8_16_SQ(quant_psnr8x8_c, quant_psnr16_c)
3797WRAPPER8_16_SQ(rd8x8_c, rd16_c) 3798WRAPPER8_16_SQ(rd8x8_c, rd16_c)
3798WRAPPER8_16_SQ(bit8x8_c, bit16_c) 3799WRAPPER8_16_SQ(bit8x8_c, bit16_c)
3799 3800
3801#endif /* 0 */
3802
3800static void vector_fmul_c(float *dst, const float *src, int len){ 3803static void vector_fmul_c(float *dst, const float *src, int len){
3801 int i; 3804 int i;
3802 for(i=0; i<len; i++) 3805 for(i=0; i<len; i++)
@@ -3838,7 +3841,7 @@ static void vector_fmul_scalar_c(float *dst, const float *src, float mul,
3838 for (i = 0; i < len; i++) 3841 for (i = 0; i < len; i++)
3839 dst[i] = src[i] * mul; 3842 dst[i] = src[i] * mul;
3840} 3843}
3841 3844#if 0
3842static void vector_fmul_sv_scalar_2_c(float *dst, const float *src, 3845static void vector_fmul_sv_scalar_2_c(float *dst, const float *src,
3843 const float **sv, float mul, int len) 3846 const float **sv, float mul, int len)
3844{ 3847{
@@ -3911,6 +3914,7 @@ static void int32_to_float_fmul_scalar_c(float *dst, const int *src, float mul,
3911 dst[i] = src[i] * mul; 3914 dst[i] = src[i] * mul;
3912} 3915}
3913 3916
3917
3914static inline uint32_t clipf_c_one(uint32_t a, uint32_t mini, 3918static inline uint32_t clipf_c_one(uint32_t a, uint32_t mini,
3915 uint32_t maxi, uint32_t maxisign) 3919 uint32_t maxi, uint32_t maxisign)
3916{ 3920{
@@ -4176,9 +4180,10 @@ int ff_check_alignment(void){
4176 } 4180 }
4177 return 0; 4181 return 0;
4178} 4182}
4179 4183#endif
4180av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) 4184av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
4181{ 4185{
4186#if 0
4182 int i; 4187 int i;
4183 4188
4184 ff_check_alignment(); 4189 ff_check_alignment();
@@ -4486,20 +4491,22 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
4486#if CONFIG_LPC 4491#if CONFIG_LPC
4487 c->lpc_compute_autocorr = ff_lpc_compute_autocorr; 4492 c->lpc_compute_autocorr = ff_lpc_compute_autocorr;
4488#endif 4493#endif
4494
4495#endif /* 0 */
4489 c->vector_fmul = vector_fmul_c; 4496 c->vector_fmul = vector_fmul_c;
4490 c->vector_fmul_reverse = vector_fmul_reverse_c; 4497 c->vector_fmul_reverse = vector_fmul_reverse_c;
4491 c->vector_fmul_add = vector_fmul_add_c; 4498 c->vector_fmul_add = vector_fmul_add_c;
4492 c->vector_fmul_window = ff_vector_fmul_window_c; 4499 c->vector_fmul_window = ff_vector_fmul_window_c;
4493 c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c; 4500 //c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c;
4494 c->vector_clipf = vector_clipf_c; 4501 //c->vector_clipf = vector_clipf_c;
4495 c->float_to_int16 = ff_float_to_int16_c; 4502 //c->float_to_int16 = ff_float_to_int16_c;
4496 c->float_to_int16_interleave = ff_float_to_int16_interleave_c; 4503 //c->float_to_int16_interleave = ff_float_to_int16_interleave_c;
4497 c->scalarproduct_int16 = scalarproduct_int16_c; 4504 //c->scalarproduct_int16 = scalarproduct_int16_c;
4498 c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c; 4505 //c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c;
4499 c->scalarproduct_float = scalarproduct_float_c; 4506 //c->scalarproduct_float = scalarproduct_float_c;
4500 c->butterflies_float = butterflies_float_c; 4507 //c->butterflies_float = butterflies_float_c;
4501 c->vector_fmul_scalar = vector_fmul_scalar_c; 4508 c->vector_fmul_scalar = vector_fmul_scalar_c;
4502 4509#if 0
4503 c->vector_fmul_sv_scalar[0] = vector_fmul_sv_scalar_2_c; 4510 c->vector_fmul_sv_scalar[0] = vector_fmul_sv_scalar_2_c;
4504 c->vector_fmul_sv_scalar[1] = vector_fmul_sv_scalar_4_c; 4511 c->vector_fmul_sv_scalar[1] = vector_fmul_sv_scalar_4_c;
4505 4512
@@ -4561,5 +4568,5 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
4561 default: 4568 default:
4562 av_log(avctx, AV_LOG_ERROR, "Internal error, IDCT permutation not set\n"); 4569 av_log(avctx, AV_LOG_ERROR, "Internal error, IDCT permutation not set\n");
4563 } 4570 }
4571#endif /* 0 */
4564} 4572}
4565
diff --git a/apps/codecs/libwmapro/fft.c b/apps/codecs/libwmapro/fft.c
index 7275d98e9f..bc1b4f1796 100644
--- a/apps/codecs/libwmapro/fft.c
+++ b/apps/codecs/libwmapro/fft.c
@@ -109,11 +109,11 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
109#endif 109#endif
110 s->exptab1 = NULL; 110 s->exptab1 = NULL;
111 s->split_radix = 1; 111 s->split_radix = 1;
112 112#if 0
113 if (ARCH_ARM) ff_fft_init_arm(s); 113 if (ARCH_ARM) ff_fft_init_arm(s);
114 if (HAVE_ALTIVEC) ff_fft_init_altivec(s); 114 if (HAVE_ALTIVEC) ff_fft_init_altivec(s);
115 if (HAVE_MMX) ff_fft_init_mmx(s); 115 if (HAVE_MMX) ff_fft_init_mmx(s);
116 116#endif
117 if (s->split_radix) { 117 if (s->split_radix) {
118 for(j=4; j<=nbits; j++) { 118 for(j=4; j<=nbits; j++) {
119 ff_init_ff_cos_tabs(j); 119 ff_init_ff_cos_tabs(j);
diff --git a/apps/codecs/libwmapro/fft.h b/apps/codecs/libwmapro/fft.h
index 1f5b2e86da..26d51e984a 100644
--- a/apps/codecs/libwmapro/fft.h
+++ b/apps/codecs/libwmapro/fft.h
@@ -23,7 +23,7 @@
23#define AVCODEC_FFT_H 23#define AVCODEC_FFT_H
24 24
25#include <stdint.h> 25#include <stdint.h>
26#include "config.h" 26//#include "config.h"
27#include "libavutil/mem.h" 27#include "libavutil/mem.h"
28#include "avfft.h" 28#include "avfft.h"
29 29
diff --git a/apps/codecs/libwmapro/libavutil/avutil.h b/apps/codecs/libwmapro/libavutil/avutil.h
index 1523de6753..1b858f1fe6 100644
--- a/apps/codecs/libwmapro/libavutil/avutil.h
+++ b/apps/codecs/libwmapro/libavutil/avutil.h
@@ -81,9 +81,9 @@ enum AVMediaType {
81#include "common.h" 81#include "common.h"
82#include "error.h" 82#include "error.h"
83#include "mathematics.h" 83#include "mathematics.h"
84#include "rational.h" 84//#include "rational.h"
85#include "intfloat_readwrite.h" 85//#include "intfloat_readwrite.h"
86#include "log.h" 86#include "log.h"
87#include "pixfmt.h" 87//#include "pixfmt.h"
88 88
89#endif /* AVUTIL_AVUTIL_H */ 89#endif /* AVUTIL_AVUTIL_H */
diff --git a/apps/codecs/libwmapro/libavutil/bswap.h b/apps/codecs/libwmapro/libavutil/bswap.h
index 74c7af3026..5743e126b8 100644
--- a/apps/codecs/libwmapro/libavutil/bswap.h
+++ b/apps/codecs/libwmapro/libavutil/bswap.h
@@ -27,7 +27,7 @@
27#define AVUTIL_BSWAP_H 27#define AVUTIL_BSWAP_H
28 28
29#include <stdint.h> 29#include <stdint.h>
30#include "config.h" 30//#include "config.h"
31#include "attributes.h" 31#include "attributes.h"
32 32
33#if ARCH_ARM 33#if ARCH_ARM
diff --git a/apps/codecs/libwmapro/libavutil/common.h b/apps/codecs/libwmapro/libavutil/common.h
index fae0b5b09b..48732a29dd 100644
--- a/apps/codecs/libwmapro/libavutil/common.h
+++ b/apps/codecs/libwmapro/libavutil/common.h
@@ -290,7 +290,8 @@ static inline av_const int av_ceil_log2(int x)
290 290
291#include "mem.h" 291#include "mem.h"
292 292
293#ifdef HAVE_AV_CONFIG_H 293//#ifdef HAVE_AV_CONFIG_H
294#if 1
294# include "internal.h" 295# include "internal.h"
295#endif /* HAVE_AV_CONFIG_H */ 296#endif /* HAVE_AV_CONFIG_H */
296 297
diff --git a/apps/codecs/libwmapro/libavutil/internal.h b/apps/codecs/libwmapro/libavutil/internal.h
index b47db3d8c6..2b8da1d8c2 100644
--- a/apps/codecs/libwmapro/libavutil/internal.h
+++ b/apps/codecs/libwmapro/libavutil/internal.h
@@ -34,9 +34,9 @@
34#include <stdint.h> 34#include <stdint.h>
35#include <stddef.h> 35#include <stddef.h>
36#include <assert.h> 36#include <assert.h>
37#include "config.h" 37//#include "config.h"
38#include "attributes.h" 38#include "attributes.h"
39#include "timer.h" 39//#include "timer.h"
40 40
41#ifndef attribute_align_arg 41#ifndef attribute_align_arg
42#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,2) 42#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,2)
@@ -191,7 +191,7 @@
191 }\ 191 }\
192} 192}
193 193
194#include "libm.h" 194//#include "libm.h"
195 195
196/** 196/**
197 * Returns NULL if CONFIG_SMALL is true, otherwise the argument 197 * Returns NULL if CONFIG_SMALL is true, otherwise the argument
diff --git a/apps/codecs/libwmapro/libavutil/intreadwrite.h b/apps/codecs/libwmapro/libavutil/intreadwrite.h
index c8026f0872..87098d707d 100644
--- a/apps/codecs/libwmapro/libavutil/intreadwrite.h
+++ b/apps/codecs/libwmapro/libavutil/intreadwrite.h
@@ -20,7 +20,7 @@
20#define AVUTIL_INTREADWRITE_H 20#define AVUTIL_INTREADWRITE_H
21 21
22#include <stdint.h> 22#include <stdint.h>
23#include "config.h" 23//#include "config.h"
24#include "bswap.h" 24#include "bswap.h"
25#include "common.h" 25#include "common.h"
26 26
diff --git a/apps/codecs/libwmapro/libavutil/mathematics.c b/apps/codecs/libwmapro/libavutil/mathematics.c
index 81d47c1bf1..04f3e870d1 100644
--- a/apps/codecs/libwmapro/libavutil/mathematics.c
+++ b/apps/codecs/libwmapro/libavutil/mathematics.c
@@ -129,7 +129,7 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
129int64_t av_rescale(int64_t a, int64_t b, int64_t c){ 129int64_t av_rescale(int64_t a, int64_t b, int64_t c){
130 return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 130 return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
131} 131}
132 132#if 0
133int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 133int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){
134 int64_t b= bq.num * (int64_t)cq.den; 134 int64_t b= bq.num * (int64_t)cq.den;
135 int64_t c= cq.num * (int64_t)bq.den; 135 int64_t c= cq.num * (int64_t)bq.den;
@@ -143,7 +143,7 @@ int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){
143 if (av_rescale_rnd(ts_b, b, a, AV_ROUND_DOWN) < ts_a) return 1; 143 if (av_rescale_rnd(ts_b, b, a, AV_ROUND_DOWN) < ts_a) return 1;
144 return 0; 144 return 0;
145} 145}
146 146#endif
147#ifdef TEST 147#ifdef TEST
148#include "integer.h" 148#include "integer.h"
149#undef printf 149#undef printf
diff --git a/apps/codecs/libwmapro/libavutil/mathematics.h b/apps/codecs/libwmapro/libavutil/mathematics.h
index e198aef8cb..a09d3e9ad8 100644
--- a/apps/codecs/libwmapro/libavutil/mathematics.h
+++ b/apps/codecs/libwmapro/libavutil/mathematics.h
@@ -24,7 +24,7 @@
24#include <stdint.h> 24#include <stdint.h>
25#include <math.h> 25#include <math.h>
26#include "attributes.h" 26#include "attributes.h"
27#include "rational.h" 27//#include "rational.h"
28 28
29#ifndef M_E 29#ifndef M_E
30#define M_E 2.7182818284590452354 /* e */ 30#define M_E 2.7182818284590452354 /* e */
@@ -84,7 +84,7 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_cons
84/** 84/**
85 * Rescales a 64-bit integer by 2 rational numbers. 85 * Rescales a 64-bit integer by 2 rational numbers.
86 */ 86 */
87int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; 87//int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
88 88
89/** 89/**
90 * Compares 2 timestamps each in its own timebases. 90 * Compares 2 timestamps each in its own timebases.
@@ -92,7 +92,7 @@ int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
92 * is outside the int64_t range when represented in the others timebase. 92 * is outside the int64_t range when represented in the others timebase.
93 * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position 93 * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
94 */ 94 */
95int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b); 95//int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
96 96
97 97
98#endif /* AVUTIL_MATHEMATICS_H */ 98#endif /* AVUTIL_MATHEMATICS_H */
diff --git a/apps/codecs/libwmapro/libavutil/mem.c b/apps/codecs/libwmapro/libavutil/mem.c
index 4d776d4450..7c37e9be9f 100644
--- a/apps/codecs/libwmapro/libavutil/mem.c
+++ b/apps/codecs/libwmapro/libavutil/mem.c
@@ -24,7 +24,7 @@
24 * default memory allocator for libavutil 24 * default memory allocator for libavutil
25 */ 25 */
26 26
27#include "config.h" 27//#include "config.h"
28 28
29#include <limits.h> 29#include <limits.h>
30#include <stdlib.h> 30#include <stdlib.h>
diff --git a/apps/codecs/libwmapro/mdct_tablegen.h b/apps/codecs/libwmapro/mdct_tablegen.h
index 1722c3b4d0..9f130aa6b5 100644
--- a/apps/codecs/libwmapro/mdct_tablegen.h
+++ b/apps/codecs/libwmapro/mdct_tablegen.h
@@ -24,7 +24,7 @@
24// do not use libavutil/mathematics.h since this is compiled both 24// do not use libavutil/mathematics.h since this is compiled both
25// for the host and the target and config.h is only valid for the target 25// for the host and the target and config.h is only valid for the target
26#include <math.h> 26#include <math.h>
27#include "../libavutil/attributes.h" 27#include "libavutil/attributes.h"
28 28
29#if !CONFIG_HARDCODED_TABLES 29#if !CONFIG_HARDCODED_TABLES
30SINETABLE( 32); 30SINETABLE( 32);
diff --git a/apps/codecs/libwmapro/wma.c b/apps/codecs/libwmapro/wma.c
index 65780459aa..5306634c7c 100644
--- a/apps/codecs/libwmapro/wma.c
+++ b/apps/codecs/libwmapro/wma.c
@@ -21,11 +21,11 @@
21 21
22#include "avcodec.h" 22#include "avcodec.h"
23#include "wma.h" 23#include "wma.h"
24#include "wmadata.h" 24//#include "wmadata.h"
25 25
26#undef NDEBUG 26#undef NDEBUG
27#include <assert.h> 27#include <assert.h>
28 28#if 0
29/* XXX: use same run/length optimization as mpeg decoders */ 29/* XXX: use same run/length optimization as mpeg decoders */
30//FIXME maybe split decode / encode or pass flag 30//FIXME maybe split decode / encode or pass flag
31static void init_coef_vlc(VLC *vlc, uint16_t **prun_table, 31static void init_coef_vlc(VLC *vlc, uint16_t **prun_table,
@@ -65,6 +65,7 @@ static void init_coef_vlc(VLC *vlc, uint16_t **prun_table,
65 *pint_table = int_table; 65 *pint_table = int_table;
66 av_free(level_table); 66 av_free(level_table);
67} 67}
68#endif /* 0 */
68 69
69/** 70/**
70 *@brief Get the samples per frame for this stream. 71 *@brief Get the samples per frame for this stream.
@@ -106,6 +107,7 @@ int av_cold ff_wma_get_frame_len_bits(int sample_rate, int version,
106 return frame_len_bits; 107 return frame_len_bits;
107} 108}
108 109
110#if 0
109int ff_wma_init(AVCodecContext *avctx, int flags2) 111int ff_wma_init(AVCodecContext *avctx, int flags2)
110{ 112{
111 WMACodecContext *s = avctx->priv_data; 113 WMACodecContext *s = avctx->priv_data;
@@ -426,7 +428,7 @@ int ff_wma_end(AVCodecContext *avctx)
426 428
427 return 0; 429 return 0;
428} 430}
429 431#endif /* 0 */
430/** 432/**
431 * Decode an uncompressed coefficient. 433 * Decode an uncompressed coefficient.
432 * @param s codec context 434 * @param s codec context
diff --git a/apps/codecs/libwmapro/wmaprodec.c b/apps/codecs/libwmapro/wmaprodec.c
index 82f1b3623b..88d317d5f6 100644
--- a/apps/codecs/libwmapro/wmaprodec.c
+++ b/apps/codecs/libwmapro/wmaprodec.c
@@ -94,6 +94,14 @@
94#include "dsputil.h" 94#include "dsputil.h"
95#include "wma.h" 95#include "wma.h"
96 96
97/* Some defines to make it compile */
98#define AVERROR_INVALIDDATA -1
99#define AVERROR_PATCHWELCOME -2
100#ifndef M_PI
101#define M_PI 3.14159265358979323846 /* pi */
102#endif
103#define av_log_ask_for_sample(...)
104
97/** current decoder limitations */ 105/** current decoder limitations */
98#define WMAPRO_MAX_CHANNELS 8 ///< max number of handled channels 106#define WMAPRO_MAX_CHANNELS 8 ///< max number of handled channels
99#define MAX_SUBFRAMES 32 ///< max number of subframes per channel 107#define MAX_SUBFRAMES 32 ///< max number of subframes per channel
@@ -444,9 +452,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
444 /** calculate sine values for the decorrelation matrix */ 452 /** calculate sine values for the decorrelation matrix */
445 for (i = 0; i < 33; i++) 453 for (i = 0; i < 33; i++)
446 sin64[i] = sin(i*M_PI / 64.0); 454 sin64[i] = sin(i*M_PI / 64.0);
447 455#if 0
448 if (avctx->debug & FF_DEBUG_BITSTREAM) 456 if (avctx->debug & FF_DEBUG_BITSTREAM)
449 dump_context(s); 457 dump_context(s);
458#endif
450 459
451 avctx->channel_layout = channel_mask; 460 avctx->channel_layout = channel_mask;
452 return 0; 461 return 0;
@@ -1559,7 +1568,7 @@ static void flush(AVCodecContext *avctx)
1559 s->packet_loss = 1; 1568 s->packet_loss = 1;
1560} 1569}
1561 1570
1562 1571#if 0
1563/** 1572/**
1564 *@brief wmapro decoder 1573 *@brief wmapro decoder
1565 */ 1574 */
@@ -1576,3 +1585,10 @@ AVCodec wmapro_decoder = {
1576 .flush= flush, 1585 .flush= flush,
1577 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"), 1586 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"),
1578}; 1587};
1588#endif
1589
1590int main(void)
1591{
1592 /* possible test program - just here now to ensure linking is done properly */
1593 return 0;
1594}