[mythtv] VAAPI rewrite

Peter Bennett pb.mythtv at gmail.com
Sun Sep 2 20:13:03 UTC 2018


VAAPI rewite (VAAPI2) is almost complete.

I have implemented the fallback deinterlacer for speedup as is done with 
the existing deinterlacers.  Time Stretch is working for vaapi2 as well 
as it works for others. I believe there is some problem with the 
"predict drop" when your frame rate approaches 2x the screen refresh 
rate. Playback gets into  a speedup, slowdown repeating cycle. This also 
happens with other deinterlacers in the existing code from before I 
added the vaapi2, and can be seen by setting your screen refresh rate to 
30 then playing a video at 2x speedup.

The existing code switches to the fallback deinterlacer if playback 
speed is less than 0.99 or greater than 1.01. I can understand switching 
when speed is greater than 1, but I don't know why it switches to 
fallback for a reduced speed. Anybody know why this is and whether I 
should fix it to only switch when speed is greater than 1 or maybe when 
speed is greater than, say, 1.2 ?

VAAPI2 is ready for testing if anybody is interested (grab the latest 
patch on https://code.mythtv.org/trac/ticket/13311). It still needs some 
cleanup of comments, fixing conditional compile so that it will compile 
correctly with vaapi2 disabled, and testing on other environments 
(raspberry pi, shield, vdpau).

At this stage vaapi and vaapi2 are both available for selection. You 
should be able to compile with --disable-vaapi and only have the vaapi2. 
These two do not use common code. I did not use any of the existing 
vaapi code because I could not understand what it was doing.

The new design caters for decoder-based deinterlacers, and these are 
handled in MythCodecContext and subclasses for each decoder type 
(currently only vaapi2). If there are other decoder based deinterlacers. 
Also this framework makes it possible to add ffmpeg filters, of which 
there are many.

For example there are these deinterlacers available which maybe could be 
used with software decode and may be better than the ones we have in code:

  ... kerndeint         V->V       Apply kernel deinterlacing to the input.
  ... mcdeint           V->V       Apply motion compensating deinterlacing.
  T.. nnedi             V->V       Apply neural network edge directed 
interpolation intra-only deinterlacer.
  TS. w3fdif            V->V       Apply Martin Weston three field 
deinterlace.

Peter


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20180902/98263387/attachment.html>


More information about the mythtv-dev mailing list