DPID

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(DPID v1.0.0)
 
(DPID 1.1.0)
 
Line 2: Line 2:
 
{{Filter3
 
{{Filter3
 
|1={{Author/Asd-g}}
 
|1={{Author/Asd-g}}
|2=v1.0.0
+
|2=v1.1.0
|3=[https://github.com/Asd-g/AviSynth-DPID/releases DPID-1.0.0.7z]
+
|3=[https://github.com/Asd-g/AviSynth-DPID/releases DPID-1.1.0.7z]
 
|4=Resize  
 
|4=Resize  
 
|5=[https://github.com/Asd-g/AviSynth-DPID/blob/main/LICENSE.txt BSD 3-Clause]
 
|5=[https://github.com/Asd-g/AviSynth-DPID/blob/main/LICENSE.txt BSD 3-Clause]
Line 137: Line 137:
 
== Changelog ==
 
== Changelog ==
 
  Version      Date            Changes<br>
 
  Version      Date            Changes<br>
 +
v1.1.0      2022/09/23      - Added support to process alpha plane.
 +
                              - ~50% faster binary.
 
  v1.0.0      2021/07/23      - Initial release
 
  v1.0.0      2021/07/23      - Initial release
 
                               - AviSynth+: self-registers as [[MT_MULTI_INSTANCE]]
 
                               - AviSynth+: self-registers as [[MT_MULTI_INSTANCE]]

Latest revision as of 19:02, 17 May 2023

Abstract
Author Asd-g
Version v1.1.0
Download DPID-1.1.0.7z
Category Resize
License BSD 3-Clause
Discussion

Contents

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


[edit] Requirements


[edit] Syntax and Parameters

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


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


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


[edit] Changelog

Version      Date            Changes
v1.1.0 2022/09/23 - Added support to process alpha plane. - ~50% faster binary. v1.0.0 2021/07/23 - Initial release - AviSynth+: self-registers as MT_MULTI_INSTANCE


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