comparison 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
comparison
equal deleted inserted replaced
6683:75b2158c583a 6684:0b8ef15fa20e
108 MimicContext *ctx = avctx->priv_data; 108 MimicContext *ctx = avctx->priv_data;
109 109
110 ctx->prev_index = 0; 110 ctx->prev_index = 0;
111 ctx->cur_index = 15; 111 ctx->cur_index = 15;
112 112
113 if(init_vlc(&ctx->vlc, 8, sizeof(huffbits)/sizeof(huffbits[0]), 113 if(init_vlc(&ctx->vlc, 11, sizeof(huffbits)/sizeof(huffbits[0]),
114 huffbits, 1, 1, huffcodes, 4, 4, 0)) { 114 huffbits, 1, 1, huffcodes, 4, 4, 0)) {
115 av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n"); 115 av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n");
116 return -1; 116 return -1;
117 } 117 }
118 dsputil_init(&ctx->dsp, avctx); 118 dsputil_init(&ctx->dsp, avctx);
170 for(pos = 1; pos < num_coeffs; pos++) { 170 for(pos = 1; pos < num_coeffs; pos++) {
171 uint32_t vlc, num_bits; 171 uint32_t vlc, num_bits;
172 int value; 172 int value;
173 int coeff; 173 int coeff;
174 174
175 vlc = get_vlc2(&ctx->gb, ctx->vlc.table, ctx->vlc.bits, 4); 175 vlc = get_vlc2(&ctx->gb, ctx->vlc.table, ctx->vlc.bits, 3);
176 if(!vlc) /* end-of-block code */ 176 if(!vlc) /* end-of-block code */
177 return 1; 177 return 1;
178 if(vlc == -1) 178 if(vlc == -1)
179 return 0; 179 return 0;
180 180