shithub: libvpx

Download patch

ref: 71d5a59c6db964cee203349b8bfad3a15aa719b2
parent: 56cc37c64295715f632c9f169f106bf5ce9420b6
author: Alex Converse <aconverse@google.com>
date: Thu Mar 5 07:09:48 EST 2015

Don't copy thread data for the main thread.

Change-Id: I6adee6704cacfeae0ed0b217a91095457d1be74a

--- a/vp9/encoder/vp9_ethread.c
+++ b/vp9/encoder/vp9_ethread.c
@@ -119,10 +119,14 @@
     thread_data = (EncWorkerData*)worker->data1;
 
     // Before encoding a frame, copy the thread data from cpi.
-    thread_data->td->mb = cpi->td.mb;
-    thread_data->td->rd_counts = cpi->td.rd_counts;
-    vpx_memcpy(thread_data->td->counts, &cpi->common.counts,
-               sizeof(cpi->common.counts));
+    if (thread_data->td != &cpi->td) {
+      thread_data->td->mb = cpi->td.mb;
+      thread_data->td->rd_counts = cpi->td.rd_counts;
+    }
+    if (thread_data->td->counts != &cpi->common.counts) {
+      vpx_memcpy(thread_data->td->counts, &cpi->common.counts,
+                 sizeof(cpi->common.counts));
+    }
 
     // Handle use_nonrd_pick_mode case.
     if (cpi->sf.use_nonrd_pick_mode) {