| 52 | #include "arithmeticdecoder.hpp" |
| 53 | |
| 54 | class IntegerCompressor |
| 55 | { |
| 56 | public: |
| 57 | |
| 58 | // Constructor & Deconstructor |
| 59 | IntegerCompressor(ArithmeticEncoder* enc, U32 bits=16, U32 contexts=1, U32 bits_high=8, U32 range=0); |
| 60 | IntegerCompressor(ArithmeticDecoder* dec, U32 bits=16, U32 contexts=1, U32 bits_high=8, U32 range=0); |
| 61 | ~IntegerCompressor(); |
| 62 | |
| 63 | // Manage Compressor |
| 64 | void initCompressor(); |
| 65 | void compress(I32 iPred, I32 iReal, U32 context=0); |
| 66 | |
| 67 | // Manage Decompressor |
| 68 | void initDecompressor(); |
| 69 | I32 decompress(I32 iPred, U32 context=0); |
| 70 | |
| 71 | // Get the k corrector bits from the last compress/decompress call |
| 72 | U32 getK() const {return k;}; |
| 73 | |
| 74 | private: |
| 75 | void writeCorrector(I32 c, ArithmeticModel* model); |
| 76 | I32 readCorrector(ArithmeticModel* model); |
| 77 | |
| 78 | U32 k; |
| 79 | |
| 80 | U32 contexts; |
| 81 | U32 bits_high; |
| 82 | |
| 83 | U32 bits; |
| 84 | U32 range; |
| 85 | |
| 86 | U32 corr_bits; |
| 87 | U32 corr_range; |
| 88 | I32 corr_min; |
| 89 | I32 corr_max; |
| 90 | |
| 91 | ArithmeticEncoder* enc; |
| 92 | ArithmeticDecoder* dec; |
| 93 | |
| 94 | ArithmeticModel** mBits; |
| 95 | |
| 96 | ArithmeticModel** mCorrector; |
| 97 | |
| 98 | #ifdef CREATE_HISTOGRAMS |
| 99 | int** corr_histogram; |
| 100 | #endif |
| 101 | }; |
| 102 | |
| 103 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected