DPID
From Avisynth wiki
Abstract | |
---|---|
Author | Asd-g |
Version | v1.1.0 |
Download | DPID-1.1.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
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
- Supported color formats: Y8, YV12, YV16, YV24, YV411
- AviSynth+: all planar formats (8/10/12/14/16/32bit, Y/YUV/RGB with or without alpha) are supported.
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.
- clip =
- int =
target_width
: the width of the output.
- int =
- int =
target_height
: the height of the output.
- int =
- 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 lambdaY = 1.0
- float srcY_left = 0.0
- float srcU_left = 0.0
- float srcV_left = 0.0
- Cropping of the left edge.
- float srcY_left = 0.0
- float srcY_top = 0.0
- float srcU_top = 0.0
- float srcV_top = 0.0
- Cropping of the top edge.
- float srcY_top = 0.0
- 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.
- Chroma location.
- int cloc = -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 =
- clip =
input2
: user-defined downsampled clip.- Must be of the same format and number of frames as
input
.
- clip =
- 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 lambdaY = 1.0
- float srcY_left = 0.0
- float srcU_left = 0.0
- float srcV_left = 0.0
- Cropping of the left edge.
- float srcY_left = 0.0
- float srcY_top = 0.0
- float srcU_top = 0.0
- float srcV_top = 0.0
- Cropping of the top edge.
- float srcY_top = 0.0
- 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.
- Chroma location.
- int cloc = -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.
- Planes to process.
- int y = 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.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
External Links
- GitHub - Source code repository.
- GitHub - Source code repository (VapourSynth version).
- Doom9 Forum - Perceptually Based Downscaling of Images.
Back to External Filters ←