<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 15, 2018 at 11:37 AM, <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 1521091372 -19800<br>
# Thu Mar 15 10:52:52 2018 +0530<br>
# Node ID 634b57c329d4d960c098fc7f01feb7<wbr>7ed95ea3a7<br>
# Parent d7c26df32fae052b7e895fee9bda1c<wbr>22b24cc44b<br>
Set IDR's NAL type to NAL_UNIT_CODED_SLICE_IDR_N_LP if it does not have<br>
associated leading pictures<br>
<br>
diff -r d7c26df32fae -r 634b57c329d4 source/common/slice.h<br>
--- a/source/common/slice.h Tue Mar 13 13:40:13 2018 +0530<br>
+++ b/source/common/slice.h Thu Mar 15 10:52:52 2018 +0530<br>
@@ -385,12 +385,14 @@<br>
bool getRapPicFlag() const<br>
{<br>
return m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL<br>
+ || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP<br>
|| m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA;<br>
}<br>
<br>
bool getIdrPicFlag() const<br>
{<br>
- return m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL;<br>
+ return m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL<br>
+ || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP;<br>
}<br>
<br>
bool isIRAP() const { return m_nalUnitType >= 16 && m_nalUnitType <= 23; }<br>
diff -r d7c26df32fae -r 634b57c329d4 source/encoder/dpb.cpp<br>
--- a/source/encoder/dpb.cpp Tue Mar 13 13:40:13 2018 +0530<br>
+++ b/source/encoder/dpb.cpp Thu Mar 15 10:52:52 2018 +0530<br>
@@ -133,7 +133,7 @@<br>
bool bIsKeyFrame = newFrame->m_lowres.bKeyframe;<br>
<br>
slice->m_nalUnitType = getNalUnitType(pocCurr, bIsKeyFrame);<br>
- if (slice->m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL)<br>
+ if (slice->m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL || slice->m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP)<br>
m_lastIDR = pocCurr;<br>
slice->m_lastIDR = m_lastIDR;<br>
slice->m_sliceType = IS_X265_TYPE_B(type) ? B_SLICE : (type == X265_TYPE_P) ? P_SLICE : I_SLICE;<br>
@@ -250,7 +250,7 @@<br>
/* Marking reference pictures when an IDR/CRA is encountered. */<br>
void DPB::decodingRefreshMarking(<wbr>int pocCurr, NalUnitType nalUnitType)<br>
{<br>
- if (nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL)<br>
+ if (nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL || nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP)<br>
{<br>
/* If the nal_unit_type is IDR, all pictures in the reference picture<br>
* list are marked as "unused for reference" */<br>
@@ -326,10 +326,10 @@<br>
NalUnitType DPB::getNalUnitType(int curPOC, bool bIsKeyFrame)<br>
{<br>
if (!curPOC)<br>
- return NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL;<br>
+ return NAL_UNIT_CODED_SLICE_IDR_N_LP;<br>
<br>
if (bIsKeyFrame)<br>
- return m_bOpenGOP ? NAL_UNIT_CODED_SLICE_CRA : NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL;<br>
+ return m_bOpenGOP ? NAL_UNIT_CODED_SLICE_CRA : m_bhasLeadingPicture ? NAL_UNIT_CODED_SLICE_IDR_W_<wbr>RADL : NAL_UNIT_CODED_SLICE_IDR_N_LP;<br>
<br>
if (m_pocCRA && curPOC < m_pocCRA)<br>
// All leading pictures are being marked as TFD pictures here since<br>
diff -r d7c26df32fae -r 634b57c329d4 source/encoder/dpb.h<br>
--- a/source/encoder/dpb.h Tue Mar 13 13:40:13 2018 +0530<br>
+++ b/source/encoder/dpb.h Thu Mar 15 10:52:52 2018 +0530<br>
@@ -40,6 +40,7 @@<br>
int m_lastIDR;<br>
int m_pocCRA;<br>
int m_bOpenGOP;<br>
+ int m_bhasLeadingPicture;<br>
bool m_bRefreshPending;<br>
bool m_bTemporalSublayer;<br>
PicList m_picList;<br>
@@ -50,6 +51,7 @@<br>
{<br>
m_lastIDR = 0;<br>
m_pocCRA = 0;<br>
+ m_bhasLeadingPicture = param->radl;<br>
m_bRefreshPending = false;<br>
m_frameDataFreeList = NULL;<br>
m_bOpenGOP = param->bOpenGOP;<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"><br></div><div class="gmail_extra">Pushed.</div></div>