From 726d1b841b8101fbfa75eb9832e9baa9e477c1d5 Mon Sep 17 00:00:00 2001 From: Yunqing Wang Date: Tue, 4 Aug 2015 12:16:47 -0700 Subject: [PATCH] Minor adjustment in diagonal sub-pixel point checking Choose a different diagonal point to check when the two costs are the same, making it consistent with the way we choose the best mv. This slightly changes the encoding result, and the derflr set borg test at speed 0 shows 0.027% Overall PSNR gain, 0.024% Avg PSNR gain, and 0.043% SSIM gain. Change-Id: Ic8ee3a6767394866d159e4f9e1c777604dd73c17 --- vp9/encoder/vp9_mcomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c index 6e0c561c3..63a35526b 100644 --- a/vp9/encoder/vp9_mcomp.c +++ b/vp9/encoder/vp9_mcomp.c @@ -703,8 +703,8 @@ int vp9_find_best_sub_pixel_tree(const MACROBLOCK *x, } // Check diagonal sub-pixel position - tc = bc + (cost_array[0] < cost_array[1] ? -hstep : hstep); - tr = br + (cost_array[2] < cost_array[3] ? -hstep : hstep); + tc = bc + (cost_array[0] <= cost_array[1] ? -hstep : hstep); + tr = br + (cost_array[2] <= cost_array[3] ? -hstep : hstep); if (tc >= minc && tc <= maxc && tr >= minr && tr <= maxr) { const uint8_t *const pre_address = y + (tr >> 3) * y_stride + (tc >> 3); MV this_mv = {tr, tc};