[PATCH] Hardware deinterlacing for both software and DXVA2 decoded material

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Voyager Offline
Team-XBMC Member
Posts: 304
Joined: Apr 2010
Reputation: 4
Location: Belgium
Post: #31
isidrogar Wrote:@Voyager-xbmc, @thespecialist:

Thank you for your help here.

It seems the problem is more complicated. I have tested a DVD with a still menu image and when you navigate into DVD menu pages the background is mixed with last and new page.

This is because the processor is trying to deinterlace with totally different backward reference frames. The same occurs in your videos but in that case the "last page" doesn't exit and a black image is shown.

With this information any solution based in pts==0 will not always work. The a11559's patch is probably working because it defaults to "none" deinterlacing method or you have this selected. Can you please confirm the framerate is not doubled pressing "O" in still menu? Can you also confirm a11559's behavior with a forced deinterlacing method to "Best available" (you must have double framerate in this case)?

To avoid the problem in my code for now you can select "Auto" deinterlacing method as it will properly deinterlace when needed. Anyway I will keep working in a solution for the case you have forced deinterlacing.

Thanks for this. A couple of comments: the a11559 patch wouldn't actually do anything when playing software decoded (dvd) materials. The unfortunate thing about "auto" is that it doesn't always work correctly with some dvd material that incorrectly reports its frame interlacing type. I have tested my problem dvd with "auto" and "best available". The only difference I notice is a bit of flickering (because of my own code change re. pts==0 I proposed above). Pressing O shows fr:25.000 each time (so also with "best avail").

Regarding pts==0 as an indication of stills, I'm curious why wouldn't it always work?
find quote
thespecialist Offline
Senior Member
Posts: 126
Joined: Mar 2007
Reputation: 0
Post: #32
Ok, the issue indeed only happens with ISO's (where I dont' get DXVA2 decoding anyway). If I then select 'best available' or 'best available inverted' I get a black screen. The other options (bob etc) work.

When I unpack the ISO and play the VOB files, everything works ok (I get both DXVA2 decoding and the 'best available' options work ...

My guess is that when the ISO problem is resolved, your patches will works as well.
find quote
thespecialist Offline
Senior Member
Posts: 126
Joined: Mar 2007
Reputation: 0
Post: #33
BTW, to make it more clear:
When I unpack the ISO and play the video directory, it's of course the same issue (no DXVA2 decoding and blackscreen on 'best available'). When I play the VOB files, everything is ok.
find quote
thespecialist Offline
Senior Member
Posts: 126
Joined: Mar 2007
Reputation: 0
Post: #34
And some MORE testing Smile I have several ISO's. None decode with DXVA acceleration (like described before). However, some DO work with interlace 'best available' and some don't (blackscreen). Now, the debug log of those last video's says:

18:45:33 T:3292 M:786759680 ERROR: DXVA - failed executing m_process->VideoProcessBlt(target, &blt, samples.get(), count, NULL) at line 1362 with error 80070057
18:45:36 T:1092 M:787947520 ERROR: CDVDPlayerVideo::OpenStream - Invalid framerate 4, using forced 25fps and just trust timestamps

*EDIT* and indeed, that last DVD has both VOB's at 25 fps and VOB's at 29.97 fps. So it seems that's the source of the problems ....

What are you guys going to do ? If you are busy with other stuff, I can try to debug and fix DXVA2 decoding for ISO's/DVD structure's. But if you want to do it, that's perfectly fine as well. Just want to make sure we're not doing the same thing.
(This post was last modified: 2011-06-19 19:05 by thespecialist.)
find quote
Voyager Offline
Team-XBMC Member
Posts: 304
Joined: Apr 2010
Reputation: 4
Location: Belgium
Post: #35
thespecialist Wrote:What are you guys going to do ? If you are busy with other stuff, I can try to debug and fix DXVA2 decoding for ISO's/DVD structure's. But if you want to do it, that's perfectly fine as well. Just want to make sure we're not doing the same thing.

That would be a great addition to DVD playback. I don't have plans on debugging/fixing this, but I'll be happy to test anything you come up with.
find quote
thespecialist Offline
Senior Member
Posts: 126
Joined: Mar 2007
Reputation: 0
Post: #36
Voyager-xbmc Wrote:That would be a great addition to DVD playback. I don't have plans on debugging/fixing this, but I'll be happy to test anything you come up with.

Ok, if isidrogar isn't planning to do so, I will look into this next week.

Furthermore, I've tested the interlace patches with quite a few ISO's and DVD structures; it turned out it worked perfectly with almost all of them, except those 2 I tested first. They contain a mix of PAL and NTSC content, I think that's why it goes wrong. However, as I think that is outside the specs, I don't think this is really a problem.
find quote
thespecialist Offline
Senior Member
Posts: 126
Joined: Mar 2007
Reputation: 0
Post: #37
Well, thinking of it, now that I know what the source of the deinterlacing problems is (dvd outside specs instead of the lack of dxva2 decoding), I don't really *need* dxva2 decoding for dvd's anyway (Zacate is fast enough for it). So, dunno yet if I want to invest time into this ... If nobody wants to do it though, I'll probably take a look anyway next week, but no promises ... Invested quite a bit more time than I had planned into fixing DXVA-VC1, also got other stuff to do ...
find quote
isidrogar Offline
Member
Posts: 59
Joined: Jun 2011
Reputation: 1
Location: Spain
Post: #38
Just to get all things clear and don't mix anything, a few reminders:

- DXVA deinterlacing with software decoded content will NEVER work with Dharma nor a11559's (thus you will never get "Best available" option) because it isn't implemented. This is the reason why I made my patch.
- You only will get DXVA decoding (note the word DECODING) for DVD content if your card supports MPEG2_VLD bitstream decoding. Only a few cards can do this.
- I don't now if there is a bug in DVD ISO/VOB parsing, but if it is really there I have no plans for looking at it for now. I want to focus in fixing "black screen" bug for DXVA. Using your information and my tests I think this is only related to trying to present and deinterlace an incorrect still progressive frame detected (or forced) as interlaced.

Anyway thank you so much guys for your posts. All these reports and future are welcome.

I hope to fix the bug soon...
find quote
isidrogar Offline
Member
Posts: 59
Joined: Jun 2011
Reputation: 1
Location: Spain
Post: #39
Voyager-xbmc Wrote:Thanks for this. A couple of comments: the a11559 patch wouldn't actually do anything when playing software decoded (dvd) materials. The unfortunate thing about "auto" is that it doesn't always work correctly with some dvd material that incorrectly reports its frame interlacing type. I have tested my problem dvd with "auto" and "best available". The only difference I notice is a bit of flickering (because of my own code change re. pts==0 I proposed above). Pressing O shows fr:25.000 each time (so also with "best avail").

Regarding pts==0 as an indication of stills, I'm curious why wouldn't it always work?

@Voyager-xbmc
I said pts==0 will not always work because it only will fix "black screen" at the beginning of the stream. I have tested other DVDs and when you navigate across the menus with diferent background still images the current is incorrectly presentes as previous, and in this case pts!=0.

One more generic workaround must be implemented. I'm looking at it...
find quote
loggio Offline
Fan
Posts: 562
Joined: May 2010
Reputation: 6
Post: #40
isidrogar,

I've tested Margro's last two pre-eden builds of his PVR branch located here - http://www.scintilla.utwente.nl/~mar...ld.html#master

They contain a11599's De-interlace patch.

De-interlace is working great with pvr... However i noticed an issue that when watching live tv and pushing 'C' to bring up the channel list, the video stutters and drops a lot of frames... I'm not sure if this is a problem with the Confluence skin or his patch.

But i'm willing to bet that the problem is probably the same when using your patch.

I realise these are pre-releases and are buggy, but i can confirm that the problem only exists when De-interlacing is enabled, if you changed video de-interlace settings to 'none' the problem goes away... This leads me to believe it's not a skin related issue.
So it's worth addressing.

Just thought maybe you could test your patch with Margro's git source and have a look to see if the issue is skin related, or a bug with the patch?

Cheers,
Loggio.
find quote
Post Reply