Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
coefficient_field.c File Reference
#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)
 

Macro Definition Documentation

◆ CF_M2

#define CF_M2 (   nb_index,
  coef_a,
  coef_b 
)
Value:
(((coef_a) == (coef_b)) ? plane1[(nb_index) * 4 + (coef_a)] \
: ((2 + (coef_a) + (coef_b)) < 4 ? plane1[(nb_index) * 4 + 2 + (coef_a) + (coef_b)] \
: plane3[(nb_index) * 4 + (coef_a) + (coef_b) - 2]))

◆ DEFINE_CF_FILL_RELAX

#define DEFINE_CF_FILL_RELAX (   NP)

Definition at line 191 of file coefficient_field.c.

◆ HF_M2

#define HF_M2 (   nb_index,
  coef_a,
  coef_b 
)
Value:
(((coef_a) == (coef_b)) ? plane1[(nb_index) * 4 + (coef_a)] \
: ((2 + (coef_a) + (coef_b)) < 4 ? plane1[(nb_index) * 4 + 2 + (coef_a) + (coef_b)] \
: plane3[(nb_index) * 4 + (coef_a) + (coef_b) - 2]))

Function Documentation

◆ _cf_adaptive_tensor()

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

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().

◆ _cf_fill_relax_1()

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

Definition at line 273 of file coefficient_field.c.

Referenced by _cf_harmonic_fill_n().

◆ _cf_fill_relax_2()

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

Definition at line 274 of file coefficient_field.c.

Referenced by _cf_harmonic_fill_n().

◆ _cf_fill_relax_3()

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

Definition at line 275 of file coefficient_field.c.

Referenced by _cf_harmonic_fill_n().

◆ _cf_fill_relax_4()

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

Definition at line 276 of file coefficient_field.c.

Referenced by _cf_harmonic_fill_n().

◆ _cf_harmonic_fill()

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 
)

◆ _cf_harmonic_fill_cl()

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 
)

◆ _cf_harmonic_fill_cl_n()

◆ _cf_harmonic_fill_n()

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 
)
static

◆ _cf_joint_fit_cl()

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 
)
static

◆ _cf_joint_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 
)

◆ _cf_pair_stage_cl()

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

◆ _cf_reconstruct()

◆ _cf_stage_cl()

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 
)

◆ _hf_stage_cl()