[x265] [PATCH] frameencoder: move threadMain() into cpp file

Steve Borho steve at borho.org
Sat Sep 14 07:42:37 CEST 2013


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1379134518 18000
#      Fri Sep 13 23:55:18 2013 -0500
# Node ID d0883c21fc7f1ea13c362cf4768a2dd6fde5522a
# Parent  2555acbc97367b5ea2dcfd921b3ec577e9f5e4f0
frameencoder: move threadMain() into cpp file

diff -r 2555acbc9736 -r d0883c21fc7f source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Fri Sep 13 23:37:16 2013 -0500
+++ b/source/encoder/frameencoder.cpp	Fri Sep 13 23:55:18 2013 -0500
@@ -255,6 +255,21 @@
     slice->setMaxNumMergeCand(m_cfg->param.maxNumMergeCand);
 }
 
+void FrameEncoder::threadMain()
+{
+    // worker thread routine for FrameEncoder
+    do
+    {
+        m_enable.wait(); // TEncTop::encode() triggers this event
+        if (m_threadActive)
+        {
+            compressFrame();
+            m_done.trigger(); // FrameEncoder::getEncodedPicture() blocks for this event
+        }
+    }
+    while (m_threadActive);
+}
+
 void FrameEncoder::compressFrame()
 {
     PPAScopeEvent(FrameEncoder_compressFrame);
diff -r 2555acbc9736 -r d0883c21fc7f source/encoder/frameencoder.h
--- a/source/encoder/frameencoder.h	Fri Sep 13 23:37:16 2013 -0500
+++ b/source/encoder/frameencoder.h	Fri Sep 13 23:55:18 2013 -0500
@@ -104,19 +104,7 @@
     TComPic *getEncodedPicture(AccessUnit& accessUnit);
 
     // worker thread
-    void threadMain()
-    {
-        do
-        {
-            m_enable.wait();  // TEncTop::encode() triggers this event
-            if (m_threadActive)
-            {
-                compressFrame();
-                m_done.trigger();
-            }
-        }
-        while (m_threadActive);
-    }
+    void threadMain();
 
     Event                    m_enable;
     Event                    m_done;


More information about the x265-devel mailing list