mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-18 01:22:38 -05:00
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
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue