diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-10-24 14:26:35 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-10-29 18:42:29 +0200 |
commit | 959ec353ce974ff22863927c0a9dd354d0968c85 (patch) | |
tree | 8c9864ba9500e40c405db8879fdb8782ae1b98e7 | |
parent | 81380d221c2b1f9a72b08e4193e6f81774c07b2f (diff) | |
download | ffmpeg-959ec353ce974ff22863927c0a9dd354d0968c85.tar.gz |
avfilter/vf_nlmeans: make access to pointer to lut faster
-rw-r--r-- | libavfilter/vf_nlmeans.c | 3 |
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]; } |