View Full Version : AviSynth 2.5.7 RC-1 [Sept 16th]
IanB
17th September 2006, 04:19
Here is release candidate 1 for Avisynth 2.5.7. The intention was for this to be a bug fix release only, but a few minor gems have been slipped in. :)
Notes:- I forgot to turn of the COM environment debugging option when I made this build. The final release version will not have this feature. (It can cause problems with miserable software that employs anti-debugging technology. GRR!)
2.57 Changes from 2.56
Additions
Installer option for avisynth.lib, avisynth.exp and avisynth.map files.
DirectShowSource() now sets _HIRESOUTPUT property of WMAudio Decoder DMO. Allows 24 bit samples and 6 channel decoding.
Avisynth COM object now supports IAVIStreaming interface. Many apps blindly expect it and fail to load AVS scripts.
Conditional Reader now also accepts T, F, Yes and No for bool data.
DirectShowSource() log debug messages to file.
DirectShowSource() force set framecount.
DirectShowSource() accept audio streams of type WAVE_FORMAT_IEEE_FLOAT.
Added KillVideo() verb.
TimeStretch now exposes the tuning parameter of the SoundTouch library.
Adding global OPT_AllowFloatAudio=True to your script enables WAVE_FORMAT_IEEE_FLOAT audio output.
Explicitly request all the channels available in the audio stream [acm AC3]
Explicitly try to request float, 32 bit then 24 bit samples from the audio codec.
Accept raw audio streams of type WAVE_FORMAT_IEEE_FLOAT.
Added installer option to add "Avisynth Script" item to Explorer shell for new .avs file creation.
Added avs_delete_script_environment and avs_subframe_planar to avisynth_c interface.
Hack to allow Fraunhoffer MP3 codec to work when wBitPerSample==16. (Squid_80)
Added portugese translation (by RoLon), and partly french translation (by JasonFly)
Subtitle multi line text, set LSP arg and use \n. (foxyshadis, tateu)
xxxFPS("preset") string preset FPS values. (Tritical)
Better avisynth_c cdecl/stdcall mismatch detection and protection (Tritical).
Bugfixes
Fixed ConvertFPS() blend mode mix_ratio was wrong.
Fixed AviSource() handling of dud AVI files that start with drop frames, just return the first key frame.
Fixed DirectShowSource() handling of pin renegotiation.
Fixed Overlay() "PC_Range" argument handling.
Fixed SubTitle() crash when resources exhausted.
Fixed Resizers cropping argument validation.
Fixed % operator bad argument text message.
Fixed stuffing Audio buffer with video graphics on Exception. Now returns E_FAIL. Video stream subsequently will return error text in graphic form.
Fixed KillAudio() not resetting nchannels and sample type to 0.
Fixed Conditional Reader sscanf buffer overrun.
Fixed Version() and VersionString() timestamp discrepancies.
Fixed Serious inaccuracies in TimeStretch. It is still not sample exact!
Fixed Negative int arg handling for ApplyRange() and Animate().
Fixed Installer handling of readonly/inuse target files.
Fixed ConvertAudio SSE2 to Float alignment test.
Fixed (auto)LoadPlugin altname generation. (Tritical)
Fixed SaveString memory block overrun.
Fixed $Plugin!Functionname!Param$ bug. (Fizick)
Fixed registry handle leak on $PluginDir$ lookup. (Dave Brueck)
Fixed memory leaks avisynth_c.
Fixed returning locked/protected VBF's to LRU. (Tritical)
Fixed runtime mixed SEH/C++ exception handling for XPsp2. (Tritical)
Fixed CAVIStreamSynth::Read audio buffer overrun. (Avery Lee)
Fixed DLL handle leak in LoadPlugin. (Tritical)
Fixed Assert("text") no longer parses % args.
Fixed number parser returning inaccurate float conversions.
Fixed ConvertFPS() blend mode not processing of chroma planes.
Fixed resizer resampling pattern attempted use after deletion.
Fixed resizer subpixel shifting functionality being a noop.
Fixed Info() auto font selection metric.
Fixed Conditional error checking of float RHS.
Corrected colours in YUV ColorBars, Now match BT.801-1.
TCPDeliver updates: Client: Fixed crash if client gets disconnected.
TCPDeliver updates: Server: Remember to disconnect clients when shutdown.
Fixed Turn*() YUY2 mod 2 height test.
Fixed AVISource() corrupted error messages.
Fixed AVISource() direct input drop frame handling.
Optimizations
SubTitle() releases all resources when the last frame of the clip is rendered.
SubTitle() releases GDI resources after text map is created.
ApplyRange() only builds 2 chains instead of 3.
Changes
Map file is now generated for release builds.
ConvertTo*() and GreyScale() now accept "Rec601" as a valid matrix name.
DirectShowSource.dll upx'ed.
Upgrade internal copy of SoundTouch library to 1.3.1.
SoundTouch now available in RelSym build.
Animate Integer arg enumeration no longer rounds toward positive infinity. Both positive and negative enumerations are identical. i.e. For Animate(0, 10, "Foo", 0, 0, 10, -10), Foo's arg1 = -arg2 for all frames.
Selecting associate open with Notepad with .avs files in the installer now also includes .avsi files.
The Installer now pushes a recovery dialog box when unwritable files are encountered during an install. The user may manually correct the problem and retry installing that file.
SetMemoryMax() minimum now 4Mb instead of 16. (Tritical)
Remove 50 plugin auto prescan load limit. (Tritical)
COM QueryInterface calls now return S_OK instead of NULL.
Bracketless call of argless function now get a cache. (Tritical)
Over-range numbers now raise a compile time exception.
xxxFPS(float) now uses continued fraction to generate a minimal rational pair. (Raymod2)
ChangeFPS(linear=true) now raises a compile time exception if the speed change ratio is > 10.
ConvertFPS() blend mode works for all pixel formats. (Tritical)
Info() retrofit of 2.60 updates.
TCPDeliver.dll upx'ed.
RGB ColorBars +Q and -I bars, Hue is now correct, Luma is NOT zero to achive this.
AVISource Audio no longer limited to 2 channels.
SaveString memory blocks are now 32 bit aligned.
Default planar chroma planes mod 16 aligned. See SetPlanarLegacyAlignment().
As usual download from sourceforge (http://prdownloads.sourceforge.net/avisynth2/AviSynth_160906.exe?download)
Mug Funky
17th September 2006, 06:18
sounds good. will try ASAP.
Fizick
17th September 2006, 10:50
avisynth.lib, avisynth.exp and avisynth.map?
It is for c-plugins SDK?
May be to add avisynth.h and avisynth_c.h to them?
IanB
17th September 2006, 11:38
Yes. The map is just so it exists and is bound to the appropriate avisynth.dll
And good idea.
Zarxrax
17th September 2006, 19:35
Wow, some nice fixes and changes in this release, good job!
On the documentation, would it be possible to add a search feature? I think this could be pretty helpful.
Wilbert
17th September 2006, 19:38
On the documentation, would it be possible to add a search feature? I think this could be pretty helpful.
It's just a bunch of html files. How do you propose to do that?
Zarxrax
17th September 2006, 21:23
It's just a bunch of html files. How do you propose to do that?
I honestly don't know, though I have seen it in other documentation that uses html (adobe stuff, for example). I just assumed (incorrectly perhaps) that it might be easy to implement.
IanB
18th September 2006, 04:00
@Wilbert,
Aaahhhhg, you missed your chance. :D
You should have responded :D "Nice of you to volunteer to implement this useful feature" :D
foxyshadis
18th September 2006, 05:12
A .chm! But it's not the easiest thing to get the stupid projects to work. If I can find the right free software that lets you import and compile with no fuss (the microsoft one imports fine, won't compile right!), I'll post it and a project file.
Fizick
18th September 2006, 05:15
Zarxrax,
what do you really want to find? :)
foxyshadis,
IMHO, chm is not optimal solution to maintain,
and we use different language (english-russian) for example.
Suchy
18th September 2006, 11:51
Is Avisynth optimized using by SSE2 (or MMX and SSE)?
I know that there is plugin for MultiThreating, but it isn't stabile and bugless (f. ex. after removing interlace, there appears frames with half of previous and half of next frame)
Zarxrax
18th September 2006, 20:20
Zarxrax,
what do you really want to find? :)
The current documentation is a great reference if you know what you are looking for, but if you don't know what you are looking for, it can be difficult to find anything.
For example, what if I want to adjust the saturation of my video? How would I determine which filter to use, besides reading the descriptions of every one until I find "Tweak"? With a search function, I could just search for "saturation" and expect it to tell me about the Tweak filter.
@others:
I have come across this open-source javascript which appears that it may provide the kind of search functionality that I am talking about: http://www.kscripts.com/scripts.shtml
If this kind of thing seems satisfactory, I could indeed try to implement it myself.
Fizick
18th September 2006, 21:03
may be, we can build and provide some static html file with references to important terms.
Wilbert
18th September 2006, 22:03
A .chm! But it's not the easiest thing to get the stupid projects to work. If I can find the right free software that lets you import and compile with no fuss (the microsoft one imports fine, won't compile right!), I'll post it and a project file.
A chm file is easy to make (there is already such a project file in the CVS, but it just needs to be updated a bit).
@others:
I have come across this open-source javascript which appears that it may provide the kind of search functionality that I am talking about: http://www.kscripts.com/scripts.shtml
If this kind of thing seems satisfactory, I could indeed try to implement it myself.
This could be what we are looking for!
I don't get it completely. You need to install Ksearch and thus perl to build the DBM database. Is it possible to access this database without installing Ksearch (and thus perl)?
Zarxrax
19th September 2006, 03:40
I don't get it completely. You need to install Ksearch and thus perl to build the DBM database. Is it possible to access this database without installing Ksearch (and thus perl)?
You mean for the end user? The "database" is just some stuff formatted into a javascript file, so it should be able to run on any browser that supports javascript.
Prettz
19th September 2006, 07:39
I'm not quite sure what's wrong here. I'm getting some horrible chroma shifting when I use Crop. The same problem was present with 2.5.7a3; I just installed RC1 to make sure and it's there in this version too, and it is. This seems like something so obvious that I'm assuming there's something wrong on my end. It's screwing up the same with "align" set to both true and false.
Here's a script that has it:
MPEG2Source("J:\terminator\terminator_full_01.d2v")
Telecide(order=1,chroma=true,post=0)
Decimate(cycle=5,mode=0)
Crop(2,58,-2,-60)
I've included a screenshot of the original before cropping and the result right after.
Odder still: when I follow the Crop immediately with a LanczosResize(704,352), I don't see any results of chroma shifting anymore.
squid_80
19th September 2006, 09:51
Are you sure it's not your YV12 codec?
GodofaGap
19th September 2006, 10:29
For example, what if I want to adjust the saturation of my video? How would I determine which filter to use, besides reading the descriptions of every one until I find "Tweak"? With a search function, I could just search for "saturation" and expect it to tell me about the Tweak filter.
Most browsers have a text search function (e.g. CTRL+F). If you click on filters page and search for saturation, Tweak is the first thing you'll see. :)
Wilbert
19th September 2006, 19:36
Most browsers have a text search function (e.g. CTRL+F). If you click on filters page and search for saturation, Tweak is the first thing you'll see.
That's within a page. We are talking about offline searching in the AviSynth docs. Thus start in the startpage and search for a keyword in all htmls.
You mean for the end user? The "database" is just some stuff formatted into a javascript file, so it should be able to run on any browser that supports javascript.
You are probably correct, but i can't find it in the faq:
http://www.kscripts.com/ksearch/faqs.html
If i understand it correctly you need to insert the following into one of your htmls (for which i assume you need KSearch):
To add a search box, insert the following HTML code:
<FORM ACTION="http://my_web_site.com/cgi-bin/ksearch/ksearch.cgi" METHOD="GET" NAME="search">
<INPUT TYPE="text" NAME="terms"><INPUT TYPE="submit" VALUE="Search">
</FORM>
or do i misunderstand it completely?
foxyshadis
19th September 2006, 20:51
That's the online ksearch. There's an offline version under it: http://www.kscripts.com/ksearch-client-side/faqs.html
Prettz
20th September 2006, 03:02
Are you sure it's not your YV12 codec?
I would never have imagined something could be wrong with that, but it seems you're right. A ConvertToRGB32() at the end fixes it. I first noticed it when the Crop came before some filters, so I assumed the chroma shifting was happening at the Crop.
The width was mod 4 (which I'm pretty sure has always been fine for raw YV12 before), but if I replace what I posted with Crop(4,58,0,-60,align=true), the chroma shifting isn't there anymore. What could possibly be wrong with my YV12 codec, and how might it have happened?
edit: Nevermind, the chroma shifting IS still there with Crop(4,58,0,-60,align=true), but the effect is much smaller. That doesn't make the problem not confusing as hell, though. Some kind of pitch error I guess. My memory might be bad, but I'm certain I've looked at scripts with mod 4 width before in VD without problems.
IanB
21st September 2006, 04:05
@Prettz,
In VDub make sure Options/Preferences/AVI/"Directly Decode YCbCr (YUV) Sources" is turned on.
The YV12 to RGB converter in some DivX and XviD version is known to require mod 8 or even 16 width to work correctly.
IanB
21st September 2006, 15:48
Hey language team, any chance of some activity in each of the translations before I make this RC-1 the real thing. Russian and English seem the only loved ones.
Kostarum Rex Persia
21st September 2006, 17:22
I hope so. Translation on Serbian language would be very very nice.
Who is in the translation team?
Prettz
21st September 2006, 18:48
@Prettz,
In VDub make sure Options/Preferences/AVI/"Directly Decode YCbCr (YUV) Sources" is turned on.
The YV12 to RGB converter in some DivX and XviD version is known to require mod 8 or even 16 width to work correctly.
Thanks a lot. My VD version is so old it doesn't even have that option, so it's time to get up to date. I wonder what I did to make my VfW YV12 handling go nutty, though.
I know Xvid installs a YV12 codec; doesn't Avisynth install one as well?
Fizick
21st September 2006, 19:28
IanB,
please notify me at last two days before final release,
I must syncronize the Russian with your latest changes
Fizick
21st September 2006, 19:31
I hope so. Translation on Serbian language would be very very nice.
Who is in the translation team?
you can become this member :)
Wilbert
21st September 2006, 21:15
I know Xvid installs a YV12 codec; doesn't Avisynth install one as well?
XviD IS a codec. No, AviSynth doesn't install a codec, you should do that yourself.
Kostarum Rex Persia
22nd September 2006, 02:12
I contacted IanB via PM, so I hope that I will become a member of translation team.
tebasuna51
22nd September 2006, 02:47
Additions
...
DirectShowSource() accept audio streams of type WAVE_FORMAT_IEEE_FLOAT..
...
Maybe a typo?
DirectShowSource(), with ffdshow, accept audio streams of type WAVE_FORMAT_IEEE_FLOAT in v2.5.6. And also with header WAVE_FORMAT_EXTENSIBLE.
WavSource() accept audio streams of type WAVE_FORMAT_IEEE_FLOAT in 2.5.7
Btw, what is the problem to accept WAVE_FORMAT_EXTENSIBLE?
IanB
22nd September 2006, 06:23
@tebasuna51,
Yes it should be "... accept raw audio streams ..."
I am not aware of problems accepting WAVE_FORMAT_EXTENSIBLE please elaborate. This stuff is difficult to test due to the lack of stable sources of data to test against, so simple examples of faults with a logfile are very helpfull.
tebasuna51
23rd September 2006, 00:32
I am not aware of problems accepting WAVE_FORMAT_EXTENSIBLE please elaborate. This stuff is difficult to test due to the lack of stable sources of data to test against, so simple examples of faults with a logfile are very helpfull.
Maybe the problem is the interface (BeHappy), but the error message seems generated in vd_audio.cpp:
Starting job 16_in_ex.wav->16_in_ex_.wav
Error: BeHappy.AviSynthException: No compatible ACM codec to decode 0xFFFE audio stream to PCM.
at BeHappy.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
at BeHappy.Encoder.encode()
When wFormatTag is 0xFFFE (WAVE_FORMAT_EXTENSIBLE) the SubType must be checked, WAVE_FORMAT_PCM or WAVE_FORMAT_IEEE_FLOAT are valid and the audio stream must be processed in consequence.
Also Bepipe don't work but the error message is less sophisticated:
bepipe --script "WavSource(^D:\16_in_ex.wav^)" > output.wav
...
ERROR: Can't find audio stream!
The sample wav used is 16_in_ex.wav (http://www.mytempdir.com/945735)
Ebobtron
23rd September 2006, 11:11
@tebasuna51
you asked, "Btw, what is the problem to accept WAVE_FORMAT_EXTENSIBLE?"
0x0001 WAVE_FORMAT_PCM PCM
0x0003 WAVE_FORMAT_IEEE_FLOAT IEEE float
0x0006 WAVE_FORMAT_ALAW 8-bit ITU-T G.711 A-law
0x0007 WAVE_FORMAT_MULAW 8-bit ITU-T G.711 µ-law
0xFFFE WAVE_FORMAT_EXTENSIBLE Determined by SubFormat
Above is a list of "wFormatTag"s,
WAVE_FORMAT_IEEE_FLOAT, is a valid format outside of WAVE_FORMAT_EXTENSIBLE.
That is why it works with WavSource. When WAVE_FORMAT_EXTENSIBLE is used, the format tag is moved to another location in the header you incorrectly identified as the subtype. The SubFormat member of the WAVEFORMATEXTENSIBLE Structure is not available to AviSource.
WavSource, a subfuction or mode of AviSource, when presented with 0xFFFE as the format tag, goes looking for a decompressor (which it should).
As written and compiled AviSynth doesn't know what WAVE_FORMAT_EXTENSIBLE is unless it is looking though DirectShowSource.
Just took a quick glance at the latest Free PSDK and WAVE_FORMAT_EXTENSIBLE is not in the VFW (Video For Windows) documentation. But it is part of direct show and has been.
If it could be added to the AviSource functions in the future, is beyond my ability to guess. I am still trying to decide what a WAVE_FORMAT_EXTENSIBLE file header is suppose to look like. To me the format is a little vague, but I am pretty dumb.
Hope that helps.
squid_80
23rd September 2006, 11:57
I can think of one problem: it's always possible to convert a wFormatTag to a Subformat GUID, but not the other way around. So I'm not sure how you'd go about handling a GUID which didn't convert easily to a corresponding wFormatTag, without some sort of look-up table for known types (for instance there's about half a dozen different GUID definitions for AC3, while most acm codecs which support AC3 via waveformatex use wFormatTag 0x2000).
Ebobtron
23rd September 2006, 14:41
@squid_80,
The conversions would not be an issue.
The rest of your post shifts over to an apples verses oranges kind of the thing.
Just different uses of the same structure.
squid_80
23rd September 2006, 15:20
My point was it's not just as simple as saying, "Oh it's a WAVE_FORMAT_EXTENSIBLE structure, I'll just convert the SubFormat GUID to a wFormatTag and go looking for an ACM codec to handle it..." since it's not always possible to get a wFormatTag from a GUID. In some cases it's possible, but not always.
Ebobtron
23rd September 2006, 18:05
Sorry IanB,
Thought I could help, I was wrong. Think I'll stick to asking questions.
bye
tebasuna51
23rd September 2006, 18:53
When WAVE_FORMAT_EXTENSIBLE is used, the format tag is moved to another location in the header you incorrectly identified as the subtype. The SubFormat member of the WAVEFORMATEXTENSIBLE Structure is not available to AviSource.
For me the subtype is the first two bytes (WORD) of the field SubFormat (GUID) and have a value 0x0001 (WAVE_FORMAT_PCM) for int samples and 0x0003 (WAVE_FORMAT_IEEE_FLOAT) for float samples.
KSDATAFORMAT_SUBTYPE_PCM 00000001-0000-0010-8000-00aa00389b71
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT 00000003-0000-0010-8000-00aa00389b71
KSDATAFORMAT_SUBTYPE_DRM 00000009-0000-0010-8000-00aa00389b71
KSDATAFORMAT_SUBTYPE_ALAW 00000006-0000-0010-8000-00aa00389b71
KSDATAFORMAT_SUBTYPE_MULAW 00000007-0000-0010-8000-00aa00389b71
KSDATAFORMAT_SUBTYPE_ADPCM 00000002-0000-0010-8000-00aa00389b71
KSDATAFORMAT_SUBTYPE_MPEG 00000050-0000-0010-8000-00aa00389b71
We only need to check 0x0001 and 0x0003 not all possible GUID values.
But if SubFormat is unknown inside AviSource-WavSource we can do nothing. Thanks.
Edit: If we have access to wav header is really easy (if we plan reject anything than PCM or FLOAT) change wFormatTag for this first two bytes of SubFormat. Is used in Aften (http://forum.doom9.org/showthread.php?p=853988#post853988).
Ebobtron
23rd September 2006, 20:42
@ tebasuna51,
I am, again, sorry. You may call a pig a cow, but I may not understand. Others will not either.
I didn't mean to suggest that you didn't know your way around the data types, especially the really big ones.
My suggestion is that you did not understand why AviSynth(WavSource()) would load WAVE_FORMAT_IEEE_FLOAT and not load WAVE_FORMAT_EXTENSIBLE.
Again I am assuming that your asking a question and you would like the answer.
Sorry I has incorrect.
done.
Fizick
24th September 2006, 22:57
It seems, there is some bug in Avisynth smart cache impementation,
see MVTools thread
http://forum.doom9.org/showthread.php?p=867682#post867682
I discovered, that backward and forward vectors clips sometimes swapped after 12 frames.
Version 2.5.5 and v2.5.6beta3 (with not smart cache) works fine with MVDenoise.
I try to find workaround with some SetCacheHints,
but some problem still exists.
Also I remember similar problem with Restore24.
IanB
25th September 2006, 00:31
Btw, what is the problem to accept WAVE_FORMAT_EXTENSIBLE?Okay, to clarify, I take it more fully this question is :-
Why does WavSource() fail to accept WAVE_FORMAT_EXTENSIBLE type files.
The answer to this question is because the code only has access to a WAVEFORMATEX structure not a WAVEFORMATEXTENSIBLE structure, which is required to access the subtype information. The code has been borrowed from VirtualDub a fair while ago. It is very convoluted and may well be lacking some of the graces needed for these newer formats.
Use DirectShowSource("plugh.wav", video=false) to read WAVE_FORMAT_EXTENSIBLE type files.
IanB
25th September 2006, 00:59
@Fizick,
What do you expect the access pattern to be from Denoise_Temporal() in il9ad's post?
Fizick
25th September 2006, 05:12
The MVDenoise bug is reproduced even with simplest script with two motion vectors clips,
see Didйe post http://forum.doom9.org/showthread.php?p=868502#post868502.
The bad news, that MVdegrain is also not bugs-free when seeking backward.
Fizick
25th September 2006, 17:05
test script
avisource("h:\test.avi")
converttoYv12()
assumetff
separatefields().selecteven
i=last
vf=last.invert.mvanalyse(pel=2, blksize=8,isb=false,delta=2)
vb=mvanalyse(pel=2, blksize=8,isb=true,delta=2)
i.mvdenoise(vf,vb,y=true,tht=1000,thmv=1000,thsad=1000)
Try seek frame by frame in VDub, you will see transition at about 50-100 frames.
IanB,
the most bad, that cache miss results in not to slowdown, but to mess of frames!
For MVDenoise, it seems, the SetCacheHints(CACHE_RANGE,3) addition to all VectorsClips corrects the bug.
Have clip arrays get the cache?
And I still disagree with your opinion about plugins writters as complete idiots. :) Why we can not use CACHE_RANGE=0,1,2 ? (It reseted to default.)
What is "access pattern" ? List of frames requested from filter or by filter? I will try to add some debug commands to get the list.
Today I created (and released) bug-fixed MVTools v1.4.12 with debug output for debugview utility.
IanB
26th September 2006, 03:00
the most bad, that cache miss results in not to slowdown, but to mess of frames!Well there is something very wrong here. Rule 1 for GetFrame(n) is that for each n it MUST return exactly the same frame n contents.For MVDenoise, it seems, the SetCacheHints(CACHE_RANGE,3) addition to all VectorsClips corrects the bug.No it just hides the bug. By rule 1 above filters must work correctly (maybe slowly) without the cache.
Why we can not use CACHE_RANGE=0,1,2 ? (It reseted to default.)In the context of the call, 0 and 1 make no sense so I ignore the call. And as a courtesy to avoid boundary conditions 2 is promoted to 3. Probably in the long run we should change the value of the key and fully define it's use and values.What is "access pattern" ? List of frames requested from filter or by filter? I will try to add some debug commands to get the list.Yes access pattern is the list of frames requested by the function for a given input request n.
And the question is what do you expect the list of frames to be, not what you measure. I can debug the filter and see what they are, I need to know what you think it is supposed to be so I can compare reality with theory.
Fizick
26th September 2006, 05:11
The bug is not only wrong frame number n.
Bugged frame N is frame N+1 taken from another vector clip!
avisource("h:\test.avi").converttoYv12().separatefields().selecteven
other=avisource("h:\other.avi").converttoYv12().separatefields().selecteven
i=last
vf=other.mvanalyse(pel=2, isb=false,delta=1)
vb=mvanalyse(pel=2, isb=true,delta=1)
i.mvdenoise(vf,vb,y=true,tht=1000,thmv=1000,thsad=1000)
I try build expected list.
Fizick
26th September 2006, 15:58
src=Avisource("test.avi")
vf=src.MVAnalyse(isb=false)
vb=src.MVAnalyse(isb=true)
MVdenoise(src,vf,vb)
Assumed frames pattern
VirtualDub requested frame 0 from MVdenoise
MVDenoise:
- requested source frame 0 from clip src;
- created new destination frame 0, and copied src frame 0 to it;
- requested frame 0 from motion vector clip vF (it stores both vectors and compensated data);
- requested frame 0 from motion vector clip vB (it stores both vectors and compensated data);
- wait these vectors frames, make some averaging data of src(0), vF(0), vB(0), write it to dest frame 1;
- return dest frame 0.
When MVAnalyse is asked for vF frame 0, it:
- requested src frame 0,
- created new output vector frame 0, with specific video properties (height=0, width=size);
- check if may request frame 0-1=-1 (no); write default data to dest vector clip vF frame 0 with BAD flag;
- return dest vector frame vF(0) (bad)
When MVAnalyse is asked for vB frame 0, it:
- requested src frame 0,
- created new output vector frame 0, with specific video properties (height=0, width=size);
- check if may request src frame 0+1=1 (yes); request src frame 1, analyze motion (1 to 0) and write vectors data and compensated data to dest vector clip vB frame 0 with Good flag;
- return dest vector frame vB(0).
VirtualDub requested frame 1 from MVdenoise
MVDenoise:
- requested source frame 1 from clip src;
- created new destination frame 1, and copied src frame 1 to it;
- requested frame 1 from motion vector clip vF (it stores both vectors and compensated data);
- requested frame 1 from motion vector clip vB (it stores both vectors and compensated data);
- wait these vectors frames, make some averaging data of src(1), vF(1), vB(1), write it to dest frame 1;
- return dest frame 1.
When MVAnalyse is asked for vF frame 1, it:
- requested src frame 1,
- created new output vector frame 1, with specific video properties (height=0, width=size);
- check if may request frame 1-1=0 (yes); request src frame 0, analyze motion (0 to 1) and write vectors data and compensated data to dest vector clip vB frame 1 with Good flag;
- return dest vector frame vf(1)
When MVAnalyse is asked for vB frame 1, it:
- requested src frame 1,
- created new output vector frame 1, with specific video properties (height=0, width=size);
- check if may request src frame 1+1=2 (yes); request src frame 2, analyze motion (2 to 1) and write vectors data and compensated data to dest vector clip vB frame 1 with Good flag;
- return dest vector frame vB(1).
and so on.
So, supposed pattern:
src(0) from MVDenoise
vf(0) from MVDenoise
src(0) from MVAnalyse Forward
vb(0) from MVDenoise
src(0) from MVAnalyse Backward
src(1) from MVAnalyse Backward
src(1) from MVDenoise
vf(1) from MVDenoise
src(1) from MVAnalyse Forward
src(0) from MVAnalyse Forward
vb(1) from MVDenoise
src(1) from MVAnalyse Backward
src(2) from MVAnalyse Backward
src(2) from MVDenoise
vf(2) from MVDenoise
src(2) from MVAnalyse Forward
src(1) from MVAnalyse Forward
vb(2) from MVDenoise
src(2) from MVAnalyse Backward
src(3) from MVAnalyse Backward
may be I am wrong, MVTools has complex internal structure.
(and some hack with callback)
IanB
26th September 2006, 16:24
pRef = child->GetFrame(n + offset, env)->GetReadPtr(PLANAR_Y);
pRefU = child->GetFrame(n + offset, env)->GetReadPtr(PLANAR_U);
pRefV = child->GetFrame(n + offset, env)->GetReadPtr(PLANAR_V);
nRefPitch = child->GetFrame(n + offset, env)->GetPitch(PLANAR_Y);
nRefPitchUV = child->GetFrame(n + offset, env)->GetPitch(PLANAR_U);Code like this is going to cause serious grief every time the cache cannot provide the exact same vfb to each and every call.
You gotta a lot of fix'en to do.
Fizick
26th September 2006, 18:55
This will be better?
ref = child->GetFrame(n + offset, env)
pRef = ref->GetReadPtr(PLANAR_Y);
pRefU = ref->GetReadPtr(PLANAR_U);
pRefV = ref->GetReadPtr(PLANAR_V);
nRefPitch = ref->GetPitch(PLANAR_Y);
nRefPitchUV = ref->GetPitch(PLANAR_U);
It is mostly Manao's code, and I added some parts too :)
Well, I replaced all these in mvanalyse,
but your's cache algo is bugged anyway :)
Kostarum Rex Persia
26th September 2006, 19:36
Feature request for 2.57 final: optimized multi-threaded AviSynth for dual/quad core machines.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.