Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
tiling.c File Reference
#include "common/darktable.h"
#include "develop/tiling.h"
#include "common/opencl.h"
#include "control/control.h"
#include "develop/blend.h"
#include "develop/pixelpipe.h"
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
+ Include dependency graph for tiling.c:

Macros

#define CLAMPI(a, mn, mx)   ((a) < (mn) ? (mn) : ((a) > (mx) ? (mx) : (a)))
 
#define CL_ALIGNMENT   ((piece->dsc_in.filters != 9u) ? 4 : 1)
 
#define RESERVE   5
 
#define MAX_IT   1000 /* maximum number of iterations */
 
#define ALPHA   1.0 /* reflection coefficient */
 
#define BETA   0.5 /* contraction coefficient */
 
#define GAMMA   2.0 /* expansion coefficient */
 

Functions

static unsigned _gcd (unsigned a, unsigned b)
 
static unsigned _lcm (unsigned a, unsigned b)
 
static int _min (int a, int b)
 
static int _max (int a, int b)
 
static int _align_up (int n, int a)
 
static int _align_down (int n, int a)
 
static int _align_close (int n, int a)
 
static int _maximum_number_tiles ()
 
static void _print_roi (const dt_iop_roi_t *roi, const char *label)
 
static double _nm_fitness (double x[], void *rest[])
 
static int _simplex (double(*objfunc)(double[], void *[]), double start[], int n, double EPSILON, double scale, int maxiter, void(*constrain)(double[], int n), void *rest[])
 
static int _nm_fit_output_to_input_roi (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *iroi, dt_iop_roi_t *oroi, int delta)
 
static int _fit_output_to_input_roi (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *iroi, dt_iop_roi_t *oroi, int delta, int iter)
 
static int _default_process_tiling_ptp (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const int in_bpp)
 
static int _default_process_tiling_roi (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out, const int in_bpp)
 
int default_process_tiling (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const int in_bpp)
 
int default_process_tiling_cl (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, const void *const ivoid, void *const ovoid, const int in_bpp)
 
void default_tiling_callback (struct dt_iop_module_t *self, const struct dt_dev_pixelpipe_t *pipe, const struct dt_dev_pixelpipe_iop_t *piece, struct dt_develop_tiling_t *tiling)
 
int dt_tiling_piece_fits_host_memory (const size_t width, const size_t height, const unsigned bpp, const float factor, const size_t overhead)
 

Macro Definition Documentation

◆ ALPHA

#define ALPHA   1.0 /* reflection coefficient */

◆ BETA

#define BETA   0.5 /* contraction coefficient */

◆ CL_ALIGNMENT

#define CL_ALIGNMENT   ((piece->dsc_in.filters != 9u) ? 4 : 1)

◆ CLAMPI

#define CLAMPI (   a,
  mn,
  mx 
)    ((a) < (mn) ? (mn) : ((a) > (mx) ? (mx) : (a)))

◆ GAMMA

#define GAMMA   2.0 /* expansion coefficient */

◆ MAX_IT

#define MAX_IT   1000 /* maximum number of iterations */

◆ RESERVE

#define RESERVE   5

Function Documentation

◆ _align_close()

static int _align_close ( int  n,
int  a 
)
inlinestatic

References a, and n.

Referenced by _default_process_tiling_roi().

◆ _align_down()

static int _align_down ( int  n,
int  a 
)
inlinestatic

References a, and n.

Referenced by _default_process_tiling_roi().

◆ _align_up()

static int _align_up ( int  n,
int  a 
)
inlinestatic

References a, and n.

Referenced by _default_process_tiling_roi().

◆ _default_process_tiling_ptp()

static int _default_process_tiling_ptp ( struct dt_iop_module_t self,
const struct dt_dev_pixelpipe_t pipe,
const struct dt_dev_pixelpipe_iop_t piece,
const void *const  ivoid,
void *const  ovoid,
const dt_iop_roi_t *const  roi_in,
const dt_iop_roi_t *const  roi_out,
const int  in_bpp 
)
static

◆ _default_process_tiling_roi()

◆ _fit_output_to_input_roi()

static int _fit_output_to_input_roi ( struct dt_iop_module_t self,
const struct dt_dev_pixelpipe_iop_t piece,
const dt_iop_roi_t iroi,
dt_iop_roi_t oroi,
int  delta,
int  iter 
)
static

◆ _gcd()

static unsigned _gcd ( unsigned  a,
unsigned  b 
)
static

References a, b, MAX, and t.

Referenced by _lcm().

◆ _lcm()

static unsigned _lcm ( unsigned  a,
unsigned  b 
)
static

References _gcd(), a, and b.

Referenced by _default_process_tiling_ptp(), and _default_process_tiling_roi().

◆ _max()

static int _max ( int  a,
int  b 
)
inlinestatic

◆ _maximum_number_tiles()

static int _maximum_number_tiles ( )
inlinestatic

◆ _min()

static int _min ( int  a,
int  b 
)
inlinestatic

References a, and b.

Referenced by _default_process_tiling_roi().

◆ _nm_fit_output_to_input_roi()

static int _nm_fit_output_to_input_roi ( struct dt_iop_module_t self,
const struct dt_dev_pixelpipe_iop_t piece,
const dt_iop_roi_t iroi,
dt_iop_roi_t oroi,
int  delta 
)
static

◆ _nm_fitness()

static double _nm_fitness ( double  x[],
void rest[] 
)
static

◆ _print_roi()

◆ _simplex()

static int _simplex ( double(*)(double[], void *[])  objfunc,
double  start[],
int  n,
double  EPSILON,
double  scale,
int  maxiter,
void(*)(double[], int n constrain,
void rest[] 
)
static

◆ default_process_tiling()

int default_process_tiling ( struct dt_iop_module_t self,
const struct dt_dev_pixelpipe_t pipe,
const struct dt_dev_pixelpipe_iop_t piece,
const void *const  ivoid,
void *const  ovoid,
const int  in_bpp 
)

◆ default_process_tiling_cl()

int default_process_tiling_cl ( struct dt_iop_module_t self,
const struct dt_dev_pixelpipe_t pipe,
const struct dt_dev_pixelpipe_iop_t piece,
const void *const  ivoid,
void *const  ovoid,
const int  in_bpp 
)

References FALSE, and void().

◆ default_tiling_callback()

◆ dt_tiling_piece_fits_host_memory()

int dt_tiling_piece_fits_host_memory ( const size_t  width,
const size_t  height,
const unsigned  bpp,
const float  factor,
const size_t  overhead 
)