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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd March 2015, 23:50   #21  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,484
My understanding is that this "Intelligent Auto Correction" legalization is only useful if you want to keep the out of gamut details visible. Of course, this requires you to change in-gamut values as well or you are simply clipping.

It is the difference between perceptual gamut mapping and absolute gamut mapping. IMO small differences in gamut should use absolute (clipped) while large differences in gamut need a perceptual method or you get banding. There are really a lot of possible perceptual methods developed for the graphic design field that are applicable to video, I do not know why Vidcheck thinks they are special.

It did have more sense for analog but when using perceptual methods it isn't clipped even in the digital world. I suppose legalization could also be important if dealing with a bad/non-standard YCbCr to RGB converter that was willing to output RGB values below 0 or above 255.
Asmodian is offline   Reply With Quote
Old 4th March 2015, 00:17   #22  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,869
Well, yes. I assume it's for more advaced than simple clipping conversion, so actual look of the frame changes as little as possible.
Do they think they are special? Hmmm...maybe because their algorythm tries to preserve 'the look' as you mentioned. For example if you have some pure black frames (16) and auto correction happens than this may be raised to eg 20. They say this is desired, some place reject such a files, where 'pure' black is not at 16
kolak is offline   Reply With Quote
Old 14th October 2018, 11:15   #23  |  Link
Soulnight
Registered User
 
Join Date: Jan 2017
Location: Germany
Posts: 21
Quote:
Originally Posted by colours View Post
Slightly inefficient, but one way you can check for YUV exceeding the gamut is to first reduce the range then convert to RGB as usual, after which we can apply some sort of fancy soft limiting for out-of-gamut values. Maybe something like this (entirely untested):

Code:
source
Dither_lut8(expr="x 128 - 3 / 128 + 256 *",yexpr="x 125.5 - 3 / 125.5 + 256 *",u=3,v=3)
# replace 128 and 125.5 with 127.5 if working with a full-range source
Dither_convert_yuv_to_rgb(matrix="709",lsb_in=true,output="rgb48y")
r = SelectEvery(3,0)
g = SelectEvery(3,1)
b = SelectEvery(3,2)
undershoot = cl_exprxyz(r,g,b,"21760 x y z min min -",lsb=true).SelectEvery(1,0,0,0)
overshoot = cl_exprxyz(r,g,b,"x y z max max 43520 -",lsb=true).SelectEvery(1,0,0,0)
rgb_fixed = cl_exprxyz(last,undershoot,overshoot,"x 21760 y - - 21760 y z + + / 65280 *",lsb=true)
# the above is not exactly "fancy" soft limiting, but derp.
rgb_fixed.DitherPost(mode=6)
MergeRGB(SelectEvery(3,0),SelectEvery(3,1),SelectEvery(3,2))
Edit: now actually tested; forgot the lsb_in=true earlier.
Hi,

interesting post. I understand only partially the code what you wrote but would like to do something similar.

My target is to analyse 4k HDR REC2020 clips to see what pixel lies outside REC709.

For this, If I understood correctly,

I need to:
1) Convert YUV to RGB
2) Convert non linear RGB to linear RGB
3) Convert REC2020 RGB to REC709 RGB

I have created the matrix for the step 3, and everything which is outside REC709 should then get illegal RGB triplet.

And I would like to give those illegal RGB triplet a certain value, like (0,0,0) to paint them black.

Could you help me?


My current code:

Code:
loadplugin("C:\Users\flole\Downloads\ManualColorMatrix\ManualColorMatrix_26.dll")
loadplugin("C:\Users\flole\Videos\AviSynth\HDRTools\x86\Release_W7\HDRTools.dll")
Directshowsource("F:\Kodi\Demo 4k HDR\The World In HDR 4K Demo.mkv")
ConvertYUVtoLinearRGB(Color=1)
#isRGB()
ManualColorMatrix(1, 1.66049, -0.58764, -0.07285, -0.12455, 1.13290, -0.00835, -0.01815, -0.10058, 1.11873)
Thank you.


Florian
Soulnight is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.