46 #ifndef _ARITH_CODEC_H_
47 #define _ARITH_CODEC_H_
90 static const unsigned int lut[256];
123 void EncodeSymbol(
const bool symbol,
const int context_num);
125 void EncodeUInt(
const unsigned int value,
const int bin1,
const int max_bin);
127 void EncodeSInt(
const int value,
const int bin1,
const int max_bin);
143 unsigned int DecodeUInt(
const int bin1,
const int max_bin);
145 int DecodeSInt(
const int bin1,
const int max_bin);
214 const bool symbol = ( count >= range_x_prob );
219 m_low_code += range_x_prob;
232 if( ( (m_low_code+
m_range-1)^m_low_code)>=0x8000 )
239 m_low_code ^= 0x4000;
245 m_low_code &= 0xFFFF;
258 const int info_ctx = (max_bin+1);
260 unsigned int value = 1;
264 if (bin<max_bin) bin+=1;
272 const int magnitude =
DecodeUInt(bin1, max_bin);
275 else value=magnitude;
333 const int bin1,
const int max_bin) {
334 const int value = (the_int+1);
335 const int info_ctx = (max_bin+1);
340 while (value>max_value) {
346 bool stop = (top_bit==1);
351 if ( bin < max_bin) bin+=1;
358 const int bin1,
const int max_bin) {
415 void Decompress(T & out_data,
const int num_bytes);
451 InitDecoder(num_bytes);
452 DoWorkDecode( out_data );