[Libva] [PATCH] mpeg2: fix incorrect slice_vertical_position from codec layers.

Gwenole Beauchesne gb.devel at gmail.com
Thu Mar 29 00:01:55 PDT 2012


Hi,

2012/3/29 Xiang, Haihao <haihao.xiang at intel.com>:
>
>> +            vpos = slice_param->slice_vertical_position;
>> +            if (vpos >= mb_height || vpos == last_vpos + 2)
>> +                return 1;
>
> Why is the workaround applied for vpos == last_vpos + 2 ? I think it is
> right that vpos = 0, 2, 4, ... for top field and vpos = 1, 3, 5, .. for
> bottom field.

No, this is wrong, and that was the bug. The codec layer passed wrong
info. The bitstream really has linearly increasing
slice_vertical_position, and this is what is expected by PVR: the
original bitstream info. Of course, we could have fixed PVR, but if
this is for all drivers to have the same workaround, that's a bit
silly. Let's use the proper way. Besides, some other PVR drivers can't
be fixed. Besides, this is extra computation we don't need. The Gen HW
also computes the target line correctly, based on TFF and first field.

> I still met GPU hang issue when playing some mpeg2 conformance tests
> such as sony-ct1.bits.  The root cause is that the codec layers pass
> wrong parameters to the driver.  I think a safe way to avoid GPU hang
> issue is not to decode the stream.

sony-ct1.bits works well, both with mplayer and gstreamer. For the
former, you need 2 patches I posted to the ffmpeg/libav dev lists. It
seems this also fixes support for DXVA along the way on Windows. :)

You also need master or v1.0-branch of the Gen driver.

Regards,
Gwenole.


More information about the Libva mailing list