Quantcast KDVD: Updating my Script for KDVD from DVD - digitalFAQ.com Forums [Archives]
  #1  
03-12-2006, 08:52 PM
maurus maurus is offline
Free Member
 
Join Date: Oct 2003
Location: Madrid
Posts: 387
Thanks: 0
Thanked 0 Times in 0 Posts
Hello.

I want to update my script for make KDVD from DVD source.

But I actually using the GripFit_YV12 (SansGrip filters) for the resize an sharp, for automatic process without FitCD.


1) GripCrop(%x%, %y%, overscan=2, source_anamorphic=%s_anamorphic%, dest_anamorphic=%d_anamorphic%)
2) BicubicResize(GripFit_resize_width, GripFit_resize_height, 0, 0.6)
3) RemoveGrain().Deen()
4) GripBorders()

I read than I can replace my line 3) for LRemoveDust_YV12(17,1) but ...

I must put this line before the 2) BicubicResize?

I need the LimitedSharpenFaster if I use Bicubicresize (this sharp and resize, I think)?

I must replace BicubicResize for the new LimitedSharpenFaster?

In what dll (for LoadPlugin) it's the LRemoveDust_YV12 and LimitedSharpenFaster ? RemoveGrain 1.0?

Thanks for all.

-Maurus
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
03-12-2006, 09:02 PM
sparskter sparskter is offline
Free Member
 
Join Date: Jul 2005
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Hello. For LREMOVEDUST you do the following:
Quote:
function LRemoveDust_YUY2(clip input, int clmode, int "limit")
{
clmode=default(clmode,17)
limit=default(limit,2)
repmode = 2
clensed = Clense(input, grey=true)
rep = Repair(clensed, input, mode=repmode, modeU=-1)
rg = RemoveGrain(rep, mode=clmode, modeU=-1)
return LimitChange(rg, input, limit, limitU=255)
}

function LRemoveDust_YV12(clip input, int clmode, int "limit")
{
clmode=default(clmode,17)
limit=default(limit,2)
repmode = 2
clensed = Clense(input)
rep = Repair(clensed, input, mode=repmode)
rg = RemoveGrain(rep, mode=clmode)
return LimitChange(rg, input, limit)
}
save as LREMOVEDUST.AVS
Then you load this way:
Quote:
LOADPLUGIN("D:\filters\RemoveGrain\SSETools.dll")
LOADPLUGIN("D:\filters\RemoveGrain\Repair.dll")
LOADPLUGIN("D:\filters\RemoveGrain\RemoveGrain.dll ")
IMPORT("D:\FILTERS\LREMOVEDUST.AVS")
LRemoveDust_YV12(17,2)
http://rapidshare.de/files/15367393/...Grain.zip.html

edit: Limited Sharpen Faster ->http://www.avisynth.org/LimitedSharpen

you Import the script same way above
Reply With Quote
  #3  
03-12-2006, 09:05 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi maurus,

You should remove GripFit, and use AviSynth's resizer, because GripFit is known to cause problems with some sources.

-kwag
Reply With Quote
  #4  
03-12-2006, 09:25 PM
sparskter sparskter is offline
Free Member
 
Join Date: Jul 2005
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
ok, full code just to be sure XD:
Code:
# LimitedSharpen()   ( a modded version, 29 Oct 2005 )
#
# A multi-purpose sharpener by Didée
#
# 
# Changes in this mod:
#
# - RemoveGrain >= v0.9  IS REQUIRED!!
#   ==================================
#
# - Smode=4   / sometimes does the magic ;-)
# - a separate "undershoot" parameter, to allow for some line darkening in comic or Anime 
# - Lmode=3   / on edges, limited sharpening with zero OS & US. On not-edges, limited sharpening with specified OS + LS
# - "soft" acts different now: no more boolean true/false, but instead integer 0 - 100  (or -1 -> automatic)
#    instead of blurring before finding minima/maxima, it now softens the "effect-of-sharpening"
# - edgemode=-1 now shows the edgemask. (scaling still not implemented :p )
#
## - MODIFIED version using MaskTools 2.0

function LimitedSharpenFaster( clip clp, 
 \                       float "ss_x",   float "ss_y", 
 \                       int   "dest_x", int   "dest_y",
 \                       int   "Smode" , int   "strength", int  "radius", 
 \                       int   "Lmode",  bool  "wide",     int  "overshoot", int "undershoot",
 \                       int   "soft",   int   "edgemode", bool "special",
 \                       int   "exborder" )
{
ox = clp.width
oy = clp.height

Smode     = default( Smode,       3 )
ss_x      = (Smode==4)
 \        ? default( ss_x,      1.25)
 \        : default( ss_x,      1.5 )
ss_y      = (Smode==4)
 \        ? default( ss_y,      1.25)
 \        : default( ss_y,      1.5 )
dest_x    = default( dest_x,     ox )
dest_y    = default( dest_y,     oy )
strength  = (Smode==1)
 \        ? default( strength,  160 )
 \        : default( strength,  100 )
strength  = (Smode==2&&strength>100) ? 100 : strength
radius    = default( radius,      2 )
Lmode     = default( Lmode,       1 )
wide      = default( wide,    false )
overshoot = default( overshoot, 1)
undershoot= default( undershoot, overshoot)
softdec   = default( soft,        0 )
soft    =  softdec!=-1 ? softdec : sqrt( (((ss_x+ss_y)/2.0-1.0)*100.0) ) * 10
soft    = soft>100 ? 100 : soft
edgemode  = default( edgemode,    0 )
special   = default( special, false )
exborder  = default( exborder, 0)
#radius =   round( radius*(ss_x+ss_y)/2)  #  If it's you, Mug Funky - feel free to activate it again  
xxs=round(ox*ss_x/8)*8
yys=round(oy*ss_y/8)*8
smx=exborder==0?dest_x:round(dest_x/Exborder/4)*4
smy=exborder==0?dest_y:round(dest_y/Exborder/4)*4

clp.isYV12() ? clp : clp.converttoyv12()

ss_x != 1.0 || ss_y != 1.0 ? last.lanczosresize(xxs,yys) : last
tmp = last

edge = mt_logic( tmp.mt_edge(thY1=0,thY2=255,"8 16 8 0 0 0 -8 -16 -8 4")
 \              ,tmp.mt_edge(thY1=0,thY2=255,"8 0 -8 16 0 -16 8 0 -8 4")
 \              ,"max") .mt_lut("x 128 / 0.86 ^ 255 *") #.levels(0,0.86,128,0,255,false) 

tmpsoft       = tmp.removegrain(11,-1)
dark_limit1   = tmp.mt_inpand()
bright_limit1 = tmp.mt_expand()
dark_limit    = (wide==false) ? dark_limit1   : dark_limit1  .removegrain(20,-1).mt_inpand()
bright_limit  = (wide==false) ? bright_limit1 : bright_limit1.removegrain(20,-1).mt_expand() 
minmaxavg     = special==false
 \            ? mt_average(dark_limit1, bright_limit1)
 \            : mt_merge(dark_limit,bright_limit,tmp.removegrain(11,-1),Y=3,U=-128,V=-128)

Str=string(float(strength)/100.0)
normsharp = Smode==1 ? unsharpmask(strength,radius,0) 
 \        : Smode==2 ? sharpen(float(strength)/100.0) 
 \        : Smode==3 ? mt_lutxy(tmp,minmaxavg,yexpr="x x y - "+Str+" * +")
 \        :            mt_lutxy(tmp,tmpsoft,"x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+
 \                       " * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?")

OS = string(overshoot)
US = string(undershoot)
mt_lutxy( bright_limit, normsharp, yexpr="y x "+OS+" + < y x y x - "+OS+" - 1 2 / ^ + "+OS+" + ?")
mt_lutxy( dark_limit, last, yexpr="y x "+US+" - > y x x y - "+US+" - 1 2 / ^ - "+US+" - ?")

Lmode==1 ? mt_clamp(normsharp, bright_limit, dark_limit, overshoot, undershoot) : last
 
normal = last
zero   = mt_clamp(normsharp, bright_limit, dark_limit, 0,0)

Lmode==3 ? mt_merge(normal,zero,edge.mt_inflate()) : normal

      edgemode==0  ?  last 
 \  : edgemode==1  ?  mt_merge(tmp,last,edge.mt_inflate().mt_inflate().removegrain(11,-1),Y=3,U=1,V=1)
 \  :                 mt_merge(last,tmp,edge.mt_inflate().mt_inflate().removegrain(11,-1),Y=3,U=1,V=1)

AMNT  = string(soft)
AMNT2 = string(100-soft)
sharpdiff=mt_makediff(tmp,last)
sharpdiff2=mt_lutxy(sharpdiff,sharpdiff.removegrain(19,-1),
 \           "x 128 - abs y 128 - abs > y "+AMNT+" * x "+AMNT2+" * + 100 / x ?")

soft==0 ? last : mt_makediff(tmp,sharpdiff2)
  
     (ss_x != 1.0 || ss_y != 1.0) 
\ || (dest_x != ox || dest_y != oy) ? lanczosresize(dest_x,dest_y) : last

ex=blankclip(last,width=smx,height=smy,color=$FFFFFF).addborders(2,2,2,2).coloryuv(levels="TV->PC")
 \.blur(1.3).mt_inpand().blur(1.3).bicubicresize(dest_x,dest_y,1.0,.0)
tmp =  clp.lanczosresize(dest_x,dest_y)

clp.isYV12() ? ( exborder==0 ? tmp.mergeluma(last)
 \                           : mt_merge(tmp,last,ex,Y=3,U=1,V=1) )
 \           : ( exborder==0 ? tmp.mergeluma(last.converttoyuy2())
 \                           : tmp.mergeluma( mt_merge(tmp.converttoyv12(),last,ex,Y=3,U=1,V=1)
 \                                           .converttoyuy2()) )
 
(edgemode!= -1) ? last : edge.lanczosresize(dest_x,dest_y).greyscale

return last
}
save as LimitedSharpenfaster.avs

then:
Quote:
LOADPLUGIN("D:\filters\RemoveGrain\SSETools.dll")
LOADPLUGIN("D:\filters\RemoveGrain\RemoveGrain.dll ")
LOADPLUGIN("D:\filters\RemoveGrain\Repair.dll")
LOADPLUGIN("D:\filters\warpsharppackage_25_dll_200 31103\warpsharp.dll")
LOADPLUGIN("D:\filters\masktools-v2.0a27\mt_masktools.dll")
IMPORT("D:\FILTERS\LimitedSharpenfaster.avs")
LimitedSharpenFaster()
Lanczos4Resize(704,480,0,0,640,272)
Addborders(8,0,8,0)
NOTE: you may have problems at this point:
sharpdiff2=mt_lutxy(sharpdiff,sharpdiff.removegrai n(19,-1),
I changed 19 to 4, but 4 is not the original script :/ But it works :/
http://rapidshare.de/files/15368180/....0a27.zip.html
http://rapidshare.de/files/15368202/...31103.zip.html
Reply With Quote
  #5  
03-13-2006, 03:44 AM
maurus maurus is offline
Free Member
 
Join Date: Oct 2003
Location: Madrid
Posts: 387
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Hi maurus,

You should remove GripFit, and use AviSynth's resizer, because GripFit is known to cause problems with some sources.

-kwag
I use GripFit for automatic resize ans aspect ratio. I not have any problem for now. But, can I make automatic process with AviSynth resize? A sample?

Thanks.
Reply With Quote
  #6  
03-13-2006, 04:42 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by maurus
I use GripFit for automatic resize ans aspect ratio. I not have any problem for now. But, can I make automatic process with AviSynth resize? A sample?

Thanks.
It's possible to use the functions developped by Vmesquita for Diko. But for me it's far better to use FitCD (or Paranoia) each time and enter manually the crop/resize parameters in the script.

Note that you can also resize directly INTO the limitedsharpen function (supposed to be more efficient, but I never tried).

Quote:
function LimitedSharpenFaster( clip clp,
\ float "ss_x", float "ss_y",
\ int "dest_x", int "dest_y",
\ int "Smode" , int "strength", int "radius",
\ int "Lmode", bool "wide", int "overshoot", int "undershoot",
\ int "soft", int "edgemode", bool "special",
\ int "exborder" )
Reply With Quote
  #7  
03-13-2006, 10:28 AM
maurus maurus is offline
Free Member
 
Join Date: Oct 2003
Location: Madrid
Posts: 387
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Hi maurus,

You should remove GripFit, and use AviSynth's resizer, because GripFit is known to cause problems with some sources.

-kwag
I need use GripFit for automatic resize and aspect ratio in my K-Encoder-HC script. I not have any problem for now...

-Maurus
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Best KDVD Script? The Untouchable Video Encoding and Conversion 3 09-20-2005 10:55 PM
Avisynth: Best Script for KDVD ? cyron Avisynth Scripting 2 11-13-2004 10:34 AM
can i use this script for doing a kdvd? khusru Video Encoding and Conversion 3 02-10-2004 06:28 PM
KDVD: MA Script Questions nicksteel Video Encoding and Conversion 38 01-21-2004 06:18 PM
KDVD: CQ Values for KDVD with MA script? beany101uk Video Encoding and Conversion 7 08-03-2003 02:29 PM

Thread Tools



 
All times are GMT -5. The time now is 03:57 PM  —  vBulletin © Jelsoft Enterprises Ltd