~ubuntu-branches/ubuntu/trusty/libav/trusty-proposed

« back to all changes in this revision

Viewing changes to libavcodec/vp6.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2013-10-22 23:24:08 UTC
  • mfrom: (1.3.36 sid)
  • Revision ID: package-import@ubuntu.com-20131022232408-b8tvvn4pyzri9mi3
Tags: 6:9.10-1ubuntu1
* Build all -extra flavors from this source package, as libav got demoted
  from main to universe, cf LP: #1243235
* Simplify debian/rules to follow exactly the code that debian executes
* New upstream (LP: #1180288) fixes lots of security issues (LP: #1242802)
* Merge from unstable, remaining changes:
  - build-depend on libtiff5-dev rather than libtiff4-dev,
    avoids FTBFS caused by imlib
  - follow the regular debian codepaths

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
    model->vector_sig[0] = 0x80;
183
183
    model->vector_sig[1] = 0x80;
184
184
 
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));
336
336
            else
337
337
                delta |= 8;
338
338
        } else {
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]);
341
341
        }
342
342
 
404
404
                        s->nb_null[1][pt] = vp6_get_nb_null(s);
405
405
                    break;
406
406
                } else {
407
 
                    int coeff2 = vp56_coeff_bias[coeff];
 
407
                    int coeff2 = ff_vp56_coeff_bias[coeff];
408
408
                    if (coeff > 4)
409
409
                        coeff2 += get_bits(&s->gb, coeff <= 9 ? coeff - 4 : 11);
410
410
                    ct = 1 + (coeff2 > 1);
441
441
 
442
442
        if (b > 3) pt = 1;
443
443
 
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;
459
459
                    } else {
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];
496
496
        }
497
497
 
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];
500
500
    }
501
501
}
594
594
{
595
595
    VP56Context *s = avctx->priv_data;
596
596
 
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 = {
628
628
    .name           = "vp6",
629
629
    .type           = AVMEDIA_TYPE_VIDEO,
630
 
    .id             = CODEC_ID_VP6,
 
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"),
637
637
};
638
638
 
639
639
/* flash version, not flipped upside-down */
640
640
AVCodec ff_vp6f_decoder = {
641
641
    .name           = "vp6f",
642
642
    .type           = AVMEDIA_TYPE_VIDEO,
643
 
    .id             = CODEC_ID_VP6F,
 
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)"),
650
650
};
651
651
 
652
652
/* flash version, not flipped upside-down, with alpha channel */
653
653
AVCodec ff_vp6a_decoder = {
654
654
    .name           = "vp6a",
655
655
    .type           = AVMEDIA_TYPE_VIDEO,
656
 
    .id             = CODEC_ID_VP6A,
 
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)"),
663
663
};