<div dir="ltr"><div>This is an error introduced when we moved calcAdaptiveQuantFrame from ratecontrol to slicetype. ncu in ratecontrol signifies actual number of 16x16 blocks, whereas ncu in slicetype leaves out the border blocks (I think?)<br><br></div>slicetype.cpp:481 (m_ncu = m_widthInCU > 2 && m_heightInCU > 2 ? (m_widthInCU - 2) * (m_heightInCU - 2) : m_widthInCU * m_heightInCU;)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 6, 2015 at 8:38 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"><span class="">On 03/06, <a href="mailto:sreelakshmy@multicorewareinc.com">sreelakshmy@multicorewareinc.com</a> wrote:<br>
> # HG changeset patch<br>
> # User Sreelakshmy V G <<a href="mailto:sreelakshmy@multicorewareinc.com">sreelakshmy@multicorewareinc.com</a>><br>
> # Date 1425636287 -19800<br>
> #      Fri Mar 06 15:34:47 2015 +0530<br>
> # Node ID 99edf8d0064295633a7c52536600f5b55b9fd060<br>
> # Parent  45deb0125890ab0211d0e256c74d91ede78d12d3<br>
> slicetype: change the total CU value for averaging of qp_adj<br>
<br>
</span>I need an explanation why, in the commit message<br>
<span class=""><br>
> diff -r 45deb0125890 -r 99edf8d00642 source/encoder/slicetype.cpp<br>
> --- a/source/encoder/slicetype.cpp    Thu Mar 05 20:39:08 2015 -0600<br>
> +++ b/source/encoder/slicetype.cpp    Fri Mar 06 15:34:47 2015 +0530<br>
> @@ -106,6 +106,11 @@<br>
>      int maxCol = curFrame->m_fencPic->m_picWidth;<br>
>      int maxRow = curFrame->m_fencPic->m_picHeight;<br>
><br>
> +    int lowresCuWidth = ((param->sourceWidth / 2) + X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS;<br>
> +    int lowresCuHeight = ((param->sourceHeight / 2) + X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS;<br>
> +    int totalBlocks = lowresCuWidth * lowresCuHeight;<br>
> +<br>
> +<br>
<br>
</span>too many blank lines here<br>
<span class="im HOEnZb"><br>
>      for (int y = 0; y < 3; y++)<br>
>      {<br>
>          curFrame->m_lowres.wp_ssd[y] = 0;<br>
> @@ -141,6 +146,7 @@<br>
>      {<br>
>          blockXY = 0;<br>
>          double avg_adj_pow2 = 0, avg_adj = 0, qp_adj = 0;<br>
> +<br>
>          if (param->rc.aqMode == X265_AQ_AUTO_VARIANCE)<br>
>          {<br>
>              double bit_depth_correction = pow(1 << (X265_DEPTH - 8), 0.5);<br>
> @@ -157,8 +163,8 @@<br>
>                  }<br>
>              }<br>
><br>
> -            avg_adj /= ncu;<br>
> -            avg_adj_pow2 /= ncu;<br>
> +            avg_adj /= totalBlocks;<br>
> +            avg_adj_pow2 /= totalBlocks;<br>
>              strength = param->rc.aqStrength * avg_adj / bit_depth_correction;<br>
>              avg_adj = avg_adj - 0.5f * (avg_adj_pow2 - (11.f * bit_depth_correction)) / avg_adj;<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>
<br>
</span><span class="HOEnZb"><font color="#888888">--<br>
Steve Borho<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br></div>