DPID

From Avisynth wiki
Revision as of 22:21, 29 July 2021 by Reel.Deal (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Abstract
Author Asd-g
Version v1.0.0
Download DPID-1.0.0.7z
Category Resize
License BSD 3-Clause
Discussion

Contents

Description

dpid is an algorithm that preserves visually important details in downscaled images and is especially suited for large downscaling factors.

It acts like a convolutional filter where input pixels contribute more to the output image the more their color deviates from their local neighborhood, which preserves visually important details.

This is a port of the VapourSynth plugin dpid.


Requirements


Syntax and Parameters

DPID

avsresize is required in order to use this function (DPID).

DPID (clip input, int target_width, int target_height, float "lambdaY", float "lambdaU", float "lambdaV", float "src_leftY", float "src_leftU", float "src_leftV", float "src_topY", float "src_topU", float "src_topV", int "cloc")


clip   =
input: a clip to process. It must be in planar format.


int   =
target_width: the width of the output.


int   =
target_height: the height of the output.


float  lambdaY = 1.0
float  lambdaU = lambdaY
float  lambdaV = lambdaU
The power factor of range kernel.
It can be used to tune the amplification of the weights of pixels that represent detail—from a box filter over an emphasis of distinct pixels towards a selection of only the most distinct pixels.
Must be greater than 0.1.
Default: lambdaY = 1.0; lambdaU = lambdaV = lambdaY.


float  srcY_left = 0.0
float  srcU_left = 0.0
float  srcV_left = 0.0
Cropping of the left edge.


float  srcY_top = 0.0
float  srcU_top = 0.0
float  srcV_top = 0.0
Cropping of the top edge.


int  cloc = -1
Chroma location.
  • -1: If frame properties are supported and frame property "_ChromaLocation" exists - "_ChromaLocation" value is used.
If frame properties aren't supported or there is no frame property "_ChromaLocation" - 0.
  • 0: Left.
  • 1: Center.
  • 2: Top left.
  • 3: Top.
  • 4: Bottom left.
  • 5: Bottom.
Default: -1.


DPIDraw

DPIDraw uses a user supplied downscaled clip.

DPIDraw (clip input, clip input2, float "lambdaY", float "lambdaU", float "lambdaV", float "src_leftY", float "src_leftU", float "src_leftV", float "src_topY", float "src_topU", float "src_topV", int "cloc", int "y", int "u", int "v")


clip   =
input: a clip to process. It must be in planar format.


clip   =
input2: user-defined downsampled clip.
Must be of the same format and number of frames as input.


float  lambdaY = 1.0
float  lambdaU = lambdaY
float  lambdaV = lambdaU
The power factor of range kernel.
It can be used to tune the amplification of the weights of pixels that represent detail—from a box filter over an emphasis of distinct pixels towards a selection of only the most distinct pixels.
Must be greater than 0.1.
Default: lambdaY = 1.0; lambdaU = lambdaV = lambdaY.


float  srcY_left = 0.0
float  srcU_left = 0.0
float  srcV_left = 0.0
Cropping of the left edge.


float  srcY_top = 0.0
float  srcU_top = 0.0
float  srcV_top = 0.0
Cropping of the top edge.


int  cloc = -1
Chroma location.
  • -1: If frame properties are supported and frame property "_ChromaLocation" exists - "_ChromaLocation" value is used.
If frame properties aren't supported or there is no frame property "_ChromaLocation" - 0.
  • 0: Left.
  • 1: Center.
  • 2: Top left.
  • 3: Top.
  • 4: Bottom left.
  • 5: Bottom.
Default: -1.


int  y = 3
int  u = 3
int  v = 3
Planes to process.
  • 1: Return garbage.
  • 2: Copy plane from input2.
  • 3: Process plane. Always process planes when clip is RGB.
Default: y = u = v = 3.


Examples

src =  AviSource("Blah.avi") # assume the clip is 1920x1080
DPID(src, 1280, 720)

is equivalent to:

src =  AviSource("Blah.avi")
down = z_BilinearResize(src, target_width=1280, target_height=720)
DPIDRaw(src, down)


Changelog

Version      Date            Changes
v1.0.0 2021/07/23 - Initial release - AviSynth+: self-registers as MT_MULTI_INSTANCE


External Links

  • GitHub - Source code repository.
  • GitHub - Source code repository (VapourSynth version).
  • Doom9 Forum - Perceptually Based Downscaling of Images.




Back to External Filters

Personal tools