mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
[inter] Remove MV rounding from kvz_inter_get_merge_cand() and add it to where merge cand are used
* Should be adapted to AMVR later * merge candidates match VTM at full precision
This commit is contained in:
parent
bf06538f33
commit
21d7d2e4ed
10
src/inter.c
10
src/inter.c
|
@ -1603,7 +1603,7 @@ uint8_t kvz_inter_get_merge_cand(const encoder_state_t * const state,
|
|||
}
|
||||
}
|
||||
|
||||
if (candidates == max_num_cands) goto return_with_precision_clamp;
|
||||
if (candidates == max_num_cands) return candidates;
|
||||
|
||||
if (candidates != max_num_cands - 1) {
|
||||
const uint32_t ctu_row = (y >> LOG2_LCU_WIDTH);
|
||||
|
@ -1689,7 +1689,7 @@ uint8_t kvz_inter_get_merge_cand(const encoder_state_t * const state,
|
|||
}
|
||||
}
|
||||
|
||||
if (candidates == max_num_cands) goto return_with_precision_clamp;
|
||||
if (candidates == max_num_cands) return candidates;
|
||||
|
||||
|
||||
int num_ref = state->frame->ref->used_size;
|
||||
|
@ -1724,11 +1724,5 @@ uint8_t kvz_inter_get_merge_cand(const encoder_state_t * const state,
|
|||
candidates++;
|
||||
}
|
||||
|
||||
return_with_precision_clamp:
|
||||
for (int i = 0; i < candidates; i++) {
|
||||
if(mv_cand[i].dir & 1) kvz_round_precision(INTERNAL_MV_PREC, 2, &mv_cand[i].mv[0][0], &mv_cand[i].mv[0][1]);
|
||||
if (mv_cand[i].dir & 2) kvz_round_precision(INTERNAL_MV_PREC, 2, &mv_cand[i].mv[1][0], &mv_cand[i].mv[1][1]);
|
||||
}
|
||||
|
||||
return candidates;
|
||||
}
|
||||
|
|
|
@ -1660,6 +1660,12 @@ static void search_pu_inter(encoder_state_t * const state,
|
|||
lcu
|
||||
);
|
||||
|
||||
for (int i = 0; i < info.num_merge_cand; i++) {
|
||||
// ToDo: Adapt to AMVR
|
||||
if (info.merge_cand->dir & 1) kvz_round_precision(INTERNAL_MV_PREC, 2, &info.merge_cand[i].mv[0][0], &info.merge_cand[i].mv[0][1]);
|
||||
if (info.merge_cand->dir & 2) kvz_round_precision(INTERNAL_MV_PREC, 2, &info.merge_cand[i].mv[1][0], &info.merge_cand[i].mv[1][1]);
|
||||
}
|
||||
|
||||
// Default to candidate 0
|
||||
CU_SET_MV_CAND(cur_cu, 0, 0);
|
||||
CU_SET_MV_CAND(cur_cu, 1, 0);
|
||||
|
|
Loading…
Reference in a new issue