Commit 8c64331a authored by James Zern's avatar James Zern
Browse files

variance_avx2: sync variance functions with c-code

add missing int64 -> uint32 cast; quiets -Wshorten-64-to-32 warnings

Change-Id: I4850b36e18dc8b399108342be4bfe0b684aefb78
(cherry picked from commit 6acd061aad8cf62000cc9117390d0c94581a8591)
parent 2176b7ac
......@@ -62,7 +62,7 @@ unsigned int aom_variance32x16_avx2(const uint8_t *src, int src_stride,
int sum;
variance_avx2(src, src_stride, ref, ref_stride, 32, 16, sse, &sum,
aom_get32x32var_avx2, 32);
return *sse - (((int64_t)sum * sum) >> 9);
return *sse - (uint32_t)(((int64_t)sum * sum) >> 9);
}
unsigned int aom_variance32x32_avx2(const uint8_t *src, int src_stride,
......@@ -71,7 +71,7 @@ unsigned int aom_variance32x32_avx2(const uint8_t *src, int src_stride,
int sum;
variance_avx2(src, src_stride, ref, ref_stride, 32, 32, sse, &sum,
aom_get32x32var_avx2, 32);
return *sse - (((int64_t)sum * sum) >> 10);
return *sse - (uint32_t)(((int64_t)sum * sum) >> 10);
}
unsigned int aom_variance64x64_avx2(const uint8_t *src, int src_stride,
......@@ -80,7 +80,7 @@ unsigned int aom_variance64x64_avx2(const uint8_t *src, int src_stride,
int sum;
variance_avx2(src, src_stride, ref, ref_stride, 64, 64, sse, &sum,
aom_get32x32var_avx2, 32);
return *sse - (((int64_t)sum * sum) >> 12);
return *sse - (uint32_t)(((int64_t)sum * sum) >> 12);
}
unsigned int aom_variance64x32_avx2(const uint8_t *src, int src_stride,
......@@ -89,7 +89,7 @@ unsigned int aom_variance64x32_avx2(const uint8_t *src, int src_stride,
int sum;
variance_avx2(src, src_stride, ref, ref_stride, 64, 32, sse, &sum,
aom_get32x32var_avx2, 32);
return *sse - (((int64_t)sum * sum) >> 11);
return *sse - (uint32_t)(((int64_t)sum * sum) >> 11);
}
unsigned int aom_sub_pixel_variance32xh_avx2(const uint8_t *src, int src_stride,
......@@ -116,7 +116,7 @@ unsigned int aom_sub_pixel_variance64x64_avx2(const uint8_t *src,
dst + 32, dst_stride, 64, &sse2);
const int se = se1 + se2;
*sse = sse1 + sse2;
return *sse - (((int64_t)se * se) >> 12);
return *sse - (uint32_t)(((int64_t)se * se) >> 12);
}
unsigned int aom_sub_pixel_variance32x32_avx2(const uint8_t *src,
......@@ -126,7 +126,7 @@ unsigned int aom_sub_pixel_variance32x32_avx2(const uint8_t *src,
unsigned int *sse) {
const int se = aom_sub_pixel_variance32xh_avx2(
src, src_stride, x_offset, y_offset, dst, dst_stride, 32, sse);
return *sse - (((int64_t)se * se) >> 10);
return *sse - (uint32_t)(((int64_t)se * se) >> 10);
}
unsigned int aom_sub_pixel_avg_variance64x64_avx2(
......@@ -143,7 +143,7 @@ unsigned int aom_sub_pixel_avg_variance64x64_avx2(
*sse = sse1 + sse2;
return *sse - (((int64_t)se * se) >> 12);
return *sse - (uint32_t)(((int64_t)se * se) >> 12);
}
unsigned int aom_sub_pixel_avg_variance32x32_avx2(
......@@ -152,5 +152,5 @@ unsigned int aom_sub_pixel_avg_variance32x32_avx2(
// Process 32 elements in parallel.
const int se = aom_sub_pixel_avg_variance32xh_avx2(
src, src_stride, x_offset, y_offset, dst, dst_stride, sec, 32, 32, sse);
return *sse - (((int64_t)se * se) >> 10);
return *sse - (uint32_t)(((int64_t)se * se) >> 10);
}
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