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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st June 2011, 02:29   #221  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Quote:
Originally Posted by LaTo View Post
You only need to multiply value by 256.
If I remap the value internally, it avoids fine adjustments.
I never worked with such numbers in 32bit applications, this next line is far from intuitive.
Code:
"0-4096;8704-4096;10496-8192;15616-17664;31744-31744;47872-46080;53760-53760;58880-64512;65280-60160",\
For fine adjustments we have always used decimals...
Quote:
Originally Posted by LaTo View Post
In SmoothLevels you only need to set output_low/output_high at 16/235 (or 4096/60160 in 16bits).
I see, I never use smoothlevels or smoothtweak but I thought about helping. Output_low/output_high at 16/235 is the same as clamping, and I recently read that many TVrange sources have below 16 or above 235 values which should be better leave alone.
Quote:
Originally Posted by LaTo View Post
In SmoothTweak TVrange/PCrange doesn't change the processing (you can set "limiter=true" in TVrange).
"limiter=true" readme says: Clamp the output to 16-235...
But I dont want to output/clamp TV range values,but instead work in TV range
For example, see this analogy by using smoothcurve
Code:
saturation in PC range:
"0-0;64-"+string(64-64*sat)+";128-128;192-"+string(192+64*sat)+";255-255"
saturation in TV range:
"0-16;16-16;74-"+string(74-55*sat)+";127-127;185-"+string(185+55*sat)+";240-240;255-240"
...or I am totally wrong.
Quote:
Originally Posted by LaTo View Post
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 1st June 2011, 09:56   #222  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by Dogway View Post
I never worked with such numbers in 32bit applications, this next line is far from intuitive.
Code:
"0-4096;8704-4096;10496-8192;15616-17664;31744-31744;47872-46080;53760-53760;58880-64512;65280-60160",\
For fine adjustments we have always used decimals...
No, 16bits values is the only way to go for precision. (SmoothAdjust works in 32bits internally, 16bits is just the input clip)

Example: "Invert" the 16 bits clip

Code:
SmoothCurve16("0-65535;65535-0") #Easy
SmoothCurve16("0.0-255,99609375;255,99609375-0.0") #Your proposition with decimals (65535/256 = 255,99609375)
SmoothCurve16("0-255;255-0") #Internal remap: the conversion is wrong (255*256->65280 != 65535)


Quote:
Originally Posted by Dogway View Post
I see, I never use smoothlevels or smoothtweak but I thought about helping. Output_low/output_high at 16/235 is the same as clamping, and I recently read that many TVrange sources have below 16 or above 235 values which should be better leave alone.
It's not the same as clamping (with limiter=0).



Quote:
Originally Posted by Dogway View Post
"limiter=true" readme says: Clamp the output to 16-235...
But I dont want to output/clamp TV range values,but instead work in TV range
For example, see this analogy by using smoothcurve
Code:
saturation in PC range:
"0-0;64-"+string(64-64*sat)+";128-128;192-"+string(192+64*sat)+";255-255"
saturation in TV range:
"0-16;16-16;74-"+string(74-55*sat)+";127-127;185-"+string(185+55*sat)+";240-240;255-240"
...or I am totally wrong.
Your 2nd script clamp output to TVrange (should be "0-0;16-16;...;240-240;255-255")
Also I doesn't understand why you want to leave theses parts "as-is".
If you do that, you will have strange things later.

Example: "Desaturate" a clip
Code:
SmoothCurve(UVcurve="0-128;255-128") #In "PCrange", all colors are gone
SmoothCurve(UVcurve="0-0;16-16;17-128;239-128;240-240;255-255") #In "TVrange", extreme colors are still here


Quote:
Originally Posted by Dogway View Post
I will try to improve a bit the view

Last edited by LaTo; 1st June 2011 at 10:23.
LaTo is offline   Reply With Quote
Old 1st June 2011, 11:41   #223  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
beta4 AVX test
--------------------

Code:
#smoothlevels(gamma=2.0, useOPT=0) # 159 fps
#smoothlevels(gamma=2.0, useOPT=1) # 217 fps
#smoothlevels(gamma=2.0, useOPT=2) # 92 fps

#smoothlevels(gamma=2.0, useOPT=0, useMT=0) # 66 fps
#smoothlevels(gamma=2.0, useOPT=1, useMT=0) # 140 fps
#smoothlevels(gamma=2.0, useOPT=2, useMT=0) # 33 fps
The AVX part still does not seem to work properly :/
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 1st June 2011, 11:43   #224  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Quote:
Originally Posted by LaTo View Post
No, 16bits values is the only way to go for precision.
I dont know how other applications deal internally with it, and I can't tell you how but Im pretty sure is possible, that's why I tried to fill a bit your empty todo list. Its unintuitive as hell, thats all.

Quote:
Originally Posted by LaTo View Post
If you do that, you will have strange things later.
In effect I was totally wrong yey!
Some tests a few months ago I remember I could desaturate with no problems, but it makes sense that out of TVrange bounds colors follow a correlation with the curve

Quote:
Originally Posted by LaTo View Post
Your 2nd script clamp output to TVrange (should be "0-0;16-16;...;240-240;255-255")
Then I guess this example wasn't correct at all
What I expect is a curve behaviour inside the TVRange in the same fashion as PCrange, but leaving the out of bounds values practically untouched. That's why my confusion on whether "0-0;16-16... or "0-16;16-16... because the first seems to be more locked on the extremes by the knobs (thus modifying the curve weight) than PCrange curve. While it being at first glance the ideal approach I can't tell behaviour is the same, Im not mathematician.

Quote:
Originally Posted by LaTo View Post
It's not the same as clamping (with limiter=0).
Then maybe is contradictory. Because "Output_low/output_high at 16/235" in levels is not "0-0;16-16;...;235-235;255-255". Maybe you wanted to say "16,1.0,235,16,235" but this flats values in the range 0-16 to a value of 16. There is no way in levels to do "proper" TVrange like you said in curves "0-0;16-16;...;235-235;255-255" (assuming this is the correct way which I discussed in the previous paragraph.)

edit: I think interp=100 doesn't work, using beta4
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 1st June 2011 at 11:59.
Dogway is offline   Reply With Quote
Old 1st June 2011, 17:16   #225  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Hmm, I don't know if I am doing something wrong, here...

I wanted to replicate the effect of tweak(hue=+5) using smoothtweak. After some confusion, I realized that smoothtweak's hue1 and hue2 in fact seem to do the same thing as coloryuv's off_u and off_v, respectively.

(Acording to my very limited understanding, the hue parameter as used by tweak kind of rotates the color spectrum around the center/white/black/grey (or something like that, excuse me please), and strangely enough, a dvd I am trying to color-adjust for some strange reason seem to respond well to this kind of shifting...)

1) Is my observation correct? if it is so, mybe the parameters could use some additional explanation in readme...
2) Is there a way to do the adjustment tweak does for hue with smoothadjust, with its superior precission?

Last edited by mandarinka; 1st June 2011 at 17:29.
mandarinka is offline   Reply With Quote
Old 2nd June 2011, 16:36   #226  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by mandarinka View Post
Hmm, I don't know if I am doing something wrong, here...

I wanted to replicate the effect of tweak(hue=+5) using smoothtweak. After some confusion, I realized that smoothtweak's hue1 and hue2 in fact seem to do the same thing as coloryuv's off_u and off_v, respectively.

(Acording to my very limited understanding, the hue parameter as used by tweak kind of rotates the color spectrum around the center/white/black/grey (or something like that, excuse me please), and strangely enough, a dvd I am trying to color-adjust for some strange reason seem to respond well to this kind of shifting...)

1) Is my observation correct? if it is so, mybe the parameters could use some additional explanation in readme...
2) Is there a way to do the adjustment tweak does for hue with smoothadjust, with its superior precission?
1. Correct
2. No sorry


Quote:
Originally Posted by Dogway View Post
edit: I think interp=100 doesn't work, using beta4
Yes, just a bad scaling... 50 is in fact 100, so higher than 50 produces strange result (fixed in the next beta)


Quote:
Originally Posted by ChaosKing View Post
beta4 AVX test
--------------------

Code:
#smoothlevels(gamma=2.0, useOPT=0) # 159 fps
#smoothlevels(gamma=2.0, useOPT=1) # 217 fps
#smoothlevels(gamma=2.0, useOPT=2) # 92 fps

#smoothlevels(gamma=2.0, useOPT=0, useMT=0) # 66 fps
#smoothlevels(gamma=2.0, useOPT=1, useMT=0) # 140 fps
#smoothlevels(gamma=2.0, useOPT=2, useMT=0) # 33 fps
The AVX part still does not seem to work properly :/
Very very strange, I don't understand. The results was with the MSVC or the ICL build?

Can you try the 2 dlls in this package > SmoothAdjust.AVXtest.zip < and report FPS here (with useMT=0)?

Thanks!

Last edited by LaTo; 2nd June 2011 at 16:58.
LaTo is offline   Reply With Quote
Old 3rd June 2011, 11:46   #227  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
@LaTo: I was doing some tests and investigations using vectorscope for accuracy. Indeed SmoothLevels can work with TVrange like this "SmoothLevels(16,1.0,235,16,235..." but by doing so you cant avoid out of 16 and 235 values to not be flatten. This procedure overrides limiter=0. I can post samples but dont want to make the post too bulky.

I also noticed that there is no way you can match smoothcurve and smoothlevels in a simple gamma tweak, I get different curves, and results. So I think you are using another valid approach Im not aware of or something is missing.
Code:
SmoothCurve(Ycurve="0-0;128-136.3;255-255",smooth=0,dither=0,interp=50,show=true)
!=
SmoothLevels(0,1.1,255,0,255,smooth=0,show=true,dither=0,limiter=0)
About the 16bit input numbers, could this be possible? Fit (0-65535)/256 range values into 0-255. I dont know how range mapping is done in programming so Im probably talking too much.
Also is it broken decimals input in beta4?
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 3rd June 2011, 18:58   #228  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by Dogway View Post
@LaTo: I was doing some tests and investigations using vectorscope for accuracy. Indeed SmoothLevels can work with TVrange like this "SmoothLevels(16,1.0,235,16,235..." but by doing so you cant avoid out of 16 and 235 values to not be flatten. This procedure overrides limiter=0. I can post samples but dont want to make the post too bulky.
Sorry, clamping is a bug. Fixed in the next beta.


Quote:
Originally Posted by Dogway View Post
I also noticed that there is no way you can match smoothcurve and smoothlevels in a simple gamma tweak, I get different curves, and results. So I think you are using another valid approach Im not aware of or something is missing.
Code:
SmoothCurve(Ycurve="0-0;128-136.3;255-255",smooth=0,dither=0,interp=50,show=true)
!=
SmoothLevels(0,1.1,255,0,255,smooth=0,show=true,dither=0,limiter=0)
Yes, it's normal... You need to set more control points because the interpolation doesn't follow a power curve.


Quote:
Originally Posted by Dogway View Post
About the 16bit input numbers, could this be possible? Fit (0-65535)/256 range values into 0-255. I dont know how range mapping is done in programming so Im probably talking too much.
Also is it broken decimals input in beta4?
Not broken, input points are integer from the beginning. Decimals added in next beta.
LaTo is offline   Reply With Quote
Old 3rd June 2011, 20:04   #229  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
You are right, I get the same identical results as of levels with "mt_lut(yexpr="x 255 / 1 1.1 / ^ 255 * ",Y=3,U=2,V=2)" then what is the "correct" gamma for smoothcurves? Is there an interp value to conform the power curve?
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 3rd June 2011, 21:31   #230  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by Dogway View Post
You are right, I get the same identical results as of levels with "mt_lut(yexpr="x 255 / 1 1.1 / ^ 255 * ",Y=3,U=2,V=2)" then what is the "correct" gamma for smoothcurves? Is there an interp value to conform the power curve?
No, the only solution is to add more control points to approximate the gamma curve.
LaTo is offline   Reply With Quote
Old 4th June 2011, 17:35   #231  |  Link
Ponder
Registered User
 
Join Date: Apr 2011
Posts: 51
@Lato
I do get back a lot more contrast on Lmode1 when using very conservative setting on BrightSTR.
Varying DarkSTR is quite safe on the other hand.

Q1. If I use gamma=1, will smoothing be turn off. Q2.If set Smode=1, will it be on at all time?
At certain situation, I want it to be on at all time with gamma=1.

Q3. Same behavior between v1.74 and v2?
Ponder is offline   Reply With Quote
Old 4th June 2011, 20:06   #232  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Update 2011/06/04

Quote:
v2.00 beta5:
tweaked AVX support
fixed clamping bug in SmoothLevels
fixed interp scaling in SmoothCurve
added decimals support in SmoothCurve


Todo-list:
- fix AVX performance?!?
- improve debug view
- add SmoothCustom
- fix all bugs
Download here: > SmoothAdjust v2.00 beta5 <

LaTo is offline   Reply With Quote
Old 4th June 2011, 20:31   #233  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by Ponder View Post
@Lato
I do get back a lot more contrast on Lmode1 when using very conservative setting on BrightSTR.
Varying DarkSTR is quite safe on the other hand.

Q1. If I use gamma=1, will smoothing be turn off. Q2.If set Smode=1, will it be on at all time?
At certain situation, I want it to be on at all time with gamma=1.

Q3. Same behavior between v1.74 and v2?
Q1: No
Q2: Smode=0 -> always OFF // Smode=1/2 -> always ON
Q3: Yes but Smode is removed ( smooth>0 -> always ON // smooth=0 -> always OFF )




Here is a fast comparison of v1.74 & v2.xx with strength/smooth=100 (very strong):


Source image
Smoothing OFF
v1.74 (Smode=2)
v2.00beta5 (More effective, more details & sharpness, no artifact...)

Code:
SmoothCurve(Ycurve="0-16;16-16;64-128;128-224;235-235;255-235",Ucurve="0-0;64-192;128-128;192-64;255-255",Vcurve="0-255;64-64;128-128;192-192;255-0")

Last edited by LaTo; 4th June 2011 at 20:37.
LaTo is offline   Reply With Quote
Old 4th June 2011, 21:09   #234  |  Link
leeperry
Kid for Today
 
Join Date: Aug 2004
Posts: 3,477
Quote:
Originally Posted by LaTo View Post

Here is a fast comparison of v1.74 & v2.xx with strength/smooth=100 (very strong):


Source image
Smoothing OFF
v1.74 (Smode=2)
v2.00beta5 (More effective, more details & sharpness, no artifact...)
very impressive. for the new build, much appreciated
leeperry is offline   Reply With Quote
Old 4th June 2011, 21:12   #235  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
LaTo, thanks a lot! This plugin feels profesional, I wonder what SmoothCustom is... : D
btw how do you get that fancy colors in the UV debug, the Cb Cr colors...
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 5th June 2011 at 09:07.
Dogway is offline   Reply With Quote
Old 4th June 2011, 22:29   #236  |  Link
Ponder
Registered User
 
Join Date: Apr 2011
Posts: 51
@Lato, Thanks, it clears up what I suspected on Q1&2 since DarkSTR was set to some value ,even
when gamma was 1.
Ponder is offline   Reply With Quote
Old 5th June 2011, 17:34   #237  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
beta5 AVX test
------------------


Quote:
#smoothlevels(gamma=2.0) # 232.56 FPS
#smoothlevels(gamma=2.0, useOPT=0) # 173.86 FPS
#smoothlevels(gamma=2.0, useOPT=1) # 232.89 FPS
#smoothlevels(gamma=2.0, useOPT=2) # 240.10 FPS

#smoothlevels(gamma=2.0, useOPT=0, useMT=0) # 83.33 FPS
#smoothlevels(gamma=2.0, useOPT=1, useMT=0) # 165.28 FPS
#smoothlevels(gamma=2.0, useOPT=2, useMT=0) # 178.57 FPS
I noticed that smoothlevels(gamma=2.0) doesn't seem to use the AVX part. With useOPT=2 it's always faster!
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 5th June 2011 at 17:38.
ChaosKing is offline   Reply With Quote
Old 5th June 2011, 18:54   #238  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by ChaosKing View Post
beta5 AVX test
------------------

Quote:
#smoothlevels(gamma=2.0) # 232.56 FPS
#smoothlevels(gamma=2.0, useOPT=0) # 173.86 FPS
#smoothlevels(gamma=2.0, useOPT=1) # 232.89 FPS
#smoothlevels(gamma=2.0, useOPT=2) # 240.10 FPS

#smoothlevels(gamma=2.0, useOPT=0, useMT=0) # 83.33 FPS
#smoothlevels(gamma=2.0, useOPT=1, useMT=0) # 165.28 FPS
#smoothlevels(gamma=2.0, useOPT=2, useMT=0) # 178.57 FPS
I noticed that smoothlevels(gamma=2.0) doesn't seem to use the AVX part. With useOPT=2 it's always faster!
Thanks for testing! Can you try these 2 dlls (AVXtest.zip) and report the speed for each?
LaTo is offline   Reply With Quote
Old 6th June 2011, 09:23   #239  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
AVXtest (test)
----------------

Quote:
##avx 1
#smoothlevels(gamma=2.0) # 233.33 FPS
#smoothlevels(gamma=2.0, useOPT=2) # 232.56 FPS

#smoothlevels(gamma=2.0, useMT=0) # 129.03 FPS
#smoothlevels(gamma=2.0, useOPT=2, useMT=0) # 128.05


##avx2
#smoothlevels(gamma=2.0) # 241.95 FPS
#smoothlevels(gamma=2.0, useOPT=0) # 105.12 FPS
#smoothlevels(gamma=2.0, useOPT=1) # 227.27 FPS
#smoothlevels(gamma=2.0, useOPT=2) # 243.89 FPS

#smoothlevels(gamma=2.0, useMT=0) # 129.03 FPS
#smoothlevels(gamma=2.0, useOPT=2, useMT=0) # 127.39 FPS
avx1 seems to be slower with useMT=-1. Each test was run with 3-5 runs.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 6th June 2011, 21:24   #240  |  Link
LaTo
LaTo INV.
 
LaTo's Avatar
 
Join Date: Jun 2007
Location: France
Posts: 701
Quote:
Originally Posted by ChaosKing View Post
beta5 AVX test
------------------

[...]

I noticed that smoothlevels(gamma=2.0) doesn't seem to use the AVX part. With useOPT=2 it's always faster!
@ChaosKing: Please redownload beta5, now it will autoselect AVX correctly
LaTo is offline   Reply With Quote
Reply


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 23:01.


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