summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs')
-rw-r--r--lib/rbcodec/codecs/codecs.h6
-rw-r--r--lib/rbcodec/codecs/lib/codeclib.h4
-rw-r--r--lib/rbcodec/codecs/lib/ffmpeg_bswap.h32
-rw-r--r--lib/rbcodec/codecs/lib/ffmpeg_get_bits.h9
-rw-r--r--lib/rbcodec/codecs/libffmpegFLAC/bitstream.h3
-rw-r--r--lib/rbcodec/codecs/libmad/frame.c1
-rw-r--r--lib/rbcodec/codecs/libmad/frame.h1
-rw-r--r--lib/rbcodec/codecs/libmad/libmad.make2
-rw-r--r--lib/rbcodec/codecs/libmusepack/mpcdec.h2
-rw-r--r--lib/rbcodec/codecs/libspeex/filters.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/lsp.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/ltp.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/modes.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/modes_wb.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/nb_celp.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/quant_lsp.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/sb_celp.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/speex.c2
-rw-r--r--lib/rbcodec/codecs/libspeex/stereo.c2
-rw-r--r--lib/rbcodec/codecs/libtremor/vorbisfile.c1
-rw-r--r--lib/rbcodec/codecs/libwavpack/bits.c1
21 files changed, 60 insertions, 22 deletions
diff --git a/lib/rbcodec/codecs/codecs.h b/lib/rbcodec/codecs/codecs.h
index 91ce8698ab..03167f55bf 100644
--- a/lib/rbcodec/codecs/codecs.h
+++ b/lib/rbcodec/codecs/codecs.h
@@ -27,11 +27,7 @@
27#define NO_REDEFINES_PLEASE 27#define NO_REDEFINES_PLEASE
28#endif 28#endif
29 29
30#include <stdbool.h> 30#include "rbcodecconfig.h"
31#include <stdlib.h>
32#include "strlcpy.h"
33#include "config.h"
34#include "system.h"
35#include "metadata.h" 31#include "metadata.h"
36#include "audio.h" 32#include "audio.h"
37#ifdef RB_PROFILE 33#ifdef RB_PROFILE
diff --git a/lib/rbcodec/codecs/lib/codeclib.h b/lib/rbcodec/codecs/lib/codeclib.h
index d0f985b8e1..18c1043b8c 100644
--- a/lib/rbcodec/codecs/lib/codeclib.h
+++ b/lib/rbcodec/codecs/lib/codeclib.h
@@ -22,9 +22,7 @@
22#ifndef __CODECLIB_H__ 22#ifndef __CODECLIB_H__
23#define __CODECLIB_H__ 23#define __CODECLIB_H__
24 24
25#include <inttypes.h> 25#include "platform.h"
26#include <string.h>
27#include "config.h"
28#include "codecs.h" 26#include "codecs.h"
29#include "mdct.h" 27#include "mdct.h"
30#include "fft.h" 28#include "fft.h"
diff --git a/lib/rbcodec/codecs/lib/ffmpeg_bswap.h b/lib/rbcodec/codecs/lib/ffmpeg_bswap.h
index 24a2aab7ea..70176db215 100644
--- a/lib/rbcodec/codecs/lib/ffmpeg_bswap.h
+++ b/lib/rbcodec/codecs/lib/ffmpeg_bswap.h
@@ -6,6 +6,32 @@
6#ifndef __BSWAP_H__ 6#ifndef __BSWAP_H__
7#define __BSWAP_H__ 7#define __BSWAP_H__
8 8
9#include "platform.h"
10
11#ifndef bswap_16
12#define bswap_16(x) swap16(x)
13#endif
14#ifndef bswap_32
15#define bswap_32(x) swap32(x)
16#endif
17
18#ifndef bswap_64
19static inline uint64_t ByteSwap64(uint64_t x)
20{
21 union {
22 uint64_t ll;
23 struct {
24 uint32_t l,h;
25 } l;
26 } r;
27 r.l.l = bswap_32 (x);
28 r.l.h = bswap_32 (x>>32);
29 return r.ll;
30}
31#define bswap_64(x) ByteSwap64(x)
32#endif
33
34#if 0
9#ifdef HAVE_BYTESWAP_H 35#ifdef HAVE_BYTESWAP_H
10#include <byteswap.h> 36#include <byteswap.h>
11#else 37#else
@@ -13,9 +39,7 @@
13#ifdef ROCKBOX 39#ifdef ROCKBOX
14#include "codecs.h" 40#include "codecs.h"
15 41
16/* rockbox' optimised inline functions */ 42
17#define bswap_16(x) swap16(x)
18#define bswap_32(x) swap32(x)
19 43
20static inline uint64_t ByteSwap64(uint64_t x) 44static inline uint64_t ByteSwap64(uint64_t x)
21{ 45{
@@ -127,7 +151,7 @@ static inline uint64_t ByteSwap64(uint64_t x)
127#endif /* !ARCH_X86 */ 151#endif /* !ARCH_X86 */
128 152
129#endif /* !HAVE_BYTESWAP_H */ 153#endif /* !HAVE_BYTESWAP_H */
130 154#endif
131// be2me ... BigEndian to MachineEndian 155// be2me ... BigEndian to MachineEndian
132// le2me ... LittleEndian to MachineEndian 156// le2me ... LittleEndian to MachineEndian
133 157
diff --git a/lib/rbcodec/codecs/lib/ffmpeg_get_bits.h b/lib/rbcodec/codecs/lib/ffmpeg_get_bits.h
index 04eda021a7..e6f80ff45c 100644
--- a/lib/rbcodec/codecs/lib/ffmpeg_get_bits.h
+++ b/lib/rbcodec/codecs/lib/ffmpeg_get_bits.h
@@ -26,8 +26,9 @@
26#ifndef AVCODEC_GET_BITS_H 26#ifndef AVCODEC_GET_BITS_H
27#define AVCODEC_GET_BITS_H 27#define AVCODEC_GET_BITS_H
28 28
29#include <stdint.h> 29//#include <stdint.h>
30#include <stdlib.h> 30//#include <stdlib.h>
31#include "platform.h"
31#include "ffmpeg_intreadwrite.h" 32#include "ffmpeg_intreadwrite.h"
32//#include <assert.h> 33//#include <assert.h>
33//#include "libavutil/bswap.h" 34//#include "libavutil/bswap.h"
@@ -39,8 +40,12 @@
39#include "codecs.h" 40#include "codecs.h"
40 41
41/* rockbox' optimised inline functions */ 42/* rockbox' optimised inline functions */
43#ifndef bswap_16
42#define bswap_16(x) swap16(x) 44#define bswap_16(x) swap16(x)
45#endif
46#ifndef bswap_32
43#define bswap_32(x) swap32(x) 47#define bswap_32(x) swap32(x)
48#endif
44 49
45#ifdef ROCKBOX_BIG_ENDIAN 50#ifdef ROCKBOX_BIG_ENDIAN
46#define be2me_16(x) (x) 51#define be2me_16(x) (x)
diff --git a/lib/rbcodec/codecs/libffmpegFLAC/bitstream.h b/lib/rbcodec/codecs/libffmpegFLAC/bitstream.h
index 5fc3460c8e..2ec54c42fa 100644
--- a/lib/rbcodec/codecs/libffmpegFLAC/bitstream.h
+++ b/lib/rbcodec/codecs/libffmpegFLAC/bitstream.h
@@ -10,8 +10,7 @@
10#include "ffmpeg_get_bits.h" 10#include "ffmpeg_get_bits.h"
11 11
12#ifndef BUILD_STANDALONE 12#ifndef BUILD_STANDALONE
13 #include <config.h> 13 #include "platform.h"
14 #include <system.h>
15#else 14#else
16 #include <stdio.h> 15 #include <stdio.h>
17 #define IBSS_ATTR 16 #define IBSS_ATTR
diff --git a/lib/rbcodec/codecs/libmad/frame.c b/lib/rbcodec/codecs/libmad/frame.c
index f17306285c..c1cc10396b 100644
--- a/lib/rbcodec/codecs/libmad/frame.c
+++ b/lib/rbcodec/codecs/libmad/frame.c
@@ -28,7 +28,6 @@
28# include "bit.h" 28# include "bit.h"
29# include "stream.h" 29# include "stream.h"
30# include "frame.h" 30# include "frame.h"
31# include "timer.h"
32# include "layer12.h" 31# include "layer12.h"
33# include "layer3.h" 32# include "layer3.h"
34# include "codeclib.h" 33# include "codeclib.h"
diff --git a/lib/rbcodec/codecs/libmad/frame.h b/lib/rbcodec/codecs/libmad/frame.h
index b1c6e0289d..a8eb2b51f9 100644
--- a/lib/rbcodec/codecs/libmad/frame.h
+++ b/lib/rbcodec/codecs/libmad/frame.h
@@ -23,7 +23,6 @@
23# define LIBMAD_FRAME_H 23# define LIBMAD_FRAME_H
24 24
25# include "fixed.h" 25# include "fixed.h"
26# include "timer.h"
27# include "stream.h" 26# include "stream.h"
28 27
29enum mad_layer { 28enum mad_layer {
diff --git a/lib/rbcodec/codecs/libmad/libmad.make b/lib/rbcodec/codecs/libmad/libmad.make
index 2a8c7b220f..16b2bd76a9 100644
--- a/lib/rbcodec/codecs/libmad/libmad.make
+++ b/lib/rbcodec/codecs/libmad/libmad.make
@@ -13,7 +13,7 @@
13 13
14# Extract optimization level ('-O') from compile flags. Will be set later. 14# Extract optimization level ('-O') from compile flags. Will be set later.
15MADFLAGS = $(filter-out -O%,$(CODECFLAGS)) -I$(RBCODECLIB_DIR)/codecs/libmad 15MADFLAGS = $(filter-out -O%,$(CODECFLAGS)) -I$(RBCODECLIB_DIR)/codecs/libmad
16MADFLAGS += -UDEBUG -DNDEBUG -DHAVE_LIMITS_H 16MADFLAGS += -UDEBUG -DNDEBUG -DHAVE_LIMITS_H -DHAVE_ASSERT_H
17 17
18# libmad is faster on ARM-targets with -O1 than -O2 18# libmad is faster on ARM-targets with -O1 than -O2
19ifeq ($(ARCH),arch_arm) 19ifeq ($(ARCH),arch_arm)
diff --git a/lib/rbcodec/codecs/libmusepack/mpcdec.h b/lib/rbcodec/codecs/libmusepack/mpcdec.h
index 85536e726a..02003cb01b 100644
--- a/lib/rbcodec/codecs/libmusepack/mpcdec.h
+++ b/lib/rbcodec/codecs/libmusepack/mpcdec.h
@@ -39,9 +39,9 @@
39#pragma once 39#pragma once
40#endif 40#endif
41 41
42#include "platform.h"
42#include "reader.h" 43#include "reader.h"
43#include "streaminfo.h" 44#include "streaminfo.h"
44#include "config.h"
45 45
46#ifdef __cplusplus 46#ifdef __cplusplus
47extern "C" { 47extern "C" {
diff --git a/lib/rbcodec/codecs/libspeex/filters.c b/lib/rbcodec/codecs/libspeex/filters.c
index 09f93c2a59..7c4c90a636 100644
--- a/lib/rbcodec/codecs/libspeex/filters.c
+++ b/lib/rbcodec/codecs/libspeex/filters.c
@@ -39,7 +39,9 @@
39#include "arch.h" 39#include "arch.h"
40#include "math_approx.h" 40#include "math_approx.h"
41#include "ltp.h" 41#include "ltp.h"
42#ifndef FIXED_POINT
42#include <math.h> 43#include <math.h>
44#endif
43 45
44#ifdef _USE_SSE 46#ifdef _USE_SSE
45#include "filters_sse.h" 47#include "filters_sse.h"
diff --git a/lib/rbcodec/codecs/libspeex/lsp.c b/lib/rbcodec/codecs/libspeex/lsp.c
index 8408d782aa..83365a8639 100644
--- a/lib/rbcodec/codecs/libspeex/lsp.c
+++ b/lib/rbcodec/codecs/libspeex/lsp.c
@@ -83,7 +83,9 @@ Heavily modified by Jean-Marc Valin (c) 2002-2006 (fixed-point,
83#include "config-speex.h" 83#include "config-speex.h"
84#endif 84#endif
85 85
86#ifndef FIXED_POINT
86#include <math.h> 87#include <math.h>
88#endif
87#include "lsp.h" 89#include "lsp.h"
88#include "stack_alloc.h" 90#include "stack_alloc.h"
89#include "math_approx.h" 91#include "math_approx.h"
diff --git a/lib/rbcodec/codecs/libspeex/ltp.c b/lib/rbcodec/codecs/libspeex/ltp.c
index 9f10bc09d8..c81e8eb2f3 100644
--- a/lib/rbcodec/codecs/libspeex/ltp.c
+++ b/lib/rbcodec/codecs/libspeex/ltp.c
@@ -34,7 +34,9 @@
34#include "config-speex.h" 34#include "config-speex.h"
35#endif 35#endif
36 36
37#ifndef FIXED_POINT
37#include <math.h> 38#include <math.h>
39#endif
38#include "ltp.h" 40#include "ltp.h"
39#include "stack_alloc.h" 41#include "stack_alloc.h"
40#include "filters.h" 42#include "filters.h"
diff --git a/lib/rbcodec/codecs/libspeex/modes.c b/lib/rbcodec/codecs/libspeex/modes.c
index d1046f1cfb..a58c0786dd 100644
--- a/lib/rbcodec/codecs/libspeex/modes.c
+++ b/lib/rbcodec/codecs/libspeex/modes.c
@@ -44,7 +44,9 @@
44#include "nb_celp.h" 44#include "nb_celp.h"
45#include "vbr.h" 45#include "vbr.h"
46#include "arch.h" 46#include "arch.h"
47#ifndef FIXED_POINT
47#include <math.h> 48#include <math.h>
49#endif
48 50
49#ifndef NULL 51#ifndef NULL
50#define NULL 0 52#define NULL 0
diff --git a/lib/rbcodec/codecs/libspeex/modes_wb.c b/lib/rbcodec/codecs/libspeex/modes_wb.c
index 93922afa2f..4055a2b074 100644
--- a/lib/rbcodec/codecs/libspeex/modes_wb.c
+++ b/lib/rbcodec/codecs/libspeex/modes_wb.c
@@ -44,7 +44,9 @@
44#include "nb_celp.h" 44#include "nb_celp.h"
45#include "vbr.h" 45#include "vbr.h"
46#include "arch.h" 46#include "arch.h"
47#ifndef FIXED_POINT
47#include <math.h> 48#include <math.h>
49#endif
48#include "os_support.h" 50#include "os_support.h"
49 51
50 52
diff --git a/lib/rbcodec/codecs/libspeex/nb_celp.c b/lib/rbcodec/codecs/libspeex/nb_celp.c
index 364f987472..a385500f90 100644
--- a/lib/rbcodec/codecs/libspeex/nb_celp.c
+++ b/lib/rbcodec/codecs/libspeex/nb_celp.c
@@ -33,7 +33,9 @@
33#include "config-speex.h" 33#include "config-speex.h"
34#endif 34#endif
35 35
36#ifndef FIXED_POINT
36#include <math.h> 37#include <math.h>
38#endif
37#include "nb_celp.h" 39#include "nb_celp.h"
38#include "lpc.h" 40#include "lpc.h"
39#include "lsp.h" 41#include "lsp.h"
diff --git a/lib/rbcodec/codecs/libspeex/quant_lsp.c b/lib/rbcodec/codecs/libspeex/quant_lsp.c
index 9b9104c842..c79942cd59 100644
--- a/lib/rbcodec/codecs/libspeex/quant_lsp.c
+++ b/lib/rbcodec/codecs/libspeex/quant_lsp.c
@@ -36,7 +36,9 @@
36 36
37#include "quant_lsp.h" 37#include "quant_lsp.h"
38#include "os_support.h" 38#include "os_support.h"
39#ifndef FIXED_POINT
39#include <math.h> 40#include <math.h>
41#endif
40#ifndef M_PI 42#ifndef M_PI
41#define M_PI 3.14159265358979323846 43#define M_PI 3.14159265358979323846
42#endif 44#endif
diff --git a/lib/rbcodec/codecs/libspeex/sb_celp.c b/lib/rbcodec/codecs/libspeex/sb_celp.c
index b28744812f..45c8417022 100644
--- a/lib/rbcodec/codecs/libspeex/sb_celp.c
+++ b/lib/rbcodec/codecs/libspeex/sb_celp.c
@@ -33,7 +33,9 @@
33#include "config-speex.h" 33#include "config-speex.h"
34#endif 34#endif
35 35
36#ifndef FIXED_POINT
36#include <math.h> 37#include <math.h>
38#endif
37#include "sb_celp.h" 39#include "sb_celp.h"
38#include "filters.h" 40#include "filters.h"
39#include "lpc.h" 41#include "lpc.h"
diff --git a/lib/rbcodec/codecs/libspeex/speex.c b/lib/rbcodec/codecs/libspeex/speex.c
index 0dcfb3f7f6..92e41f52ae 100644
--- a/lib/rbcodec/codecs/libspeex/speex.c
+++ b/lib/rbcodec/codecs/libspeex/speex.c
@@ -37,7 +37,9 @@
37#endif 37#endif
38 38
39#include "modes.h" 39#include "modes.h"
40#ifndef FIXED_POINT
40#include <math.h> 41#include <math.h>
42#endif
41#include "os_support.h" 43#include "os_support.h"
42 44
43#ifndef NULL 45#ifndef NULL
diff --git a/lib/rbcodec/codecs/libspeex/stereo.c b/lib/rbcodec/codecs/libspeex/stereo.c
index 652d2a6e90..0aca1050fa 100644
--- a/lib/rbcodec/codecs/libspeex/stereo.c
+++ b/lib/rbcodec/codecs/libspeex/stereo.c
@@ -37,7 +37,9 @@
37#include "speex/speex_callbacks.h" 37#include "speex/speex_callbacks.h"
38#include "math_approx.h" 38#include "math_approx.h"
39#include "vq.h" 39#include "vq.h"
40#ifndef FIXED_POINT
40#include <math.h> 41#include <math.h>
42#endif
41#include "os_support.h" 43#include "os_support.h"
42 44
43typedef struct RealSpeexStereoState { 45typedef struct RealSpeexStereoState {
diff --git a/lib/rbcodec/codecs/libtremor/vorbisfile.c b/lib/rbcodec/codecs/libtremor/vorbisfile.c
index 271e5a09e3..688a864077 100644
--- a/lib/rbcodec/codecs/libtremor/vorbisfile.c
+++ b/lib/rbcodec/codecs/libtremor/vorbisfile.c
@@ -21,7 +21,6 @@
21#include <errno.h> 21#include <errno.h>
22#include <string.h> 22#include <string.h>
23#include <math.h> 23#include <math.h>
24#include "system.h"
25 24
26#include "ivorbiscodec.h" 25#include "ivorbiscodec.h"
27#include "ivorbisfile.h" 26#include "ivorbisfile.h"
diff --git a/lib/rbcodec/codecs/libwavpack/bits.c b/lib/rbcodec/codecs/libwavpack/bits.c
index 0f0e79c292..6d81b22773 100644
--- a/lib/rbcodec/codecs/libwavpack/bits.c
+++ b/lib/rbcodec/codecs/libwavpack/bits.c
@@ -15,7 +15,6 @@
15// the malloc() system is provided. 15// the malloc() system is provided.
16 16
17#include "wavpack.h" 17#include "wavpack.h"
18#include "system.h"
19 18
20#include <string.h> 19#include <string.h>
21 20