SHOW:
|
|
- or go back to the newest paste.
1 | # Y'et A'nother H'alo R'educing script | |
2 | ||
3 | function YAHR(clip clp) | |
4 | { | |
5 | b1 = clp.minblur(2).removegrain(11,-1) | |
6 | b1D = mt_makediff(clp,b1) | |
7 | w1 = clp.aWarpSharp(depth=32,blurlevel=2,thresh=0.5) | |
8 | w1b1 = w1.minblur(2,1).removegrain(11,-1) | |
9 | w1b1D = mt_makediff(w1,w1b1) | |
10 | DD = b1D.repair(w1b1D,13) | |
11 | DD2 = mt_makediff(b1D,DD) | |
12 | clp.mt_makediff(DD2,U=2,V=2) | |
13 | } | |
14 | ||
15 | ||
16 | - | # YAHR A.SONY mod 1.37 , original YAHR was by Didée |
16 | + | |
17 | # YAHR A.SONY mod 1.37, original YAHR was by Didée | |
18 | # good deHalo for modern DVD and other cases | |
19 | ||
20 | function YAHR2(clip clp, int "depth", int "blur", bool "useawarp4") | |
21 | { | |
22 | ||
23 | depth = Default(depth, 8) | |
24 | useawarp4 = Default(useawarp4, false) | |
25 | ||
26 | b1 = clp.minblur(2).removegrain(11,-1) | |
27 | b1D = mt_makediff(clp,b1) | |
28 | w1 = useawarp4 ? clp.aWarpSharp4xx(depth=depth,blur=blur,chroma=1,useawarp4=true) : clp.aWarpSharp2(depth=depth,blur=blur,chroma=1) | |
29 | w1b1 = w1.minblur(2,1).removegrain(11,-1) | |
30 | w1b1D = mt_makediff(w1,w1b1) | |
31 | DD = b1D.repair(w1b1D,13) | |
32 | DD2 = mt_makediff(b1D,DD) | |
33 | clp.mt_makediff(DD2,U=2,V=2) | |
34 | } | |
35 | ||
36 | ||
37 | function YAHR3(clip src, int "depth", int "radius", int "blur", bool "useawarp4") | |
38 | { | |
39 | depth = Default(depth, 32) | |
40 | radius = Default(radius, 6) | |
41 | src | |
42 | edgm = EMask_dhh(ColorYUV(autogain=true), 3, 140,true) | |
43 | hfil = YAHR2(depth=depth,blur=blur,useawarp4=useawarp4) | |
44 | RM2 = DR_Radius_dhh(edgm.mt_inflate(),radius,0).mt_inflate() | |
45 | DeRinging = mt_Merge(hfil, src, edgm.mt_inflate(155,155)) | |
46 | mt_Merge(src, DeRinging, RM2, u=2, v=2) | |
47 | } | |
48 | ||
49 | ||
50 | # YAHRmask, by Tophf | |
51 | # With slight modifications (merging both functions into one). Output should be identical. | |
52 | ||
53 | function YAHRmask(clip input, int "expand", int "warpdepth", int "blur", bool "useawarp4", clip "yahr") { | |
54 | ||
55 | expand = Default(expand, 5) | |
56 | warpde = Default(warpdepth, 32) | |
57 | blur = Default(blur, 2) | |
58 | ||
59 | yahr = defined(yahr) ? yahr : input.YAHR2(warpde, blur, useawarp4) | |
60 | ||
61 | input | |
62 | vEdge = mt_lutxy(last, mt_expand().mt_expand(),"x y - abs 8 - 7 <<") | |
63 | ||
64 | mt_merge(yahr, vEdge.binomialblur(expand*2, u=1, v=1) | |
65 | \ .mt_lut("x 4 <<") | |
66 | \ .mt_logic(vEdge.removegrain(12, -1) | |
67 | \ .mt_invert(), "min"), true) | |
68 | } |