Moved ref_frame_cost from MACROBLOCKD to MACROBLOCK
authorScott LaVarnway <slavarnway@google.com>
Thu, 2 Feb 2012 18:40:08 +0000 (13:40 -0500)
committerScott LaVarnway <slavarnway@google.com>
Thu, 2 Feb 2012 18:40:08 +0000 (13:40 -0500)
Change-Id: I05788522e9cde4322cfb12032483bdbf184bdf0b

vp8/common/blockd.h
vp8/encoder/block.h
vp8/encoder/encodeframe.c
vp8/encoder/pickinter.c
vp8/encoder/rdopt.c

index 6a03f1e..ae32538 100644 (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;
index a43cff0..6165d04 100644 (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;
index e762d25..10f5607 100644 (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);
index 1f9d055..5e5e19f 100644 (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,
index 3362285..433412d 100644 (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),