Hey there folks of digitalFAQ
I want to remove or reduce these 2 types of noises from the video samples that i'm attaching below. The first 2 videos contains noises to be present in dark areas & the other 2 videos contains noises in bright areas or the entire video to be exact. They are h264 .m2ts & mpeg2 .ts files. Please help.
The movie in the two .ts samples is permanently ruined. The disturbance you see isn't "noise". It is damaged to the point where there is no usable video data to work with. Playing with the color is about all you can do.
BTW, none of those videos are BluRay compliant. 1920x1080 progressive video @25fps is not valid for authored BluRay, which at that frame size and frame rate must be encoded as interlaced. The script above changes the frame rate to the original 24fps film speed, which is valid for 1920x1080p BluRay and which doesn't look and sound ridiculous as it does when speeded up to 25fps.
The noises present in the video i'm attaching other than the dirts, scratches & spots, there is some compression noises in the dark areas kinda like macro blocks (coz they are not exactly block shaped). Is there a filter to remove or reduce that types of noises?
Hey sanlyn what is the best deblock filter to use?
There is no "best" deblocker. DeBlock is among the strongest but is also more destructive. DeBlock_QED uses DeBlock internally but has more specific parameters. The dither 16-bit plugin package has additional tweaks that people add to deblock operations that help prevent posterizing effects after removing macroblocks, such as GradFun3 and filters that add fine film grain effects.
I didn't see any macroblocks in the samples posted in this thread.
1. DeBlock_QED_MT2Mod.avsi is the latest version. Internally the filter is still called "DeBlocK_QED", so there is no change in the way the filter appears in a script. It is fully compatible with older scripts that used the earlier "DeBlock_QED.avsi". http://avisynth.nl/index.php/Deblock_QED
# Changes 2008-08-18: (Didée)
# - Replaced the ugly stackXXX cascade with mt_LutSpa() (requires MaskTools v2.0a35)
# - Changed Quant and Offset defaults to 24,28,2,4,4,8
# Changes 2010-05-25:
# - Explicitly specified parameters of mt_LutSpa()
# (required due to position of new 'biased' parameter, starting from MaskTools 2.0a43)
# - Non mod 16 input is now padded with borders internally
# Changes 2010-08-18:
# - Replaced AddBorders with PointResize
# - Changed Quant and Offset defaults to 18,19,3,4,1,1 to reduce blurring
# Changes 2010-10-16:
# - Replaced 'relative' with the new 'mode' parameter in mt_LutSpa(), starting from MaskTools 2.0a45
# - Changed Quant and Offset defaults to 24,26,1,1,2,2 to increase effectiveness, but still within sensible limits.
# (see for details: http://forum.doom9.org/showthread.php?p=810932#post810932)
function Deblock_QED ( clip clp, int "quant1", int "quant2",
\ int "aOff1", int "bOff1", int "aOff2", int "bOff2", int "uv" )
quant1 = default( quant1, 24 ) # Strength of block edge deblocking
quant2 = default( quant2, 26 ) # Strength of block internal deblocking
aOff1 = default( aOff1, 1 ) # halfway "sensitivity" and halfway a strength modifier for borders
aOff2 = default( aOff2, 1 ) # halfway "sensitivity" and halfway a strength modifier for block interiors
bOff1 = default( bOff1, 2 ) # "sensitivity to detect blocking" for borders
bOff2 = default( bOff2, 2 ) # "sensitivity to detect blocking" for block interiors
uv = default( uv, 3 ) # u=3 -> use proposed method for chroma deblocking
# u=2 -> no chroma deblocking at all (fastest method)
# u=1|-1 -> directly use chroma debl. from the normal|strong deblock()
# add borders if clp is not mod 8
padX = clp.width%8 == 0 ? 0 : (8 - clp.width%8)
padY = clp.height%8 == 0 ? 0 : (8 - clp.height%8)
clp=clp.pointresize(clp.width+padX, clp.height+padY, 0, 0, clp.width+padX, clp.height+padY)
block = clp.mt_LutSpa(mode="absolute",expr="x 1 + 8 % 1 < x 8 % 1 < y 1 + 8 % 1 < y 8 % 1 < | | | 255 0 ?",U=3,V=3)
# create normal deblocking (for block borders) and strong deblocking (for block interiour)
normal = clp.deblock(quant=quant1,aOffset=aOff1,bOffset=bOff1)
strong = clp.deblock(quant=quant2,aOffset=aOff2,bOffset=bOff2)
# build difference maps of both
normalD = mt_makediff(clp,normal,chroma=uv>2?"process":"ignore")
strongD = mt_makediff(clp,strong,chroma=uv>2?"process":"ignore")
# separate border values of the difference maps, and set the interiours to '128'
normalD2 = mt_lutxy(normalD,block,expr="y 255 == x 128 ?",U=uv,V=uv)
strongD2 = mt_lutxy(StrongD,block,expr="y 255 == x 128 ?",U=uv,V=uv)
# interpolate the border values over the whole block: DCTFilter can do it. (Kiss to Tom Barry!)
# (Note: this is not fully accurate, but a reasonable approximation.)
# add borders if clp is not mod 16
remX = sw%16 == 0 ? 0 : (16 - sw%16)
remY = sh%16 == 0 ? 0 : (16 - sh%16)
strongD3 = strongD2.pointresize(sw+remX, sh+remY, 0, 0, sw+remX, sh+remY).mt_lut(expr="x 128 - 1.01 * 128 +",U=uv,V=uv)\
# apply compensation from "normal" deblocking to the borders of
# the full-block-compensations calculated from "strong" deblocking ...
strongD4 = mt_lutxy(strongD3,normalD2,expr="y 128 == x y ?",U=uv,V=uv)
# ... and apply it.
# simple decisions how to treat chroma
deblocked = (uv<0) ? deblocked.mergechroma(strong) : uv<2 ? deblocked.mergechroma(normal) : deblocked
deblocked.crop(0,0,-padX,-padY) # remove mod 8 borders