summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/libwma/avcodec.h58
-rw-r--r--apps/codecs/libwma/common.c2
-rw-r--r--apps/codecs/libwma/common.h60
-rw-r--r--apps/codecs/libwma/dsputil.h22
-rw-r--r--apps/codecs/libwma/ffmpeg_config.h11
5 files changed, 1 insertions, 152 deletions
diff --git a/apps/codecs/libwma/avcodec.h b/apps/codecs/libwma/avcodec.h
deleted file mode 100644
index 3ddc2d6770..0000000000
--- a/apps/codecs/libwma/avcodec.h
+++ /dev/null
@@ -1,58 +0,0 @@
1#ifndef AVCODEC_H
2#define AVCODEC_H
3
4/**
5 * @file avcodec.h
6 * external api header.
7 */
8
9#include "common.h"
10#include <sys/types.h> /* size_t */
11
12/**
13 * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
14 * this is mainly needed because some optimized bitstream readers read
15 * 32 or 64 bit at once and could read over the end<br>
16 * Note, if the first 23 bits of the additional bytes are not 0 then damaged
17 * MPEG bitstreams could cause overread and segfault
18 */
19#define FF_INPUT_BUFFER_PADDING_SIZE 8
20
21/* memory */
22void *av_malloc(unsigned int size);
23void *av_mallocz(unsigned int size);
24void *av_realloc(void *ptr, unsigned int size);
25void av_free(void *ptr);
26char *av_strdup(const char *s);
27void __av_freep(void **ptr);
28#define av_freep(p) __av_freep((void **)(p))
29void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
30/* for static data only */
31/* call av_free_static to release all staticaly allocated tables */
32void av_free_static(void);
33void *__av_mallocz_static(void** location, unsigned int size);
34#define av_mallocz_static(p, s) __av_mallocz_static((void **)(p), s)
35
36/* av_log API */
37
38#include <stdarg.h>
39
40#define AV_LOG_ERROR 0
41#define AV_LOG_INFO 1
42#define AV_LOG_DEBUG 2
43
44extern void av_log(int level, const char *fmt, ...);
45extern void av_vlog(int level, const char *fmt, va_list);
46extern int av_log_get_level(void);
47extern void av_log_set_level(int);
48extern void av_log_set_callback(void (*)(int, const char*, va_list));
49
50#undef AV_LOG_TRAP_PRINTF
51#ifdef AV_LOG_TRAP_PRINTF
52#define printf DO NOT USE
53#define fprintf DO NOT USE
54#undef stderr
55#define stderr DO NOT USE
56#endif
57
58#endif /* AVCODEC_H */
diff --git a/apps/codecs/libwma/common.c b/apps/codecs/libwma/common.c
index 4d165ed0a8..619ce47197 100644
--- a/apps/codecs/libwma/common.c
+++ b/apps/codecs/libwma/common.c
@@ -25,7 +25,7 @@
25 * common internal api. 25 * common internal api.
26 */ 26 */
27 27
28#include "avcodec.h" 28#include "common.h"
29 29
30const uint8_t ff_sqrt_tab[128]={ 30const uint8_t ff_sqrt_tab[128]={
31 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 31 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
diff --git a/apps/codecs/libwma/common.h b/apps/codecs/libwma/common.h
index dc55dcaed2..b627bfb710 100644
--- a/apps/codecs/libwma/common.h
+++ b/apps/codecs/libwma/common.h
@@ -6,69 +6,9 @@
6#ifndef COMMON_H 6#ifndef COMMON_H
7#define COMMON_H 7#define COMMON_H
8 8
9/* only include the following when compiling package */
10#include "ffmpeg_config.h" 9#include "ffmpeg_config.h"
11
12#include <stdlib.h>
13#include <stdio.h>
14#include <string.h>
15#include <ctype.h>
16#include <math.h>
17#include <stddef.h>
18#include <inttypes.h> 10#include <inttypes.h>
19 11
20#ifndef M_PI
21#define M_PI 3.14159265358979323846
22#endif
23
24#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
25# define always_inline __attribute__((always_inline)) inline
26#else
27# define always_inline inline
28#endif
29
30#ifndef INT64_MAX
31#define INT64_MAX 9223372036854775807LL
32#endif
33
34# if defined(__MINGW32__) || defined(__CYGWIN__) || \
35 defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
36# define MANGLE(a) "_" #a
37# else
38# define MANGLE(a) #a
39# endif
40
41/* debug stuff */
42
43# ifndef DEBUG
44# define NDEBUG
45# endif
46# include <assert.h>
47
48/* dprintf macros */
49# if defined(CONFIG_WIN32) && !defined(__MINGW32__)
50
51inline void dprintf(const char* fmt,...) {}
52
53# else
54
55# ifdef DEBUG
56# define dprintf(fmt,...) printf(fmt, __VA_ARGS__)
57# else
58# define dprintf(fmt,...)
59# endif
60
61# endif /* !CONFIG_WIN32 */
62
63# define av_abort() do { av_log(AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
64
65//rounded divison & shift
66#define RSHIFT(a,b) ((a) > 0 ? ((a) + (1<<((b)-1)))>>(b) : ((a) + (1<<((b)-1))-1)>>(b))
67/* assume b>0 */
68#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
69
70extern const uint32_t inverse[256];
71
72#define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s))) 12#define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s)))
73#define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) 13#define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
74 14
diff --git a/apps/codecs/libwma/dsputil.h b/apps/codecs/libwma/dsputil.h
index a5b2af3039..794af1e285 100644
--- a/apps/codecs/libwma/dsputil.h
+++ b/apps/codecs/libwma/dsputil.h
@@ -30,8 +30,6 @@
30 30
31#include "common.h" 31#include "common.h"
32 32
33//#define DEBUG
34
35void dsputil_static_init(void); 33void dsputil_static_init(void);
36 34
37/* FFT computation */ 35/* FFT computation */
@@ -83,24 +81,4 @@ void ff_mdct_calc(MDCTContext *s, FFTSample *out,
83 const FFTSample *input, FFTSample *tmp); 81 const FFTSample *input, FFTSample *tmp);
84void ff_mdct_end(MDCTContext *s); 82void ff_mdct_end(MDCTContext *s);
85 83
86#define WARPER8_16(name8, name16)\
87static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
88 return name8(s, dst , src , stride, h)\
89 +name8(s, dst+8 , src+8 , stride, h);\
90}
91
92#define WARPER8_16_SQ(name8, name16)\
93static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
94 int score=0;\
95 score +=name8(s, dst , src , stride, 8);\
96 score +=name8(s, dst+8 , src+8 , stride, 8);\
97 if(h==16){\
98 dst += 8*stride;\
99 src += 8*stride;\
100 score +=name8(s, dst , src , stride, 8);\
101 score +=name8(s, dst+8 , src+8 , stride, 8);\
102 }\
103 return score;\
104}
105
106#endif 84#endif
diff --git a/apps/codecs/libwma/ffmpeg_config.h b/apps/codecs/libwma/ffmpeg_config.h
index 4b5f4f7fa6..40815cb54b 100644
--- a/apps/codecs/libwma/ffmpeg_config.h
+++ b/apps/codecs/libwma/ffmpeg_config.h
@@ -4,15 +4,4 @@
4 4
5#define CONFIG_ALIGN 1 5#define CONFIG_ALIGN 1
6 6
7#define ARCH_X86 1
8#undef HAVE_MMX
9#define __CPU__ 586
10#define HAVE_BUILTIN_VECTOR 1
11#define HAVE_LOCALTIME_R 1
12#define HAVE_LRINTF 1
13#undef HAVE_VHOOK
14#define HAVE_MALLOC_H 1
15#define HAVE_MEMALIGN 1
16#define SIMPLE_IDCT 1
17
18#endif 7#endif