[x265] [PATCH 1 of 2] wait until the last row of recon is complete. Waiting on m_reconEncoded doesn't

santhoshini at multicorewareinc.com santhoshini at multicorewareinc.com
Mon Dec 4 12:00:41 CET 2017


# HG changeset patch
# User Santhoshini Sekar <santhoshini at multicorewareinc.com>
# Date 1512383899 -19800
#      Mon Dec 04 16:08:19 2017 +0530
# Node ID ee9a82d856a5f726bbca9380c3539e70a8ab8913
# Parent  c353f34a532c16b0db02fbba7b928b71e9300996
wait until the last row of recon is complete. Waiting on m_reconEncoded doesn't
ensure full recon generation.

diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp
+++ b/source/encoder/encoder.cpp
@@ -463,8 +463,8 @@
                 {
                     int l0POC = framePtr->m_encData->m_slice->m_refFrameList[0][j]->m_poc;
                     Frame* l0Fp = m_dpb->m_picList.getPOC(l0POC);
-                    if (l0Fp->m_reconPic->m_picOrg[0] == NULL)
-                        l0Fp->m_reconEncoded.wait(); /* If recon is not ready, current frame encoder need to wait. */
+                    while (l0Fp->m_reconRowFlag[l0Fp->m_numRows - 1].get() == 0)
+                        l0Fp->m_reconRowFlag[l0Fp->m_numRows - 1].waitForChange(0); /* If recon is not ready, current frame encoder has to wait. */
                     l0[j] = l0Fp->m_reconPic;
                 }
             }
@@ -474,8 +474,8 @@
                 {
                     int l1POC = framePtr->m_encData->m_slice->m_refFrameList[1][j]->m_poc;
                     Frame* l1Fp = m_dpb->m_picList.getPOC(l1POC);
-                    if (l1Fp->m_reconPic->m_picOrg[0] == NULL)
-                        l1Fp->m_reconEncoded.wait(); /* If recon is not ready, current frame encoder need to wait. */
+                    while (l1Fp->m_reconRowFlag[l1Fp->m_numRows - 1].get() == 0)
+                        l1Fp->m_reconRowFlag[l1Fp->m_numRows - 1].waitForChange(0); /* If recon is not ready, current frame encoder has to wait. */
                     l1[j] = l1Fp->m_reconPic;
                 }
             }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265-1.patch
Type: text/x-patch
Size: 1878 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20171204/70b1229b/attachment.bin>


More information about the x265-devel mailing list