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 conversion

Post by Narkyy » Wed Jul 18, 2018 11:21 am

:bravo:
It looks good for the most parts and the results are pretty good :)
Though now I'm mostly picking at small imperfections I can notice against other algorithms.
I used the madVR settings people seem to agree on for default, somewhere in this discussion: https://www.avsforum.com/forum/24-digit ... st56500902

Screenshots in order: v1.6 light=200 tm=0.90 | HDRTools | madVR 0.92.14 | madVR latest test build

Image Image Image Image

Same sample as earlier, frame 129: https://mega.nz/#!5A8FHJJI!t9NhrAw64prb ... pCKsq0QESU

Numbered the issues I noticed to explain, circled in the first screenshot.

1- The vivid/deep red/purple isn't blending in with the lighter colored skin at the bottom of the neck so it looks weird.
The same thing happens on the forehead, and on the edge of the red hue on the right, next to the ear.
It might blend in better if the left side of the face was more red, like it is on HDRTools and madVR.

2- The bright points there are spot on, a bit softer but a lower "tm" parameter would fix that.
However the saturation (or hue ?) seems a little low. Again, that might be the same saturation issue as on the left side of the face mentioned before, since it's reflecting white light.

3- The left side of the face is less red as mentioned, but it's also a bit smoother compared to madVR.
The fine details seem smoothed out on the cheek.
That might be caused by the Reinhard contrast or gamma but I'm not sure.

Otherwise on the right side of the nose, the red spot under the eye looks as good as latest test build of madVR, so that's very nice.

That's all for now, thank you again :salute:

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

Re: HDR -> SDR conversion

Post by admin » Wed Jul 18, 2018 11:40 am

You're welcome and thank you, Narkky, I'll come back to this stuff in a few days.

I do make some tradeoffs for speed and to handle a wide range of scenes decently without massive tweaking, but I'm always willing to try to further improve things.

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

Re: HDR -> SDR conversion

Post by admin » Wed Jul 18, 2018 11:53 am

Narkyy, may I ask you some things?

1. How do you run and obtain snapshots from madVR? I have never run madVR in any way.

2. Is it possible to embed madVR processing in an Avisynth script somehow?

3. How fast is madVR (max frame rate)?

Thank you.

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

Re: HDR -> SDR conversion

Post by Narkyy » Wed Jul 18, 2018 12:06 pm

Unfortunately madVR is closed source, though I think madshi had intentions to make plugins from the algorithms like SSIM downscaler, tonemapping.
It runs as a rendering engine for media players like MPC-BE, so it does much more than tonemapping but there's nothing for AviSynth so it's a totally different thing.
I just have MPC-BE playing a file, and do the screenshots with that.

It's probably much slower than CUDA, but it's hard to tell exactly because the OSD shows rendering times for everything combined, not just the tonemapping part.
I usually get 15-20ms frame rendering times tonemapping a 2160p clip, so at least 50 fps?

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

Re: HDR -> SDR conversion

Post by admin » Wed Jul 18, 2018 12:18 pm

Thanks, Narkky!

User avatar
gonca
Distinguished Member
Distinguished Member
Posts: 705
Joined: Sun Apr 08, 2012 6:12 pm

Re: HDR -> SDR conversion

Post by gonca » Wed Jul 18, 2018 6:05 pm

In honor of this new version some images
No torture tests, just some "normal, generic" frames to see how it looks in general
Settings are default
First sdr version, then hdr
BD1.bmp
BD1.bmp (5.93 MiB) Viewed 749 times
hdr1.bmp
hdr1.bmp (23.73 MiB) Viewed 749 times
BD4.bmp
BD4.bmp (5.93 MiB) Viewed 749 times
hdr4.bmp
hdr4.bmp (23.73 MiB) Viewed 749 times
Thanks for your efforts
:salute:

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

Re: HDR -> SDR conversion

Post by admin » Wed Jul 18, 2018 8:59 pm

You're welcome, gonca, and thank you for the test shots.

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

Re: HDR -> SDR conversion

Post by Narkyy » Wed Jul 18, 2018 9:56 pm

Looks like that confirms what I noticed, reds aren't as saturated/deep as they should be.

Even 1.4 was better I think, though it has a ton of hue shifts.
I tried increasing saturation but it didn't get as deep of a red hue.

In order: v1.4 light=200 peak=2.0 | v1.6 light=200 tm=0.90 | madVR latest test build

Image Image Image

Screenshot is frame 99.
Another sample with more obvious differences, for good luck: https://mega.nz/#!VBsygYaI!2l_qaVWLkFgD ... Bd4nrLPjA8

No hurry though, it's already great :hat:

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

Re: HDR -> SDR conversion

Post by admin » Thu Jul 19, 2018 11:50 am

I confirm the reported desaturation and have found a simple way to avoid it. Just have to regression test it on all my samples then I'll give y'all a build. While still not counting chickens, I think y'all will be very happy with it. ;)

@gonca

Can I please have the source sample for that shot of the blonde girl with colored streaks? Thank you.

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

Re: HDR -> SDR conversion

Post by admin » Thu Jul 19, 2018 12:41 pm

Here is build 1.7. It adds a new parameter 'roll' that controls the retention of saturation and contrast. Please see the user document for details. With roll=0.5 (default), the desaturation is cured. The default for light was changed to 300 to compensate for the greater brightness of roll=0.5. If you set roll=1.0 it will be equivalent to build 1.6. As always, your feedback will be greatly appreciated.

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

I'm really happy with this build and I hope y'all are too. I'm amazed that such a simple algorithm could perform so well. You would be truly shocked at how simple it is! Don't forget, Einstein said: make things as simple as possible but no simpler. It seems that, thanks in large part to your testing, samples, and advice, we've hit a pretty good sweet spot in that regard. Now, bring on the cold water. :P

Post Reply