<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 21, 2014 at 4:53 PM, <span dir="ltr"><<a href="mailto:deepthi@multicorewareinc.com" target="_blank">deepthi@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># HG changeset patch<br>
# User Deepthi Nandakumar <<a href="mailto:deepthi@multicorewareinc.com">deepthi@multicorewareinc.com</a>><br>
# Date 1392976266 -19800<br>
# Node ID 3275142274c8e424c9a9a57dbc2c70b0707ea996<br>
# Parent 5e2043f89aa11363dffe33a0ff06550a7d862326<br>
ratecontrol: clean up confusing if-checks in calcAdaptiveQuantFrame<br>
<br>
diff -r 5e2043f89aa1 -r 3275142274c8 source/encoder/ratecontrol.cpp<br>
--- a/source/encoder/ratecontrol.cpp Fri Feb 21 03:05:48 2014 -0600<br>
+++ b/source/encoder/ratecontrol.cpp Fri Feb 21 15:21:06 2014 +0530<br>
@@ -105,23 +105,20 @@<br>
int block_xy = 0;<br>
int block_x = 0, block_y = 0;<br>
double strength = 0.f;<br>
- if (cfg->param.rc.aqMode == X265_AQ_NONE || cfg->param.rc.aqStrength == 0)<br>
+<br>
+ if (cfg->param.rc.cuTree && cfg->param.rc.aqStrength == 0) /* CUTree is enabled with zero strength AQ */<br>
{<br></blockquote><div>-- the above change will give wrong results when cutree is 0 and aqStrength = 0. It should still enter this branch in this scenario. </div><div>better way : if (cfg->param.rc.cuTree || cfg->param.rc.aqMode == X265_AQ_NONE)</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
- /* Need to init it anyways for CU tree */<br>
int cuWidth = ((maxCol / 2) + X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS;<br>
int cuHeight = ((maxRow / 2) + X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS;<br>
int cuCount = cuWidth * cuHeight;<br>
-<br>
- if (cfg->param.rc.aqMode && cfg->param.rc.aqStrength == 0)<br>
+<br>
+ memset(pic->m_lowres.qpOffset, 0, cuCount * sizeof(double));<br>
+ memset(pic->m_lowres.qpAqOffset, 0, cuCount * sizeof(double));<br>
+ for (int cuxy = 0; cuxy < cuCount; cuxy++)<br>
{<br>
- memset(pic->m_lowres.qpOffset, 0, cuCount * sizeof(double));<br>
- memset(pic->m_lowres.qpAqOffset, 0, cuCount * sizeof(double));<br>
- for (int cuxy = 0; cuxy < cuCount; cuxy++)<br>
- {<br>
- pic->m_lowres.invQscaleFactor[cuxy] = 256;<br>
- }<br>
+ pic->m_lowres.invQscaleFactor[cuxy] = 256;<br>
}<br>
-<br>
+<br>
/* Need variance data for weighted prediction */<br>
if (cfg->param.bEnableWeightedPred)<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>