diff 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
line wrap: on
line diff
--- a/vp56.h	Wed Aug 04 06:56:55 2010 +0000
+++ b/vp56.h	Wed Aug 04 23:04:05 2010 +0000
@@ -181,19 +181,12 @@
  * vp56 specific range coder implementation
  */
 
-static inline void vp56_init_range_decoder(VP56RangeCoder *c,
-                                           const uint8_t *buf, int buf_size)
-{
-    c->high = 255;
-    c->bits = -8;
-    c->buffer = buf;
-    c->end = buf + buf_size;
-    c->code_word = bytestream_get_be16(&c->buffer);
-}
+extern const uint8_t ff_vp56_norm_shift[256];
+void ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size);
 
 static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c)
 {
-    int shift = ff_h264_norm_shift[c->high] - 1;
+    int shift = ff_vp56_norm_shift[c->high];
     int bits = c->bits;
     unsigned int code_word = c->code_word;