PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
adpcm.h
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2005, James Lee (jbit<at>jbit<dot>net)
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#ifndef _ADPCM_H_
12#define _ADPCM_H_
13
14typedef int (*AdpcmGetPCMfunc) (void *priv, double *pcm, int len); /* Length in samples */
15typedef int (*AdpcmPutADPCMfunc)(void *priv, void *data, int len); /* Length in bytes */
16
17typedef struct
18{
19 AdpcmGetPCMfunc GetPCM;
20 AdpcmPutADPCMfunc PutADPCM;
21 double s_1, s_2;
22 double ps_1, ps_2;
23 int curblock; /* Current block */
24 int loopstart; /* Loop start position, in ADPCM blocks (28 PCM samples) */
25 void *getpriv;
26 void *putpriv;
27 int pad;
29
30extern AdpcmSetup *AdpcmCreate(AdpcmGetPCMfunc get, void *getpriv, AdpcmPutADPCMfunc put, void *putpriv, int loopstart);
31extern int AdpcmDestroy(AdpcmSetup *set);
32extern int AdpcmEncode(AdpcmSetup *set, int blocks);
33
34
35#endif