31 float *
const restrict tensor_xy,
float *
const restrict tensor_yy,
float *
const restrict scratch,
32 const int region_w,
const int region_h);
48void _aniso_iterate_obs(
float *
const restrict field,
const float *
const restrict obstacle,
49 const uint8_t *
const restrict hole,
const float *
const restrict tensor_xx,
50 const float *
const restrict tensor_xy,
const float *
const restrict tensor_yy,
51 float *
const restrict tmp,
const int region_w,
const int region_h,
const int iters,
52 const int box_x_lo,
const int box_y_lo,
const int box_x_hi,
const int box_y_hi);
54static inline float _aniso_edge_w(
const float *
const restrict tensor_xx,
const float *
const restrict tensor_xy,
55 const float *
const restrict tensor_yy,
const size_t i,
const size_t j,
56 const int offset_x,
const int offset_y)
58 const float avg_xx = 0.5f * (tensor_xx[
i] + tensor_xx[j]);
59 const float avg_yy = 0.5f * (tensor_yy[
i] + tensor_yy[j]);
60 const float limit = fminf(avg_xx, avg_yy);
62 = CLAMP(0.5f * (tensor_xy[
i] + tensor_xy[j]), -limit, limit);
64 if(offset_y == 0)
return fmaxf(avg_xx - fabsf(cross), 1e-4f);
65 if(offset_x == 0)
return fmaxf(avg_yy - fabsf(cross), 1e-4f);
66 if(offset_x == offset_y)
return fmaxf(cross, 0.f);
67 return fmaxf(-cross, 0.f);
82int _aniso_div_solve(
float *
const restrict ratios,
const float *
const restrict valid,
83 const float *
const restrict
luminance,
float *
const restrict scratch_planes,
88#if defined(HAVE_OPENCL) && DT_HL_SPARSE_SOLVE && (DT_HL_ANISO_SOLVER == 2)
105cl_int _aniso_stage_cl(
const int devid,
void *gd_void, cl_mem estimate, cl_mem valid, cl_mem clip0,
106 const int region_w,
const int region_h,
const float radius,
const dt_dev_pixelpipe_t *pipe);
int _aniso_div_solve(float *const restrict ratios, const float *const restrict valid, const float *const restrict luminance, float *const restrict scratch_planes, const int region_w, const int region_h, const dt_dev_pixelpipe_t *pipe)
void _aniso_iterate_obs(float *const restrict field, const float *const restrict obstacle, const uint8_t *const restrict hole, const float *const restrict tensor_xx, const float *const restrict tensor_xy, const float *const restrict tensor_yy, float *const restrict tmp, const int region_w, const int region_h, const int iters, const int box_x_lo, const int box_y_lo, const int box_x_hi, const int box_y_hi)
void _aniso_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, const int region_w, const int region_h)
void _aniso_chroma(_hl_region_ctx_t *const ctx)
static float _aniso_edge_w(const float *const restrict tensor_xx, const float *const restrict tensor_xy, const float *const restrict tensor_yy, const size_t i, const size_t j, const int offset_x, const int offset_y)
float *const restrict luminance