# Camembert-v0.1 # # Some weird script snippet I tend to use alot. # I have like 6 different versions of it on my # HD, this is the most common and best working # one. Deblock is for MPEG4 raws, cleanup is # for DVD ones. See whatever works for you. # # Does: HQDering functionality with background # enhancement. # # Needs: MaskTools152, Unfilter, Deen, MPEG2Dec3, # WarpSharp (japanese version). # # Includes: GreyCenteredToMask, a lazy function, # and SluttyBlindPP. Mod16 limitations are sooo # 2001. # function GreyCenteredToMask(clip input) { input.Levels(128, 1, 255, 0, 255, false) one = last input.Levels(0, 1, 128, 255, 0, false) two = last Overlay(one, two, mode="lighten") } function SluttyBlindPP(clip input, int "quant", int "cpu", \ string "cpu2", bool "iPP", int "moderate_h", int "moderate_v") { quant = Default(quant, 2) cpu = Default(cpu, 6) cpu2 = Default(cpu2, "") iPP = Default(iPP, false) moderate_h = Default(moderate_h, 20) moderate_v = Default(moderate_v, 40) input AddBorders(0, 0, (Ceil(input.width/16)+1)*16-input.width, \ (Ceil(input.height/16)+1)*16-input.height) BlindPP(quant=quant, cpu=cpu, cpu2=cpu2, iPP=iPP, \ moderate_h=moderate_h, moderate_v=moderate_v) Crop(0, 0, input.width, input.height) } function Camembert(clip input, bool "deblock", bool "cleanup") { deblock = Default(deblock, true) cleanup = Default(cleanup, false) input Overlay(last, Blur(1).Blur(1), mode="difference") Greycenteredtomask().greyscale() Levels(0, 1, 115, 0, 255, false) mask1 = last Blur(1) Levels(0, 0.4, 64, 0, 255, false) mask = last Blur(1).Blur(1) Levels(0, 1, 30, 0, 255, false).Blur(1) mask2 = last MaskedMerge(input, input.Unfilter(-20, -20), mask) MaskedMerge(last, input.Deen("a3d", 4, 15, 15, 20), mask) Overlay(last, input, mask=mask1, mode="darken", opacity=0.5) deblock ? MaskedMerge(Unsharpmask(100, 2, 0).SluttyBlindPP(quant=15, cpu2="xoxoxo"), last, mask2) \ : MaskedMerge(Unsharpmask(50, 2, 0), last, mask2) cleanup ? Deen("a3d", 4, 3, 5, 10) : last }