Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
8th August 2018, 14:00 | #1 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
Vapoursynth tonemap
I'm implementing the '"standard" tonemap functions, using vapoursynth tonemap for the formula.
Reinhard has an exposure parameter, but i don't see it in the formula. Is it normal
__________________
My github. |
8th August 2018, 14:51 | #2 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
8th August 2018, 15:10 | #4 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Yeah, look here
https://github.com/ifb/vapoursynth-tonemap/issues/4
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
8th August 2018, 16:13 | #5 | Link | |
Registered User
Join Date: Dec 2009
Posts: 72
|
Quote:
|
|
8th August 2018, 20:26 | #7 | Link |
Registered User
Join Date: Dec 2009
Posts: 72
|
I don't know that there is a correct formula. Exposure isn't present in vf_tonemap.c, but Reinhard's paper does talk about applying an initial gain to the image.
I kinda feel like it's a hack that shouldn't be needed. It adds yet another setting to tweak, but I guess it's helpful? I don't use Reinhard or any of the others much except for testing. I've ended up just using a 3D LUT. |
10th August 2018, 06:21 | #9 | Link |
Registered User
Join Date: Dec 2009
Posts: 72
|
The new release on Github has working Reinhard exposure now.
A 33-point LUT is faster for me (Skylake i5-6200U). Source is 1080p XAVC Intra 100. Code:
source 210.25 YUV422P10 source->RGBS 130.05 3D LUT 63.44 RGBS 3D LUT 61.24 RGB48 3D LUT 61.44 RGB30 3D LUT 63.26 RGB24 Hable 57.04 Mobius 58.11 Reinhard 59.21 |
10th August 2018, 08:44 | #10 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
What do you call a 33-point LUT ? If input is 10 bits, the 3D LUT requires at least [1024x1024x1024]x2 (x3) => 6GB of memory ! (for 16 bits data output, x2 for RGPS data output).
__________________
My github. |
10th August 2018, 13:26 | #11 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
3D LUTs are subsampled and output values are interpolated from the available input points. See here:
https://www.lightillusion.com/luts.html |
10th August 2018, 14:59 | #13 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
The theoretical performance benefit of using a 3D LUT versus implementing the underlying math is reduced by the need for accurate interpolation. In DGHDRtoSDR performance is achieved with CUDA parallelism, so I don't need to bother with 3D LUTs. madVR supports both modes (3D LUTs and "pixel shader math").
|
10th August 2018, 17:24 | #14 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,316
|
Out of curiosity, (as i've absolutely no idea) what is the average parallelism level with CUDA ? Are we talking of things about 16/32, or are we more talking of things about 64/128/256 ?
I think it's probably defined by the GPU model, and can change according GPU, but with a standard actual card ?
__________________
My github. |
10th August 2018, 18:13 | #15 | Link | |
Registered User
Join Date: Dec 2009
Posts: 72
|
Quote:
|
|
10th August 2018, 19:56 | #17 | Link | |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Quote:
|
|
10th August 2018, 20:11 | #19 | Link |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
It's a simple mathematical formula that won't significantly toll any decent GPU.
Out of curiosity what kind of operation would you not call performance heavy? I would call performance heavy operations that need neighboring pixels or comparing values from prior or next frames, not single pixel/channel operations. |
10th August 2018, 20:45 | #20 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
3D LUTs are used for all kinds of transforms, e.g., full HDR to SDR, which is the context of this thread. If you think the following process is not intensive, then I'll leave you to your own world:
Convert YCbCr to normalized float RGB. Convert to linear float RGB (undo 2084). Convert to a perceptually uniform color space. Tonemap. Perform gamut mapping using one of many different designs. Convert back to linear float RGB. Apply SDR gamma curve. Convert back to YCbCr for output. Tonemapping is one small piece of the puzzle. The point of a LUT is that you can perform this process for each color value and store the results for lookup. Last edited by videoh; 10th August 2018 at 20:50. |
|
|