1#ifndef APE_APECOMPRESSCORE_H
2#define APE_APECOMPRESSCORE_H
3
4#include "APECompress.h"
5#include "BitArray.h"
6
7class CPrepare;
8class IPredictorCompress;
9
10/*************************************************************************************************
11CAPECompressCore - manages the core of compression and bitstream output
12*************************************************************************************************/
13class  CAPECompressCore
14{
15public:
16    CAPECompressCore(CIO * pIO, const WAVEFORMATEX * pwfeInput, int nMaxFrameBlocks, int nCompressionLevel);
17    ~CAPECompressCore();
18
19    int EncodeFrame(const void * pInputData, int nInputBytes);
20
21    CBitArray * GetBitArray() { return m_spBitArray.GetPtr(); }
22    int GetPeakLevel() { return m_nPeakLevel; }
23
24private:
25
26    int Prepare(const void * pInputData, int nInputBytes, int * pSpecialCodes);
27
28    CSmartPtr<CBitArray> m_spBitArray;
29    CSmartPtr<IPredictorCompress> m_spPredictorX;
30    CSmartPtr<IPredictorCompress> m_spPredictorY;
31    BIT_ARRAY_STATE    m_BitArrayStateX;
32    BIT_ARRAY_STATE    m_BitArrayStateY;
33    CSmartPtr<int> m_spDataX;
34    CSmartPtr<int> m_spDataY;
35    CSmartPtr<int> m_spTempData;
36    CSmartPtr<CPrepare> m_spPrepare;
37    WAVEFORMATEX m_wfeInput;
38    int    m_nPeakLevel;
39};
40
41#endif // #ifndef APE_APECOMPRESSCORE_H
42