![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/darktable.h"#include "develop/imageop.h"#include "develop/imageop_math.h"#include "iop/highlights/blur.h"#include "iop/highlights/chroma.h"#include "iop/highlights/coefficient_field.h"#include "iop/highlights/knee.h"#include <math.h>#include <string.h>
Include dependency graph for coefficient_field.c:Go to the source code of this file.
Macros | |
| #define | DEFINE_CF_FILL_RELAX(NP) |
| #define | CF_M2(nb_index, coef_a, coef_b) |
| #define | HF_M2(nb_index, coef_a, coef_b) |
Functions | |
| static __DT_CLONE_TARGETS__ void | _cf_adaptive_tensor (const float *const restrict luminance, float *const restrict tensor_xx, float *const restrict tensor_xy, float *const restrict tensor_yy, float *const restrict scratch_lin, float *const restrict scratch_quad, const int region_w, const int region_h, const float k) |
| static __DT_CLONE_TARGETS__ void | _cf_fill_relax_1 (float *const restrict field, float *const restrict tmp, const uint8_t *const restrict level_anchor, const float *const restrict edge_weights, const float *const restrict edge_weight_sum, const int coarse_w, const int coarse_h, const size_t cell_count, const int steered) |
| static __DT_CLONE_TARGETS__ void | _cf_fill_relax_2 (float *const restrict field, float *const restrict tmp, const uint8_t *const restrict level_anchor, const float *const restrict edge_weights, const float *const restrict edge_weight_sum, const int coarse_w, const int coarse_h, const size_t cell_count, const int steered) |
| static __DT_CLONE_TARGETS__ void | _cf_fill_relax_3 (float *const restrict field, float *const restrict tmp, const uint8_t *const restrict level_anchor, const float *const restrict edge_weights, const float *const restrict edge_weight_sum, const int coarse_w, const int coarse_h, const size_t cell_count, const int steered) |
| static __DT_CLONE_TARGETS__ void | _cf_fill_relax_4 (float *const restrict field, float *const restrict tmp, const uint8_t *const restrict level_anchor, const float *const restrict edge_weights, const float *const restrict edge_weight_sum, const int coarse_w, const int coarse_h, const size_t cell_count, const int steered) |
| static __DT_CLONE_TARGETS__ void | _cf_harmonic_fill_n (float *const restrict *vals, const int n_planes_in, const uint8_t *const restrict hole, const int region_w, const int region_h, const int base_ds, const float *const restrict steer, const dt_dev_pixelpipe_t *pipe) |
| void | _cf_harmonic_fill (float *const restrict val, const uint8_t *const restrict hole, const int region_w, const int region_h, const int base_ds, const float *const restrict steer, const dt_dev_pixelpipe_t *pipe) |
| __DT_CLONE_TARGETS__ void | _cf_reconstruct (_hl_region_ctx_t *const ctx) |
| static cl_int | _cf_harmonic_fill_cl_n (const int devid, void *gd_void, cl_mem *vals, const int n_planes_in, cl_mem hole, const int region_w, const int region_h, const int base_ds, const int mask_is_hole, cl_mem steer) |
| cl_int | _cf_harmonic_fill_cl (const int devid, void *gd_void, cl_mem val, cl_mem hole, const int region_w, const int region_h, const int base_ds, const int mask_is_hole, cl_mem steer) |
| cl_int | _cf_joint_stage_cl (const int devid, void *gd_void, cl_mem estimate, cl_mem valid, cl_mem model_quality, cl_mem mom0, cl_mem mom1, cl_mem mom2, cl_mem steer, const float *const restrict channel_means, const int region_w, const int region_h, const float cf_sigma, const float cf_fmin, const int c, const int guide1, const int guide2) |
| static cl_int | _cf_pair_stage_cl (const int devid, void *gd_void, cl_mem estimate, cl_mem valid, cl_mem model_quality, cl_mem moment_a, cl_mem moment_b, cl_mem steer, const float *const restrict channel_means, const int region_w, const int region_h, const float cf_sigma, const float cf_fmin, const int chan_a, const int chan_b, const int orientation) |
| static cl_int | _cf_joint_fit_cl (const int devid, void *gd_void, cl_mem estimate, cl_mem valid, cl_mem mom0, cl_mem mom1, cl_mem mom2, cl_mem steer, const float *const restrict channel_means, const int region_w, const int region_h, const float cf_sigma, const float cf_fmin, const int c, const int guide1, const int guide2, cl_mem *ca_out, cl_mem *cb_out, cl_mem *cd_out, cl_mem *cr2_out) |
| cl_int | _cf_stage_cl (const int devid, void *gd_void, cl_mem estimate, cl_mem valid, cl_mem model_quality, cl_mem luminance, cl_mem steer, const float *const restrict channel_means, dt_gaussian_cl_t *gaussian, const int region_w, const int region_h, const float cf_sigma, const float cf_fmin, const float cf_binv, const int cdeep) |
| cl_int | _hf_stage_cl (const int devid, void *gd_void, cl_mem estimate, cl_mem valid, cl_mem model_quality, cl_mem luminance, cl_mem steer, dt_gaussian_cl_t *gaussian, const int region_w, const int region_h, const float cf_sigma, const float cf_fmin, const float cf_binv) |
| #define CF_M2 | ( | nb_index, | |
| coef_a, | |||
| coef_b | |||
| ) |
| #define DEFINE_CF_FILL_RELAX | ( | NP | ) |
Definition at line 191 of file coefficient_field.c.
| #define HF_M2 | ( | nb_index, | |
| coef_a, | |||
| coef_b | |||
| ) |
|
static |
Definition at line 51 of file coefficient_field.c.
References HL_PFOR, i, k, luminance, MAX, MIN, and x.
Referenced by _cf_harmonic_fill_n().
|
static |
Definition at line 273 of file coefficient_field.c.
Referenced by _cf_harmonic_fill_n().
|
static |
Definition at line 274 of file coefficient_field.c.
Referenced by _cf_harmonic_fill_n().
|
static |
Definition at line 275 of file coefficient_field.c.
Referenced by _cf_harmonic_fill_n().
|
static |
Definition at line 276 of file coefficient_field.c.
Referenced by _cf_harmonic_fill_n().
| void _cf_harmonic_fill | ( | float *const restrict | val, |
| const uint8_t *const restrict | hole, | ||
| const int | region_w, | ||
| const int | region_h, | ||
| const int | base_ds, | ||
| const float *const restrict | steer, | ||
| const dt_dev_pixelpipe_t * | pipe | ||
| ) |
Definition at line 625 of file coefficient_field.c.
References _cf_harmonic_fill_n().
Referenced by _cf_harmonic_fill_cl_selftest(), _cf_joint_stage_cl_selftest(), _cf_reconstruct(), _cf_stage_cl_selftest(), _hf_stage_cl_selftest(), _selfdome(), and _selfdome_stage_cl_selftest().
| cl_int _cf_harmonic_fill_cl | ( | const int | devid, |
| void * | gd_void, | ||
| cl_mem | val, | ||
| cl_mem | hole, | ||
| const int | region_w, | ||
| const int | region_h, | ||
| const int | base_ds, | ||
| const int | mask_is_hole, | ||
| cl_mem | steer | ||
| ) |
Definition at line 1871 of file coefficient_field.c.
References _cf_harmonic_fill_cl_n().
Referenced by _cf_harmonic_fill_cl_selftest(), _cf_joint_fit_cl(), _cf_joint_stage_cl(), and _cf_pair_stage_cl().
|
static |
Definition at line 1410 of file coefficient_field.c.
References DT_HL_CF_K, DT_HL_FILL_CL_MAXP, dt_opencl_alloc_device_buffer(), DT_OPENCL_DEFAULT_ERROR, dt_opencl_enqueue_kernel_2d(), dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), kernel(), dt_iop_highlights_global_data_t::kernel_hl_cfa_box, dt_iop_highlights_global_data_t::kernel_hl_cfa_down, dt_iop_highlights_global_data_t::kernel_hl_cfa_gnorm, dt_iop_highlights_global_data_t::kernel_hl_cfa_grad, dt_iop_highlights_global_data_t::kernel_hl_cfa_jacobi, dt_iop_highlights_global_data_t::kernel_hl_cfa_jacobi_block, dt_iop_highlights_global_data_t::kernel_hl_cfa_tensor, dt_iop_highlights_global_data_t::kernel_hl_cfa_weights, dt_iop_highlights_global_data_t::kernel_hl_fill_down, dt_iop_highlights_global_data_t::kernel_hl_fill_jacobi, dt_iop_highlights_global_data_t::kernel_hl_fill_jacobi_block, dt_iop_highlights_global_data_t::kernel_hl_fill_seed, dt_iop_highlights_global_data_t::kernel_hl_fill_seed_up, dt_iop_highlights_global_data_t::kernel_hl_fill_up, MAX, out, ROUNDUPDHT, ROUNDUPDWD, and size.
Referenced by _cf_harmonic_fill_cl(), _cf_joint_fit_cl(), _cf_joint_stage_cl(), _cf_pair_stage_cl(), and _hf_stage_cl().
|
static |
Definition at line 288 of file coefficient_field.c.
References _aniso_edge_w(), _cf_adaptive_tensor(), _cf_fill_relax_1(), _cf_fill_relax_2(), _cf_fill_relax_3(), _cf_fill_relax_4(), double(), DT_HL_CF_K, DT_HL_FILL_MAXP, dt_pixelpipe_cache_alloc_align, dt_pixelpipe_cache_alloc_align_float, dt_pixelpipe_cache_free_align, HL_PFOR, i, k, MAX, MIN, weight(), and x.
Referenced by _cf_harmonic_fill(), and _cf_reconstruct().
|
static |
Definition at line 2072 of file coefficient_field.c.
References _cf_harmonic_fill_cl(), _cf_harmonic_fill_cl_n(), dt_opencl_alloc_device_buffer(), DT_OPENCL_DEFAULT_ERROR, dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), kernel(), dt_iop_highlights_global_data_t::kernel_hl_cf_fit_joint, out, ROUNDUPDHT, and ROUNDUPDWD.
Referenced by _cf_stage_cl().
| cl_int _cf_joint_stage_cl | ( | const int | devid, |
| void * | gd_void, | ||
| cl_mem | estimate, | ||
| cl_mem | valid, | ||
| cl_mem | model_quality, | ||
| cl_mem | mom0, | ||
| cl_mem | mom1, | ||
| cl_mem | mom2, | ||
| cl_mem | steer, | ||
| const float *const restrict | channel_means, | ||
| const int | region_w, | ||
| const int | region_h, | ||
| const float | cf_sigma, | ||
| const float | cf_fmin, | ||
| const int | c, | ||
| const int | guide1, | ||
| const int | guide2 | ||
| ) |
Definition at line 1882 of file coefficient_field.c.
References _cf_harmonic_fill_cl(), _cf_harmonic_fill_cl_n(), dt_opencl_alloc_device_buffer(), DT_OPENCL_DEFAULT_ERROR, dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), kernel(), dt_iop_highlights_global_data_t::kernel_hl_cf_eval_joint, dt_iop_highlights_global_data_t::kernel_hl_cf_fit_joint, out, ROUNDUPDHT, and ROUNDUPDWD.
Referenced by _cf_joint_stage_cl_selftest(), and _cf_stage_cl().
|
static |
Definition at line 1981 of file coefficient_field.c.
References _cf_harmonic_fill_cl(), _cf_harmonic_fill_cl_n(), dt_opencl_alloc_device_buffer(), DT_OPENCL_DEFAULT_ERROR, dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), kernel(), dt_iop_highlights_global_data_t::kernel_hl_cf_eval_pair, dt_iop_highlights_global_data_t::kernel_hl_cf_fit_pair, out, ROUNDUPDHT, and ROUNDUPDWD.
Referenced by _cf_stage_cl().
| __DT_CLONE_TARGETS__ void _cf_reconstruct | ( | _hl_region_ctx_t *const | ctx | ) |
Definition at line 634 of file coefficient_field.c.
References _cf_harmonic_fill(), _cf_harmonic_fill_n(), _region_blur(), _hl_region_ctx_t::blur_in, CF_M2, _hl_region_ctx_t::clip0, _hl_region_ctx_t::clip_depth, delta, _hl_region_ctx_t::dome_lum, dt_pixelpipe_cache_alloc_align, dt_pixelpipe_cache_alloc_align_float, dt_pixelpipe_cache_free_align, _hl_region_ctx_t::estimate, _hl_region_ctx_t::fill_planes, _hl_region_ctx_t::flat_target, _hl_region_ctx_t::guide_score, HF_M2, HL_PFOR, _hl_region_ctx_t::hole, i, _hl_region_ctx_t::lum_accum, _hl_region_ctx_t::pipe, _hl_region_ctx_t::plane1, _hl_region_ctx_t::plane2, _hl_region_ctx_t::plane3, _hl_region_ctx_t::prev_scale, _hl_region_t::radius, _hl_region_ctx_t::reaction_weight, _hl_region_ctx_t::region, _hl_region_ctx_t::region_h, _hl_region_ctx_t::region_pixels, _hl_region_ctx_t::region_w, _hl_region_ctx_t::solver_field, _hl_region_ctx_t::valid, _hl_region_ctx_t::valid_variance, and weight().
Referenced by _region_guided_filter().
| cl_int _cf_stage_cl | ( | const int | devid, |
| void * | gd_void, | ||
| cl_mem | estimate, | ||
| cl_mem | valid, | ||
| cl_mem | model_quality, | ||
| cl_mem | luminance, | ||
| cl_mem | steer, | ||
| const float *const restrict | channel_means, | ||
| dt_gaussian_cl_t * | gaussian, | ||
| const int | region_w, | ||
| const int | region_h, | ||
| const float | cf_sigma, | ||
| const float | cf_fmin, | ||
| const float | cf_binv, | ||
| const int | cdeep | ||
| ) |
Definition at line 2145 of file coefficient_field.c.
References _cf_joint_fit_cl(), _cf_joint_stage_cl(), _cf_pair_stage_cl(), _region_blur_cl(), dt_gaussian_blur_cl(), dt_opencl_alloc_device(), DT_OPENCL_DEFAULT_ERROR, dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), gaussian(), kernel(), dt_iop_highlights_global_data_t::kernel_hl_cf_eval_deep, dt_iop_highlights_global_data_t::kernel_hl_cf_pack_deepmask, dt_iop_highlights_global_data_t::kernel_hl_cf_pack_joint, dt_iop_highlights_global_data_t::kernel_hl_cf_pack_pair, luminance, out, ROUNDUPDHT, ROUNDUPDWD, and size.
Referenced by _cf_stage_cl_selftest().
| cl_int _hf_stage_cl | ( | const int | devid, |
| void * | gd_void, | ||
| cl_mem | estimate, | ||
| cl_mem | valid, | ||
| cl_mem | model_quality, | ||
| cl_mem | luminance, | ||
| cl_mem | steer, | ||
| dt_gaussian_cl_t * | gaussian, | ||
| const int | region_w, | ||
| const int | region_h, | ||
| const float | cf_sigma, | ||
| const float | cf_fmin, | ||
| const float | cf_binv | ||
| ) |
Definition at line 2308 of file coefficient_field.c.
References _cf_harmonic_fill_cl_n(), _region_blur_cl(), dt_gaussian_blur_cl(), dt_opencl_alloc_device(), dt_opencl_alloc_device_buffer(), DT_OPENCL_DEFAULT_ERROR, dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), gaussian(), kernel(), dt_iop_highlights_global_data_t::kernel_hl_buf_to_img, dt_iop_highlights_global_data_t::kernel_hl_hf_damp, dt_iop_highlights_global_data_t::kernel_hl_hf_energy, dt_iop_highlights_global_data_t::kernel_hl_hf_eval, dt_iop_highlights_global_data_t::kernel_hl_hf_fit, dt_iop_highlights_global_data_t::kernel_hl_hf_pack, luminance, out, ROUNDUPDHT, ROUNDUPDWD, and size.
Referenced by _hf_stage_cl_selftest().