Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development
Register FAQ Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 6th February 2008, 03:16   #1  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
ungibbs, a gibbs artifact remover

Code:
function blurfunction2(clip c){
c
dctlimit(dct2=1.625, dct3=0, dct4=0, dct5=0, dct6=0, dct7=0, dct8=0, use64dct=false, use32dct=false, use8dct=true, use4dct=false)
}

function ungibbs(clip c){
	thresh = 224

	c
	predict = c.blurfunction2
	sharp1 = c.limitedsharpenfaster(smode=4, strength=100, overshoot=0)#Xsharpen(31, 255)
	blur1 = c.removegrain(4)
	sharp2 = c.limitedsharpenfaster(smode=3, strength=100, overshoot=0)
	blur2 = c.quantile(2)
	blur3 = c.spline36resize(width*2, height*2).removegrain(4).spline36resize(c.width, c.height)
	
	bp0 = mt_makediff(predict, c)
	bp1 = mt_makediff(sharp1.blurfunction2, c)
	bp2 = mt_makediff(blur1.blurfunction2, c)
	bp3 = mt_makediff(sharp2.blurfunction2, c)
	bp4 = mt_makediff(blur2.blurfunction2, c)
	bp5 = mt_makediff(blur3.blurfunction2, c)

	cp1 = mt_merge(c, sharp1, MT_lutxy(bp0, bp1, "x 128 - abs y 128 - abs - "+string(thresh)+" *", u=1, v=1).frfun7(0.51, 256, 256))
	m100 = mt_makediff(c, cp1.blurfunction2, u=1, v=1)
	
	cp2 = mt_merge(cp1, blur1, MT_lutxy(m100, bp2, "x 128 - abs y 128 - abs - "+string(thresh)+" *", u=1, v=1).frfun7(0.51, 256, 256))
	m101 = mt_makediff(c, cp2.blurfunction2, u=1, v=1)
	
	cp3 = mt_merge(cp2, sharp2, MT_lutxy(m101, bp3, "x 128 - abs y 128 - abs - "+string(thresh)+" *", u=1, v=1).frfun7(0.51, 256, 256))
	m102 = mt_makediff(c, cp3.blurfunction2, u=1, v=1)
	
	cp4 = mt_merge(cp3, blur2, MT_lutxy(m102, bp4, "x 128 - abs y 128 - abs - "+string(thresh)+" *", u=1, v=1).frfun7(0.51, 256, 256))
	m103 = mt_makediff(c, cp4.blurfunction2, u=1, v=1)
	
	cp5 = mt_merge(cp4, blur3, MT_lutxy(m103, bp5, "x 128 - abs y 128 - abs - "+string(thresh)+" *", u=1, v=1).frfun7(0.51, 256, 256))
	m104 = mt_makediff(c, cp5.blurfunction, u=1, v=1)
	
	#cp6 = mt_merge(cp5, blur3, MT_lutxy(m100, bp2, "x 128 - abs y 128 - abs - "+string(thresh)+" *", u=1, v=1))
	#m105 = mt_makediff(c, cp2.blurfunction, u=1, v=1)
	
	
cp5}
Requires: limitedsharpenfaster, removegrain, removegrain HD, masktools 2, dctlimit. [edit] forgot to list frfun7.

This is here (development as opposed to usage) because, its slow, it causes artifacts sometimes, and because I am lazy and don't want to spend all of my time explaining how to make it work.

example script:
Code:
#source
ungibbs().ungibbs()
spline36resize(1280, 720)
Note that it will probably produce very ugly results if used on a source that is not, atleast, a little blurry.

example: processed, unprocessed

Last edited by *.mp4 guy; 7th February 2008 at 15:53.
*.mp4 guy is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.