![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#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) |
| #define ALPHA 1.0 /* reflection coefficient */ |
| #define BETA 0.5 /* contraction coefficient */ |
| #define CL_ALIGNMENT ((piece->dsc_in.filters != 9u) ? 4 : 1) |
| #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_iop_buffer_dsc_t::bpp, dt_dev_pixelpipe_iop_t::dsc_out, dt_control_log(), DT_DEBUG_TILING, dt_get_available_mem(), dt_get_singlebuffer_mem(), dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_free_align, dt_print(), dt_vprint(), error(), factor, height, dt_iop_roi_t::height, dt_iop_module_t::op, dt_dev_pixelpipe_iop_t::roi_in, dt_iop_roi_t::scale, dt_dev_pixelpipe_t::type, width, dt_iop_roi_t::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_iop_buffer_dsc_t::bpp, delta, dt_dev_pixelpipe_iop_t::dsc_out, dt_control_log(), DT_DEBUG_TILING, dt_get_available_mem(), dt_get_singlebuffer_mem(), dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_free_align, dt_print(), dt_vprint(), error(), factor, height, dt_iop_roi_t::height, dt_iop_module_t::op, RESERVE, dt_dev_pixelpipe_iop_t::roi_in, dt_iop_roi_t::scale, dt_dev_pixelpipe_t::type, width, dt_iop_roi_t::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(), delta, TRUE, and dt_iop_roi_t::y.
Referenced by _default_process_tiling_roi().
|
static |
|
static |
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(), delta, 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, x, 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().
| 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 | ||
| ) |
References dt_dev_pixelpipe_iop_t::dsc_in, dt_ioppr_get_iop_order(), dt_iop_buffer_dsc_t::filters, dt_iop_roi_t::height, IOP_FLAGS_TILING_FULL_ROI, dt_iop_module_t::iop_order, dt_dev_pixelpipe_t::iop_order_list, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, dt_iop_roi_t::width, and dt_iop_roi_t::y.
| 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, darktable, dt_dev_pixel_pipe_cache_remove_lru(), dt_get_available_mem(), error(), factor, FALSE, height, darktable_t::pixelpipe_cache, TRUE, width, and dt_iop_roi_t::y.
Referenced by pixelpipe_process_on_CPU().