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. |
18th February 2020, 09:20 | #5161 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Code:
filter_support = support() / min(target_width / crop_width, 1.0) if (width_original < filter_support) --> error 4 - Gaussian, sinc, Spline64, lanczos4 4 (or taps) - Blackman 3 (or taps) - Lanczos 3 - Spline36 2 - Spline16, bicubic 1 - bilinear |
|
18th February 2020, 09:23 | #5162 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
This calcs for 2.58, 2.60, and avs+
Code:
Function IsAvs26() { VersionNumber>=2.6} Function IsAvsNeo() { FindStr(VersionString," Neo")!=0} Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||IsAvsNeo} Function X_YMod(clip c) { c IsAvsPlus ? (NumComponents==1||IsRGB?1:Height/ExtractU.Height):(IsYV12 ?2:1) } # Y Min crop multiple for Progressive Function X_XMod(clip c) { c IsAvsPlus ? (NumComponents==1||IsRGB?1:Width/ExtractU.Width):IsAvs26?(IsYV411?4:IsYUY2||IsYV16||IsYV12?2:1):(IsRGB?1:2)} # X Min crop multiple Function X_CsXMod(Val CSP) { (CSP.IsClip)?CSP:(CSP.IsString)?Blankclip(Length=1,Width=16,height=16,Pixel_type=CSP):Assert(False,"X_CsXMod: CSP Clip or Pixel_Type string ONLY") Return X_XMod } Function X_CsYMod(Val CSP) { (CSP.IsClip)?CSP:(CSP.IsString)?Blankclip(Length=1,Width=16,height=16,Pixel_type=CSP):Assert(False,"X_CsYMod: CSP Clip or Pixel_Type string ONLY") Return X_YMod } Function X_MinResize(String Resizer,Val CSP,Bool "Wid",Bool "Src",Int "Taps") { # Minimum required Width or Height, Source or Dest, for Resizer and Colorspace, CSP can be Clip or String eg "RGB32" S=Resizer.UCase I=FindStr(S,"RESIZE") S=(I==0) ? S : S.LeftStr(I-1) # Can use eg Resizer either "BiLinearResize or just BiLinear" Ix=(S=="POINT")?0:(S=="BILINEAR")?1:(S=="BICUBIC")?2:(S=="SPLINE16")?3:(S=="SPLINE36")?4:(S=="SPLINE64")?5:(S=="GAUSS")?6:(S=="LANCZOS4")?7:(S=="LANCZOS")?8:(S=="BLACKMAN")?9:(S=="SINC")?10:-1 Assert(0 <= IX <= (IsAvs26?10:9), "X_MinResize: No such Resizer filter (" + S + "Resize)") defT=Select(Ix, 0,-1,-2,-2,-3,-4,-4,-4,3,4,4) Wid=Default(Wid,True) # True = Inquire Width, else Height Src=Default(Src,True) # True = Inquire Upscale Src, else DownScale Dest Assert(defT>0 || !Taps.Defined,"X_MinResize: "+S+"RESIZE Does not have a Taps arg") Taps=(defT>0) ? Default(Taps,defT) : Abs(defT) Assert(CSP.IsClip || CSP.IsString,"X_MinResize: CSP clip or Pixel_Type string ONLY") Return (Wid) ? (Taps+1) * CSP.X_CsXMod : (IsAvs26) ? (Taps+1) * CSP.X_CsYMod \ : (Src) ? (Taps+1) * 2 : Max((Taps+1)*2,4) # Fix for v2.58 Peculiarities } EDIT: I do not take into account Dest size when inquiring min Src size, or Src size when inquiring min Dest size, it dont seem to matter, maybe I need more checks. Also do not take into account src_left, Src_top etc, we assume full src. EDIT: Quote:
bilinear always fails unless width_original = 2, ie support + 1. Same with all of the others, and the reason for the "(Taps+1) * CSP.X_CsXMod" type stuff above, you can substitute support where says Taps above. Maybe there is some kind of float precision thing going on, where something like width_original < 1.00000000000001 provides error where it is intended not to. Same happens when downsize, taps + 1 minimum. Code:
S=1 BlankClip(Length=1,Width=S,Height=S,Pixel_type="RGB32") Z=2 BiLinearResize(Z,Z) # Width=1 support = 1 error Code:
ResamplingProgram* ResamplingFunction::GetResamplingProgram(int source_size, double crop_start, double crop_size, int target_size, int bits_per_pixel, IScriptEnvironment2* env) { double filter_scale = double(target_size) / crop_size; double filter_step = min(filter_scale, 1.0); double filter_support = support() / filter_step; int fir_filter_size = int(ceil(filter_support*2)); ResamplingProgram* program = new ResamplingProgram(fir_filter_size, source_size, target_size, crop_start, crop_size, bits_per_pixel, env); // this variable translates such that the image center remains fixed double pos; double pos_step = crop_size / target_size; if (source_size <= filter_support) { env->ThrowError("Resize: Source image too small for this resize method. Width=%d, Support=%d", source_size, int(ceil(filter_support))); } [Actually, I think qyot27 might have said something about < versus <= last time subject came up] EDIT: Yep, RaffRiff42 and qyot27 both made mention:- https://forum.doom9.org/showthread.p...52#post1836752
__________________
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; 19th February 2020 at 12:55. |
|
22nd February 2020, 17:18 | #5163 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Made some simple wrapper library for AviSynth and VapourSynth, it was necessary because AviSynth has no C or COM interface...
https://github.com/staxrip/staxrip/t...er/FrameServer https://github.com/staxrip/staxrip/b...FrameServer.vb https://github.com/staxrip/staxrip/b...deoRenderer.vb
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
23rd February 2020, 21:08 | #5164 | Link | |
gMKVExtractGUI author
Join Date: Aug 2003
Location: Greece / Thessaloniki
Posts: 251
|
Quote:
I was experimenting myself recently on something similar for my C# projects! |
|
24th February 2020, 01:05 | #5165 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
@gpower2
No problem, I've committed a vs text encoding fix today. To convert from VB.NET to C# there is http://converter.telerik.com or if that don't work the jetbrains dotpeek decompiler can be used. MysteryX has written code to access VapourSynth directly in C#, that would have been an alternative route I could have taken. https://github.com/mysteryx93?tab=repositories
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
3rd March 2020, 03:34 | #5166 | Link |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
AviSynth+ 3.5.0 has been released.
The big, shiny new feature this time around: native support for Linux, macOS, and BSD. Full list of changes:
|
3rd March 2020, 09:17 | #5167 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Lovely and shiny, thanx muchly
__________________
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 ??? |
3rd March 2020, 10:34 | #5168 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Linux + mac support, nice! So it does not rely on vfw anymore? Are there already tools what supports "native" avs files on linux?
Happy avs filter recompiling
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
3rd March 2020, 12:11 | #5170 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
|
Introducing Linux and Mac OSX Support is a very important achievement!
Some people (including me) never thought this day was going to happen, but here it is...! Kudos to all of you, guys! And as always, it also works like a charm on Windows XP as well! (I just tested it) |
3rd March 2020, 12:47 | #5171 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
__________________
Groucho's Avisynth Stuff |
|
3rd March 2020, 14:02 | #5174 | Link | |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
Quote:
But yes, a patch exists to be able to use AviSynth+ in FFmpeg on Linux, et al. (https://github.com/qyot27/FFmpeg/commits/avsplus_linux). It getting into FFmpeg upstream is dependent on whether they want a deprecation message to tell people to upgrade from AvxSynth or not (and then delay the actual switch until after the next release of FFmpeg). |
|
3rd March 2020, 15:30 | #5176 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
qyot27 never gives up , thank you for pushing this through and answering my very basic questions. Supporting multiple platforms is a bit more difficult though. At least for someone (me) who is using linux in every five years for only a day or two. All I can say that Midnight Commander rulez
And a missing thing from the change log (I'll put it on Wiki) Since on Linux we do not have Windows font rendering engine, as a quick solution a filter named "Text" was created with the same parameters as SubTitle. "Text" is available on Windows as well. It is using a simple 10x20 matrix fixed font (planned to have some more), similar to what debug text in some Avisynth external filters are using, but with color and halocolor for outline. Size and orientations related parameters are simply ignored. SubTitle on linux is simply redirected to this new filter. Last edited by pinterf; 3rd March 2020 at 17:07. Reason: No "SimpleText" just "Text" |
3rd March 2020, 16:32 | #5177 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Quote:
__________________
See My Avisynth Stuff |
|
3rd March 2020, 16:49 | #5178 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
You can extract them from Groucho2004's installer using 7zip
https://forum.doom9.org/showthread.php?t=172124 |
3rd March 2020, 16:54 | #5179 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Code:
Blankclip(width=120,height=120,Color=$808080) /* Text "cs[x]f[y]f[first_frame]i[last_frame]i[font]s[size]f[text_color]i[halo_color]i[align]i[spc]i[lsp]i[font_width]f[font_angle]f[interlaced]b[font_filename]s[utf8]b" */ Text("Hello\nWorld",lsp=0,align=5)
__________________
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; 3rd March 2020 at 16:58. |
|
3rd March 2020, 16:54 | #5180 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
pinterf's test version had fixed the errors in this post with the internal avs conversion
https://forum.doom9.org/showthread.php?p=1897686 pinterf test version https://forum.doom9.org/showthread.php?p=1898860 But using the recent 3.5, r3043 , some differences are back. 12bits again "fixes" it avsresize/zimg/zlib works using 10bits with either version |
|
|