![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/bauhaus.h"#include "system/macros.h"#include "system/openmp.h"#include "system/target_clones.h"#include "system/mem_alloc.h"#include "common/logging.h"#include "common/module_versioning.h"#include <json-glib/json-glib.h>#include "caches/pixelpipe_cache_alloc.h"#include "common/file_location.h"#include "common/imagebuf.h"#include "common/nn_model.h"#include "common/noiseprofiles.h"#include "common/opencl.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include "develop/imageop_math.h"#include "develop/tiling.h"#include "iop/iop_api.h"#include <gtk/gtk.h>#include <stdlib.h>#include "widgets/collapsible_section.h"#include "widgets/label.h"
Include dependency graph for rawdenoiseai.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_rawdenoiseai_params_t |
| struct | dt_iop_rawdenoiseai_gui_data_t |
| struct | dt_iop_rawdenoiseai_data_t |
| struct | dt_iop_rawdenoiseai_global_data_t |
| struct | nn_region_t |
Macros | |
| #define | DT_RAWDENOISEAI_MODEL_LEN 128 |
| #define | DT_RAWDENOISEAI_NUM_VERSIONS 1 |
| #define | DT_RAWDENOISEAI_NUM_SIZES 3 |
| #define | DT_RAWDENOISEAI_NUM_SCALES 2 |
| #define | NN_REGION_MAX_BLOCKS 32 |
| #define | NN_REGION_SLACK 1.02f |
| #define | DT_NN_FUSION_T_CHI2 2.5 |
Enumerations | |
| enum | dt_iop_rawdenoiseai_version_t { DT_RAWDENOISEAI_V1 = 0 } |
| enum | dt_iop_rawdenoiseai_size_t { DT_RAWDENOISEAI_LARGE = 0 , DT_RAWDENOISEAI_HALF = 1 , DT_RAWDENOISEAI_QUARTER = 2 } |
| enum | dt_iop_rawdenoiseai_scale_t { DT_RAWDENOISEAI_SINGLE = 0 , DT_RAWDENOISEAI_MULTI = 1 } |
Variables | |
| static const char *const | _version_tag [1] = { "v1" } |
| static const char *const | _size_tag [3] = { "large", "half", "quarter" } |
| static const char *const | _scale_tag [2] = { "single", "multi" } |
| static __thread nn_region_t * | _nn_region = NULL |
| static const float | DT_NN_FUSION_DENS [3] = { 0.25f, 0.5f, 0.25f } |
| #define DT_NN_FUSION_T_CHI2 2.5 |
Definition at line 923 of file rawdenoiseai.c.
| #define DT_RAWDENOISEAI_MODEL_LEN 128 |
Definition at line 83 of file rawdenoiseai.c.
| #define DT_RAWDENOISEAI_NUM_SCALES 2 |
Definition at line 121 of file rawdenoiseai.c.
| #define DT_RAWDENOISEAI_NUM_SIZES 3 |
Definition at line 120 of file rawdenoiseai.c.
| #define DT_RAWDENOISEAI_NUM_VERSIONS 1 |
Definition at line 119 of file rawdenoiseai.c.
| #define NN_REGION_MAX_BLOCKS 32 |
Definition at line 376 of file rawdenoiseai.c.
| #define NN_REGION_SLACK 1.02f |
Definition at line 380 of file rawdenoiseai.c.
| Enumerator | |
|---|---|
| DT_RAWDENOISEAI_SINGLE | |
| DT_RAWDENOISEAI_MULTI | |
Definition at line 113 of file rawdenoiseai.c.
| Enumerator | |
|---|---|
| DT_RAWDENOISEAI_LARGE | |
| DT_RAWDENOISEAI_HALF | |
| DT_RAWDENOISEAI_QUARTER | |
Definition at line 103 of file rawdenoiseai.c.
| Enumerator | |
|---|---|
| DT_RAWDENOISEAI_V1 | |
Definition at line 91 of file rawdenoiseai.c.
|
inlinestatic |
Definition at line 820 of file rawdenoiseai.c.
Definition at line 708 of file rawdenoiseai.c.
Referenced by tiling_callback().
|
static |
Definition at line 1195 of file rawdenoiseai.c.
References _fusion_levels(), _k_avg2x2(), _k_bilerp_add(), _k_bin16_mdv(), _k_floor_fuse(), _k_fuse_step(), DT_NN_FUSION_COARSEST, DT_NN_FUSION_FINEST, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, IS_NULL_PTR, k, L, and S.
Referenced by process().
|
static |
Definition at line 1695 of file rawdenoiseai.c.
References dt_iop_module_t::dev, dt_bauhaus_combobox_get(), dt_bauhaus_combobox_get_text(), dt_dev_add_history_item, dt_gui_widgets_suppressed(), dt_iop_request_focus(), L, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Definition at line 1709 of file rawdenoiseai.c.
References _list_custom_models(), dt_bauhaus_combobox_add(), dt_bauhaus_combobox_clear(), dt_bauhaus_combobox_set(), dt_iop_gui_data(), g, i, L, p, and dt_iop_module_t::params.
Referenced by gui_update().
|
static |
Definition at line 557 of file rawdenoiseai.c.
References dt_opencl_is_enabled(), DT_RAWDENOISEAI_HALF, and DT_RAWDENOISEAI_QUARTER.
Referenced by _rawdenoiseai_supported(), and reload_defaults().
|
static |
Definition at line 611 of file rawdenoiseai.c.
References dt_noiseprofile_t::a, dt_noiseprofile_t::b, d, dt_iop_module_t::dev, dt_noiseprofile_free(), dt_noiseprofile_generic, dt_noiseprofile_get_matching(), dt_noiseprofile_interpolate(), dt_image_t::exif_iso, dt_develop_t::image_storage, dt_noiseprofile_t::iso, k, and L.
Referenced by commit_params().
Definition at line 1049 of file rawdenoiseai.c.
References DT_NN_FUSION_COARSEST, DT_NN_FUSION_FINEST, and n.
Referenced by _apply_low_band_anchor(), and process_cl().
|
static |
Definition at line 266 of file rawdenoiseai.c.
References DT_DEBUG_ALWAYS, dt_loc_get_user_config_dir(), dt_nn_model_load(), dt_print(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), L, m, and PATH_MAX.
Referenced by commit_params(), and gui_update().
|
static |
Definition at line 226 of file rawdenoiseai.c.
References _scale_tag, _size_tag, _version_tag, DT_DEBUG_ALWAYS, dt_loc_get_datadir(), dt_loc_get_user_config_dir(), dt_nn_model_load(), dt_print(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), DT_RAWDENOISEAI_NUM_SCALES, DT_RAWDENOISEAI_NUM_SIZES, DT_RAWDENOISEAI_NUM_VERSIONS, L, m, name(), PATH_MAX, and TRUE.
Referenced by _rawdenoiseai_supported(), commit_params(), and gui_update().
|
static |
Definition at line 874 of file rawdenoiseai.c.
References __OMP_PARALLEL_FOR__, _sigma_scale(), d, FC(), FCxtrans(), height, L, MAX, sigma, v, width, and x.
Referenced by process().
|
static |
Definition at line 992 of file rawdenoiseai.c.
Referenced by _apply_low_band_anchor().
|
static |
Definition at line 1165 of file rawdenoiseai.c.
References __OMP_PARALLEL_FOR__, d0, DT_NN_FUSION_FINEST, i, inv, L, and x.
Referenced by _apply_low_band_anchor().
|
static |
Definition at line 955 of file rawdenoiseai.c.
References __OMP_PARALLEL_FOR__, DT_NN_FUSION_FINEST, i, L, M, n, V, and x.
Referenced by _apply_low_band_anchor().
|
static |
Definition at line 846 of file rawdenoiseai.c.
References __OMP_PARALLEL_FOR__, _sigma_scale(), d, dt_nn_bin_planes(), i, L, MAX, n, and sigma.
Referenced by process().
|
static |
Definition at line 939 of file rawdenoiseai.c.
References __OMP_PARALLEL_FOR__, height, L, out, strength(), width, and x.
Referenced by process().
|
static |
Definition at line 1070 of file rawdenoiseai.c.
References double(), DT_NN_FUSION_DENS, DT_NN_FUSION_T_CHI2, i, L, M, S, V, and x.
Referenced by _apply_low_band_anchor().
|
static |
Definition at line 1115 of file rawdenoiseai.c.
References _upsample_bilinear(), d, double(), DT_NN_FUSION_DENS, DT_NN_FUSION_T_CHI2, i, L, n, and x.
Referenced by _apply_low_band_anchor().
|
static |
Definition at line 929 of file rawdenoiseai.c.
References __OMP_PARALLEL_FOR__, i, L, n, and out.
Referenced by process().
Definition at line 294 of file rawdenoiseai.c.
References _scale_tag, _size_tag, _version_tag, d, dt_loc_get_user_config_dir(), DT_RAWDENOISEAI_NUM_SCALES, DT_RAWDENOISEAI_NUM_SIZES, DT_RAWDENOISEAI_NUM_VERSIONS, FALSE, L, name(), out, PATH_MAX, and v.
Referenced by _custom_model_populate().
Definition at line 472 of file rawdenoiseai.c.
References _nn_region, _region_alloc(), dt_pixelpipe_cache_alloc_align_cache, and L.
Referenced by init_global().
Definition at line 478 of file rawdenoiseai.c.
References _nn_region, _region_free(), dt_pixelpipe_cache_free_align, L, p, and r.
Referenced by init_global().
|
static |
Definition at line 568 of file rawdenoiseai.c.
References _default_size(), _get_model(), dt_image_needs_demosaic(), DT_RAWDENOISEAI_MULTI, DT_RAWDENOISEAI_V1, and L.
Referenced by force_enable().
|
static |
Definition at line 395 of file rawdenoiseai.c.
References nn_region_t::blocks, DT_DEBUG_ALWAYS, dt_print(), i, L, NN_REGION_MAX_BLOCKS, nn_region_t::off, and r.
Referenced by _nn_arena_alloc(), and process().
|
static |
Definition at line 460 of file rawdenoiseai.c.
Referenced by _nn_arena_free().
|
static |
Definition at line 834 of file rawdenoiseai.c.
References d.
Referenced by _k_assemble(), _k_bin_planes(), and process_cl().
|
static |
Definition at line 1037 of file rawdenoiseai.c.
Referenced by _k_fuse_step().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 511 of file rawdenoiseai.c.
References dt_nn_cl_destroy(), dt_nn_model_free(), dt_nn_set_allocator(), dt_opencl_free_kernel(), dt_pthread_mutex_destroy(), DT_RAWDENOISEAI_NUM_SCALES, DT_RAWDENOISEAI_NUM_SIZES, DT_RAWDENOISEAI_NUM_VERSIONS, k, L, and v.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1683 of file rawdenoiseai.c.
References dt_dev_pixelpipe_iop_t::data, dt_free_align, and L.
| void commit_params | ( | struct dt_iop_module_t * | self, |
| dt_iop_params_t * | params, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 648 of file rawdenoiseai.c.
References _fetch_noise_profile(), _get_custom_model(), _get_model(), _scale_tag, _size_tag, _version_tag, dt_dev_pixelpipe_iop_t::cache_output_on_ram, dt_image_t::camera_makermodel, d, dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_DEBUG_ALWAYS, DT_DEBUG_PARAMS, dt_nn_model_coarse_in_channels(), dt_nn_model_coarse_out_channels(), dt_nn_model_in_channels(), dt_print(), DT_RAWDENOISEAI_NUM_SCALES, DT_RAWDENOISEAI_NUM_SIZES, DT_RAWDENOISEAI_NUM_VERSIONS, dt_dev_pixelpipe_iop_t::enabled, dt_image_t::exif_iso, dt_iop_module_t::global_data, dt_develop_t::image_storage, L, p, and TRUE.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 344 of file rawdenoiseai.c.
References IOP_CS_RAW.
| int default_group | ( | ) |
Definition at line 339 of file rawdenoiseai.c.
References IOP_GROUP_REPAIR.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 325 of file rawdenoiseai.c.
References dt_iop_set_description(), and L.
| int flags | ( | ) |
Definition at line 334 of file rawdenoiseai.c.
References IOP_FLAGS_ALLOW_TILING, and IOP_FLAGS_SUPPORTS_BLENDING.
| gboolean force_enable | ( | struct dt_iop_module_t * | self, |
| const gboolean | current_state | ||
| ) |
Definition at line 600 of file rawdenoiseai.c.
References _rawdenoiseai_supported(), and L.
| void gui_cleanup | ( | dt_iop_module_t * | self | ) |
Definition at line 1859 of file rawdenoiseai.c.
References IOP_GUI_FREE.
| void gui_init | ( | dt_iop_module_t * | self | ) |
Definition at line 1770 of file rawdenoiseai.c.
References _custom_model_callback(), dt_bauhaus_combobox_from_params(), dt_bauhaus_combobox_new(), dt_bauhaus_get_global(), dt_bauhaus_slider_from_params(), dt_bauhaus_slider_set_digits(), dt_bauhaus_slider_set_format(), dt_bauhaus_widget_set_label(), DT_GUI_BOX_SPACING, DT_GUI_MODULE, dt_gui_new_collapsible_section(), dt_ui_label_new(), dt_ui_section_label_new(), FALSE, g, dt_iop_module_t::gui, IOP_GUI_ALLOC, L, TRUE, and dt_iop_module_gui_t::widget.
| void gui_update | ( | dt_iop_module_t * | self | ) |
Refresh GUI controls from current params and configuration.
Definition at line 1738 of file rawdenoiseai.c.
References _custom_model_populate(), _get_custom_model(), _get_model(), _scale_tag, _size_tag, _version_tag, dt_image_t::camera_makermodel, dt_iop_module_t::dev, dt_gui_update_collapsible_section(), dt_iop_gui_data(), dt_noiseprofile_free(), dt_noiseprofile_get_matching(), DT_RAWDENOISEAI_NUM_SCALES, DT_RAWDENOISEAI_NUM_SIZES, DT_RAWDENOISEAI_NUM_VERSIONS, dt_image_t::exif_iso, g, dt_iop_module_t::global_data, dt_iop_module_t::gui, dt_iop_module_t::hide_enable_button, dt_develop_t::image_storage, L, p, dt_iop_module_t::params, and dt_iop_module_gui_t::widget.
| void init | ( | dt_iop_module_t * | module | ) |
Definition at line 1672 of file rawdenoiseai.c.
References dt_iop_default_init(), and L.
| void init_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 489 of file rawdenoiseai.c.
References _nn_arena_alloc(), _nn_arena_free(), dt_nn_cl_create(), dt_nn_set_allocator(), dt_opencl_create_kernel(), dt_pthread_mutex_init(), and L.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 1677 of file rawdenoiseai.c.
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
| void input_format | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_buffer_dsc_t * | dsc | ||
| ) |
Definition at line 349 of file rawdenoiseai.c.
References dt_iop_buffer_dsc_t::channels, default_input_format(), and dt_iop_buffer_dsc_update_bpp().
| const char * name | ( | ) |
Definition at line 320 of file rawdenoiseai.c.
References L.
Referenced by _get_model(), and _list_custom_models().
| __DT_CLONE_TARGETS__ int process | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const void *const | ivoid, | ||
| void *const | ovoid | ||
| ) |
Definition at line 1260 of file rawdenoiseai.c.
References _apply_low_band_anchor(), _k_assemble(), _k_bin_planes(), _k_blend_crop(), _k_residual(), _nn_region, _region_alloc(), nn_region_t::base, d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::dsc_in, DT_DEBUG_ALWAYS, dt_dev_get_roi_filters(), dt_iop_image_copy_by_size(), dt_nn_model_alignment(), dt_nn_model_anchor(), dt_nn_model_bin(), dt_nn_model_in_channels(), dt_nn_unet_apply_stage(), dt_nn_unet_scratch_bytes(), dt_nn_upsample_nearest(), dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, dt_print(), height, dt_iop_roi_t::height, IS_NULL_PTR, L, model, NN_REGION_SLACK, out, ovoid, dt_dev_pixelpipe_iop_t::roi_in, nn_region_t::size, width, dt_iop_roi_t::width, and dt_iop_buffer_dsc_t::xtrans.
| int process_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 | ||
| ) |
Definition at line 1370 of file rawdenoiseai.c.
References _fusion_levels(), _sigma_scale(), cleanup(), d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_t::devid, dt_dev_pixelpipe_iop_t::dsc_in, DT_DEBUG_OPENCL, dt_dev_get_roi_filters(), DT_NN_FUSION_COARSEST, DT_NN_FUSION_DENS, dt_nn_model_alignment(), dt_nn_model_anchor(), dt_nn_model_bin(), dt_nn_model_in_channels(), dt_nn_unet_apply_stage_cl(), dt_opencl_alloc_device_buffer(), dt_opencl_enqueue_copy_buffer_to_image(), dt_opencl_enqueue_copy_image_to_buffer(), dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_opencl_write_buffer_to_device(), dt_print(), f, FALSE, gh(), dt_iop_module_t::global_data, height, dt_iop_roi_t::height, k, L, lw, model, dt_dev_pixelpipe_iop_t::roi_in, ROUNDUPDHT, ROUNDUPDWD, S, t, TRUE, width, dt_iop_roi_t::width, dt_iop_roi_t::x, dt_iop_buffer_dsc_t::xtrans, and dt_iop_roi_t::y.
| void reload_defaults | ( | dt_iop_module_t * | module | ) |
Definition at line 575 of file rawdenoiseai.c.
References _default_size(), d, DT_RAWDENOISEAI_MULTI, and L.
| void 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 | ||
| ) |
Definition at line 721 of file rawdenoiseai.c.
References _align_lcm(), d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::dsc_in, dt_nn_model_alignment(), dt_nn_model_bin(), dt_nn_model_in_channels(), dt_nn_unet_scratch_per_px(), dt_nn_unet_scratch_per_px_cl(), dt_iop_buffer_dsc_t::filters, L, and NN_REGION_SLACK.
|
static |
Definition at line 393 of file rawdenoiseai.c.
Referenced by _nn_arena_alloc(), _nn_arena_free(), and process().
Definition at line 127 of file rawdenoiseai.c.
Referenced by _get_model(), _list_custom_models(), commit_params(), and gui_update().
Definition at line 126 of file rawdenoiseai.c.
Referenced by _get_model(), _list_custom_models(), commit_params(), and gui_update().
Definition at line 125 of file rawdenoiseai.c.
Referenced by _get_model(), _list_custom_models(), commit_params(), and gui_update().
Definition at line 918 of file rawdenoiseai.c.
Referenced by _k_floor_fuse(), _k_fuse_step(), and process_cl().