sr55 [Sat, 13 Jan 2018 20:30:44 +0000 (20:30 +0000)]
WinGui: Reselect the last selected preset (if still available) when editing a queue task. Fix a bug on the summary task not rendering correctly when queue editing.
Bradley Sepos [Wed, 27 Dec 2017 20:10:27 +0000 (15:10 -0500)]
contrib: Update libsamplerate.
I've asked upstream a couple times to push at least one tag, but it seems the maintainer is busy with other projects. Imagining a world where libsamplerate 0.1.9 was tagged, this is libsamplerate 0.1.9-35-g02ebb9f.
Numerous improvements include upstream moving from bzr to git, modernizing and cleaning up the autotools-based build system, fixing issues involving GCC 7, and *nine* years of improvements to the code base.
libsamplerate is now under a 2-clause BSD license.
Bradley Sepos [Thu, 11 Jan 2018 04:50:43 +0000 (23:50 -0500)]
libhb: Plug memory leak in NLMeans.
This reverts 0e072aa42e3affd6280447317375460753f9284b and implements a proper fix for some frames not being prefiltered correctly. Turns out it was an issue with an uninitialized variable.
Bradley Sepos [Fri, 29 Dec 2017 18:09:38 +0000 (13:09 -0500)]
build: Unclobber PATH when shunting build through Xcode.
Tools shipping with Xcode are still in PATH, only moved from first to last priority. Avoids accidentally using old tools where a newer version is installed. This ensures the tools identified by configure will be the exact tools used by make via Xcode.
Bradley Sepos [Tue, 9 Jan 2018 09:30:28 +0000 (04:30 -0500)]
libhb: Add CSM prefilter to NLMeans.
CSM is a Conservative Smoothing filter with Median-like tendencies.
Conservative Smoothing is a basic noise reduction method that ensures a given pixel is within the values of those around it. A value higher than all the others is clamped to the maximum value in the neighborhood. Likewise, a value lower than all the others is clamped to the minimum value in the neighborhood. Basically, pixel values that seem to "fit in" are left alone, and extreme values are brought in line.
CSM takes this a step further. A pixel not affected by the previous part of the algorithm is subjected to additional thresholding. If the pixel value is closer to the minimum or maximum neighborhood value than the median, it is clamped to the half-way point. Finally, a pixel still not affected is subjected to a third level of thresholding, clamping to the half-way point between the median and the previous half-way point. Any other pixel value is deemed close enough to its peers and left alone.
In effect, this creates a "soft" median-like filter, where relatively similar values are left alone and increasingly disparate values are nudged closer together.
Practically, CSM is the best prefilter to date for improving weight decisions with sources containing a type or amount of noise proving difficult for NLMeans to uniformly dampen or completely remove on its own. Additionally, it does not significantly alter the strength metric in most cases, so it can simply be enabled wherever desired. From what I can tell in my limited testing, the algorithm respects proper detail and edges well enough that it seems to be safe with nearly any source. Perhaps it should be the default if I ever get around to creating NLMeans 2.
Unlike the mean and median prefilters where a larger neighborhood increases the strength of the prefilter, a larger CSM neighborhood merely takes more pixels into account, theoretically decreasing the strength of the filter. In practice, the provided 3x3 and 5x5 neighborhoods typically do not produce significantly differing results.
Basic usage: Add y-prefilter=16 to your desired parameters and NLMeans will use CSM for weighting decisions. Use y-prefilter=2064 if you want to see the output of the prefilter itself—the visual effect is mild. Adjust these values to 32 and 2080 for a 5x5 neighborhood; 3x3 works well in all cases I've tried.
Chris Darroch [Sat, 30 Dec 2017 08:12:57 +0000 (00:12 -0800)]
libhb: Output result of nlmeans prefilter when passthru enabled.
When the prefilter passthru flag is enabled, write the nlmeans prefilter
result into the "main" memory buffer (mem) instead of the prefilter one
(mem_pre) so that the prefilter result will be output as if it was the
result of the nlmeans filter itself.
Otherwise, when the passthru flag is enabled, the prefilter result is
lost and the filter effectively just outputs its source input without
any changes.
In commit 29a49a8, the nlmeans_prefilter() call in nlmeans_filter_thread()
was fixed, but a corresponding change was not made to the similar
call site in nlmeans_filter_flush().
Bradley Sepos [Wed, 27 Dec 2017 19:03:33 +0000 (14:03 -0500)]
contrib: Update fribidi url to use GitHub tarball.
fribidi.org is gone. The official release archive we were using is gone. Only release tags on GitHub remain, and they are not direct replacements for the proper release archives we were using previously.
Some changes were necessary for compilation from source, namely:
- Removal of an ugly hack that resulted in configure being run more than once. Apparently the same fix is already upstream https://github.com/fribidi/fribidi/commit/0efbaa9052320a951823a6e776b30a580e3a2b4e
- Modification of Makefile.am to avoid building the doc subdirectory, since this will fail wherever c2man isn't available such as on Mac. We don't need these docs
- Modification of gen.tab/Makefile.in to use the host compiler when cross-compiling. This cannot be done as a normal patch since Makefile.in is generated in the bootstrap phase. This is an open issue upstream: https://github.com/fribidi/fribidi/issues/7
This is all a good lesson on the importance of maintaining urls. I'm still a bit stunned a widely used GNU project would shutter its domain and release archive.
Bradley Sepos [Wed, 27 Dec 2017 23:03:01 +0000 (18:03 -0500)]
contrib: Fix issues with fribidi.
The source tarball isn't exactly the same as the release tarball found on fribidi.org before it shuttered. Needs a little extra care and an anvil dropped on Mr. Horrible.