From Avisynth wiki
Jump to: navigation, search
Author mawen1250
Version v1.2
Download Resize8_v1.2.avsi
Category Resize
Discussion NMM-HD [Chinese]



Resize8() works just like AviSynth's internal resizers but with some extra features:

  • Chroma placement is correctly handled by it, while AviSynth resizers doesn't.
  • Scaling kernel for luma and chroma can be adjusted separately
  • Optional adaptive anti-ringing algorithm.

It also includes Resize8_Separate(), this function processes each plane's source position separately, mainly designed for fixing center shift caused by nnedi3, eedi3, eedi2, etc. Note that it doesn't correct chroma placement, so usually the result should be resized back to the original size, such as what many anti aliasing functions do. Adaptive anti-ringing algorithm is supported


Required Plugins

Latest version of the following plugins are recommended unless stated otherwise.

Syntax and Parameters

Resize8 (clip input, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", string "kernel", string "kernel_c", float "a1", float "a2", float "a1_c", float "a2_c", val "noring", val "noring_c", string "cplace", bool "Y", bool "U", bool "V", bool "Alpha")

clip   =
Input clip

int  target_width = input.Width()
int  target_height = input.Height()
Target width and height.

float  src_left = 0.0
float  src_top = 0.0
float  src_width = input.Width()
float  src_height = input.Height()
Optional crop syntax, works the same as AviSynth's internal resizers.

string  kernel =
string  kernel_C =
"kernel" sets resizing kernel for luma, "kernel_c" sets resizing kernel for chroma.
Supported kernels:
  • Bicubic, Catmull-Rom, Hermite, Mitchell-Netravali, Robidoux, SoftCubic, SoftCubicXX (XX represents softness:[50-100])
  • Point, Bilinear, Gauss/Gaussian, Sinc
  • Blankman, Blankman2, Blankman3, Blankman4
  • Lanczos, Lanczos2, Lanczos3, Lanczos4
  • Spline16, Spline36, Spline64
By default, "Lanczos4" is set for luma upscaling, "Lanczos" is set for chroma upscaling, "Spline36" is set for luma/chroma downscaling.

float  a1 =
float  a2 =
float  a1_c =
float  a2_c =
         "a1",   "a2",  sets parameters for resizer used in luma
         "a1_c", "a2_c" sets parameters for resizer used in chroma
         "a1" represents "b" and "a2" represents "c" for kernel "Bicubic"   (default: b = 1/3.,     c = 1/3.)
         "a1" represents "taps" and "a2" do nothing  for kernel "Blackman"  (default: taps=4,   1<=taps<=100)
         "a1" represents "taps" and "a2" do nothing  for kernel "Lanczos"   (default: taps=3,   1<=taps<=100)
         "a1" represents "taps" and "a2" do nothing  for kernel "Sinc"      (default: taps=4,   1<=taps<= 20)
         "a1" represents "p"    and "a2" do nothing  for kernel "Gauss"     (default:   p=30,   1<=  p <=100)
         "a1" represents "soft" and "a2" do nothing  for kernel "SoftCubic" (default: soft=75, 50<=soft<=100)
         for kernel "SoftCubicXX", "XX" represents "soft" and "a1"/"a2" do nothing
         "a1" do nothing and "a2" do nothing for the rest kernels supported by Resize8:
         "Catmull-Rom", "Hermite", "Mitchell-Netravali", "Robidoux", "Bilinear", "Point", "Spline16", "Spline36", "Spline64"

val  noring =
val  noring_c =
"noring" & "noring_c" can be Bool or Float
By default, we don't use anti-ringing algorithm for kernels "Point","Bilinear","Gauss"/"Gaussian","Hermite","SoftCubic".
When "noring" or "noring_c" is True, adaptive anti-ringing is enabled, when no upscaling is applied, anti-ringing is also automatically disabled.
For the default kernel of upscaling, kernel="Lanczos4"+noring=True is applied for luma, kernel_c="Lanczos"+noring_c=True is applied for chroma.
For the default kernel of downscaling, kernel="Spline36"+noring=True is applied for luma/chroma, but the adaptive anti-ringing will turn off anti-ringing.
Use repair to remove ringing introduced from resizer
noring >= 1  : completely use non-ringing repaired clip
0 < noring < 1  : noring is the weight of non-ringing repaired clip for merging with normally upscaled clip
noring <= 0 or False : do not use non-ringing repaired clip
noring == True  : adapt the weight of non-ringing repaired clip according to input and output resolution

string  cplace = "MPEG2"
Placement of the chroma subsamples. Can be one of these strings:
  • "MPEG1": 4:2:0 subsampling used in MPEG-1. Chroma samples are located on the center of each group of 4 pixels.
  • "MPEG2": Subsampling used in MPEG-2 4:2:x. Chroma samples are located on the left pixel column of the group.

bool  Y = true
bool  U = true
bool  V = true
bool  Alpha = true
Control whether to process Y/U/V plane(or R/G/B/A plane for RGB24/RGB32 input).


Correctly scale a YV12 source with MPEG2 chroma placement:

Resize8(target_width=1280, target_height=720, cplace="MPEG2") # Identical to Resize8(1280,720)

Upscale using adaptive anti-ringing:

Resize8(target_width=1280, target_height=720, noring=true)


Version      Date            Changes
v1.2 02/24/2015 - add Resize8_Separate() function v1.1 xx/xx/xxxx - fix RGB24 problem v1.0 11/15/2013 - Initial release

External Links

Back to External Filters

Personal tools