diff options
author | Jingning Han <jingning@google.com> | 2015-02-27 13:35:22 -0800 |
---|---|---|
committer | Jingning Han <jingning@google.com> | 2015-03-01 10:42:56 -0800 |
commit | 1790d45252efb29903baae3d1776bb24cee76558 (patch) | |
tree | c78441dc2aef61b80f9b027634c927540e1a4912 /vp9/encoder/vp9_encodeframe.c | |
parent | f4e0eb17e85eb84c162ac0218cf32a9eccece353 (diff) | |
download | libvpx-1790d45252efb29903baae3d1776bb24cee76558.tar libvpx-1790d45252efb29903baae3d1776bb24cee76558.tar.gz libvpx-1790d45252efb29903baae3d1776bb24cee76558.tar.bz2 libvpx-1790d45252efb29903baae3d1776bb24cee76558.zip |
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
Diffstat (limited to 'vp9/encoder/vp9_encodeframe.c')
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 18 |
1 files changed, 9 insertions, 9 deletions
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; |