<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 17, 2016 at 2:00 PM, Pradeep Ramachandran <span dir="ltr"><<a href="mailto:pradeep@multicorewareinc.com" target="_blank">pradeep@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Pradeep Ramachandran <<a href="mailto:pradeep@multicorewareinc.com">pradeep@multicorewareinc.com</a>><br>
# Date 1476693005 -19800<br>
# Mon Oct 17 14:00:05 2016 +0530<br>
# Node ID 304116f4cd41bc4fd610d5b16c6f44<wbr>7a50b8df02<br>
# Parent c97805dad9148ad3cddba10a67ed55<wbr>96508e8f86<br>
api: Introduce param options to toggle PPS bitstream optimizations<br>
<br>
diff -r c97805dad914 -r 304116f4cd41 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt Thu Oct 13 17:53:48 2016 +0800<br>
+++ b/source/CMakeLists.txt Mon Oct 17 14:00:05 2016 +0530<br>
@@ -30,7 +30,7 @@<br>
mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
<br>
# X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 97)<br>
+set(X265_BUILD 98)<br>
configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265.def.in" rel="noreferrer" target="_blank">x265.def.in</a>"<br>
"${PROJECT_BINARY_DIR}/x265.<wbr>def")<br>
configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265_config.h.in" rel="noreferrer" target="_blank">x265_config.h.in</a>"<br>
diff -r c97805dad914 -r 304116f4cd41 source/common/param.cpp<br>
--- a/source/common/param.cpp Thu Oct 13 17:53:48 2016 +0800<br>
+++ b/source/common/param.cpp Mon Oct 17 14:00:05 2016 +0530<br>
@@ -230,9 +230,6 @@<br>
param->rc.qpMin = 0;<br>
param->rc.qpMax = QP_MAX_MAX;<br>
<br>
- param->bEmitVUITimingInfo = 1;<br>
- param->bEmitVUIHRDInfo = 1;<br>
-<br>
/* Video Usability Information (VUI) */<br>
param->vui.aspectRatioIdc = 0;<br>
param->vui.sarWidth = 0;<br>
@@ -259,6 +256,12 @@<br>
param->maxLuma = PIXEL_MAX;<br>
param->log2MaxPocLsb = 8;<br>
param->maxSlices = 1;<br>
+<br>
+ param->bEmitVUITimingInfo = 1;<br>
+ param->bEmitVUIHRDInfo = 1;<br>
+ param->bOptQpPPS = 1;<br>
+ param->bOptRefListLengthPPS = 1;<br>
+<br>
}<br>
<br>
int x265_param_default_preset(<wbr>x265_param* param, const char* preset, const char* tune)<br>
@@ -910,6 +913,8 @@<br>
OPT("vui-hrd-info") p->bEmitVUIHRDInfo = atobool(value);<br>
OPT("slices") p->maxSlices = atoi(value);<br>
OPT("limit-tu") p->limitTU = atoi(value);<br>
+ OPT("opt-qp-pps") p->bOptQpPPS = atobool(value);<br>
+ OPT("opt-ref-list-length-pps") p->bOptRefListLengthPPS = atobool(value);<br>
else<br>
return X265_PARAM_BAD_NAME;<br>
}<br>
diff -r c97805dad914 -r 304116f4cd41 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Thu Oct 13 17:53:48 2016 +0800<br>
+++ b/source/encoder/encoder.cpp Mon Oct 17 14:00:05 2016 +0530<br>
@@ -874,7 +874,7 @@<br>
slice->m_endCUAddr = slice->realEndAddress(m_sps.<wbr>numCUsInFrame * NUM_4x4_PARTITIONS);<br>
}<br>
<br>
- if( frameEnc->m_lowres.bKeyframe && m_param->bRepeatHeaders )<br>
+ if( m_param->bOptQpPPS && frameEnc->m_lowres.bKeyframe && m_param->bRepeatHeaders )<br></blockquote><div><br></div><div>Lots of whitespace errors in this block, introduced by <span style="font-family:monospace;font-size:9pt">43d4754ea627</span></div><div><span style="font-family:monospace;font-size:9pt"></span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
{<br>
ScopedLock qpLock( m_sliceQpLock );<br>
if( m_iFrameNum > 0 )<br>
diff -r c97805dad914 -r 304116f4cd41 source/encoder/frameencoder.<wbr>cpp<br>
--- a/source/encoder/frameencoder.<wbr>cpp Thu Oct 13 17:53:48 2016 +0800<br>
+++ b/source/encoder/frameencoder.<wbr>cpp Mon Oct 17 14:00:05 2016 +0530<br>
@@ -354,6 +354,7 @@<br>
}<br>
if (m_frame->m_lowres.bKeyframe && m_param->bRepeatHeaders)<br>
{<br>
+ if (m_param-><wbr>bOptRefListLengthPPS)<br>
{<br>
ScopedLock refIdxLock(m_top->m_<wbr>sliceRefIdxLock);<br>
m_top->updateRefIdx();<br>
@@ -467,7 +468,7 @@<br>
/* Clip slice QP to 0-51 spec range before encoding */<br>
slice->m_sliceQp = x265_clip3(-QP_BD_OFFSET, QP_MAX_SPEC, qp);<br>
<br>
- if( m_param->bRepeatHeaders )<br>
+ if( m_param->bOptQpPPS && m_param->bRepeatHeaders )<br></blockquote><div><br></div><div>And here</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
{<br>
ScopedLock qpLock( m_top->m_sliceQpLock );<br>
for( int i = 0; i < (QP_MAX_MAX + 1); i++ )<br>
@@ -861,6 +862,7 @@<br>
const uint32_t sliceAddr = nextSliceRow * m_numCols;<br>
//CUData* ctu = m_frame->m_encData->getPicCTU(<wbr>sliceAddr);<br>
//const int sliceQp = ctu->m_qp[0];<br>
+ if (m_param-><wbr>bOptRefListLengthPPS)<br>
{<br>
ScopedLock refIdxLock(m_top->m_<wbr>sliceRefIdxLock);<br>
m_top->analyseRefIdx(slice->m_<wbr>numRefIdx);<br>
@@ -888,6 +890,7 @@<br>
}<br>
else<br>
{<br>
+ if (m_param-><wbr>bOptRefListLengthPPS)<br>
{<br>
ScopedLock refIdxLock(m_top->m_<wbr>sliceRefIdxLock);<br>
m_top->analyseRefIdx(slice->m_<wbr>numRefIdx);<br>
diff -r c97805dad914 -r 304116f4cd41 source/x265.h<br>
--- a/source/x265.h Thu Oct 13 17:53:48 2016 +0800<br>
+++ b/source/x265.h Mon Oct 17 14:00:05 2016 +0530<br>
@@ -1317,6 +1317,12 @@<br>
/* Maximum count of Slices of picture, the value range is [1, maximum rows] */<br>
unsigned int maxSlices;<br>
<br>
+ /* Optimize QP in PPS based on statistics from prevvious GOP*/<br>
+ int bOptQpPPS;<br>
+<br>
+ /* Opitmize ref list length in PPS based on stats from previous GOP*/<br>
+ int bOptRefListLengthPPS;<br>
+<br>
} x265_param;<br>
<br>
/* x265_param_alloc:<br>
diff -r c97805dad914 -r 304116f4cd41 source/x265cli.h<br>
--- a/source/x265cli.h Thu Oct 13 17:53:48 2016 +0800<br>
+++ b/source/x265cli.h Mon Oct 17 14:00:05 2016 +0530<br>
@@ -213,6 +213,10 @@<br>
{ "no-vui-timing-info", no_argument, NULL, 0 },<br>
{ "vui-hrd-info", no_argument, NULL, 0 },<br>
{ "no-vui-hrd-info", no_argument, NULL, 0 },<br>
+ { "opt-qp-pps", no_argument, NULL, 0 },<br>
+ { "no-opt-qp-pps", no_argument, NULL, 0 },<br>
+ { "opt-ref-list-length-pps", no_argument, NULL, 0 },<br>
+ { "no-opt-ref-list-length-pps", no_argument, NULL, 0 },<br>
{ "no-dither", no_argument, NULL, 0 },<br>
{ "dither", no_argument, NULL, 0 },<br>
{ "no-repeat-headers", no_argument, NULL, 0 },<br>
@@ -452,8 +456,10 @@<br>
H0(" --[no-]aud Emit access unit delimiters at the start of each access unit. Default %s\n", OPT(param-><wbr>bEnableAccessUnitDelimiters));<br>
H1(" --hash <integer> Decoded Picture Hash SEI 0: disabled, 1: MD5, 2: CRC, 3: Checksum. Default %d\n", param->decodedPictureHashSEI);<br>
H0(" --log2-max-poc-lsb <integer> Maximum of the picture order count\n");<br>
- H0(" --[no]-vui-timing-info Discard optional VUI timing information from the bistream. Default %s\n", OPT(param->bEmitVUITimingInfo)<wbr>);<br>
- H0(" --[no]-vui-hrd-info Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bEmitVUIHRDInfo));<br>
+ H0(" --[no-]vui-timing-info Discard optional VUI timing information from the bistream. Default %s\n", OPT(param->bEmitVUITimingInfo)<wbr>);<br>
+ H0(" --[no-]vui-hrd-info Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bEmitVUIHRDInfo));<br>
+ H0(" --[no-]opt-qp-pps Discard optional HRD timing information from the bistream. Default %s\n", OPT(param->bOptQpPPS));<br>
+ H0(" --[no-]opt-ref-list-length-pps Discard optional HRD timing information from the bistream. Default %s\n", OPT(param-><wbr>bOptRefListLengthPPS));<br>
H1("\nReconstructed video options (debugging):\n");<br>
H1("-r/--recon <filename> Reconstructed raw image YUV or Y4M output file name\n");<br>
H1(" --recon-depth <integer> Bit-depth of reconstructed raw image file. Defaults to input bit depth, or 8 if Y4M\n");<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><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Deepthi</div>
</div></div>