[CLOSED] How does DGSource() process the color bit-depth

Anything related to video and my tools that is not a support request.
Locked
dennis
Posts: 17
Joined: Mon Mar 26, 2018 6:00 am

[CLOSED] How does DGSource() process the color bit-depth

Post by dennis » Fri Nov 02, 2018 2:19 pm

I would like to know how does DGSource() process the color bit-depth.
This is related to an encode from an UHD source with a target 8-bit HD release I've done.
The problem I've faced was I didn't like the tonmaped colors, so I've used DGSource() for all transformations needed:
DGSource("F:\Gladiator.copy\Gladiator.hevc.dgi",resize_w=1920,resize_h=1080,i420=true)
Here are screens to ilustrate the pictures:
UHD source and DGSource() 8-bit HD conversion
Image Image
DGHDRtoSDR conversion and the original HD release
Image Image

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

Re: How does DGSource() process the color bit-depth

Post by admin » Fri Nov 02, 2018 3:49 pm

I don't understand your question. First, i420=true is very unlikely to be correct. Why are you doing that? Please be very precise and explicit about your problem, giving a sample source stream and your full script. You can't just show some screenshots and assume I know what you are talking about. You haven't even told me whether the source is HDR10 or not! If it is HDR10, DGSource() alone will not be enough. If you find DGHDRtoSDR() to not meet your needs then post a link to a source sample and your full script, and say what expectation you think is not being met.

If your source is HDR10, then give the fulldepth=true parameter to DGSource() and follow it with DGHDRtoSDR() with appropriate options, as described in the documentation. You may have to alter the light parameter, depending on how the stream was mastered, and you may want to tweak the saturation for your own tastes.

Also, I asked you a question in another thread and you have not answered it. I will ignore you if you ignore me. ;)

dennis
Posts: 17
Joined: Mon Mar 26, 2018 6:00 am

Re: How does DGSource() process the color bit-depth

Post by dennis » Fri Nov 02, 2018 5:04 pm

Sorry, there is misunderstanding.
I’ll answer every question you may have but tomorrow.

Here, I was asking only one question: How does DGSource() process the color bit-depth?
The context says it works with 10-bit color and generates 8-bit color.
I don’t need a precise algorithm, just an idea.
The reason is, I like its result better than any tone mapping process I’ve tried and I’ve tried all of them running in ffmpeg and AviSynth environment.

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

Re: How does DGSource() process the color bit-depth

Post by admin » Fri Nov 02, 2018 9:03 pm

dennis wrote:
Fri Nov 02, 2018 5:04 pm
Here, I was asking only one question: How does DGSource() process the color bit-depth? The context says it works with 10-bit color and generates 8-bit color.
I don’t need a precise algorithm, just an idea.
It uses whatever proprietary algorithm that nVidia has built into NVDec. I guess it is some form of dithering.
The reason is, I like its result better than any tone mapping process I’ve tried and I’ve tried all of them running in ffmpeg and AviSynth environment.
Tone mapping is needed only for HDR->SDR, not for simple 10-bit to 8-bit conversion (not all 10-bit video is HDR). So it is misguided to be comparing them. That is why I wanted to know if your source is HDR10.

dennis
Posts: 17
Joined: Mon Mar 26, 2018 6:00 am

Re: How does DGSource() process the color bit-depth

Post by dennis » Sat Nov 03, 2018 6:25 am

Thanks.
The source I've worked with was a row (*.hevc) stream demuxed by tsMuxeR from
Gladiator 2000 Extended 2160p UHD BluRay REMUX HDR HEVC DTS-X-EPSiLON release.
MediaInfo log:

Code: Select all

General
Complete name                            : F:\Gladiator\Gladiator.hevc
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
File size                                : 51.7 GiB

Video
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Commercial name                          : HDR10
Format profile                           : Main 10@L5.1@High
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0050 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 497 cd/m2
The setup was:
avs2yuv64 -depth 10 -raw C:\Users\Spas\Desktop\AVS\DGSource.avs - | x265-64bit-8bit-2018-10-08 - ...
with DGSource.avs
DGSource("F:\Gladiator\Gladiator.hevc.dgi",i420=true,resize_w=1920,resize_h=1080,fulldepth=false)
Now, I'm showing screens obtained with the script:
avs2yuv64 -depth 10 -frames 1430 -raw C:\Users\Spas\Desktop\AVS\DGSource-i420.avs - | ffmpeg -y -f rawvideo -s 1920x1080 -pix_fmt yuv420p -r 24000/1001 -i - -vcodec copy D:\gladiator-src\gladiator_part3.hevc2yuv-frame#.yuv
with DGSource-i420.avs

Code: Select all

import("C:\Programs\AviSynth+\plugins64+\FFMS2.avsi")
FFMS2("F:\Gladiator.copy\Gladiator_part3.hevc")
DGSource("F:\Gladiator.copy\Gladiator_part3.hevc.dgi",i420=true,resize_w=1920,resize_h=1080,fulldepth=false)
ffinfo(frametype=true, cfrtime=true, vfrtime=false, colorspace=true, colorrange=false, cropping=false, sar=false, version=false)
Image Image

The screens show ColorSpace BT2020 NCL which satisfies me completely.
The colors in ColorSpace BT2020 are much better than in ColorSpace BT709.

As to the tonemaping, JOHN HABLE says in his post Filmic Tonemapping with Piecewise Power Curves
http://filmicworlds.com/blog/filmic-ton ... er-curves/
Direct control over dynamic range: This issue was a big one for me. Using the Uncharted 2 curve is "all or nothing". It's not possible to make a plain linear curve using those controls. There are times where you want a plain linear curve with a slight shoulder (like on foggy days) and times where you need to heavily compress the highlights and shadows (like direct sunlight).
Maybe, the Gladiator 2000 UHD BluRay release is the case "nothing".

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

Re: How does DGSource() process the color bit-depth

Post by admin » Sat Nov 03, 2018 8:29 am

Still not answering my questions. That means you are wasting my time.

But never mind, as I don't allow discussion of illegitimately obtained materials. Thread closed.

Locked