[x265] [PATCH 2 of 7] frameEncoder: copy param state for each FE and worker thread from input frame

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Tue May 5 17:51:41 CEST 2015


# HG changeset patch
# User Aarthi Thirumalai
# Date 1427281243 -19800
#      Wed Mar 25 16:30:43 2015 +0530
# Node ID 084e7ed97059873201ccb4762eeb9d3a55dd3238
# Parent  fc12a89d17cbf231f63e7eeba4a9112d1cf0fe17
frameEncoder: copy param state for each FE and worker thread from input frame

Each FrameEncoder gets the param from the current frame it is processing and all the worker threads
/bondedgrp worker threads sets the param to it's parent FrameEncoder instance.

diff -r fc12a89d17cb -r 084e7ed97059 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Wed Mar 25 16:28:53 2015 +0530
+++ b/source/encoder/analysis.cpp	Wed Mar 25 16:30:43 2015 +0530
@@ -348,6 +348,7 @@
     ScopedElapsedTime pmodeTime(master.m_stats[fe].pmodeTime);
 #endif
     ProfileScopeEvent(pmode);
+    master.m_tld[workerThreadId].analysis.m_param = master.m_param;
     master.processPmode(*this, master.m_tld[workerThreadId].analysis);
 }
 
diff -r fc12a89d17cb -r 084e7ed97059 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Wed Mar 25 16:28:53 2015 +0530
+++ b/source/encoder/frameencoder.cpp	Wed Mar 25 16:30:43 2015 +0530
@@ -217,6 +217,7 @@
     curFrame->m_encData->m_frameEncoderID = m_jpId;
     curFrame->m_encData->m_jobProvider = this;
     curFrame->m_encData->m_slice->m_mref = m_mref;
+    this->m_param = curFrame->m_param;
 
     if (!m_cuGeoms)
     {
@@ -793,7 +794,7 @@
 {
     uint32_t row = (uint32_t)intRow;
     CTURow& curRow = m_rows[row];
-
+    tld.analysis.m_param = m_param;
     if (m_param->bEnableWavefront)
     {
         ScopedLock self(curRow.lock);
@@ -1092,7 +1093,7 @@
             tryWakeOne();
         }
     }
-
+    tld.analysis.m_param = NULL;
     curRow.busy = false;
 
     if (ATOMIC_INC(&m_completionCount) == 2 * (int)m_numRows)
diff -r fc12a89d17cb -r 084e7ed97059 source/encoder/search.cpp
--- a/source/encoder/search.cpp	Wed Mar 25 16:28:53 2015 +0530
+++ b/source/encoder/search.cpp	Wed Mar 25 16:30:43 2015 +0530
@@ -1897,6 +1897,7 @@
     ScopedElapsedTime pmeTime(master.m_stats[fe].pmeTime);
 #endif
     ProfileScopeEvent(pme);
+    master.m_tld[workerThreadId].analysis.m_param = master.m_param;
     master.processPME(*this, master.m_tld[workerThreadId].analysis);
 }
 


More information about the x265-devel mailing list