182
182
model->vector_sig[0] = 0x80;
183
183
model->vector_sig[1] = 0x80;
185
memcpy(model->mb_types_stats, vp56_def_mb_types_stats, sizeof(model->mb_types_stats));
185
memcpy(model->mb_types_stats, ff_vp56_def_mb_types_stats, sizeof(model->mb_types_stats));
186
186
memcpy(model->vector_fdv, vp6_def_fdv_vector_model, sizeof(model->vector_fdv));
187
187
memcpy(model->vector_pdv, vp6_def_pdv_vector_model, sizeof(model->vector_pdv));
188
188
memcpy(model->coeff_runv, vp6_def_runv_coeff_model, sizeof(model->coeff_runv));
339
delta = vp56_rac_get_tree(c, vp56_pva_tree,
339
delta = vp56_rac_get_tree(c, ff_vp56_pva_tree,
340
340
model->vector_pdv[comp]);
404
404
s->nb_null[1][pt] = vp6_get_nb_null(s);
407
int coeff2 = vp56_coeff_bias[coeff];
407
int coeff2 = ff_vp56_coeff_bias[coeff];
409
409
coeff2 += get_bits(&s->gb, coeff <= 9 ? coeff - 4 : 11);
410
410
ct = 1 + (coeff2 > 1);
442
442
if (b > 3) pt = 1;
444
ctx = s->left_block[vp56_b6to4[b]].not_null_dc
444
ctx = s->left_block[ff_vp56_b6to4[b]].not_null_dc
445
445
+ s->above_blocks[s->above_block_idx[b]].not_null_dc;
446
446
model1 = model->coeff_dccv[pt];
447
447
model2 = model->coeff_dcct[pt][ctx];
452
452
/* parse a coeff */
453
453
if (vp56_rac_get_prob(c, model2[2])) {
454
454
if (vp56_rac_get_prob(c, model2[3])) {
455
idx = vp56_rac_get_tree(c, vp56_pc_tree, model1);
456
coeff = vp56_coeff_bias[idx+5];
457
for (i=vp56_coeff_bit_length[idx]; i>=0; i--)
458
coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i;
455
idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1);
456
coeff = ff_vp56_coeff_bias[idx+5];
457
for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--)
458
coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i;
460
460
if (vp56_rac_get_prob(c, model2[4]))
461
461
coeff = 3 + vp56_rac_get_prob(c, model1[5]);
495
495
model1 = model2 = model->coeff_ract[pt][ct][cg];
498
s->left_block[vp56_b6to4[b]].not_null_dc =
498
s->left_block[ff_vp56_b6to4[b]].not_null_dc =
499
499
s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0];
595
595
VP56Context *s = avctx->priv_data;
597
ff_vp56_init(avctx, avctx->codec->id == CODEC_ID_VP6,
598
avctx->codec->id == CODEC_ID_VP6A);
597
ff_vp56_init(avctx, avctx->codec->id == AV_CODEC_ID_VP6,
598
avctx->codec->id == AV_CODEC_ID_VP6A);
599
599
s->vp56_coord_div = vp6_coord_div;
600
600
s->parse_vector_adjustment = vp6_parse_vector_adjustment;
601
601
s->filter = vp6_filter;
627
627
AVCodec ff_vp6_decoder = {
629
629
.type = AVMEDIA_TYPE_VIDEO,
630
.id = AV_CODEC_ID_VP6,
631
631
.priv_data_size = sizeof(VP56Context),
632
632
.init = vp6_decode_init,
633
633
.close = vp6_decode_free,
634
634
.decode = ff_vp56_decode_frame,
635
635
.capabilities = CODEC_CAP_DR1,
636
.long_name = NULL_IF_CONFIG_SMALL("On2 VP6"),
636
.long_name = NULL_IF_CONFIG_SMALL("On2 VP6"),
639
639
/* flash version, not flipped upside-down */
640
640
AVCodec ff_vp6f_decoder = {
642
642
.type = AVMEDIA_TYPE_VIDEO,
643
.id = AV_CODEC_ID_VP6F,
644
644
.priv_data_size = sizeof(VP56Context),
645
645
.init = vp6_decode_init,
646
646
.close = vp6_decode_free,
647
647
.decode = ff_vp56_decode_frame,
648
648
.capabilities = CODEC_CAP_DR1,
649
.long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"),
649
.long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"),
652
652
/* flash version, not flipped upside-down, with alpha channel */
653
653
AVCodec ff_vp6a_decoder = {
655
655
.type = AVMEDIA_TYPE_VIDEO,
656
.id = AV_CODEC_ID_VP6A,
657
657
.priv_data_size = sizeof(VP56Context),
658
658
.init = vp6_decode_init,
659
659
.close = vp6_decode_free,
660
660
.decode = ff_vp56_decode_frame,
661
661
.capabilities = CODEC_CAP_DR1,
662
.long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"),
662
.long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"),