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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th November 2019, 13:48   #1  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,636
Denoising HDR sources

Are there any specific things to keep in mind when denoising HDR sources with filters like MDegrain? What I'm wondering is that as the filter only seems the non-graded pixels, is there any recommended special pre- and post-processing to do? As far as I've understood, resizing should be done in linear light, for example with ResampleHQ.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 3rd December 2019, 19:08   #2  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 183
Quote:
Originally Posted by Boulder View Post
Are there any specific things to keep in mind when denoising HDR sources with filters like MDegrain? What I'm wondering is that as the filter only seems the non-graded pixels, is there any recommended special pre- and post-processing to do? As far as I've understood, resizing should be done in linear light, for example with ResampleHQ.
Quite an interesting question.
In the past i've denoised an HDR clip without questioning too much using MVTools giving me the results i expect, so maybe it doesn't need any particular pre-processing?
But I'd expect that passing a tonemapped clip to the analisys part of MVTools may be better? I really don't know.
MonoS is offline   Reply With Quote
Old 3rd December 2019, 22:13   #3  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,200
Once the HDR still or video has been created, it is just pixels, like any other video. Yes, it has a certain "look" because of the gamma mapping, but I don't think the denoiser would "care" about how those noise pixels got there.

The only thing I can think of that might be a little different is that HDR photos and videos seldom have any totally black areas because the overexposed image (which gets mixed with the underexposed image to achieve the HDR effect) provides detail in areas that would otherwise be black. Therefore, if any of the denoisers include algorithms for denoising near-black areas more aggressively, that feature might want to be turned off or diminished.

Last edited by johnmeyer; 3rd December 2019 at 22:14. Reason: clarification
johnmeyer is offline   Reply With Quote
Old 4th December 2019, 04:12   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,267
For any kind of MC denoise on any Hi Def, I think maybe that a Blur prefilter on clip to MSuper (for MAnalyse) would be a good idea.
(although I dont do much in any HiDef, and non at all on HDR).

EDIT: Maybe something like this (totally untested, might crash)

Code:
# Mod from, McDegrain/McDegrainSharp, From:- http://forum.doom9.org/showthread.php?p=1737045#post1737045

Function MCDegrainHD(clip c, int "frames", float "bblur") {
    frames = default(frames, 2)
#    bblur  = default(bblur, 0.6)
    defbblur = (c.width>1920) ? 0.75 : (c.width>1280) ? 0.7 : (c.width>960 ) ? 0.65 : 0.6
    bblur  = default(bblur, defbblur)
    bs     = (c.width>1920) ? 32 : (c.width>1280) ? 24 : (c.width>960 ) ? 16 : 8    # EDIT: Added block size 32
    superFilt     = c.blur(bblur).MSuper(pel=2, sharp=1)    # EDIT: Make MC block matching easier for MAnaylse & 'gritty' source, using blur.
    super_rend    = c.MSuper(pel=2, sharp=1,levels=1)   # Only 1 Level required for render Super (not MAnalyse-ing)
    backward_vec3 = MAnalyse(superFilt, isb = true,  delta = 3, blksize=bs, overlap=bs/2)
    backward_vec2 = MAnalyse(superFilt, isb = true,  delta = 2, blksize=bs, overlap=bs/2)
    backward_vec1 = MAnalyse(superFilt, isb = true,  delta = 1, blksize=bs, overlap=bs/2)
    forward_vec1  = MAnalyse(superFilt, isb = false, delta = 1, blksize=bs, overlap=bs/2)
    forward_vec2  = MAnalyse(superFilt, isb = false, delta = 2, blksize=bs, overlap=bs/2)
    forward_vec3  = MAnalyse(superFilt, isb = false, delta = 3, blksize=bs, overlap=bs/2)
    (frames<=0) ? c :\
    (frames==1) ? c.MDegrain1(super_rend, backward_vec1,forward_vec1,thSAD=400) :\
    (frames==2) ? c.MDegrain2(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400) \
                : c.MDegrain3(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400)
    return(last)
}
EDIT: At least it dont crash.
EDIT: Where good MC match on blurred clip (src for superFilt), uses MC matched from degrained super_rend, where not good MC match, uses original non degrained bits from original clip c.
HiDef tends to be 'gritty', and so harder to match using MC, blur should make it easier to MC match blocks. HDR is likely HiDef too.
EDIT: A higher default bBlur might also be a good idea, perhaps about 0.75->1.0 for full HD+, Didee tended to always use 0.6 for pretty much everything [StdDef].

Maybe something like
Code:
#    bblur  = default(bblur, 0.6)
    defbblur = (c.width>1920) ? 0.75 : (c.width>1280) ? 0.7 : (c.width>960 ) ? 0.65 : 0.6
    bblur  = default(bblur, defbblur)
__________________
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; 4th December 2019 at 12:57.
StainlessS is offline   Reply With Quote
Old 4th December 2019, 12:50   #5  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,636
I already apply some blurring on the analysis clip similar to this snippet stolen from QTGMC:

w = clip.Width()
h = clip.Height()
srchClip = clip.RemoveGrain(12,12).GaussResize(w,h, 0,0, w+0.0001,h+0.0001, p=2).MergeLuma(clip, 0.1)

I was just thinking if the whole process needs to be tuned because the image the filters and functions see is so flat compared to an SDR one. But maybe it's just the case of limiting the amount of change which I already do with SDR sources anyway, depending on the amount of noise and actual detail.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 4th December 2019, 13:21   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,267
Well it seems to me that HD tends to be 'gritty', ie pixels representing a small object seem to have a bit of a 'random' component whereas for stddef same object, is less 'random'.
Same small object in next frame not necessarily 'random' in the same way, so is a bit less easy to match blocks in HD (reason for blur).
Maybe the 'amount of change limiting' should be on the final result frame, and not on the analysis frame, you can just use a lesser blur arg for change limit on analysis frames.
EDIT: I aint ever seen an 8K frame, I'm assuming the 'girtty-ness' is even more pronounced therein.
Perhaps the tiny optical sensors are a little susceptible to electrical noise, or some other miniscule phenomena.
__________________
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; 4th December 2019 at 13:28.
StainlessS is offline   Reply With Quote
Old 4th December 2019, 13:47   #7  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,636
Quote:
Originally Posted by StainlessS View Post
Maybe the 'amount of change limiting' should be on the final result frame, and not on the analysis frame, you can just use a lesser blur arg for change limit on analysis frames.
That's what I meant, I simply use the limit and limitc parameters of MDegrain to dampen the effects in the final image. The analysis clip gets blurred normally. When processing in 16 bits, you get more granularity in the limits (in Vapoursynth at least) as the values need to be scaled manually.

From what I've seen, the high frequency grain (often artificial) in UHD is much more apparent than with regular HD so blurring is even more useful.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 4th December 2019, 15:19   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,267
I had forgotten bout limit and limitc, thanks for the reminder.
Quote:
From what I've seen, the high frequency grain (often artificial) in UHD is much more apparent than with regular HD
I say again
Quote:
Originally Posted by StainlessS View Post
Those with "trained eyes" see grain as detail, my untrained eyes just see noise
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 4th December 2019, 17:07   #9  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,636
Well, I have to admit that I do like grain even if it is artificial. I just try to suppress it a bit to increase compressibility. The important thing is the subjective experience; if the added grain can fool my poor brain into thinking that there's real detail and sharpness there, I'm happy A wax-like, oversmoothed video with floating denoised backgrounds is much worse because it will start catching your eye quite easily. Upscaled, blocky and noisy mess of a transfer is a whole new deal though..
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.