Commit a4533957 authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Cleaning up vp9_variance.c"

parents 6b4efa49 4498194b
...@@ -113,12 +113,9 @@ unsigned int vp9_get_mb_ss_c(const int16_t *src_ptr) { ...@@ -113,12 +113,9 @@ unsigned int vp9_get_mb_ss_c(const int16_t *src_ptr) {
unsigned int vp9_variance##W##x##H##_c(const uint8_t *a, int a_stride, \ unsigned int vp9_variance##W##x##H##_c(const uint8_t *a, int a_stride, \
const uint8_t *b, int b_stride, \ const uint8_t *b, int b_stride, \
unsigned int *sse) { \ unsigned int *sse) { \
unsigned int var; \ int sum; \
int avg; \ variance(a, a_stride, b, b_stride, W, H, sse, &sum); \
\ return *sse - (((int64_t)sum * sum) / (W * H)); \
variance(a, a_stride, b, b_stride, W, H, &var, &avg); \
*sse = var; \
return var - (((int64_t)avg * avg) / (W * H)); \
} }
#define SUBPIX_VAR(W, H) \ #define SUBPIX_VAR(W, H) \
...@@ -172,56 +169,36 @@ void vp9_get_sse_sum_8x8_c(const uint8_t *src_ptr, int source_stride, ...@@ -172,56 +169,36 @@ void vp9_get_sse_sum_8x8_c(const uint8_t *src_ptr, int source_stride,
variance(src_ptr, source_stride, ref_ptr, ref_stride, 8, 8, sse, sum); variance(src_ptr, source_stride, ref_ptr, ref_stride, 8, 8, sse, sum);
} }
unsigned int vp9_mse16x16_c(const uint8_t *src_ptr, unsigned int vp9_mse16x16_c(const uint8_t *src, int src_stride,
int source_stride, const uint8_t *ref, int ref_stride,
const uint8_t *ref_ptr,
int recon_stride,
unsigned int *sse) { unsigned int *sse) {
unsigned int var; int sum;
int avg; variance(src, src_stride, ref, ref_stride, 16, 16, sse, &sum);
return *sse;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg);
*sse = var;
return var;
} }
unsigned int vp9_mse16x8_c(const uint8_t *src_ptr, unsigned int vp9_mse16x8_c(const uint8_t *src, int src_stride,
int source_stride, const uint8_t *ref, int ref_stride,
const uint8_t *ref_ptr,
int recon_stride,
unsigned int *sse) { unsigned int *sse) {
unsigned int var; int sum;
int avg; variance(src, src_stride, ref, ref_stride, 16, 8, sse, &sum);
return *sse;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 8, &var, &avg);
*sse = var;
return var;
} }
unsigned int vp9_mse8x16_c(const uint8_t *src_ptr, unsigned int vp9_mse8x16_c(const uint8_t *src, int src_stride,
int source_stride, const uint8_t *ref, int ref_stride,
const uint8_t *ref_ptr,
int recon_stride,
unsigned int *sse) { unsigned int *sse) {
unsigned int var; int sum;
int avg; variance(src, src_stride, ref, ref_stride, 8, 16, sse, &sum);
return *sse;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 16, &var, &avg);
*sse = var;
return var;
} }
unsigned int vp9_mse8x8_c(const uint8_t *src_ptr, unsigned int vp9_mse8x8_c(const uint8_t *src, int src_stride,
int source_stride, const uint8_t *ref, int ref_stride,
const uint8_t *ref_ptr,
int recon_stride,
unsigned int *sse) { unsigned int *sse) {
unsigned int var; int sum;
int avg; variance(src, src_stride, ref, ref_stride, 8, 8, sse, &sum);
return *sse;
variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 8, &var, &avg);
*sse = var;
return var;
} }
VAR(4, 4) VAR(4, 4)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment