Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
14th June 2020, 11:11 | #1 | Link |
Registered User
Join Date: Apr 2007
Posts: 33
|
CCD - Camcorder Color Denoise (Chroma spatial denoiser) - AVISynth+ version
CCD - Camcorder Color Denoise (Chroma spatial denoiser) - AVISynth+ version
Hello to all. @Guest @tritical @pinterf and other respected filter makers Who can and knows exactly how: Please make a version for AVISynth+ (x64 + MT) of VirtualDub filter "CCD - Camcorder Color Denoise" by Sergey Stolyarevsky. http://acobw.narod.ru > Camcorder color denoise http://acobw.narod.ru/file/ccd.zip Sources here: https://forum.doom9.org/showthread.p...25#post1916925 This filter "CCD" works much more correctly, and really suppresses chroma noise within the frame, without creating graphic artifacts, unlike the filter "Cnr2". It would be very useful to have it in the form of a filter for AVISynth+ so that we can work using x64 + MT and directly in the YV12 color space without the need for double conversion YV12> RGB32> YV12. Screenshots of some frames before and after processing by the filter "CCD - Camcorder Color Denoise" I attached. CCD-Screenshots.zip (3.1 МБ) - PNG https://mega.nz/file/ag5GFC4J#LWgqMq...LG3k5OaQ0BDOJI Last edited by zybex; 27th June 2020 at 19:11. |
14th June 2020, 12:18 | #2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
In all probability, the filter you mention relies on RGB to do its thing, YUV conversion would likely not work as well or at all.
User Guest, has now undergone his latest transmogrification into videoh, and I suspect that he is currently on a 30 day 'vacation'. Tritical, long time missing.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
14th June 2020, 13:12 | #4 | Link |
RipBot264 author
Join Date: May 2006
Location: Poland
Posts: 7,815
|
I would not be so sure... Try slamming the revolving door
__________________
Windows 7 Image Updater - SkyLake\KabyLake\CoffeLake\Ryzen Threadripper |
14th June 2020, 14:34 | #5 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Maybe not impossible, maybe just improbable.
Zybex, Asking for anybody to emulate CCD without some source code is also improbable outcome [unless you know specifically and can point to method used] This has problem in x64 but works in x86 Code:
# 64 bit VDF fails with error 0xC1, but filter works OK in VDUB2 x64, possible AVS+ VDubFilter.dll problem. # VDub GUI "Show Noise" and "Disable" args not available external to VDUB, ie not usable in Avisynth. # VDF accepts only RGB32 Function VD_CCD(clip clip, int "threshold", bool "multithreading",bool "ShowNoise",Int "preroll") { threshold = Default(threshold,30) # Default 30 as in Vdub multithreading = Default(multithreading,true) # Default true ShowNoise = Default(ShowNoise,False) # Simulated preroll = Default(preroll,1) # We've given default of 1 frames pre-rolled, maybe only 0 needed. Assert(clip.IsRGB32,"VD_CCD: Need RGB32") LoadVirtualdubPlugin("D:\VDUB\ccd_32bit.vdf", "_VD_CCD", preroll) # Change Path to VDF # LoadVirtualdubPlugin("D:\VDUB\ccd_64bit.vdf", "_VD_CCD", preroll) # Change Path to VDF ## Getting Error OXC1 for 64 bit VDF plugin result = clip._VD_CCD(threshold,multithreading?1:0) return (ShowNoise) ? result.Subtract(clip) : result } SHOWNOISE=False AviSource("D:\parade.avi") # Added, FIX WEIRD stuff MOD=16 Crop(0,0,Width/MOD*MOD,height/MOD*MOD) ConvertToRGB32(matrix="rec601") VD_CCD(shownoise=SHOWNOISE) EDIT: Added ShowNoise simulated arg, not sure if working ok. [test clip giving weird result] Here wierd results, weird at top of frame, maybe again VdubFilter.dll problem [there is some color variation in the main grey block] EDIT: VD_CCD(threshold=0,shownoise=true) should provide no change, but gives same weird problem at top of frame. EDIT: This fixed problem if before the function call, weird stuff gone [MOD=8 dont fix it] Code:
MOD=16 Crop(0,0,Width/MOD*MOD,height/MOD*MOD)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 19th June 2020 at 10:32. |
14th June 2020, 15:21 | #6 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Added AMP arg,
Code:
# 64 bit VDF fails with error 0xC1, but filter works OK in VDUB2 x64, possible AVS+ VDubFilter.dll problem. # VDub GUI "Show Noise" and "Disable" args not available external to VDUB, ie not usable in Avisynth. # VDF accepts only RGB32 Function VD_CCD(clip clip, int "threshold", bool "multithreading",bool "ShowNoise",Bool "Amp",Int "preroll") { threshold = Default(threshold,30) # Default 30 as in Vdub multithreading = Default(multithreading,true) # Default true ShowNoise = Default(ShowNoise,False) # Simulated Amp = Default(Amp,True) # Amplify if ShowNoise preroll = Default(preroll,1) # We've given default of 1 frames pre-rolled, maybe only 0 needed. Assert(clip.IsRGB32,"VD_CCD: Need RGB32") LoadVirtualdubPlugin("D:\VDUB\ccd_32bit.vdf", "_VD_CCD", preroll) # Change Path to VDF # LoadVirtualdubPlugin("D:\VDUB\ccd_64bit.vdf", "_VD_CCD", preroll) # Change Path to VDF ## Getting Error OXC1 for 64 bit VDF plugin result = clip._VD_CCD(threshold,multithreading?1:0) return (!ShowNoise) ? result : (!amp) ? result.Subtract(clip) : result.Subtract(clip).Levels(128-8,1.0,128+8,0,255,coring=false) } THRESHOLD=30 SHOWNOISE=true AMP =true AviSource("D:\parade.avi") # FIX VDubFilter.dll Weird BUG, but not the x64 bug MOD=16 Crop(0,0,Width/MOD*MOD,height/MOD*MOD) ConvertToRGB32(matrix="rec601") VD_CCD(threshold=THRESHOLD,shownoise=SHOWNOISE,amp=AMP) NOTE, RGB Interleaved is internally upside down, so weird stuff at top of frame is actually near end of frame buffer. EDIT: OOps, used AMP center 126, changed to 128 [subtract for YUV TV levels Y is 125.5 rounded to 126, but we are in RGB so need 128]
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 14th June 2020 at 16:53. |
14th June 2020, 17:52 | #7 | Link | |
Registered User
Join Date: Apr 2007
Posts: 33
|
Quote:
Snowman https://derevenets.com Last edited by zybex; 18th June 2020 at 09:08. |
|
14th June 2020, 18:53 | #9 | Link |
Registered User
Join Date: Apr 2007
Posts: 33
|
So far i have found a way out:
As a replacement for the "CCD - Camcorder Color Denoise" filter in AVISynth, I selected the "TBilateral" filter parameters to make it work only to suppress Chroma noise. With such a line, the result of "TBilateral" is almost identical to "CCD - Camcorder Color Denoise" with Threshold=20: TBilateral (diameterL=3, diameterC=11, sDevL=0, sDevC=3.0, iDevL=0, iDevC=7.0, csL=1.0, csC=1.0, d2=false, chroma=true, gui=false, kernS=2, kernI=2, resType=0) |
14th June 2020, 19:07 | #10 | Link |
Registered User
Join Date: Apr 2007
Posts: 33
|
But the TBilateral filter is slow.
My next dream wish is: So that in the fast-running filter DGDecNV> DGDenoise (fast stand-alone CUDA filter that implements NLM denoising) made a separate adjustment of parameters for Chroma noise reduction. Now there the noise reduction parameters for Chroma and Luma can only be the same, which does not allow to achieve an ideal result. http://rationalqm.us/dgdecnv/dgdecnv.html http://rationalqm.us/board/viewtopic.php?f=14&t=506 DGDenoise(clip c, float strength, float blend, bool chroma, int searchw, int device) |
14th June 2020, 19:23 | #11 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,731
|
You can run DGDenoise twice and use Mergexxx.
chromadenoise = DGDenoise(strength=whatever) lumadenoise = DGDenoise(strength=whatever2) lumadenoise.MergeChroma(chromadenoise)
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
14th June 2020, 21:57 | #13 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Using a decompiler to re-code a plugin would I think constitute Code Theft.
You would need to find Public domain or Open Source, source code, or algorithm. DGDenoise for chroma, might try look here(I dont use DGdenoise):- http://avisynth.nl/index.php/Swap and here:- http://avisynth.nl/index.php/Extract
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 15th June 2020 at 00:08. |
15th June 2020, 04:54 | #14 | Link | |
Registered User
Join Date: Apr 2007
Posts: 33
|
Quote:
"CCD uses the advantages of RGB, so translation into other formats is possible only in sham, inside you still have to translate into RGB." (translated from Russian) Nevertheless, I have already managed to achieve a very similar result directly in the YV12 mode using the special Chroma setting of the "TBilateral" filter, as I wrote above. |
|
15th June 2020, 05:09 | #15 | Link | |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,731
|
Quote:
MergeChroma(chromadenoise)
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
|
15th June 2020, 05:15 | #16 | Link | |
Registered User
Join Date: Apr 2007
Posts: 33
|
Quote:
I think that he uses the secret technologies of ancient or extraterrestrial civilizations :-) Updated 18 June: Sources here: https://forum.doom9.org/showthread.p...10#post1916010 Last edited by zybex; 18th June 2020 at 09:11. |
|
15th June 2020, 06:12 | #18 | Link | |
Registered User
Join Date: Apr 2007
Posts: 33
|
Quote:
Thanks. It remains only to figure out which combination of filter commands "Extract" and "Swap" need to be composed to process only Chroma through DGDenoise. |
|
15th June 2020, 07:01 | #19 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
For YV12 do something like: Code:
Source Y = Last U = UToY().DGDenoise(strength=0.20, chroma=false) # chroma processing is already set to false by default V = VToY().DGDenoise(strength=0.25, chroma=false) YToUV(U,V,Y) Code:
Source ConvertBits(16) Y = Last U = ShowU(pixel_type="YUV420P16").DGDenoise(strength=0.20, chroma=false) V = ShowV(pixel_type="YUV420P16").DGDenoise(strength=0.25, chroma=false) CombinePlanes(Y,U,V, planes="YUV", source_planes="YYY", sample_clip=Y) # instead of 'sample_clip' you can also you pixel_type="YUV420P16" Last edited by Reel.Deel; 15th June 2020 at 07:45. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|