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. |
21st January 2014, 12:24 | #721 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
@mawen1250,
dither-1.24.0.zip contains this mod which seems to work OK Code:
Function Dither_replace_string (string str, string findstr, string repstr) { strl = LCase (str) findstrl = LCase (findstr) lenf = StrLen (findstr) pos = FindStr (strl, findstrl) pos2 = (pos <= 0) ? 1 : pos # EDIT: seems superflous rep = (pos <= 0) ? "" : LeftStr (str, pos-1) + repstr + Dither_replace_string (MidStr (str, pos + lenf), findstr, repstr) return ((pos <= 0) ? str : rep) } Your version with the added '-1' causes Avisynth halt without producng clip or error message and is not working as you expected. EDIT: Your version keeps trying to replace the same string over and over again, until it runs out of stack. EDIT: This Code:
colorbars Function Dither_replace_string (string str, string findstr, string repstr) { strl = LCase (str) findstrl = LCase (findstr) lenf = StrLen (findstr) pos = FindStr (strl, findstrl) # pos2 = (pos <= 0) ? 1 : pos rep = (pos <= 0) ? "" : LeftStr (str, pos-1) + repstr + Dither_replace_string (MidStr (str, pos + lenf), findstr, repstr) return ((pos <= 0) ? str : rep) } S = " x 32768 <= x x 32768 - ? " F=" x " R=" 123 " O=Dither_replace_string(S,F,R) RT_DebugF("%s\n%s",S,O) S2 = " x 32768 <= x x 32768 - ? " O2=Dither_replace_string(S2,F,R) RT_DebugF("%s\n%s",S2,O2) return Last Code:
00000013 72.02262115 [1948] RT_DebugF: x 32768 <= x x 32768 - ? 00000014 72.02263641 [1948] RT_DebugF: 123 32768 <= 123 x 32768 - ? # Problem 00000015 72.03427887 [1948] RT_DebugF: x 32768 <= x x 32768 - ? 00000016 72.03430176 [1948] RT_DebugF: 123 32768 <= 123 123 32768 - ? # OK
__________________
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; 21st January 2014 at 14:21. |
21st January 2014, 13:03 | #722 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
Try F=" x " R=" 123 " and you will see the issue mawen1250 is talking about. |
|
21st January 2014, 14:12 | #723 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
I think his point is that the way the function is used in Dither_lut16, both the search and replacement strings always have added spaces, so his fix works. |
|
21st January 2014, 15:54 | #724 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Thank you big G, you got me there.
As omission of space could cause problem, how bout this: Code:
colorbars Function Dither_replace_string_MOD (string str, string findstr, string repstr) { strl = LCase (str) # case independent for FindStr findstrl = LCase (findstr) # lenf = StrLen (findstr) pos = FindStr (strl, findstrl) lenr = Strlen(repstr) # Below string comparison 'RightStr(repstr,1) == LeftStr(findstr,1)' is case insignificant # If last char in replace matches 1st char in find, then # we replace with all but last char of replace, and re-search remainder but with prepended first char of replace. rep = (pos <= 0) \ ? "" \ : (lenf>1 && lenr>1 && RightStr(repstr,1) == LeftStr(findstr,1)) \ ? LeftStr (str, pos-1) + LeftStr(repstr,lenr-1) + Dither_replace_string_MOD (RightStr(repstr,1) \ + MidStr (str, pos + lenf), findstr, repstr) \ : LeftStr (str, pos-1) + repstr + Dither_replace_string_MOD (MidStr (str, pos + lenf), findstr, repstr) return ((pos <= 0) ? str : rep) } S1 = " x 32768 <= x x 32768 - ? " F=" x " R=" ABC " O1=Dither_replace_string_MOD(S1,F,R) RT_DebugF("S1='%s' : F='%s' R='%s'\nO1='%s'\n",S1,F,R,O1) R="ABC" O2=Dither_replace_string_MOD(S1,F,R) RT_DebugF("S1='%s' : F='%s' R='%s'\nO2='%s\n",S1,F,R,O2) S2 = " x 32768 <= x x 32768 - ? " F=" x " R=" ABC " O3=Dither_replace_string_MOD(S2,F,R) RT_DebugF("S2='%s' : F='%s' R='%s'\nO3='%s\n",S2,F,R,O3) R="ABC" O4=Dither_replace_string_MOD(S2,F,R) RT_DebugF("S2='%s' : F='%s' R='%s'\nO4='%s\n",S2,F,R,O4) return Last Code:
00000005 2.31286550 [2940] RT_DebugF: S1=' x 32768 <= x x 32768 - ? ' : F=' x ' R=' ABC ' 00000006 2.31392574 [2940] RT_DebugF: O1=' ABC 32768 <= ABC ABC 32768 - ? ' 00000007 2.31412077 [2940] RT_DebugF: 00000008 2.33118415 [2940] RT_DebugF: S1=' x 32768 <= x x 32768 - ? ' : F=' x ' R='ABC' 00000009 2.37454796 [2940] RT_DebugF: O2='ABC32768 <=ABCABC32768 - ? 00000010 2.37459588 [2940] RT_DebugF: 00000011 2.39530826 [2940] RT_DebugF: S2=' x 32768 <= x x 32768 - ? ' : F=' x ' R=' ABC ' 00000012 2.39533472 [2940] RT_DebugF: O3=' ABC 32768 <= ABC ABC 32768 - ? 00000013 2.39536095 [2940] RT_DebugF: 00000014 2.40840435 [2940] RT_DebugF: S2=' x 32768 <= x x 32768 - ? ' : F=' x ' R='ABC' 00000015 2.41166806 [2940] RT_DebugF: O4='ABC32768 <=ABCx 32768 - ? 00000016 2.41172385 [2940] RT_DebugF: Not much testing but seems to work. Spot any problems Gavino ? PS, Whatever happend to the 'quick reply' spell checker when I was on 'vacation' ??? EDIT: This causes silent crash in Mawen1250 mod, no error message, could be hard to trace bug Code:
S1 = " x 32768 <= x x 32768 - ? " F="x" R="A" O1=Dither_replace_string(S1,F,R) Code:
00000005 2.15423131 [2144] RT_DebugF: S1=' x 32768 <= x x 32768 - ? ' : F='x' R='A' 00000006 2.15425491 [2144] RT_DebugF: O1=' A 32768 <= A A 32768 - ? '
__________________
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; 21st January 2014 at 17:23. |
22nd January 2014, 05:02 | #725 | Link |
Registered User
Join Date: Aug 2011
Posts: 103
|
The original Dither_replace_string works correctly for pure linear string replacement, but it is only used in Dither_lut16, while the string replacement in Dither_lut16 is somewhat meant to be non-linear...
So the modified Dither_replace_string should be renamed to something like Dither_expr_replace_string IMO. Last edited by mawen1250; 22nd January 2014 at 05:08. |
22nd January 2014, 11:30 | #726 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Because there isn’t currently any operator starting with the letter "x", I think replacing " x" instead of " x " in Dither_lut16_expr() is a simpler solution.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
2nd March 2014, 09:37 | #727 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Dither 1.25.0:
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding Last edited by cretindesalpes; 3rd March 2014 at 22:14. |
2nd March 2014, 13:44 | #729 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Do you mean avstp.dll? Most likely not. With this 64-bit version, I’m supporting AviSynth+, not the old 64-bit AviSynth which is abandoned. Avs+ already has frame-based multi-threading capabilities, and I’ll probably make avstp use its internal thread pool interface in the future.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
3rd March 2014, 22:11 | #732 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Damn! Your’re right. Fixed in Dither 1.25.1
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
5th March 2014, 21:41 | #733 | Link |
Registered User
Join Date: Nov 2006
Posts: 83
|
Just wondering... is this the expected encode speed for a Q8400 and 4GB RAM?
(avstp.dll is in the autoload plugin folder) Code:
setmemorymax(512) LoadPlugin("D:\Edição de video\MeGUI\tools\dgavcindex\DGAVCDecode.dll") LoadPlugin("D:\Arquivos de programas\AviSynth 2.5\plugins\removegrain\RemoveGrainSSE2.dll") LoadPlugin("D:\Arquivos de programas\AviSynth 2.5\plugins\removegrain\RepairSSE2.dll") LoadPlugin("D:\Arquivos de programas\AviSynth 2.5\plugins\removegrain\RSharpenSSE2.dll") LoadPlugin("D:\Arquivos de programas\AviSynth 2.5\plugins\outros\mt_masktools-26.dll") LoadPlugin("D:\Arquivos de programas\AviSynth 2.5\plugins\outros\AddGrainC.dll") LoadPlugin("D:\Arquivos de programas\AviSynth 2.5\plugins\outros\dither.dll") Import("D:\Arquivos de programas\AviSynth 2.5\plugins\outros\dither.avs") AVCSource("I:\BDMV Symphogear G Vol. 2\BDMV\STREAM\00003.dga") spline64resize(1280,720) dither_convert_8_to_16() gradfun3(lsb_in=true,lsb=true,smode=2) dither_out() |
5th March 2014, 23:24 | #734 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
No idea. If you want to check the speed of the script, use AVSMeter. If you want to check the speed of x264, keep only AVCSource + resize and use 10bit-x264 with 8-bit input.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
7th March 2014, 08:34 | #736 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 712
|
Not right now. This is a serious beast, and I have things to finish before (porting dfttest and eedi3 to 64-bits/VS/Avs+/high bit depth). But I plan to work on it. I think Myrsloik and tp7 are already poking it too.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
9th March 2014, 10:16 | #738 | Link |
Registered User
Join Date: Jan 2012
Location: Toulon France
Posts: 249
|
Hello
When I try Martin53's AWB function, i get error " Unable to call Dither_convert_yuv_to_rgb(). Required dither package 1.23.0 or higher installed ? http://forum.doom9.org/showthread.php?p=1386559" I have writted this short script for checking LoadPlugin("C:\RT_Stats_25&26_dll_v1.30_20131219\Avisynth26\RT_Stats26.dll") LoadPlugin("C:\dither-1.25.1\win32\dither.dll") assert(RT_FunctionExist("""Dither_convert_yuv_to_rgb"""), "Unable to call Dither_convert_yuv_to_rgb().") return last I get the same error. I use avisynth 2.60A5 (CVS 20130920, ICL 10). What is missing ? Thanks |
9th March 2014, 10:58 | #739 | Link |
Yes, I'm weird.
Join Date: May 2010
Location: Southeast Asia
Posts: 271
|
@Bernardd:
Function Dither_convert_yuv_to_rgb is implemented as a script function in dither.avsi, so you need to import dither.avsi or have it in autoload folder.
__________________
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” — Mark Twain |
Tags |
color banding, deblocking, noise reduction |
|
|