Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Hardware & Software > Software players

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 5th August 2008, 22:28   #3621  |  Link
tetsuo55
MPC-HC Project Manager
 
Join Date: Mar 2007
Posts: 2,317
I have been talking with a freind, and been reading a lot of DXVA documentation.

1. i have posted a plug-and-play commitable change to the level detection code, the freind helped me get it into actual c++ code. Its based on the ieee standards of SD and HD. The code now defines anything with a width of 1024 and higher as HD. This is correct according to all the documentation i have seen. i do not test for height as cropping makes the height an unreliable test.

2.after read a lot of documentation it seems like DXVA doesn't care about levels at all, this means that as soon as we find the correct commands we can have 16 ref frame SD files hardware decoded as level4.1, in other words the broken files would work, but it would still be a hack of sorts.

Below is the code, it needs to be commited to:
mpc-hc/trunk/src/filters/transform/mpcvideodec/FfmpegContext.c

Code:
int FFH264CheckCompatibility(int nWidth, int nHeight, struct AVCodecContext* pAVCtx, BYTE* pBuffer, UINT nSize)
{
        H264Context*    pContext        = (H264Context*) pAVCtx->priv_data;
        SPS*                    cur_sps;
        PPS*                    cur_pps;
 
        if (pBuffer != NULL)
                av_h264_decode_frame (pAVCtx, pBuffer, nSize);
 
        cur_sps         = pContext->sps_buffers[0];
        cur_pps         = pContext->pps_buffers[0];
 
        if (cur_sps != NULL)
        {
                // Check max num reference frame according to the level
                #define MAX_DPB_41 8355840 // value for level 4.1 (that be HD for the uninitiated)
                #define MAX_DPB_31 4608000 // value for level 3.1 (that be SD for the uninitiated)
 
                if (cur_sps->ref_frame_count*nWidth*nHeight) > (MAX_DPB_41))
                //width*height*ref_frame_count higher than max dpb is bad
                        return 2;       // Too much ref frames
                //got to check if this might in fact be SD. We assume anything with a width lower than 1024 is SD,
                if(nWidth < 1024)
                {
                  if (cur_sps->ref_frame_count*nWidth*nHeight) > (MAX_DPB_31))
                        // width*height*ref_frame_count higher than max dpb is bad
                    return 2;
                }
        }
        //if control reaches this, we're inside DPB limits
        return 0;
}
PS For those wondering this completely filters out the acciedental playback of 16 ref frame files unless they are valid which means they would need a very low resolution like 320x240

Last edited by tetsuo55; 5th August 2008 at 22:42.
tetsuo55 is offline  
Old 5th August 2008, 23:20   #3622  |  Link
MatMaul
Registered User
 
Join Date: Apr 2004
Posts: 402
@tetsuo55 : actual implementations of DXVA support level 4.1 just fine for both SD and HD resolution so the actual code is OK.

the 11 refs restriction is a known bug and not a DXVA limitation
MatMaul is offline  
Old 6th August 2008, 00:29   #3623  |  Link
STaRGaZeR
4:2:0 hater
 
Join Date: Apr 2008
Posts: 1,302
What about a test version with tetsuo55's code?
STaRGaZeR is offline  
Old 6th August 2008, 02:15   #3624  |  Link
ADude
Registered User
 
Join Date: Nov 2007
Posts: 340
Quote:
Originally Posted by clsid View Post
Since there is a good working alternative (Haali), improving the internal Matroska splitter of MPC is very low priority. Fixing bugs and improving stability is far more important at this moment.
The Haali Splitter does not always work right for MPEG1 content, as I have posted twice in this thread... is there a way to contact the developer about that ?
__________________
s/w: Vista Home Basic 32bit (no Aero), MPC-HC, EVR Custom Presenter, CoreAVC Pro, ffdshow, SPDIFer
h/w: Antec 2480 case, Gigabyte GA-MA69GM-S2H, 4200+, 2.5gb+512mb, ATI x1250 IGP, MS MCE remote
ADude is offline  
Old 6th August 2008, 09:25   #3625  |  Link
Mercury_22
Registered User
 
Join Date: Dec 2007
Posts: 1,138
Quote:
Originally Posted by clsid View Post
Since there is a good working alternative (Haali), improving the internal Matroska splitter of MPC is very low priority. Fixing bugs and improving stability is far more important at this moment.
Isn't this a bug ?

If this is the way we should think, one can also say there are better / "good working" alternatives for all MPC-HC internal (Transform) Fiters / decoders not only for internal Splitters so "improving the internal" (Transform) Fiters / decoders should also be "very low priority" !!!

In my opinion the internal Splitters (ogg, ts, ... also, not just Matroska) ARE THE ONE MAKING THE DIFFERENCE FOR MPC-HC, since the only "real" alternative it's Haali's (or none for 64-bit version), and for internal (Transform) Fiters / decoders are MANY MORE other "good working alternative" !!!

So i think fixing / improving the internal SPLITTERS (TS, OGG, Matroska, ... ) should be TOP PRIORITY !

But that's just me !

P.S.
Quote:
Originally Posted by ADude View Post
The Haali Splitter does not always work right for MPEG1 content, as I have posted twice in this thread... is there a way to contact the developer about that ?
I can confirm that and not just for MPEG1 content !!!
__________________
Intel UHD Graphics 750; Win 10 22H2

Last edited by Mercury_22; 6th August 2008 at 09:40.
Mercury_22 is offline  
Old 6th August 2008, 09:54   #3626  |  Link
tetsuo55
MPC-HC Project Manager
 
Join Date: Mar 2007
Posts: 2,317
Quote:
Originally Posted by MatMaul View Post
@tetsuo55 : actual implementations of DXVA support level 4.1 just fine for both SD and HD resolution so the actual code is OK.

the 11 refs restriction is a known bug and not a DXVA limitation
The current code blocks a lot of valid files. And allows a lot of broken files.
-Files with more than 16 ref frames are very valid, this has been proven in the past.
-The current code allows SD files with too many ref frames to be decoded in DXVA model which causes crashes or green screens, some SD files have an upper limit of 8 or less ref frames

My code allows ALL valid files and blocks ALL invalid files completely accurately.
-It is based on the h264, DXVA, HD rules and guidelines.
-It is based on realworld tests in the past
-All the files that the current code is trying to block are still blocked with my code, but now in an accurate way.

---------------

The bug you're talking about has nothing to do with the blocking code, i'm very close to finding the cause.

Here is my theory in short:

DXVA does not talk about levels, the software is completely responsible for making sure the decoder sets the correct mode. When the software does not provide the needed information the decoder guesses the level. The problem is that nvidia and ati guess differently

Last edited by tetsuo55; 6th August 2008 at 10:15.
tetsuo55 is offline  
Old 6th August 2008, 11:42   #3627  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,642
Quote:
The Haali Splitter does not always work right for MPEG1 content, as I have posted twice in this thread... is there a way to contact the developer about that ?
Are you talking about MPEG1 inside Matroska container? Or the MPEG-PS splitter (which you should not enable) of Haali? There is a topic about Haali Media Splitter on this forum, you can report bugs there.

Quote:
In my opinion the internal Splitters (ogg, ts, ... also, not just Matroska) ARE THE ONE MAKING THE DIFFERENCE FOR MPC-HC, since the only "real" alternative it's Haali's (or none for 64-bit version), and for internal (Transform) Fiters / decoders are MANY MORE other "good working alternative" !!!
So i think fixing / improving the internal SPLITTERS (TS, OGG, Matroska, ... ) should be TOP PRIORITY !
The lack of a x64 version of Haali Media Splitter should only be a temporary problem. I strongly disagree with your opinion. As long a there are good (and free) alternatives for non-essential functionality (the internal filters), improving other functionality is far more important. Just to name a few: DXVA, EVR issues, and some stability issues. Once those issues have been addressed, the internal splitters can be improved. Supporting Theora in Ogg is the most important. Hidden/disabled streams in Matroska is not very important as you can also just manually select the desired streams.

And since Casimir's ToDo list is already several meters long, it doesn't help if everyone constantly keeps bitching about the same issues. It ain't gonna magically fix things quicker.
__________________
MPC-HC 2.1.7.2
clsid is offline  
Old 6th August 2008, 11:43   #3628  |  Link
STaRGaZeR
4:2:0 hater
 
Join Date: Apr 2008
Posts: 1,302
Just complile a test version, I'd be pleased to test it
STaRGaZeR is offline  
Old 6th August 2008, 11:53   #3629  |  Link
tetsuo55
MPC-HC Project Manager
 
Join Date: Mar 2007
Posts: 2,317
Quote:
Originally Posted by STaRGaZeR View Post
Just complile a test version, I'd be pleased to test it
Yeah i am going to need your help later too, as you seem to have many borderline test cases.

So could someone please at least build a test-version with my code?


---

Casimir, How much ms lag does the Anti-Tearing code introduce?

Last edited by tetsuo55; 6th August 2008 at 12:14.
tetsuo55 is offline  
Old 6th August 2008, 12:32   #3630  |  Link
Mercury_22
Registered User
 
Join Date: Dec 2007
Posts: 1,138
Quote:
Originally Posted by clsid View Post
Are you talking about MPEG1 inside Matroska container? Or the MPEG-PS splitter (which you should not enable) of Haali? There is a topic about Haali Media Splitter on this forum, you can report bugs there.

The lack of a x64 version of Haali Media Splitter should only be a temporary problem. I strongly disagree with your opinion. As long a there are good (and free) alternatives for non-essential functionality (the internal filters), improving other functionality is far more important. Just to name a few: DXVA, EVR issues, and some stability issues. Once those issues have been addressed, the internal splitters can be improved. Supporting Theora in Ogg is the most important. Hidden/disabled streams in Matroska is not very important as you can also just manually select the desired streams.

And since Casimir's ToDo list is already several meters long, it doesn't help if everyone constantly keeps bitching about the same issues. It ain't gonna magically fix things quicker.
Ok I agree : let's NOT "keep bitching about the same issues."
I was just thinking that being able to play all those type of files (without external help / filters ) it's an "essential functionality" and for the moment it's more important than improving the quality.

I just have one question for you about
Quote:
MPEG-PS splitter (which you should not enable) of Haali
since enabling Haali's MPEG-PS splitter it's the only thing that allows me to play EVO files, what do you use for evo file ?
__________________
Intel UHD Graphics 750; Win 10 22H2

Last edited by Mercury_22; 6th August 2008 at 13:09.
Mercury_22 is offline  
Old 6th August 2008, 13:14   #3631  |  Link
MatMaul
Registered User
 
Join Date: Apr 2004
Posts: 402
Quote:
Originally Posted by tetsuo55 View Post
Files with more than 16 ref frames are very valid, this has been proven in the past.
??? more than 16 refs is not compliant with the h264 standard, if you find a sample like this ask for a refund :P
Quote:
Originally Posted by tetsuo55 View Post
-The current code allows SD files with too many ref frames to be decoded in DXVA model which causes crashes or green screens, some SD files have an upper limit of 8 or less ref frames
I'm waiting for a proof of that (samples please )
If you check the log I had nearly exactly the same code (rev 517) but some people complain here because some of their files didn't play anymore.

Quote:
Originally Posted by tetsuo55 View Post
The bug you're talking about has nothing to do with the blocking code, i'm very close to finding the cause.

Here is my theory in short:

DXVA does not talk about levels, the software is completely responsible for making sure the decoder sets the correct mode. When the software does not provide the needed information the decoder guesses the level. The problem is that nvidia and ati guess differently
no. Casimir already knows what is the bug and it is not that : the algorithm which manage the release of the decoded pictures is not very good so with more than 10-11 refs the buffers are full and it hangs up.

Last edited by MatMaul; 6th August 2008 at 13:17.
MatMaul is offline  
Old 6th August 2008, 13:56   #3632  |  Link
tetsuo55
MPC-HC Project Manager
 
Join Date: Mar 2007
Posts: 2,317
oops i meant more than 11 ref frames but less than 17 :P

The old code was not exactly the same as mine. Lets just test my code with a test-build before changing anything on the SVN.

Which file is the basis for the bug casimir is working on?

Since no-one seems to be stepping up to the plate i will try to encode a couple of 5 second test files later. Only borderline tests though. We need a group of guaranteed accurately encoded test files anyway

Last edited by tetsuo55; 6th August 2008 at 13:58.
tetsuo55 is offline  
Old 6th August 2008, 14:27   #3633  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,642
Quote:
Originally Posted by Mercury_22 View Post
I was just thinking that being able to play all those type of files (without external help / filters ) it's an "essential functionality" and for the moment it's more important than improving the quality.
Why is it such a big problem to use external filters? You also need external filters for formats that MPC-HC doesn't support by itself. More people care more about fully working DXVA than those Matroska features. This topic is the living proof of that. And if you read discussions/reviews of MPC on various sites, than the majority of complaints that users have are about stability.
You seem to care only about your own user experience. While I care about the user experience of the average user.
Quote:
I just have one question for you about since enabling Haali's MPEG-PS splitter it's the only thing that allows me to play EVO files, what do you use for evo file ?
I don't play EVO files. The internal MPEG-PS/TS/PVA source filter is supposed to support EVO now I think, but I dunno if those changes are completed yet.
__________________
MPC-HC 2.1.7.2
clsid is offline  
Old 6th August 2008, 15:43   #3634  |  Link
Mercury_22
Registered User
 
Join Date: Dec 2007
Posts: 1,138
Quote:
Originally Posted by clsid View Post
Why is it such a big problem to use external filters? You also need external filters for formats that MPC-HC doesn't support by itself. More people care more about fully working DXVA than those Matroska features. This topic is the living proof of that. And if you read discussions/reviews of MPC on various sites, than the majority of complaints that users have are about stability.
You seem to care only about your own user experience. While I care about the user experience of the average user.
I don't play EVO files. The internal MPEG-PS/TS/PVA source filter is supposed to support EVO now I think, but I dunno if those changes are completed yet.
Look above it wasn't me that started this it just happens that I agree with all this, and I'm not refering only to Matroska splitter.
But like I've said before
Quote:
Ok I agree : let's NOT "keep bitching about the same issues."
Anyway thanks for the info on EVO but internal MPEG-PS/TS/PVA source filter it's still not working for evo and also for some ts .
__________________
Intel UHD Graphics 750; Win 10 22H2
Mercury_22 is offline  
Old 6th August 2008, 21:03   #3635  |  Link
Casimir666
Registered User
 
Join Date: Jan 2007
Posts: 455
Quote:
Originally Posted by tetsuo55 View Post
I have been talking with a freind, and been reading a lot of DXVA documentation.

1. i have posted a plug-and-play commitable change to the level detection code, the freind helped me get it into actual c++ code. Its based on the ieee standards of SD and HD. The code now defines anything with a width of 1024 and higher as HD. This is correct according to all the documentation i have seen. i do not test for height as cropping makes the height an unreliable test.

2.after read a lot of documentation it seems like DXVA doesn't care about levels at all, this means that as soon as we find the correct commands we can have 16 ref frame SD files hardware decoded as level4.1, in other words the broken files would work, but it would still be a hack of sorts.

Below is the code, it needs to be commited to:
mpc-hc/trunk/src/filters/transform/mpcvideodec/FfmpegContext.c

Code:
int FFH264CheckCompatibility(int nWidth, int nHeight, struct AVCodecContext* pAVCtx, BYTE* pBuffer, UINT nSize)
{
        H264Context*    pContext        = (H264Context*) pAVCtx->priv_data;
        SPS*                    cur_sps;
        PPS*                    cur_pps;
 
        if (pBuffer != NULL)
                av_h264_decode_frame (pAVCtx, pBuffer, nSize);
 
        cur_sps         = pContext->sps_buffers[0];
        cur_pps         = pContext->pps_buffers[0];
 
        if (cur_sps != NULL)
        {
                // Check max num reference frame according to the level
                #define MAX_DPB_41 8355840 // value for level 4.1 (that be HD for the uninitiated)
                #define MAX_DPB_31 4608000 // value for level 3.1 (that be SD for the uninitiated)
 
                if (cur_sps->ref_frame_count*nWidth*nHeight) > (MAX_DPB_41))
                //width*height*ref_frame_count higher than max dpb is bad
                        return 2;       // Too much ref frames
                //got to check if this might in fact be SD. We assume anything with a width lower than 1024 is SD,
                if(nWidth < 1024)
                {
                  if (cur_sps->ref_frame_count*nWidth*nHeight) > (MAX_DPB_31))
                        // width*height*ref_frame_count higher than max dpb is bad
                    return 2;
                }
        }
        //if control reaches this, we're inside DPB limits
        return 0;
}
PS For those wondering this completely filters out the acciedental playback of 16 ref frame files unless they are valid which means they would need a very low resolution like 320x240
Release 1.1.174 with tetsuo55 code :
http://www.zshare.net/download/16631247cc8efe85/

Please let me know if this modification should be commited or not.
__________________
Tired of tearing?
Try this Media Player Classic mod : http://mpc-hc.sourceforge.net
Casimir666 is offline  
Old 6th August 2008, 21:13   #3636  |  Link
Tery
Registered User
 
Join Date: Mar 2003
Posts: 24
I really like, being able to choose which Screen to use when playing full screen, but sometimesI play video fullscreen on computer screen sometimes not, and it is really anoying to modify preferences each times.

Would it be possible to add command key, in preferences to be able to configure two keys (or more if people have more than two screen), to play full screen on screen 1 or 2 .... ?
Like F11 play full screen on screen1, and F12 play full screen on screen2.

Or something like two left click, play full screen on screen1 and two right click play it on screen2 ? (and two middle click play it on screen3 .... )

Thanks for your great work, keep going

Tery.

Last edited by Tery; 6th August 2008 at 21:18.
Tery is offline  
Old 6th August 2008, 21:19   #3637  |  Link
rica
Registered User
 
Join Date: Mar 2008
Posts: 2,021
Quote:
Originally Posted by clsid View Post
Why is it such a big problem to use external filters? You also need external filters for formats that MPC-HC doesn't support by itself. More people care more about fully working DXVA than those Matroska features. This topic is the living proof of that. And if you read discussions/reviews of MPC on various sites, than the majority of complaints that users have are about stability.
You seem to care only about your own user experience. While I care about the user experience of the average user.
Hundred percent i agree; what i've been looking for ages a DX based player which i can easily select the filters i desire. (I've been normally using GraphEdit as my default player just for this reason.)
Subtitle DXVA feature is a bonus as well
rica is offline  
Old 6th August 2008, 21:49   #3638  |  Link
Kado
Otaku
 
Kado's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 576
I want to translate MPC HC to Portuguese, how can I do it? I it's a text based file it would be nice!
__________________
In the school, the three guys met. Their relation had been changed in the season, and turned into three love stories.
Kado is offline  
Old 6th August 2008, 21:59   #3639  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,642
Download "mplayerc.rc" from the SVN repository. It is text based. Translate that and send it to Casimir.
__________________
MPC-HC 2.1.7.2
clsid is offline  
Old 6th August 2008, 22:04   #3640  |  Link
Casimir666
Registered User
 
Join Date: Jan 2007
Posts: 455
Can somebody try this release of VSFilter with Haali Renderer and told me if it solve the freeze problem in mpc :

http://www.zshare.net/download/16633220b12de839/

@Kado
Someone is already working on the Portuguese translation, but thanks for your proposition :-)
__________________
Tired of tearing?
Try this Media Player Classic mod : http://mpc-hc.sourceforge.net
Casimir666 is offline  
Closed Thread

Tags
dxva, h264, home cinema, media player classic, mpc-hc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:27.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.