JincResize: Difference between revisions

From Avisynth wiki
Jump to navigationJump to search
add r44
v1.1.1 update (wip)
Line 1: Line 1:
{{FilterCat5|External_filters|Plugins|Plugins_x64|Adjustment_filters|Resizers}}
{{FilterCat5|External_filters|Plugins|Plugins_x64|Adjustment_filters|Resizers}}
{{Filter3
{{Filter3
|1=innocenat  
|1=[https://github.com/innocenat innocenat], [https://github.com/Kiyamou Kiyamou], [https://github.com/Asd-g Asd-g]
|2=r44
|2=v1.0.1
|3=[https://www.dropbox.com/s/pj37t6ackhbs42k/jincresize_r44.zip?dl=1 jincresize_r44.zip]
|3=[https://github.com/Asd-g/AviSynth-JincResize/releases JincResize-1.0.1.7z]
|4=Resize  
|4=Resize  
|5=[http://www.apache.org/licenses/LICENSE-2.0 Apache 2.0]
|5=[https://github.com/Asd-g/AviSynth-JincResize/blob/master/LICENSE MIT]
|6=[http://forum.doom9.org/showthread.php?t=169813 Doom9 Thread]}}
|6=[https://forum.doom9.org/showthread.php?t=169813 Doom9 Thread]}}


== Description ==
== Description ==
Jinc (EWA Lanczos) resampling plugin for AviSynth 2.6/AviSynth+.<br>
Jinc (EWA Lanczos) resampling plugin for AviSynth 2.6/AviSynth+.<br>
<tt>JincResize</tt> includes 4 functions {{Template:FuncDef3| Jinc36Resize}}, {{Template:FuncDef3| Jinc64Resize}}, {{Template:FuncDef3| Jinc144Resize}}, and {{Template:FuncDef3| Jinc256Resize}}, which is a 3-tap, 4-tap, 6-tap, and a 8-tap filter respectively.<br>
[[JincResize]] v1.0.0 and greater is a port of the VapourSynth JincResize filter with SSE / AVX Intrinsics taken from the original JincFilter by innocenat.
 
 
<tt>JincResize</tt> includes 5 functions:
*{{Template:FuncDef3| JincResize}} is the main filter.
*{{Template:FuncDef3| Jinc36Resize}} is an alias for JincResize(tap=3).
*{{Template:FuncDef3| Jinc64Resize}} is an alias for JincResize(tap=4).
*{{Template:FuncDef3| Jinc144Resize}} is an alias for JincResize(tap=6).
*{{Template:FuncDef3| Jinc256Resize}} is an alias for JincResize(tap=8).
<br>
<br>
== Requirements ==
== Requirements ==
Line 16: Line 24:
* [x64]: [[AviSynth+]]
* [x64]: [[AviSynth+]]
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
<br>
** AviSynth+: all [[planar]] formats (8/10/12/14/16/32bit, Y/YUV/RGB with or without alpha) are supported.
 
== Limitations ==
*<strike>Downscaling is not currently implemented.</strike> Not true with r44, only previous versions.
<br>
<br>
== [[Script variables|Syntax and Parameters]] ==
== [[Script variables|Syntax and Parameters]] ==
:{{Template:FuncDef| Jinc36Resize (clip, int, int, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y", bool "version")}}
:{{Template:FuncDef|   JincResize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y", int "tap", float "blur", int "opt")}}
:{{Template:FuncDef| Jinc64Resize (clip, int, int, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y", bool "version")}}
:{{Template:FuncDef| Jinc36Resize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y")}}
:{{Template:FuncDef|Jinc144Resize (clip, int, int, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y", bool "version")}}
:{{Template:FuncDef| Jinc64Resize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y")}}
:{{Template:FuncDef|Jinc256Resize (clip, int, int, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y", bool "version")}}
:{{Template:FuncDef|Jinc144Resize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y")}}
:{{Template:FuncDef|Jinc256Resize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y")}}


<br>
<br>
::{{Par2| |clip| }}
::{{Par2| |clip| }}
:::Input clip
:::Input clip.
<br>
<br>
::{{Par2| |int| }}
::{{Par2| |int| }}
::: Target width
:::<code>target_width</code>: the width of the output.
<br>
<br>
::{{Par2| |int| }}
::{{Par2| |int| }}
:::Target height
:::<code>target_height</code>: the heightof the output.
<br>
::{{Par2|src_left|float|0.0}}
::: Cropping of the left edge.
<br>
::{{Par2|src_top|float|0.0}}
:::Cropping of the top edge.
<br>
<br>
::{{Par2|src_left|float|0}}
::{{Par2|src_width|float|Source width}}
::{{Par2|src_top|float|0}}
:::If > 0.0 it sets the width of the clip before resizing.
::{{Par2|src_width|float| }}
:::If <= 0.0 it sets the cropping of the right edges before resizing.
::{{Par2|src_height|float| }}
:::Optional crop syntax is the same as AviSynth's [[Resize|internal resizers]].
<br>
<br>
::{{Par2|src_height|float|Source height}}
:::If > 0.0 it sets the height of the clip before resizing.
:::If <= 0.0 it sets the cropping of the bottom edges before resizing
<br>
<br>
::{{Par2|quant_x|int|256}}
::{{Par2|quant_x|int|256}}
::{{Par2|quant_y|int|256}}
::{{Par2|quant_y|int|256}}
::: Control sub-pixel quantization.
::: Controls sub-pixel quantization.
::: Must be between 1 and 256.
<br>
::{{Par2|tap|int|3}}
:::Corresponding to different zero points of Jinc function.
:::Must be between 1 and 16.
:::This parameter is for <code>JincResize()</code> only.
<br>
::{{Par2|blur|float|0.0}}
:::Blur processing, it can reduce side effects.
:::To achieve blur, the value should more than 0.0.
:::Must be between 0.0 and 10.0. Default: 0.0.
:::This parameter is for <code>JincResize()</code> only.
<br>
<br>
::{{Par2|version|bool|false }}
::{{Par2|opt|int|2}}
:::Setting it to true will show Jinc's internal CPU flag and instruction support it compiles with. More information [http://forum.doom9.org/showthread.php?p=1688576#post1688576 here].
:::Controls the used CPU optimizations.
:::*0 : Use C++ routine.
:::*1 : Use SSE routine (SSE4.1 required).
:::*2 : Use AVX routine (AVX2 required).
:::Default: 2, if AVX not available 1, if SSE not available 0.
:::This parameter is for <code>JincResize()</code> only.
<br>
<br>
== Examples ==  
== Examples ==  
Upscale to 1920x1080 with {{Template:FuncDef3|Jinc36Resize}}:
Upscale to 1920x1080 with {{Template:FuncDef3|Jinc36Resize}}:
  [[AviSource]]("Blah.avi")
  [[AviSource]]("Blah.avi")
  Jinc36Resize(1920, 1080)
  Jinc36Resize(1920, 1080) # same as JincResize(1920,1080)
<br>
<br>
== Changelog ==
== Changelog ==
Line 101: Line 131:
<br>
<br>
== External Links ==
== External Links ==
*[http://forum.doom9.org/showthread.php?t=169813 Doom9 Forum] - JincResize discussion.
*[https://github.com/AviSynth/jinc-resize GitHub] - Source code repository (original).
*[http://github.com/AviSynth/jinc-resize GitHub] - Source code repository.
*[https://github.com/Asd-g/AviSynth-JincResize GitHub] - Source code repository (update).
*[https://github.com/Kiyamou/VapourSynth-JincResize GitHub] - Source code repository (VapourSynth version).
<br>
<br>
<br>
<br>
-----------------------------------------------
-----------------------------------------------
'''Back to [[External_filters#Resizers|External Filters]] &larr;'''
'''Back to [[External_filters#Resizers|External Filters]] &larr;'''

Revision as of 10:23, 12 June 2020

Abstract
Author innocenat, Kiyamou, Asd-g
Version v1.0.1
Download JincResize-1.0.1.7z
Category Resize
License MIT
Discussion Doom9 Thread

Description

Jinc (EWA Lanczos) resampling plugin for AviSynth 2.6/AviSynth+.
JincResize v1.0.0 and greater is a port of the VapourSynth JincResize filter with SSE / AVX Intrinsics taken from the original JincFilter by innocenat.


JincResize includes 5 functions:

  • JincResize is the main filter.
  • Jinc36Resize is an alias for JincResize(tap=3).
  • Jinc64Resize is an alias for JincResize(tap=4).
  • Jinc144Resize is an alias for JincResize(tap=6).
  • Jinc256Resize is an alias for JincResize(tap=8).


Requirements


JincResize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y", int "tap", float "blur", int "opt")
Jinc36Resize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y")
Jinc64Resize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y")
Jinc144Resize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y")
Jinc256Resize (clip, int target_width, int target_height, float "src_left", float "src_top", float "src_width", float "src_height", int "quant_x", int "quant_y")


clip   =
Input clip.


int   =
target_width: the width of the output.


int   =
target_height: the heightof the output.


float  src_left = 0.0
Cropping of the left edge.


float  src_top = 0.0
Cropping of the top edge.


float  src_width = Source width
If > 0.0 it sets the width of the clip before resizing.
If <= 0.0 it sets the cropping of the right edges before resizing.


float  src_height = Source height
If > 0.0 it sets the height of the clip before resizing.
If <= 0.0 it sets the cropping of the bottom edges before resizing


int  quant_x = 256
int  quant_y = 256
Controls sub-pixel quantization.
Must be between 1 and 256.


int  tap = 3
Corresponding to different zero points of Jinc function.
Must be between 1 and 16.
This parameter is for JincResize() only.


float  blur = 0.0
Blur processing, it can reduce side effects.
To achieve blur, the value should more than 0.0.
Must be between 0.0 and 10.0. Default: 0.0.
This parameter is for JincResize() only.


int  opt = 2
Controls the used CPU optimizations.
  • 0 : Use C++ routine.
  • 1 : Use SSE routine (SSE4.1 required).
  • 2 : Use AVX routine (AVX2 required).
Default: 2, if AVX not available 1, if SSE not available 0.
This parameter is for JincResize() only.


Examples

Upscale to 1920x1080 with Jinc36Resize:

AviSource("Blah.avi")
Jinc36Resize(1920, 1080) # same as JincResize(1920,1080)


Changelog

Version      Date            Changes
r44 2014/09/20 - Latest revision r44 (@0cd502a) - More correct calculation on quantized pixel - Fixing some memory leak - Implement basic downscaling support. - Better memory performance - Cleanup + const qualify more variable - x64 binary - Compiled with Intel Parallel Studio XE 2015 Composer Edition for C++
v0.2 2014/07/27 - Core rewritten to use quantized lookup table for coefficient. - Support SSE2, SSE3, AVX2 and FMA3. - Basically, MUCH faster. - Add Jinc144Resize which is 6-tap filter. - Add quant_x, quant_y, and version parameters.
v0.1.1 2013/11/26 - Binary is now compile with ICC14 - More optimized code, should run much faster. Thanks to tp7 and others for optimization tips.
v0.1 2013/11/26 - Initial release


Archived Downloads

Version Download Source code
r44 jincresize_r44.zip
Mirror
jinc-resize-master.zip
v0.2 JincResize.dll jinc-resize-0.2.zip
v0.1.1 JincResize.dll jinc-resize-0.1.1.zip
v0.1 JincResize.dll jinc-resize-0.1.zip


  • GitHub - Source code repository (original).
  • GitHub - Source code repository (update).
  • GitHub - Source code repository (VapourSynth version).




Back to External Filters