Mercurial > libavcodec.hg
comparison vp56.h @ 12365:7c54834209f6 libavcodec
VP5/6/8: eliminate CABAC dependency
Create a custom table for VP5/6/8's renorm to avoid depending on H.264's.
Saves one instruction in the arithmetic decoder as well.
author | darkshikari |
---|---|
date | Wed, 04 Aug 2010 23:04:05 +0000 |
parents | e25a985a550c |
children | d0b25641338b |
comparison
equal
deleted
inserted
replaced
12364:2e96cab6ecde | 12365:7c54834209f6 |
---|---|
179 | 179 |
180 /** | 180 /** |
181 * vp56 specific range coder implementation | 181 * vp56 specific range coder implementation |
182 */ | 182 */ |
183 | 183 |
184 static inline void vp56_init_range_decoder(VP56RangeCoder *c, | 184 extern const uint8_t ff_vp56_norm_shift[256]; |
185 const uint8_t *buf, int buf_size) | 185 void ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size); |
186 { | |
187 c->high = 255; | |
188 c->bits = -8; | |
189 c->buffer = buf; | |
190 c->end = buf + buf_size; | |
191 c->code_word = bytestream_get_be16(&c->buffer); | |
192 } | |
193 | 186 |
194 static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c) | 187 static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c) |
195 { | 188 { |
196 int shift = ff_h264_norm_shift[c->high] - 1; | 189 int shift = ff_vp56_norm_shift[c->high]; |
197 int bits = c->bits; | 190 int bits = c->bits; |
198 unsigned int code_word = c->code_word; | 191 unsigned int code_word = c->code_word; |
199 | 192 |
200 c->high <<= shift; | 193 c->high <<= shift; |
201 code_word <<= shift; | 194 code_word <<= shift; |