summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorAngie Chiang <angiebird@google.com>2018-09-28 14:23:23 -0700
committerAngie Chiang <angiebird@google.com>2018-09-28 14:23:23 -0700
commit33cc4670473d51de0f1a782108ace460e028e23a (patch)
treef0d973b3177dbc20c4d88c6129a3b3367c363cf4 /vp9
parent12d6c66f500141343a736d85c7224db5ebf0730e (diff)
downloadlibvpx-33cc4670473d51de0f1a782108ace460e028e23a.tar
libvpx-33cc4670473d51de0f1a782108ace460e028e23a.tar.gz
libvpx-33cc4670473d51de0f1a782108ace460e028e23a.tar.bz2
libvpx-33cc4670473d51de0f1a782108ace460e028e23a.zip
Separate lambda from nb_mvs_inconsistency()
Change-Id: Ie5818689233ae01742ca595e2c8c3f3664bb426c
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_mcomp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c
index 48afb7190..980bf24ba 100644
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -1578,8 +1578,7 @@ static int exhuastive_mesh_search(const MACROBLOCK *x, MV *ref_mv, MV *best_mv,
}
#if CONFIG_NON_GREEDY_MV
-static double nb_mvs_inconsistency(const MV *mv, const int_mv *nb_mvs,
- double lambda) {
+static double nb_mvs_inconsistency(const MV *mv, const int_mv *nb_mvs) {
int i;
double best_cost = -1;
vpx_clear_system_state();
@@ -1600,7 +1599,7 @@ static double nb_mvs_inconsistency(const MV *mv, const int_mv *nb_mvs,
if (best_cost < 0) {
return 0;
} else {
- return best_cost * lambda;
+ return best_cost;
}
}
@@ -1646,7 +1645,7 @@ double vp9_diamond_search_sad_new(const MACROBLOCK *x,
// Check the starting position
bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride) +
- nb_mvs_inconsistency(best_full_mv, nb_full_mvs, lambda);
+ lambda * nb_mvs_inconsistency(best_full_mv, nb_full_mvs);
i = 0;
@@ -1678,8 +1677,8 @@ double vp9_diamond_search_sad_new(const MACROBLOCK *x,
if (sad_array[t] < bestsad) {
const MV this_mv = { best_full_mv->row + ss_mv[i].row,
best_full_mv->col + ss_mv[i].col };
- double thissad = sad_array[t] + nb_mvs_inconsistency(
- &this_mv, nb_full_mvs, lambda);
+ double thissad = sad_array[t] + lambda * nb_mvs_inconsistency(
+ &this_mv, nb_full_mvs);
if (thissad < bestsad) {
bestsad = thissad;
best_site = i;
@@ -1699,7 +1698,7 @@ double vp9_diamond_search_sad_new(const MACROBLOCK *x,
fn_ptr->sdf(what, what_stride, check_here, in_what_stride);
if (thissad < bestsad) {
- thissad += nb_mvs_inconsistency(&this_mv, nb_full_mvs, lambda);
+ thissad += lambda * nb_mvs_inconsistency(&this_mv, nb_full_mvs);
if (thissad < bestsad) {
bestsad = thissad;
best_site = i;
@@ -2265,11 +2264,12 @@ double vp9_refining_search_sad_new(const MACROBLOCK *x, MV *best_full_mv,
const struct buf_2d *const what = &x->plane[0].src;
const struct buf_2d *const in_what = &xd->plane[0].pre[0];
const uint8_t *best_address = get_buf_from_mv(in_what, best_full_mv);
- double best_sad =
- fn_ptr->sdf(what->buf, what->stride, best_address, in_what->stride) +
- nb_mvs_inconsistency(best_full_mv, nb_full_mvs, lambda);
+ double best_sad;
int i, j;
vpx_clear_system_state();
+ best_sad =
+ fn_ptr->sdf(what->buf, what->stride, best_address, in_what->stride) +
+ lambda * nb_mvs_inconsistency(best_full_mv, nb_full_mvs);
for (i = 0; i < search_range; i++) {
int best_site = -1;
@@ -2292,7 +2292,7 @@ double vp9_refining_search_sad_new(const MACROBLOCK *x, MV *best_full_mv,
const MV mv = { best_full_mv->row + neighbors[j].row,
best_full_mv->col + neighbors[j].col };
- thissad += nb_mvs_inconsistency(&mv, nb_full_mvs, lambda);
+ thissad += lambda * nb_mvs_inconsistency(&mv, nb_full_mvs);
if (thissad < best_sad) {
best_sad = thissad;
best_site = j;
@@ -2309,7 +2309,7 @@ double vp9_refining_search_sad_new(const MACROBLOCK *x, MV *best_full_mv,
fn_ptr->sdf(what->buf, what->stride,
get_buf_from_mv(in_what, &mv), in_what->stride);
if (thissad < best_sad) {
- thissad += nb_mvs_inconsistency(&mv, nb_full_mvs, lambda);
+ thissad += lambda * nb_mvs_inconsistency(&mv, nb_full_mvs);
if (thissad < best_sad) {
best_sad = thissad;
best_site = j;