HDR -> SDR conversion

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
User avatar
admin
Site Admin
Posts: 4046
Joined: Thu Sep 09, 2010 3:08 pm

Re: HDR -> SDR conversion

Post by admin » Mon Jul 23, 2018 7:11 am

Dion wrote:
Sun Jul 22, 2018 3:31 pm
Is it possible to have your plugin not take everything straight to 8bit? Like a bits="10" command or something?
What is the use case? Would YUV420P16 be acceptable? You can add ConvertBits(10) if needed.

Dion
Posts: 20
Joined: Sun Dec 04, 2016 1:30 am

Re: HDR -> SDR conversion

Post by Dion » Mon Jul 23, 2018 1:23 pm

admin wrote:
Mon Jul 23, 2018 7:11 am
What is the use case? Would YUV420P16 be acceptable? You can add ConvertBits(10) if needed.
Yes 16 would be fine too.. I can add ConvertBits after.

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

Re: HDR -> SDR conversion

Post by admin » Mon Jul 23, 2018 3:46 pm

Again, what is the use case? And how would you do things if this change did not exist?

User avatar
DJATOM
Distinguished Member
Distinguished Member
Posts: 33
Joined: Fri Oct 16, 2015 6:14 pm

Re: HDR -> SDR conversion

Post by DJATOM » Mon Jul 23, 2018 4:54 pm

Probably better compression with 10 bit encoders, as plain 8 bit looks worse on my observation. Tested with 16 bit output, 10 bit output and dithered 8 bit output. 16 is bloat, 10 is fine and 8 kind of bit-starved. Well, it's possible to get acceptable results with 8 bit, just need to rise bitrate a bit.

Dion
Posts: 20
Joined: Sun Dec 04, 2016 1:30 am

Re: HDR -> SDR conversion

Post by Dion » Mon Jul 23, 2018 5:06 pm

admin wrote:
Mon Jul 23, 2018 3:46 pm
Again, what is the use case? And how would you do things if this change did not exist?
Down converting to 8bit causes banding. You can't just up convert back to 10/16 and its fixed.. the data is lost. A plugin would be required to fix the banding.

Can't encode in 10bit basically. Properly.

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

Re: HDR -> SDR conversion

Post by admin » Mon Jul 23, 2018 9:25 pm

Again, how would you do things if this change did not exist? Do you have an existing or alternative process?

Look, I don't want to spend time on things and find it is not what you need. You are asking for the filter to just convert from 2020 to 709 and PQ to gamma, and do nothing with the HDR? When you talk about eliminating banding, I think of the extra bits being used for granularity and not for HDR. I have never done any 10-bit encoding so I do not know the use case and/or exactly what you are looking for. This is why I ask for your alternative process.

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

Re: HDR -> SDR conversion

Post by admin » Mon Jul 23, 2018 10:38 pm

Here's where I am confused about your request...

The extra two bits can be used to represent a dynamic range increased by 4 times, i.e., we can now represent a ratio between the darkest and lightest 4 times greater. Or we can keep the 8-bit dynamic range and increase the granularity of that range with the extra two bits. If our source is using the bits exclusively for HDR then keeping it as 10 bits doesn't improve the granularity. What is the trade-off on a HDR10 bluray? I have no idea and it's not clear to me at all that retaining 10-bits necessarily means that we retain granularity that would be missed if we output 8 bits.

If you can show an alternative process (that is, one with existing tools) that manifestly reduces banding for a HDR10 bluray rip by retaining 10 bits compared to outputting 8 bits then I would have something to go on in terms of engineering a useful solution for your request.

Dion
Posts: 20
Joined: Sun Dec 04, 2016 1:30 am

Re: HDR -> SDR conversion

Post by Dion » Tue Jul 24, 2018 2:59 am

I was under the impression that the DGHDRtoSDR plugin automatically converted everything to 8bit. Is this not true?

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

Re: HDR -> SDR conversion

Post by admin » Tue Jul 24, 2018 5:10 am

:scratch: Must be some kind of language problem.

If you ever become properly responsive I'll reconsider your request but until then forget it. You could start by demonstrating a HDR10 disk rip that shows banding after converting with DGHDRtoSDR.

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

Re: HDR -> SDR conversion

Post by Narkyy » Tue Jul 24, 2018 9:36 am

I'm in favor of just having the option to output as YUV420P16 too, it might be affecting the sharpness as well, from tests with HDRTools.

Build from latest code change and example script:
FFVideoSource("sample5.mkv", colorspace="YUV420P10")
ConvertBits(16).ConvertYUVtoXYZ(Color=0,OutputMode=1).ConvertXYZ_HDRtoSDR(MinMastering=1, MaxMastering=1000,Coeff_X=30, Coeff_Y=30, Coeff_Z=30).ConvertXYZtoYUV(Color=2, OutputMode=2, pColor=1)
Specifically this part: ConvertXYZtoYUV(Color=2, OutputMode=2, pColor=1)
I tested with OutputMode=2 and OutputMode=0, so YV12 and YV24 respectively and here are the results.

Image Image

YV24 is retaining much more details, and I'm thinking this is where DGHDRtoSDR loses them as well.
Though YV12 is still YUV420P16 so I'm not sure how the detail reappears with YUV444P16, since the source is 4:2:0

Post Reply