[Libva] [PATCH] mpeg2: fix incorrect slice_vertical_position from codec layers.
Xiang, Haihao
haihao.xiang at intel.com
Thu Mar 29 01:27:55 PDT 2012
On Thu, 2012-03-29 at 09:01 +0200, Gwenole Beauchesne wrote:
> 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.
I'm a little confused. Do you mean PVR driver can work well without a
workaround even if the codec layer passed wrong info ?
> 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. :)
>
The hang issue disappears after applying your patches for FFmpeg. But
the decoded picture is still wrong at the beginning.
> You also need master or v1.0-branch of the Gen driver.
>
> Regards,
> Gwenole.
More information about the Libva
mailing list