Avsresize

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (Resizers: typo)
(Update docs to version 2020-04-08)
Line 2: Line 2:
 
{{Filter3
 
{{Filter3
 
| [https://github.com/sekrit-twc sekrit-twc]
 
| [https://github.com/sekrit-twc sekrit-twc]
|2=r1d
+
|2=2020-04-08
|3=[https://www.dropbox.com/s/3ocrd217pprrvmn/avsresize-r1d.7z?dl=1 avsresize-r1d.7z]
+
|3=[https://cloud.owncube.com/s/DjHxaH7YdEieY3s avsresize.7z]
 
|4=Resize  
 
|4=Resize  
 
|5=Open source
 
|5=Open source
Line 22: Line 22:
 
===z_ConvertFormat===
 
===z_ConvertFormat===
 
Scaling, colorspace conversion, and depth conversion.
 
Scaling, colorspace conversion, and depth conversion.
:{{Template:FuncDef|z_ConvertFormat (clip clip, int "width", int "height", str "pixel_type", str "colorspace_op", str "chromaloc_op", bool "interlaced", float "src_left", float "src_top", float "src_width", float "src_height", str "resample_filter", float "filter_param_a", float "filter_param_b", str "resample_filter_uv", float "filter_param_a_uv", float "filter_param_b_uv", str "dither_type")}}
+
:{{Template:FuncDef|z_ConvertFormat (clip clip, int "width", int "height", str "pixel_type", string "colorspace_op", string "chromaloc_op", bool "interlaced", float "src_left", float "src_top", float "src_width", float "src_height", string "resample_filter", float "filter_param_a", float "filter_param_b", string "resample_filter_uv", float "filter_param_a_uv", float "filter_param_b_uv", string "dither_type", string "cpu_type", float "nominal_luminance", bool "approximate_gamma")}}
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
Line 156: Line 156:
 
<br>
 
<br>
 
::{{Par2|resample_filter|string| }}
 
::{{Par2|resample_filter|string| }}
:::Resampling modes: <code>"point", "bilinear", "bicubic", "spline16", "spline36", "lanczos"</code>
+
:::Resampling modes: <code>"point", "bilinear", "bicubic", "spline16", "spline36", "spline64", "lanczos"</code>
::: Compatibility aliases: <code>"gauss", "spline64", "lanczos4", "blackman", "sinc"</code>
+
 
<br>
 
<br>
 
::{{Par2|filter_param_a|float| }}
 
::{{Par2|filter_param_a|float| }}
Line 172: Line 171:
 
:::First and second parameter to chroma resampler.
 
:::First and second parameter to chroma resampler.
 
<br>
 
<br>
::{{Par2|resample_filter|string| }}
+
::{{Par2|resample_filter|string|"none"}}
 
:::Dithering type: <code>"none", "ordered", "random", "error_diffusion"</code>
 
:::Dithering type: <code>"none", "ordered", "random", "error_diffusion"</code>
 +
<br>
 +
::{{Par2|cpu_type|string| }}
 +
:::CPU type: ("none", "avx" , "avx_e" ("ivy"), "avx2", "avx512f, "avx512_skx" ("skx"), "avx512_clx", "avx512_pmc" ("cannon"), "avx512_snc" ("ice"))
 +
<br>
 +
::{{Par2|nominal_luminance|float|100.0}}
 +
:::Nominal peak luminance in cd/m^2 when converting HDR content to RGB Linear.
 +
<br>
 +
::{{Par2|approximate_gamma|bool|true}}
 +
:::Evaluating transfer functions at reduced precision.
 
<br>
 
<br>
  
 
===Resizers===
 
===Resizers===
 
z.lib compatibility wrappers with same syntax as [[Resize|built-in resizers]].
 
z.lib compatibility wrappers with same syntax as [[Resize|built-in resizers]].
:{{Template:FuncDef|z_PointResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height")}}
+
:{{Template:FuncDef|z_PointResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")}}
 
+
:{{Template:FuncDef|z_BilinearResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height")}}
+
 
+
:{{Template:FuncDef|z_BicubicResize (clip, float "b", float "c", int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height")}}
+
  
:{{Template:FuncDef|z_LanczosResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps")}}
+
:{{Template:FuncDef|z_BilinearResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")}}
  
:{{Template:FuncDef|z_Lanczos4Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height")}}
+
:{{Template:FuncDef|z_BicubicResize (clip, float "b", float "c", int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")}}
  
:{{Template:FuncDef|z_BlackmanResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps")}}
+
:{{Template:FuncDef|z_LanczosResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps", string "chromaloc_op", string "dither")}}
  
:{{Template:FuncDef|z_Spline16Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height")}}
+
:{{Template:FuncDef|z_Lanczos4Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")}}
  
:{{Template:FuncDef|z_Spline36Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height")}}
+
:{{Template:FuncDef|z_Spline16Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")}}
  
:{{Template:FuncDef|z_Spline64Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height")}}
+
:{{Template:FuncDef|z_Spline36Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")}}
  
:{{Template:FuncDef|z_GaussResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", float "p")}}
+
:{{Template:FuncDef|z_Spline64Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")}}
  
:{{Template:FuncDef|z_SincResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps")}}
 
 
<br>
 
<br>
  
 
== Changelog ==
 
== Changelog ==
 
  Version      Date            Changes<br>
 
  Version      Date            Changes<br>
  r1d          2018/03/21      - lastest release
+
              2020/04/08      - Changes by [https://forum.doom9.org/showthread.php?p=1906771#post1906771 StvG]
 +
                              - Update to zimg@5896a26
 +
                              - z_ConvertFormat: add "cpu_type", "nominal_luminance", and "approximate_gamma" parameters
 +
                              - z_ConvertFormat: remove "gauss", "lanczos4", "blackman", and "sinc" compatibility aliases
 +
                              - Resizers: add "chromaloc_op" and "dither"
 +
                              - Resizers: remove z_BlackmanResize(), z_GaussResize(),
 +
                                and z_SincResize() compatibility aliases.<br>
 +
  r1d          2018/03/21      - lastest release<br>
 
  r1          2016/10/29      - initial release
 
  r1          2016/10/29      - initial release
 
<br>
 
<br>

Revision as of 23:37, 8 April 2020

Abstract
Author sekrit-twc
Version 2020-04-08
Download avsresize.7z
Category Resize
License Open source
Discussion Doom9 Forum


Contents

Description

z.lib resizers for AviSynth+

Requirements

  • AviSynth+ x86/x64
  • Supported color formats: RGB24, RGB32, Y8, YV12, YV16, YV24
    • All planar formats (8/10/12/14/16bit and float, YUV/RGB with or without alpha) are supported.


Syntax and Parameters

z_ConvertFormat

Scaling, colorspace conversion, and depth conversion.

z_ConvertFormat (clip clip, int "width", int "height", str "pixel_type", string "colorspace_op", string "chromaloc_op", bool "interlaced", float "src_left", float "src_top", float "src_width", float "src_height", string "resample_filter", float "filter_param_a", float "filter_param_b", string "resample_filter_uv", float "filter_param_a_uv", float "filter_param_b_uv", string "dither_type", string "cpu_type", float "nominal_luminance", bool "approximate_gamma")


clip   =
Input clip.


int  width =
int  height =
Output width and height in pixels.


string  pixel_type =
Output pixel type ("YV12", "YUV420P16", etc.). See all available color formats here.


string  colorspace_op =
Colorspace operation description.
Format is "matS[:transS[:primS[:rangeS]]]=>matD[:transD[:primD[:rangeD]]]"
Example JPEG to MPEG: "170m:709:709:f=>709:709:709:l"
MATRIX COEFFICIENTS TRANSFER CHARACTERISTICS COLOR PRIMARIES PIXEL RANGE
"rgb" "709" "709" "limited"
"709" "unspec" "unspec" "l"
"unspec" "470m" "470m" "full"
"fcc" "470bg" "470bg" "f"
"470bg" "601" "170m"
"170m" "240m" "240m"
"240" "linear" "film"
"ycgco" "log100" "2020"
"2020ncl" "log316" "st428"
"2020cl" "xvycc" "st431-2"
"chromancl" "srgb" "st432-1"
"chromacl" "2020_10" "jedec-p22"
"ictcp" "2020_12" Compatibility aliases
Compatibility aliases "st2084" "xyz" same as "st428"
"601" same as "470bg" "std-b67" "dci-p3" same as "st431-2"
"2020" same as "2020ncl" Compatibility aliases "display-p3" same as "st432-1"
"2020" same as "2020_10"
see tables on VapourSynth resize documentation


string  chromaloc_op =
Chroma location operation description.
Format is "[locS]=>[locD]"
Example JPEG to MPEG2: "center=>left"
Chroma location table:
  • "left"
  • "center"
Compatibility aliases
  • "dv" : left
  • "jpeg" : center
  • "mpeg1" : center
  • "mpeg2" : left


bool  interlaced = false
Whether to use interlaced mode (default: false)


float  src_left =
float  src_top =
float  src_width =
float  src_height =
Optional crop rectangle in the input frame.


string  resample_filter =
Resampling modes: "point", "bilinear", "bicubic", "spline16", "spline36", "spline64", "lanczos"


float  filter_param_a =
float  filter_param_b =
First and second parameter to resampler.
Example Bicubic (Mitchell-Netravali): resample_filter="bicubic", filter_param_a=0.333, filter_param_b=0.333
Example 4-tap Lanczos: resample_filter="lanczos", filter_param_a=4


string  resample_filter_uv =
Resampling mode for chroma.


float  filter_param_a_uv =
float  filter_param_b_uv =
First and second parameter to chroma resampler.


string  resample_filter = "none"
Dithering type: "none", "ordered", "random", "error_diffusion"


string  cpu_type =
CPU type: ("none", "avx" , "avx_e" ("ivy"), "avx2", "avx512f, "avx512_skx" ("skx"), "avx512_clx", "avx512_pmc" ("cannon"), "avx512_snc" ("ice"))


float  nominal_luminance = 100.0
Nominal peak luminance in cd/m^2 when converting HDR content to RGB Linear.


bool  approximate_gamma = true
Evaluating transfer functions at reduced precision.


Resizers

z.lib compatibility wrappers with same syntax as built-in resizers.

z_PointResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")
z_BilinearResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")
z_BicubicResize (clip, float "b", float "c", int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")
z_LanczosResize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps", string "chromaloc_op", string "dither")
z_Lanczos4Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")
z_Spline16Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")
z_Spline36Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")
z_Spline64Resize (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "chromaloc_op", string "dither")


Changelog

Version      Date            Changes
2020/04/08 - Changes by StvG - Update to zimg@5896a26 - z_ConvertFormat: add "cpu_type", "nominal_luminance", and "approximate_gamma" parameters - z_ConvertFormat: remove "gauss", "lanczos4", "blackman", and "sinc" compatibility aliases - Resizers: add "chromaloc_op" and "dither" - Resizers: remove z_BlackmanResize(), z_GaussResize(), and z_SincResize() compatibility aliases.
r1d 2018/03/21 - lastest release
r1 2016/10/29 - initial release


Archived Downloads

Version Download Mirror
r1d avsresize-r1d.7z


External Links

  • Doom9 Forum - 8bit or greater (AviSynth+) linear/gamma light aware resizing?
  • Doom9 Forum - HDRTools vs DitherTools vs ColorMatrix




Back to External Filters

Personal tools