Skip to content

Commit

Permalink
Fix inter search for small SMP and AMP blocks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aryla committed Jan 29, 2017
1 parent fb10b56 commit 46c9a48
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/search_inter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 46c9a48

Please sign in to comment.