Help msvc 2017 compiler to generate correct code This loop is wrongly vectorized by the MSVC2017 compiler, this change is a work-around for the compiler bug. Change-Id: Ie4c8403965c3e4cd6d70eb3dbc92148f5272f0ab
diff --git a/aom_dsp/sad.c b/aom_dsp/sad.c index 6adb69c..e500fc4 100644 --- a/aom_dsp/sad.c +++ b/aom_dsp/sad.c
@@ -341,27 +341,24 @@ #endif // CONFIG_HIGHBITDEPTH #if CONFIG_AV1 && CONFIG_EXT_INTER - static INLINE +static INLINE unsigned int masked_sad(const uint8_t *src, int src_stride, const uint8_t *a, int a_stride, const uint8_t *b, int b_stride, const uint8_t *m, int m_stride, int width, int height) { int y, x; unsigned int sad = 0; - for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { - const uint8_t pred = AOM_BLEND_A64(m[x], a[x], b[x]); + const int16_t pred = AOM_BLEND_A64(m[x], a[x], b[x]); sad += abs(pred - src[x]); } - src += src_stride; a += a_stride; b += b_stride; m += m_stride; } sad = (sad + 31) >> 6; - return sad; }