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. |
3rd July 2019, 13:40 | #4781 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
it can't has "universal Expr" https://forum.doom9.org/showthread.p...44#post1873444
__________________
See My Avisynth Stuff |
3rd July 2019, 13:46 | #4782 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Getting there step by step, looking quite good. Looks like S_ExLogo may support all colorspaces that layer supports. [wonder if we have to support YAxx at some point (internally, dont think exists externally, <maybe just strip alpha>)] Thanks muchly for all of the nice new Layer() stuff, we is gettin' there.
__________________
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 July 2019 at 13:52. |
|
3rd July 2019, 14:00 | #4783 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
But sometimes we have to use "IF float ELSE ". 32 bit float expressions can be tricky, using a generic expression would be sub-optimal for lower bit depths. Anyway, this one seems to work properly for me (I'm using different y and u/v expression) for both 16 and 32 bits: In smaskmerge: mt_lutxyz(src,overlay,mask,\ "x range_max z - * y z * + range_max /",\ uexpr="x range_max range_min - z - * y z * + range_max range_min - /",\ vexpr="x range_max range_min - z - * y z * + range_max range_min - /",\ y=y,u=u,v=v) I'd rather use Expr for high bit depth (speed) |
|
3rd July 2019, 14:50 | #4784 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Quote:
I will use "IF float ELSE" only if the lazy method slower
__________________
See My Avisynth Stuff |
|
3rd July 2019, 15:21 | #4785 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Unlike the lut family, Expr can use constant folding internally when it pre-scans an expression. The expression e.g. range_max - range_min (RPN: "range_max range_min -") is a constant expression known before JIT compilation is done, so it'll be replaced with a single constant. (Other optimizations exist in Expr preprocessor such as eliminating "*1" and "+0", replacing "x power 2" with a much faster x*x, etc...) Since lutxyz is not using JIT (Just In Time) compilation, the subtraction is done as a separate step. In lut versions where the lookup table is precalculated (e.g. lutxyz in 8 bits) this does not affect performance much because the actual expression evaluation is done once during filter creation (unless it's working in a runtime evaluated function, because the size of this lut is 256*256*256 = 16777216 which takes significant time if expression is complex). |
|
3rd July 2019, 15:55 | #4786 | Link |
Registered User
Join Date: Dec 2013
Location: France
Posts: 64
|
RunTime Functions
Quick test with the latest AVS+ r2895.
With a active RunTime Function in MT Mode, I no longer have the error message reported to the first post of this topic. https://forum.doom9.org/showthread.php?t=176502 But, total freezing of the script with active MT (Prefetch). RunTime Functions works, always, normally WITHOUT MT. |
4th July 2019, 23:59 | #4787 | Link |
Registered User
Join Date: Feb 2014
Posts: 355
|
Hello. I'm attempting to graduate from AviSynth+ x86 to AviSynth+ x64 but I'm encountering difficulty. With Win 7 x64 and MeGUI, my standard script:
Code:
SOURCE INFORMATION HERE SetFilterMTMode("Default_MT_Mode",2) SMDegrain(TR=X,ThSAD=XXX,RefineMotion=True,Plane=0,Chroma=False,n16=True,n16_Out=True) FastLineDarkenMod4() ConvertToDoubleWidth() F3KDB(Y=100,Cb=100,Cr=100,GrainY=0,GrainC=0,Input_Mode=2,Output_Mode=2) ConvertFromDoubleWidth() PreFetch(X) Code:
SOURCE INFORMATION HERE SetFilterMTMode("Default_MT_Mode",2) SMDegrain(TR=X,ThSAD=XXX,RefineMotion=True,Plane=0,Chroma=False,n16=True,n16_Out=True) FastLineDarkenMod4() # ConvertToDoubleWidth() # F3KDB(Y=100,Cb=100,Cr=100,GrainY=0,GrainC=0,Input_Mode=2,Output_Mode=2) # ConvertFromDoubleWidth() PreFetch(X) I realize this possibly (probably) isn't an AviSynth+ issue but I couldn't come up with a better place to post a question given the number of geniuses frequenting this thread. Thanks for any redirection or help . Last edited by LouieChuckyMerry; 5th July 2019 at 00:06. Reason: Information; Information... |
5th July 2019, 00:58 | #4789 | Link |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
Don't try to use MeGUI to debug anything. Pass the script to AVSMeter or FFmpeg (or mpv) or x264 itself and see what error gets thrown there. Because I can almost guarantee you it's because you're using the new AviSynth+ high bit depth-compatible build of f3kdb and yet still using the input_mode and output_mode parameters, which were removed (technically also the DoubleWidth conversions, but that's mostly because they're irrelevant now, not because they'd actually cause an error).
|
5th July 2019, 12:26 | #4790 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Quote:
And this is just a script that calls f3kdb directly. Think about how many other plugins/filters are there, who requires f3kdb as a dependency and who call it using those parameters! |
|
5th July 2019, 15:54 | #4791 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 5th July 2019 at 15:59. |
|
5th July 2019, 17:57 | #4793 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
No. I think the current method is slow, just count the number of times you run "GetProcAddress(plugin.Library, "....") on each plugin.
Almost all plugins just have one export so the enumeration is going to be fast. Also, within the same call to "MapAndLoad()" you get the bitness info. Have a look, the relevant function in AVSMeter is "CAvisynthInfo::GetPluginType" in "AvisynthInfo.h". As I mentioned, I can strip the stuff you don't need and put some comments.
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 5th July 2019 at 18:03. |
7th July 2019, 02:32 | #4795 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Quote:
Code:
blankclip(length=48,width=720,height=480, color=$00000,pixel_type="YV12") expr("sx frameno + 32 % 16 < range_half range_max ?","sx frameno 2 / + 16 % 8 < range_half sx 15 / - range_half ?","sx frameno 2 / + 16 % 8 < range_half sx 8 / - range_half ?") o=last setbits=32 ConvertBits(setbits) # 32bit float vs 8-16bit integer video=last video2=video.trim(20,0) x1=string(20) x2=string(600) y1=string(50) y2=string(340) msk=o.expr("sx "+x1+" >= sx "+x2+" <= & sy "+y1+" >= sy "+y2+" <= & & range_max range_min ?", "range_half", "range_half").trim(0,-1).FreezeFrame(0, FrameCount(last)-1, 0) msk=msk.ConvertBits(setbits) # 32bit float vs 8-16bit integer ########################## pmaskmerge(video, video2, msk,3,3,3, true).StackVertical(smaskmerge(video, video2, msk,3,3,3, true).Subtitle("smaskmerge")) ConvertBits(8)
__________________
See My Avisynth Stuff Last edited by real.finder; 7th July 2019 at 03:00. |
|
7th July 2019, 11:42 | #4796 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Code:
BOOL GetPluginType(std::string sPlugin) { BOOL PROCESS_64 = (sizeof(void*) == 8) ? TRUE : FALSE; BOOL bIs64BitDLL = FALSE; //The MapAndLoad function maps an image and preloads data from the mapped file. LOADED_IMAGE li; BOOL bLoaded = MapAndLoad((LPSTR)sPlugin.c_str(), NULL, &li, TRUE, TRUE); if (!bLoaded) { //error handling, check GetLastError() why the DLL could not be loaded return FALSE; } if (li.FileHeader->FileHeader.Machine != IMAGE_FILE_MACHINE_I386) //check the PE header for bitness { bIs64BitDLL = TRUE; //it's a 64 bit DLL if (!PROCESS_64) //if running a 32 bit process, throw error and return { //"Trying to load 64 bit DLL in 32 bit Avisynth" UnMapAndLoad(&li); return FALSE; } } else //it's a 32 bit DLL { if (PROCESS_64) //if running a 64 bit process, throw error and return { //"Trying to load 32 bit DLL in 64 bit Avisynth" UnMapAndLoad(&li); return FALSE; } } DWORD expVA = li.FileHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress; if (expVA == 0) { //error handling -> "Cannot retrieve PE header data" UnMapAndLoad(&li); return FALSE; } PIMAGE_EXPORT_DIRECTORY pExp = (PIMAGE_EXPORT_DIRECTORY)ImageRvaToVa(li.FileHeader, li.MappedAddress, expVA, NULL); if (pExp == 0) { //error handling -> "Cannot retrieve PE header data", check GetLastError() UnMapAndLoad(&li); return FALSE; } DWORD rvaNames = pExp->AddressOfNames; DWORD *prvaNames = (DWORD*)ImageRvaToVa(li.FileHeader, li.MappedAddress, rvaNames, NULL); if (prvaNames == 0) { //error handling -> "Cannot retrieve PE header data", check GetLastError() UnMapAndLoad(&li); return FALSE; } //enumerate DLL exports DWORD dwName = 0; std::string sPluginType = ""; for (dwName = 0; dwName < pExp->NumberOfNames; ++dwName) { DWORD rvaName = prvaNames[dwName]; std::string sExportFunc((char *)ImageRvaToVa(li.FileHeader, li.MappedAddress, rvaName, NULL)); std::transform(sExportFunc.begin(), sExportFunc.end(), sExportFunc.begin(), ::tolower); //convert to lower case for comparison if (sExportFunc.find("avisynthplugininit3") != string::npos) //CPP 2.6, 32 or 64 bit { sPluginType = "AVSCPP26"; break; } if (sExportFunc.find("avisynthplugininit2") != string::npos) //CPP 2.5, 32 or 64 bit { sPluginType = "AVSCPP25"; break; } if ((sExportFunc.find("avisynthplugininit") != string::npos) && !bIs64BitDLL) //CPP 2.0 (these are 32 bit only) sPluginType = "AVSCPP20"; //don't break here, keep looping if ((sExportFunc.find("avisynth_c_plugin_init@4") != string::npos) && !bIs64BitDLL) //32 bit C 2.5 { sPluginType = "AVSC25"; break; } if ((sExportFunc.find("avisynth_c_plugin_init") != string::npos) && bIs64BitDLL) //64 bit C 2.5 { sPluginType = "AVSC25"; break; } if ((sExportFunc == "avisynth_c_plugin_init") && !bIs64BitDLL) //C 2.0 (these are 32 bit only) sPluginType = "AVSC20"; //don't break here, keep looping } UnMapAndLoad(&li); return TRUE; }
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 7th July 2019 at 17:37. |
|
8th July 2019, 11:07 | #4799 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
New test build Avisynth+ r2900 https://drive.google.com/open?id=14D...3LX9jCssDt3VeF Changes since last test build: Code:
- Fix: ConvertToRGB from 32bit float YUV w/ full scale matrixes (pc.601, pc.709, average) - Fix: FlipHorizontal RGB48/64 artifacts - Enhanced: a bit quicker FlipHorizontal - Fix: RGB64 Blur leftmost column artifact |
|
8th July 2019, 14:35 | #4800 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Ooooo lovely, thanx P.
__________________
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 ??? |
|
|