shithub: libvpx

Download patch

ref: 538865dfa516a3a08aa63ee7eab49197d326898a
parent: 016a38be93baabec24d922102edb150f554cb141
parent: 380d64ecb19984a1466e727244a41445ae919060
author: Yunqing Wang <yunqingwang@google.com>
date: Tue Oct 4 03:04:30 EDT 2011

Merge "Multithreaded encoder, late sync loopfilter"

--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -3781,6 +3781,17 @@
             vp8_setup_key_frame(cpi);
         }
 
+#if CONFIG_MULTITHREAD
+        /*  wait for loopfilter thread done (for last picture)
+         *  don't do it for first frame, re-code and when PSNR is calculated
+         */
+        if (cpi->b_multi_threaded && cm->current_video_frame && (!Loop) &&
+                (!cpi->b_calculate_psnr))
+        {
+            sem_wait(&cpi->h_event_end_lpf);
+        }
+#endif
+
         // transform / motion compensation build reconstruction frame
         vp8_encode_frame(cpi);
 
@@ -4153,8 +4164,8 @@
     vp8_pack_bitstream(cpi, dest, size);
 
 #if CONFIG_MULTITHREAD
-    /* wait for loopfilter thread done */
-    if (cpi->b_multi_threaded)
+    /* if PSNR packets are generated we have to wait for the lpf */
+    if (cpi->b_multi_threaded && cpi->b_calculate_psnr)
     {
         sem_wait(&cpi->h_event_end_lpf);
     }
--