Friday, February 26, 2021

Fun with Noise Reduction

At the end of 2014, I was working with some 4K footage from the early days, and it didn’t have enough light — shot indoors. The 4K detail was in there, deep down ... if you could remove the temporal noise and not the spatial noise.

Fast-forward to the end of 2019, and I had a 6K 360° edit that was so information-dense, it needed to upscale to 8K for delivery: I could find no way to create a 6K MP4 the same or smaller size than an 8K MP4 with the same PQ. However, I left a large opportunity for datarate savings on the table — I didn’t have time to find a perceptually transparent temporal noise filter.

As we move into an era of reliance on upscaling and ML reconstruction, we need to preserve a lot of the "noise" texture that was in the lower resolution formats. It’s the same gotcha we had when moving from perfect analogue -> typical digital.

I’ve been meaning to write this up for 6 years.

Jumping straight to the conclusions, here's what I learned:

  • HQDN3D has easy settings but is probably never going to be as useful as NLMeans.

  • NLMeans luma (y-settings) will always alter the feel.  This is why the ‘Grain’ presets are all zero:
    Even a super-low strength of 1 or 2 will remove detail.  Trust the HandBrake presets.

  • NLMeans’s prefilter mean,median will give bitrate reduction of 2%,1% each, PQ neutral.
    They will also increase processing overhead by orders of magnitude.

  • NLMeans’s Grain (Strong) preset will give bitrate reduction of 9%, PQ neutral.

  • x265’s Grain tuning will give bitrate reduction of 40%, PQ neutral.
    RF 18 on None Tuning can preserve as much detail as RF 28 on Grain Tuning.

  • x265 knows how to NR — don't overlook your friendly neighbourhood encoder!
    When experimenting with NR filters, you can find better results, or quicker results, or both.

  • x265’s best quality 🤯 comes with ‘Slow’.  ‘Slower’ and ‘Very Slow’ are 6%-8% larger files.
    x264’s best quality 😏 comes with ‘Very Slow’, not ‘Placebo’.  The clue is in the name.
    Trust the Handbrake presets.

  • RF28 to RF18 are as far as you want to go.  Target bitrates only if you’re forced to.
    Trust the Handbrake advice.


Extreme Noise Reduction:  fixing a bad mess


Here is the 2014 project, with NLMeans settings at — 10 : 0.15 : 9 : 3 : 30 : 0 — that's a sextuple:






You can see some “fly noise” large black dots — this frame in particular.  This is enhanced noise because the shot is a 2K crop out of the 4K video.  NLMeans removed most but not all the dots.  One of the parameters made most of the difference, but I forgot which one by 2015.




I had also used 10 : 1 : 7 : 3 : 30 : 0 for a while but it did not clean up the large noise in the close-up as effectively.  The origin-tune and patch-size were the two settings that made the difference.


3DNR too far:  not for studio quality sources

Flash forward to 2021 and I am converting some S-VHS tapes to 1080p and even HDR.  The breakthroughs have come in good consumer-grade sampling and upsamping, but the industry’s fascination with temporal noise reduction may have come in a decade where LCDs have lowered our expectations in temporal resolution:  I was able to turn off my JVC’s DigiPure 3DNR once I found the menu in S-Video, but the Ocean Matrix S-Video to HDMI upscaler has no settings at all.

I’ve since replaced it with a more configurable Magewell (despite it not always locking on to field dominance) and here's why:

Ocean Matrix, as recommended by @techconnectify … probably fine for 24fps content?