From 1790d45252efb29903baae3d1776bb24cee76558 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Fri, 27 Feb 2015 13:35:22 -0800 Subject: Use variance metric for integral projection vector match This commit replaces the SAD with variance as metric for the integral projection vector match. It improves the search accuracy in the presence of slight light change. The average speed -6 compression performance for rtc set is improved by 1.7%. No speed changes are observed for the test clips. Change-Id: I71c1d27e42de2aa429fb3564e6549bba1c7d6d4d --- vp9/encoder/vp9_encodeframe.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vp9/encoder/vp9_encodeframe.c') diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index a5e9ed616..63ca2d34d 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -519,14 +519,14 @@ void vp9_set_vbp_thresholds(VP9_COMP *cpi, int q) { #endif #if GLOBAL_MOTION -static int vector_match(int16_t *ref, int16_t *src, int length) { +static int vector_match(int16_t *ref, int16_t *src, int bwl) { int best_sad = INT_MAX; int this_sad; int d; int center, offset = 0; - int bw = length; // redundant variable, to be changed in the experiments. + int bw = 4 << bwl; // redundant variable, to be changed in the experiments. for (d = 0; d <= bw; d += 16) { - this_sad = vp9_vector_sad(&ref[d], src, length); + this_sad = vp9_vector_var(&ref[d], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; offset = d; @@ -539,7 +539,7 @@ static int vector_match(int16_t *ref, int16_t *src, int length) { // check limit if (this_pos < 0 || this_pos > bw) continue; - this_sad = vp9_vector_sad(&ref[this_pos], src, length); + this_sad = vp9_vector_var(&ref[this_pos], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; center = this_pos; @@ -552,7 +552,7 @@ static int vector_match(int16_t *ref, int16_t *src, int length) { // check limit if (this_pos < 0 || this_pos > bw) continue; - this_sad = vp9_vector_sad(&ref[this_pos], src, length); + this_sad = vp9_vector_var(&ref[this_pos], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; center = this_pos; @@ -565,7 +565,7 @@ static int vector_match(int16_t *ref, int16_t *src, int length) { // check limit if (this_pos < 0 || this_pos > bw) continue; - this_sad = vp9_vector_sad(&ref[this_pos], src, length); + this_sad = vp9_vector_var(&ref[this_pos], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; center = this_pos; @@ -578,7 +578,7 @@ static int vector_match(int16_t *ref, int16_t *src, int length) { // check limit if (this_pos < 0 || this_pos > bw) continue; - this_sad = vp9_vector_sad(&ref[this_pos], src, length); + this_sad = vp9_vector_var(&ref[this_pos], src, bwl); if (this_sad < best_sad) { best_sad = this_sad; center = this_pos; @@ -638,8 +638,8 @@ static void motion_estimation(VP9_COMP *cpi, MACROBLOCK *x, } // Find the best match per 1-D search - tmp_mv->col = vector_match(hbuf, src_hbuf, bw); - tmp_mv->row = vector_match(vbuf, src_vbuf, bh); + tmp_mv->col = vector_match(hbuf, src_hbuf, b_width_log2_lookup[bsize]); + tmp_mv->row = vector_match(vbuf, src_vbuf, b_height_log2_lookup[bsize]); best_sad = INT_MAX; this_mv = *tmp_mv; -- cgit v1.2.3