summaryrefslogtreecommitdiffstats
path: root/libhb/nlmeans.c
diff options
context:
space:
mode:
authorBradley Sepos <[email protected]>2018-01-10 23:55:00 -0500
committerBradley Sepos <[email protected]>2018-01-10 23:55:00 -0500
commit738326394e0e80f855d21c6f1d4996f29af35ce9 (patch)
treee4bf63b4bf7381f13bf76ccd2c60b935b9461917 /libhb/nlmeans.c
parentb8e11e0a5292c81c06831b8a0543dbfca5346f89 (diff)
libhb: Reorder some code in nlmeans_prefilter for clarity.
Diffstat (limited to 'libhb/nlmeans.c')
-rw-r--r--libhb/nlmeans.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/libhb/nlmeans.c b/libhb/nlmeans.c
index e6f8f1767..0ca0f4f6d 100644
--- a/libhb/nlmeans.c
+++ b/libhb/nlmeans.c
@@ -686,22 +686,18 @@ static void nlmeans_prefilter(BorderedPlane *src,
}
}
+ // Recreate borders
+ nlmeans_border(mem_pre, w, h, border);
+
// 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;
+ src->mem = src->mem_pre;
+ src->image = src->image_pre;
}
- // Recreate borders
- nlmeans_border(mem_pre, w, h, border);
-
}
src->prefiltered = 1;
hb_unlock(src->mutex);