From 46c9a483c377c555a5b1890a75f2a3e858ca36c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Yl=C3=A4-Outinen?= Date: Sat, 28 Jan 2017 20:59:00 +0900 Subject: [PATCH] Fix inter search for small SMP and AMP blocks The function search_pu_inter_ref incorrectly rounded the coordinates of the block to down to a multiple 8 pixels. Small SMP and AMP blocks may start at coordinates that are not multiples of 8. Fixed by removing the rounding. Fixes a failing assert when --mv-constraint is used with --smp or --amp. --- src/search_inter.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/search_inter.c b/src/search_inter.c index 0ddf8b6c..534068dc 100644 --- a/src/search_inter.c +++ b/src/search_inter.c @@ -1229,20 +1229,16 @@ static void search_pu_inter_ref(encoder_state_t * const state, double *inter_cost, uint32_t *inter_bitcost) { - const int x_cu = x >> 3; - const int y_cu = y >> 3; const videoframe_t * const frame = state->tile->frame; kvz_picture *ref_image = state->frame->ref->images[ref_idx]; + const vector2d_t orig = { x, y }; uint32_t temp_bitcost = 0; uint32_t temp_cost = 0; - vector2d_t orig; int32_t merged = 0; uint8_t cu_mv_cand = 0; int8_t merge_idx = 0; int8_t ref_list = state->frame->refmap[ref_idx].list-1; int8_t temp_ref_idx = cur_cu->inter.mv_ref[ref_list]; - orig.x = x_cu * CU_MIN_SIZE_PIXELS; - orig.y = y_cu * CU_MIN_SIZE_PIXELS; // Get MV candidates cur_cu->inter.mv_ref[ref_list] = ref_idx; kvz_inter_get_mv_cand(state, x, y, width, height, mv_cand, cur_cu, lcu, ref_list);