JincResize

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (Requirements: version update)
(JincResize 2.1.2)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{FilterCat4|External_filters|Plugins|Adjustment_filters|Resizers}}
+
{{FilterCat6|External_filters|Plugins|Plugins_x64|Adjustment_filters|Resizers|Deep_color_tools}}
 
{{Filter3
 
{{Filter3
| innocenat  
+
|1=[https://github.com/innocenat innocenat], [https://github.com/Kiyamou Kiyamou], {{Author/Asd-g}}
| v0.2
+
|2=v2.1.2
| [http://github.com/AviSynth/jinc-resize/releases JincResize.dll]
+
|3=[https://github.com/Asd-g/AviSynth-JincResize/releases JincResize]
| Resize  
+
|4=Resize
| [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 ==
*[http://sourceforge.net/projects/avisynth2/ AviSynth 2.6] or [[AviSynth+]]
+
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]
 +
* [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 ==
+
*Downscaling is not currently implemented.
+
 
<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", string "cplace", int "threads", 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", string "cplace", int "threads")}}
:{{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", string "cplace", int "threads")}}
:{{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", string "cplace", int "threads")}}
 +
:{{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", string "cplace", int "threads")}}
  
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
:::Input clip
+
:::A clip to process. All planar formats are supported.
 
<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>
 
<br>
::{{Par2|src_left|float|0}}
+
::{{Par2|src_left|float|0.0}}
::{{Par2|src_top|float|0}}
+
::: Cropping of the left edge.
::{{Par2|src_width|float| }}
+
::{{Par2|src_height|float| }}
+
:::Optional crop syntax is the same as AviSynth's [[Resize|internal resizers]].
+
 
<br>
 
<br>
 +
::{{Par2|src_top|float|0.0}}
 +
:::Cropping of the top edge.
 +
<br>
 +
::{{Par2|src_width|float|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.
 +
<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>
 
<br>
::{{Par2|version|bool|false }}
+
::{{Par2|tap|int|3}}
:::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].
+
:::Corresponding to different zero points of Jinc function.
 +
:::Must be between 1 and 16.
 +
:::This parameter is for <code>JincResize()</code> only.
 
<br>
 
<br>
== Examples ==  
+
::{{Par2|blur|float|0.0}}
Upscale to 1920x1080 with {{Template:FuncDef3|Jinc36Resize}}:
+
:::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>
 +
::{{Par2|cplace|string|}}
 +
:::The location of the chroma samples.
 +
:::MPEG1 : Chroma samples are located on the center of each group of 4 pixels.
 +
:::MPEG2 : Chroma samples are located on the left pixel column of the group.
 +
:::topleft : Chroma samples are located on the left pixel column and the first row of the group.
 +
:::Default : If frame properties are supported and frame property "_ChromaLocation" exists - "_ChromaLocation" value of the first frame is used. If frame properties aren't supported or there is no property "_ChromaLocation" - "MPEG2".
 +
<br>
 +
::{{Par2|threads|int|0}}
 +
:::How many logical processors are used.
 +
:::*0 : Maximum logical processors are used.
 +
:::Default: 0.
 +
<br>
 +
::{{Par2|opt|int|-1}}
 +
:::Controls the used CPU optimizations.
 +
:::*-1 : Auto-detect without AVX-512.
 +
:::*0 : Use C++ code.
 +
:::*1 : Use SSE4.1 code.
 +
:::*2 : Use AVX2 code.
 +
:::*3 : Use AVX-512 code.
 +
:::Default: -1.
 +
:::This parameter is for <code>JincResize()</code> only.
 +
<br>
 +
== Examples ==
 +
Upscale to 1920x1080:
 
  [[AviSource]]("Blah.avi")
 
  [[AviSource]]("Blah.avi")
  Jinc36Resize(1920, 1080)
+
  Jinc36Resize(1920, 1080)  # same as JincResize(1920, 1080, tap=3) or JincResize(1920, 1080)
 +
Jinc64Resize(1920, 1080)  # same as JincResize(1920, 1080, tap=4)
 +
Jinc144Resize(1920, 1080) # same as JincResize(1920, 1080, tap=6)
 +
Jinc256Resize(1920, 1080) # same as JincResize(1920, 1080, tap=8)
 
<br>
 
<br>
 
== Changelog ==
 
== Changelog ==
 
  Version      Date            Changes<br>
 
  Version      Date            Changes<br>
  v0.2        07/27/2014     - Core rewritten to use quantized lookup table for coefficient.
+
v2.1.2      2022/12/23      - Set frame property _ChromaLocation only for 420, 422, 411 clips.<br>
 +
v2.1.1      2022/12/22      - Changed back the behavior of parameter blur.
 +
                              - Set frame property _ChromaLocation.<br>
 +
v2.1.0      2021/08/29      - Added parameter cplace.
 +
                              - Changed omp parallel execution to C++17 parallel execution (better speed).<br>
 +
v2.0.2      2021/03/28      - Fixed output for SIMD and threads > 1.<br>
 +
v2.0.1      2020/12/24      - Used MSVC instead Intel C++ for faster binaries.<br>
 +
v2.0.0      2020/12/23      - Added OpenMP support to main processing loops. (DTL2020)
 +
                              - Added parameter 'threads'.<br>
 +
v1.2.0      2020/12/13      - AVX-512 code is not used as default when AVX-512 CPU instructions are available.
 +
                              - Fixed AVX-512 output.
 +
                              - Prevent 'nan' values for the float input (SIMD).
 +
                              - Fixed JincXXXResize parameters 'quant_x' and 'quant_y' when called by name.<br>
 +
v1.1.0      2020/07/02      - Added AVX-512 code.<br>
 +
v1.0.1      2020/06/11      - Fixed the 8..16-bit output for C++ routine.<br>
 +
v1.0.0      2020/06/10      - Initial release
 +
                              - Port of the VapourSynth JincResize<br>
 +
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++<br>
 +
  v0.2        2014/07/27      - Core rewritten to use quantized lookup table for coefficient.
 
                               - Support SSE2, SSE3, AVX2 and FMA3.
 
                               - Support SSE2, SSE3, AVX2 and FMA3.
 
                               - Basically, MUCH faster.
 
                               - Basically, MUCH faster.
 
                               - Add Jinc144Resize which is 6-tap filter.
 
                               - Add Jinc144Resize which is 6-tap filter.
 
                               - Add quant_x, quant_y, and version parameters.<br>
 
                               - Add quant_x, quant_y, and version parameters.<br>
  v0.1.1      11/26/2013     - Binary is now compile with ICC14
+
  v0.1.1      2013/11/26      - Binary is now compile with ICC14
 
                               - More optimized code, should run much faster.
 
                               - More optimized code, should run much faster.
 
                                 Thanks to tp7 and others for optimization tips.<br>
 
                                 Thanks to tp7 and others for optimization tips.<br>
  v0.1        11/26/2013     - Initial release
+
  v0.1        2013/11/26      - Initial release
 
<br>
 
<br>
 
== Archived Downloads ==
 
== Archived Downloads ==
Line 73: Line 146:
 
!!width="150px"| Download
 
!!width="150px"| Download
 
!!width="150px"| Source code
 
!!width="150px"| Source code
 +
|-
 +
!r44
 +
|[https://www.dropbox.com/s/pj37t6ackhbs42k/jincresize_r44.zip?dl=1 jincresize_r44.zip]<br>[https://web.archive.org/web/20200522062025if_/https://files.videohelp.com/u/223002/jincresize_r44.zip Mirror]
 +
|[https://github.com/AviSynth/jinc-resize/archive/master.zip jinc-resize-master.zip]
 
|-
 
|-
 
!v0.2
 
!v0.2
Line 88: Line 165:
 
<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;'''

Latest revision as of 08:32, 18 May 2023

Abstract
Author innocenat, Kiyamou, Asd-g
Version v2.1.2
Download JincResize
Category Resize
License MIT
Discussion Doom9 Thread

Contents

[edit] 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).


[edit] Requirements


[edit] Syntax and Parameters

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", string "cplace", int "threads", 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", string "cplace", int "threads")
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", string "cplace", int "threads")
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", string "cplace", int "threads")
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", string "cplace", int "threads")


clip   =
A clip to process. All planar formats are supported.


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.


string  cplace =
The location of the chroma samples.
MPEG1 : Chroma samples are located on the center of each group of 4 pixels.
MPEG2 : Chroma samples are located on the left pixel column of the group.
topleft : Chroma samples are located on the left pixel column and the first row of the group.
Default : If frame properties are supported and frame property "_ChromaLocation" exists - "_ChromaLocation" value of the first frame is used. If frame properties aren't supported or there is no property "_ChromaLocation" - "MPEG2".


int  threads = 0
How many logical processors are used.
  • 0 : Maximum logical processors are used.
Default: 0.


int  opt = -1
Controls the used CPU optimizations.
  • -1 : Auto-detect without AVX-512.
  • 0 : Use C++ code.
  • 1 : Use SSE4.1 code.
  • 2 : Use AVX2 code.
  • 3 : Use AVX-512 code.
Default: -1.
This parameter is for JincResize() only.


[edit] Examples

Upscale to 1920x1080:

AviSource("Blah.avi")
Jinc36Resize(1920, 1080)  # same as JincResize(1920, 1080, tap=3) or JincResize(1920, 1080)
Jinc64Resize(1920, 1080)  # same as JincResize(1920, 1080, tap=4)
Jinc144Resize(1920, 1080) # same as JincResize(1920, 1080, tap=6)
Jinc256Resize(1920, 1080) # same as JincResize(1920, 1080, tap=8)


[edit] Changelog

Version      Date            Changes
v2.1.2 2022/12/23 - Set frame property _ChromaLocation only for 420, 422, 411 clips.
v2.1.1 2022/12/22 - Changed back the behavior of parameter blur. - Set frame property _ChromaLocation.
v2.1.0 2021/08/29 - Added parameter cplace. - Changed omp parallel execution to C++17 parallel execution (better speed).
v2.0.2 2021/03/28 - Fixed output for SIMD and threads > 1.
v2.0.1 2020/12/24 - Used MSVC instead Intel C++ for faster binaries.
v2.0.0 2020/12/23 - Added OpenMP support to main processing loops. (DTL2020) - Added parameter 'threads'.
v1.2.0 2020/12/13 - AVX-512 code is not used as default when AVX-512 CPU instructions are available. - Fixed AVX-512 output. - Prevent 'nan' values for the float input (SIMD). - Fixed JincXXXResize parameters 'quant_x' and 'quant_y' when called by name.
v1.1.0 2020/07/02 - Added AVX-512 code.
v1.0.1 2020/06/11 - Fixed the 8..16-bit output for C++ routine.
v1.0.0 2020/06/10 - Initial release - Port of the VapourSynth JincResize
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


[edit] 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


[edit] External Links

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




Back to External Filters

Personal tools