Niotso  git revision 558726a9f13d7c3423a683dd2f4323589b66c310
The New Implementation of The Sims Online
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Functions | Variables
read_xa.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <limits.h>
#include "read_xa.h"

Classes

struct  channel_t
 

Macros

#define HINIBBLE(byte)   ((byte) >> 4)
 
#define LONIBBLE(byte)   ((byte) & 0x0F)
 
#define read_uint32(x)   (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)) | ((x)[2]<<(8*2)) | ((x)[3]<<(8*3)))
 
#define read_uint16(x)   (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)))
 

Functions

size_t xa_compressed_size (size_t Frames, size_t Channels)
 
int xa_read_header (xaheader_t *XAHeader, const uint8_t *Buffer, size_t FileSize)
 
static __inline int16_t Clip16 (int sample)
 
int xa_decode (const uint8_t *__restrict InBuffer, uint8_t *__restrict OutBuffer, size_t Frames, size_t Channels)
 

Variables

static const int16_t XATable []
 

Macro Definition Documentation

#define HINIBBLE (   byte)    ((byte) >> 4)
#define LONIBBLE (   byte)    ((byte) & 0x0F)
#define read_uint16 (   x)    (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)))
#define read_uint32 (   x)    (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)) | ((x)[2]<<(8*2)) | ((x)[3]<<(8*3)))

Function Documentation

static __inline int16_t Clip16 ( int  sample)
static
size_t xa_compressed_size ( size_t  Frames,
size_t  Channels 
)
int xa_decode ( const uint8_t *__restrict  InBuffer,
uint8_t *__restrict  OutBuffer,
size_t  Frames,
size_t  Channels 
)
int xa_read_header ( xaheader_t XAHeader,
const uint8_t *  Buffer,
size_t  FileSize 
)

Variable Documentation

const int16_t XATable[]
static
Initial value:
=
{
0, 240, 460, 392,
0, 0, -208, -220,
0, 1, 3, 4,
7, 8, 10, 11,
0, -1, -3, -4
}