<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 3:41 PM, <span dir="ltr"><<a href="mailto:aarthi@multicorewareinc.com" target="_blank">aarthi@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 Aarthi Thirumalai <<a href="mailto:aarthi@multicorewareinc.com">aarthi@multicorewareinc.com</a>><br>
# Date 1520503694 -19800<br>
# Thu Mar 08 15:38:14 2018 +0530<br>
# Node ID b7c8bfabc808a933cf6bdcef63bf49<wbr>c8177851a6<br>
# Parent 613d9f443769767fb99299a524ad00<wbr>55f9237ce3<br>
insert SEIRecoveryPoint at IDR frames when --idr-recovery-sei is set<br>
<br>
diff -r 613d9f443769 -r b7c8bfabc808 doc/reST/cli.rst<br>
--- a/doc/reST/cli.rst Mon Mar 05 15:14:34 2018 +0530<br>
+++ b/doc/reST/cli.rst Thu Mar 08 15:38:14 2018 +0530<br>
@@ -2212,6 +2212,9 @@<br>
<br>
Only effective at RD levels 5 and 6<br>
<br>
+.. option:: --idr-recovery-sei, --no-idr-recoveery-sei<br>
+ Emit RecoveryPoint info as sei in bitstream for each IDR frame. Default disabled.<br>
+<br>
DCT Approximations<br>
=================<br>
<br>
diff -r 613d9f443769 -r b7c8bfabc808 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt Mon Mar 05 15:14:34 2018 +0530<br>
+++ b/source/CMakeLists.txt Thu Mar 08 15:38:14 2018 +0530<br>
@@ -29,7 +29,7 @@<br>
option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)<br>
mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
# X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 154)<br>
+set(X265_BUILD 155)<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 613d9f443769 -r b7c8bfabc808 source/common/param.cpp<br>
--- a/source/common/param.cpp Mon Mar 05 15:14:34 2018 +0530<br>
+++ b/source/common/param.cpp Thu Mar 08 15:38:14 2018 +0530<br>
@@ -133,7 +133,7 @@<br>
param->bEmitHRDSEI = 0;<br>
param->bEmitInfoSEI = 1;<br>
param->bEmitHDRSEI = 0;<br>
-<br>
+ param->bEmitIDRRecoverySEI = 0;<br>
/* CU definitions */<br>
param->maxCUSize = 64;<br>
param->minCUSize = 8;<br>
@@ -982,6 +982,7 @@<br>
OPT("limit-sao") p->bLimitSAO = atobool(value);<br>
OPT("dhdr10-info") p->toneMapFile = strdup(value);<br>
OPT("dhdr10-opt") p->bDhdr10opt = atobool(value);<br>
+ OPT("idr-recovery-sei") p->bEmitIDRRecoverySEI = atobool(value);<br>
OPT("const-vbv") p->rc.bEnableConstVbv = atobool(value);<br>
OPT("ctu-info") p->bCTUInfo = atoi(value);<br>
OPT("scale-factor") p->scaleFactor = atoi(value);<br>
@@ -1730,6 +1731,7 @@<br>
BOOL(p->bEmitHDRSEI, "hdr");<br>
BOOL(p->bHDROpt, "hdr-opt");<br>
BOOL(p->bDhdr10opt, "dhdr10-opt");<br>
+ BOOL(p->bEmitIDRRecoverySEI, "idr-recovery-sei");<br>
if (p->analysisSave)<br>
s += sprintf(s, " analysis-save");<br>
if (p->analysisLoad)<br>
diff -r 613d9f443769 -r b7c8bfabc808 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Mon Mar 05 15:14:34 2018 +0530<br>
+++ b/source/encoder/encoder.cpp Thu Mar 08 15:38:14 2018 +0530<br>
@@ -2268,7 +2268,7 @@<br>
list.serialize(NAL_UNIT_SPS, bs);<br>
<br>
bs.resetBits();<br>
- sbacCoder.codePPS( m_pps, (m_param->maxSlices <= 1), m_iPPSQpMinus26);<br>
+ sbacCoder.codePPS(m_pps, (m_param->maxSlices <= 1), m_iPPSQpMinus26);<br>
bs.writeByteAlignment();<br>
list.serialize(NAL_UNIT_PPS, bs);<br>
<br>
@@ -2303,14 +2303,14 @@<br>
if (opts)<br>
{<br>
char *buffer = X265_MALLOC(char, strlen(opts) + strlen(PFX(version_str)) +<br>
- strlen(PFX(build_info_str)) + 200);<br>
+ strlen(PFX(build_info_str)) + 200);<br>
if (buffer)<br>
{<br>
sprintf(buffer, "x265 (build %d) - %s:%s - H.265/HEVC codec - "<br>
- "Copyright 2013-2018 (c) Multicoreware, Inc - "<br>
- "<a href="http://x265.org" rel="noreferrer" target="_blank">http://x265.org</a> - options: %s",<br>
- X265_BUILD, PFX(version_str), PFX(build_info_str), opts);<br>
-<br>
+ "Copyright 2013-2018 (c) Multicoreware, Inc - "<br>
+ "<a href="http://x265.org" rel="noreferrer" target="_blank">http://x265.org</a> - options: %s",<br>
+ X265_BUILD, PFX(version_str), PFX(build_info_str), opts);<br>
+<br>
bs.resetBits();<br>
SEIuserDataUnregistered idsei;<br>
idsei.m_userData = (uint8_t*)buffer;<br>
diff -r 613d9f443769 -r b7c8bfabc808 source/encoder/frameencoder.<wbr>cpp<br>
--- a/source/encoder/frameencoder.<wbr>cpp Mon Mar 05 15:14:34 2018 +0530<br>
+++ b/source/encoder/frameencoder.<wbr>cpp Thu Mar 08 15:38:14 2018 +0530<br>
@@ -594,7 +594,6 @@<br>
<br>
/* reset entropy coders and compute slice id */<br>
m_entropyCoder.load(m_<wbr>initSliceContext);<br>
-<br>
for (uint32_t sliceId = 0; sliceId < m_param->maxSlices; sliceId++)<br>
for (uint32_t row = m_sliceBaseRow[sliceId]; row < m_sliceBaseRow[sliceId + 1]; row++)<br>
m_rows[row].init(m_<wbr>initSliceContext, sliceId);<br>
@@ -644,6 +643,19 @@<br>
<br>
m_top->m_lastBPSEI = m_rce.encodeOrder;<br>
}<br>
+<br>
+ if (m_frame->m_lowres.sliceType == X265_TYPE_IDR && m_param->bEmitIDRRecoverySEI)<br>
+ {<br>
+ /* Recovery Point SEI require the SPS to be "activated" */<br>
+ SEIRecoveryPoint sei;<br>
+ sei.m_recoveryPocCnt = 0;<br>
+ sei.m_exactMatchingFlag = true;<br>
+ sei.m_brokenLinkFlag = false;<br>
+ m_bs.resetBits();<br>
+ sei.write(m_bs, *slice->m_sps);<br>
+ m_bs.writeByteAlignment();<br>
+ m_nalList.serialize(NAL_UNIT_<wbr>PREFIX_SEI, m_bs);<br>
+ }<br>
}<br>
<br>
if ((m_param->bEmitHRDSEI || !!m_param->interlaceMode))<br>
diff -r 613d9f443769 -r b7c8bfabc808 source/encoder/sei.h<br>
--- a/source/encoder/sei.h Mon Mar 05 15:14:34 2018 +0530<br>
+++ b/source/encoder/sei.h Thu Mar 08 15:38:14 2018 +0530<br>
@@ -253,6 +253,11 @@<br>
class SEIRecoveryPoint : public SEI<br>
{<br>
public:<br>
+ SEIRecoveryPoint()<br>
+ {<br>
+ m_payloadType = RECOVERY_POINT;<br>
+ m_payloadSize = 0;<br>
+ }<br>
int m_recoveryPocCnt;<br>
bool m_exactMatchingFlag;<br>
bool m_brokenLinkFlag;<br>
diff -r 613d9f443769 -r b7c8bfabc808 source/x265.h<br>
--- a/source/x265.h Mon Mar 05 15:14:34 2018 +0530<br>
+++ b/source/x265.h Thu Mar 08 15:38:14 2018 +0530<br>
@@ -1557,6 +1557,11 @@<br>
* It represents the percentage of maximum AU size used.<br>
* Default is 1 (which is 100%). Range is 0.5 to 1. */<br>
double maxAUSizeFactor;<br>
+<br>
+ /* Enables the emission of a Recovery Point SEI with the stream headers<br>
+ * at each IDR frame describing poc of the recovery point, exact matching flag<br>
+ * and broken link flag. Default is disabled. */<br>
+ int bEmitIDRRecoverySEI;<br>
} x265_param;<br>
<br>
/* x265_param_alloc:<br>
diff -r 613d9f443769 -r b7c8bfabc808 source/x265cli.h<br>
--- a/source/x265cli.h Mon Mar 05 15:14:34 2018 +0530<br>
+++ b/source/x265cli.h Thu Mar 08 15:38:14 2018 +0530<br>
@@ -294,6 +294,8 @@<br>
{ "copy-pic", no_argument, NULL, 0 },<br>
{ "no-copy-pic", no_argument, NULL, 0 },<br>
{ "max-ausize-factor", required_argument, NULL, 0 },<br>
+ { "idr-recovery-sei", no_argument, NULL, 0 },<br>
+ { "no-idr-recovery-sei", no_argument, NULL, 0 },<br>
{ 0, 0, 0, 0 },<br>
{ 0, 0, 0, 0 },<br>
{ 0, 0, 0, 0 },<br>
@@ -552,6 +554,7 @@<br>
H0(" --[no-]repeat-headers Emit SPS and PPS headers at each keyframe. Default %s\n", OPT(param->bRepeatHeaders));<br>
H0(" --[no-]info Emit SEI identifying encoder and parameters. Default %s\n", OPT(param->bEmitInfoSEI));<br>
H0(" --[no-]hrd Enable HRD parameters signaling. Default %s\n", OPT(param->bEmitHRDSEI));<br>
+ H0(" --[no-]idr-recovery-sei Emit recovery point infor SEI at each IDR frame \n");<br>
H0(" --[no-]temporal-layers Enable a temporal sublayer for unreferenced B frames. Default %s\n", OPT(param-><wbr>bEnableTemporalSubLayers));<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>
<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>