![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/math.h"#include "common/opencl.h"#include "control/control.h"#include "develop/imageop.h"#include "develop/imageop_math.h"#include "develop/tiling.h"#include "iop/iop_api.h"#include "common/nlmeans_core.h"#include <stdbool.h>#include <stdlib.h>
Include dependency graph for nlmeans_core.c:Data Structures | |
| struct | patch_t |
Macros | |
| #define | SLICE_WIDTH 72 |
| #define | SLICE_HEIGHT 60 |
| #define | NUM_BUCKETS 4 |
| #define | _mm_prefetch(where, hint) |
Typedefs | |
| typedef struct patch_t | patch_t |
Functions | |
| static float | gh (const float f) |
| static int | sign (int a) |
| static int | scatter (const float scale, const float scattering, const int index1, const int index2) |
| static struct patch_t * | define_patches (const dt_nlmeans_param_t *const params, const int stride, int *num_patches, int *max_shift) |
| static float | compute_center_pixel_norm (const float center_weight, const int radius) |
| static float | pixel_difference (const float *const pix1, const float *pix2, const dt_aligned_pixel_t norm) |
| static float | diff_of_pixels_diff (const float *const pix1, const float *pix2, const float *const pix3, const float *pix4, const dt_aligned_pixel_t norm) |
| static void | init_column_sums (float *const col_sums, const patch_t *const patch, const float *const in, const int row, const int chunk_left, const int chunk_right, const int height, const int width, const int stride, const int radius, const float *const norm) |
| static int | compute_slice_height (const int height) |
| static int | compute_slice_width (const int width) |
| __DT_CLONE_TARGETS__ void | nlmeans_denoise (const float *const inbuf, float *const outbuf, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const dt_nlmeans_param_t *const params) |
| static int | bucket_next (unsigned int *state, unsigned int max) |
| static void | get_blocksizes (int *h, int *v, const int radius, const int devid, const int horiz_kernel, const int vert_kernel) |
| static cl_int | nlmeans_cl_init (const int devid, const int kernel, cl_mem dev_out, const int height, const int width) |
| static cl_int | nlmeans_cl_horiz (const int devid, const int kernel, cl_mem dev_U4, cl_mem dev_U4_t, const int P, const int q[2], const int height, const int width, const int bwidth, const int hblocksize) |
| static cl_int | nlmeans_cl_accu (const int devid, const int kernel, cl_mem dev_in, cl_mem dev_U4_tt, cl_mem dev_out, const int q[2], const int height, const int width, const size_t sizes[3]) |
| int | nlmeans_denoise_cl (const dt_nlmeans_param_t *const params, const int devid, cl_mem dev_in, cl_mem dev_out, const dt_iop_roi_t *const roi_in) |
| int | nlmeans_denoiseprofile_cl (const dt_nlmeans_param_t *const params, const int devid, cl_mem dev_in, cl_mem dev_out, const dt_iop_roi_t *const roi_in) |
| #define _mm_prefetch | ( | where, | |
| hint | |||
| ) |
| #define NUM_BUCKETS 4 |
| #define SLICE_HEIGHT 60 |
| #define SLICE_WIDTH 72 |
|
static |
Referenced by nlmeans_denoise_cl(), and nlmeans_denoiseprofile_cl().
|
static |
References width.
Referenced by nlmeans_denoise().
|
static |
References height, and SLICE_HEIGHT.
Referenced by nlmeans_denoise().
|
static |
References SLICE_WIDTH, and width.
Referenced by nlmeans_denoise().
|
static |
References patch_t::cols, dt_pixelpipe_cache_alloc_align_cache, IS_NULL_PTR, patch_t::offset, r, patch_t::rows, and scatter().
Referenced by nlmeans_denoise(), nlmeans_denoise_cl(), and nlmeans_denoiseprofile_cl().
|
inlinestatic |
References for_each_channel, and i.
Referenced by nlmeans_denoise().
|
static |
References dt_opencl_local_buffer_opt(), dt_opencl_local_buffer_t::sizex, dt_opencl_local_buffer_t::sizey, v, and dt_opencl_local_buffer_t::xoffset.
Referenced by nlmeans_denoise_cl(), and nlmeans_denoiseprofile_cl().
|
inlinestatic |
References dt_fast_mexp2f(), and f.
Referenced by _circle_get_mask_roi(), _ellipse_get_mask_roi(), _gradient_get_mask(), _gradient_get_mask_roi(), and nlmeans_denoise().
|
static |
References patch_t::cols, height, i, MAX, MIN, patch_t::offset, pixel_difference(), r, row, patch_t::rows, and width.
Referenced by nlmeans_denoise().
|
inlinestatic |
References dt_opencl_enqueue_kernel_2d(), dt_opencl_set_kernel_arg(), height, kernel(), and width.
Referenced by nlmeans_denoise_cl(), and nlmeans_denoiseprofile_cl().
|
inlinestatic |
References dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_set_kernel_arg(), height, kernel(), P, ROUNDUPDHT, and width.
Referenced by nlmeans_denoise_cl(), and nlmeans_denoiseprofile_cl().
|
inlinestatic |
References dt_opencl_enqueue_kernel_2d(), dt_opencl_set_kernel_arg(), height, kernel(), ROUNDUPDHT, ROUNDUPDWD, and width.
Referenced by nlmeans_denoise_cl(), and nlmeans_denoiseprofile_cl().
| __DT_CLONE_TARGETS__ void nlmeans_denoise | ( | const float *const | inbuf, |
| float *const | outbuf, | ||
| const dt_iop_roi_t *const | roi_in, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const dt_nlmeans_param_t *const | params | ||
| ) |
References __OMP_PARALLEL_FOR__, _mm_prefetch, patch_t::cols, compute_center_pixel_norm(), compute_slice_height(), compute_slice_width(), darktable, define_patches(), diff_of_pixels_diff(), dt_get_perthread, dt_pixelpipe_cache_alloc_perthread_float, dt_pixelpipe_cache_free_align, for_each_channel, for_four_channels, gh(), height, dt_iop_roi_t::height, i, init_column_sums(), IS_NULL_PTR, MAX, MIN, darktable_t::num_openmp_threads, patch_t::offset, out, p, pixel_difference(), row, patch_t::rows, SLICE_WIDTH, weight(), width, and dt_iop_roi_t::width.
Referenced by process().
| int nlmeans_denoise_cl | ( | const dt_nlmeans_param_t *const | params, |
| const int | devid, | ||
| cl_mem | dev_in, | ||
| cl_mem | dev_out, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
References bucket_next(), patch_t::cols, define_patches(), dt_iop_nap(), dt_opencl_alloc_device_buffer(), dt_opencl_enqueue_kernel_2d(), dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_micro_nap(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_pixelpipe_cache_free_align, error(), get_blocksizes(), height, dt_iop_roi_t::height, k, nlmeans_cl_accu(), nlmeans_cl_horiz(), nlmeans_cl_init(), NUM_BUCKETS, p, P, ROUNDUP, ROUNDUPDHT, ROUNDUPDWD, patch_t::rows, state, width, and dt_iop_roi_t::width.
Referenced by process_cl().
| int nlmeans_denoiseprofile_cl | ( | const dt_nlmeans_param_t *const | params, |
| const int | devid, | ||
| cl_mem | dev_in, | ||
| cl_mem | dev_out, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
References bucket_next(), patch_t::cols, define_patches(), dt_opencl_alloc_device_buffer(), dt_opencl_enqueue_kernel_2d(), dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_pixelpipe_cache_free_align, error(), get_blocksizes(), height, dt_iop_roi_t::height, k, nlmeans_cl_accu(), nlmeans_cl_horiz(), nlmeans_cl_init(), NUM_BUCKETS, p, P, ROUNDUP, ROUNDUPDHT, ROUNDUPDWD, patch_t::rows, state, width, and dt_iop_roi_t::width.
Referenced by process_nlmeans_cl().
|
inlinestatic |
References for_each_channel, and i.
Referenced by init_column_sums(), and nlmeans_denoise().
|
static |
References sign.
Referenced by define_patches().
|
inlinestatic |