Blender  V2.93
Macros | Functions
filter_prefilter.h File Reference

Go to the source code of this file.

Macros

#define GET_COLOR(image)    make_float3(image[idx], image[idx + pass_stride], image[idx + 2 * pass_stride])
 
#define SET_COLOR(image, color)
 

Functions

CCL_NAMESPACE_BEGIN ccl_device void kernel_filter_divide_shadow (int sample, CCL_FILTER_TILE_INFO, int x, int y, ccl_global float *unfilteredA, ccl_global float *unfilteredB, ccl_global float *sampleVariance, ccl_global float *sampleVarianceV, ccl_global float *bufferVariance, int4 rect, int buffer_pass_stride, int buffer_denoising_offset)
 
ccl_device void kernel_filter_get_feature (int sample, CCL_FILTER_TILE_INFO, int m_offset, int v_offset, int x, int y, ccl_global float *mean, ccl_global float *variance, float scale, int4 rect, int buffer_pass_stride, int buffer_denoising_offset)
 
ccl_device void kernel_filter_write_feature (int sample, int x, int y, int4 buffer_params, ccl_global float *from, ccl_global float *buffer, int out_offset, int4 rect)
 
ccl_device void kernel_filter_detect_outliers (int x, int y, ccl_global float *in, ccl_global float *variance_out, ccl_global float *depth, ccl_global float *image_out, int4 rect, int pass_stride)
 
ccl_device void kernel_filter_combine_halves (int x, int y, ccl_global float *mean, ccl_global float *variance, ccl_global float *a, ccl_global float *b, int4 rect, int r)
 

Macro Definition Documentation

◆ GET_COLOR

#define GET_COLOR (   image)     make_float3(image[idx], image[idx + pass_stride], image[idx + 2 * pass_stride])

Definition at line 148 of file filter_prefilter.h.

◆ SET_COLOR

#define SET_COLOR (   image,
  color 
)
Value:
image[idx] = color.x; \
image[idx + pass_stride] = color.y; \
image[idx + 2 * pass_stride] = color.z

Definition at line 150 of file filter_prefilter.h.

Function Documentation

◆ kernel_filter_combine_halves()

ccl_device void kernel_filter_combine_halves ( int  x,
int  y,
ccl_global float mean,
ccl_global float variance,
ccl_global float a,
ccl_global float b,
int4  rect,
int  r 
)

Definition at line 263 of file filter_prefilter.h.

References Freestyle::a, align_up(), max, min, r, v, int4::w, int4::x, x, int4::y, y, and int4::z.

Referenced by filter_combine_halves().

◆ kernel_filter_detect_outliers()

ccl_device void kernel_filter_detect_outliers ( int  x,
int  y,
ccl_global float in,
ccl_global float variance_out,
ccl_global float depth,
ccl_global float image_out,
int4  rect,
int  pass_stride 
)

◆ kernel_filter_divide_shadow()

CCL_NAMESPACE_BEGIN ccl_device void kernel_filter_divide_shadow ( int  sample,
CCL_FILTER_TILE_INFO  ,
int  x,
int  y,
ccl_global float unfilteredA,
ccl_global float unfilteredB,
ccl_global float sampleVariance,
ccl_global float sampleVarianceV,
ccl_global float bufferVariance,
int4  rect,
int  buffer_pass_stride,
int  buffer_denoising_offset 
)

First step of the shadow prefiltering, performs the shadow division and stores all data in a nice and easy rectangular array that can be passed to the NLM filter.

Calculates:

Parameters
unfilteredContains the two half images of the shadow feature pass
sampleVarianceThe sample-based variance calculated in the kernel. Note: This calculation is biased in general, and especially here since the variance of the ratio can only be approximated.
sampleVarianceVVariance of the sample variance estimation, quite noisy (since it's essentially the buffer variance of the two variance halves)
bufferVarianceThe buffer-based variance of the shadow feature. Unbiased, but quite noisy.

Definition at line 33 of file filter_prefilter.h.

References align_up(), ccl_get_tile_buffer, ccl_global, ccl_restrict, max, blender::compositor::sample(), stride, int4::x, x, int4::y, y, and int4::z.

Referenced by filter_divide_shadow().

◆ kernel_filter_get_feature()

ccl_device void kernel_filter_get_feature ( int  sample,
CCL_FILTER_TILE_INFO  ,
int  m_offset,
int  v_offset,
int  x,
int  y,
ccl_global float mean,
ccl_global float variance,
float  scale,
int4  rect,
int  buffer_pass_stride,
int  buffer_denoising_offset 
)

◆ kernel_filter_write_feature()

ccl_device void kernel_filter_write_feature ( int  sample,
int  x,
int  y,
int4  buffer_params,
ccl_global float from,
ccl_global float buffer,
int  out_offset,
int4  rect 
)

Definition at line 130 of file filter_prefilter.h.

References align_up(), buffer, ccl_global, from, int4::x, x, int4::y, y, and int4::z.

Referenced by filter_write_feature().