Hqdn3d filter for digitized analog sources such as VHS

Would it be possible to include hqdn3d filter as part of Topaz’s CLI distribution, assuming GPLv2 license terms are acceptable? It is noted that the filter is GPLv2 rather than LGPL.

https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_hqdn3d.h

I appreciate that I would compile my own build to include hqdn3d from Topaz github, but the (much appreciated) regular release cycle makes a weekly build onerous.

The advantage of the hqdn3d filter is that it is easy to apply separate denoise settings for chroma and luma. I have found that on particularly noisy tape digitization sources that an aggressive chroma denoise (both spacial and temporal) helped clean up sources prior to TVAI enhancement without losing the detail in the luma. Denoise on the chroma really helped remove post-enhancement TVAI artifacts (like vertical ripples), and in my test cases there was no need to denoise the luma plane - which helped preserve detail. Denoise on the luma plane destroyed too much detail.

I have a pipeline which works for me, but this relies on running a first pass with hqdn3d>ffv1 applying an aggressive denoise to the subsampled chroma using a standalone FFmpeg distribution and then using a second TVAI pass to perform the enhancement with the Topaz distribution. It works but it would be nicer to perform this function within Topaz’s distribution of FFmpeg.

Aggressive chroma denoise was a revelation and when combined with Topaz TVAI improved the subsequent processing of digitized analog sources enormously. YMMV, but for me TVAI really benefited from having sufficient detail in the luma plane, while not needing so much detail in the chroma plane.

For anyone who is dealing with digitized tapes where there is noise, it is possible to use FFplay to look at each plane and identify whether the noise is unique to the chroma (U&V) planes or common to all planes. [I have not included bwdif for brevity, but it is common that digitizations are also interlaced.]

$ ffplay -hide_banner -f 'lavfi' -i "movie=filename='${infile}',format=pix_fmts='yuv444p',split=4[split1][split2][split3][split4]; [split1]extractplanes=planes='y'[split1]; [split2]extractplanes=planes='u'[split2]; [split3]extractplanes=planes='v'[split3]; [split1][split2][split3][split4]xstack=inputs=4:grid='2x2'" -volume 0

A very aggressive hqdn3d, looks like…

-filter:v hqdn3d=luma_spatial=0x00:chroma_spatial=0x0f:luma_tmp=0x00:chroma_tmp=0x0f

These two can be combined to preview the effect of hqdn3d.

Thanks

Hello and thanks so much for this detailed feature suggestion!

We probably cannot bundle hqdn3d in the TVAI ffmpeg build because of the GPLv2 license, but an alternative option could be to pipe the output of the standalone ffmpeg process into the TVAI bundled one:

Thanks Tony - appreciate the reply and I can pipe. Totally understand the GPL licensing issues.

If ever Topaz is looking to optimize denoise filters for digitalized content, having separate controls over luma and chroma denoise really helped.

Marking as solved, so as to not leave open questions hanging around in the forum. Thanks.

1 Like