View Full Version : Deblocking - Blu-Ray source
johnny_b
15th January 2022, 04:23
This transfer has some of the worst macroblocking I've seen for a commercial Blu-Ray, but mostly on the blue uniforms and, in this clip, on the piano. I've tried several deblocking filters without success but don't have much experience using them. Any suggestions on how to smooth out the blocky areas without losing too much detail elsewhere?
https://www.mediafire.com/file/kad2ygs74mlsn1i/sample.mkv/file
Selur
15th January 2022, 09:42
Probably not that helpful, as it's no Avisynth, but a Vapoursynth solution.
With BasicVSR++ you can minimize the blocking in that area.
using: clip = BasicVSRPP(clip=clip, model=3, tile_x=370, tile_y=540, fp16=True)
(the 'tile_x=370, tile_y=540, fp16=True' part is to compensate that my gpu only has 8GB VRAM)
https://i.ibb.co/hWbS28V/without-gamma.png (https://ibb.co/BZb9TsB)
here with adjusting gamma to 2 for visualization:
https://i.ibb.co/47sZwpJ/with-gamma.png (https://ibb.co/DtGDPQL)
It also removed basically all grain (and is really slow) so it really might not be what you are looking for, but I thought I post it anyways.
After a bit of thinking, some masked strong debanding probably would work also:
# denoising using debanding only dark area
a = last
g_mask = mt_lut("x 128 >= 255 x 16 <= 0 x 16 - 255 * 112 / ? ?").mt_invert()
filtering = GradFun2db(thr=10)
mt_merge(a, filtering, g_mask)
Cu Selur
Sharc
15th January 2022, 10:23
It seems to me that the picture has a greenish tint. Can be seen for example with RGB of the black piano where the green component is stronger than the R an B.
Correct with something like
SmoothTweak(hue1=3,hue2=3)
real.finder
15th January 2022, 15:46
what about this
ConvertBits(16)
o=last
sh_KNLMeansCL(h=1.0)
diff=o.mt_makediff(last,u=3,v=3)
F3KDB_3(grainy=0,output_depth=16).mt_adddiff(diff,u=3,v=3)
https://i.postimg.cc/hzRpPg86/New-File-4-000048.png (https://postimg.cc/hzRpPg86) https://i.postimg.cc/R3DgrKqS/New-File-3-000048.png (https://postimg.cc/R3DgrKqS)
johnny_b
15th January 2022, 16:27
RE: Selur, your settings do get rid of the blocking, but introduce other artifacts, at least in AvsPmod. Look at the white gloves in the original vs in the 'deblocked' version - there's a halo around them against the uniform.
https://i.postimg.cc/TKsCHGxY/original.jpg (https://postimg.cc/TKsCHGxY)
https://i.postimg.cc/5HFphG95/selur.jpg (https://postimg.cc/5HFphG95)
johnny_b
15th January 2022, 16:43
what about this
ConvertBits(16)
o=last
sh_KNLMeansCL(h=1.0)
diff=o.mt_makediff(last,u=3,v=3)
F3KDB_3(grainy=0,output_depth=16).mt_adddiff(diff,u=3,v=3)
https://i.postimg.cc/hzRpPg86/New-File-4-000048.png (https://postimg.cc/hzRpPg86) https://i.postimg.cc/R3DgrKqS/New-File-3-000048.png (https://postimg.cc/R3DgrKqS)
These results look great in your image, but (and apologies for asking such a novice question) which filters am I supposed to load to get this to work? I guess F3KDB_3 is your flash3kyuu_deband.dll, although I had to rename it once loading the plugin for this to work in AvsPmod. mt_adddiff and mt_makediff I think are Masktools2, but I get an error 'I don't know what 'diff' means' after loading Masktools2 (edit - solved by upgrading to the most recent release of Masktools2). sh_KNLMeansCL I saw in another thread is from SMDegrain, but when I import SMDegrain I still get a 'there is no function named sh_KNLMeansCL' error.
johnny_b
15th January 2022, 16:47
It seems to me that the picture has a greenish tint. Can be seen for example with RGB of the black piano where the green component is stronger than the R an B.
Correct with something like
SmoothTweak(hue1=3,hue2=3)
Thank you for this - I agree, that does make the colors look more natural.
kedautinh12
15th January 2022, 16:53
sh_KNLMeansCL from here
https://github.com/realfinder/AVS-Stuff/blob/Community/avs%202.5%20and%20up/Zs_RF_Shared.avsi
F3KDB_3 from here
https://github.com/realfinder/AVS-Stuff/blob/Community/avs%202.5%20and%20up/F3KDB_s.avsi
But if you want real.finder's scripts work, you need download all plugins & scripts from here:
https://github.com/realfinder/AVS-Stuff
And:
https://github.com/Asd-g?tab=repositories
real.finder
15th January 2022, 16:59
These results look great in your image, but (and apologies for asking such a novice question) which filters am I supposed to load to get this to work? I guess F3KDB_3 is your flash3kyuu_deband.dll, although I had to rename it once loading the plugin for this to work in AvsPmod. mt_adddiff and mt_makediff I think are Masktools2, but I get an error 'I don't know what 'diff' means' after loading Masktools2. sh_KNLMeansCL I saw in another thread is from SMDegrain, but when I import SMDegrain I still get a 'there is no function named sh_KNLMeansCL' error.
you need all lines I post
F3KDB_3 is not flash3kyuu_deband
all what you need here (https://forum.doom9.org/showthread.php?t=181989) but if you need only sh_KNLMeansCL and F3KDB_3 then you can get it from Zs_RF_Shared.avsi (for both sh_KNLMeansCL and F3KDB_3) and F3KDB_s.avsi (for F3KDB_3) in https://github.com/realfinder/AVS-Stuff (in avs 2.5 and up folder), mt_adddiff and mt_makediff from Masktools2, nowadays you don't need SMDegrain for this
Off topic but I don't do SMDegrain updates now (dogway is back to update i (https://forum.doom9.org/showthread.php?t=182881)t) but I got NotSMDegrain (https://forum.doom9.org/showthread.php?p=1944538&highlight=NotSMDegrain#post1944538) instead
kedautinh12
15th January 2022, 17:19
F3KDB_3 use both flash3kyuu_deband and neo-f3kdb. If you put flash3kyuu_deband and neo-f3kdb in same autoload plugins folder, neo-f3kdb will use first and faster than flash3kyuu_deband
https://github.com/HomeOfAviSynthPlusEvolution/neo_f3kdb/releases
johnny_b
15th January 2022, 18:03
Thank you - while not perfect (only so much you can do with this type of source I imagine) this looks better than the original Blu-Ray. Appreciate it!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.