diff options
author | Kyle Siefring <kylesiefring@gmail.com> | 2021-01-08 20:44:24 +0300 |
---|---|---|
committer | Jean-Baptiste Kempf <jb@videolan.org> | 2021-01-11 15:06:42 +0300 |
commit | 3ccfc25a8451d5f17d80b06eb9d6a622722ec08d (patch) | |
tree | b832eaf85f27f9553b529bd10c982660e86d02da /src/refmvs.c | |
parent | 864b1995dce9edf5e655fe8b44f81be8fbfbcaa8 (diff) |
Dedup setting match flags for spatial candidates
Diffstat (limited to 'src/refmvs.c')
-rw-r--r-- | src/refmvs.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/refmvs.c b/src/refmvs.c index 1e113b4..09f18db 100644 --- a/src/refmvs.c +++ b/src/refmvs.c @@ -51,12 +51,13 @@ static void add_spatial_candidate(refmvs_candidate *const mvstack, int *const cn const mv cand_mv = ((b->mf & 1) && gmv[0].n != INVALID_MV) ? gmv[0] : b->mv.mv[n]; + *have_refmv_match = 1; + *have_newmv_match |= b->mf >> 1; + const int last = *cnt; for (int m = 0; m < last; m++) if (mvstack[m].mv.mv[0].n == cand_mv.n) { mvstack[m].weight += weight; - *have_refmv_match = 1; - *have_newmv_match |= b->mf >> 1; return; } @@ -65,8 +66,6 @@ static void add_spatial_candidate(refmvs_candidate *const mvstack, int *const cn mvstack[last].weight = weight; *cnt = last + 1; } - *have_refmv_match = 1; - *have_newmv_match |= b->mf >> 1; return; } } @@ -76,12 +75,13 @@ static void add_spatial_candidate(refmvs_candidate *const mvstack, int *const cn [1] = ((b->mf & 1) && gmv[1].n != INVALID_MV) ? gmv[1] : b->mv.mv[1], }}; + *have_refmv_match = 1; + *have_newmv_match |= b->mf >> 1; + const int last = *cnt; for (int n = 0; n < last; n++) if (mvstack[n].mv.n == cand_mv.n) { mvstack[n].weight += weight; - *have_refmv_match = 1; - *have_newmv_match |= b->mf >> 1; return; } @@ -90,8 +90,6 @@ static void add_spatial_candidate(refmvs_candidate *const mvstack, int *const cn mvstack[last].weight = weight; *cnt = last + 1; } - *have_refmv_match = 1; - *have_newmv_match |= b->mf >> 1; } } |