mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-28 03:34:06 +00:00
Implement TMVP duplicate checking as in VTM 2.1
This commit is contained in:
parent
3f9d1d12df
commit
027359c3c3
17
src/inter.c
17
src/inter.c
|
@ -1406,7 +1406,22 @@ uint8_t kvz_inter_get_merge_cand(const encoder_state_t * const state,
|
|||
}
|
||||
}
|
||||
|
||||
if (mv_cand[candidates].dir != 0) candidates++;
|
||||
|
||||
if (mv_cand[candidates].dir != 0) {
|
||||
bool add_tmvp = true;
|
||||
// Check for duplicate entries
|
||||
for (int i = 0; i < candidates; i++) {
|
||||
if (mv_cand[i].dir == mv_cand[candidates].dir &&
|
||||
(!(mv_cand[i].dir & 1) || (mv_cand[i].mv[0][0] == mv_cand[candidates].mv[0][0] &&
|
||||
mv_cand[i].mv[0][1] == mv_cand[candidates].mv[0][1])) &&
|
||||
(!(mv_cand[i].dir & 2) || (mv_cand[i].mv[1][0] == mv_cand[candidates].mv[1][0] &&
|
||||
mv_cand[i].mv[1][1] == mv_cand[candidates].mv[1][1]))) {
|
||||
add_tmvp = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(add_tmvp) candidates++;
|
||||
}
|
||||
}
|
||||
|
||||
if (candidates < MRG_MAX_NUM_CANDS && state->frame->slicetype == KVZ_SLICE_B) {
|
||||
|
|
Loading…
Reference in a new issue