Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Data Structures | Macros | Typedefs | Functions
vadpcm.h File Reference
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  ChunkHeader
 
struct  Chunk
 
struct  CommonChunk
 
struct  Marker
 
struct  Loop
 
struct  InstrumentChunk
 
struct  SoundDataChunk
 
struct  CodeChunk
 
struct  ALADPCMloop
 

Macros

#define BSWAP16(x)   x = __builtin_bswap16(x);
 
#define BSWAP32(x)   x = __builtin_bswap32(x);
 
#define BSWAP16_MANY(x, n)   { s32 _i; for (_i = 0; _i < n; _i++) BSWAP16((x)[_i]) }
 
#define MODE_READ   "rb"
 
#define MODE_WRITE   "wb"
 

Typedefs

typedef signed char s8
 
typedef short s16
 
typedef int s32
 
typedef long long s64
 
typedef unsigned char u8
 
typedef unsigned short u16
 
typedef unsigned int u32
 
typedef unsigned long long u64
 
typedef float f32
 
typedef double f64
 

Functions

s32 readcodebook (FILE *fhandle, s32 ****table, s32 *order, s32 *npredictors)
 
s32 readaifccodebook (FILE *fhandle, s32 ****table, s16 *order, s16 *npredictors)
 
s32 inner_product (s32 length, s32 *v1, s32 *v2)
 
s16 qsample (f32 x, s32 scale)
 Compute x / scale rounded to the nearest integer, with x.5 (fuzzy with an epsilon of 1e-7) rounding towards zero. More...
 
void clamp (s32 fs, f32 *e, s32 *ie, s32 bits)
 Round all ('fs' many) values in 'e' to the nearest 'bits'-bit integer, outputting to 'ie'. More...
 
s32 clip (s32 ix, s32 llevel, s32 ulevel)
 Clamp ix to within [llevel, ulevel]. More...
 
void vdecodeframe (FILE *ifile, s32 *outp, s32 order, s32 ***coefTable)
 
void vencodeframe (FILE *ofile, s16 *inBuffer, s32 *state, s32 ***coefTable, s32 order, s32 npredictors, s32 nsam)
 
u32 readbits (u32 nbits, FILE *ifile)
 
charReadPString (FILE *ifile)
 
s32 lookupMarker (u32 *sample, s16 loopPoint, Marker *markers, s32 nmarkers)
 
ALADPCMloopreadlooppoints (FILE *ifile, s16 *nloops)
 
void writeout (FILE *outfd, s32 size, s32 *l_out, s32 *r_out, s32 chans)
 

Macro Definition Documentation

◆ BSWAP16

#define BSWAP16 (   x)    x = __builtin_bswap16(x);

◆ BSWAP16_MANY

#define BSWAP16_MANY (   x,
 
)    { s32 _i; for (_i = 0; _i < n; _i++) BSWAP16((x)[_i]) }

◆ BSWAP32

#define BSWAP32 (   x)    x = __builtin_bswap32(x);

◆ MODE_READ

#define MODE_READ   "rb"

◆ MODE_WRITE

#define MODE_WRITE   "wb"

Typedef Documentation

◆ f32

typedef float f32

◆ f64

typedef double f64

◆ s16

typedef short s16

◆ s32

◆ s64

typedef long long s64

◆ s8

typedef signed char s8

◆ u16

typedef unsigned short u16

◆ u32

typedef unsigned int u32

◆ u64

typedef unsigned long long u64

◆ u8

typedef unsigned char u8

Function Documentation

◆ clamp()

void clamp ( s32  fs,
f32 e,
s32 ie,
s32  bits 
)

Round all ('fs' many) values in 'e' to the nearest 'bits'-bit integer, outputting to 'ie'.

◆ clip()

s32 clip ( s32  ix,
s32  llevel,
s32  ulevel 
)

Clamp ix to within [llevel, ulevel].

◆ inner_product()

s32 inner_product ( s32  length,
s32 v1,
s32 v2 
)

◆ lookupMarker()

s32 lookupMarker ( u32 sample,
s16  loopPoint,
Marker markers,
s32  nmarkers 
)

◆ qsample()

s16 qsample ( f32  x,
s32  scale 
)

Compute x / scale rounded to the nearest integer, with x.5 (fuzzy with an epsilon of 1e-7) rounding towards zero.

◆ readaifccodebook()

s32 readaifccodebook ( FILE *  fhandle,
s32 ****  table,
s16 order,
s16 npredictors 
)

◆ readbits()

u32 readbits ( u32  nbits,
FILE *  ifile 
)

◆ readcodebook()

s32 readcodebook ( FILE *  fhandle,
s32 ****  table,
s32 order,
s32 npredictors 
)

◆ readlooppoints()

ALADPCMloop* readlooppoints ( FILE *  ifile,
s16 nloops 
)

◆ ReadPString()

char* ReadPString ( FILE *  ifile)

◆ vdecodeframe()

void vdecodeframe ( FILE *  ifile,
s32 outp,
s32  order,
s32 ***  coefTable 
)

◆ vencodeframe()

void vencodeframe ( FILE *  ofile,
s16 inBuffer,
s32 state,
s32 ***  coefTable,
s32  order,
s32  npredictors,
s32  nsam 
)

◆ writeout()

void writeout ( FILE *  outfd,
s32  size,
s32 l_out,
s32 r_out,
s32  chans 
)