shithub: libvpx

Download patch

ref: 12180c8329d56d72e8d4424b8fd82b1b2f8e846a
parent: 2319b7aaf17b7efe143862bf0569fe8c9efd9d1f
author: Yaowu Xu <[email protected]>
date: Tue Jun 18 14:18:25 EDT 2013

Remove unnecessary copying of probs.

Change-Id: Ic924f07c6ab0c929c6cdf11880d3c625806e272c

--- a/vp9/common/vp9_findnearmv.c
+++ b/vp9/common/vp9_findnearmv.c
@@ -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 @@
   }
 }
 
-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,
--- a/vp9/common/vp9_findnearmv.h
+++ b/vp9/common/vp9_findnearmv.h
@@ -70,10 +70,6 @@
          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,
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -560,7 +560,7 @@
   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 @@
                        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)) {
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -708,11 +708,11 @@
     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;
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -992,11 +992,9 @@
   // 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;