From aed826b06571e2d88671aa78204e5ca89f6805e0 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Fri, 28 Feb 2014 14:10:51 -0800 Subject: [PATCH] Using ref_mv[2] instead of two separate variables. Change-Id: I909a81991aa0cc18afe6526542c7513837445213 --- vp9/encoder/vp9_rdopt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index b57b94806..ee5ddb1f1 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1614,7 +1614,7 @@ typedef struct { } SEG_RDSTAT; typedef struct { - int_mv *ref_mv, *second_ref_mv; + int_mv *ref_mv[2]; int_mv mvp; int64_t segment_rd; @@ -1822,30 +1822,30 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x, // adjust src pointer for this block mi_buf_shift(x, i); - vp9_set_mv_search_range(x, &bsi->ref_mv->as_mv); + vp9_set_mv_search_range(x, &bsi->ref_mv[0]->as_mv); if (cpi->sf.search_method == HEX) { bestsme = vp9_hex_search(x, &mvp_full, step_param, sadpb, 1, v_fn_ptr, 1, - &bsi->ref_mv->as_mv, + &bsi->ref_mv[0]->as_mv, &new_mv->as_mv); } else if (cpi->sf.search_method == SQUARE) { bestsme = vp9_square_search(x, &mvp_full, step_param, sadpb, 1, v_fn_ptr, 1, - &bsi->ref_mv->as_mv, + &bsi->ref_mv[0]->as_mv, &new_mv->as_mv); } else if (cpi->sf.search_method == BIGDIA) { bestsme = vp9_bigdia_search(x, &mvp_full, step_param, sadpb, 1, v_fn_ptr, 1, - &bsi->ref_mv->as_mv, + &bsi->ref_mv[0]->as_mv, &new_mv->as_mv); } else { bestsme = vp9_full_pixel_diamond(cpi, x, &mvp_full, step_param, sadpb, further_steps, 0, v_fn_ptr, - &bsi->ref_mv->as_mv, + &bsi->ref_mv[0]->as_mv, &new_mv->as_mv); } @@ -1859,7 +1859,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x, thissme = cpi->full_search_sad(x, &mvp_full, sadpb, 16, v_fn_ptr, x->nmvjointcost, x->mvcost, - &bsi->ref_mv->as_mv, + &bsi->ref_mv[0]->as_mv, &best_mv->as_mv); if (thissme < bestsme) { bestsme = thissme; @@ -1875,7 +1875,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x, int distortion; cpi->find_fractional_mv_step(x, &new_mv->as_mv, - &bsi->ref_mv->as_mv, + &bsi->ref_mv[0]->as_mv, cm->allow_high_precision_mv, x->errorperbit, v_fn_ptr, cpi->sf.subpel_force_stop, @@ -1922,7 +1922,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x, bsi->rdstat[i][mode_idx].brate = labels2mode(x, i, this_mode, &mode_mv[this_mode], &second_mode_mv[this_mode], frame_mv, seg_mvs[i], - bsi->ref_mv, bsi->second_ref_mv, x->nmvjointcost, + bsi->ref_mv[0], bsi->ref_mv[1], x->nmvjointcost, x->mvcost, cpi); @@ -2031,7 +2031,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x, labels2mode(x, i, mode_selected, &mode_mv[mode_selected], &second_mode_mv[mode_selected], frame_mv, seg_mvs[i], - bsi->ref_mv, bsi->second_ref_mv, x->nmvjointcost, + bsi->ref_mv[0], bsi->ref_mv[1], x->nmvjointcost, x->mvcost, cpi); br += bsi->rdstat[i][mode_idx].brate; @@ -2086,8 +2086,8 @@ static int64_t rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x, vp9_zero(*bsi); bsi->segment_rd = best_rd; - bsi->ref_mv = best_ref_mv; - bsi->second_ref_mv = second_best_ref_mv; + bsi->ref_mv[0] = best_ref_mv; + bsi->ref_mv[1] = second_best_ref_mv; bsi->mvp.as_int = best_ref_mv->as_int; bsi->mvthresh = mvthresh;