#include <stdint.h>
-#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
-
-#define ROUND_POWER_OF_TWO(value, n) (((value) + (1 << ((n)-1))) >> (n))
-
-#define FILTER_BITS 7
+#include "variance_ref.h"
static const uint8_t bilinear_filters[8][2] = {
{ 128, 0 }, { 112, 16 }, { 96, 32 }, { 80, 48 },
return sum;
}
-static void variance(const uint8_t *src_ptr, int src_stride,
+void variance_c(const uint8_t *src_ptr, int src_stride,
const uint8_t *ref_ptr, int ref_stride, int w, int h,
uint32_t *sse, int *sum) {
int i, j;
// taps should sum to FILTER_WEIGHT. pixel_step defines whether the filter is
// applied horizontally (pixel_step = 1) or vertically (pixel_step = stride).
// It defines the offset required to move from one input to the next.
-static void var_filter_block2d_bil_first_pass(
+void var_filter_block2d_bil_first_pass_c(
const uint8_t *src_ptr, uint16_t *ref_ptr, unsigned int src_pixels_per_line,
int pixel_step, unsigned int output_height, unsigned int output_width,
const uint8_t *filter) {
// filter is applied horizontally (pixel_step = 1) or vertically
// (pixel_step = stride). It defines the offset required to move from one input
// to the next. Output is 8-bit.
-static void var_filter_block2d_bil_second_pass(
+void var_filter_block2d_bil_second_pass_c(
const uint16_t *src_ptr, uint8_t *ref_ptr, unsigned int src_pixels_per_line,
unsigned int pixel_step, unsigned int output_height,
unsigned int output_width, const uint8_t *filter) {
const uint8_t *ref_ptr, int ref_stride, \
uint32_t *sse) { \
int sum; \
- variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, &sum); \
+ variance_c(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, &sum); \
return *sse - (uint32_t)(((int64_t)sum * sum) / (W * H)); \
}
uint16_t fdata3[(H + 1) * W]; \
uint8_t temp2[H * W]; \
\
- var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_stride, 1, H + 1, \
+ var_filter_block2d_bil_first_pass_c(src_ptr, fdata3, src_stride, 1, H + 1, \
W, bilinear_filters[x_offset]); \
- var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
+ var_filter_block2d_bil_second_pass_c(fdata3, temp2, W, W, H, W, \
bilinear_filters[y_offset]); \
\
return vpx_variance##W##x##H##_c(temp2, W, ref_ptr, ref_stride, sse); \
uint8_t temp2[H * W]; \
DECLARE_ALIGNED(16, uint8_t, temp3[H * W]); \
\
- var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_stride, 1, H + 1, \
+ var_filter_block2d_bil_first_pass_c(src_ptr, fdata3, src_stride, 1, H + 1, \
W, bilinear_filters[x_offset]); \
- var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
+ var_filter_block2d_bil_second_pass_c(fdata3, temp2, W, W, H, W, \
bilinear_filters[y_offset]); \
\
vpx_comp_avg_pred_c(temp3, second_pred, W, H, temp2, W); \
void vpx_get##W##x##H##var_c(const uint8_t *src_ptr, int src_stride, \
const uint8_t *ref_ptr, int ref_stride, \
uint32_t *sse, int *sum) { \
- variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, sum); \
+ variance_c(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, sum); \
}
/* Identical to the variance call except it does not calculate the
const uint8_t *ref_ptr, int ref_stride, \
uint32_t *sse) { \
int sum; \
- variance(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, &sum); \
+ variance_c(src_ptr, src_stride, ref_ptr, ref_stride, W, H, sse, &sum); \
return *sse; \
}
--- /dev/null
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <stdint.h>
+
+#define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
+
+#define ROUND_POWER_OF_TWO(value, n) (((value) + (1 << ((n)-1))) >> (n))
+
+#define FILTER_BITS 7
+
+uint32_t vpx_get4x4sse_cs_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride);
+
+uint32_t vpx_get_mb_ss_c(const int16_t *src_ptr);
+
+void variance_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride, int w, int h,
+ uint32_t *sse, int *sum);
+
+void var_filter_block2d_bil_first_pass_c(
+ const uint8_t *src_ptr, uint16_t *ref_ptr, unsigned int src_pixels_per_line,
+ int pixel_step, unsigned int output_height, unsigned int output_width,
+ const uint8_t *filter);
+
+void var_filter_block2d_bil_second_pass_c(
+ const uint16_t *src_ptr, uint8_t *ref_ptr, unsigned int src_pixels_per_line,
+ unsigned int pixel_step, unsigned int output_height,
+ unsigned int output_width, const uint8_t *filter);
+
+void vpx_comp_avg_pred_c(uint8_t *comp_pred, const uint8_t *pred, int width,
+ int height, const uint8_t *ref, int ref_stride);
+