shithub: libvpx

Download patch

ref: d8ebdcd89d5d19d283a73a2a81d3909b172e7e2d
parent: 11c706488b8d457cb808a8a7ff1358ae55d36649
author: Scott LaVarnway <slavarnway@google.com>
date: Thu Feb 2 08:40:08 EST 2012

Moved ref_frame_cost from MACROBLOCKD to MACROBLOCK

Change-Id: I05788522e9cde4322cfb12032483bdbf184bdf0b

--- a/vp8/common/blockd.h
+++ b/vp8/common/blockd.h
@@ -258,7 +258,6 @@
     int mb_to_top_edge;
     int mb_to_bottom_edge;
 
-    int ref_frame_cost[MAX_REF_FRAMES];
 
 
     vp8_subpix_fn_t  subpixel_predict;
--- a/vp8/encoder/block.h
+++ b/vp8/encoder/block.h
@@ -74,6 +74,8 @@
     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;
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -629,18 +629,18 @@
 
     // 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);
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -641,7 +641,7 @@
 
         /* 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,
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -2198,7 +2198,7 @@
          * 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 @@
             }
 
             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),