FunkyDeBlock

From Avisynth wiki
Jump to navigationJump to search
Abstract
Author Mug Funky
Version 10/03/2004
Download funkydeblock script
Category Deblocker
License
Discussion Doom9 Thread

Description

Deblocking function based on blindPP and high/lowpass separating. This is of most use on HEAVILY compressed source material.

Requirements

Required Plugins

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


funkydeblock (clip c, int "quant", int "th", int "radius", bool "deblock", bool "depump")


clip   =
Input clip.


int  quant = 4
The quant parameter usually fed into blindPP. The default is 4 which is actually very conservative due to the fact it's only used on the highpassed clip, so even quant=31 gives a good picture.


int  th = 3
TemporalSoften threshold. Only active when depumping is on. Default 3. This parameter controls how sensitive to pumping the filter is. keep it low, unless you're seeing large jumps at I frames. Increase only as much as you have to, or dim moving objects will start vanishing.


int  radius = 4
The number of frames before and after currentframe used in TemporalSoften. Default 4. This is intended to smear GOP changes, so pumping doesn't show as much.


bool  deblock = true
Turn deblocking on/off (only depumping is used). Default true.


bool  depump = true
Turn depumping on/off (only deblocking is used). Default true.


Examples

funkydeblock with default settings:

MPEG2Source("Blocky.dv2")
funkydeblock (quant=4, th=3, radius=4, deblock=true, depump=true)


Script

function gauss (clip c, int "radius") {

radius=default(radius,1)

radius=radius*4
c.bilinearresize(4*(c.width/radius),4*(c.height/radius)).bicubicresize(c.width,c.height,1,0)

}

function funkydeblock (clip c, int "quant", int "th", int "radius", bool "deblock", bool "depump"){

quant=default(quant,4)
th=default(th,3)
radius=default(radius,4)
deblock=default(deblock,true)
depump=default(depump,true)

blurd = c.gauss(4)

highpass=subtract(blurd,c)
deblocked=(deblock==true) ? highpass.blindpp(quant=floor(quant),cpu=4) : highpass

nopump=subtract(blurd,deblocked)
pump=subtract(blurd.temporalsoften(radius,th,th,2*th,2),deblocked)

(depump==true) ? pump : nopump

}





Back to External Filters