[FFmpeg-devel] [PATCH 1/5] avcodec/vc1: FIELDTX is only coded raw in interlaced frame I pictures

Jerome Borsboom jerome.borsboom at carpalis.nl
Sun May 20 11:56:19 EEST 2018

>>  libavcodec/vc1_block.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
>> index f59c440943..daf30fdbfe 100644
>> --- a/libavcodec/vc1_block.c
>> +++ b/libavcodec/vc1_block.c
>> @@ -2680,7 +2680,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
>>              s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0;
>>              // do actual MB decoding and displaying
>> -            if (v->fieldtx_is_raw)
>> +            if (v->fcm == ILACE_FRAME && v->fieldtx_is_raw)
>>                  v->fieldtx_plane[mb_pos] = get_bits1(&v->s.gb);
> fieldtx_is_raw is only set when fcm == ILACE_FRAME
> I suspect the intend was it is unset otherwise. This would avoid the extra
> check

I think this may be a design decision. You can either set the decoding
context, 'v' in this case, to a sane default or only use syntax elements
where appropriate. The current state of the bitstream decoder for VC-1
is not very clean in this regard. But it does certainly not reset the
decoding context for each frame and even depends on this behaviour for
at least one case.

While I think it may be better to reset the decoding context to sane
defaults for each frame for the applicable variables, for now, I would
like to propose to leave the bitstream decoder as is and use this patch.
Currently, I am focusing on compliance to the VC-1 spec and a cleanup of
the bitstream decoder may be something down the road.

A trac issue might be appropriate to remember this issue, although the
decoder in general could use a good cleanup.


More information about the ffmpeg-devel mailing list