Moved ref_frame_cost from MACROBLOCKD to MACROBLOCK

Change-Id: I05788522e9cde4322cfb12032483bdbf184bdf0b
This commit is contained in:
Scott LaVarnway 2012-02-02 13:40:08 -05:00
parent 11c706488b
commit d8ebdcd89d
5 changed files with 9 additions and 8 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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,

View File

@ -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),