<div dir="ltr"><div># HG changeset patch</div><div># User Deepthi Nandakumar <<a href="mailto:deepthi@multicorewareinc.com">deepthi@multicorewareinc.com</a>></div><div># Date 1458293588 -19800</div><div># Fri Mar 18 15:03:08 2016 +0530</div><div># Node ID f60818c73f3b2c8c42d987c6d25d9c73ef6bc089</div><div># Parent 63748dea60675d5a029ca0b1b8a92de2aaad94b0</div><div>param: prevent race conditions in initialising global tables (refs #247)</div><div><br></div><div>Reset param if different encoder instances have different CU sizes.</div><div><br></div><div>diff -r 63748dea6067 -r f60818c73f3b source/common/param.cpp</div><div>--- a/source/common/param.cpp<span class="" style="white-space:pre"> </span>Thu Mar 17 13:01:37 2016 +0530</div><div>+++ b/source/common/param.cpp<span class="" style="white-space:pre"> </span>Fri Mar 18 15:03:08 2016 +0530</div><div>@@ -1225,18 +1225,21 @@</div><div> uint32_t maxLog2CUSize = (uint32_t)g_log2Size[param->maxCUSize];</div><div> uint32_t minLog2CUSize = (uint32_t)g_log2Size[param->minCUSize];</div><div> </div><div>- if (ATOMIC_INC(&g_ctuSizeConfigured) > 1)</div><div>+ Lock gLock;</div><div>+ ScopedLock sLock(gLock);</div><div>+</div><div>+ if (++g_ctuSizeConfigured > 1)</div><div> {</div><div> if (g_maxCUSize != param->maxCUSize)</div><div> {</div><div>- x265_log(param, X265_LOG_ERROR, "maxCUSize must be the same for all encoders in a single process");</div><div>- return -1;</div><div>+ x265_log(param, X265_LOG_WARNING, "maxCUSize must be the same for all encoders in a single process");</div><div> }</div><div> if (g_maxCUDepth != maxLog2CUSize - minLog2CUSize)</div><div> {</div><div>- x265_log(param, X265_LOG_ERROR, "maxCUDepth must be the same for all encoders in a single process");</div><div>- return -1;</div><div>+ x265_log(param, X265_LOG_WARNING, "maxCUDepth must be the same for all encoders in a single process");</div><div> }</div><div>+ param->maxCUSize = g_maxCUSize;</div><div>+ return x265_check_params(param); /* Check again, since param may have changed */</div><div> }</div><div> else</div><div> {</div><div><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div>Deepthi Nandakumar<br></div>Engineering Manager, x265<br></div>Multicoreware, Inc<br></div></div>
</div>