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. |
|
|
Thread Tools | Search this Thread | Display Modes |
3rd December 2008, 16:48 | #1021 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Hmm, no success until I tried L6 and L7 - both of which work whereas L4 and L5 don't. Not sure why.
Code:
SetMTmode(mode=5,threads=1) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216 SetMemoryMax(256) LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-xxx\AGC.dll") AviSource("G:\HDTV\capt\capt-type1.08-11-30_20-39.00.avi", audio=false) AssumeFPS(25) AssumeBFF() original=LAST #L1 = original.SeparateFields().HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0).Weave() #L2 = original.MTi("HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0)") #L3 = original.SeparateFields() #L3e = L3.SelectEven().AGCiEmbedded() #L3o = L3.SelectOdd().AGCiEmbedded() #L3 = Interleave(L3e,L3o).Weave() #L4 = original.MTi("AGCiEmbedded()") #L5 = original.MTi("Gavino()") #L6 = original.AssumeBFF().MTi("Gavino()") L7 = original.AssumeBFF().MTi("AGCiEmbedded()") #L1 #L2 #L3 #L4 #L5 #L6 L7 function Gavino(clip srcclp) { return srcclp.HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0) } function AGCiEmbedded(clip srcclp) { inpclp = srcclp # other processing inpclp=inpclp.HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0) return inpclp } |
4th December 2008, 12:04 | #1024 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
And is the failure always the same - 'Invalid arguments to function "HDRAGC" '?
That suggests that 'srcclp' is not a clip, but if that's the case I would expect 'Invalid arguments to function AGCiEmbedded' instead and the function would never be called. What happens if you replace HDRAGC by something else? (Perhaps even a dummy function with the same interface.) I suspected a threading problem but I have had a quick look at the source code of Mti and it looks like this bit (setting up the parallel filter chains) is single-threaded. Can anyone familiar with the internal workings of MT shed some light on what is going on? |
4th December 2008, 14:05 | #1025 | Link | |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Quote:
It sort of seems like minor data corruption or omission about remembering xFF setting when a clip variable hasn't had an explicit AssumexFF() and when it gets fed into MTi. When a clip variable has an AssumexFF() applied to it, then it seems to follow though into MTi OK. |
|
4th December 2008, 18:41 | #1026 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
What if you remove this first line:
SetMTmode(mode=5,threads=1) ?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
4th December 2008, 22:08 | #1027 | Link | ||
Interested Newbie
Join Date: Jun 2007
Location: Sopron, Hungary
Posts: 39
|
Quote:
Quote:
|
||
4th December 2008, 22:40 | #1028 | Link |
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
Avisource, mpeg2source, whateversource
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
5th December 2008, 00:32 | #1029 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
SetMTMode: more than one frame is processed at the same time. MT/MTi: different parts of the same frame are processed at the same time (and then joined together). |
|
5th December 2008, 16:00 | #1030 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
@halsboss
Can you consistently reproduce your problem? I tried (using the latest MT and special Avisynth) and was unable to do so. Everything worked as it should. Is it possible that your failures were done with the function having an optional clip parameter? Code:
function AGCiEmbedded(clip "srcclp") { ... |
5th December 2008, 22:56 | #1031 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Hi and thanks for looking at it. Post 1021 http://forum.doom9.org/showpost.php?...postcount=1021 was a snipped version of the the actual script, no quotes in
Code:
function AGCiEmbedded(clip srcclp) { I'll check on the latest download of HDRAGC and try it again. Last edited by halsboss; 5th December 2008 at 23:15. |
5th December 2008, 23:24 | #1032 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
That's got me. It failed across reboots then. Now the script below works !! And it looks the same to me as the above. Nothing changed in the meantime except that Trend internet security updated itself and I had to recreate the script below.
I guarantee that I swapped back and forth between L5,L6 and L7,L8 etc a number of times to check it and got the error in one and not the other. I'l terribly upset about it. Code:
SetMTmode(mode=5,threads=1) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216 SetMemoryMax(256) LoadPlugin("C:\Program Files\AviSynth 2.5\plugins-xxx\AGC.dll") AviSource("G:\HDTV\capt\capt-type1.08-11-30_20-39.00.avi", audio=false) AssumeFPS(25) AssumeBFF() original=LAST #L1 = original.SeparateFields().HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0).Weave() #L2 = original.MTi("HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0)") #L3 = original.SeparateFields() #L3e = L3.SelectEven().AGCiEmbedded() #L3o = L3.SelectOdd().AGCiEmbedded() #L3 = Interleave(L3e,L3o).Weave() #L4 = original.MTi("AGCiEmbedded()") L5 = original.MTi("Gavino()") #L6 = original.AssumeBFF().MTi("Gavino()") #L7 = original.AssumeBFF().MTi("AGCiEmbedded()") #original=LAST.assumebff() #L8 = original.MTi("AGCiEmbedded()") #L1 #L2 #L3 #L4 L5 #L6 #L7 #L8 function Gavino(clip srcclp) { return srcclp.HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0) } function AGCiEmbedded(clip srcclp) { inpclp = srcclp # other processing inpclp=inpclp.HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0) return inpclp } Last edited by halsboss; 5th December 2008 at 23:58. |
6th December 2008, 00:05 | #1033 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
Memory corruption, uninitialised data, timing dependency, etc. I doubt that the nature of your source file or even the version of HDRAGC is a factor, since the error in question is produced at 'compile-time' by the Avisynth script interpreter (no frames have yet been requested) and the evidence suggests it never gets as far as entering HDRAGC. The problem possibly lies in the modifications to the parser for the MT version of Avisynth. Did you try Fizick's suggestion of removing SetMTMode altogether? |
|
6th December 2008, 00:54 | #1034 | Link |
likes to tinker
Join Date: Jan 2004
Location: girt by sea
Posts: 635
|
Yes, I am sure. I really can't believe it. I'll be testing it every day for a while. I'll try the setmtmode removal and see what happens. Next time I have an anomalous encounter I'll test it out on a second PC.
EDIT tried with and without setmtode, all works fine every time. Still can't believe it. Last edited by halsboss; 6th December 2008 at 04:00. |
6th December 2008, 21:03 | #1036 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
MTi is like MT, except that the frames, instead of being split in half vertically or horizontally, are separated into fields. A very good pictorial description of the differences between SetMtMode and MT can be found here. For MTi, the picture would be different because of what I just said, but the principle is the same. |
|
8th December 2008, 09:43 | #1037 | Link | |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,699
|
Okay, I am a little unsure about posting this here, but I have discovered a "bug". The reason I use quotes is I am, again, a little unsure about the circumstances.
I originally discovered it while converting a Blu ray to DVD. I indexed the source m2ts using DGAVCindex, and created an avs file containing this: Quote:
Two error windows pop up as you can see. It took a me a little while, but I did narrow it down. It seems the problem lies with DGAVCIndex, and it partner dll. When I load a file indexed with DGAVCindex, and use Setmtmode(), I get the crash. This is immediately apparent when HD material is used. On SD material, it is a little more isolated, but if you job around on the seek bar, it happens as well. I do not know the exact cause of the error, or which program is at fault. So I thought I would post it here to start out. This is on Windows XP SP3 x86, stock Q6600, 4gb ram. |
|
8th December 2008, 14:54 | #1038 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Here's an odd thing. Run this script
Code:
function f(clip c) { global n = n+1 return c } SetMTMode(1, 3) global n = 0 BlankClip() MTi("f()") Subtitle((string(n)) It's not surprising it is called more than once, as that is what MTi() is advertised to do, but I would expect n=2. The result is independent of the parameters passed to SetMTMode - again, to be expected since MT is documented as always setting MT mode temporarily to 5. But removing the SetMTMode altogether produces the 'expected' result n=2. (Calling f directly instead of via MTi gives n=1, independent of SetMTMode settings.) If the MTi line is changed to MT("f()", k) for any integer k, the function is called 2*k times instead of the expected k. I'm not sure if this is a bug or a feature, but it's certainly surprising. It may or may not have anything to do with the problem reported by halsboss (post #1021), but at least it shows that strange things can happen with user functions and MT/MTi when SetMTMode is also used. |
Thread Tools | Search this Thread |
Display Modes | |
|
|