/*---------------------------------------------------------------------------* Project: Revolution DSPADPCM dynamic link library File: dspadpcm.h Copyright (C)1998-2006 Nintendo All Rights Reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Log: dspadpcm.h,v $ Revision 1.2 2006/02/09 06:13:46 aka Changed copyright. *---------------------------------------------------------------------------*/ #ifndef __DSPTOOL_H__ #define __DSPTOOL_H__ /*---------------------------------------------------------------------------* ADPCM info passed to the caller *---------------------------------------------------------------------------*/ typedef struct { // start context s16 coef[16]; u16 gain; u16 pred_scale; s16 yn1; s16 yn2; // loop context u16 loop_pred_scale; s16 loop_yn1; s16 loop_yn2; } ADPCMINFO; /*---------------------------------------------------------------------------* exported functions pointers *---------------------------------------------------------------------------*/ u32 getBytesForAdpcmBuffer (u32 samples); u32 getBytesForAdpcmSamples (u32 samples); u32 getBytesForPcmBuffer (u32 samples); u32 getBytesForPcmSamples (u32 samples); u32 getNibbleAddress (u32 samples); u32 getNibblesForNSamples (u32 samples); u32 getSampleForAdpcmNibble (u32 nibble); u32 getBytesForAdpcmInfo (void); void encode ( s16 *src, // location of source samples (16bit PCM signed little endian) u8 *dst, // location of destination buffer ADPCMINFO *cxt, // location of adpcm info u32 samples // number of samples to encode ); void decode ( u8 *src, // location of encoded source samples s16 *dst, // location of destination buffer (16 bits / sample) ADPCMINFO *cxt, // location of adpcm info u32 samples // number of samples to decode ); void getLoopContext ( u8 *src, // location of ADPCM buffer in RAM ADPCMINFO *cxt, // location of adpcminfo u32 samples // samples to desired context ); typedef u32 (*dspToolFnType1)(u32); typedef u32 (*dspToolFnType2)(void); typedef void (*dspToolFnType3)(s16*, u8*, ADPCMINFO*, u32); typedef void (*dspToolFnType4)(u8*, s16*, ADPCMINFO*, u32); typedef void (*dspToolFnType5)(u8*, ADPCMINFO*, u32); #endif