diff options
author | Chris Darroch <[email protected]> | 2017-12-30 00:12:57 -0800 |
---|---|---|
committer | Bradley Sepos <[email protected]> | 2017-12-30 06:26:16 -0500 |
commit | 0067b00e9cd251c776ec3d0b02f4e95ef0382601 (patch) | |
tree | 83e0ff354e0e4496563322a6daf1879a6dd0d892 /libhb | |
parent | 7a9f97278418e3ed59c23a8d291e9c98b8e5c0b0 (diff) |
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.
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/nlmeans.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libhb/nlmeans.c b/libhb/nlmeans.c index 7b6a8deb1..8b776f4f1 100644 --- a/libhb/nlmeans.c +++ b/libhb/nlmeans.c @@ -581,8 +581,17 @@ static void nlmeans_prefilter(BorderedPlane *src, } // Assign result - src->mem_pre = mem_pre; - src->image_pre = image_pre; + if (filter_type & NLMEANS_PREFILTER_MODE_PASSTHRU) + { + // No swap needed as nlmeans_alloc() set src->mem_pre == src->mem + src->mem = mem_pre; + src->image = image_pre; + } + else + { + src->mem_pre = mem_pre; + src->image_pre = image_pre; + } // Recreate borders nlmeans_border(mem_pre, w, h, border); |