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. |
9th November 2017, 01:00 | #3721 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
|
But important, when following StainlessS' form: Do not use "return" before "Prefetch". In case you do, the "return" statement is "the end of the script", not the last character.
|
9th November 2017, 01:05 | #3722 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Code:
return Last.Prefetch(4) Code:
return Last.Prefetch(4) EDIT: OK, I think I get what you mean, simlar to John's earlier not working script. Use eg Code:
return output.Prefetch(4) Code:
output.Prefetch(4)
__________________
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 November 2017 at 01:20. |
|
9th November 2017, 01:19 | #3723 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
|
No, it would be equivalent to:
Code:
last = last.Prefetch(4) return last Last edited by LigH; 9th November 2017 at 01:21. |
9th November 2017, 01:22 | #3724 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
OK, but both of my last two above code blocks would work, yes ?
EDIT: or that below will NOT work as planned. Code:
return output.Prefetch(4)
__________________
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 November 2017 at 01:31. |
9th November 2017, 09:22 | #3726 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
A short question.
Lately moved to Visual Studio 2017. Now Avisynth+ is built with v141_xp toolset instead of v140_xp (VS 2015). I have put it to an xp virtual machine, which did not have Microsoft Visual C++ Redistributable for Visual Studio 2017. I expected that it would crash with a nice exception but it was running instead. What function call should I use that would crash this vs2017-built dll with no new redistributables? |
9th November 2017, 09:46 | #3727 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
__________________
Groucho's Avisynth Stuff |
|
9th November 2017, 10:44 | #3728 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
C++ Binary Compatibility between Visual Studio 2015 and Visual Studio 2017 It says that in our case they are compatible, because the major number is to the toolsets (v140, v141) is 14. (Does it mean that for a freshly installed system, it's enough to have the VS2017 redistributables for our old dlls that would need VS2015 redist in the past?) |
|
9th November 2017, 10:50 | #3729 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
13th November 2017, 12:33 | #3730 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
since there are many plugins dll's that didn't port to x64 including the closed source plugins, is there some ways to make the 32 bit one work in 64 processes? I note this http://www.dllwrapper.com/ but couldn't build wrapped dll successfully, and even if I did, it will work one day only (need to buy it)
__________________
See My Avisynth Stuff |
13th November 2017, 12:53 | #3731 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
|
I guess it might be possible in a separate 32-bit sub process (with a "bridge" EXE in between), but that would probably be quite inefficient, possibly requiring frame data to be piped (like the avs2yuv or avs4x26x bridges do).
Could you name any "priceless" plugins you know some users can't live without? |
13th November 2017, 13:06 | #3732 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Quote:
about the "priceless" plugins, it depend on the source you work with it, but there are many, mostly used in avsi script functions
__________________
See My Avisynth Stuff |
|
13th November 2017, 15:31 | #3735 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
ok then, like removedirt, deen, TBilateral, removegrainT, LGhost
edit: and AVSInpaint (for FillBorders() in Stabilization Tools Pack by Dogway)
__________________
See My Avisynth Stuff Last edited by real.finder; 13th November 2017 at 18:10. |
13th November 2017, 20:07 | #3736 | Link | |
Registered User
Join Date: Oct 2011
Posts: 275
|
Quote:
This said i gave up on many x86 plug-ins that looked interesting on the paper for some specific tasks i had to do and needed a solution for but did not bothered with long processing and headache of not being able to pass some variables from one process mode to the other and in the end found other ways to do what i needed using other tools outside avisytnh or simply gave up on those projects. Being able to run natively and more smoothly some x86 stuff like MP_Pipeline allows it will be a dream, but i keep this as a dream Last edited by Yanak; 1st December 2017 at 13:16. |
|
13th November 2017, 20:36 | #3737 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Quote:
and aside from mpp downside, if there are one plugin that lacking x64 port in some function then you have to use the x86 just for it!
__________________
See My Avisynth Stuff |
|
14th November 2017, 16:19 | #3738 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
All good things must come to an end: now I stopped optimizing Expr so have fun with this release.
This version - along with fixing some annoying bugs - features the Expr filter, which was ported from the Vapoursynth project. Although it was ported in one day, tweaking it further took a _lot_ more time and of course, a good entertainment. Download Avisynth+ r2542 (20171114) Questions, testing are welcome. Please read the "readme.txt" for details about Expr, until the documentation appears in the avisynth webpage. Code:
# Avisynth+ r2542 (20171114) ## Fixes - Fix: RGB (full scale) conversion: 10-16 bits to 8 bits rounding issue; pic got darker in repeated 16<->8 bit conversion chain - Fix: ConvertToY: remove unnecessary clamp for Planar RGB 32 bit float - Fix: RGB ConvertToY when rec601, rec709 (limited range) matrix. Regression since r2266 ## modification, additions - Add: Expr filter - Add: Levels: 32 bit float format support - Optimized: Faster RGB (full scale) 10-16 bits to 8 bits conversion when dithering - Other: Default frame alignment is 64 bytes (was: 32 bytes). (independently of AVX512 support) - Built with Visual Studio 2017, v141_xp toolset - some fixes in avisynth_c.h (C interface header file) - experimental x64 build with size_t frame offsets for testing more properly written C interfaces Code:
Expr filter Syntax ("c+s+[format]s[optAvx2]b[optSingleMode]b[optSSE2]b") clip Expr(clip c[,clip c2, ...], string expr [, string expr2[, string expr3[, string expr4]]] [, string format] [, bool optSSE2][, bool optAVX2][, bool optSingleMode]) Clip and Expr parameters are unnamed 'format' overrides the output video format 'optSSE2' to disable simd optimizations (use C code) 'optAVX2' to disable AVX2 optimizations (use SSE2 code) 'optSingleMode' default false, to generate simd instructions for one XMM/YMM wide data instead of two. Experimental. One simd cycle processes 8 pixels (SSE2) or 16 pixels (AVX2) at a time by using two XMM/YMM registers as working set. Very-very complex expressions would use too many XMM/YMM registers which are then "swapped" to memory slots, that can be slow. Using optSingleMode = true may result in using less registers with no need for swapping them to memory slots. Expr accepts 1 to 26 clips as inputs and up to four expression strings, an optional video format overrider, and some debug parameters. Output video format is inherited from the first clip, when no format override. All clips have to match their dimensions and plane subsamplings. Expressions are evaluated on each plane, Y, U, V (and A) or R, G, B (,A). When an expression string is not specified, the previous expression is used for that plane. Except for plane A (alpha) which is copied by default. When an expression is an empty string ("") then the relevant plane will be copied (if the output clip bit depth is similar). When an expression is a single clip reference letter ("x") and the source/target bit depth is similar, then the relevant plane will be copied. When an expression is constant, then the relevant plane will be filled with an optimized memory fill method. Expressions are written in Reverse Polish Notation (RPN). Expressions use 32 bit float precision internally For 8..16 bit formats output is rounded and clamped from the internal 32 bit float representation to valid 8, 10, ... 16 bits range. 32 bit float output is not clamped at all. - Clips: letters x, y, z, a, ... w. x is the first clip parameter, y is the second one, etc. - Math: * / + - - Math constant: pi - Functions: min, max, sqrt, abs, neg, exp, log, pow ^ (synonyms: "pow" and "^") - Logical: > < = >= <= and or xor not == & | != (synonyms: "==" and "=", "&" and "and", "|" and "or") - Ternary operator: ? - Duplicate stack: dup, dupN (dup1, dup2, ...) - Swap stack elements: swap, swapN (swap1, swap2, ...) - Scale by bit shift: scaleb (operand is treated as being a number in 8 bit range unless i8..i16 or f32 is specified) - Scale by full scale stretch: scalef (operand is treated as being a number in 8 bit range unless i8..i16 or f32 is specified) - Bit-depth aware constants ymin, ymax (ymin_a .. ymin_z for individual clips) - the usual luma limits (16..235 or scaled equivalents) cmin, cmax (cmin_a .. cmin_z) - chroma limits (16..240 or scaled equivalents) range_half (range_half_a .. range_half_z) - half of the range, (128 or scaled equivalents) range_size, range_half, range_max (range_size_a .. range_size_z , etc..) - Keywords for modifying base bit depth for scaleb and scalef: i8, i10, i12, i14, i16, f32 - Spatial input variables in expr syntax: sx, sy (absolute x and y coordinates, 0 to width-1 and 0 to height-1) sxr, syr (relative x and y coordinates, from 0 to 1.0) Additions and differences to VS r39 version: ------------------------------ (similar features to the masktools mt_lut family syntax) Aliases: introduced "^", "==", "&", "|" New operator: != (not equal) Built-in constants ymin, ymax (ymin_a .. ymin_z for individual clips) - the usual luma limits (16..235 or scaled equivalents) cmin, cmax (cmin_a .. cmin_z) - chroma limits (16..240 or scaled equivalents) range_half (range_half_a .. range_half_z) - half of the range, (128 or scaled equivalents) range_size, range_half, range_max (range_size_a .. range_size_z , etc..) Autoscale helper functions (operand is treated as being a number in 8 bit range unless i8..i16 or f32 is specified) scaleb (scale by bit shift - mul or div by 2, 4, 6, 8...) scalef (scale by stretch full scale - mul or div by source_max/target_max Keywords for modifying base bit depth for scaleb and scalef : i8, i10, i12, i14, i16, f32 Built-in math constant pi Alpha plane handling. When no separate expression is supplied for alpha, plane is copied instead of reusing last expression parameter. Proper clamping when storing 10, 12 or 14 bit outputs (Faster storing of results for 8 and 10-16 bit outputs, fixed in VS r40) 16 pixels/cycle instead of 8 when avx2, with fallback to 8-pixel case on the right edge. Thus no need for 64 byte alignment for 32 bit float. (Load zeros for nonvisible pixels, when simd block size goes beyond image width, to prevent garbage input for simd calculation) Optimizations for pow: x^0.5 is sqrt, ^2, ^3, ^4 is done by faster and more precise multiplication Spatial input variables in expr syntax: sx, sy (absolute x and y coordinates, 0 to width-1 and 0 to height-1) sxr, syr (relative x and y coordinates, from 0 to 1.0) Optimize: recognize constant plane expression: use fast memset instead of generic simd process. Approx. 3-4x (32 bits) to 10-12x (8 bits) speedup Optimize: Recognize single clip letter in expression: use fast plane copy (BitBlt) (e.g. for 8-16 bits: instead of load-convert_to_float-clamp-convert_to_int-store). Approx. 1.4x (32 bits), 3x (16 bits), 8-9x (8 bits) speedup Optimize: do not call GetFrame for input clips that are not referenced or plane-copied Recognize constant expression: use fast memset instead of generic simd process. Approx. 3-4x (32 bits) to 10-12x (8 bits) speedup Example: Expr(clip,"128","128,"128") Differences from masktools 2.2.10 -------------------------------- Up to 26 clips are allowed (x,y,z,a,b,...w). Masktools handles only up to 4 clips with its mt_lut, my_lutxy, mt_lutxyz, mt_lutxyza - Clips with different bit depths are allowed - Works with 32 bit floats instead of 64 bit double internally - Less functions (e.g. no bit shifts) - No float clamping and float-to-8bit-and-back load/store autoscale magic (yet) - Logical 'false' is 0 instead of -1 - The ymin, ymax, etc built-in constants can have a _X suffix, where X is the corresponding clip designator letter. E.g. cmax_z, range_half_x - mt_lutspa-like functionality is available through "sx", "sy", "sxr", "syr" - No y= u= v= parameters with negative values for filling plane with constant value, constant expressions are changed into optimized "fill" mode Sample: Average three clips: c = Expr(clip1, clip2, clip3, "x y + z + 3 /") using spatial feature: c = Expr(clip1, clip2, clip3, "sxr syr 1 sxr - 1 syr - * * * 4096 scaleb *", "", "") Last edited by pinterf; 14th November 2017 at 16:30. |
14th November 2017, 16:59 | #3739 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
About how much faster is avx2 vs sse2 on a modern cpu in your expr version?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
14th November 2017, 17:05 | #3740 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
thanks pinterf
Quote:
__________________
See My Avisynth Stuff |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|