<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 11:45 PM, Steve Borho <span dir="ltr"><<a href="mailto:steve@borho.org" target="_blank">steve@borho.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Mon, Jun 30, 2014 at 11:38 AM,  <<a href="mailto:aarthi@multicorewareinc.com" target="_blank">aarthi@multicorewareinc.com</a>> wrote:<br>


> # HG changeset patch<br>
> # User Aarthi Thirumalai<br>
> # Date 1403785166 -19800<br>
> #      Thu Jun 26 17:49:26 2014 +0530<br>
> # Node ID 2dd5aded9e192783dfc8f8307a05e3b2a55b7f1d<br>
> # Parent  bab912d0834914e8947a126e6b0ec4dbc75d7843<br>
> rc: compute inter, intra and skip cus per frame for the first pass<br>
><br>
> diff -r bab912d08349 -r 2dd5aded9e19 source/Lib/TLibEncoder/TEncCu.cpp<br>
> --- a/source/Lib/TLibEncoder/TEncCu.cpp Wed Jun 25 22:49:38 2014 +0530<br>
> +++ b/source/Lib/TLibEncoder/TEncCu.cpp Thu Jun 26 17:49:26 2014 +0530<br>
> @@ -341,6 +341,7 @@<br>
>              do<br>
>              {<br>
>                  m_log->totalCu++;<br>
> +                m_log->rowIntraCuCnt++;<br>
>                  part = cu->getDepth(i);<br>
>                  int next = numPartition >> (part * 2);<br>
>                  if (part == g_maxCUDepth - 1 && cu->getPartitionSize(i) != SIZE_2Nx2N)<br>
> @@ -383,6 +384,7 @@<br>
>                  if (cu->isSkipped(i))<br>
>                  {<br>
>                      m_log->cntSkipCu[part]++;<br>
> +                    m_log->rowSkipCuCnt++;<br>
<br>
</div>I suspect there's an impedance mismatch here between AVC and HEVC.<br>
For x264 these inter/intra/skip decisions are for the whole MB, but<br>
for us these decisions are made at each CU at every level of the<br>
quad-tree.<br></blockquote><div><br></div><div>yea, you are right, I missed that. we need to compute the inter,intra and skip cus of the frame in terms of the number of 16x16 blocks to be used for the 2nd pass.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<br>
We can keep such statistics but they would need to be weighted per<br>
depth - perhaps multiplied by the number of pixels in the coding unit<br>
so that at the end of the frame you know what percentages of the frame<br>
were inter, intra, or merge coded.<br>
<div><div><br>
>                  }<br>
>                  else<br>
>                  {<br>
> @@ -390,6 +392,7 @@<br>
>                      if (cu->getPredictionMode(0) == MODE_INTER)<br>
>                      {<br>
>                          m_log->cntInter[part]++;<br>
> +                        m_log->rowInterCuCnt++;<br>
>                          if (cu->getPartitionSize(0) < AMP_ID)<br>
>                              m_log->cuInterDistribution[part][cu->getPartitionSize(0)]++;<br>
>                          else<br>
> @@ -397,6 +400,7 @@<br>
>                      }<br>
>                      else if (cu->getPredictionMode(0) == MODE_INTRA)<br>
>                      {<br>
> +                        m_log->rowIntraCuCnt++;<br>
>                          if (part == g_maxCUDepth - 1 && cu->getPartitionSize(0) == SIZE_NxN)<br>
>                          {<br>
>                              m_log->cntIntraNxN++;<br>
> diff -r bab912d08349 -r 2dd5aded9e19 source/Lib/TLibEncoder/TEncCu.h<br>
> --- a/source/Lib/TLibEncoder/TEncCu.h   Wed Jun 25 22:49:38 2014 +0530<br>
> +++ b/source/Lib/TLibEncoder/TEncCu.h   Thu Jun 26 17:49:26 2014 +0530<br>
> @@ -65,7 +65,9 @@<br>
>      uint64_t cntSkipCu[4];<br>
>      uint64_t cntTotalCu[4];<br>
>      uint64_t totalCu;<br>
> -<br>
> +    uint32_t rowInterCuCnt;<br>
> +    uint32_t rowIntraCuCnt;<br>
> +    uint32_t rowSkipCuCnt;<br>
>      StatisticLog()<br>
>      {<br>
>          memset(this, 0, sizeof(StatisticLog));<br>
> diff -r bab912d08349 -r 2dd5aded9e19 source/encoder/frameencoder.cpp<br>
> --- a/source/encoder/frameencoder.cpp   Wed Jun 25 22:49:38 2014 +0530<br>
> +++ b/source/encoder/frameencoder.cpp   Thu Jun 26 17:49:26 2014 +0530<br>
> @@ -1037,6 +1037,14 @@<br>
>              enableRowFilter(i);<br>
>          }<br>
>      }<br>
> +<br>
> +    // copy no. of intra, inter Cu cnt per row into frame stats<br>
> +    m_frame->m_stats.cuCount_i += tld.m_cuCoder.m_log->rowIntraCuCnt;<br>
> +    m_frame->m_stats.cuCount_p += tld.m_cuCoder.m_log->rowInterCuCnt;<br>
> +    m_frame->m_stats.cuCount_skip += tld.m_cuCoder.m_log->rowSkipCuCnt;<br>
> +    //clear the row cu data from thread local object<br>
> +    tld.m_cuCoder.m_log->rowIntraCuCnt = tld.m_cuCoder.m_log->rowInterCuCnt = tld.m_cuCoder.m_log->rowSkipCuCnt = 0;<br>
> +<br>
>      m_totalTime += x265_mdate() - startTime;<br>
>      curRow.m_busy = false;<br>
>  }<br>
</div></div>> _______________________________________________<br>
> x265-devel mailing list<br>
> <a href="mailto:x265-devel@videolan.org" target="_blank">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>
<span><font color="#888888"><br>
<br>
<br>
--<br>
Steve Borho<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">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>
</font></span></blockquote></div><br></div></div>