Revision 33dbc1b7
libavcodec/vp3.c | ||
---|---|---|
461 | 461 |
|
462 | 462 |
/* unpack the list of partially-coded superblocks */ |
463 | 463 |
bit = get_bits1(gb); |
464 |
/* toggle the bit because as soon as the first run length is |
|
465 |
* fetched the bit will be toggled again */ |
|
466 |
bit ^= 1; |
|
467 | 464 |
while (current_superblock < s->superblock_count) { |
468 |
if (current_run-- == 0) { |
|
469 |
bit ^= 1; |
|
470 | 465 |
current_run = get_vlc2(gb, |
471 |
s->superblock_run_length_vlc.table, 6, 2); |
|
472 |
if (current_run == 33)
|
|
466 |
s->superblock_run_length_vlc.table, 6, 2) + 1;
|
|
467 |
if (current_run == 34)
|
|
473 | 468 |
current_run += get_bits(gb, 12); |
474 | 469 |
|
470 |
if (current_superblock + current_run > s->superblock_count) { |
|
471 |
av_log(s->avctx, AV_LOG_ERROR, "Invalid partially coded superblock run length\n"); |
|
472 |
return -1; |
|
473 |
} |
|
474 |
|
|
475 |
memset(s->superblock_coding + current_superblock, bit, current_run); |
|
476 |
|
|
477 |
current_superblock += current_run; |
|
478 |
|
|
475 | 479 |
/* if any of the superblocks are not partially coded, flag |
476 | 480 |
* a boolean to decode the list of fully-coded superblocks */ |
477 | 481 |
if (bit == 0) { |
... | ... | |
482 | 486 |
* superblocks */ |
483 | 487 |
decode_partial_blocks = 1; |
484 | 488 |
} |
485 |
} |
|
486 |
s->superblock_coding[current_superblock++] = bit;
|
|
489 |
|
|
490 |
bit ^= 1;
|
|
487 | 491 |
} |
488 | 492 |
|
489 | 493 |
/* unpack the list of fully coded superblocks if any of the blocks were |
Also available in: Unified diff