xref: /haiku/src/add-ons/media/plugins/ape_reader/MAClib/Prepare.h (revision b51fbe43f532ef73b4d3b772f60aace45765e54c)
1*b51fbe43SDavid McPaul #ifndef APE_PREPARE_H
2*b51fbe43SDavid McPaul #define APE_PREPARE_H
3*b51fbe43SDavid McPaul 
4*b51fbe43SDavid McPaul #define SPECIAL_FRAME_MONO_SILENCE              1
5*b51fbe43SDavid McPaul #define SPECIAL_FRAME_LEFT_SILENCE              1
6*b51fbe43SDavid McPaul #define SPECIAL_FRAME_RIGHT_SILENCE             2
7*b51fbe43SDavid McPaul #define SPECIAL_FRAME_PSEUDO_STEREO             4
8*b51fbe43SDavid McPaul 
9*b51fbe43SDavid McPaul /*****************************************************************************
10*b51fbe43SDavid McPaul Manage the preparation stage of compression and decompression
11*b51fbe43SDavid McPaul 
12*b51fbe43SDavid McPaul Tasks:
13*b51fbe43SDavid McPaul 
14*b51fbe43SDavid McPaul 1) convert data to 32-bit
15*b51fbe43SDavid McPaul 2) convert L,R to X,Y
16*b51fbe43SDavid McPaul 3) calculate the CRC
17*b51fbe43SDavid McPaul 4) do simple analysis
18*b51fbe43SDavid McPaul 5) check for the peak value
19*b51fbe43SDavid McPaul *****************************************************************************/
20*b51fbe43SDavid McPaul 
21*b51fbe43SDavid McPaul class IPredictorDecompress;
22*b51fbe43SDavid McPaul 
23*b51fbe43SDavid McPaul class CPrepare
24*b51fbe43SDavid McPaul {
25*b51fbe43SDavid McPaul public:
26*b51fbe43SDavid McPaul 
27*b51fbe43SDavid McPaul     int Prepare(const unsigned char * pRawData, int nBytes, const WAVEFORMATEX * pWaveFormatEx, int * pOutputX, int * pOutputY, unsigned int * pCRC, int * pSpecialCodes, int * pPeakLevel);
28*b51fbe43SDavid McPaul     void Unprepare(int X, int Y, const WAVEFORMATEX * pWaveFormatEx, unsigned char * pOutput, unsigned int * pCRC);
29*b51fbe43SDavid McPaul 
30*b51fbe43SDavid McPaul 
31*b51fbe43SDavid McPaul #ifdef BACKWARDS_COMPATIBILITY
32*b51fbe43SDavid McPaul     int UnprepareOld(int * pInputX, int *pInputY, int nBlocks, const WAVEFORMATEX * pWaveFormatEx, unsigned char * pRawData, unsigned int * pCRC, int * pSpecialCodes, int nFileVersion);
33*b51fbe43SDavid McPaul #endif
34*b51fbe43SDavid McPaul 
35*b51fbe43SDavid McPaul };
36*b51fbe43SDavid McPaul 
37*b51fbe43SDavid McPaul 
38*b51fbe43SDavid McPaul #endif // #ifndef APE_PREPARE_H
39