Jump to content

8bit → 10bit video with temporal noise filtering, stunning results


cantsin
 Share

Recommended Posts

Here's an approach to high-quality upsampling of 8bit to 10bit video material that I haven't seen mentioned before. We had several discussions on this forum whether 4K 8bit footage could be converted to 2K footage with higher color depth, but my approach is different, and doesn't result in loss of pixel resolution. 

First brought it up as a hypothesis on the German Slashcam forum, tested it, and voilà, it worked even better than I had expected: 

High-quality video noise filters (such as Neat Video Pro and the built-in noise filter of Resolve Studio) can do temporal denoising, by comparing several neighboring video frames and averaging pixels between them. If these filters internally work with 10bit or more color depth, they should average/interpolate these color values with more subtle gradations than available in 8bit, producing a picture with more than 8bit color depth. (The logic is the pretty much the same as with super resolution algorithms that compute a higher image resolution from adjacent frames. Only that this method affects color resolution instead of spatial resolution.)

So I did the following:

  1. Downloaded Luke Neumann's out-of-the-camera test files of the GH5 from here, the ones that were shot with 180fps in 8bit 4:2:0 in V-log; 
  2. imported the clip "Pete Fire Hand.MP4" into Resolve and dropped it into the time without applying any corrections;
  3. exported one frame as a 16bit uncompressed TIFF;
  4. ran Imagemagick's "identify" command on the command line to determine the number of its unique colors. It identified 17,210. [command syntax: "identify -format %k xy.tif"] 
  5. applied Neat Video Pro (OFX plugin) to the clip, using only temporal noise reducation, with 5 reference frames and in the highest quality setting.
  6. exported the same frame as a 16bit uncompressed TIFF;
  7. ran Imagemagick's "identify" on the denoised frame; it now identified 1,194,446 unique colors.

Both TIFF files can be downloaded from here: http://data.pleintekst.nl/chroma-upsampling.zip (13 MB)

1,1 million colors is still much less than the 24 million colors available with 8bit color depth. So, to check whether the temporal denoising had really interpolated the colors into a higher bit depth, I exported an uncompressed 8bit TIFF in Resolve and, in addition, used Imagemagick to convert the denoised 1.1 million color-16bit TIFF into a second 8bit TIFF. The two images contained 39.471 respectively 39.473 unique colors. This was the proof that most of those 1.19 million unique colors of the denoised 16bit TIFF were outside the 8bit color/gradation range. (This can already happen if you have a monochrome gradient with more than 256 gradations. So, theoretically, an image with only 257 unique colors can exceed 8bit color resolution.)

1.19 million is about 69 times 17,210. When jumping from 8bit to 10bit,  there are two bits=2^2=4 times the values per color channel. In total, this amounts to is 4^3=64 times as many color values. So the jump from the original image to the denoised image is even slightly bigger than from 8bit to 10bit. If we take the noise-filtered 8bit image with its 39.473 unique colors as a reference instead, then the increase is still by factor 30=5bits, which would mean 9.67 bits per color channel. 

In other words, it's fair to call this a high-quality 8bit to 10bit upsampling. As opposed to dithering into higher bit depth, noise isn't added but even removed!

Link to comment
Share on other sites

EOSHD Pro Color 5 for Sony cameras EOSHD Z LOG for Nikon CamerasEOSHD C-LOG and Film Profiles for All Canon DSLRs

Thanks for posting this.

In the steps above you mentioned Neat Noise, but you also stated that the built-in nosie reduction of Resolve should work as well. Have you been able to test that out yet just to confirm?

Also, in a real world workflow, would one apply the noise reduction effect on the Edit page to EVERY clip and then just go about grading on the color page as usual? I am not familiar with Neat Noise and I don't have the studio version of Resolve (just the free version), and am not sure if noise reduction is applied on Edit page or on Color page.

Link to comment
Share on other sites

Justed tested temporal denoising with the built-in noise filter of Resolve Studio: This results in even 1.6 million unique colors, but with rather aggressive filter settings. (Neat yields higher image quality, in my opinion. It's not worth upgrading to Studio for the noise filter. The Neat plugin also works in the free version.)

You apply the noise filter to nodes in the Color menu, no matter whether you use Neat Video Pro as an OFX effect or Resolve Studio's built-in denoiser. You get the best results if you set the filter parameters for each clips individually. But you can also define a group node, use one filter setting for all footage, and have that group node at the beginning of your color correction chain. (You should always denoise the ungraded footage first and apply all other corrections afterwards.) The group node work method also makes it easier to turn noise reduction on and off for all clips with a single click, for example, when you need realtime playback in editing.

Link to comment
Share on other sites

4 minutes ago, majoraxis said:

@cantsin, if you could post before and after images for the same frame, that would be appreciated.

I already did, see the download link in my original post. The difference is only contained in the 16bit TIFFs and not really visible to the human eye (since these are ungraded log images). It wouldn't make sense to post the images here in the forum, since they would be downconverted to highly compressed 8bit JPEGs....

Link to comment
Share on other sites

To illustrate, here are two extreme grades of the same frame - the one with temporal noise reduction applied, the other without. You mostly see macroblocking from the codec (with the noise filter also somewhat reduces). But if you pay attention to color gradients such as the underside of the stair or on the surface of the kitchen drawer, you see where the 8bit color breaks apart and the noise filter smoothes it out. [View in 1:1 pixel size.]

 

grade-filtered_1.1.1.T.png

grade-unfiltered_1.2.1.T.png

Link to comment
Share on other sites

Just to confirm that this orientation indeed have sense. In one of the topics about new lowlight capability of GH5s I upload the same shot done with GH5 but with Resolve's temporal NR, both at iso6400 - result is near identical. So, I expect that it is possible to smooth-up macroblocking artefacts, but, of course, result is - smooth.

Neat Video temporal reduction is better, but much much slower than Resolve. Spatial NR of Resolve is extremely slow and demands very powerful computer to work.

Link to comment
Share on other sites

I dunno cantsin. I can't get past the codec limitations. For me, all this process doesn't really add anything. If you look at the hand there are terrible compression artifacts in both images, without any differences in color.

Here is a comparison of few places with boosted saturation (top orig, bottom neat):

5a8b36ca0f938_ScreenShot2018-02-19at2_41_01PM.thumb.png.b58c365db9178b37989c5b1b5f43261e.png

I see mostly different compression. Here is the difference between the two frames:

5a8b36d11e886_ScreenShot2018-02-19at2_41_28PM.thumb.png.51e4e8a971ae42fcfbef9e17aa7e2cfc.png

Link to comment
Share on other sites

@Don & @hyalinejim - my post was actually not about compression artifacts and macroblocks. (Could have used Neat's spatial denoising to tackle them...) But it's only about how to best upsample 8bit to 10bit. Maybe the test footage wasn't wisely chosen, and I should rather have picked 8bit footage without these artifacts.

Link to comment
Share on other sites

For the banding removal mentioned earlier, when you have massive banding, it can be useful to add grain and then apply temporal noise reduction. I applied a very strong grade to one of my X-T2 F-Log clips here, to show some nasty banding (view in full size):

f-log_banding_before.thumb.jpg.66b6a314670552f50f13f9f794246518.jpg

Then I created a mask for the sky in Resolve, applied some heavy grain and then some heavy temporal noise reduction in Resolve's denoiser, and voilá. Obviously this will only work if you can mask out the problematic area and if there's no real detail there.

f-log_banding_after.thumb.jpg.326cbd2a8c39d45819713ed506508a41.jpg

Link to comment
Share on other sites

5 minutes ago, Attila Bakos said:

For the banding removal mentioned earlier, when you have massive banding, it can be useful to add grain and then apply temporal noise reduction. I applied a very strong grade to one of my X-T2 F-Log clips here, to show some nasty banding (view in full size):

f-log_banding_before.thumb.jpg.66b6a314670552f50f13f9f794246518.jpg

Then I created a mask for the sky in Resolve, applied some heavy grain and then some heavy temporal noise reduction in Resolve's denoiser, and voilá. Obviously this will only work if you can mask out the problematic area and if there's no real detail there.

f-log_banding_after.thumb.jpg.326cbd2a8c39d45819713ed506508a41.jpg

Thank you!

Link to comment
Share on other sites

Yeah, and btw it can be used in more difficult situations as well. Again, F-Log, very strong grade, banding and nasty pink patch:

f-log_pink_before.thumb.jpg.7db479c7dbd0f46662fd0824720e479c.jpg:

Now there are the rooftop edges, branches, whatnot, and you don't want them to be affected. In Resolve I was able to do a very precise selection with the HSL selection tool. Just make sure you use zero or very minimal softening. Then I applied grain and then noise reduction. You have to play with the grain and noise reduction amount until it looks the best. At this step the pink patch was already better, but I changed it's hue to match the rest of the sky, then applied some midtone detail in the same mask, and arrived at this:

f-log_pink_after.thumb.jpg.ee5866ab4d1a14c7a3d77afe54296c3a.jpg

Like it was shot in 10 bit :)

Link to comment
Share on other sites

This is way above my head, but doesn't this have more to do with denoising being able to reduce macroblocking than it does with bit depth?

The banding and color problems in all these shots seem to be from color profiles and compression artifacts, not bit depth. None of these image problems are primarily correlated with an 8 bit codec. They're far more to do with macroblocking.

Both of the shots of the guy by the stairs, for instance, look awful and riddled with compression artifacts.

Admittedly, the sunset does look a lot better, improved by what's a pretty clever trick.

Generally, I feel like there's some "10 bit magic" that I don't see. My experience has always been that the strength of the codec and the color space and gamma assigned it is far more important than bit depth. The F5, for instance, still had a lot of banding in 10 bit XAVC or whatever the codec is, because the bit depth is too low and gamma too flat. (This has been improved upon since in future updates.)

Denoising is definitely powerful! I've used it before to remove compression artifacts in similar situations. I just don't understand what bit depth has to do with it. It's macroblocking that's a far far bigger issue in all these examples. Unless my eyes deceive me...

Link to comment
Share on other sites

I will make a better test with CinemaDNG source material from a Blackmagic Cinema Camera, downconvert it to a high-quality 8bit codec (DNxHR HQ), upsample it to 10bit with Neat, and see how it solves banding when grading the material. However, give me some time - this might take me a week to do.

But that temporal NR spreads 8bit colors into 10bit by greatly increasing the number of unique colors, is a fact.

Link to comment
Share on other sites

1 minute ago, cantsin said:

Recorded with an external recorder, I guess? (So 8bit 4:2:2 ProRes without transcoding?)

Yes, the frames are directly exported from Resolve. I believe banding would be much less visible in 10bit. The pink patch might not be related to 8bit though, but to some problem with the F-Log implementation in the X-T2. The red channel is very noisy and from the footage I've seen so far they fixed this problem with the upcoming X-H1.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • EOSHD Pro Color 5 for All Sony cameras
    EOSHD C-LOG and Film Profiles for All Canon DSLRs
    EOSHD Dynamic Range Enhancer for H.264/H.265
×
×
  • Create New...