diff mimic.c @ 6684:0b8ef15fa20e libavcodec

get_vlc2() only gets up to three levels in the tables. The last codes weren't being read properly.
author ramiro
date Sat, 26 Apr 2008 05:03:36 +0000
parents 28af02d712cf
children a4104482ceef
line wrap: on
line diff
--- a/mimic.c	Sat Apr 26 04:14:33 2008 +0000
+++ b/mimic.c	Sat Apr 26 05:03:36 2008 +0000
@@ -110,7 +110,7 @@
     ctx->prev_index = 0;
     ctx->cur_index = 15;
 
-    if(init_vlc(&ctx->vlc, 8, sizeof(huffbits)/sizeof(huffbits[0]),
+    if(init_vlc(&ctx->vlc, 11, sizeof(huffbits)/sizeof(huffbits[0]),
                  huffbits, 1, 1, huffcodes, 4, 4, 0)) {
         av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n");
         return -1;
@@ -172,7 +172,7 @@
         int value;
         int coeff;
 
-        vlc = get_vlc2(&ctx->gb, ctx->vlc.table, ctx->vlc.bits, 4);
+        vlc = get_vlc2(&ctx->gb, ctx->vlc.table, ctx->vlc.bits, 3);
         if(!vlc) /* end-of-block code */
             return 1;
         if(vlc == -1)