compblock.h
上传用户:lbr_007
上传日期:2019-05-31
资源大小:282k
文件大小:1k
- #ifndef COMPBLOCK_H__
- #define COMPBLOCK_H__
- class CompBlock {
- private:
- void InitBlock(void)
- {
- m_bits = 0;
- m_length = 0;
- m_off = 0;
- m_current_bit = 0;
- m_pre = m_fol = m_bucket = 0;
- m_pushed = m_popped = 0;
- }
- protected:
- unsigned char * m_bits;
- UINT32 m_length;
- UINT32 m_off;
- UINT32 m_current_bit;
- UINT32 m_pre;
- UINT32 m_fol;
- UINT32 m_bucket;
- UINT32 m_pushed;
- UINT32 m_popped;
- public:
- CompBlock(void);
- CompBlock(UINT32 length, unsigned char * ptr);
- ~CompBlock(void);
- void SetData(UINT32 length, unsigned char * ptr);
- unsigned char * GetData(void){ return m_bits;}
- void PopNumber(UINT32 num_bits, short& num);
- void PushNumber(UINT32 num_bits, short num);
- void PushNumber(UINT32 num_bits, UINT32 num);
- void PushNumber(UINT32 num_bits, unsigned char num);
- static UINT32 CalculateMinBits(UINT32 num);
- UINT32 GetCompressedSize(void)const;
- };
- #endif