1 /*---------------------------------------------------------------------------* 2 Project: DLS converter for SYN 3 File: dspadpcm.h 4 5 Copyright (C)2001-2006 Nintendo All Rights Reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Log: dspadpcm.h,v $ 14 Revision 1.2 2006/02/08 06:21:14 aka 15 Changed copyright. 16 17 18 *---------------------------------------------------------------------------*/ 19 20 #ifndef __DSPADPCM_H__ 21 #define __DSPADPCM_H__ 22 23 //#define MAKE_A_DLL 24 25 #ifdef MAKE_A_DLL 26 #define LINKDLL __declspec(dllexport) 27 #else 28 #define LINKDLL __declspec(dllimport) 29 #endif 30 31 /*---------------------------------------------------------------------------* 32 ADPCM info passed to the caller 33 *---------------------------------------------------------------------------*/ 34 typedef struct 35 { 36 // start context 37 s16 coef[16]; 38 u16 gain; 39 u16 pred_scale; 40 s16 yn1; 41 s16 yn2; 42 43 // loop context 44 u16 loop_pred_scale; 45 s16 loop_yn1; 46 s16 loop_yn2; 47 48 } ADPCMINFO; 49 50 51 /*---------------------------------------------------------------------------* 52 exported functions 53 *---------------------------------------------------------------------------*/ 54 /* 55 LINKDLL u32 getBytesForAdpcmBuffer (u32 samples); 56 LINKDLL u32 getBytesForAdpcmSamples (u32 samples); 57 LINKDLL u32 getBytesForPcmBuffer (u32 samples); 58 LINKDLL u32 getBytesForPcmSamples (u32 samples); 59 LINKDLL u32 getSampleForAdpcmNibble (u32 nibble); 60 LINKDLL u32 getBytesForAdpcmInfo (void); 61 LINKDLL u32 getNibbleAddress (u32 samples); 62 63 LINKDLL void encode 64 ( 65 s16 *src, // location of source samples (16bit PCM signed little endian) 66 u8 *dst, // location of destination buffer 67 ADPCMINFO *cxt, // location of adpcm info 68 u32 samples // number of samples to encode 69 ); 70 71 LINKDLL void decode 72 ( 73 u8 *src, // location of encoded source samples 74 s16 *dst, // location of destination buffer (16 bits / sample) 75 ADPCMINFO *cxt, // location of adpcm info 76 u32 samples // number of samples to decode 77 ); 78 79 LINKDLL void getLoopContext 80 ( 81 u8 *src, // location of ADPCM buffer in RAM 82 ADPCMINFO *cxt, // location of adpcminfo 83 u32 samples // samples to desired context 84 ); 85 */ 86 #endif 87