diff options
author | John Koleszar <jkoleszar@google.com> | 2011-08-06 00:05:14 -0400 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2011-08-06 00:05:15 -0400 |
commit | 939f64f68efc837a98a5c80913a4bde50b79854f (patch) | |
tree | 5c368985b8e0bbabb099c4259161e467a1e3ee42 | |
parent | 712762b5081068e3e20cca8d01832f316ae74656 (diff) | |
parent | b84e8f20c3aca0f2a65265cf704cc7c15a2c93d4 (diff) | |
download | libvpx-939f64f68efc837a98a5c80913a4bde50b79854f.tar libvpx-939f64f68efc837a98a5c80913a4bde50b79854f.tar.gz libvpx-939f64f68efc837a98a5c80913a4bde50b79854f.tar.bz2 libvpx-939f64f68efc837a98a5c80913a4bde50b79854f.zip |
Merge remote branch 'origin/master' into experimental
Change-Id: I9c479c9b6e72aa78b412d25c00b8075eaca5229d
-rw-r--r-- | vp8/encoder/mcomp.c | 78 |
1 files changed, 14 insertions, 64 deletions
diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c index ff84306e7..aebcfce70 100644 --- a/vp8/encoder/mcomp.c +++ b/vp8/encoder/mcomp.c @@ -661,6 +661,7 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d, unsigned char *z = (*(b->base_src) + b->src); int left, right, up, down, diag; unsigned int sse; + int whichdir ; int thismse; int y_stride; @@ -740,8 +741,6 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d, *sse1 = sse; } - // somewhat strangely not doing all the diagonals for half pel is slower than doing them. -#if 0 // now check 1 more diagonal - whichdir = (left < right ? 0 : 1) + (up < down ? 0 : 2); this_mv = startmv; @@ -749,39 +748,28 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d, switch (whichdir) { case 0: - this_mv.col = (this_mv.col - 8) | 4; - this_mv.row = (this_mv.row - 8) | 4; - diag = vfp->svf(y - 1 - y_stride, y_stride, 4, 4, z, b->src_stride, &sse); + this_mv.as_mv.col = (this_mv.as_mv.col - 8) | 4; + this_mv.as_mv.row = (this_mv.as_mv.row - 8) | 4; + thismse = vfp->svf_halfpix_hv(y - 1 - y_stride, y_stride, z, b->src_stride, &sse); break; case 1: - this_mv.col += 4; - this_mv.row = (this_mv.row - 8) | 4; - diag = vfp->svf(y - y_stride, y_stride, 4, 4, z, b->src_stride, &sse); + this_mv.as_mv.col += 4; + this_mv.as_mv.row = (this_mv.as_mv.row - 8) | 4; + thismse = vfp->svf_halfpix_hv(y - y_stride, y_stride, z, b->src_stride, &sse); break; case 2: - this_mv.col = (this_mv.col - 8) | 4; - this_mv.row += 4; - diag = vfp->svf(y - 1, y_stride, 4, 4, z, b->src_stride, &sse); + this_mv.as_mv.col = (this_mv.as_mv.col - 8) | 4; + this_mv.as_mv.row += 4; + thismse = vfp->svf_halfpix_hv(y - 1, y_stride, z, b->src_stride, &sse); break; case 3: - this_mv.col += 4; - this_mv.row += 4; - diag = vfp->svf(y, y_stride, 4, 4, z, b->src_stride, &sse); + default: + this_mv.as_mv.col += 4; + this_mv.as_mv.row += 4; + thismse = vfp->svf_halfpix_hv(y, y_stride, z, b->src_stride, &sse); break; } - diag += mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (diag < bestmse) - { - *bestmv = this_mv; - bestmse = diag; - } - -#else - this_mv.as_mv.col = (this_mv.as_mv.col - 8) | 4; - this_mv.as_mv.row = (this_mv.as_mv.row - 8) | 4; - thismse = vfp->svf_halfpix_hv(y - 1 - y_stride, y_stride, z, b->src_stride, &sse); diag = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); if (diag < bestmse) @@ -792,44 +780,6 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d, *sse1 = sse; } - this_mv.as_mv.col += 8; - thismse = vfp->svf_halfpix_hv(y - y_stride, y_stride, z, b->src_stride, &sse); - diag = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (diag < bestmse) - { - *bestmv = this_mv; - bestmse = diag; - *distortion = thismse; - *sse1 = sse; - } - - this_mv.as_mv.col = (this_mv.as_mv.col - 8) | 4; - this_mv.as_mv.row = startmv.as_mv.row + 4; - thismse = vfp->svf_halfpix_hv(y - 1, y_stride, z, b->src_stride, &sse); - diag = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (diag < bestmse) - { - *bestmv = this_mv; - bestmse = diag; - *distortion = thismse; - *sse1 = sse; - } - - this_mv.as_mv.col += 8; - thismse = vfp->svf_halfpix_hv(y, y_stride, z, b->src_stride, &sse); - diag = thismse + mv_err_cost(&this_mv, ref_mv, mvcost, error_per_bit); - - if (diag < bestmse) - { - *bestmv = this_mv; - bestmse = diag; - *distortion = thismse; - *sse1 = sse; - } - -#endif return bestmse; } |