shithub: libvpx

Download patch

ref: 0fad6a9d99dbd88c87c5e621a18b9c18d9173dce
parent: df2314cfdd1ea6c0b4bca77165d959b74b58e4bb
author: Jim Bankoski <jimbankoski@google.com>
date: Wed Jun 19 08:16:45 EDT 2013

fix to set up new speed feature

This uses the speed feature functionality for code.

Change-Id: I9cd16c0c5f98520ae27ebba81aa2c178546587f8

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1397,10 +1397,11 @@
   for (mi_col = cm->cur_tile_mi_col_start;
        mi_col < cm->cur_tile_mi_col_end; mi_col += 64 / MI_SIZE) {
     int dummy_rate, dummy_dist;
-    if (cpi->speed < 5) {
+    if (!cpi->sf.use_lastframe_partitioning) {
       rd_pick_partition(cpi, tp, mi_row, mi_col, BLOCK_SIZE_SB64X64,
                         &dummy_rate, &dummy_dist);
     } else {
+
       const int idx_str = cm->mode_info_stride * mi_row + mi_col;
       MODE_INFO *m = cm->mi + idx_str;
       MODE_INFO *p = cm->prev_mi + idx_str;
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -539,6 +539,9 @@
   int speed_multiplier = speed + 1;
   int i;
 
+  if (speed == 2)
+    speed_multiplier = 1;
+
   // Set baseline threshold values
   for (i = 0; i < MAX_MODES; ++i)
     sf->thresh_mult[i] = mode == 0 ? -500 : 0;
@@ -595,18 +598,21 @@
     for (i = 0; i < MAX_MODES; ++i)
       sf->thresh_mult[i] = INT_MAX;
 
-    sf->thresh_mult[THR_DC       ] = 0;
-    sf->thresh_mult[THR_TM       ] = 0;
-    sf->thresh_mult[THR_NEWMV    ] = 4000;
-    sf->thresh_mult[THR_NEWG     ] = 4000;
-    sf->thresh_mult[THR_NEWA     ] = 4000;
+    sf->thresh_mult[THR_DC] = 0;
+    sf->thresh_mult[THR_TM] = 0;
+    sf->thresh_mult[THR_NEWMV] = 4000;
+    sf->thresh_mult[THR_NEWG] = 4000;
+    sf->thresh_mult[THR_NEWA] = 4000;
     sf->thresh_mult[THR_NEARESTMV] = 0;
-    sf->thresh_mult[THR_NEARESTG ] = 0;
-    sf->thresh_mult[THR_NEARESTA ] = 0;
-    sf->thresh_mult[THR_NEARMV   ] = 2000;
-    sf->thresh_mult[THR_NEARG    ] = 2000;
-    sf->thresh_mult[THR_NEARA    ] = 2000;
+    sf->thresh_mult[THR_NEARESTG] = 0;
+    sf->thresh_mult[THR_NEARESTA] = 0;
+    sf->thresh_mult[THR_NEARMV] = 2000;
+    sf->thresh_mult[THR_NEARG] = 2000;
+    sf->thresh_mult[THR_NEARA] = 2000;
     sf->thresh_mult[THR_COMP_NEARESTLA] = 2000;
+    sf->thresh_mult[THR_SPLITMV] = 2500;
+    sf->thresh_mult[THR_SPLITG] = 2500;
+    sf->thresh_mult[THR_SPLITA] = 2500;
     sf->recode_loop = 0;
   }
 
@@ -681,6 +687,7 @@
   sf->max_step_search_steps = MAX_MVSEARCH_STEPS;
   sf->comp_inter_joint_search_thresh = BLOCK_SIZE_AB4X4;
   sf->adpative_rd_thresh = 0;
+  sf->use_lastframe_partitioning = 0;
 
 #if CONFIG_MULTIPLE_ARF
   // Switch segmentation off.
@@ -708,8 +715,11 @@
         sf->optimize_coefficients = 0;
         sf->first_step = 1;
       }
-      break;
+      if (speed == 2)
+        sf->use_lastframe_partitioning = 1;
 
+     break;
+
   }; /* switch */
 
   // Set rd thresholds based on mode and speed setting
@@ -3327,7 +3337,7 @@
     vp9_second_pass(cpi);
 
   encode_frame_to_data_rate(cpi, size, dest, frame_flags);
-
+  //vp9_print_modes_and_motion_vectors(&cpi->common, "encode.stt");
 #ifdef DISABLE_RC_LONG_TERM_MEM
   cpi->twopass.bits_left -=  cpi->this_frame_target;
 #else
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -216,6 +216,7 @@
   int static_segmentation;
   int comp_inter_joint_search_thresh;
   int adpative_rd_thresh;
+  int use_lastframe_partitioning;
 } SPEED_FEATURES;
 
 enum BlockSize {
--