Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
simd.h File Reference
#include "system/mem_alloc.h"
#include "system/openmp.h"
#include <glib.h>
#include <math.h>
Include dependency graph for simd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DT_PIXEL_SIMD_CHANNELS   4
#define for_each_channel(_var, ...)
#define for_four_channels(_var, ...)

Typedefs

typedef DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
typedef float dt_aligned_pixel_simd_t __attribute__((vector_size(16), aligned(16)))
 Apply one channel's tone curve to each of the three colour channels, or pass the channel through untouched when it has none.

Functions

static __attribute__ ((always_inline)) dt_aligned_pixel_simd_t dt_simd_set1(const float value)
 for (int c=0;c< 4;c++) out[c]
 dt_store_simd (out, value)
static void copy_pixel_nontemporal (float *const __restrict__ out, const float *const __restrict__ in)
static void copy_pixel (float *const __restrict__ out, const float *const __restrict__ in)

Variables

static const dt_aligned_pixel_simd_t sign
return out = row1 * in[1] + out
static const dt_aligned_pixel_simd_t exponent
static const dt_aligned_pixel_simd_t value
static const dt_aligned_pixel_simd_t row0
static const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t row1
static const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t row2

Macro Definition Documentation

◆ DT_PIXEL_SIMD_CHANNELS

#define DT_PIXEL_SIMD_CHANNELS   4

Definition at line 63 of file simd.h.

Referenced by _lens_fill_vignette_row(), and process().

◆ for_each_channel

#define for_each_channel ( _var,
... )
Value:
for (size_t _var = 0; _var < DT_PIXEL_SIMD_CHANNELS; _var++)
#define DT_PIXEL_SIMD_CHANNELS
Definition simd.h:63

Definition at line 87 of file simd.h.

Referenced by __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), _blend_Lab_rescale(), _blend_Lab_scale(), _build_edge_edit(), _CLAMP_XYZ(), _heal_add(), _heal_laplace_iteration(), _heal_sub(), _interpolate_and_mask(), _interpolate_and_mask_passthrough(), _interpolate_and_mask_xtrans(), _node_base_rgb(), _profile_linear_rgb_to_display_rgb_normalized(), _remosaic_and_replace_passthrough(), _retouch_fill(), _scope_pixel_to_display_rgb(), _transform_matrix_rgb(), _update_sample_label(), _xyz_d50_to_profile_rgb(), auto_detect_WB(), backtransform(), backtransform_v2(), backtransform_Y0U0V0(), compute_wb_factors(), copy_pixel(), diff_of_pixels_diff(), dn_weight(), dt_colormatrix_mul(), dt_colorrings_hsb_to_display_rgb(), dt_colorrings_profile_rgb_to_display_rgb(), dt_colorrings_profile_rgb_to_dt_ucs_jch(), dt_develop_blendif_lab_blend(), dwt_decompose_horiz(), dwt_decompose_vert(), eaw_dn_decompose(), filmic_chroma_v1(), filmic_chroma_v2_v3(), get_luminance_from_buffer(), guide_laplacians(), heat_PDE_diffusion(), heat_PDE_diffusion(), init_reconstruct(), inpaint_noise(), nlmeans_denoise(), nlmeans_precondition_cl(), normalize_manifolds(), pixel_difference(), precondition(), precondition_v2(), precondition_Y0U0V0(), process(), process(), process(), process_hsl_v1(), process_hsl_v2(), process_wavelets(), process_wavelets_cl(), restore_ratios(), rt_copy_image_masked(), sparse_scalar_product(), sum_rec(), variance_rec(), and weight().

◆ for_four_channels

Typedef Documentation

◆ __attribute__

__attribute__
inline

Apply one channel's tone curve to each of the three colour channels, or pass the channel through untouched when it has none.

Enable aggressive floating-point arithmetic optimizations, in denormals handling. Set through user preference cpu_fp_mode.

Build the keyed full transform matrix for one scene luminance.

Multi-tap smudge source sample with directional jitter.

Parameters
rgb_insource pixel.
rgb_outdestination pixel. Only channels 0..2 are written – the 4th lane is left alone, which is what preserves alpha through an in-place conversion.
lutthe profile's lut_in or lut_out. A NULL entry, or one whose [0] is negative, means "channel is linear" and is copied straight through.
unbounded_coeffsthe matching unbounded_coeffs_in/_out.
lutsizeentry count.

uses D50 white point.

Uses D50

Uses D65

uses D50 white point and clips the output to [0..1].

Conversion algorithms between XYZ and JzAzBz and JzCzhz are described in the following paper:

Perceptually uniform color space for image signals including high dynamic range and wide gamut https://www.osapublishing.org/oe/fulltext.cfm?uri=oe-25-13-15131&id=368272

Parameters
motion_dxMotion X used to orient anisotropic taps.
motion_dyMotion Y used to orient anisotropic taps.

Inside the [dark ; bright] segment, the module linearly interpolates between the two user transforms. Outside that segment, the nearest transform fades linearly back to identity over one segment length so the correction tapers out instead of clipping.

Parameters
[in]luminanceCurrent pixel scene luminance in XYZ Y.
[in]dPrecomputed module state for the current pipe.
[out]matrixKeyed full transform matrix in transposed padded form.
mode

Definition at line 55 of file simd.h.

◆ dt_aligned_pixel_t

typedef DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]

Definition at line 53 of file simd.h.

Function Documentation

◆ __attribute__()

__attribute__ ( (always_inline) ) const
inlinestatic

Definition at line 93 of file simd.h.

References value.

◆ copy_pixel()

void copy_pixel ( float *const __restrict__ out,
const float *const __restrict__ in )
inlinestatic

Definition at line 217 of file simd.h.

References for_each_channel, in, k, and out.

Referenced by _heal_laplace_iteration(), _interpolation_resample_plain(), and process().

◆ copy_pixel_nontemporal()

void copy_pixel_nontemporal ( float *const __restrict__ out,
const float *const __restrict__ in )
inlinestatic

Definition at line 207 of file simd.h.

References in, and out.

Referenced by _interpolation_resample_plain(), expand_2D_Bspline(), and reduce_2D_Bspline().

◆ dt_store_simd()

◆ for()

for ( )

Definition at line 519 of file geometry.c.

Variable Documentation

◆ exponent

const dt_aligned_pixel_simd_t exponent
Initial value:
{
dt_aligned_pixel_simd_t out = base
const dt_colormatrix_t dt_aligned_pixel_t out

Definition at line 126 of file simd.h.

Referenced by _float_to_half(), and dt_focuspeaking().

◆ out

return row2* in [2] out = row1 * in[1] + out

Definition at line 122 of file simd.h.

◆ row0

const dt_aligned_pixel_simd_t row0

◆ row1

const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t row1

◆ row2

const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t const dt_aligned_pixel_simd_t row2
Initial value:
{
dt_aligned_pixel_simd_t out = row0 * in[0]
dt_iop_roi_t in
Definition geometry.h:117
static const dt_aligned_pixel_simd_t row0
Definition simd.h:189

Definition at line 190 of file simd.h.

Referenced by _downsample_guided_laplacian_fit(), gui_init(), guide_laplacians(), matrix_dot_float4_rows(), and matrix_product_float4().

◆ sign

◆ value

const dt_aligned_pixel_simd_t value
Initial value:
{
__builtin_memcpy(pixel, &value, sizeof(value))
dev roi_request value

Definition at line 143 of file simd.h.