<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 11, 2018 at 7:54 PM, <span dir="ltr"><<a href="mailto:aruna@multicorewareinc.com" target="_blank">aruna@multicorewareinc.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 Aruna Matheswaran <<a href="mailto:aruna@multicorewareinc.com">aruna@multicorewareinc.com</a>><br>
# Date 1530254734 -19800<br>
# Fri Jun 29 12:15:34 2018 +0530<br>
# Node ID be4894f073613c44279e0972f0fca7<wbr>f7b996895e<br>
# Parent 0106f9f2f867ee20893a317e98c60e<wbr>9ca626e7d2<br>
multi-pass-opt-distortion: Apply QP offsets even when aq-mode is disabled<br>
<br>
Currently, QP offsets from multi-pass-opt-distortion will not get applied on<br>
baseQP when aq-mode is disabled. This patch enables distortion QP offsets to be<br>
applied even when aq-mode is set to 0 and hence this will be an output changing<br>
commit.<br>
<br>
diff -r 0106f9f2f867 -r be4894f07361 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Mon Apr 23 14:16:54 2018 +0530<br>
+++ b/source/encoder/encoder.cpp Fri Jun 29 12:15:34 2018 +0530<br>
@@ -2522,6 +2522,7 @@<br>
void Encoder::initPPS(PPS *pps)<br>
{<br>
bool bIsVbv = m_param->rc.vbvBufferSize > 0 && m_param->rc.vbvMaxBitrate > 0;<br>
+ bool bEnableDistOffset = m_param-><wbr>analysisMultiPassDistortion && m_param->rc.bStatRead;<br>
<br>
if (!m_param->bLossless && (m_param->rc.aqMode || bIsVbv || m_param->bAQMotion))<br>
{<br>
@@ -2529,6 +2530,11 @@<br>
pps->maxCuDQPDepth = g_log2Size[m_param->maxCUSize] - g_log2Size[m_param->rc.qgSize]<wbr>;<br>
X265_CHECK(pps->maxCuDQPDepth <= 3, "max CU DQP depth cannot be greater than 3\n");<br>
}<br>
+ else if (!m_param->bLossless && bEnableDistOffset)<br>
+ {<br>
+ pps->bUseDQP = true;<br>
+ pps->maxCuDQPDepth = 0;<br>
+ }<br>
else<br>
{<br>
pps->bUseDQP = false;<br>
diff -r 0106f9f2f867 -r be4894f07361 source/encoder/ratecontrol.cpp<br>
--- a/source/encoder/ratecontrol.<wbr>cpp Mon Apr 23 14:16:54 2018 +0530<br>
+++ b/source/encoder/ratecontrol.<wbr>cpp Fri Jun 29 12:15:34 2018 +0530<br>
@@ -2640,8 +2640,9 @@<br>
FrameData& curEncData = *curFrame->m_encData;<br>
int64_t actualBits = bits;<br>
Slice *slice = curEncData.m_slice;<br>
+ bool bEnableDistOffset = m_param-><wbr>analysisMultiPassDistortion && m_param->rc.bStatRead;<br>
<br>
- if (m_param->rc.aqMode || m_isVbv || m_param->bAQMotion)<br>
+ if (m_param->rc.aqMode || m_isVbv || m_param->bAQMotion || bEnableDistOffset)<br>
{<br>
if (m_isVbv && !(m_2pass && m_param->rc.rateControlMode == X265_RC_CRF))<br>
{<br>
@@ -2655,10 +2656,10 @@<br>
rce->qpaRc = curEncData.m_avgQpRc;<br>
}<br>
<br>
- if (m_param->rc.aqMode || m_param->bAQMotion)<br>
+ if (m_param->rc.aqMode || m_param->bAQMotion || bEnableDistOffset)<br>
{<br>
double avgQpAq = 0;<br>
- /* determine actual avg encoded QP, after AQ/cutree adjustments */<br>
+ /* determine actual avg encoded QP, after AQ/cutree/distortion adjustments */<br>
for (uint32_t i = 0; i < slice->m_sps->numCuInHeight; i++)<br>
avgQpAq += curEncData.m_rowStat[i].<wbr>sumQpAq;<br>
<br>
<br>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
<br></blockquote></div><br></div><div class="gmail_extra">Pushed.</div></div>