Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@thexai
Copy link
Member

@thexai thexai commented Jun 4, 2023

Description

Motivation and context

Found that in NVIDIA RTX 4070 things goes wrong with HDR10 limited range.... The use of only "native" color spaces for HDR10 simplifies things and with more strictly checks and fallback to Pixel Shaders more robust and predictable behavior should result.

Closes #23357

Also should fix other sporadic issues seen in forums as:
https://forum.kodi.tv/showthread.php?tid=372606&pid=3146966#pid3146966

How has this been tested?

Runtime tested Intel NUC8i3BEK and NVIDIA RTX 4070.
On NUC continues working as before supporting DXVA HDR10 passthrough in full and limited range.
On RTX 4070 DXVA HDR10 works only in full range and now is used Pixel Shaders in limited range.

Note that current behavior for RTX 4070 limited range in Nexus is wrong black level and in master execution halts in:

CLog::LogF(LOGERROR, "unable to create DXVA processor");

What is the effect on users?

Avoids failures or wrong picture/black screen when DXVA HDR10 color conversion is not full supported and improves compatibility in some scenarios.

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@thexai thexai added Type: Fix non-breaking change which fixes an issue Type: Improvement non-breaking change which improves existing functionality Component: Video rendering Platform: Windows Component: DirectX rendering v21 Omega labels Jun 4, 2023
@thexai thexai added this to the Omega 21.0 Alpha 2 milestone Jun 4, 2023
@thexai thexai requested review from CrystalP and afedchin June 4, 2023 09:43
@CrystalP
Copy link
Contributor

CrystalP commented Jun 4, 2023

UHD Blu-ray is not the only source of HDR so unsure about always preferring topleft (it's most likely the most common though).
Phones, cameras, streaming, transcoding, ... I don't know the details for those.

Looks like a solid change, will have to run-time test it to go through some of the combinations.

@thexai
Copy link
Member Author

thexai commented Jun 4, 2023

UHD Blu-ray is not the only source of HDR so unsure about always preferring topleft (it's most likely the most common though). Phones, cameras, streaming, transcoding, ... I don't know the details for those.

4K Remuxes, even 1080p HDR versions probably comes all from UHD Blu Ray anyway. In any case the difference (if any) sure is minimal: probably chroma plane half pixel shifted vertically. This in 4K resolution I'm not sure if can be noticed.

Copy link
Contributor

@CrystalP CrystalP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to push the button earlier, sorry.

@CrystalP
Copy link
Contributor

CrystalP commented Jun 4, 2023

UHD Blu-ray is not the only source of HDR so unsure about always preferring topleft (it's most likely the most common though). Phones, cameras, streaming, transcoding, ... I don't know the details for those.

4K Remuxes, even 1080p HDR versions probably comes all from UHD Blu Ray anyway. In any case the difference (if any) sure is minimal: probably chroma plane half pixel shifted vertically. This in 4K resolution I'm not sure if can be noticed.

We can go with topleft preferred, but please add a comment that flags are ignored on purpose.
I found an example of HDR reencode with missing flagging, but am unable to tell if chroma was moved during reencode or is still topleft.

@CrystalP
Copy link
Contributor

CrystalP commented Jun 5, 2023

Is it stable for runtime testing?

@thexai
Copy link
Member Author

thexai commented Jun 5, 2023

Sure, for me is ready for merge.

Has been tested in Intel NUC with full and limited range and RTX 4070 with full/limited HDR10 passthrough in combination with Denon AVR-1600X and TV Sony AG9. No issues found. Black level is correct and is the same in all cases. No visible differences due use Pixel Shaders in Nvidia limited comparing DXVA in NUC (limited or full). Also for reference compared with Kodi in Shield Pro 2019 in the same setup (AVR - TV).

I won't have much time in the next few days to make changes or runtime test others PRs.

@CrystalP
Copy link
Contributor

CrystalP commented Jun 6, 2023

Testing completed on AMD, Intel Gen 4 and Gen 8. See the previous notes. The problem of destination format in IsHDR10PassthroughSupported() is blocking.

The limited output is rejected for AMD and accepted by Intel, as expected.

AMD also doesn't output limited range for SDR, do you think the new function can be generalized or would it take a separate one? (no questions of top left vs left in SDR)

@thexai thexai force-pushed the dxva-hdr10 branch 2 times, most recently from ecc6f8c to 9d09bfa Compare June 6, 2023 11:25
@CrystalP
Copy link
Contributor

CrystalP commented Jun 6, 2023

Comments answered, please let me know when you consider this stable for another round of testing.

@thexai
Copy link
Member Author

thexai commented Jun 7, 2023

I think all points are resolved and is ready for final test/review.

@thexai
Copy link
Member Author

thexai commented Jun 7, 2023

AMD also doesn't output limited range for SDR, do you think the new function can be generalized or would it take a separate one?

Maybe a new separated method like IsSDRLimitedOutputSupported() as HDR limited is already covered and SDR full is not need to check as is the default.

@atrugiel69
Copy link

atrugiel69 commented Jun 7, 2023

Sorry for the ignorant question but... I have tried installing the build from today. I saw from Jenkins, up here, that it failed building for TVOS and Linux GLES but it built for other platforms, Windows included.

Does this mean that build 20230607-babe32cf-master-x64 should include this? If it does... it doesn't appear to solve the problem with HDR material. If it doesn't, please ignore (or maybe explain why, so that I won't repeat the mistake in the future).

Edit: I see this it's still at the "pull request" stage, so maybe it wasn't included in the official nightly build? How can one test developments like this, then? Or is it something that just developers do? I ask because, due to the complexity of hardware, different platforms, different GPUs, etc. maybe it could be helpful to involve users.

@afedchin
Copy link
Member

afedchin commented Jun 7, 2023

current nightly doesn't include these changes till this will be merged

@atrugiel69
Copy link

current nightly doesn't include these changes till this will be merged

Ok, thanks for confirming. So testing PRs before merge is something that only devs can do (unless one builds by him/herself)?

@thexai
Copy link
Member Author

thexai commented Jun 7, 2023

There is a build here:
https://mirrors.kodi.tv/test-builds/windows/win64/

KodiSetup-20230607-bb6f0be3-dxva-hdr10-x64.exe

@atrugiel69
Copy link

There is a build here: https://mirrors.kodi.tv/test-builds/windows/win64/

KodiSetup-20230607-bb6f0be3-dxva-hdr10-x64.exe

For me, RTX 3070, this solves the HDR playback problem. Thanks for sharing the build.

Copy link
Contributor

@CrystalP CrystalP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, ran well. No need for a retest after the couple cosmetic comments, it's approved for me.

…ocessor

And fallback to Pixel Shaders when not supported.
@CrystalP
Copy link
Contributor

CrystalP commented Jun 8, 2023

You can merge whenever.

@thexai
Copy link
Member Author

thexai commented Jun 8, 2023

TVOS build failure is unrelated.

@thexai thexai merged commit 5b79de7 into xbmc:master Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: DirectX rendering Component: Video rendering Platform: Windows Type: Fix non-breaking change which fixes an issue Type: Improvement non-breaking change which improves existing functionality v21 Omega

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] HDR10 passthrough using limited range is broken on NVIDIA cards in master branch

4 participants