From: Scott LaVarnway Date: Thu, 2 Feb 2012 18:40:08 +0000 (-0500) Subject: Moved ref_frame_cost from MACROBLOCKD to MACROBLOCK X-Git-Tag: v1.1.0~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d8ebdcd89d5d19d283a73a2a81d3909b172e7e2d;p=libvpx Moved ref_frame_cost from MACROBLOCKD to MACROBLOCK Change-Id: I05788522e9cde4322cfb12032483bdbf184bdf0b --- diff --git a/vp8/common/blockd.h b/vp8/common/blockd.h index 6a03f1e0c..ae32538fc 100644 --- a/vp8/common/blockd.h +++ b/vp8/common/blockd.h @@ -258,7 +258,6 @@ typedef struct macroblockd int mb_to_top_edge; int mb_to_bottom_edge; - int ref_frame_cost[MAX_REF_FRAMES]; vp8_subpix_fn_t subpixel_predict; diff --git a/vp8/encoder/block.h b/vp8/encoder/block.h index a43cff065..6165d048c 100644 --- a/vp8/encoder/block.h +++ b/vp8/encoder/block.h @@ -74,6 +74,8 @@ typedef struct macroblock PARTITION_INFO *pi; /* Corresponds to upper left visible macroblock */ PARTITION_INFO *pip; /* Base of allocated array */ + int ref_frame_cost[MAX_REF_FRAMES]; + search_site *ss; int ss_count; int searches_per_step; diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index e762d2591..10f56078b 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -629,18 +629,18 @@ void init_encode_frame_mb_context(VP8_COMP *cpi) // Special case treatment when GF and ARF are not sensible options for reference if (cpi->ref_frame_flags == VP8_LAST_FLAG) - vp8_calc_ref_frame_costs(xd->ref_frame_cost, + vp8_calc_ref_frame_costs(x->ref_frame_cost, cpi->prob_intra_coded,255,128); else if ((cpi->oxcf.number_of_layers > 1) && (cpi->ref_frame_flags == VP8_GOLD_FLAG)) - vp8_calc_ref_frame_costs(xd->ref_frame_cost, + vp8_calc_ref_frame_costs(x->ref_frame_cost, cpi->prob_intra_coded,1,255); else if ((cpi->oxcf.number_of_layers > 1) && (cpi->ref_frame_flags == VP8_ALT_FLAG)) - vp8_calc_ref_frame_costs(xd->ref_frame_cost, + vp8_calc_ref_frame_costs(x->ref_frame_cost, cpi->prob_intra_coded,1,1); else - vp8_calc_ref_frame_costs(xd->ref_frame_cost, + vp8_calc_ref_frame_costs(x->ref_frame_cost, cpi->prob_intra_coded, cpi->prob_last_coded, cpi->prob_gf_coded); diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c index 1f9d05533..5e5e19fe3 100644 --- a/vp8/encoder/pickinter.c +++ b/vp8/encoder/pickinter.c @@ -641,7 +641,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, /* Work out the cost assosciated with selecting the reference frame */ frame_cost = - x->e_mbd.ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; + x->ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; rate2 += frame_cost; /* Only consider ZEROMV/ALTREF_FRAME for alt ref frame, diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 3362285c2..433412d73 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -2198,7 +2198,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, * to the rolling cost variable. */ rate2 += - x->e_mbd.ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; + x->ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; if (!disable_skip) { @@ -2258,7 +2258,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, } other_cost += - x->e_mbd.ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; + x->ref_frame_cost[x->e_mbd.mode_info_context->mbmi.ref_frame]; /* Calculate the final y RD estimate for this mode */ best_yrd = RDCOST(x->rdmult, x->rddiv, (rate2-rate_uv-other_cost),