Blender  V2.93
filter_prefilter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2017 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
35  int x,
36  int y,
37  ccl_global float *unfilteredA,
38  ccl_global float *unfilteredB,
39  ccl_global float *sampleVariance,
40  ccl_global float *sampleVarianceV,
41  ccl_global float *bufferVariance,
42  int4 rect,
43  int buffer_pass_stride,
44  int buffer_denoising_offset)
45 {
46  int xtile = (x < tile_info->x[1]) ? 0 : ((x < tile_info->x[2]) ? 1 : 2);
47  int ytile = (y < tile_info->y[1]) ? 0 : ((y < tile_info->y[2]) ? 1 : 2);
48  int tile = ytile * 3 + xtile;
49 
50  int offset = tile_info->offsets[tile];
51  int stride = tile_info->strides[tile];
52  const ccl_global float *ccl_restrict center_buffer = (ccl_global float *)ccl_get_tile_buffer(
53  tile);
54  center_buffer += (y * stride + x + offset) * buffer_pass_stride;
55  center_buffer += buffer_denoising_offset + 14;
56 
57  int buffer_w = align_up(rect.z - rect.x, 4);
58  int idx = (y - rect.y) * buffer_w + (x - rect.x);
59  unfilteredA[idx] = center_buffer[1] / max(center_buffer[0], 1e-7f);
60  unfilteredB[idx] = center_buffer[4] / max(center_buffer[3], 1e-7f);
61 
62  float varA = center_buffer[2];
63  float varB = center_buffer[5];
64  int odd_sample = (sample + 1) / 2;
65  int even_sample = sample / 2;
66 
67  /* Approximate variance as E[x^2] - 1/N * (E[x])^2, since online variance
68  * update does not work efficiently with atomics in the kernel. */
69  varA = max(0.0f, varA - unfilteredA[idx] * unfilteredA[idx] * odd_sample);
70  varB = max(0.0f, varB - unfilteredB[idx] * unfilteredB[idx] * even_sample);
71 
72  varA /= max(odd_sample - 1, 1);
73  varB /= max(even_sample - 1, 1);
74 
75  sampleVariance[idx] = 0.5f * (varA + varB) / sample;
76  sampleVarianceV[idx] = 0.5f * (varA - varB) * (varA - varB) / (sample * sample);
77  bufferVariance[idx] = 0.5f * (unfilteredA[idx] - unfilteredB[idx]) *
78  (unfilteredA[idx] - unfilteredB[idx]);
79 }
80 
81 /* Load a regular feature from the render buffers into the denoise buffer.
82  * Parameters:
83  * - sample: The sample amount in the buffer, used to normalize the buffer.
84  * - m_offset, v_offset: Render Buffer Pass offsets of mean and variance of the feature.
85  * - x, y: Current pixel
86  * - mean, variance: Target denoise buffers.
87  * - rect: The prefilter area (lower pixels inclusive, upper pixels exclusive).
88  */
91  int m_offset,
92  int v_offset,
93  int x,
94  int y,
95  ccl_global float *mean,
96  ccl_global float *variance,
97  float scale,
98  int4 rect,
99  int buffer_pass_stride,
100  int buffer_denoising_offset)
101 {
102  int xtile = (x < tile_info->x[1]) ? 0 : ((x < tile_info->x[2]) ? 1 : 2);
103  int ytile = (y < tile_info->y[1]) ? 0 : ((y < tile_info->y[2]) ? 1 : 2);
104  int tile = ytile * 3 + xtile;
105  ccl_global float *center_buffer = ((ccl_global float *)ccl_get_tile_buffer(tile)) +
106  (tile_info->offsets[tile] + y * tile_info->strides[tile] + x) *
107  buffer_pass_stride +
108  buffer_denoising_offset;
109 
110  int buffer_w = align_up(rect.z - rect.x, 4);
111  int idx = (y - rect.y) * buffer_w + (x - rect.x);
112 
113  float val = scale * center_buffer[m_offset];
114  mean[idx] = val;
115 
116  if (v_offset >= 0) {
117  if (sample > 1) {
118  /* Approximate variance as E[x^2] - 1/N * (E[x])^2, since online variance
119  * update does not work efficiently with atomics in the kernel. */
120  variance[idx] = max(
121  0.0f, (center_buffer[v_offset] - val * val * sample) / (sample * (sample - 1)));
122  }
123  else {
124  /* Can't compute variance with single sample, just set it very high. */
125  variance[idx] = 1e10f;
126  }
127  }
128 }
129 
131  int x,
132  int y,
133  int4 buffer_params,
134  ccl_global float *from,
135  ccl_global float *buffer,
136  int out_offset,
137  int4 rect)
138 {
139  ccl_global float *combined_buffer = buffer + (y * buffer_params.y + x + buffer_params.x) *
140  buffer_params.z;
141 
142  int buffer_w = align_up(rect.z - rect.x, 4);
143  int idx = (y - rect.y) * buffer_w + (x - rect.x);
144 
145  combined_buffer[out_offset] = from[idx];
146 }
147 
148 #define GET_COLOR(image) \
149  make_float3(image[idx], image[idx + pass_stride], image[idx + 2 * pass_stride])
150 #define SET_COLOR(image, color) \
151  image[idx] = color.x; \
152  image[idx + pass_stride] = color.y; \
153  image[idx + 2 * pass_stride] = color.z
154 
156  int y,
157  ccl_global float *in,
158  ccl_global float *variance_out,
159  ccl_global float *depth,
160  ccl_global float *image_out,
161  int4 rect,
162  int pass_stride)
163 {
164  int buffer_w = align_up(rect.z - rect.x, 4);
165 
166  ccl_global float *image_in = in;
167  ccl_global float *variance_in = in + 3 * pass_stride;
168 
169  int n = 0;
170  float values[25];
171  float pixel_variance, max_variance = 0.0f;
172  for (int y1 = max(y - 2, rect.y); y1 < min(y + 3, rect.w); y1++) {
173  for (int x1 = max(x - 2, rect.x); x1 < min(x + 3, rect.z); x1++) {
174  int idx = (y1 - rect.y) * buffer_w + (x1 - rect.x);
175  float3 color = GET_COLOR(image_in);
176  color = max(color, make_float3(0.0f, 0.0f, 0.0f));
177  float L = average(color);
178 
179  /* Find the position of L. */
180  int i;
181  for (i = 0; i < n; i++) {
182  if (values[i] > L)
183  break;
184  }
185  /* Make space for L by shifting all following values to the right. */
186  for (int j = n; j > i; j--) {
187  values[j] = values[j - 1];
188  }
189  /* Insert L. */
190  values[i] = L;
191  n++;
192 
193  float3 pixel_var = GET_COLOR(variance_in);
194  float var = average(pixel_var);
195  if ((x1 == x) && (y1 == y)) {
196  pixel_variance = (pixel_var.x < 0.0f || pixel_var.y < 0.0f || pixel_var.z < 0.0f) ? -1.0f :
197  var;
198  }
199  else {
200  max_variance = max(max_variance, var);
201  }
202  }
203  }
204 
205  max_variance += 1e-4f;
206 
207  int idx = (y - rect.y) * buffer_w + (x - rect.x);
208 
209  float3 color = GET_COLOR(image_in);
210  float3 variance = GET_COLOR(variance_in);
211  color = max(color, make_float3(0.0f, 0.0f, 0.0f));
212  variance = max(variance, make_float3(0.0f, 0.0f, 0.0f));
213 
214  float L = average(color);
215 
216  float ref = 2.0f * values[(int)(n * 0.75f)];
217 
218  /* Slightly offset values to avoid false positives in (almost) black areas. */
219  max_variance += 1e-5f;
220  ref -= 1e-5f;
221 
222  if (L > ref) {
223  /* The pixel appears to be an outlier.
224  * However, it may just be a legitimate highlight. Therefore, it is checked how likely it is
225  * that the pixel should actually be at the reference value: If the reference is within the
226  * 3-sigma interval, the pixel is assumed to be a statistical outlier. Otherwise, it is very
227  * unlikely that the pixel should be darker, which indicates a legitimate highlight.
228  */
229 
230  if (pixel_variance < 0.0f || pixel_variance > 9.0f * max_variance) {
231  depth[idx] = -depth[idx];
232  color *= ref / L;
233  variance = make_float3(max_variance, max_variance, max_variance);
234  }
235  else {
236  float stddev = sqrtf(pixel_variance);
237  if (L - 3 * stddev < ref) {
238  /* The pixel is an outlier, so negate the depth value to mark it as one.
239  * Also, scale its brightness down to the outlier threshold to avoid trouble with the NLM
240  * weights. */
241  depth[idx] = -depth[idx];
242  float fac = ref / L;
243  color *= fac;
244  variance *= sqr(fac);
245  }
246  }
247  }
248 
249  /* Apply log(1+x) transform to compress highlights and avoid halos in the denoised results.
250  * Variance is transformed accordingly - the derivative of the transform is 1/(1+x), so we
251  * scale by the square of that (since we have variance instead of standard deviation). */
252  color = color_highlight_compress(color, &variance);
253 
254  SET_COLOR(image_out, color);
255  SET_COLOR(variance_out, variance);
256 }
257 
258 #undef GET_COLOR
259 #undef SET_COLOR
260 
261 /* Combine A/B buffers.
262  * Calculates the combined mean and the buffer variance. */
264  int y,
265  ccl_global float *mean,
266  ccl_global float *variance,
267  ccl_global float *a,
268  ccl_global float *b,
269  int4 rect,
270  int r)
271 {
272  int buffer_w = align_up(rect.z - rect.x, 4);
273  int idx = (y - rect.y) * buffer_w + (x - rect.x);
274 
275  if (mean)
276  mean[idx] = 0.5f * (a[idx] + b[idx]);
277  if (variance) {
278  if (r == 0)
279  variance[idx] = 0.25f * (a[idx] - b[idx]) * (a[idx] - b[idx]);
280  else {
281  variance[idx] = 0.0f;
282  float values[25];
283  int numValues = 0;
284  for (int py = max(y - r, rect.y); py < min(y + r + 1, rect.w); py++) {
285  for (int px = max(x - r, rect.x); px < min(x + r + 1, rect.z); px++) {
286  int pidx = (py - rect.y) * buffer_w + (px - rect.x);
287  values[numValues++] = 0.25f * (a[pidx] - b[pidx]) * (a[pidx] - b[pidx]);
288  }
289  }
290  /* Insertion-sort the variances (fast enough for 25 elements). */
291  for (int i = 1; i < numValues; i++) {
292  float v = values[i];
293  int j;
294  for (j = i - 1; j >= 0 && values[j] > v; j--)
295  values[j + 1] = values[j];
296  values[j + 1] = v;
297  }
298  variance[idx] = values[(7 * numValues) / 8];
299  }
300  }
301 }
302 
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
ATTR_WARN_UNUSED_RESULT const BMVert * v
int x
Definition: btConvexHull.h:149
int w
Definition: btConvexHull.h:149
int y
Definition: btConvexHull.h:149
int z
Definition: btConvexHull.h:149
StackEntry * from
#define ccl_get_tile_buffer(id)
#define CCL_FILTER_TILE_INFO
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)
#define GET_COLOR(image)
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)
#define SET_COLOR(image, color)
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_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)
#define ccl_restrict
#define ccl_device
#define ccl_global
#define CCL_NAMESPACE_END
#define sqrtf(x)
#define make_float3(x, y, z)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
#define L
static unsigned a[3]
Definition: RandGen.cpp:92
static void sample(SocketReader *reader, int x, int y, float color[4])
#define min(a, b)
Definition: sort.c:51
float z
Definition: sky_float3.h:35
float y
Definition: sky_float3.h:35
float x
Definition: sky_float3.h:35
float max
ccl_device float3 color_highlight_compress(float3 color, float3 *variance)
Definition: util_color.h:278
ccl_device_inline float sqr(float a)
Definition: util_math.h:651
ccl_device_inline float average(const float2 &a)
ccl_device_inline size_t align_up(size_t offset, size_t alignment)
Definition: util_types.h:65