shithub: libvpx

Download patch

ref: 0bf6b51572442cf6a8ee33a6011a34f1cc74a9dc
parent: 44600442dca48a5586105b01403ac03fad54d05b
parent: 5127e58dab541a21f2953f8f0acb86da9170e042
author: Yunqing Wang <[email protected]>
date: Thu Feb 16 11:22:54 EST 2017

Merge "Structured the mode ordering code to avoid redundant memcpy"

--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3169,15 +3169,14 @@
 
   midx = sf->schedule_mode_search ? mode_skip_start : 0;
 
-  memcpy(mode_map, tile_mode_map, sizeof(mode_map));
-
   while (midx > 4) {
     uint8_t end_pos = 0;
     for (i = 5; i < midx; ++i) {
-      if (mode_threshold[mode_map[i - 1]] > mode_threshold[mode_map[i]]) {
-        uint8_t tmp = mode_map[i];
-        mode_map[i] = mode_map[i - 1];
-        mode_map[i - 1] = tmp;
+      if (mode_threshold[tile_mode_map[i - 1]] >
+          mode_threshold[tile_mode_map[i]]) {
+        uint8_t tmp = tile_mode_map[i];
+        tile_mode_map[i] = tile_mode_map[i - 1];
+        tile_mode_map[i - 1] = tmp;
         end_pos = i;
       }
     }
@@ -3184,7 +3183,7 @@
     midx = end_pos;
   }
 
-  memcpy(tile_mode_map, mode_map, sizeof(mode_map));
+  memcpy(mode_map, tile_mode_map, sizeof(mode_map));
 
 #if CONFIG_MULTITHREAD
   if (NULL != tile_data->enc_row_mt_mutex)