00001 #ifndef _ADPCM_H_ 00002 #define _ADPCM_H_ 00003 00004 class Adpcm { 00005 00006 // Destination format - note we always decompress to 16 bit 00007 long stereo; 00008 int nBits; // number of bits in each sample 00009 00010 long valpred[2]; // Current state 00011 int index[2]; 00012 00013 long nSamples; // number of samples decompressed so far 00014 00015 // Parsing Info 00016 unsigned char *src; 00017 long bitBuf; // this should always contain at least 24 bits of data 00018 int bitPos; 00019 00020 void FillBuffer(); 00021 00022 long GetBits(int n); 00023 00024 long GetSBits(int n); 00025 00026 public: 00027 Adpcm(unsigned char *buffer, long isStereo); 00028 00029 void Decompress(short * dst, long n); // return number of good samples 00030 #ifdef DUMP 00031 void dump(BitStream *bs); 00032 void Compress(short *pcm, long n, int bits); 00033 #endif 00034 }; 00035 00036 #endif /* _ADPCM_H_ */
1.4.2