From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 105145] vaExportSurfaceHandle interaction with surface interlaced flag prevents switching on vaapi deinterlacing dynamically Date: Mon, 11 Jun 2018 12:58:15 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0528031059==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 759AB6E2E3 for ; Mon, 11 Jun 2018 12:58:15 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0528031059== Content-Type: multipart/alternative; boundary="15287218950.5A172.18773" Content-Transfer-Encoding: 7bit --15287218950.5A172.18773 Date: Mon, 11 Jun 2018 12:58:15 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D105145 --- Comment #11 from k.philipp@gmail.com --- Hi again, > The PR got merged. I do have a patch ready (it's just a few lines anyway), but vaapi has not s= een a release yet so it is unclear which API version it should depend on. Also = we have encountered even more corner cases that prompts me to now follow up on= a comment to the PR, https://github.com/intel/libva/pull/196#issuecomment-371769757 - see below. In this bug report, I described the approach (or workaround, rather) we too= k in Kodi to get useful vaapi-accelerated playback working on most videos. In the meantime, we have encountered more edge cases. Namely: 1. The described approach will not work for 1080p HEVC and VP9 videos, since the AMD decoder does not support the interlaced (field) format for HEVC and= VP9 (see si_get_video_param) and will re-allocate the decode surfaces to progressive format when decoding the first picture. Then they cannot be use= d as post-processing input any more. This could be fixed by setting the export u= sage hint on the post-processing output surface, since then both input and outpu= t to post-processing are progressive. 2. We encountered a DVB H.264 PAFF mixed progressive/interlaced video with resolution 1920x1088, which failed the size check for always inserting post-processing by a few pixels. This can be fixed by making the check more lenient. Now as you see these issues are not unfixable (or un-workaroundable), but y= ou can probably see that in the long run these kind of edge cases will continu= e to crop up and cause problems. Our alternative workaround would be to always re-initialize the whole decode pipeline when encountering a change from interlaced to progressive frames or vice-versa, losing a bunch of already decoded frames in the pipeline in the process. As this is also far from optimal and Christian K=C3=B6nig seemed positively= inclined to switch to progressive by default, I want to investigate this route after all. The only missing piece for this to work seems to be de-weaving the fra= mes when switching to the interlaced format, and I can have a look at that (can= 't promise a time frame though). However, before investing time into that I want to ask if it would be also possible to go one step even further: Is the interlaced format necessary in= the first place? With DVB (or other, but this seems the most common) PAFF strea= ms, you will have to reallocate surfaces and weave/de-weave very often, possibly after few frames. Wouldn't it be more efficient then to ditch the interlaced format and have post-processing accept progressive-format frames for deinterlacing, like intel-vaapi-driver seems to do? --=20 You are receiving this mail because: You are the assignee for the bug.= --15287218950.5A172.18773 Date: Mon, 11 Jun 2018 12:58:15 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Comme= nt # 11 on bug 10514= 5 from k.philipp@gm= ail.com
Hi again,

> The PR got merged.

I do have a patch ready (it's just a few lines anyway), but vaapi has not s=
een
a release yet so it is unclear which API version it should depend on. Also =
we
have encountered even more corner cases that prompts me to now follow up on=
 a
comment to the PR,
=
https://github.com/intel/libva/pull/196#issuecomment-371769757 - see be=
low.

In this bug report, I described the approach (or workaround, rather) we too=
k in
Kodi to get useful vaapi-accelerated playback working on most videos. In the
meantime, we have encountered more edge cases. Namely:
1. The described approach will not work for 1080p HEVC and VP9 videos, since
the AMD decoder does not support the interlaced (field) format for HEVC and=
 VP9
(see si_get_video_param) and will re-allocate the decode surfaces to
progressive format when decoding the first picture. Then they cannot be use=
d as
post-processing input any more. This could be fixed by setting the export u=
sage
hint on the post-processing output surface, since then both input and outpu=
t to
post-processing are progressive.
2. We encountered a DVB H.264 PAFF mixed progressive/interlaced video with
resolution 1920x1088, which failed the size check for always inserting
post-processing by a few pixels. This can be fixed by making the check more
lenient.

Now as you see these issues are not unfixable (or un-workaroundable), but y=
ou
can probably see that in the long run these kind of edge cases will continu=
e to
crop up and cause problems. Our alternative workaround would be to always
re-initialize the whole decode pipeline when encountering a change from
interlaced to progressive frames or vice-versa, losing a bunch of already
decoded frames in the pipeline in the process.

As this is also far from optimal and Christian K=C3=B6nig seemed positively=
 inclined
to switch to progressive by default, I want to investigate this route after
all. The only missing piece for this to work seems to be de-weaving the fra=
mes
when switching to the interlaced format, and I can have a look at that (can=
't
promise a time frame though).
However, before investing time into that I want to ask if it would be also
possible to go one step even further: Is the interlaced format necessary in=
 the
first place? With DVB (or other, but this seems the most common) PAFF strea=
ms,
you will have to reallocate surfaces and weave/de-weave very often, possibly
after few frames. Wouldn't it be more efficient then to ditch the interlaced
format and have post-processing accept progressive-format frames for
deinterlacing, like intel-vaapi-driver seems to do?


You are receiving this mail because:
  • You are the assignee for the bug.
= --15287218950.5A172.18773-- --===============0528031059== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0528031059==--