HDR -> SDR conversion

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
Narkyy
Posts: 51
Joined: Thu May 25, 2017 11:51 pm

Re: HDR -> SDR tonemapping

Post by Narkyy » Fri Jul 13, 2018 11:46 am

:hat:
There seems to be some issues with the update :(

v1.4
Image

v1.5
Image

User avatar
admin
Site Admin
Posts: 4274
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Fri Jul 13, 2018 11:50 am

C'mon Narkyy, I asked you before to explain and not just say "some issues". :evil:

And you know I need the script and a source sample to do anything.

Narkyy
Posts: 51
Joined: Thu May 25, 2017 11:51 pm

Re: HDR -> SDR conversion

Post by Narkyy » Fri Jul 13, 2018 11:56 am

My bad, I thought it was obvious, the lighting is all weird on the window side.
The plain white looks like saturation was applied to it and luminance dropped completely.

Image

Sample: https://mega.nz/#!sVtAnAIQ!lOOwvKGOWy-l ... Y9LyzWQmLk
Script
FFVideoSource("sample.mkv", colorspace="YUV420P10")
ConvertBits(16).DGHDRtoSDR(impl="255", light=150, peak=2)
Last edited by Narkyy on Fri Jul 13, 2018 12:04 pm, edited 1 time in total.

User avatar
admin
Site Admin
Posts: 4274
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Fri Jul 13, 2018 12:03 pm

Thanks. Will look into it.

EDIT: 1.5 temporarily withdrawn.

User avatar
admin
Site Admin
Posts: 4274
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Mon Jul 16, 2018 2:16 pm

I've redesigned my gamut mapping and tonemapping. Here is what I am getting for the problematic Narkyy scene with dghdrtosdr(light=150). This is using simple Reinhard tonemapping. I may bring back Mobius but it is currently not behaving as expected. The result looks good to me. Highlights are handled well and artifacting is gone. I have to regression test it on all my other HDR streams.

EDIT: The new method does not require the sat=0.8 tweak but I posted this shot before realizing that and default 0.8 was used. So it may look a bit desaturated.

narkyy.jpg
narkyy.jpg (240.73 KiB) Viewed 522 times

Narkyy
Posts: 51
Joined: Thu May 25, 2017 11:51 pm

Re: HDR -> SDR conversion

Post by Narkyy » Mon Jul 16, 2018 4:15 pm

Neat, bright spots look softer too. :salute:

User avatar
admin
Site Admin
Posts: 4274
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Mon Jul 16, 2018 4:20 pm

Glad you like it. Actually there is now a tonemapping strength option that allows you to select along a continuum of hard hightlights and soft highlights. This sample is the softest. If you want a little more dazzle from the brights, you can decrease the strength.

Thanks for this sample, Narkyy. It is now one of my go-to HDR torture tests.

User avatar
admin
Site Admin
Posts: 4274
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Tue Jul 17, 2018 4:47 pm

Here's 1.5 with the patented Rocky the Squirrel gamut mapping:

http://rationalqm.us/misc/DGHDRtoSDR_1.5.rar

Hammer it with your torture scenes! :twisted:

Narkyy
Posts: 51
Joined: Thu May 25, 2017 11:51 pm

Re: HDR -> SDR conversion

Post by Narkyy » Tue Jul 17, 2018 8:55 pm

:hat:
It looks much better at handling highlights, plus the "tm" parameter is great.
Noticed some differences with v1.4 again, at this point I compare against madVR but it's getting harder to tell which is supposed to be "correct"
Screenshots in order: v1.4 light=250, v1.5 light=250 tm=0.90, madVR 250 nits

Image Image Image

The hue shift seems to be fixed in this sample so that's good. Looking at the red lamps at the top, 1.4 is definitely shifted to the right and looks wider.
The middle of the lights isn't red but it's hard to tell if it's supposed to be, at least from the untonemapped source.

There's a spot of light orange in the sky instead of white, which looks like saturation applied there. There's definitely some banding there in the source itself so that might be the cause?

Otherwise some colors are different, like the blue wavy line at the front of the boat is a bit darker. Not sure if it's a lack of saturation or too much saturation though.
The orange and red stripes in the flag are less saturated as well.

Sample URL: https://mega.nz/#!gZF2FS6a!V4e1acBSNx74 ... tfMlZdTkBc

I'll test other samples where I saw issues before and report back.
Thank you :salute:

Edit:
So after some other samples, there's definitely a desaturation of red/orange happening, compared to v1.4 and madVR.
I'm not sure about other colors yet

From another sample, which reveals the same white spot in deep red lights, as well as desaturation and some fine detail smoothing on the left side (our left) of the face that's probably caused by lower gamma/contrast.
Screenshot is from frame 129.
v1.4 has the colors proper, but hue shift all over the place.

In order: v1.4 light=150 peak=2.0, light=150 tm=0.90, madVR 130 nits

Image Image Image

Sample #2: https://mega.nz/#!5A8FHJJI!t9NhrAw64prb ... pCKsq0QESU

If you compare with madVR at the edge of red light on the face (especially on the nose), you can see the clipping of color whereas madVR has a roll off to lower saturation.
That might be the same issue as in the bright spots on the metal.
Last edited by Narkyy on Tue Jul 17, 2018 10:15 pm, edited 11 times in total.

User avatar
admin
Site Admin
Posts: 4274
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Tue Jul 17, 2018 9:31 pm

Thanks a million, Narkyy, I'll study it tomorrow as it's getting late here.

Post Reply