Changeset 296 for libmpc/trunk/libmpcdec/mpc_bits_reader.h
- Timestamp:
- 04/24/07 15:07:19 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/trunk/libmpcdec/mpc_bits_reader.h
r290 r296 76 76 } 77 77 78 static mpc_inline mpc_int32_t mpc_bits_can_dec(mpc_bits_reader * r, const mpc_can_data *can) 79 { 80 mpc_uint16_t code; 81 mpc_huff_lut tmp; 82 const mpc_huffman * Table; 83 code = ((r->buff[0] << 16) | (r->buff[1] << 8) | r->buff[2]) >> r->count; 84 85 tmp = can->lut[code >> (16 - LUT_DEPTH)]; 86 if (tmp.Length != 0) { 87 r->buff -= (int)(r->count - tmp.Length) >> 3; 88 r->count = (r->count - tmp.Length) & 0x07; 89 return tmp.Value; 90 } 91 92 Table = can->table + (unsigned char)tmp.Value; 93 while (code < Table->Code) Table++; 94 95 r->buff -= (int)(r->count - Table->Length) >> 3; 96 r->count = (r->count - Table->Length) & 0x07; 97 98 return can->sym[(Table->Value - (code >> (16 - Table->Length))) & 0xFF] ; 99 } 100 78 101 // LUT-based huffman decoding routine 79 102 // works with maximum lengths up to 16 … … 93 116 94 117 Table = lut->table + (unsigned char)tmp.Value; 95 96 118 while (code < Table->Code) Table++; 97 119
Note: See TracChangeset
for help on using the changeset viewer.