![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#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>
Macros | |
#define | CLAMPI(a, mn, mx) ((a) < (mn) ? (mn) : ((a) > (mx) ? (mx) : (a))) |
#define | CL_ALIGNMENT ((piece->pipe->dsc.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, 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, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *iroi, dt_iop_roi_t *oroi, int delta, int iter) |
static void | _default_process_tiling_ptp (struct dt_iop_module_t *self, 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 void | _default_process_tiling_roi (struct dt_iop_module_t *self, 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) |
void | default_process_tiling (struct dt_iop_module_t *self, 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_cl (struct dt_iop_module_t *self, 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) |
void | default_tiling_callback (struct dt_iop_module_t *self, struct dt_dev_pixelpipe_iop_t *piece, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out, 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) |
#define ALPHA 1.0 /* reflection coefficient */ |
#define BETA 0.5 /* contraction coefficient */ |
#define CL_ALIGNMENT ((piece->pipe->dsc.filters != 9u) ? 4 : 1) |
#define CLAMPI | ( | a, | |
mn, | |||
mx | |||
) | ((a) < (mn) ? (mn) : ((a) > (mx) ? (mx) : (a))) |
#define GAMMA 2.0 /* expansion coefficient */ |
#define MAX_IT 1000 /* maximum number of iterations */ |
#define RESERVE 5 |
|
inlinestatic |
Referenced by _default_process_tiling_roi().
|
inlinestatic |
Referenced by _default_process_tiling_roi().
|
inlinestatic |
Referenced by _default_process_tiling_roi().
|
static |
References _lcm(), _max(), _maximum_number_tiles(), dt_alloc_align, dt_control_log(), DT_DEBUG_TILING, dt_free_align, dt_get_available_mem(), dt_get_singlebuffer_mem(), dt_iop_buffer_dsc_to_bpp(), dt_print(), dt_vprint(), error(), factor, for_four_channels, height, dt_iop_module_t::op, dt_dev_pixelpipe_iop_t::pipe, dt_iop_roi_t::scale, width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by default_process_tiling().
|
static |
References _align_close(), _align_down(), _align_up(), _fit_output_to_input_roi(), _lcm(), _max(), _maximum_number_tiles(), _min(), _print_roi(), dt_alloc_align, dt_control_log(), DT_DEBUG_TILING, dt_free_align, dt_get_available_mem(), dt_get_singlebuffer_mem(), dt_iop_buffer_dsc_to_bpp(), dt_print(), dt_vprint(), error(), factor, for_four_channels, height, dt_iop_module_t::op, dt_dev_pixelpipe_iop_t::pipe, RESERVE, dt_iop_roi_t::scale, width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by default_process_tiling().
|
static |
References _nm_fit_output_to_input_roi(), _print_roi(), TRUE, and dt_iop_roi_t::y.
Referenced by _default_process_tiling_roi().
|
static |
References _gcd().
Referenced by _default_process_tiling_ptp(), and _default_process_tiling_roi().
|
inlinestatic |
Referenced by _default_process_tiling_ptp(), _default_process_tiling_roi(), and spectrum_to_XYZ().
|
inlinestatic |
Referenced by _default_process_tiling_ptp(), and _default_process_tiling_roi().
|
inlinestatic |
Referenced by _default_process_tiling_roi().
|
static |
References _nm_fitness(), _simplex(), double(), DT_DEBUG_TILING, dt_vprint(), dt_dev_pixelpipe_iop_t::iheight, dt_dev_pixelpipe_iop_t::iwidth, MIN, and dt_iop_roi_t::y.
Referenced by _fit_output_to_input_roi().
References double(), dt_dev_pixelpipe_iop_t::iheight, dt_dev_pixelpipe_iop_t::iwidth, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _nm_fit_output_to_input_roi().
|
inlinestatic |
References darktable, DT_DEBUG_TILING, DT_DEBUG_VERBOSE, dt_iop_roi_t::height, dt_iop_roi_t::scale, darktable_t::unmuted, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _default_process_tiling_roi(), and _fit_output_to_input_roi().
|
static |
References ALPHA, BETA, EPSILON, f(), GAMMA, m, dt_iop_roi_t::scale, and dt_iop_roi_t::y.
Referenced by _nm_fit_output_to_input_roi().
void default_process_tiling | ( | struct dt_iop_module_t * | self, |
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_cl | ( | struct dt_iop_module_t * | self, |
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 | ||
) |
References FALSE.
void default_tiling_callback | ( | struct dt_iop_module_t * | self, |
struct dt_dev_pixelpipe_iop_t * | piece, | ||
const dt_iop_roi_t * | roi_in, | ||
const dt_iop_roi_t * | roi_out, | ||
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 | ||
) |
References bpp, dt_get_available_mem(), factor, FALSE, height, TRUE, width, and dt_iop_roi_t::y.
Referenced by pixelpipe_process_on_CPU().