<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://avisynth.nl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ChiDragon</id>
		<title>Avisynth wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ChiDragon"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Special:Contributions/ChiDragon"/>
		<updated>2026-05-24T07:48:02Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.24</generator>

	<entry>
		<id>http://avisynth.nl/index.php/Filter_SDK/SDK_history</id>
		<title>Filter SDK/SDK history</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Filter_SDK/SDK_history"/>
				<updated>2016-10-10T22:37:57Z</updated>
		
		<summary type="html">&lt;p&gt;ChiDragon: Fix &amp;quot;modifyed&amp;quot; typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;quot;Writing Avisynth plugins&amp;quot; article was written by Ben Rudiak-Gould (Avisynth creator). It was taken from AviSynth 1.0 documentation as it was (year 2000) at http://math.berkeley.edu/~benrg/avisynth-extensions.html (Ben's home page). The current (November 2006) mirror is at http://www.neuron2.net/www.math.berkeley.edu/benrg/avisynth-extensions.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Preliminary version of AviSynth 2.0-2.5 FilterSDK documentation has been created at 2003 as a section of AviSynth online (wiki) documentation at the official AviSynth site www.avisynth.org (maintained by Richard Berg).&lt;br /&gt;
&lt;br /&gt;
{{Underline|Developers:}}&lt;br /&gt;
&lt;br /&gt;
* Klaus Post ('sh0dan'):&lt;br /&gt;
: AviSynthTwoFiveAudio, AviSynthTwoFivePixelType, AviSynthTwoFiveSDK, ChangeFrameSize, ColorSpaces, DataAlignment, DataStorageInAviSynth, EnvInvoke, EnvSaveString, SimpleMmxOptimization, TwoFiveInvert, TwoFiveFastInvert and some other wiki pages.&lt;br /&gt;
* Wilbert Dijkhof ('Wilbert'):&lt;br /&gt;
: CompilingAvisynth and some other wiki pages.&lt;br /&gt;
&lt;br /&gt;
{{Underline|Contributors:}}&lt;br /&gt;
&lt;br /&gt;
* Simon Walters ('SiWalters'):&lt;br /&gt;
: SimpleSample 1.0 to 1.7 wiki pages.&lt;br /&gt;
* 'trevlac':&lt;br /&gt;
: SimpleSampleClass wiki page.&lt;br /&gt;
* Avery Lee ('phaeron'):&lt;br /&gt;
: Some texts in AssemblerOptimizing wiki pages, &amp;quot;as freely available for any use&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thanks to other Avisynth community people for wiki pages improving/correction! &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The package of off-line (HTML) AviSynth external FilterSDK documentation version 2.5.7 was created at 2006 at sourceforge.net CVS for distribution with AviSynth v2.5.7 installation.&lt;br /&gt;
&lt;br /&gt;
Most documents were converted from wiki pages (some modified/updated). Some new documents are added too.&lt;br /&gt;
&lt;br /&gt;
{{Underline|Developer:}}&lt;br /&gt;
&lt;br /&gt;
* Alexander Balakhnin ('Fizick'):&lt;br /&gt;
: SDKNecessaries, SDKLicense, SDKHistory, wiki pages converting/editing.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
FilterSDK documentation has been reposted to the new Avisynth mediawiki in 2007.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Back to [[Filter SDK]].&lt;br /&gt;
&lt;br /&gt;
[[Category:FilterSDK]]&lt;/div&gt;</summary>
		<author><name>ChiDragon</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Removing_blended_film_frames_on_vcds</id>
		<title>Removing blended film frames on vcds</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Removing_blended_film_frames_on_vcds"/>
				<updated>2014-01-02T20:49:19Z</updated>
		
		<summary type="html">&lt;p&gt;ChiDragon: Forgot formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For anyone who owns films on NTSC VCD's and has done a frame by frame playback, it can be easily seen that two consecutive frames out of every five frames are blended with adjacent frames. This is done to match the speed of film to NTSC video. Film plays at 24 frames per second, while video plays at 30 frames per second. To match the speeds, one new film frame must be added to every four existing frames. The process is similar, although simpler, than telecine, so if you want to understand how the blending procedure is undertaken, search for 'telecine'. The difference is instead of interlaced frames, you have blended frames. If you want to recover the original frames, problems arise, because one doesn't exist.&lt;br /&gt;
&lt;br /&gt;
Here is an example: the VCD film frames will be listed as numbers, and the corresponding 'film' frames will be listed as letters. Where letters are doubled up, that means the frame is complete.&lt;br /&gt;
&lt;br /&gt;
 VCD Frames     1    2    3    4    5&lt;br /&gt;
 Film Frames    aa   bb   bc   cd   dd&lt;br /&gt;
&lt;br /&gt;
Frames a, b and d are kept in their entirety. But frame c is not. It is blended into 2 different frames, but there is no independent copy. So it must be recovered digitally.&lt;br /&gt;
&lt;br /&gt;
This is how it's done. Frame 3 consists of an even blend of frames b and c. Since we have a complete version of frame b, we can '[[Subtract|subtract]]' that image from the blended frame, leaving behind frame c. Frame b has to be reduced to 50% effectiveness in the subtraction, because only 50% of frame 3 is frame b, the other 50% is frame c. Likewise, frame 4, consisting of frames c and d, can subtract frame d (which is complete in frame 5) to leave behind a second version of frame c.&lt;br /&gt;
&lt;br /&gt;
This redundancy is not entirely necessary, however it is recommended because video compression noise affects the restored frames' appearance. By combining the two restorations, the majority of video noise is hidden.&lt;br /&gt;
&lt;br /&gt;
So here is the code:&lt;br /&gt;
&lt;br /&gt;
 Function DeBlend (clip Last) {&lt;br /&gt;
     First = [[SelectEvery]] (5, 0)&lt;br /&gt;
     Second = SelectEvery (5, 1)     # Frames a, b and d get passed through untouched.&lt;br /&gt;
     Fourth = SelectEvery (5, 4)&lt;br /&gt;
     Third1 = [[Subtract]] (SelectEvery (5, 2), &lt;br /&gt;
       \ Second.[[Levels]] (0, 1, 255, 128, 255)).Levels (0, 1, 127, 0, 255)&lt;br /&gt;
     Third2 = Subtract (SelectEvery (5, 3), &lt;br /&gt;
       \ Fourth.Levels (0, 1, 255, 128, 255)).Levels (0, 1, 127, 0, 255)&lt;br /&gt;
 &lt;br /&gt;
 # Recovering frame c from the blends by subtraction. Note that the first Levels' &lt;br /&gt;
 # halfs the range of frames b and d.&lt;br /&gt;
 # The second Levels' boosts each restoration of frame c from 50% value to 100%.&lt;br /&gt;
 &lt;br /&gt;
     # Blend the two versions of frame c together to get the most accurate restoration&lt;br /&gt;
     Third = [[Overlay]] (Third1, Third2, mode = &amp;quot;blend&amp;quot;, opacity = 0.5)    &lt;br /&gt;
     # Re-integrate the restored frame into the other frames.&lt;br /&gt;
     [[Interleave]] (First, Second, Third, Fourth)   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This code is effective, but not perfect. It does not perform noise reduction - other than the simplistic and not very effective blending of the different versions of the frames - nor can it detect which frames are blended. It assumes the 3rd and 4th frames out of every 5 are blended, but many poorly mastered VCDs break this pattern, in which case, this function is useless.&lt;br /&gt;
&lt;br /&gt;
For broken cadences, use one of the [[External_filters#Fieldblending_and_Frameblending_removal|frameblending removal]] filters that is specifically designed for this type of film -&amp;gt; NTSC -&amp;gt; blend recovery (i.e. ExBlend, Srestore with a string for ''omode'').&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>ChiDragon</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Removing_blended_film_frames_on_vcds</id>
		<title>Removing blended film frames on vcds</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Removing_blended_film_frames_on_vcds"/>
				<updated>2014-01-02T20:47:48Z</updated>
		
		<summary type="html">&lt;p&gt;ChiDragon: Auto filters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For anyone who owns films on NTSC VCD's and has done a frame by frame playback, it can be easily seen that two consecutive frames out of every five frames are blended with adjacent frames. This is done to match the speed of film to NTSC video. Film plays at 24 frames per second, while video plays at 30 frames per second. To match the speeds, one new film frame must be added to every four existing frames. The process is similar, although simpler, than telecine, so if you want to understand how the blending procedure is undertaken, search for 'telecine'. The difference is instead of interlaced frames, you have blended frames. If you want to recover the original frames, problems arise, because one doesn't exist.&lt;br /&gt;
&lt;br /&gt;
Here is an example: the VCD film frames will be listed as numbers, and the corresponding 'film' frames will be listed as letters. Where letters are doubled up, that means the frame is complete.&lt;br /&gt;
&lt;br /&gt;
 VCD Frames     1    2    3    4    5&lt;br /&gt;
 Film Frames    aa   bb   bc   cd   dd&lt;br /&gt;
&lt;br /&gt;
Frames a, b and d are kept in their entirety. But frame c is not. It is blended into 2 different frames, but there is no independent copy. So it must be recovered digitally.&lt;br /&gt;
&lt;br /&gt;
This is how it's done. Frame 3 consists of an even blend of frames b and c. Since we have a complete version of frame b, we can '[[Subtract|subtract]]' that image from the blended frame, leaving behind frame c. Frame b has to be reduced to 50% effectiveness in the subtraction, because only 50% of frame 3 is frame b, the other 50% is frame c. Likewise, frame 4, consisting of frames c and d, can subtract frame d (which is complete in frame 5) to leave behind a second version of frame c.&lt;br /&gt;
&lt;br /&gt;
This redundancy is not entirely necessary, however it is recommended because video compression noise affects the restored frames' appearance. By combining the two restorations, the majority of video noise is hidden.&lt;br /&gt;
&lt;br /&gt;
So here is the code:&lt;br /&gt;
&lt;br /&gt;
 Function DeBlend (clip Last) {&lt;br /&gt;
     First = [[SelectEvery]] (5, 0)&lt;br /&gt;
     Second = SelectEvery (5, 1)     # Frames a, b and d get passed through untouched.&lt;br /&gt;
     Fourth = SelectEvery (5, 4)&lt;br /&gt;
     Third1 = [[Subtract]] (SelectEvery (5, 2), &lt;br /&gt;
       \ Second.[[Levels]] (0, 1, 255, 128, 255)).Levels (0, 1, 127, 0, 255)&lt;br /&gt;
     Third2 = Subtract (SelectEvery (5, 3), &lt;br /&gt;
       \ Fourth.Levels (0, 1, 255, 128, 255)).Levels (0, 1, 127, 0, 255)&lt;br /&gt;
 &lt;br /&gt;
 # Recovering frame c from the blends by subtraction. Note that the first Levels' &lt;br /&gt;
 # halfs the range of frames b and d.&lt;br /&gt;
 # The second Levels' boosts each restoration of frame c from 50% value to 100%.&lt;br /&gt;
 &lt;br /&gt;
     # Blend the two versions of frame c together to get the most accurate restoration&lt;br /&gt;
     Third = [[Overlay]] (Third1, Third2, mode = &amp;quot;blend&amp;quot;, opacity = 0.5)    &lt;br /&gt;
     # Re-integrate the restored frame into the other frames.&lt;br /&gt;
     [[Interleave]] (First, Second, Third, Fourth)   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This code is effective, but not perfect. It does not perform noise reduction - other than the simplistic and not very effective blending of the different versions of the frames - nor can it detect which frames are blended. It assumes the 3rd and 4th frames out of every 5 are blended, but many poorly mastered VCDs break this pattern, in which case, this function is useless.&lt;br /&gt;
&lt;br /&gt;
For broken cadences, use one of the [url=http://avisynth.nl/index.php/External_filters#Fieldblending_and_Frameblending_removal]frameblending removal[/url] filters that is specifically designed for this type of film -&amp;gt; NTSC -&amp;gt; blend recovery (i.e. ExBlend, Srestore with a string for ''omode'').&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>ChiDragon</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/Srestore</id>
		<title>Srestore</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Srestore"/>
				<updated>2013-12-08T23:18:08Z</updated>
		
		<summary type="html">&lt;p&gt;ChiDragon: 2.7f -&amp;gt; 2.7f+ (as in g)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat|External_filters|Restoration_filters|Deblenders}}&lt;br /&gt;
{{Filter|MOmonster|2.7e, 2.7g| '''2.7e:''' [[Media:srestore.avsi|srestore.avsi]]&lt;br /&gt;
'''2.7g:''' [[Media:srestore_27g.avsi|srestore_27g.avsi]]|Deblenders|&lt;br /&gt;
* YV12&lt;br /&gt;
|}}&lt;br /&gt;
{{Template:FuncDef|        srestore(clip source, float ''frate'', int ''dmode'', ''omode'', float ''blocks'', int ''mthresh'', int ''bthresh'', bool ''chroma'', int ''cache'', float ''rr'', clip ''dclip'') }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
[[Srestore]] is the replacement function for [[mrestore]], Cdeblend, FixBlendIVTC and DupHq from the [[R_pack]]. It is an AviSynth script function that uses conditional frame evaluation for the output calculation. Generally it was written to undo norm-conversions with blends, but the last version can be useful for decimation ratios between 5 and 1 using the ''frate'' parameter.&lt;br /&gt;
&lt;br /&gt;
Important note: Srestore 2.7e can only be called one time in any script due to its use of global variables.&lt;br /&gt;
Srestore 2.7f+ can be called as many times as you like. This is hopefully the only functional difference.&lt;br /&gt;
&lt;br /&gt;
== Requires Filters ==&lt;br /&gt;
*[[MaskTools2]]&lt;br /&gt;
*[[TIVTC]] Version 1.04 or higher (only for cache&amp;gt;0, not default)&lt;br /&gt;
*[[RemoveGrain]]   (only for double-blend-removal, not default)&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?p=1129919#post1129919 Average]       (only for double-blend-removal, not default)&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=139337 GRunT] Version 1.0.1 or higher (only for v2.7f+)&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
{{Par|frate|float|optional}}&lt;br /&gt;
You don't need to set the decimation parameters for the norm conversions restoring Pal_to_NTSC (50-&amp;gt;23.976 or 25-&amp;gt;11.988) and NTSC_to_Pal (59.94-&amp;gt;25 or 29.97-&amp;gt;12.5), but for some seldom other blend conversion (for example 29.97 back to 23.976 or 50 to 25 - DEFT). Use frate to set the wanted output-framerate. If source-framerate/frate &amp;gt;5 or &amp;lt;1 the output-framerate will be the same as the input-framerate. This can be useful if you want to have only the dup functionality of srestore.&lt;br /&gt;
&lt;br /&gt;
{{ParR|omode|string|6|0-6 or mode}}&lt;br /&gt;
Srestore can be used as blend-decimation-function, as simple deblend-function and for double-blend-removal&lt;br /&gt;
: 1   - deblend-mode 1        -&amp;gt; detected blends will be replaced with the previous frame&lt;br /&gt;
: 2   - deblend-mode 2        -&amp;gt; next frame is used instead of the detected blend&lt;br /&gt;
: 3   - deblend-mode 3        -&amp;gt; detected blends will be replaced with the neighbour that has the smaller difference&lt;br /&gt;
: 4   - deblend-mode 4        -&amp;gt; use the neighbour with the smaller blend-possibility&lt;br /&gt;
: 5   - deblend-special       -&amp;gt; outputs the one of four frames with the smallest blend-possibility&lt;br /&gt;
: &amp;gt;5  - blend-decimation      -&amp;gt; for all decimation operations&lt;br /&gt;
&lt;br /&gt;
The output-modes 1-5 are simple deblending modes, so the framerate will not change.&lt;br /&gt;
            &lt;br /&gt;
To enable the double-blend-removal you have to set a string for omode. This string decides about the postprocessing mode that is used on the restored frames:&lt;br /&gt;
: pp0 -&amp;gt;  the fastest mode, no postprocessing&lt;br /&gt;
: pp1 -&amp;gt;  use difference masking, higher quality and still good speed&lt;br /&gt;
: pp2 -&amp;gt;  use a special blurring mask on luma and chroma that reduces artefacts&lt;br /&gt;
: pp3 -&amp;gt;  combines postprocessing 1 and 2   -&amp;gt; slowest&lt;br /&gt;
&lt;br /&gt;
You can add also your own postprocessing to these modes. Just add your function like this:&lt;br /&gt;
&lt;br /&gt;
 omode=&amp;quot;pp3.blur(1)&amp;quot;		   -&amp;gt; pp3 + blurring&lt;br /&gt;
If you want to add a function with its own inputstrings use three quotation marks:&lt;br /&gt;
 omode=&amp;quot;&amp;quot;&amp;quot;pp2.deen(&amp;quot;a2d&amp;quot;)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Important Note: Also the double-blend-removal does no decimation. It's created only for double-blends caused by blend deinterlacing of telecined sources. You have to add an decimation function for full restoring:&lt;br /&gt;
&lt;br /&gt;
 source                          #progressive&lt;br /&gt;
 srestore(dmode=-4,omode=&amp;quot;pp0&amp;quot;)&lt;br /&gt;
 decimate(cycle=5,quality=0)     #recommed decimating&lt;br /&gt;
&lt;br /&gt;
{{ParR|speed|int|9|-25-25}}&lt;br /&gt;
With the speed parameter you can set a speed-vs-detail-detection value. If you set speed=25, only one of 25 pixels (5*5) is used for the detection. Higher values result in a lower possibility of low-detail detection. Set a negative speed value for high quality and hd sources. This can improve the detection of small details.&lt;br /&gt;
&lt;br /&gt;
{{ParR|mode|int|2|1-3}}&lt;br /&gt;
With the mode parameter you can decide if chroma should be used for detection and if srestore have to merge neighboured frames or look for dups to improve output quality:&lt;br /&gt;
: 1   - simple output mode, decimation is not touched&lt;br /&gt;
: 2   - duping feature, if a frame has a dup-neighbour, that seems to have a higher quality, this one will be outputed&lt;br /&gt;
: 3   - like 2 but the duplicates will be merged&lt;br /&gt;
: &amp;gt;3  - mode 2 and 3 combined&lt;br /&gt;
By setting the compatible negative values, the chroma values will be also used for the detection.&lt;br /&gt;
Note: The double-blend-removal does not use this parameter (-&amp;gt; only mode 1 or -1).&lt;br /&gt;
&lt;br /&gt;
{{ParR|thresh|int|22|12-44}}&lt;br /&gt;
The detection of srestore is pretty stable, but the threshold is still important to weight the detection influence. Use small values for sources with little temporal artefacts (bobbing effect, aliasing, blocks, noise, ...) and higher values for the opposite case.&lt;br /&gt;
&lt;br /&gt;
{{ParR|cache|int|-1|-1-10}}&lt;br /&gt;
With cache&amp;gt;=0 srestore use the RequestLinear function (TIVTC) to be more compatible with non-linear requesting (codec or other functions). Best way to use srestore is to do a lossless first pass right after calling srestore and do all other filtering and the final encoding in a second pass. If you do not have enough space to do a lossless pass and you cannot avoid non-linear frame requesting and the pattern of the source is pretty unstable set cache around 5-10, but keep in mind that this can increase memory usage.&lt;br /&gt;
    			&lt;br /&gt;
{{Par|dclip|clip|input}}&lt;br /&gt;
The '''d'''etection '''clip''' can be used to improve (deblock, smooth, ...) and speed-up blend and motion detection. The selected clip is only used for detection and not for output, so it does not affect the output quality. &lt;br /&gt;
If you use a high quality deinterlacing on the source you can speed up the detection by using a faster deinterlacing function (third code example) for the detection clip.&lt;br /&gt;
It's recommended to crop the bobbed source (deinterlace BEFORE cropping!) to avoid the detection influence of the bobbing borders (second code example).&lt;br /&gt;
&lt;br /&gt;
== Examples== &lt;br /&gt;
&lt;br /&gt;
bobbed (or progressive) source&lt;br /&gt;
 srestore()&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
 ord = last.getparity() ? 1 : 0&lt;br /&gt;
 leakkernelbob(ord,4,true,true)&lt;br /&gt;
 srestore(dclip=last.crop(8,16,-8,-24))&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
 d = last.bob(-0.2,0.6).reduceflicker(strength=1)&lt;br /&gt;
 tdeint(mode=1)   #or for example yadif(mode=1)&lt;br /&gt;
 srestore(mode=4,dclip=d)&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=95924 Discussion thread] at [http://forum.doom9.org/ Doom9's Forum]&lt;/div&gt;</summary>
		<author><name>ChiDragon</name></author>	</entry>

	</feed>