New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Fix HDR static metadata primaries order #19852
[Android] Fix HDR static metadata primaries order #19852
Conversation
could this problem be the cause of incorrect colours with DolbyVision with some devices? |
Sadly I'm not really familiar with how DV works. But I've seen that incorrect primaries can lead to the image looking not-quite-right even in "plain" HDR10. |
@CastagnaIT If I understand the jenkins process correctly, you can grab |
@CiNcH83 have you time to test if this PR resolve your DV color problem? |
Yes. I already have it on my TODO list. Will hopefully be able to check today. |
Unfortunately can't find the build artifact. The above link does not work. |
maybe @fuzzard can make start the build of android artifact |
jenkins build this please |
One more thing we found here is that some content does not have a valid content light metadata. In such case, if I understand the way things work in Android, the code will not trigger HDR at all. And now that I think of it, this line is probably incorrect as well: data[9] = static_cast<short>(av_q2d(m_hints.masteringMetadata->min_luminance) + 0.5); Because the minimum luminance in content usually ranges in the 0.00x range. Adding 0.5 to 0.005 and casting the result to short, which is an integer value, will result in a minimum luminance of 0. Edit: The Amlogic kernel can dump the metadata it's currently using into dmesg. This is what I see as the output when playing an HEVC video, where the metadata is extracted from the content, and not passed the same way as it is for VP9. And I'm pretty sure I'm correct about the max chromaticity multiplier. It should 50,000.
|
I pushed a couple extra fixes. Please review, and try the resulting binaries to see if there's any improvement. |
I downloaded the latest build from Jenkins. Will test this afternoon. |
Purple tinting with Dolby Vision unfortunately is still present on BRAVIA. |
DV does not use static metadata, #19099 might help. |
Won't help either. I am using Inputstream Adaptive to play Netflix which doesn't use ffmpeg. Plus my BRAVIA does not use the MediaTek chipset to decode DV ( |
I didn't really expect this PR to fix anything with DV, although it would've been neat if it has. |
45faf49
to
3df504e
Compare
I set up a build env for Android and was able to test this PR.
|
So then, please make Jenkins happy and final review can happen. Thank you very much. |
Done |
44dd6f9
to
b6afe92
Compare
Should I squash all of the commits? |
Yes, please. |
Fix primaries order and chromaticity, fix minimum display luminance Populate HDR static metadata even when CLL is missing Use 'unsigned short' instead of 'short'. It will make the data readable in case of debugging or logging
b6afe92
to
f0025f6
Compare
Ok, done |
Thanks again. I or anybody else coming by can ousnfrom my side after Jenkins is happy. |
I see that the Android builds failed, is this just Jenkins acting up or did I break something? |
Jenkins playing up, close and reopen the PR usually fixes it. |
I also think it's worth to backport it Matrix, once it's verified by others as not causing any unexpected issues. |
I played several HDR10 and HLG HEVC and VP9.2 files. All fine. |
Description
Fix the order of the primaries coordinates in the HDR static metadata in Android
Motivation and context
The primaries coordinates of the HDR static metadata in Android are wrong
How has this been tested?
Can't test it, but the new order fits when looking at existing kernel outputs. (See screenshots)
In addition, this fix fits with the FFmpeg and google documentation of the metadata structure.
What is the effect on users?
Fixes incorrect colors in HDR content in Android.
Screenshots (if appropriate):
pdata->config
output are in the wrong positions.Types of change
Checklist: