Solved Issue 10-bit h264 (Hi10) Support?

  Thread Rating:
  • 7 Votes - 4.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
jpsdr Offline
Senior Member
Posts: 260
Joined: Oct 2003
Reputation: 0
Post: #431
That's why i've said "i think". I should have said "what's seems".
The a0fc63d patch is the following :
Code:
+  /* Only allow slice threading, since frame threading is more
+   * sensitive to changes in frame sizes, and it causes crashes
+   * during HW accell */
+  m_pCodecContext->thread_type = FF_THREAD_SLICE;

Well, maybe it could "simply" be changed by :
Code:
if ("dxva is enabled") {m_pCodecContext->thread_type = FF_THREAD_SLICE;} else {m_pCodecContext->thread_type = "value wich allow frame threading";}
As i said, it seems easy, but you're the devs, not me. I don't know, how difficult it can be to get the "dxva enabled" information in this part of the code.

Of course, if this part of the code is called only once at the startup of XBMC, it's not good because change in settings will not be taken in, but if this part of the code is called each time a file is played (at the init of DVDPlayer), well, at first glance i don't realy see any trouble.
I'm using the "-mt" version maruchan build since it's been posted, and have encounter any problem in all the files i've played for now (i've dxva disabled of course).
(This post was last modified: 2012-04-26 11:28 by jpsdr.)
find quote
maruchan Offline
Fan
Posts: 311
Joined: Feb 2009
Reputation: 0
Post: #432
I think I remember reading that FFMPEG decides whether or not to use multithreaded decoding before it's decided whether or not to use hardware acceleration, so you cannot simply have a conditional "if not DXVA then multithread", because you cannot know whether or not DXVA is supported that early on.

Perhaps there's a way to default to multithreading, then wait to see if hardware acceleration is supported; if it is, re-init playback with multithreading disabled. This would come at a hit in initial playback speed, however.

As a note, if there's one thing that developers hate hearing, it's that something is "simple." Trust me, some seemingly simple things can be a huge pain in the ass to implement.
find quote
jpsdr Offline
Senior Member
Posts: 260
Joined: Oct 2003
Reputation: 0
Post: #433
(2012-04-26 14:51)maruchan Wrote:  I think I remember reading that FFMPEG decides whether or not to use multithreaded decoding before it's decided whether or not to use hardware acceleration, so you cannot simply have a conditional "if not DXVA then multithread", because you cannot know whether or not DXVA is supported that early on.

Yes, but i'm not talking about the fact DXVA is supported, i'm talking about the fact DXVA is enabled in the UI settings. I can perfectly understand that at this stage you may still don't know if DXVA is supported, but you always know if DXVA is enabled or not in the UI settings.
This is why in the code i've wrote "dxva is enabled" and not "dxva is supported". What you're talking about is realy more complex that what i suggest.
Now, the only thing i see wich may be difficult or tricky, is to have access to this information inside the specific function this code is. If this information is easely avaible by any variable/class/structure already passed down to the function, i'm even more convinced "it's easy". If not, it may be indeed more difficult, as information must be pass down, wich indeed in that case can affect a lot of functions to modify to pass this parameter.
But i'm still convinced that it's for now the easiest (but maybe not simple Wink) way to enable multi-threading.

(2012-04-26 14:51)maruchan Wrote:  As a note, if there's one thing that developers hate hearing, it's that something is "simple." Trust me, some seemingly simple things can be a huge pain in the ass to implement.
I know, it's my little mistake and somehow "bad" english, and how i thought i would be interpreted. In my post i should have wrote "It seems (but maybe it's not) simple" and not "I think it's simple".
(This post was last modified: 2012-04-26 17:33 by jpsdr.)
find quote
Roman_V_M Offline
Fan
Posts: 332
Joined: Jun 2011
Reputation: 6
Location: Kyiv, Ukraine
Post: #434
But even if DXVA (or other VA technologies for that matter) is enabled you'd still want to have multi-threading for videos that are not accelerated. I don't know, maybe there should be some option, e.g. in advancedsettings.xml to tell a decoder how many threads to use, like it is done in LAVFilters Video.

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 12.2 (custom build) on Windows 7
find quote
s1l3nc0r Offline
Member
Posts: 51
Joined: Jul 2011
Reputation: 0
Post: #435
Nice, I will give one of teh latest nightlies a go on this system:
A6-Pack
find quote
jpsdr Offline
Senior Member
Posts: 260
Joined: Oct 2003
Reputation: 0
Post: #436
(2012-04-27 09:03)Roman_V_M Wrote:  But even if DXVA (or other VA technologies for that matter) is enabled you'd still want to have multi-threading for videos that are not accelerated. I don't know, maybe there should be some option, e.g. in advancedsettings.xml to tell a decoder how many threads to use, like it is done in LAVFilters Video.

As maruchan explained in post #433 just a little ahead, implement this may be very difficult.
find quote
jpsdr Offline
Senior Member
Posts: 260
Joined: Oct 2003
Reputation: 0
Post: #437
(2012-04-26 10:11)spiff Wrote:  we figured it was so simple, we have left it to you.

I've followed the wiki tutorial, download xbmc code, and knowing absolutely nothing, it take me aroud... 10 minutes to figure out 2 possibilities at first time...

Edited : After having seen a little more, i think the following is good, so only one proposition left :

Code:
/* Only allow slice threading, since frame threading is more
   * sensitive to changes in frame sizes, and it causes crashes
   * during HW accell */
  bool disable_mt_frame=true;
#ifdef HAS_DX
  disable_mt_frame=g_guiSettings.GetBool("videoplayer.usedxva2");
#endif
  if (disable_mt_frame) m_pCodecContext->thread_type = FF_THREAD_SLICE;
  else m_pCodecContext->thread_type = FF_THREAD_FRAME;

This was indeed higly complex...Undecided
Nevertheless, i think a dev must confirm.
(This post was last modified: 2012-05-03 08:07 by jpsdr.)
find quote
jpsdr Offline
Senior Member
Posts: 260
Joined: Oct 2003
Reputation: 0
Post: #438
I've been able to create a build with this, very quick test, seems to work...
find quote
Shine Offline
Junior Member
Posts: 22
Joined: Apr 2012
Reputation: 1
Post: #439
I've created a new build using an approach similar to maruchan's idea.

This new build is based on the current master (2012-04-29, rev. d2ac454556).

In addition, it contains the following changes:
This should be the best of both worlds:
  • software decoding incl. Hi10P playback with full (frame and slice) MT enabled
  • DXVA decoding working and limited to slice threading like in the current nightlies
The playback delay penalty introduced by pre-checking the files is between 0.1 and 0.3 seconds per file, ie. barely noticable.

The build is here: http://www.mediafire.com/?6cx2ndk11q7q4v8

Test&Enjoy.
(This post was last modified: 2012-04-29 14:53 by Shine.)
find quote
sereny Offline
Junior Member
Posts: 23
Joined: Dec 2008
Reputation: 0
Post: #440
Thank you very much. Will test this during the next few days.
find quote
Post Reply