Average

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (link fix)
m (add Deep_color_tools category)
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{FilterCat|External_filters|Plugins|Adjustment_filters}}
+
{{FilterCat6|External_filters|Plugins|Plugins_x64|Adjustment_filters|Averaging|Deep_color_tools}}
 
{{Filter3
 
{{Filter3
| {{Author/tp7}}
+
| {{Author/tp7}}, {{Author/pinterf}}
| v0.92
+
| v0.94
|
+
|[https://github.com/pinterf/Average/releases Average-v0.94.7z]
*[http://github.com/tp7/Average/releases/download/0.92/Average-x86.zip Average-x86.zip]
+
-----
+
*[http://github.com/tp7/Average/releases/download/0.92/Average-x64.zip Average-x64.zip]
+
 
| Averaging  
 
| Averaging  
 
| [http://opensource.org/licenses/MIT MIT] but binaries are [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
 
| [http://opensource.org/licenses/MIT MIT] but binaries are [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
Line 12: Line 9:
 
<br>
 
<br>
 
== Description ==
 
== Description ==
A simple plugin that calculates weighted average of multiple frames. This is a modern rewrite of the [[Average#Average_for_AviSynth_2.5|old Average plugin]] but a bit faster, additional colorspace support, and some additional sanity checks.<br/>
+
A simple plugin that calculates a weighted frame-by-frame average from multiple clips. This is a modern rewrite of the [[#Average_for_AviSynth_2.5|old Average plugin]] but a bit faster, additional colorspace support, and some additional sanity checks.<br/>
  
 
*The usage is identical to the old Average plugin or RedAverage: <code>Average (clip1, weight1, clip2, weight2, clip3, weight3, ...)</code>
 
*The usage is identical to the old Average plugin or RedAverage: <code>Average (clip1, weight1, clip2, weight2, clip3, weight3, ...)</code>
Line 18: Line 15:
 
<br>
 
<br>
 
== Requirements ==
 
== Requirements ==
* [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6.0] or greater
+
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]
* x64 version requires [http://forum.doom9.org/showthread.php?t=168856 AviSynth+ r1576] or later
+
* [x64]: [[AviSynth+]]
 
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 +
** AviSynth+: All [[planar]] formats (8/10/12/14/16/32bit, Y/YUV/RGB with or without alpha) are supported, also RGB48 and RGB64.
 
<br>
 
<br>
* [http://www.microsoft.com/en-us/download/details.aspx?id=30679 Microsoft Visual C++ 2012 Redistributable Package (x86 / x64)]
+
* [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ 2019 Redistributable Package (x86 / x64)]
 
:<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>Average-x86</tt>
 
:<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>Average-x86</tt>
 
:<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>Average-x64</tt>
 
:<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>Average-x64</tt>
Line 50: Line 48:
 
== Changelog ==
 
== Changelog ==
 
  Version      Date            Changes<br>
 
  Version      Date            Changes<br>
 +
v0.94        01/27/2017      - Fix: fix the fix: rounding of intermediate results was ok for two clips
 +
                              - New: AVX for 10-16bit (+20-30%) and float (+50-60%) compared to v0.93
 +
                              - AVX for 8 bit non-integer path (+20% gain), e.g. when one of the weights is over 1.0
 +
v0.93        01/26/2017      - Mod by pinterf
 +
                              - Fix: rounding of intermediate results in fast integer average of 8 bit clips
 +
                              - Mod: faster results for two or three clips
 +
                              - New: Support for AviSynth+ color spaces: 10-16 bit and float YUV(A)/Planar RGB(A), RGB48 and RGB64
 +
                              - 10+ bits are calculated in float precision internally.
 +
                              - New: auto register as [[MT_NICE_FILTER]] for AviSynth+
 +
                              - New: add version resource
 +
                              - Info: built with VS2015 Update 3, may require Visual Studio 2015 Redistributable update 3
 
  v0.92        12/27/2014      - This release fixes a very important memory leak which made the plugin unusable for somewhat complex scripts.
 
  v0.92        12/27/2014      - This release fixes a very important memory leak which made the plugin unusable for somewhat complex scripts.
 
  v0.91        12/24/2014      - Double performance when absolute values of all weights are smaller or equal to one.
 
  v0.91        12/24/2014      - Double performance when absolute values of all weights are smaller or equal to one.
Line 55: Line 64:
 
*For older downloads (and source code) see the [http://github.com/tp7/Average/releases GitHub releases page].
 
*For older downloads (and source code) see the [http://github.com/tp7/Average/releases GitHub releases page].
 
<br>
 
<br>
 +
 
== Average for AviSynth 2.5 ==
 
== Average for AviSynth 2.5 ==
 
This is the original Average plugin written by mg262. It works with AviSynth 2.5/2.6 but only supports the [[YV12]] colorspace. Additional information in the following links.
 
This is the original Average plugin written by mg262. It works with AviSynth 2.5/2.6 but only supports the [[YV12]] colorspace. Additional information in the following links.
Line 60: Line 70:
 
*[http://forum.doom9.org/showthread.php?t=118430 Doom9 Forum] - mg262's plugins with source code.
 
*[http://forum.doom9.org/showthread.php?t=118430 Doom9 Forum] - mg262's plugins with source code.
 
===Download===
 
===Download===
*[http://wilbertdijkhof.com/mg262/Average_v11.zip Average_v11.zip] | [http://web.archive.org/web/20141116214856/http://wilbertdijkhof.com/mg262/Average_v11.zip Mirror]
+
*[http://wilbertdijkhof.com/mg262/Average_v11.zip Average_v11.zip] | [http://web.archive.org/web/20141116214856if_/http://wilbertdijkhof.com/mg262/Average_v11.zip Mirror]
 
*[http://forum.doom9.org/attachment.php?attachmentid=8362&d=1209405643 average-codeblock.zip] | [http://forum.doom9.org/showpost.php?p=1129919&postcount=57 Doom9 Forum]
 
*[http://forum.doom9.org/attachment.php?attachmentid=8362&d=1209405643 average-codeblock.zip] | [http://forum.doom9.org/showpost.php?p=1129919&postcount=57 Doom9 Forum]
 +
<br>
 +
== External Links ==
 +
*[https://github.com/tp7/Average GitHub] - Source code repository (original)
 +
*[https://github.com/pinterf/Average GitHub] - Source code repository (update)
 
<br>
 
<br>
 
<br>
 
<br>
 
-----------------------------------------------
 
-----------------------------------------------
 
'''Back to [[External_filters#Averaging.2FLayering.2FMasking|External Filters]] &larr;'''
 
'''Back to [[External_filters#Averaging.2FLayering.2FMasking|External Filters]] &larr;'''

Revision as of 19:38, 25 June 2020

Abstract
Author tp7, pinterf
Version v0.94
Download Average-v0.94.7z
Category Averaging
License MIT but binaries are GPLv2
Discussion Doom9 Thread


Contents

Description

A simple plugin that calculates a weighted frame-by-frame average from multiple clips. This is a modern rewrite of the old Average plugin but a bit faster, additional colorspace support, and some additional sanity checks.

  • The usage is identical to the old Average plugin or RedAverage: Average (clip1, weight1, clip2, weight2, clip3, weight3, ...)
  • Output pixel value is calculated as: out[x] = clip1[x] * weight1 + clip2[x] * weight2 + clip3[x] * weight3...


Requirements


*** vcredist_x86.exe is required for Average-x86
*** vcredist_x64.exe is required for Average-x64


Syntax and Parameters

Average (clip, float, clip, float, clip, float ...)


clip   =
Input clip 1 / 2 / 3 ...
float   =
Weight 1 / 2 / 3 ...


You can average as many clips as you want but there are a few limitations.

  • Average requires an even number of arguments.
  • All clips must have the same colorspace.
  • All clips must have identical width and height.
  • All clips must have the same or greater number of frames as the first input clip.
  • Best performance when absolute values of all weights are smaller or equal to one.


Examples

TODO:

AviSource("blah.avi")


Changelog

Version      Date            Changes
v0.94 01/27/2017 - Fix: fix the fix: rounding of intermediate results was ok for two clips - New: AVX for 10-16bit (+20-30%) and float (+50-60%) compared to v0.93 - AVX for 8 bit non-integer path (+20% gain), e.g. when one of the weights is over 1.0 v0.93 01/26/2017 - Mod by pinterf - Fix: rounding of intermediate results in fast integer average of 8 bit clips - Mod: faster results for two or three clips - New: Support for AviSynth+ color spaces: 10-16 bit and float YUV(A)/Planar RGB(A), RGB48 and RGB64 - 10+ bits are calculated in float precision internally. - New: auto register as MT_NICE_FILTER for AviSynth+ - New: add version resource - Info: built with VS2015 Update 3, may require Visual Studio 2015 Redistributable update 3 v0.92 12/27/2014 - This release fixes a very important memory leak which made the plugin unusable for somewhat complex scripts. v0.91 12/24/2014 - Double performance when absolute values of all weights are smaller or equal to one. v0.90 12/21/2014 - Initial release.


Average for AviSynth 2.5

This is the original Average plugin written by mg262. It works with AviSynth 2.5/2.6 but only supports the YV12 colorspace. Additional information in the following links.

  • Doom9 Forum - Average plug-in : weighted average of any number of clips (original thread by mg262)
  • Doom9 Forum - mg262's plugins with source code.

Download


External Links

  • GitHub - Source code repository (original)
  • GitHub - Source code repository (update)




Back to External Filters

Personal tools