Port Cube

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
Post Reply
User avatar
Sherman
Posts: 576
Joined: Mon Jan 06, 2020 10:19 pm

Port Cube

Post by Sherman »

Guys, did you know you can just open the cube file with a text editor?

If the cube specifies a domain you will see DOMAIN_MAX and DOMAIN_MIN in the header. I've never seen a cube file using them.

TITLE "PQ_to_BT709_slope"
LUT_3D_SIZE 65
# - Created by Francesco Bucciantini
0.000000 0.000000 0.000000
0.025484 0.000000 0.000000
0.045503 0.000000 0.000000
0.065639 0.000000 0.000000
0.086664 0.000000 0.000000
...
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

Cool, thank you Sherm!

Please re-download to get new range option handling. Please read the document for details.

DGSource("THE GREAT WALL.dgi",ct=48,cb=48,cl=0,cr=0,rw=1920,rh=1032)
DGCube("PQ_to_BT709_slope.cube",expand_in=true,compress_out=true,interp="tetrahedral")
DAE avatar
reel.deal
Posts: 8
Joined: Fri Aug 19, 2022 1:44 pm

Port Cube

Post by reel.deal »

Hi DG,

Thanks for the updates on this filter. Quick question, you mentioned full range is gone but I still see that parameter in the filter signature: c[cube]s[fullrange]b[expand_in]b[compress_out]b[interp]s[device]i

Is it simply ignored?
User avatar
Curly
Posts: 712
Joined: Sun Mar 15, 2020 11:05 am

Port Cube

Post by Curly »

No attention to detail these guys, you're right.

Dude! Welcome to the forum where your reputation will increase by leaps and bounds. Like mine!

:bow: reel.deal
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Port Cube

Post by Guest 2 »

reel.deal wrote:
Fri Aug 19, 2022 1:48 pm
Hi DG
Welcome ;)
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

Thank you for the report reel.deal. Yes it's ignored. I'll get rid of it. And welcome!
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

Uploaded version without ignored fullrange parameter. Now we have to get some versioning in place. Can't believe this was already linked at Avisynth wiki. Interest is apparently greater than I anticipated.

Also, the cube loading seems rather slow. I'll try to improve that.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Port Cube

Post by Guest 2 »

Rocky wrote:
Sat Aug 20, 2022 8:16 am
Interest is apparently greater than I anticipated.
As I told you ;)

You did something eagerly wanted by a lot of people.

When DGCube will be polished and shiny, a proper BM3D is wanted too. ;)
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

I'll listen when you tell me things, promise.

Re-download to get the faster cube loading. Jeez, templates, vectors, calling functions for every character. Why would anyone do that (five seconds to parse a simple text file)? There's no timecube code left at all. Still, could release source code when stable.

BM3D. Sure, I'm listening.

Can you get that TDS guy straightened out? Or is it terminal?
DAE avatar
reel.deal
Posts: 8
Joined: Fri Aug 19, 2022 1:44 pm

Port Cube

Post by reel.deal »

I added DGCube to the wiki a few days ago, I thought it was *done*. But yes, there is an interest :).

I have a few questions regarding the examples that are included in the documentation. I have virtually no experience with HDR content but a few things stand out to me.

Apply 3D LUT to HDR10 PQ clip obtained from DGSource() using external conversions to RGBP16:

Code: Select all

DGSource("THE GREAT WALL.dgi")
z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020:st2084:2020:limited=>rgb:st2084:2020:full")
DGCube("PQ_to_BT709_slope.cube", expand_in=true, compress_out=true, interp="tetrahedral")
z_ConvertFormat(pixel_type="YUV422P10", colorspace_op="rgb:std-b67:2020:full=>2020:std-b67:2020:limited")
Shouldn't that be expand_in=false, compress_out=false since z_ConvertFormat converts to full range RGB and then converts to limited range YUV?

Also, the cube being applied implies that it converts PQ to Rec.709 (hdr to sdr?), so why does z_ConvertFormat then convert to Rec.2020 HLG? Wouldn't it be more appropriate to use colorspace_op="rgb:709:709:full=>709:709:709:limited"? I don't know what difference it make as I do not have an HDR monitor nor any samples to try it on, but I just found that a little confusing. Do you by any chance have a small sample of The Great Wall?

I was looking for the cube in that example, turns out the actual name is "PQ_to_BT709_v1.cube".

Lastly, how does the internal YUV<->RGB conversion handle chroma placement? Is it hard coded to just one option?

Sorry for the wall of questions and thanks for the warm welcome.
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

reel.deal wrote:
Sat Aug 20, 2022 2:39 pm
Shouldn't that be expand_in=false, compress_out=false since z_ConvertFormat converts to full range RGB and then converts to limited range YUV?
Yes, I have updated the text document and uploaded it. Thank you for pointing it out.
Also, the cube being applied implies that it converts PQ to Rec.709 (hdr to sdr?), so why does z_ConvertFormat then convert to Rec.2020 HLG? Wouldn't it be more appropriate to use colorspace_op="rgb:709:709:full=>709:709:709:limited"?
Yes, also fixed in the document.
Do you by any chance have a small sample of The Great Wall?
https://rationalqm.us/misc/THE_GREAT_WALL.mkv
Lastly, how does the internal YUV<->RGB conversion handle chroma placement? Is it hard coded to just one option?
Whatever it started as it ends as. I don't look at or modify it.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Port Cube

Post by Guest 2 »

Rocky wrote:
Sat Aug 20, 2022 1:21 pm
BM3D. Sure, I'm listening.
Go for it. ;)
Rocky wrote:
Sat Aug 20, 2022 1:21 pm
Can you get that TDS guy straightened out? Or is it terminal?
He did even created a new user some months ago because people were fond of him.

We are now talking to the second reincarnation.
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

What's his other handle?
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Port Cube

Post by Guest 2 »

Rocky wrote:
Sun Aug 21, 2022 7:04 am
What is his other handle?
Grumpy something, can't remember.
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

Oh, that guy. :roll:
DAE avatar
reel.deal
Posts: 8
Joined: Fri Aug 19, 2022 1:44 pm

Port Cube

Post by reel.deal »

Thanks for the sample. I also updated the wiki to match the corrections above.
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

That's great, thank you reel.deal. I see you got Moose Approved. Winkie is on the reticent side, so must've noticed something positive about you. big t thinks highly. Pretty soon Moose Lodge dinners. Expect to hear from Britney. Watch out for Natasha, though, she'll bleed you dry. Wonder Woman, any interest? I heard she's on the rebound ;).
User avatar
Sherman
Posts: 576
Joined: Mon Jan 06, 2020 10:19 pm

Port Cube

Post by Sherman »

Guys, I'm thinking rd as shortform vernacular. Unanimous consent?
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Port Cube

Post by Guest 2 »

Sherman wrote:
Sun Aug 21, 2022 12:59 pm
Guys, I'm thinking rd as shortform vernacular. Unanimous consent?
Ok. But you should ask HIM :mrgreen:
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Port Cube

Post by Guest 2 »

Perhaps it's time to have some quality and consistency tests with other plugins and programs to see if everything is ok.

Who here is using some professional software, LUTs, etc?

I am having some luminosity differences between BBC full range LUT and Warner limited range LUTs outputs. With a lot of probability it's because of LUTs but who knows. :D
User avatar
Curly
Posts: 712
Joined: Sun Mar 15, 2020 11:05 am

Port Cube

Post by Curly »

Figured it out. The LUTs are different. Sheila'll believe ya! Never doubt.
User avatar
Wonder Woman
Posts: 58
Joined: Sun Feb 07, 2021 10:46 am

Port Cube

Post by Wonder Woman »

:bow: Curly
User avatar
Boris
Posts: 92
Joined: Sun Nov 10, 2019 2:55 pm

Port Cube

Post by Boris »

There's nobody here.
User avatar
Rocky
Posts: 3557
Joined: Fri Sep 06, 2019 12:57 pm

Port Cube

Post by Rocky »

I uploaded a new version that fixes compatibility with non-AVS+, e.g., AVS 2.6.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Port Cube

Post by Guest 2 »

Guys, is there a way to find if a 3D lut is to be applied to limited range or full range?

Some tests? Property of the matrix?
Post Reply