forked from len0rd/rockbox
Add rbcodecplatform.h and rbcodecconfig.h.
librbcodec users must provide these two files when the library is built. rbcodecconfig.h provides configuration #defines and basic types, and will be included by public librbcodec headers, so it must not conflict with the user's code. rbcodecplatform.h provides various OS functions, and will only be included by source files and private headers. This system is intended to provide maximum flexibility for use on embedded systems, where no operating system headers are included. Unix systems can just copy rbcodecconfig-example.h and rbcodecplatform-unix.h with minimal changes. Change-Id: I350a2274d173da391fd1ca00c4202e9760d91def Reviewed-on: http://gerrit.rockbox.org/143 Reviewed-by: Nils Wallménius <nils@rockbox.org> Tested-by: Nils Wallménius <nils@rockbox.org>
This commit is contained in:
parent
5f0cb71361
commit
cadb3627fc
70 changed files with 430 additions and 81 deletions
|
@ -27,11 +27,7 @@
|
|||
#define NO_REDEFINES_PLEASE
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include "strlcpy.h"
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "rbcodecconfig.h"
|
||||
#include "metadata.h"
|
||||
#include "audio.h"
|
||||
#ifdef RB_PROFILE
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
#ifndef __CODECLIB_H__
|
||||
#define __CODECLIB_H__
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
#include "platform.h"
|
||||
#include "codecs.h"
|
||||
#include "mdct.h"
|
||||
#include "fft.h"
|
||||
|
|
|
@ -6,6 +6,32 @@
|
|||
#ifndef __BSWAP_H__
|
||||
#define __BSWAP_H__
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#ifndef bswap_16
|
||||
#define bswap_16(x) swap16(x)
|
||||
#endif
|
||||
#ifndef bswap_32
|
||||
#define bswap_32(x) swap32(x)
|
||||
#endif
|
||||
|
||||
#ifndef bswap_64
|
||||
static inline uint64_t ByteSwap64(uint64_t x)
|
||||
{
|
||||
union {
|
||||
uint64_t ll;
|
||||
struct {
|
||||
uint32_t l,h;
|
||||
} l;
|
||||
} r;
|
||||
r.l.l = bswap_32 (x);
|
||||
r.l.h = bswap_32 (x>>32);
|
||||
return r.ll;
|
||||
}
|
||||
#define bswap_64(x) ByteSwap64(x)
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifdef HAVE_BYTESWAP_H
|
||||
#include <byteswap.h>
|
||||
#else
|
||||
|
@ -13,9 +39,7 @@
|
|||
#ifdef ROCKBOX
|
||||
#include "codecs.h"
|
||||
|
||||
/* rockbox' optimised inline functions */
|
||||
#define bswap_16(x) swap16(x)
|
||||
#define bswap_32(x) swap32(x)
|
||||
|
||||
|
||||
static inline uint64_t ByteSwap64(uint64_t x)
|
||||
{
|
||||
|
@ -127,7 +151,7 @@ static inline uint64_t ByteSwap64(uint64_t x)
|
|||
#endif /* !ARCH_X86 */
|
||||
|
||||
#endif /* !HAVE_BYTESWAP_H */
|
||||
|
||||
#endif
|
||||
// be2me ... BigEndian to MachineEndian
|
||||
// le2me ... LittleEndian to MachineEndian
|
||||
|
||||
|
|
|
@ -26,8 +26,9 @@
|
|||
#ifndef AVCODEC_GET_BITS_H
|
||||
#define AVCODEC_GET_BITS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
//#include <stdint.h>
|
||||
//#include <stdlib.h>
|
||||
#include "platform.h"
|
||||
#include "ffmpeg_intreadwrite.h"
|
||||
//#include <assert.h>
|
||||
//#include "libavutil/bswap.h"
|
||||
|
@ -39,8 +40,12 @@
|
|||
#include "codecs.h"
|
||||
|
||||
/* rockbox' optimised inline functions */
|
||||
#ifndef bswap_16
|
||||
#define bswap_16(x) swap16(x)
|
||||
#endif
|
||||
#ifndef bswap_32
|
||||
#define bswap_32(x) swap32(x)
|
||||
#endif
|
||||
|
||||
#ifdef ROCKBOX_BIG_ENDIAN
|
||||
#define be2me_16(x) (x)
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
#include "ffmpeg_get_bits.h"
|
||||
|
||||
#ifndef BUILD_STANDALONE
|
||||
#include <config.h>
|
||||
#include <system.h>
|
||||
#include "platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define IBSS_ATTR
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
# include "bit.h"
|
||||
# include "stream.h"
|
||||
# include "frame.h"
|
||||
# include "timer.h"
|
||||
# include "layer12.h"
|
||||
# include "layer3.h"
|
||||
# include "codeclib.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
# define LIBMAD_FRAME_H
|
||||
|
||||
# include "fixed.h"
|
||||
# include "timer.h"
|
||||
# include "stream.h"
|
||||
|
||||
enum mad_layer {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
# Extract optimization level ('-O') from compile flags. Will be set later.
|
||||
MADFLAGS = $(filter-out -O%,$(CODECFLAGS)) -I$(RBCODECLIB_DIR)/codecs/libmad
|
||||
MADFLAGS += -UDEBUG -DNDEBUG -DHAVE_LIMITS_H
|
||||
MADFLAGS += -UDEBUG -DNDEBUG -DHAVE_LIMITS_H -DHAVE_ASSERT_H
|
||||
|
||||
# libmad is faster on ARM-targets with -O1 than -O2
|
||||
ifeq ($(ARCH),arch_arm)
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "platform.h"
|
||||
#include "reader.h"
|
||||
#include "streaminfo.h"
|
||||
#include "config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
#include "arch.h"
|
||||
#include "math_approx.h"
|
||||
#include "ltp.h"
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
#ifdef _USE_SSE
|
||||
#include "filters_sse.h"
|
||||
|
|
|
@ -83,7 +83,9 @@ Heavily modified by Jean-Marc Valin (c) 2002-2006 (fixed-point,
|
|||
#include "config-speex.h"
|
||||
#endif
|
||||
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include "lsp.h"
|
||||
#include "stack_alloc.h"
|
||||
#include "math_approx.h"
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
#include "config-speex.h"
|
||||
#endif
|
||||
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include "ltp.h"
|
||||
#include "stack_alloc.h"
|
||||
#include "filters.h"
|
||||
|
|
|
@ -44,7 +44,9 @@
|
|||
#include "nb_celp.h"
|
||||
#include "vbr.h"
|
||||
#include "arch.h"
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
|
|
|
@ -44,7 +44,9 @@
|
|||
#include "nb_celp.h"
|
||||
#include "vbr.h"
|
||||
#include "arch.h"
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include "os_support.h"
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
#include "config-speex.h"
|
||||
#endif
|
||||
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include "nb_celp.h"
|
||||
#include "lpc.h"
|
||||
#include "lsp.h"
|
||||
|
|
|
@ -36,7 +36,9 @@
|
|||
|
||||
#include "quant_lsp.h"
|
||||
#include "os_support.h"
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
#include "config-speex.h"
|
||||
#endif
|
||||
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include "sb_celp.h"
|
||||
#include "filters.h"
|
||||
#include "lpc.h"
|
||||
|
|
|
@ -37,7 +37,9 @@
|
|||
#endif
|
||||
|
||||
#include "modes.h"
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include "os_support.h"
|
||||
|
||||
#ifndef NULL
|
||||
|
|
|
@ -37,7 +37,9 @@
|
|||
#include "speex/speex_callbacks.h"
|
||||
#include "math_approx.h"
|
||||
#include "vq.h"
|
||||
#ifndef FIXED_POINT
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include "os_support.h"
|
||||
|
||||
typedef struct RealSpeexStereoState {
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "system.h"
|
||||
|
||||
#include "ivorbiscodec.h"
|
||||
#include "ivorbisfile.h"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
// the malloc() system is provided.
|
||||
|
||||
#include "wavpack.h"
|
||||
#include "system.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue