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. |
7th December 2013, 17:19 | #81 | Link |
Registered User
Join Date: Mar 2007
Posts: 407
|
You are absolutely right. I meant it that way but I did not use the right words. I wanted to say 'after assigning a literal numeric expression without decimal point to a variable, I can use the variable where an integer is required' (the variable can hold different types later or before).
|
7th December 2013, 17:32 | #82 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
The reason I mentioned it is this line in your code:
Code:
iMinLuma = max( RT_VarExist("fgY_yMax") ? fGY_yMax : 18, iMinLuma) |
7th December 2013, 22:22 | #83 | Link |
Registered User
Join Date: Mar 2007
Posts: 407
|
That line was one suspect for me, too. The name of the variable suggests it. But it comes from RT_YStats(), which allows a prefix to write several statistics variables in one pass; and the suffix yMax is for YPlaneMax() - nothing with a fractional part.
|
8th December 2013, 04:23 | #84 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
EDIT: Suggest removal of 'round()' temp fixes, as they will hide cause of error, better to find than hide. Also suggest m53 uses same version AWB as users to avoid confusion with line numbers.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 8th December 2013 at 12:18. |
|
8th December 2013, 12:36 | #85 | Link |
Registered User
Join Date: Mar 2007
Posts: 407
|
I share the opinion about round().
Also agree to change to flags check. Please review if this is OK, 'cause I currently have little time to test the script, can only edit and believe. Code:
flags = RT_YStats(cU, mask=cGamutMask, delta=delta, threshold=MINMAX_THRESH, flgs=$17, prefix="fGU_", MaskMin=18, MaskMax=255) iMinLuma = max( BitAnd(flags, 2)>0 ? fGY_yMax : 18, iMinLuma) |
8th December 2013, 13:21 | #86 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Should be BitAnd(flags, 1)>0 or RT_BitTST(flags,1) (returns bool)
EDIT: ABOVE is RUBBISH, you were correct with BitAnd(flags, 2)>0 (or RT_BitTST(flags,1) OK) I must have a brain tumor (or a hangover) Code:
Flgs_Bit_Number Add_To_Flgs Equivalent_Function Local_Var_Set_Excluding_Prefix 0 1($01) RT_YPlaneMin() "yMin" (0->255) 1 2($02) RT_YPlaneMax() "yMax" (0->255) 2 4($04) RT_YPlaneMinMaxDifference() "yMinMaxDiff" (0->255) 3 8($08) RT_YPlaneMedian() "yMed" (0->255) 4 16($10) RT_AverageLuma() "yAve" (0.0->255.0) 5 32($20) RT_YPlaneStdev() "yStdev" (0.0->255.0) 6 64($40) RT_YInRange() "yInRng" (0.0->1.0) 7 128($80) RT_YPNorm() "yPNorm" (0.0->??? depends upon d and u) maybe easier: Code:
flags = RT_YStats(cU, mask=cGamutMask, delta=delta, threshold=MINMAX_THRESH, flgs=$17, prefix="fGU_", MaskMin=18, MaskMax=255) iMinLuma = max( flags !=0 ? fGY_yMax : 18, iMinLuma) same for whatever (valid) var you are interested in. Assuming all flags arg bits valid, and pixels found in mask within maskmin, maskmax, then will return same as flags arg.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 8th December 2013 at 15:39. |
8th December 2013, 14:19 | #87 | Link |
Registered User
Join Date: Mar 2007
Posts: 407
|
If the symbol fGY_yMax does not exist in AviSynth's variables stomach - is the code safe then?
You know, I'm talking about the classical problem Code:
if(var_does_not_exist || var>0) { ... } In some languages, one must code Code:
if (var_does_not_exist) ... else if (var>0) ... endif endif |
8th December 2013, 14:52 | #88 | Link | |||||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
If flags arg had bit 1 set and returned flags is non zero then the yMax variable (with whatever correct prefix) has been set and DOES exist.
However if returned flags is zero then you cannot assume anything about the ymax variable (it may or may not exist, it was not created nor changed). Quote:
Quote:
Ternary/Conditional Operator, [ (condition) ? result1 : result2 ] evaluates one or other result, not both. You did at one point ask if anyone objected to "%%%" sequence, I meant to answer but forgot. "%%" is used as escaped "%" in RT_DebugF() and RT_String() to embed a percent symbol into string without being interpreted as a variable insertion point. Using "%%%" might at some point in future be a problem (although perhaps unlikely). Suggest maybe change to eg "@@@" or similar (not backslash '\\\'). EDIT: this Code:
if(var_does_not_exist || var>0) { ... } Code:
if(flags==0 || var>0) { ... } # failed this makes more sense Code:
if(flags==0 || var<=0) { ... } # failed or Code:
if(flags!=0 && var>0) { ... } # passed, var exists and is greater than zero EDIT: You use eg this Quote:
It would only be necessary if you coded something like this Quote:
Quote:
[as Gavino said, IsFloat() really means IsNumeric()]. In an earlier post you put results of IsInt() and IsFloat() on frame, you would want to check IsInt() first and only after failure test for IsFloat(). An Int is a Float, but a Float is NOT an Int (or rather, an Int is accepted as a Float).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 9th December 2013 at 12:03. |
|||||
9th March 2014, 12:29 | #90 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 249
|
Hello,
I try AWB function, but il get error "invalide arguments to function MT_expand" I have load this plugins mt_masktools-26.dll CallCmd.dll dither-1.25.1\win32\dither.dll GRunT101\GRunT.dll GScript_11\GScript.dll RT_Stats_25&26_dll_v1.30_20131219\Avisynth26\RT_Stats26.dll and import this scrip dither-1.25.1\dither.avsi I tried this poor script LoadPlugin("C:\masktools-v2.0a48\mt_masktools-26.dll") AVISource("C:\my video.avi") mt_expand(chroma="process") The MT_expand's arguments are good I do not find where is the problem in AWB script script version 1st December. Thanks for help. |
15th March 2014, 01:01 | #92 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 249
|
Thanks yup,
but i think is not problem with avisynth and plugin version. The AWB script line is mt_expand(chroma="process"). This call is ok with my poor script and not inside AWB script. Why ? Bernard |
15th March 2014, 06:04 | #93 | Link |
Registered User
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
|
Hi Bernardd!
I also have problem with AWB script, but last version work for me. You can also can try http://forum.doom9.org/showthread.ph...98#post1622598 It is work better than built-in ColorYUV. yup. |
23rd March 2014, 18:23 | #94 | Link |
Anime addict
Join Date: Feb 2009
Location: Spain
Posts: 673
|
Hi, get a error:
I use this script: Code:
A=Import("E:\Dragon Ball\DB_1\001\1. Deinterlacing.avs").\ subtitle(string("Original")).Crop(0,0,-360,0) B=Import("E:\Dragon Ball\DB_1\001\1. Deinterlacing with AutoWhite.avs").\ subtitle(string("Modificado"),align=9).Crop(362,0,0,0).AddBorders(2, 0, 0, 0,$00FFFF00) Stackhorizontal(A,B) Code:
DGDecode_mpeg2source("E:\Dragon Ball\DB_1\001\VideoFile.d2v", info=3) ColorMatrix(hints=true, threads=0,interlaced=true) assumebff() tfm(order=0,pp=6,mode=4).tdecimate(mode=1) Code:
DGDecode_mpeg2source("E:\Dragon Ball\DB_1\001\VideoFile.d2v", info=3) ColorMatrix(hints=true, threads=0,interlaced=true) assumebff() tfm(order=0,pp=6,mode=4).tdecimate(mode=1) AWB(amount=1.0,dither=true,ThSc=20,show=1).tweak(bright=0,cont=1.1)
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite |
1st December 2014, 04:48 | #97 | Link |
Registered User
Join Date: Feb 2012
Posts: 82
|
Unsupported colorspace
I have been trying to load AWB into avisynth 2.6 without success.
I'm think everything has been loaded as it should be. The error that occurs is: MT Expand : Unsupported colorspace, masktools only supports planar YUV colospaces. Regardless of the conversions I apply (YV12,YV16,YV24 or any other) the same error occurs. Anyone have a solution? I have installed the latest masktools v2.0a48 Thanks |
1st December 2014, 14:29 | #98 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,664
|
Quote:
So what should I do? Download and install MaskTools v2.0b1, make sure to download masktools2-x86.zip. Last edited by Reel.Deel; 1st December 2014 at 14:48. |
|
Tags |
awb, color, colorbalance |
Thread Tools | Search this Thread |
Display Modes | |
|
|