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. |
![]() |
#61 | Link | |
Registered User
Join Date: Jan 2020
Posts: 7
|
Quote:
If you could go ahead and try from home if you can. It would be helpful and much appreciated. ![]() ![]() |
|
![]() |
![]() |
![]() |
#62 | Link | |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
Quote:
Is there another Cube plugin available? |
|
![]() |
![]() |
![]() |
#63 | Link |
Banned
Join Date: Oct 2001
Location: https://t.me/pump_upp
Posts: 811
|
Ok, I've got it!!
![]() The color must not be linearized. The example in Donald's Cube plugin is wrong. Here the correct Avisynth+ script: Code:
LWLibavVideoSource(...) z_ConvertFormat(pixel_type="RGBP16",colorspace_op="2020ncl:st2084:2020:l=>rgb:st2084:2020:f",dither_type="none") Cube("C:\Program Files (x86)\AviSynth+\LUT\PQ_to_BT709_v1.cube", cpu=2, fullrange=true) z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:709:709:f=>709:709:709:l",dither_type="ordered") v2 has lower contrast. Last edited by frank; 11th March 2020 at 12:36. |
![]() |
![]() |
![]() |
#64 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,719
|
I'm glad it finally worked out for you.
Quote:
Look what happened in Italy! They are on their knees! And it's not even one of the worse European Health Service, on the contrary, it's kinda "ok" but it's been overwhelmed... In the UK the government pushed 50 million pound in the research of a vaccine and their plan seems to be to contain and then delay the epidemic 'till this summer when hopefully there will be a cure (the vaccine) and hospitals will be slightly less busy because of the end of seasonal flu. Yet, it's March, it's a long way 'till June, so I truly hope they'll find the vaccine way sooner. Please, please please, people, don't underestimate this, don't go out if it's not necessary. |
|
![]() |
![]() |
![]() |
#65 | Link | |
Registered User
Join Date: Jan 2020
Posts: 7
|
Quote:
Did you have a chance to make the adjustments to the LUT? I didn't see a new link but I'm still not use to this forum fully. As for Corona - we are now on partial lockdown here in the US! Store shelfs are bare with everyone hoarding food - especially toilet paper. But if you had a chance to do that last small adjustment on the LUT let me know and send me a link here! |
|
![]() |
![]() |
![]() |
#69 | Link |
変身!
Join Date: Dec 2008
Location: Brazil
Posts: 38
|
Hey FranceBB, thank you very much for your LUT collection! I'll give a try someday later on these
![]() I wanna ask you something: while I understand the current situation with HDR and such, do you by any change know where to download or have plans to make an LUT file that converts BT.601 to BT.709? I didn't find anything related to this kind of conversion using an LUT file... |
![]() |
![]() |
![]() |
#70 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,719
|
Well, to be fair I've been thinking about it for a while 'cause if I introduce linear BT601 and I get that right I could potentially get all the matrices that already have linear BT709 as either input or output and modify them to make them BT601 compatible.
The only "bad" thing with Linear BT601 is that there are actually two of them: one for PAL and one for NTSC which would double the work. I would also like to cross check my results since I don't really trust myself getting the calculations right all the time... I know that I can't use color matrix 'cause it only converts the matrix and not the primaries... Perhaps I can compare it with the one from "plugin_JPSDR" made by Jean Philippe as he probably got it right. I might try in the next few days... |
![]() |
![]() |
![]() |
#71 | Link | |
変身!
Join Date: Dec 2008
Location: Brazil
Posts: 38
|
Quote:
![]() Thanks for answering me! |
|
![]() |
![]() |
![]() |
#72 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,719
|
Ok, so I made a few tests.
I started with the PAL version of BT601 as you can see: ![]() The curve is exactly the same and there's a reason: the difference between those two is so subtle that it can't really be noticed on this scale... To test this, I indexed a BT709 file and I converted it to BT601 in three different ways: 1st Indexing only (my source file): Code:
FFVideoSource("I:\temp\sample.ts") Spline64Resize(848, 480) Code:
FFVideoSource("I:\temp\sample.ts") Spline64Resize(848, 480) ConvertBits(16) ConvertToPlanarRGB() Cube("C:\Programmi\AviSynth+\LUTs\test.cube", fullrange=true) Code:
FFVideoSource("I:\temp\sample.ts") Spline64Resize(848, 480) ColorMatrix(mode="Rec.709->Rec.601", interlaced=false, threads=0, thrdmthd=0) Code:
FFVideoSource("I:\temp\sample.ts") Spline64Resize(848, 480) ConvertBits(16) ConvertToDoubleWidth() Matrix(from=709, to=601, rg=1.0, gg=1.0, bg=1.0, a=16, b=235, ao=16, bo=235, bitdepth=16) ConvertFromDoubleWidth() ![]() This is the result of my linear Transformation: ![]() This is ColorMatrix: ![]() This is Matrix from HDR Core: ![]() A few frame-comparison, but honestly the difference is so small that it's barely noticeable: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Could you test it, please, and let me know? Link: FranceBB LUT This one instead is made by Adam Stanislav and his results are pretty much the same as mine with very little difference. Can you check this one as well, please? Link: Stanislav LUT Last edited by FranceBB; 11th June 2020 at 08:54. |
![]() |
![]() |
![]() |
#73 | Link | |
変身!
Join Date: Dec 2008
Location: Brazil
Posts: 38
|
Your conversions looks pretty damn good!
![]() But for my purpose, it would look "technically" wrong... My source file is listed as: Quote:
I know this is just the beginning of your work on LUT files, so I'll be patiently waiting your LUT. As for Adam Stanislav LUT files, I think his "conversion" looks way stronger... Check out this comparison chart. |
|
![]() |
![]() |
![]() |
#74 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,719
|
Ok, so I've done it.
This is the BT601 PAL to BT709: ![]() And this is the NTSC one: ![]() I then used the CIECAT02 module and its equations for calculating mathematical correlates for the six technically defined dimensions of color appearance: brightness (luminance), lightness, colorfulness, chroma, saturation, and hue. I've got two matrices 274628 X 3, which are way too precise for such a simple calculation. Nonetheless, here they are. Take a look at them and let me know. p.s of course I made the inverse as well. Updated link in the 1st post. |
![]() |
![]() |
![]() |
#75 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,719
|
Introducing LinearTransformation.
With the increasing number of matrices to do any kind of linear transformations, I kinda felt the need to make something more accessible for users, which is why I'm introducing now "LinearTransformation". This plugin performs Linear Transformations based on a matrix conversion. Matrices are made by me and can be used independently from Avisynth as well. The function has two parameters: Input and Output. Currently, only those linear transformations are supported: From "Linear_BT601_NTSC" to "Linear_BT709" From "Linear_BT601_PAL" to "Linear_BT709" From "Linear_BT709" to "Linear_BT601_NTSC" From "Linear_BT709" to "Linear_BT601_PAL" From "Linear_BT709" to "BT2020_HLG" From "Linear_BT709" to "BT2100_PQ" From "Linear_BT709" to "DCI_XYZ" From "Linear_BT709" to "ZLog" From "BT2100_PQ" to "Linear_BT2020" From "BT2100_PQ" to "Linear_BT709" From "BT2100_PQ" to "BT2020_HLG" From "CLog3" to "Linear_BT709" From "CLog3" to "BT2020_HLG" From "CLog3" to "BT2100_PQ" From "SLog2" to "Linear_BT709" From "SLog3" to "Linear_BT709" From "BT2020_HLG" to "Linear_BT709" From "BT2020_HLG" to "BT2100_PQ" From "DCI_XYZ" to "Linear_BT709" From "LogC" to "Linear_BT709" From "VLog" to "Linear_BT709" A Linear Transformation is essentially a matrix that maps all points of a certain space to another, which includes of course points belonging to a certain curve to other in order to get a different curve. Of course, a linear transformation can be used in encoding to map some values to some other values and therefore have conversions from curves like PQ to HLG and so on. The transformation is performed with 16bit precision, which means that if your input source is lower, let's say, 8bit planar yv12, it will be brought to 16bit planar RGB internally, the linear transformation will be applied with 16bit planar precision and then the result will be brought down to 8bit planar yv12. Planar RGB 16bit is strongly suggested as your source as it's gonna be faster, in fact 4:2:0, 4:2:2, 4:4:4 planar up to 16bit will be converted back and forth internally. Inside the plugin, the path specified for the matrices is "mypath" and by default is: mypath = "C:\Program Files (x86)\AviSynth+\LUTs" which means that it's gonna look for my LUTs in a folder in such a location. It's not mandatory to have my LUTs there, you can have them in any location you want, provided that you do update that string. A huge thanks to StainlessS and to the whole community for greatly improving the script and helping me writing it. Plugin: https://github.com/FranceBB/LinearTr...formation.avsi Matrices: https://github.com/FranceBB/LinearTransformation Usage Example: Example 1: From Slog3 to Linear BT709 Code:
FFVideoSource("mySlog3source.mxf") LinearTransformation(Input="SLog3", Output="Linear_BT709") Code:
FFVideoSource("myPQsource.mxf") LinearTransformation(Input="BT2100_PQ", Output="BT2020_HLG") |
![]() |
![]() |
![]() |
#76 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,333
|
I'm curious about your LUTs, the reds are deeper using yours for matrix conversion, is this expected for the CIECAT chromatic adaptation? Can you choose Bradford or any other for comparison?
EDIT: Nevermind, you were comparing PAL. I got confused because those coefficients are more in line with SMPTE Also I think that adding an option for the chroma resample kernel should be a good idea, I always switch to spline36 since bicubic is a bit soft, not that I can't do myself but as a suggestion. Last edited by Dogway; 11th August 2020 at 17:09. |
![]() |
![]() |
![]() |
#77 | Link | ||
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,719
|
Quote:
![]() but unless there's a real need, I would personally stick with CIE 'cause the CAT02 provided is the international one that is expected to be used everywhere by everyone, which uses the following matrix: ![]() Quote:
Code:
ConvertBits(16) ConvertToPlanarRGB() Cube("C:\Programmi\AviSynth+\LUTs\whatever.cube") Converttoyuv420(chromaresample="Spline64") ![]() That would be the same as: Code:
ConvertBits(16) ConvertToPlanarRGB() LinearTransformation(Input="something", Output="something_else") Converttoyuv420(chromaresample="Spline64") ![]() |
||
![]() |
![]() |
![]() |
#78 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,333
|
Yes, CAT02 is meant to be an improved version but I was curious about why the red is so much deeper. I wanted to test this but couldn't find Linear_BT709 and 601 in your repo(?). I'm missing these LUTs:
Code:
BT601_NTSC_to_BT709 BT601_PAL_to_BT709 BT709_to_BT601_NTSC BT709_to_BT601_PAL I don't know how it behaves currently but the example in that post is wrong I think. Rec709 and Rec601_PAL only differ 0.010 in red. This is a test I did in Nuke. Rec709/sRGB Code:
0.640, 0.330, 0.030 0.300, 0.600, 0.100 0.150, 0.060, 0.790 Code:
0.640, 0.330, 0.030 0.290, 0.600, 0.110 0.150, 0.060, 0.790 Code:
0.630, 0.340, 0.030 0.295, 0.605, 0.100 0.150, 0.075, 0.775 ![]() Now when I inverted the matrices M-1 (which is wrong) I get a match of your example. ![]() Last edited by Dogway; 12th August 2020 at 09:13. |
![]() |
![]() |
![]() |
#79 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,719
|
Quote:
I see! I made a boo boo, but it's my fault, it's not the CAT02. I'll make a new one for PAL. NTSC should be ok I think, but now that they're uploaded, feel free to test it as well. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|