View Single Post
Old 22nd May 2020, 12:42   #13  |  Link
samf88
Registered User
 
Join Date: Oct 2006
Posts: 19
Below is what I've got at the moment. Hopefully it all makes sense and I haven't made any silly mistakes. I'm using AvsPmod to preview/make changes which seems to crash every time I change a parameter, so it wasn't an easy task to adjust things. I haven't yet found an alternative filter to adjust the CMYK levels as suggested by Mounir. I'm also not confident in my grain settings and keep adjusting them. It's possible I've used the masks wrong too - I never was confident using those. I may have switched colour space more than necessary too. I've also taken out all the SetFilterMTMode/Prefetch stuff for the sake of posting here.

Code:
MPEG2Source("movie1.d2v", cpu=0)

# Mounir's Chroma Noise Removal
assumetff()
ConvertToYV16(interlaced=true)
orig=last
ev=orig.assumetff().separatefields().selecteven()
od=orig.assumetff().separatefields().selectodd()
ev
ue_chroma = UToY(ev).blur(0,1.5).binomialblur(5).ttempsmooth(maxr=2,lthresh=150, strength=1)
ve_chroma = VToY(ev).blur(0,1.5).binomialblur(5).ttempsmooth(maxr=2,lthresh=150, strength=1)
YToUV(ue_chroma, ve_chroma)
MergeLuma(ev)
ev_filtered=last
od
uo_chroma = UToY(od).blur(0,1.5).binomialblur(5).ttempsmooth(maxr=2,lthresh=150, strength=1)
vo_chroma = VToY(od).blur(0,1.5).binomialblur(5).ttempsmooth(maxr=2,lthresh=150, strength=1)
YToUV(uo_chroma, vo_chroma)
MergeLuma(od)
od_filtered=last
interleave(ev_filtered,od_filtered)
assumefieldbased().assumetff().weave()

## Mounir's Colour Correction
#ConvertToRGB32(interlaced=true)
#LoadVirtualDubPlugin("VirtualDub\x86\plugins32\CMYK_rj.VDF", "CMYK", 0)
#CMYK(255,0,266,10,257,-24,255,0,0,42) # Modifying Yellow high tones (-24%) and magenta lows (4%)

ConvertToYV12()

LoadPlugin("DeGrainMedian64\DeGrainMedian.dll")
Import("kirsch.avsi")
aux=DeGrainMedian(mode=0, limity=7, interlaced=true)
denoised = KNLMeansCL(d=4,a=4,s=6,h=2.0,channels="Y",rclip=aux)
edgemask1 = ConvertToRGB32(interlaced=true).Kirsch().ConvertToYV12(interlaced=true,matrix="PC.601")
edgemask2 = edgemask1.mt_binarize(120).Blur(1.0).Blur(1.0)
mt_merge(last,denoised,edgemask2)

# Deinterlace
QTGMC(preset="Very Slow", FPSDivisor=2)

# End filtering
DeHalo_alpha_mt()
Grainfactory3mod(g1str=2,g2str=2,g3str=2)

# Shifting image up 1px and cropping (I should probably do the shift and crop all in RGB32 colour space actually)
ConvertToRGB32(matrix="Rec601", interlaced=false)
Crop(0,1,0,0)
AddBorders(0,0,0,1)
ConvertToYV12()
Crop(10, 2, -18, -2)
FillMargins(0,1,0,1) # I like to keep to mod4 resolutions, so this just makes the extra 2px less obvious
samf88 is offline   Reply With Quote