Page 38 of 57

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 9:38 am
by admin
3 minutes is great, dmcs. Thanks for the sample. Investigating...

Maybe we need something like madVR's adaptive light setting.

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 9:45 am
by admin
@dmcs

Can you tell me how that bigger sample came to be? Is it from a UHD bluray? How was it processed? If it is from a UHD bluray, it would be much better for me to get the m2ts file. One problem with the mkv is that we don't know for sure all the metadata is being preserved.

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 11:15 am
by admin
Bingo! Pretty sure I've found the problem. I was clipping the out-of-gamut RGB before applying the tonemapping. Duh. Of course we should do it after, because the tonemapping is going to pull lots of super-bright pixels into gamut. After changing this I get good results even with light as bright as light=100. By good I mean the bright blob at frame 2676 does not expand and completely lose its detail. The mobius settings for it are trans=0.8, peak=5.0. They won't help you though until I release the fixed version. I will do that after a little more experimentation.

I said this in reply to Narkyy:

"light = 160 is way too low, in my opinion. Don't blame me for blown out areas with that light setting."

Eating humble pie as Narkyy was right to choose that light level. We can go even brighter without blowing out the highlights with the change described above.

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 11:43 am
by dmcs
admin wrote:
Mon Jul 09, 2018 9:45 am
@dmcs

Can you tell me how that bigger sample came to be? Is it from a UHD bluray? How was it processed? If it is from a UHD bluray, it would be much better for me to get the m2ts file. One problem with the mkv is that we don't know for sure all the metadata is being preserved.
Yeah, I used MKVToolNix to trim the file from the UHD remux. The mediainfo from the m2ts file and the mkv one are identical.

m2ts: https://p.teknik.io/Me5TA
mkv: https://p.teknik.io/LU6MD

And boy, am I glad to hear you're figuring things out. :D :D

Edit: The only metadata missing from mkv is the Dolby Vision. It's not supported by matroska yet.

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 12:32 pm
by admin
Now I've figured out the cause of the blockiness compared to the original and madVR. I was always clipping R/G/B < 0.0 to 0.0. I need to tonemap them back into 709 range also instead of just clipping them.

@dmcs

Is this sample known to be Dolby Vision?

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 12:47 pm
by dmcs
admin wrote:
Mon Jul 09, 2018 12:32 pm
@dmcs

Is this sample known to be Dolby Vision?
I'm not sure what you meant. m2ts has Dolby Vision metadata. mkv sample file doesn't.
Here's the full mediainfo of the m2ts file.

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 12:53 pm
by admin
Yes, I meant the m2ts. Thank you.

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 1:25 pm
by admin
Another cause of blockiness! I apply tonemapping individually to R, G, and B. This causes hue shifts depending on how the individual components are mapped. I have to apply it to the lightness L. So I am going to redesign everything to work in CIELAB space and apply tonemapping to the L of darks and lights to bring them into range of 709. If there are any out-of-gamut colors left then I'll decide what to do with them. If they are sparse I can just clip them. If not, maybe desaturate them. We'll see.

Finally thinking I might be understanding things. :lol:

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 1:34 pm
by dmcs
:salute: :salute:

Re: HDR -> SDR tonemapping

Posted: Mon Jul 09, 2018 1:44 pm
by Narkyy
That would cause issues like this as well right? Not just in highlights

Image

Thank you for the hard work :hat: