Skip to content

Commit 3b12491

Browse files
tyan0torokati44
authored andcommitted
Fix the issue cisco#3837 (cisco#3868)
Revive the code removed in the commit c0e5ea2. Not quite sure now, why it was decided to be removed.
1 parent e795619 commit 3b12491

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

codec/decoder/plus/src/welsDecoderExt.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,24 @@ DECODING_STATE CWelsDecoder::ReorderPicturesInDisplay(PWelsDecoderContext pDecCo
11431143
m_bIsBaseline = pDecContext->pSps->uiProfileIdc == 66 || pDecContext->pSps->uiProfileIdc == 83;
11441144
if (!m_bIsBaseline) {
11451145
if (pDstInfo->iBufferStatus == 1) {
1146+
if (pDecContext->pSliceHeader->eSliceType == B_SLICE &&
1147+
((pDecContext->iSeqNum == m_sReoderingStatus.iLastWrittenSeqNum) ?
1148+
(pDecContext->pSliceHeader->iPicOrderCntLsb <= m_sReoderingStatus.iLastWrittenPOC + 2) :
1149+
(pDecContext->iSeqNum - m_sReoderingStatus.iLastWrittenSeqNum == 1 && pDecContext->pSliceHeader->iPicOrderCntLsb == 0))) {
1150+
m_sReoderingStatus.iLastWrittenPOC = pDecContext->pSliceHeader->iPicOrderCntLsb;
1151+
m_sReoderingStatus.iLastWrittenSeqNum = pDecContext->iSeqNum;
1152+
//issue #3478, use b-slice type to determine correct picture order as the first priority as POC order is not as reliable as based on b-slice
1153+
ppDst[0] = pDstInfo->pDst[0];
1154+
ppDst[1] = pDstInfo->pDst[1];
1155+
ppDst[2] = pDstInfo->pDst[2];
1156+
#if defined (_DEBUG)
1157+
#ifdef _MOTION_VECTOR_DUMP_
1158+
fprintf (stderr, "Output POC: #%d uiDecodingTimeStamp=%d\n", pDecContext->pSliceHeader->iPicOrderCntLsb,
1159+
pDecContext->uiDecodingTimeStamp);
1160+
#endif
1161+
#endif
1162+
return iRet;
1163+
}
11461164
BufferingReadyPicture(pDecContext, ppDst, pDstInfo);
11471165
if (!m_sReoderingStatus.bHasBSlice && m_sReoderingStatus.iNumOfPicts > 1) {
11481166
ReleaseBufferedReadyPictureNoReorder (pDecContext, ppDst, pDstInfo);

0 commit comments

Comments
 (0)