aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-10-24 14:26:35 +0200
committerPaul B Mahol <onemda@gmail.com>2021-10-29 18:42:29 +0200
commit959ec353ce974ff22863927c0a9dd354d0968c85 (patch)
tree8c9864ba9500e40c405db8879fdb8782ae1b98e7
parent81380d221c2b1f9a72b08e4193e6f81774c07b2f (diff)
downloadffmpeg-959ec353ce974ff22863927c0a9dd354d0968c85.tar.gz
avfilter/vf_nlmeans: make access to pointer to lut faster
-rw-r--r--libavfilter/vf_nlmeans.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_nlmeans.c b/libavfilter/vf_nlmeans.c
index b8d8bb2ec0..0962056a6e 100644
--- a/libavfilter/vf_nlmeans.c
+++ b/libavfilter/vf_nlmeans.c
@@ -344,6 +344,7 @@ static int nlmeans_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs
const int dist_b = 2*p + 1;
const int dist_d = dist_b * s->ii_lz_32;
const int dist_e = dist_d + dist_b;
+ const float *const weight_lut = s->weight_lut;
for (int y = starty; y < endy; y++) {
const uint8_t *src = td->src + y*src_linesize;
@@ -385,7 +386,7 @@ static int nlmeans_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs
const uint32_t patch_diff_sq = e - d - b + a;
if (patch_diff_sq < s->max_meaningful_diff) {
- const float weight = s->weight_lut[patch_diff_sq]; // exp(-patch_diff_sq * s->pdiff_scale)
+ const float weight = weight_lut[patch_diff_sq]; // exp(-patch_diff_sq * s->pdiff_scale)
wa[x].total_weight += weight;
wa[x].sum += weight * src[x];
}