38 int num_features = use_time ? 11 : 10;
43 int num_pixels = (
high.y -
low.y) * (
high.x -
low.x) * tile_info->num_frames;
47 math_vector_zero_sse(feature_means, num_features);
51 x4, y4, t4, active_pixels, pixel_buffer, features, use_time,
NULL, pass_stride);
52 math_vector_add_sse(feature_means, num_features, features);
56 float4 pixel_scale =
make_float4(1.0f / num_pixels);
57 for (
int i = 0; i < num_features; i++) {
58 feature_means[i] =
reduce_add(feature_means[i]) * pixel_scale;
64 math_vector_zero_sse(feature_scale, num_features);
68 x4, y4, t4, active_pixels, pixel_buffer, features, use_time, feature_means, pass_stride);
69 math_vector_max_sse(feature_scale, features, num_features);
80 math_matrix_zero_sse(feature_matrix_sse, num_features);
84 x4, y4, t4, active_pixels, pixel_buffer, features, use_time, feature_means, pass_stride);
85 math_vector_mul_sse(features, num_features, feature_scale);
86 math_matrix_add_gramian_sse(feature_matrix_sse, num_features, features,
make_float4(1.0f));
91 math_matrix_hsum(feature_matrix, num_features, feature_matrix_sse);
97 int max_rank =
min(num_features, num_pixels / 3);
98 if (pca_threshold < 0.0f) {
99 float threshold_energy = 0.0f;
100 for (
int i = 0; i < num_features; i++) {
101 threshold_energy += feature_matrix[i * num_features + i];
103 threshold_energy *= 1.0f - (-pca_threshold);
105 float reduced_energy = 0.0f;
106 for (
int i = 0; i < max_rank; i++, (*rank)++) {
107 if (i >= 2 && reduced_energy >= threshold_energy)
109 float s = feature_matrix[i * num_features + i];
114 for (
int i = 0; i < max_rank; i++, (*rank)++) {
115 float s = feature_matrix[i * num_features + i];
116 if (i >= 2 &&
sqrtf(s) < pca_threshold)
124 for (
int i = 0; i < num_features; i++) {
_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
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
#define CCL_FILTER_TILE_INFO
ccl_device_inline void filter_get_features_sse(float4 x, float4 y, float4 t, int4 active_pixels, const float *ccl_restrict buffer, float4 *features, bool use_time, const float4 *ccl_restrict mean, int pass_stride)
ccl_device_inline void filter_calculate_scale_sse(float4 *scale, bool use_time)
#define FOR_PIXEL_WINDOW_SSE
#define END_FOR_PIXEL_WINDOW_SSE
ccl_device_inline void filter_get_feature_scales_sse(float4 x, float4 y, float4 t, int4 active_pixels, const float *ccl_restrict buffer, float4 *scales, bool use_time, const float4 *ccl_restrict mean, int pass_stride)
#define CCL_NAMESPACE_END
#define make_float4(x, y, z, w)
__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
__forceinline ssef low(const avxf &a)
__forceinline ssef high(const avxf &a)
__forceinline int reduce_add(const avxi &v)
ccl_device_inline void math_matrix_transpose(ccl_global float *A, int n, int stride)
ccl_device void math_matrix_jacobi_eigendecomposition(float *A, ccl_global float *V, int n, int v_stride)
ccl_device_inline void math_vector_scale(float *a, float b, int n)
ccl_device_inline size_t align_up(size_t offset, size_t alignment)