xref: /haiku/src/add-ons/media/plugins/ape_reader/MAClib/Prepare.h (revision 23c0ae0362174e8dbdc88d14e03618815dde145e)
1b51fbe43SDavid McPaul #ifndef APE_PREPARE_H
2b51fbe43SDavid McPaul #define APE_PREPARE_H
3b51fbe43SDavid McPaul 
4*23c0ae03SWim van der Meer #include "NoWindows.h"
5*23c0ae03SWim van der Meer 
6b51fbe43SDavid McPaul #define SPECIAL_FRAME_MONO_SILENCE              1
7b51fbe43SDavid McPaul #define SPECIAL_FRAME_LEFT_SILENCE              1
8b51fbe43SDavid McPaul #define SPECIAL_FRAME_RIGHT_SILENCE             2
9b51fbe43SDavid McPaul #define SPECIAL_FRAME_PSEUDO_STEREO             4
10b51fbe43SDavid McPaul 
1127a54cf0SWim van der Meer 
12b51fbe43SDavid McPaul /*****************************************************************************
13b51fbe43SDavid McPaul Manage the preparation stage of compression and decompression
14b51fbe43SDavid McPaul 
15b51fbe43SDavid McPaul Tasks:
16b51fbe43SDavid McPaul 
17b51fbe43SDavid McPaul 1) convert data to 32-bit
18b51fbe43SDavid McPaul 2) convert L,R to X,Y
19b51fbe43SDavid McPaul 3) calculate the CRC
20b51fbe43SDavid McPaul 4) do simple analysis
21b51fbe43SDavid McPaul 5) check for the peak value
22b51fbe43SDavid McPaul *****************************************************************************/
23b51fbe43SDavid McPaul 
2427a54cf0SWim van der Meer 
25b51fbe43SDavid McPaul class IPredictorDecompress;
26b51fbe43SDavid McPaul 
2727a54cf0SWim van der Meer 
28b51fbe43SDavid McPaul class CPrepare
29b51fbe43SDavid McPaul {
30b51fbe43SDavid McPaul public:
3127a54cf0SWim van der Meer     int		Prepare(const unsigned char* pRawData, int nBytes,
3227a54cf0SWim van der Meer     			const WAVEFORMATEX* pWaveFormatEx, int* pOutputX,
3327a54cf0SWim van der Meer     			int* pOutputY, unsigned int* pCRC, int* pSpecialCodes,
3427a54cf0SWim van der Meer     			int* pPeakLevel);
3527a54cf0SWim van der Meer     void	Unprepare(int X, int Y, const WAVEFORMATEX* pWaveFormatEx,
3627a54cf0SWim van der Meer     			unsigned char* pOutput, unsigned int* pCRC);
37b51fbe43SDavid McPaul 
38b51fbe43SDavid McPaul #ifdef BACKWARDS_COMPATIBILITY
3927a54cf0SWim van der Meer     int 	UnprepareOld(int* pInputX, int* pInputY, int nBlocks,
4027a54cf0SWim van der Meer     			const WAVEFORMATEX* pWaveFormatEx, unsigned char* pRawData,
4127a54cf0SWim van der Meer     			unsigned int* pCRC, int* pSpecialCodes, int nFileVersion);
42b51fbe43SDavid McPaul #endif
43b51fbe43SDavid McPaul 
44b51fbe43SDavid McPaul };
45b51fbe43SDavid McPaul 
46b51fbe43SDavid McPaul 
47b51fbe43SDavid McPaul #endif // #ifndef APE_PREPARE_H
48