changeset 11904:702fe36ec3be

wait for the event of copying MV data if refine-mv-type is enabled
author Santhoshini Sekar <santhoshini@multicorewareinc.com>
date Wed, 09 Aug 2017 16:02:20 +0530
parents e98cb4ce88b5
children b0221bf913c3
files source/common/frame.h source/encoder/frameencoder.cpp
diffstat 2 files changed, 7 insertions(+-), 0 deletions(-) [+]
line wrap: on
line diff
--- a/source/common/frame.h	Mon Nov 06 13:52:22 2017 +0530
+++ b/source/common/frame.h	Wed Aug 09 16:02:20 2017 +0530
@@ -113,6 +113,8 @@ public:
     x265_analysis_2Pass    m_analysis2Pass;
     RcStats*               m_rcData;
 
+    Event                  m_copyMVType;
+
     x265_ctu_info_t**      m_ctuInfo;
     Event                  m_copied;
     int*                   m_prevCtuInfoChange;
--- a/source/encoder/frameencoder.cpp	Mon Nov 06 13:52:22 2017 +0530
+++ b/source/encoder/frameencoder.cpp	Wed Aug 09 16:02:20 2017 +0530
@@ -335,6 +335,11 @@ void FrameEncoder::threadMain()
             while (!m_frame->m_ctuInfo)
                 m_frame->m_copied.wait();
         }
+        if ((m_param->bMVType == AVC_INFO) && !m_param->analysisReuseMode && !(IS_X265_TYPE_I(m_frame->m_lowres.sliceType)))
+        {
+            while (((m_frame->m_analysisData.interData == NULL && m_frame->m_analysisData.intraData == NULL) || (uint32_t)m_frame->m_poc != m_frame->m_analysisData.poc))
+                m_frame->m_copyMVType.wait();
+        }
         compressFrame();
         m_done.trigger(); /* FrameEncoder::getEncodedPicture() blocks for this event */
         if (m_frame != NULL)