Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
rcd.c File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RCD_TILESIZE   112
 
#define RCD_BORDER   9
 
#define RCD_MARGIN   6
 
#define RCD_TILEVALID   (RCD_TILESIZE - 2 * RCD_BORDER)
 
#define w1   RCD_TILESIZE
 
#define w2   (2 * RCD_TILESIZE)
 
#define w3   (3 * RCD_TILESIZE)
 
#define w4   (4 * RCD_TILESIZE)
 
#define eps   1e-5f
 
#define epssq   1e-10f
 

Functions

static INLINE float safe_in (float a, float scale)
 
static __DT_CLONE_TARGETS__ void rcd_ppg_border (float *const out, const float *const in, const int width, const int height, const uint32_t filters, const int margin)
 
static void rcd_demosaic (const dt_dev_pixelpipe_iop_t *piece, float *const restrict out, const float *const restrict in, dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const uint32_t filters)
 
static int process_rcd_cl (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const gboolean smooth)
 

Macro Definition Documentation

◆ eps

#define eps   1e-5f

Definition at line 81 of file rcd.c.

◆ epssq

#define epssq   1e-10f

Definition at line 82 of file rcd.c.

◆ RCD_BORDER

#define RCD_BORDER   9

Definition at line 73 of file rcd.c.

◆ RCD_MARGIN

#define RCD_MARGIN   6

Definition at line 74 of file rcd.c.

◆ RCD_TILESIZE

#define RCD_TILESIZE   112

Definition at line 54 of file rcd.c.

◆ RCD_TILEVALID

#define RCD_TILEVALID   (RCD_TILESIZE - 2 * RCD_BORDER)

Definition at line 75 of file rcd.c.

◆ w1

#define w1   RCD_TILESIZE

Definition at line 76 of file rcd.c.

◆ w2

#define w2   (2 * RCD_TILESIZE)

Definition at line 77 of file rcd.c.

◆ w3

#define w3   (3 * RCD_TILESIZE)

Definition at line 78 of file rcd.c.

◆ w4

#define w4   (4 * RCD_TILESIZE)

Definition at line 79 of file rcd.c.

Function Documentation

◆ process_rcd_cl()

static int process_rcd_cl ( struct dt_iop_module_t self,
const dt_dev_pixelpipe_t pipe,
const dt_dev_pixelpipe_iop_t piece,
cl_mem  dev_in,
cl_mem  dev_out,
const dt_iop_roi_t *const  roi_in,
const dt_iop_roi_t *const  roi_out,
const gboolean  smooth 
)
static

Definition at line 568 of file rcd.c.

References dt_iop_demosaic_data_t::color_smoothing, color_smoothing_cl(), dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_t::devid, dt_dev_pixelpipe_iop_t::dsc_in, DT_DEBUG_OPENCL, DT_IOP_GREEN_EQ_NO, dt_opencl_alloc_device(), dt_opencl_alloc_device_buffer(), dt_opencl_enqueue_kernel_2d(), dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_local_buffer_opt(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_print(), error(), FALSE, dt_iop_buffer_dsc_t::filters, dt_iop_module_t::global_data, dt_iop_demosaic_data_t::green_eq, green_equilibration_cl(), height, dt_iop_roi_t::height, IS_NULL_PTR, dt_iop_demosaic_global_data_t::kernel_border_interpolate, dt_iop_demosaic_global_data_t::kernel_rcd_border_green, dt_iop_demosaic_global_data_t::kernel_rcd_border_redblue, dt_iop_demosaic_global_data_t::kernel_rcd_populate, dt_iop_demosaic_global_data_t::kernel_rcd_step_1, dt_iop_demosaic_global_data_t::kernel_rcd_step_2_1, dt_iop_demosaic_global_data_t::kernel_rcd_step_3_1, dt_iop_demosaic_global_data_t::kernel_rcd_step_4_1, dt_iop_demosaic_global_data_t::kernel_rcd_step_4_2, dt_iop_demosaic_global_data_t::kernel_rcd_step_5_1, dt_iop_demosaic_global_data_t::kernel_rcd_step_5_2, dt_iop_demosaic_global_data_t::kernel_rcd_write_output, dt_iop_buffer_dsc_t::processed_maximum, ROUNDUP, ROUNDUPDHT, ROUNDUPDWD, dt_opencl_local_buffer_t::sizex, dt_opencl_local_buffer_t::sizey, TRUE, width, dt_iop_roi_t::width, and dt_opencl_local_buffer_t::xoffset.

Referenced by process_cl().

◆ rcd_demosaic()

static void rcd_demosaic ( const dt_dev_pixelpipe_iop_t piece,
float *const restrict  out,
const float *const restrict  in,
dt_iop_roi_t *const  roi_out,
const dt_iop_roi_t *const  roi_in,
const uint32_t  filters 
)
static
Todo:
: CRITICAL: need to handle the case where we couldn't alloc the memory,
Todo:
: figure out what part of rgb is being accessed without initialization on partial tiles

Definition at line 274 of file rcd.c.

References c1, dt_dev_pixelpipe_iop_t::dsc_in, DT_ALIGNED_PIXEL, dt_control_log(), DT_FP_MODE_FAST, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, eps, epssq, FC(), height, dt_iop_roi_t::height, intp(), MIN, out, dt_iop_buffer_dsc_t::processed_maximum, RCD_BORDER, RCD_MARGIN, rcd_ppg_border(), RCD_TILESIZE, RCD_TILEVALID, rgb, row, safe_in(), w1, w2, w3, w4, width, and dt_iop_roi_t::width.

Referenced by process().

◆ rcd_ppg_border()

static __DT_CLONE_TARGETS__ void rcd_ppg_border ( float *const  out,
const float *const  in,
const int  width,
const int  height,
const uint32_t  filters,
const int  margin 
)
static

This is basically ppg adopted to only write data to RCD_MARGIN

Definition at line 92 of file rcd.c.

References __OMP_PARALLEL_FOR__, f, FC(), height, i, M, m, out, width, and x.

Referenced by rcd_demosaic().

◆ safe_in()

static INLINE float safe_in ( float  a,
float  scale 
)
static

Definition at line 85 of file rcd.c.

Referenced by rcd_demosaic().