From 9fa24f03b5c73381479594501be66aaba7c50d32 Mon Sep 17 00:00:00 2001 From: Johann Date: Mon, 17 Apr 2017 08:38:02 -0700 Subject: [PATCH] re-enable vpx_comp_avg_pred_sse2 Buffers on 32 bit x86 builds only guaranteed 8 byte alignment. Fixed with "AvgPred test: use aligned buffers" and "sad avg: align intermediate buffer" Also re-enable asserts on the C version. BUG=webm:1390 Change-Id: I93081f1b0002a352bb0a3371ac35452417fa8514 --- test/comp_avg_pred_test.cc | 3 +-- vpx_dsp/variance.c | 3 +++ vpx_dsp/vpx_dsp_rtcd_defs.pl | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/comp_avg_pred_test.cc b/test/comp_avg_pred_test.cc index 1b42315cf..c3ad28e2b 100644 --- a/test/comp_avg_pred_test.cc +++ b/test/comp_avg_pred_test.cc @@ -152,8 +152,7 @@ TEST_P(AvgPredTest, DISABLED_Speed) { INSTANTIATE_TEST_CASE_P(C, AvgPredTest, ::testing::Values(&vpx_comp_avg_pred_c)); -// TODO(johannkoenig): https://bugs.chromium.org/p/webm/issues/detail?id=1390 -#if 0 // HAVE_SSE2 +#if HAVE_SSE2 INSTANTIATE_TEST_CASE_P(SSE2, AvgPredTest, ::testing::Values(&vpx_comp_avg_pred_sse2)); #endif // HAVE_SSE2 diff --git a/vpx_dsp/variance.c b/vpx_dsp/variance.c index 8ae642d6d..b1744047a 100644 --- a/vpx_dsp/variance.c +++ b/vpx_dsp/variance.c @@ -226,6 +226,9 @@ MSE(8, 8) 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) { int i, j; + /* comp_pred and pred must be 16 byte aligned. */ + assert(((intptr_t)comp_pred & 0xf) == 0); + assert(((intptr_t)pred & 0xf) == 0); for (i = 0; i < height; ++i) { for (j = 0; j < width; ++j) { diff --git a/vpx_dsp/vpx_dsp_rtcd_defs.pl b/vpx_dsp/vpx_dsp_rtcd_defs.pl index e2418129c..e1181223d 100644 --- a/vpx_dsp/vpx_dsp_rtcd_defs.pl +++ b/vpx_dsp/vpx_dsp_rtcd_defs.pl @@ -1303,7 +1303,7 @@ add_proto qw/unsigned int vpx_get4x4sse_cs/, "const unsigned char *src_ptr, int specialize qw/vpx_get4x4sse_cs neon msa/; add_proto qw/void vpx_comp_avg_pred/, "uint8_t *comp_pred, const uint8_t *pred, int width, int height, const uint8_t *ref, int ref_stride"; - specialize qw/vpx_comp_avg_pred/; + specialize qw/vpx_comp_avg_pred sse2/; # # Subpixel Variance -- 2.40.0