int scale, shift, i; /* for initializing LUT for intensity compensation */
v->numref=0;
- v->fcm=0;
- v->field_mode=0;
v->p_frame_skipped = 0;
if (v->second_field) {
+ if(v->fcm!=2 || v->field_mode!=1)
+ return -1;
v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
if (v->fptype & 4)
v->s.pict_type = (v->fptype & 1) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B;
if (v->interlace) {
v->fcm = decode012(gb);
if (v->fcm) {
- if (v->fcm == 2)
+ if (v->fcm == ILACE_FIELD)
v->field_mode = 1;
if (!v->warn_interlaced++)
av_log(v->s.avctx, AV_LOG_ERROR,
"Interlaced frames/fields support is incomplete\n");
}
} else {
- v->fcm = 0;
+ v->fcm = PROGRESSIVE;
}
if (v->field_mode) {
v->rnd = get_bits1(gb);
if (v->interlace)
v->uvsamp = get_bits1(gb);
+ if(!ff_vc1_bfraction_vlc.table)
+ return 0; //parsing only, vlc tables havnt been allocated
if (v->field_mode) {
if (!v->refdist_flag)
v->refdist = 0;
switch (v->s.pict_type) {
case AV_PICTURE_TYPE_I:
case AV_PICTURE_TYPE_BI:
- if (v->fcm == 1) { //interlace frame picture
+ if (v->fcm == ILACE_FRAME) { //interlace frame picture
status = bitplane_decoding(v->fieldtx_plane, &v->fieldtx_is_raw, v);
if (status < 0)
return -1;
v->dmvrange = get_unary(gb, 0, 3);
else
v->dmvrange = 0;
- if (v->fcm == 1) { // interlaced frame picture
+ if (v->fcm == ILACE_FRAME) { // interlaced frame picture
v->fourmvswitch = get_bits1(gb);
v->intcomp = get_bits1(gb);
if (v->intcomp) {
v->tt_index = 1;
else
v->tt_index = 2;
- if (v->fcm != 1) {
+ if (v->fcm != ILACE_FRAME) {
int mvmode;
mvmode = get_unary(gb, 1, 4);
lowquant = (v->pq > 12) ? 0 : 1;
|| (v->mv_mode == MV_PMODE_INTENSITY_COMP
&& v->mv_mode2 == MV_PMODE_1MV_HPEL_BILIN));
}
- if (v->fcm == 0) { // progressive
+ if (v->fcm == PROGRESSIVE) { // progressive
if ((v->mv_mode == MV_PMODE_INTENSITY_COMP &&
v->mv_mode2 == MV_PMODE_MIXED_MV)
|| v->mv_mode == MV_PMODE_MIXED_MV) {
/* Hopefully this is correct for P frames */
v->s.mv_table_index = get_bits(gb, 2); //but using ff_vc1_ tables
v->cbpcy_vlc = &ff_vc1_cbpcy_p_vlc[get_bits(gb, 2)];
- } else if (v->fcm == 1) { // frame interlaced
+ } else if (v->fcm == ILACE_FRAME) { // frame interlaced
v->qs_last = v->s.quarter_sample;
v->s.quarter_sample = 1;
v->s.mspel = 1;
break;
case AV_PICTURE_TYPE_B:
// TODO: implement interlaced frame B picture decoding
- if (v->fcm == 1)
+ if (v->fcm == ILACE_FRAME)
return -1;
if (v->extended_mv)
v->mvrange = get_unary(gb, 0, 3);