<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><P># HG changeset patch<BR># User Min Chen <<A href="mailto:chenm003@163.com">chenm003@163.com</A>><BR># Date 1379423463 -28800<BR># Node ID c5c645aa14bfdbf482186730c59a000fdae10e07<BR># Parent  0d33ff236f68bc2238138a7213301b2efc0e6426<BR>Resolve some patching issues for previous patch</P>
<P>1. Added code that missed in last patch.<BR>2. check task is really ready, to be avoid deadlock when a low<BR>   id task enter ready queue but do not get enable signal.<BR>   ex: m_enableBitmap(0x1555) and m_queuedBitmap(0x0600)</P>
<P>diff -r 0d33ff236f68 -r c5c645aa14bf source/common/wavefront.cpp<BR>--- a/source/common/wavefront.cpp Mon Sep 16 21:06:49 2013 +0800<BR>+++ b/source/common/wavefront.cpp Tue Sep 17 21:11:03 2013 +0800<BR>@@ -118,16 +118,10 @@<BR>         while (m_queuedBitmap[w])<BR>         {<BR>             uint64_t oldval = m_queuedBitmap[w];<BR>-            if (oldval == 0) // race condition<BR>+            if (!(oldval & m_enableBitmap[w]))<BR>                 break;<BR> <BR>-            CTZ64(id, oldval);<BR>-<BR>-            // NOTE: if the
  lowest row is unavailable, so we don't check higher row<BR>-            if (!(m_enableBitmap[w] & (1LL << id)))<BR>-            {<BR>-                return false;<BR>-            }<BR>+            CTZ64(id, mask);<BR> <BR>             uint64_t newval = oldval & ~(1LL << id);<BR>             if (ATOMIC_CAS(&m_queuedBitmap[w], oldval, newval) == oldval)<BR>diff -r 0d33ff236f68 -r c5c645aa14bf source/encoder/frameencoder.cpp<BR>--- a/source/encoder/frameencoder.cpp Mon Sep 16 21:06:49 2013 +0800<BR>+++ b/source/encoder/frameencoder.cpp Tu
 e Sep 17 21:11:03 2013 +0800<BR>@@ -952,7 +952,7 @@<BR>                 m_rows[row + 1].m_completed + 2 <= m_rows[row].m_completed)<BR>             {<BR>                 m_rows[row + 1].m_active = true;<BR>-                WaveFront::enqueueRow(row + 1);<BR>+                enqueueRowEncoder(row + 1);<BR>             }<BR>         }<BR> <BR>@@ -968,13 +968,16 @@<BR>     // Run row-wise loop filters<BR>     if (row >= m_filterRowDelay)<BR>     {<BR>-&nb
 sp;       m_frameFilter.processRow(row - m_filterRowDelay);<BR>+        enableRowFilter(row - m_filterRowDelay);<BR>+<BR>+        // NOTE: Active Filter to first row (row 0)<BR>+        if (row == m_filterRowDelay)<BR>+            enqueueRowFilter(0);<BR>     }<BR>     if (row == m_numRows - 1)<BR>     {<BR>         for(int i = m_numRows - m_filterRowDelay; i < m_numRows; i++)<BR>-            m_frameFilter.processRow(i);<BR>-        m_completionEvent.trigger();<BR>+            enableRowFilter(i);<BR>     }<BR> }<BR> <BR>dif
 f -r 0d33ff236f68 -r c5c645aa14bf source/encoder/frameencoder.h<BR>--- a/source/encoder/frameencoder.h Mon Sep 16 21:06:49 2013 +0800<BR>+++ b/source/encoder/frameencoder.h Tue Sep 17 21:11:03 2013 +0800<BR>@@ -107,7 +107,7 @@<BR> <BR>             // NOTE: Active next row<BR>             if (realRow != m_numRows - 1)<BR>-                enableRowFilter(realRow + 1);<BR>+                enqueueRowFilter(realRow + 1);<BR>             else<BR>                 m_completionEvent.trigger();<BR>         }<BR></P>
<DIV></DIV></div>