diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index 5b90d36f08cc042b6caee3342188cc4fcfa29717..e4569ef71e050242775a3e2f5096e951936c5933 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c @@ -802,8 +802,7 @@ static double od_compute_dist_common(int activity_masking, uint16_t *x, static double od_compute_dist(uint16_t *x, uint16_t *y, int bsize_w, int bsize_h, int qindex) { int i; - double sum; - sum = 0; + double sum = 0; assert(bsize_w >= 8 && bsize_h >= 8); @@ -841,8 +840,7 @@ static double od_compute_dist(uint16_t *x, uint16_t *y, int bsize_w, static double od_compute_dist_diff(uint16_t *x, int16_t *e, int bsize_w, int bsize_h, int qindex) { int i; - double sum; - sum = 0; + double sum = 0; assert(bsize_w >= 8 && bsize_h >= 8); @@ -888,11 +886,13 @@ int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCK *x, DECLARE_ALIGNED(16, uint16_t, orig[MAX_TX_SQUARE]); DECLARE_ALIGNED(16, uint16_t, rec[MAX_TX_SQUARE]); + assert(bsw >= 8); + assert(bsh >= 8); + assert((bsw & 0x07) == 0); + assert((bsh & 0x07) == 0); + if (x->tune_metric == AOM_TUNE_CDEF_DIST || x->tune_metric == AOM_TUNE_DAALA_DIST) { - assert((bsw & 0x07) == 0); - assert((bsh & 0x07) == 0); - #if CONFIG_HIGHBITDEPTH if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { for (j = 0; j < bsh; j++) @@ -987,11 +987,13 @@ static int64_t av1_dist_8x8_diff(const MACROBLOCK *x, const uint8_t *src, DECLARE_ALIGNED(16, uint16_t, orig[MAX_TX_SQUARE]); DECLARE_ALIGNED(16, int16_t, diff16[MAX_TX_SQUARE]); + assert(bsw >= 8); + assert(bsh >= 8); + assert((bsw & 0x07) == 0); + assert((bsh & 0x07) == 0); + if (x->tune_metric == AOM_TUNE_CDEF_DIST || x->tune_metric == AOM_TUNE_DAALA_DIST) { - assert((bsw & 0x07) == 0); - assert((bsh & 0x07) == 0); - #if CONFIG_HIGHBITDEPTH if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { for (j = 0; j < bsh; j++)