Commit 50879935 authored by Stefan Gehrer's avatar Stefan Gehrer

replace run by run+1 in VLC tables

Originally committed as revision 5751 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 8ea543b5
...@@ -655,7 +655,7 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb, ...@@ -655,7 +655,7 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
for(i=0;i<65;i++) { for(i=0;i<65;i++) {
level_code = get_ue_code(gb,r->golomb_order); level_code = get_ue_code(gb,r->golomb_order);
if(level_code >= ESCAPE_CODE) { if(level_code >= ESCAPE_CODE) {
run = (level_code - ESCAPE_CODE) >> 1; run = ((level_code - ESCAPE_CODE) >> 1) + 1;
esc_code = get_ue_code(gb,esc_golomb_order); esc_code = get_ue_code(gb,esc_golomb_order);
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]); level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
while(level > r->inc_limit) while(level > r->inc_limit)
...@@ -663,8 +663,6 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb, ...@@ -663,8 +663,6 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
mask = -(level_code & 1); mask = -(level_code & 1);
level = (level^mask) - mask; level = (level^mask) - mask;
} else { } else {
if(level_code < 0)
return -1;
level = r->rltab[level_code][0]; level = r->rltab[level_code][0];
if(!level) //end of block signal if(!level) //end of block signal
break; break;
...@@ -676,7 +674,7 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb, ...@@ -676,7 +674,7 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
} }
/* inverse scan and dequantization */ /* inverse scan and dequantization */
while(--i >= 0){ while(--i >= 0){
pos += 1 + run_buf[i]; pos += run_buf[i];
if(pos > 63) { if(pos > 63) {
av_log(h->s.avctx, AV_LOG_ERROR, av_log(h->s.avctx, AV_LOG_ERROR,
"position out of block bounds at pic %d MB(%d,%d)\n", "position out of block bounds at pic %d MB(%d,%d)\n",
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment