Remove unnecessary copying of probs.
authorYaowu Xu <yaowu@google.com>
Wed, 19 Jun 2013 01:18:25 +0000 (18:18 -0700)
committerYaowu Xu <yaowu@google.com>
Wed, 19 Jun 2013 06:02:27 +0000 (23:02 -0700)
Change-Id: Ic924f07c6ab0c929c6cdf11880d3c625806e272c

vp9/common/vp9_findnearmv.c
vp9/common/vp9_findnearmv.h
vp9/decoder/vp9_decodemv.c
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_rdopt.c

index d781711..a692271 100644 (file)
@@ -13,7 +13,6 @@
 #include "vp9/common/vp9_findnearmv.h"
 #include "vp9/common/vp9_mvref_common.h"
 #include "vp9/common/vp9_sadmxn.h"
-#include "vp9/common/vp9_subpelvar.h"
 
 static void lower_mv_precision(int_mv *mv, int usehp) {
   if (!usehp || !vp9_use_nmv_hp(&mv->as_mv)) {
@@ -24,12 +23,6 @@ static void lower_mv_precision(int_mv *mv, int usehp) {
   }
 }
 
-vp9_prob *vp9_mv_ref_probs(VP9_COMMON *pc, vp9_prob *p, int context) {
-  p[0] = pc->fc.inter_mode_probs[context][0];
-  p[1] = pc->fc.inter_mode_probs[context][1];
-  p[2] = pc->fc.inter_mode_probs[context][2];
-  return p;
-}
 
 void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
                            int_mv *mvlist,
index 17fef12..d4ae210 100644 (file)
@@ -70,10 +70,6 @@ static int check_mv_bounds(int_mv *mv,
          mv->as_mv.row > mb_to_bottom_edge;
 }
 
-vp9_prob *vp9_mv_ref_probs(VP9_COMMON *pc,
-                           vp9_prob p[VP9_INTER_MODES - 1],
-                           int context);
-
 void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *pc,
                                    MACROBLOCKD *xd,
                                    int_mv *dst_nearest,
index 375fe2a..b3d41be 100644 (file)
@@ -560,7 +560,7 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
   if (mbmi->ref_frame[0] != INTRA_FRAME) {
     int_mv nearest, nearby, best_mv;
     int_mv nearest_second, nearby_second, best_mv_second;
-    vp9_prob mv_ref_p[VP9_INTER_MODES - 1];
+    vp9_prob *mv_ref_p;
 
     read_ref_frame(pbi, r, mbmi->segment_id, mbmi->ref_frame);
 
@@ -574,7 +574,8 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
                        mbmi->ref_frame[0], mbmi->ref_mvs[mbmi->ref_frame[0]],
                        cm->ref_frame_sign_bias);
 
-      vp9_mv_ref_probs(cm, mv_ref_p, mbmi->mb_mode_context[mbmi->ref_frame[0]]);
+      mv_ref_p = cm->fc.inter_mode_probs[
+        mbmi->mb_mode_context[mbmi->ref_frame[0]]];
 
       // If the segment level skip mode enabled
       if (vp9_segfeature_active(xd, mbmi->segment_id, SEG_LVL_SKIP)) {
index e18394b..09ab2db 100644 (file)
@@ -708,11 +708,11 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
     write_intra_mode(bc, mi->uv_mode,
                      pc->fc.uv_mode_prob[mode]);
   } else {
-    vp9_prob mv_ref_p[VP9_INTER_MODES - 1];
+    vp9_prob *mv_ref_p;
 
     encode_ref_frame(cpi, bc);
 
-    vp9_mv_ref_probs(&cpi->common, mv_ref_p, mi->mb_mode_context[rf]);
+    mv_ref_p = cpi->common.fc.inter_mode_probs[mi->mb_mode_context[rf]];
 
 #ifdef ENTROPY_STATS
     active_section = 3;
index 4e485e9..9cb7ab0 100644 (file)
@@ -992,11 +992,9 @@ int vp9_cost_mv_ref(VP9_COMP *cpi,
   // Dont account for mode here if segment skip is enabled.
   if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) {
     VP9_COMMON *pc = &cpi->common;
-
-    vp9_prob p[VP9_INTER_MODES - 1];
     assert(NEARESTMV <= m  &&  m <= NEWMV);
-    vp9_mv_ref_probs(pc, p, mode_context);
-    return cost_token(vp9_sb_mv_ref_tree, p,
+    return cost_token(vp9_sb_mv_ref_tree,
+                      pc->fc.inter_mode_probs[mode_context],
                       vp9_sb_mv_ref_encoding_array - NEARESTMV + m);
   } else
     return 0;