<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 9, 2015 at 11:36 PM, Min Chen <span dir="ltr"><<a href="mailto:chenm003@163.com" target="_blank">chenm003@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Min Chen <<a href="mailto:chenm003@163.com">chenm003@163.com</a>><br>
# Date 1433872873 25200<br>
# Node ID 04c9567aa2bb7b549cd6a3514a1ef29d64724638<br>
# Parent d82b6f9e08e39b784ba8240e1843b9d6371dcee4<br>
reduce memory access to absCoeff[firstC2FlagIdx]<br>
---<br>
source/encoder/entropy.cpp | 22 +++++++++++-----------<br>
1 files changed, 11 insertions(+), 11 deletions(-)<br>
<br>
diff -r d82b6f9e08e3 -r 04c9567aa2bb source/encoder/entropy.cpp<br>
--- a/source/encoder/entropy.cpp Tue Jun 09 11:01:08 2015 -0700<br>
+++ b/source/encoder/entropy.cpp Tue Jun 09 11:01:13 2015 -0700<br>
@@ -1699,28 +1699,29 @@<br>
uint8_t *baseCtxMod = bIsLuma ? &m_contextState[OFF_ONE_FLAG_CTX + 4 * ctxSet] : &m_contextState[OFF_ONE_FLAG_CTX + NUM_ONE_FLAG_CTX_LUMA + 4 * ctxSet];<br>
<br>
uint32_t numC1Flag = X265_MIN(numNonZero, C1FLAG_NUMBER);<br>
- int firstC2FlagIdx = -1;<br>
+ int firstC2Flag = -1;<br>
<br>
X265_CHECK(numC1Flag > 0, "numC1Flag check failure\n");<br>
idx = 0;<br>
do<br>
{<br>
- uint32_t symbol = absCoeff[idx] > 1;<br>
- encodeBin(symbol, baseCtxMod[c1]);<br>
+ uint32_t symbol1 = absCoeff[idx] > 1;<br>
+ uint32_t symbol2 = absCoeff[idx] > 2;<br>
+ encodeBin(symbol1, baseCtxMod[c1]);<br>
<br>
// TODO: VC can't work fine on below style, but ICL can generate branch free code<br>
#ifdef __INTEL_COMPILER<br>
if (symbol)<br>
c1 = 0;<br>
<br>
- if ((firstC2FlagIdx < 0) & symbol)<br>
- firstC2FlagIdx = (int)idx;<br>
+ if ((firstC2Flag < 0) & symbol)<br>
+ firstC2Flag = (int)symbol2;<br></blockquote><div><br></div><div>This will not compile with icpc. <br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
#else<br>
- if (symbol)<br>
+ if (symbol1)<br>
{<br>
c1 = 0;<br>
- if (firstC2FlagIdx < 0)<br>
- firstC2FlagIdx = (int)idx;<br>
+ if (firstC2Flag < 0)<br>
+ firstC2Flag = (int)symbol2;<br>
}<br>
#endif<br>
c1 += ((c1 >> 1) ^ c1) & 1;<br>
@@ -1733,9 +1734,8 @@<br>
{<br>
baseCtxMod = bIsLuma ? &m_contextState[OFF_ABS_FLAG_CTX + ctxSet] : &m_contextState[OFF_ABS_FLAG_CTX + NUM_ABS_FLAG_CTX_LUMA + ctxSet];<br>
<br>
- X265_CHECK((firstC2FlagIdx != -1), "firstC2FlagIdx check failure\n");<br>
- uint32_t symbol = absCoeff[firstC2FlagIdx] > 2;<br>
- encodeBin(symbol, baseCtxMod[0]);<br>
+ X265_CHECK((firstC2Flag != -1), "firstC2FlagIdx check failure\n");<br>
+ encodeBin(firstC2Flag, baseCtxMod[0]);<br>
}<br>
<br>
const int hiddenShift = (bHideFirstSign && signHidden) ? 1 : 0;<br>
<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>