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

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sw4y Offline
Member
Posts: 75
Joined: Apr 2011
Reputation: 0
Post: #76
Thanks you took your time to compile a different version.
So maybe the code a11599 posted on page 7 could (hopefully should) be the solution.
find quote
isidrogar Offline
Member
Posts: 59
Joined: Jun 2011
Reputation: 1
Location: Spain
Post: #77
a11599 Wrote:isidrogar:
Do I see correctly that you enable ATI h.264 ffmpeg bugfix by checking for ATI vendor ID? Is that correct? The workaround is only needed for old UVD decoder block cards. CDecoder::IsL41LimitedATI() checks exactly that. Perhaps you should use this to check if the workaround is needed. This might explain the decoding errors seen by sw4y.

EDIT

The issue appears to be DXVA.cpp @line 635.

The code says:
Code:
#ifdef FF_BUG_DXVA2_ATI
  D3DADAPTER_IDENTIFIER9 identifier = g_Windowing.GetAIdentifier();
  if (identifier.VendorId == PCIV_ATI) {
    avctx->workaround_bugs |= FF_BUG_DXVA2_ATI;
  }
#endif

I think this should be:
Code:
#ifdef FF_BUG_DXVA2_ATI
  if (IsL41LimitedATI()) {
    avctx->workaround_bugs |= FF_BUG_DXVA2_ATI;
  }
#endif

Hi a11599,

Thank you for the comments. I was in doubt about which ATI cards have the bug because I could't find any reliable information. I will include the code and post a new installer for testing.

I'm 99% sure the problem is not related to deinterlacing changes because sw4y reports no problems with DXVA2 disabled (the setting only affects decoding), but with my patch DXVA2 processor (rendering) is always enabled. I will also test the files posted by sw4y to give some feedback.

Only as reference sw4y, which video card and model are you using?
find quote
sw4y Offline
Member
Posts: 75
Joined: Apr 2011
Reputation: 0
Post: #78
Hey,

I'm using a Powercolor HD5670, this one

http://www.powercolor.com/Global/product...asp?id=236

with ATI CCC 10.3.

If you need more informations or maybe other (longer) sample files, just let me know!
find quote
isidrogar Offline
Member
Posts: 59
Joined: Jun 2011
Reputation: 1
Location: Spain
Post: #79
Hi,

I have complied a new "muscle" installer version based on my new git pvr branch.

What this version includes:

- opdenkamp's PVR branch. My system with Tvheadend backend works feautiful! Smile
- my DXVA2 deinterlacing patch based on a11599's one.
- last fixes for "black screen" problem and DXVA2 zoom scaling.
- other bug fixes found in my own tests.
- modification in method for detecting and applying ATI cards workaround as pointed by a11599.
- my patch for artifacts with ATI cards and H264 DXVA2 decoding.
- thespecialist's patches for VC-1 and MPEG2 DXVA2 decoding.

I hope this version with as many modifications don't make more difficult to indentify bugs in correct way.

@sw4y:
Try this installer and check the problem for H264 videos is gone. In my system with a UVD ATI card and my patch for H264 your sample videos play fine. Your card doesn't need the patch so with the new modification everything must be ok.

@all:
As other times before all feedback will be welcome.
find quote
sw4y Offline
Member
Posts: 75
Joined: Apr 2011
Reputation: 0
Post: #80
Thanks for your work isidrogar, I'm at work right now, but will try as soon as possible and give a feedback!
find quote
thespecialist Offline
Senior Member
Posts: 126
Joined: Mar 2007
Reputation: 0
Post: #81
Nice ! Smile
find quote
sw4y Offline
Member
Posts: 75
Joined: Apr 2011
Reputation: 0
Post: #82
Installed the new build & it works like a charme! Great work and thank you!

Could it be that the information about CPU Usage when pressing "o" while movie is playing is broken?
It always shows me 8.7%, whether DXVA2 is activated or not. No difference.

Task Manager shows me ~50% when DXVA2 is on and ~80% when DXVA2 is deactivated, so I guess DXVA2 is working.

I also have a high CPU Usage when XBMC is in idle mode (~50%), is anything known about that?

Anyway, nice job isidrogar!
find quote
minimoe Offline
Senior Member
Posts: 225
Joined: Feb 2011
Reputation: 3
Post: #83
sw4y Wrote:Installed the new build & it works like a charme! Great work and thank you!

Could it be that the information about CPU Usage when pressing "o" while movie is playing is broken?
It always shows me 8.7%, whether DXVA2 is activated or not. No difference.

Task Manager shows me ~50% when DXVA2 is on and ~80% when DXVA2 is deactivated, so I guess DXVA2 is working.

I also have a high CPU Usage when XBMC is in idle mode (~50%), is anything known about that?

Anyway, nice job isidrogar!

Must be a problem with the nightly builds. Ever since I started using the June nightlies I get 0% CPU utilization.

The patch works great but makes XBMC unresponsive on exit. I'm using Win7 32bit with ATI5450 on an old-ish AMD processor.
find quote
sw4y Offline
Member
Posts: 75
Joined: Apr 2011
Reputation: 0
Post: #84
Hm, exit works as it should. Closes directly.
find quote
jacky89 Offline
Senior Member
Posts: 144
Joined: Jul 2009
Reputation: 0
Post: #85
I installed this version from the first post:
XBMCSetup-20110618-c813ba0-dx.exe

Sorry, I don't really see any difference when playing back videos? How do I know the deinterlacing is working? Is there something I need to do to enable deinterlacing? thanks.
find quote
sw4y Offline
Member
Posts: 75
Joined: Apr 2011
Reputation: 0
Post: #86
When playing back a file, go to the video menu (that film roll at the bottom) and set deinterlacing to auto.
you can even switch the different modes, when playing back a file (an interlaced file).
You will see the difference (bad deinterlacing will show vertical lines).

Try the installer posted on page 8, it fixes some problems when playing back files with Ati cards.
find quote
Voyager Offline
Team-Kodi Member
Posts: 358
Joined: Apr 2010
Reputation: 5
Location: Belgium
Post: #87
sw4y Wrote:Hm, exit works as it should. Closes directly.

depends... the patch should be rebased to the latest xbmc/master branch as a lot of deadlock situations have been resolved recently.
find quote
jacky89 Offline
Senior Member
Posts: 144
Joined: Jul 2009
Reputation: 0
Post: #88
sw4y Wrote:When playing back a file, go to the video menu (that film roll at the bottom) and set deinterlacing to auto.
you can even switch the different modes, when playing back a file (an interlaced file).
You will see the difference (bad deinterlacing will show vertical lines).

Try the installer posted on page 8, it fixes some problems when playing back files with Ati cards.

Thanks. I installed the installer on page 8 which is compiled June 26 2011. I didn't really notice any difference when compared to the June 06, 2011 nightly build I was using on my AMD E-350. Probably the AMD driver deinterlaces on its own?

One strange thing I noticed is that after installing this version, it always show cpu usage as 0% on whatever I watch, regardless if it is sd videos or 1080p hd videos.
find quote
sw4y Offline
Member
Posts: 75
Joined: Apr 2011
Reputation: 0
Post: #89
Look at post 82 http://forum.xbmc.org/showpost.php?p=825...stcount=82
find quote
isidrogar Offline
Member
Posts: 59
Joined: Jun 2011
Reputation: 1
Location: Spain
Post: #90
Thanks for your comments!

If anybody is having unresponsive/freeze/locking problems during live TV viewing, at the end of DXVA2 decoded videos or during exit here is an updated installer.

I have modified the way Direct3D rendering surfaces are managed in CDecoder and CProcessor in order to avoid some problems of accessing to already relased pointers.
(This post was last modified: 2011-06-26 22:27 by isidrogar.)
find quote
Post Reply