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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th August 2012, 02:46   #1  |  Link
matfra
Registered User
 
Join Date: Jul 2009
Posts: 111
Get BlockKiller work in MT?

Hi,
I found a fonction call BlockKiller on this thread. Its working very well to remove block and smooth shadow.
I made a ASVI of it, with all the function needed.
I cannot have it work in Mt mode. Its really slow by itself. Can someone help me to tweak it please.

BlockKiller ()


function BlockKiller(clip source)
{
y=source.greyscale()
y=y.ChannelBlockKiller()
u=source.utoy()
u=u.ChannelBlockKiller()
v=source.vtoy()
v=v.ChannelBlockKiller()

return ytouv(u, v, y)
}

function ChannelBlockKiller(clip source)
{
source
""" spline36resize(source.width*16,source.height*16)
gradfunkmirror()
gradfunkmirror()
gradfunkmirror()
spline36resize(source.width*8,source.height*8)
gradfunkmirror()
gradfunkmirror()
gradfunkmirror() """
spline36resize(source.width*4,source.height*4)
gradfunkmirror()
gradfunkmirror()
gradfunkmirror()
spline36resize(source.width*2,source.height*2)
gradfunkmirror()
gradfunkmirror()
gradfunkmirror()
spline36resize(source.width,source.height)
gradfunkmirror()
gradfunkmirror()
gradfunkmirror()

return last
}
# Border processing fix for GrandFun by MugFunky and Alain2
# Edit by Soulhunter: Changed strength from int -> float

Function GradFunkMirror( clip c, float "strength" )
{
strength = default( strength, 1.1)
w = c.width()
h = c.height()
vflip = c.FlipVertical()
hflip = c.FlipHorizontal()

stackhorizontal( hflip.crop( w-16, 0, 16, h ).addborders( 0, 16, 0, 16 ),
\ stackvertical( vflip.crop( 0, h-16, w, 16 ), c, vflip.crop( 0, 0, w, 16 ) ),
\ hflip.crop( 0, 0, 16, h ).addborders( 0, 16, 0, 16 ) )
gradfun2db( strength )
crop( 16, 16, -16, -16 )

Return last
}
matfra is offline   Reply With Quote
Old 1st September 2012, 17:21   #2  |  Link
Jawed
Registered User
 
Join Date: Jan 2008
Location: London
Posts: 161
Seems like you found something I wrote.

I failed to get it to work multi-threaded, so if anyone has an answer I'd be interested.

By the way, here is the version I now use:

Code:
function BlockKiller(clip source, int "Scaling", int "ScalingUV")
{
    Scaling = default(Scaling,4)   # 4 is not too arduous
    ScalingUV = default(ScalingUV,Scaling)   # 4 is not too arduous
    
    y=source.greyscale()
    y=y.ChannelBlockKiller(Scaling) 
    u=source.utoy()
    u=u.ChannelBlockKiller(ScalingUV) 
    v=source.vtoy()
    v=v.ChannelBlockKiller(ScalingUV) 
      
    return ytouv(u, v, y)  
}

function ChannelBlockKiller(clip source, int "Scaling")
{
    Scaling = default(Scaling,4)   # 4 is not too arduous
    source
    (Scaling >= 16) ? spline36resize(source.width*16,source.height*16).gradfunkmirror().gradfunkmirror().gradfunkmirror() : last
    (Scaling >= 8) ? spline36resize(source.width*8,source.height*8).gradfunkmirror().gradfunkmirror().gradfunkmirror() : last
    (Scaling >= 4) ? spline36resize(source.width*4,source.height*4).gradfunkmirror().gradfunkmirror().gradfunkmirror() : last
    (Scaling >= 2) ? spline36resize(source.width*2,source.height*2).gradfunkmirror().gradfunkmirror().gradfunkmirror() : last
    (Scaling >= 1) ? spline36resize(source.width,source.height).gradfunkmirror().gradfunkmirror().gradfunkmirror() : last
    last

    return last
}
I added parameters to control luma and chroma separately.

Makes experimentation much easier.

Truthfully, I use this filter very rarely, because it's so strong. Stuff gets very blurry very fast! So low settings are usually better.

If you want to try to make it faster one thing you can do is change the resizer to something faster than spline36resize.

One thing you should do is to use setmemorymax with a large value, because BlockKiller uses huge amounts of memory.
Jawed is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 11:52.


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