diff options
author | Jingning Han <jingning@google.com> | 2015-03-04 10:47:56 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2015-03-04 10:47:56 -0800 |
commit | 50c06052e9c7cdb9b2ccec678e4e457b1b137599 (patch) | |
tree | 36f080bd6d069d46370e61a25a6f89b027e384f1 | |
parent | 0fe8304d0ba90388d06aaec588edf729e088ea1d (diff) | |
parent | 7d8061a44a8a8cd4ecb0463723cd6a2493c24b56 (diff) | |
download | libvpx-50c06052e9c7cdb9b2ccec678e4e457b1b137599.tar libvpx-50c06052e9c7cdb9b2ccec678e4e457b1b137599.tar.gz libvpx-50c06052e9c7cdb9b2ccec678e4e457b1b137599.tar.bz2 libvpx-50c06052e9c7cdb9b2ccec678e4e457b1b137599.zip |
Merge "Use SAD value to set chroma cost flag"
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 78950f041..2bdb9915c 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -610,7 +610,6 @@ static unsigned int motion_estimation(VP9_COMP *cpi, MACROBLOCK *x, uint8_t const *ref_buf, *src_buf; MV *tmp_mv = &xd->mi[0].src_mi->mbmi.mv[0].as_mv; int best_sad; - unsigned int best_sse; MV this_mv; // Set up prediction 1-D reference set @@ -659,13 +658,11 @@ static unsigned int motion_estimation(VP9_COMP *cpi, MACROBLOCK *x, tmp_mv->col = search_pos[idx].col + this_mv.col; } } - - ref_buf = xd->plane[0].pre[0].buf + tmp_mv->row * ref_stride + tmp_mv->col; - cpi->fn_ptr[bsize].vf(src_buf, src_stride, ref_buf, ref_stride, &best_sse); tmp_mv->row *= 8; tmp_mv->col *= 8; x->pred_mv[LAST_FRAME] = *tmp_mv; - return best_sse; + + return best_sad; } #endif @@ -712,9 +709,9 @@ static void choose_partitioning(VP9_COMP *cpi, if (!is_key_frame) { MB_MODE_INFO *mbmi = &xd->mi[0].src_mi->mbmi; - unsigned int var = 0, uv_sse; + unsigned int uv_sad; #if GLOBAL_MOTION - unsigned int y_sse; + unsigned int y_sad; BLOCK_SIZE bsize; #endif vp9_setup_pre_planes(xd, 0, yv12, mi_row, mi_col, @@ -735,7 +732,7 @@ static void choose_partitioning(VP9_COMP *cpi, else bsize = BLOCK_32X32; - y_sse = motion_estimation(cpi, x, bsize); + y_sad = motion_estimation(cpi, x, bsize); #endif vp9_build_inter_predictors_sb(xd, mi_row, mi_col, BLOCK_64X64); @@ -744,13 +741,13 @@ static void choose_partitioning(VP9_COMP *cpi, struct macroblock_plane *p = &x->plane[i]; struct macroblockd_plane *pd = &xd->plane[i]; const BLOCK_SIZE bs = get_plane_block_size(BLOCK_64X64, pd); - var += cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride, - pd->dst.buf, pd->dst.stride, &uv_sse); + uv_sad = cpi->fn_ptr[bs].sdf(p->src.buf, p->src.stride, + pd->dst.buf, pd->dst.stride); #if GLOBAL_MOTION - x->color_sensitivity[i - 1] = uv_sse * 6 > y_sse; + x->color_sensitivity[i - 1] = uv_sad * 4 > y_sad; #else - x->color_sensitivity[i - 1] = (uv_sse > 2048); + x->color_sensitivity[i - 1] = (uv_sad > 512); #endif } |