Log in

View Full Version : AviSynth 2.6.0 RC1 [Jan 14th, 2015]


Wilbert
14th January 2015, 20:17
Here is the 6th official release of Avisynth 2.6!!!

Get AviSynth_150114.exe (6.21MB) (https://sourceforge.net/projects/avisynth2/files/AviSynth_Alpha_Releases/AVS%202.6.0%20RC%201%20%5B150114%5D/) from SourceForge.

I hope you will all help in testing the new features. The documentation is updated, so please check out. For the plugin writers, the FilterSDK (http://avisynth.nl/index.php/Filter_SDK) and the c-api got a big update. I'm sure you will enjoy it. If no bugs will be found we will make it final.

Perhaps you have noted, although Ian submits stuff now and then to sourceforge, I'm not sure he will return to this forum. I'm sure you will notice if he does ;) I marked the differences with respect to alpha5 in bold.

========================
Changelist

Additions
========
* AviSource: added multiple video and audio track support.
* Add IScriptEnvironment::GetVarDef() nothrow version of GetVar().
* Partial 2.6 update of Avisynth_C interface.
* Add current dwAvail{Phys, Virtual} to out of memory error message.
* Add #ifndef KSDATAFORMAT_SUBTYPE_{PCM IEEE_FLOAT} for newer SDK's.
* DirectShowSource support negotiation of non-standard MediaSubTypes "I420", "NV12", "YV24" and "YV16".
* AviSource and DirectShowSource support '+' prefix on pixel_type to handle bad padded planar data.
* Added Eval(clip, string name, string) alias for oop processing of argument.
* DirectShowSource support non-standard pixel types "YV24" and "YV16".
* Info: Audio only clip now creates its own canvas video.
* AviSource: Include packed/padded processing and -ve biHeight logic for compressed input.
* Add Script Functions :- BitLRotate, BitRRotate, BitChange, BitClear, BitSet, BitTest and their asm aliases.
* Add WeaveRows (blit cost) and WeaveColumns (slow) frame combining filters.
* Add AudioDuration() [as float seconds], IsY8(), IsYV411() & PixelType() [as a string] script functions.
* Add Echo and Preroll filters.
* Add IScriptEnvironment::GetAVSLinkage() and DLLExport AVS_linkage for host usage of avisynth.dll.
* DirectShowSource, 2.6 plugin, support pixel types "AYUV" as YV24, "Y41P" and "Y411" as YV411.
* AviSource: Add Full and Auto pseudo pixel_types. Full is all supported. Auto is YV12, YUY2, RGB32, RGB24 & Y8.
* Add "AudioLengthS" [as a string], "Ord" & "FillStr" script functions.
* Add AudioTrim(clip, float, float) audio priority trimming, args in fractional seconds.
* Add Trim(M, Length=N[, Pad=False]) and Trim(M, End=N[, Pad=False]) function overloads for explicit Trimming. Length=0 means zero frame clip. End=0 means end at frame 0.
* Add SeparateRows (zero cost) and SeparateColumns (slow) frame slashing filters.
* Add Script Functions :- Acos, Asin, Atan, Atan2, Cosh, Sinh, Tanh, Fmod, Log10, BitLShift, BitRShiftS, BitRShiftU and Hex.
* Add "ConditionalSelect","csc+[show]b" runtime filter.
* Add dither option to Levels, RGBAdjust & Tweak.
* Add BitAnd(), BitNot(), BitOr() & BitXor() script functions.
* Add StrCmp() & StrCmpI() script functions.
* Add YV24 support for Limiter show option.
* Add "Global OPT_dwChannelMask={int}"
* Add 0x0063F speaker mask for 7.1 WAVE_FORMAT_EXTENSIBLE.
* Add .dll DelayLoad exception texts to crash message formatter.
* ImageWriter, add support for printf formating of filename string, default is ("%06d.%s", n, ext);
* Add avs_get_error(AVS_ScriptEnvironment*); to avisynth_c interface.
* Catch and save AvisynthError text in more avisynth_c entry points, for kemuri-_9.
* Add ScriptName(), ScriptFile(), ScriptDir() functions (WarpEnterprises).
* Add SkewRows filter.
* Histogram, Levels mode, Improve colour of chroma legends.
* ConditionalFilter, teach about string results.
* Add some more "Add/Remove Software" registry keys to the Installer (XhmikosR).
* AviSource: Support both packed and DWORD padded raw planar input like with DSS.
* Add IScriptEnvironment::ApplyMessage()
* Add ImageSourceAnim (Wilbert)
* Support user upgrade to 178 DevIL.dll (They need to manage CRT dependancies).
* ImageSource: palette and compressed bmp images load correctly now (issue 894702) [need 178 DevIL.dll]
* ImageSource: support for other formats like: gif, exr, jp2, psd, hdr [need 178 DevIL.dll]
* Add YV24 mode to ColorBars.
* Add ColorBarsHD based on arib_std_b28.
* C-api usability enhancements from kemuri9 [Work in progress!]
* Add Undefined(), AudioLengthLo(), AudioLengthHi(), IsYV16() & IsYV24() script functions
* Allow newlines (and hence comments) before '{' -- Gavino
* Added IScriptEnvironment::DeleteScriptEnvironment()
* Added Histogram, population clamp % factor for "Levels" mode,
* Histogram, revert "Stereo" mode to YV12, Add "StereoY8" mode,
* AviSource: Support fourcc "GREY" as Y8
* Added support for argument passing and EAX return value to SoftwireHelper.
* Added "Global OPT_VDubPlanarHack=True" to flip YV24 and YV16 chroma planes for old VDub's.
* Added "Global OPT_AVIPadScanlines=True" option for DWORD aligned planar padding
* Added Matrix="AVERAGE" mode.
* Added ContinuedDenominator/ContinuedNumerator(f[]i[limit]i) script functions.
* Tweak: fix MaskPointResizing + put back Dividee ISSE code (use sse=true).
* Added ChromaInPlacement, ChromaOutPlacement and ChromaResample options to planar colour conversions.
* Added MaskHS.
* Source tweaks to get ready for VC8.
* Add Y8 for DevIL, planarize EBMP.
* Planar support for many filters.
* Added Info() time indicator on audio length and video (current frame & total). (2.5.8)
* Added UtoY8 and VtoY8.
* Added more info to Info(). (2.5.8)
* ColorYUV: Added all adjustment parameters as conditional variables "coloryuv_SETTING". Enable by setting conditional=true.
* ConditionalReader: Added support for type String.
* ConditionalReader: Added offset keyword to offset all frame numbers after the keyword.
* Added SincResize() with optional taps parameter (default is 4).
* Added Custom band setting to SuperEQ to allow all 16 bands to be set from script. Usage: SuperEQ(clip,band1, band2, band3....) values are dB in float.
* Added fast 0-1-0 kernel for YV24 to ConvertBacktoYUY2().
* Added core formats: YV24, YV16, Y8, YV411.

Bugfixes
========
* Fixed VideoInfo::Is property to reference image_type (not pixel_type).
* Fixed YV16->YUY2 always ran both mmx and C code.
* Fixed YV12 Blur C code skipping left column.
* Fixed Conditional functions with Y8 referencing non-existant chroma.
* Fixed frame range clamping in ComparePlane (ultim).
* Fixed posible leak with realloc in ConditionalReader (ultim).
* Fixed posible double free in text-overlay (ultim).
* Fixed RGB32 to Y8 pixel right shift from 4th pixel on (Robert Martens).
* Fixed Overlay YV24 Image444 leak.
* Fixed AVISource "AUTO" and "FULL" handling.
* Fixed ImageSource handling of missing ebmp files.
* Fixed DirectShowSource incorrect byte order for unpacking of pixel type "AYUV".
* Fixed HexValue parsing values greater than 7FFFFFFF, now as unsigned hex.
* Fixed ConditionalReader memory overrun parsing bools.
* Fixed ResampleAudio NOP test to compare vi.num_audio_samples, not sample rate.
* Fixed YV24 -> RGB24 overrun cleanup for widths%16 == 5.
* Fixed RGB24 AddBorders with right=0.
* Fixed conditional_functions error message names (Wilbert).
* Fixed Audio cache ac_expected_next regression.
* Fixed ImageSource deal with add 1 to IL_NUM_IMAGES bug (Wilbert)
* Fixed Overlay YV24 V plane conversion.
* Fixed Overlay YV24 mode with shared input clip, needed a MakeWritable.
* Fixed ImageReader upside down TIFF in 178 DevIL. (Wilbert)
* Fixed string+string bug when total length is 4096*K-1.
* Fixed SincResize misuse of "int abs(int)" (Gavino). Fix Lanczos and Blackman sinc use of float == 0.0, use small limit "> 0.000001".
* Fixed Classic mode legend drawing for planar right limit and yuy2 centre line.
* Fixed possible MT race. Use "env->ManageCache(MC_IncVFBRefcount, ...)" in ProtectVFB.
* Fixed SwapYToUV output image size bug for 3 clip case.
* Fixed Crop limit tests for RGB.
* Fixed Overlay yellow tint on rec601 RGB import conversion.
* Fixed YtoUV() output image size bug for 3 clip case.
* Fixed ConvertToPlanar chroma alignment.
* Fixed Levels (RGB) change use of PixelClip(x) to min(max(x, 0), 255).
* Fixed SwapYtoUV yuy2 crash (StainlessS).
* Fixed Overlay saturate UV in add and subtract mode.
* Fixed Info.h range protect display characters (StainlessS).
* Fixed AviSource packed planar import chroma offsets.
* Fixed AviSource NULL GetWritePtr() failure due to premature setting of last_frame.
* Fixed Mask rounding in greyscale calcs (Wilbert), minor refactor.
* Fixed SelectRangeEvery audio snafu (Gavino).
* Fixed LoadPlugin, SaveString of result string.
* Fixed LoadPlugin, use _vsnprintf.
* Fixed LoadVirtualdubPlugin, don't add vdub filter to chain on load failure.
* Fixed rounding in RGB HResize (JoshyD) (affects all resizers)
* Fixed error message name in the filter VerticalReduceBy2
* Fixed SeparateFields() with variable parity input clip (Wilbert)
* Fixed AviSource, cannot cast__int64* to long*, it does not work!
* Fixed ConditionalReader: Don't allow out of range "Range" to overwrite edge values
* Fixed MonoToStereo with stereo sources.
* Fixed MergeChannels with only 1 input clip.
* Fixed AviSource support for negative height DIB format AVI's.
* Fixed Audio cache crashes.
* Fixed resize with YV411, missing code.
* Fixed ConditionalReader rounding with integer interpolation.
* Fixed Softwire SSE2 bugs.
* Fixed SSSE3 CPU detection.
* Fixed SSSE3, SSE4.1 & SSE4.2 detection.
* Fixed Fastwire encoding of instructions that are >2 opcodes (SSSE3+4).
* Fixed _RPT5() macro for debug builds

Optimizations
=============
* Cache auto increase span on sparse misses.
* Cache prevent inactive instances returning VFB early and spoiling active instances hit rate (LaTo).
* ConvertToPlanarGeneric explicit add Cache before chroma rescaler.
* Overlay minor refactor YV12 -> 444 chroma
* Speedup ConvertToMono(), minor refactor MixAudio().
* Change StackVertical/Horizontal to interative instead of recursive, 2^N performace increase for 3 and more clips, i.e. 1 blit total instead of blit(blit(blit(...
* RGBtoY8 Dynamic ASM code, support for RGB24.
* YV24backtoYUY2 Dynamic ASM code.
* UtoY8, VtoY8 abuse subframe, zero cost.
* YV24<->RGB Add SSE2 and SSSE3 code paths, get rid of wide_enough.
* ConvertToYUY2 Add SSE2, MMX restore full speed on platforms with poor ooox.
* ConvertAudio, manage tempbuffer and floatbuffer independantly.
* ConvertAudio, prefer SSE2 over 3DNow for super AMD cores.
* Info.h, full refactor, a good example of "Never look down", thx StainlessS
* DoubleWeaveFrames, If A not writable, try to write to B, else make new frame
* Histogram, fix GetFrame/NewVideoFrame call order
* HResizer, interleave code +4% faster
* YtoUV() Abuse Subframe to snatch the Y plane / UV planes, Derestrict destination colorformat autogeneration.
* ImageSource: Improve thread interlock code
* ConditionalReader/WriteFile: Full refactor.
* Replace _strdup with SaveString in AddFunction (Thanks Gavino)
* SuperEQ: Improve channel unpacking/packing code.
* H-Resize: Use SSE4.1 (movntdqa) loads for use once memory access.
* H-Resize: Added SSE2 horizontal unpacker.
* Resize: Use SSE3 (lddqu) loads for unaligned memory access.
* Added ultra fast vertical PointResizer (64 pixel/cycle).
* Added dynamic SSSE3 vertical resizer (16 pixel/cycle) ~ twice as fast as old MMX.
* Added dynamic SSE2 vertical resizer (16 pixel/cycle).
* Added dynamic MMX vertical resizer (8 pixel/cycle).
* Added SSSE3 version for RGB<->YV24 conversions.
* Added dynamic compiled MMX/iSSE for RGB<->YV24 conversions. Speed is approx 200% of C-code.

See next post for the changes.

Wilbert
14th January 2015, 20:17
Changes
=======
* Bump AVISYNTH_INTERFACE_VERSION to 6. Counter bad use of version 5.
* Changed recursive include protection #define from __AVISYNTH_H__ to __AVISYNTH_6_H__
* Changed mem size elements from signed int to unsigned size_t.
* Removed CACHE_25_* enums.
* Removed AlignedPlanar, FillBorder, ConvertAudio.
* Change CPUF_SSE4_2 to 0x1000 to match VirtualDub. 0x800 reserved for AVX.
* Removed MIN_INT, MAX_INT.
* BMPSize() use mod 4 rowsize for all formats.
* LoadPlugin errs 0x7e and 0x7f have descriptive text.
* Import: Increase full path buffer to MAX_PATH*4 for multi char code pages like CP932 (Chikuzen).
* Throw error when output number of frames will exceed MAXINT.
* BlankClip: Supply useful defaults for new Audio/Video when using a Video/Audio only template clip.
* BlankClip: Use duration from Audio only template as default length for new clip.
* Bob: Retain parity sense of input clip.
* Define new IClip::SetCacheHints cachehint constants.
* Force int call arguments to user script function float params to be explicit floats.
* Splice pass CacheHints through to both children in + and ++ mode.
* WriteFileStart/End save current_frame and set Last.
* ConditionalReader do not ignore syntax errors in input file.
* ImageSourceAnim Pad/Crop images to match first frame (Wilbert)
* ImageSource Add version to messages (Wilbert)
* Initial 2.6 API entry point linkage.
* Use Invoke for graph tail, enhance non-clip output error reporting.
* PopContext when inner block Asserts/throws (maxxon).
* Remove duplicate definitions (Wilbert).
* Enhance non-clip output error reporting.
* Explicitly specify calling sequence as __cdecl for Avisynth softwire routines, (was the compiler default)
* Use env->Invoke("Cache", ...) everywhere instead of Cache::Create_Cache(), allows for Cache to be overloaded by a plugin.
* ConvertToYUY2 Change from 0-1-1 kernel to 1-2-1 kernel.
* Tweak make Interp same units as minSat and maxSat.
* Check HKEY_CURRENT_USER for PluginDir first. (henktiggelaar)
* Make forced, -ve, planar alignment of chroma planes match subsampling.
* Enforce planar alignment restrictions.
* C-api: Remove func sub-struct from AVS_Library struct
* Add error code to plugin load failure message
* Make default planar AVI output packed. Control with OPT_AVIPadScanlines=True.
* WriteFile() now supports unlimited number of unlimited strings. (was 16 by 254 byte strings).
* ConvertToRGB*, make C++ code sample chroma the same as the MMX code i.e. use both pixels.
* ConvertToRGB*, use YV24 path for planar, complain when options are present for YUY2.
* ConvertToYUY2, use YV16 path for planar, complain when options are present for RGB.
see: http://forum.doom9.org/showthread.php?p=1378381#post1378381
* Thread safe code, part 2.
* Correct IClip baked documentation
* Passify compilation error/warnings (XhmikosR)
* for, const, extern and ansi patches for VC2008 (SEt)
* Disable OPT_RELS_LOGGING option
* Change implicit Last parsing for argless, bracketless calls to match bracketed cases. (Gavino)
* DirectShowSource: Support last minute format renegotiation thru IPin::QueryAccept() & Validate the size of the provided directshow buffer.
* Remove non ascii chars from comments.
* Add core stubs for DirectShowSource, TCPServer & TCPSource, report when plugins are missing.
* Add note for original source downloads - SoundTouch
* Add more lineage history to Info()
* Move convertaudio, alignplanar, fillborder & MIN/MAX_INT definitions.
* Run AtExit before dismantling world.
* Change setcachehints definition from void to int. Test IClip version >= 5.
* Move PixelClip definition to avisynth.cpp
* SubTitle, etc, make X & Y options float (0.125 pixel granularity).
* ShowSMPTE() supports all integer FPS and multiplies of drop frame FPS.
* SubTitle, stop overwriting string constants (Gavino).
* SubTitle, improve pixel registration (Gavino).
* Make Info() CPU display hierarchical.
* Thread safe code, part 1.
* SoftwireHelper: explicit hardware exception handling.
* Resize: Moved GetResampleFunction into Resamplefuntion, to allow overrides.
* Resampler: Removed dead stlf code.
* Updated Soundtouch to 1.31 (2.5.8)
* Put dynamic matrix conversion into separate file.
* Moved chroma subsampling to image_type section.
* Added specific error reporting when requesting chromasubsampling with Y8.
* Split up merge and plane Swappers.
* Split up Plane transfers into separate classes.
* Added automatic destination colorspace detection on planar YtoUV.
* Took out greyscale and RGB32<->RGB24 from convert.cpp and placed them in separate files.
* All code assuming UVwidth = Ywidth/2 and similar should be gone.

ARDA
14th January 2015, 22:09
Happy to see that things are moving again:)
Congratulations and
:thanks: to both, for the work you are doing

ARDA

Groucho2004
14th January 2015, 23:28
* Add current dwAvail{Phys, Virtual} to out of memory error message.
The out of memory message looks like this now:

http://s18.postimg.org/s5mfx54ux/Image1.png

For better readability, I would suggest to format the values to MB.

StainlessS
17th January 2015, 21:36
Thank you IanB, much appreciated. :thanks:

zerowalker
18th January 2015, 09:37
Does this means AVI with 2 audio streams can be worked with without having to extract the second stream?

Wilbert
18th January 2015, 14:33
Does this means AVI with 2 audio streams can be worked with without having to extract the second stream?
No, that's not possible. I have no idea how to make that possible, or if it is possible at all without breaking everything.
The functionallity is the same as ffmpegsource. So you can open them one by one (with two avisource calls) if you want to process them both and export them one by one.

zerowalker
18th January 2015, 16:31
No, that's not possible. I have no idea how to make that possible, or if it is possible at all without breaking everything.
The functionallity is the same as ffmpegsource. So you can open them one by one (with two avisource calls) if you want to process them both and export them one by one.

Wait, you mean i can open 2 Avisource from one file.
And tell:

A = Stream 1
B = Stream 2

If so i don't need to export anything for what i am doing.

Wilbert
18th January 2015, 18:05
Yes indeed.

zerowalker
18th January 2015, 18:27
Perfect, that's what i have been waiting for, saves me quite some time:)

Much appreciated to those who made this work:)

real.finder
19th January 2015, 12:30
http://i.imgur.com/ZnEbJZW.png

it still 2.5

StainlessS
20th January 2015, 17:19
It will remain v2.5 folder till v2.6 full version released.

EDIT: Based on reply to similar question answered by IanB (IIRC).

Wilbert
20th January 2015, 19:38
I don't know if the name of the folder will be changed, since the current one seems more convenient to me. When installing a new 2.6 you don't need to look in two folders for deinstalling older versions. Will ask Ianb about it.

pistacho
20th January 2015, 21:14
It may be a good time to change the folder name to "AviSynth" only. Logically change may involve some small complication but only would this time.

vcmohan
21st January 2015, 03:53
Has avisynth.h also been modified?

Wilbert
21st January 2015, 19:53
Has avisynth.h also been modified?
Yes:
* Bump AVISYNTH_INTERFACE_VERSION to 6. Counter bad use of version 5.
* Changed recursive include protection #define from __AVISYNTH_H__ to __AVISYNTH_6_H__
The changes are:

* Add IScriptEnvironment::GetVarDef() nothrow version of GetVar().
* Bump AVISYNTH_INTERFACE_VERSION to 6. Counter bad use of version 5.
* Changed recursive include protection #define from __AVISYNTH_H__ to __AVISYNTH_6_H__
* Changed mem size elements from signed int to unsigned size_t.
* Removed CACHE_25_* enums.
* Removed AlignedPlanar, FillBorder, ConvertAudio.
* Change CPUF_SSE4_2 to 0x1000 to match VirtualDub. 0x800 reserved for AVX.

vcmohan
22nd January 2015, 03:20
Both at Sourceforge anf GiThub I get the older version of avisynth.h

ARDA
22nd January 2015, 09:13
http://avisynth2.cvs.sourceforge.net/viewvc/avisynth2/avisynth/src/core/avisynth.h?revision=1.41

Revision 1.41 - (view) (download) (as text) (annotate) - [select for diffs]
Wed Nov 12 06:37:22 2014 UTC (2 months, 1 week ago) by ianb1957
Branch: MAIN
CVS Tags: HEAD
Changes since 1.40: +75 -127 lines
Diff to previous 1.40
Bump to rev 6. Change CPUF_SSE4_2 to 0x1000 to match VirtualDub. Remove legacy 2.5 cache definitions.
Add IScriptEnvironment::GetVarDef a nothrow GetVar. Use size_t for things that are memory sizes,
ready for 64 bit port.

zerowalker
6th February 2015, 07:02
Can confirm the Audiotrack thing i asked about.

You can do stuff like:

A = Avisource("myvideo",atrack=0)
B = Avisource("myvideo",atrack=1)
A.Mixaudio(B)

(Hope i did that correct now).

Such a feature i have been waiting a long time for, and i thought it wasn't possible as i asked about it.
Very thankful for it to have been implemented:)

martin53
7th February 2015, 17:55
After months of AviSynth abstinence, I just started a V2.6 plugin to substitute AudioGraph. Now I'm struggling with the C++ API, especially the
PClip ok_clip = ConvertAudio::Create(_clip, SAMPLE_INT16|SAMPLE_FLOAT, SAMPLE_FLOAT);
part in the 'AviSynthTwoFiveAudio' doc, encountering a linkage error
Error 1 error LNK2001: Unresolved external symbol ""public: static class PClip __cdecl ConvertAudio::Create(class PClip,int,int)" (?Create@ConvertAudio@@SA?AVPClip@@V2@HH@Z)".
and wondering by what the shortly removed ConvertAudio reference in the AviSynth.h header might have been replaced, as I find no documentation in the AviSynth26RC1 package, and also forum search with keyword 'ConvertAudio' gives no clue.

EDIT: though I also wonder how this worked before, as the lines were inside a #if 0 ... clause. Did anyone write a plugin on this platform yet, or can give a really working examplee?

StainlessS
7th February 2015, 18:16
Dont know about ConvertAudio, but you could take a peek at Waveform by DavidHorman, better than AudioGraph.
http://forum.doom9.org/showthread.php?t=165703

EDIT: Not sure, think you may have had to include Internal.h for the ConvertAudio stuff.

Wilbert
7th February 2015, 23:13
and wondering by what the shortly removed ConvertAudio reference in the AviSynth.h header might have been replaced, as I find no documentation in the AviSynth26RC1 package, and also forum search with keyword 'ConvertAudio' gives no clue.
You need to add either convertaudio.h/convertaudio.cpp to your project or use Invoke:

AVSValue cache_args[1] = { _clip };
PClip ok_clip = env->Invoke("ConvertAudioToFloat", AVSValue(cache_args,1)).AsClip();

martin53
8th February 2015, 09:56
Thank you for the support. I must admit that FilterSDK/GettingStartedWithAudio even says "... It'll require you to include ConvertAudio.cpp ... " but I skipped that and it was just too unexpected one has to include AviSynth source.

Wilbert
10th February 2015, 18:50
Thank you for the support. I must admit that FilterSDK/GettingStartedWithAudio even says "... It'll require you to include ConvertAudio.cpp ... " but I skipped that and it was just too unexpected one has to include AviSynth source.
Yes it says so. The proper way is to use Invoke to convert the audio (then you don't need to include any source file). I will change that.

burfadel
16th February 2015, 07:30
Are any of the changes in Avisynth+ (MT-r1689) included in this Avisynth? It would make sense to merge the two. I realise that Avisynth+ (MT-r1689) is a third party offshoot, but it does work well!

Wilbert
16th February 2015, 19:07
Are any of the changes in Avisynth+ (MT-r1689) included in this Avisynth? It would make sense to merge the two.
I can't answer that. Will ask Ian about his plans.

burfadel
16th February 2015, 22:06
I can't answer that. Will ask Ian about his plans.

Thanks!

martin53
19th February 2015, 18:58
Yes it says so. The proper way is to use Invoke to convert the audio (then you don't need to include any source file). I will change that.

Currently, the code is
if (vi.HasAudio()) {
child->SetCacheHints(CACHE_AUDIO, 4096 * 1024);
PClip aud_clip = ConvertAudio::Create(child, SAMPLE_INT16, SAMPLE_INT16);
}
can you please point out the correct Invoke code for me once? I don't think I understand how to replace the above code yet.

I think it should be
if (vi.HasAudio()) {
child->SetCacheHints(CACHE_AUDIO, 4096 * 1024);
AVSValue invoke_args[1] = { child };
PClip aud_clip = env->Invoke("ConvertAudioTo16bit", AVSValue(invoke_args,1)).AsClip();
}
in my case - but the cache code? and is '_clip' from your post #22 'child' here?:confused:

StainlessS
19th February 2015, 19:29
Looks ok to me but, what do I know :confused:

From docs
Invoke throws IScriptEnvironment :: NotFound if it can't find a matching function prototype.
You should be prepared to catch this unless you know that the function exists and will accept the given arguments.

A few examples (grabbed from MipSmooth - it uses invoke a lot):


try {
AVSValue args[1] = { child };
PClip reduced = env->Invoke("Reduceby2",AVSValue(args,1)).AsClip();
} catch (IScriptEnvironment::NotFound) {
env->ThrowError("MyFilterError: Whoa! Could not Invoke reduce!");
}


ConvertAudio available since v2.5 so try/catch not an issue.

EDIT: On cache, I guess it provides a sensible default, Wilbert seemed to suggest invoke did not require it.
Give it a whirl.

EDIT: I think you will have to make a copy of vi, and copy contents over into it, and then update the audio related stuff.
There might be some weird stuff related to cache that you have to handle for following filters.
EDIT: Although in Prune(), I did not copy vi, just update contents of vi with eg

vi.num_frames=OutFrameCount; // New Length of Output clip in Video Frames
vi.num_audio_samples=vi.AudioSamplesFromFrames(OutFrameCount); // New number of Audio Samples

StainlessS
19th February 2015, 20:55
M53, this seems to work ok, not much testing, does conversion before calling constructor, and just passes everything through untouched.


#include <windows.h>
#include "avisynth.h"

class audiotest : public GenericVideoFilter {
public:
audiotest(PClip _child,IScriptEnvironment* env);
// just pass it on using default audio handler of the ConvertAudioTo16bit filter
// void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env);
~audiotest(){};
};

audiotest::audiotest(PClip _child,IScriptEnvironment* env) : GenericVideoFilter(_child) {
// if(!vi.HasAudio()) env->ThrowError("audiotest: requires Audio"); // we already know it has audio
}

//void __stdcall audiotest::GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) {
// start and count are in multichannel samples, and 'start' is beginning of requested output samples to store @ buf.
// child->GetAudio(buf, start, count, env);
//}

AVSValue __cdecl Create_audiotest(AVSValue args, void* user_data, IScriptEnvironment* env) {
PClip child = args[0].AsClip();
const VideoInfo &vi = child->GetVideoInfo();
AVSValue ret;
if (vi.HasAudio()) {
// child->SetCacheHints(CACHE_AUDIO, 4096 * 1024);
AVSValue invoke_args[1] = { child };
PClip new_clip = env->Invoke("ConvertAudioTo16bit", AVSValue(invoke_args,1)).AsClip();
new_clip->SetCacheHints(CACHE_AUDIO, 4096 * 1024);
ret = new audiotest(new_clip,env);
} else {
ret = child; // return original untouched
}
return ret;
}

extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) {
env->AddFunction("audiotest", "c", Create_audiotest, 0);
return "`audiotest' audiotest plugin";
}


EDIT: Line in blue added, not sure if in correct position, or should it be purple ?

Wilbert
19th February 2015, 22:14
EDIT: On cache, I guess it provides a sensible default, Wilbert seemed to suggest invoke did not require it.
Give it a whirl.
No, not on purpose. env->Invoke does not automatically insert a cache after the filter you invoke, so martin53's plugin might benefit a cache (can't see what his plugin is doing though).

StainlessS
19th February 2015, 22:44
There is some good stuff here on Cache:- http://forum.doom9.org/showthread.php?p=1595750#post1595750

And presumably the line in blue two posts ahead is OKEY-DOKEY (and not on child before Invoke).

martin53
20th February 2015, 22:10
Thanks to you both. Will publish the 1st version now, I think it is good although I haven't performed significant tests on cache alternatives. But I don't experience peculiar slowness, either.

StainlessS
24th February 2015, 23:10
Small prob in colors_rgb.avsi,


global color_palegoldenrod = $EEE8AA
global color_palegoldenrod = $EEE8AA

Color occurs twice in file (have checked by extracting installer, not just my copy).

Wilbert
25th February 2015, 22:26
Color occurs twice in file (have checked by extracting installer, not just my copy).
Fixed it. Thanks.

ultim
9th March 2015, 20:44
Hi,

Among the changes in RC1, many ints in the public interface have been changed to size_ts, in a process to prepare for a 64-bit version. I would like to ask you to reconsider that, and revert those changes. The reason is, even though "official" AviSynth has never before supported x64, there are still a relatively large number of 64-bit plugins. These have existed for a long time, long before AviSynth+ (and some more sprouted after Avs+). These changes break all those plugins. Worse, these changes break those plugins without any real benefit. Changing frame offsets and datasizes to size_t, these can now hold values larger than 2GBs in 64-bit mode, but what video has a plane (or frame) size of 2GB? To summarize, I don't think these changes bring real value, but they necessitate the recompilation of all existing x64 plugins. Please consider reverting these changes.

TheFluff
9th March 2015, 22:34
I'm pretty sure those changes are necessary for VapourSynth interoperability, though! (VS uses separate pointers for the planes instead of storing offsets.)

there are still a relatively large number of 64-bit plugins

[citation needed]

I'm also pretty sure the quality of the porting of most of the x64 plugins that actually do exist is rather low (and by that I mean someone just commented out everything that didn't work).

ultim
9th March 2015, 23:37
I'm pretty sure those changes are necessary for VapourSynth interoperability, though! (VS uses separate pointers for the planes instead of storing offsets.)
So the x64 rc1 broke all its own plugins just so they can be also loaded in a completely different system if they are ever recompiled?


there are still a relatively large number of 64-bit plugins
[citation needed]
No problem: [1] (http://code.google.com/p/avisynth64/wiki/PluginLinks), [2] (http://forum.doom9.org/showthread.php?t=169832), [3] (http://forum.doom9.org/showthread.php?t=152800), [4] (http://members.optusnet.com.au/squid_80/), [5] (http://desktop2ch.tv/avi/1383985211/), [6] (http://web.archive.org/web/20130922222259/http://yo4kazu.110mb.com/)

Edit: Added 6th link. This one is archive.org, but all the download links still work if you copy them.

real.finder
1st April 2015, 22:38
I note that some filters that work yv12 work also with yv411 but with Garbage chroma like TFM() or both luma and chroma, Is this ok?

StainlessS
1st April 2015, 23:13
Not sure what you are saying there but I'll take a guess.
I'm guessing that you have only just tried out v2.6 for the first time.
v2.5 filters (compiled with v2.5 Avisynth.h version 3) cannot tell the difference between YV12 and other planar formats.
If processing eg YV24 then the header used would give chroma rowsize and height as if for YV12, and the returned
chroma might appear only in the Top Left Hand side quarter of the frame, the rest of the frame may (or may not) contain
garbage chroma EDIT: 3/4 garbage chroma depends upon whether plugin does 'in-place' changes or creates new
chroma plane (garbage).
You can only use v2.6 planar compatible plugins with Avisynth v2.6 additional colorspaces.

real.finder
1st April 2015, 23:41
Not sure what you are saying there but I'll take a guess.
I'm guessing that you have only just tried out v2.6 for the first time.
v2.5 filters (compiled with v2.5 Avisynth.h version 3) cannot tell the difference between YV12 and other planar formats.
If processing eg YV24 then the header used would give chroma rowsize and height as if for YV12, and the returned
chroma might appear only in the Top Left Hand side quarter of the frame, the rest of the frame may contain garbage.
You can only use v2.6 compatible plugins with Avisynth v2.6 additional colorspaces.

I see

I used 2.6 (SEt mt) for a years but with yv12 all the time, but now I deal with a yv411 source and just note that

:thanks: