diff --git a/Source/Lib/Codec/EbPictureDecisionProcess.c b/Source/Lib/Codec/EbPictureDecisionProcess.c index 993a57a5b..a725a18b2 100644 --- a/Source/Lib/Codec/EbPictureDecisionProcess.c +++ b/Source/Lib/Codec/EbPictureDecisionProcess.c @@ -1560,8 +1560,12 @@ void* PictureDecisionKernel(void *inputPtr) EbObjectIncLiveCount( paReferenceEntryPtr->pPcsPtr->pPcsWrapperPtr, 1); - + --paReferenceEntryPtr->dependentCount; + } else { + pictureControlSetPtr->sliceType = EB_P_PICTURE; + ((EbPaReferenceObject_t *)pictureControlSetPtr->paReferencePictureWrapperPtr->objectPtr)->sliceType = + EB_P_PICTURE; } } diff --git a/Source/Lib/Codec/EbPredictionStructure.c b/Source/Lib/Codec/EbPredictionStructure.c index ba44ba03d..49db10845 100644 --- a/Source/Lib/Codec/EbPredictionStructure.c +++ b/Source/Lib/Codec/EbPredictionStructure.c @@ -1711,6 +1711,13 @@ static EB_ERRORTYPE PredictionStructureCtor( } } + // Adjust List1 if there is no positive reference frames. + if (predictionStructurePtr->predStructEntryPtrArray[entryIndex]->positiveRefPicsTotalCount == 0 && + predictionStructurePtr->predStructEntryPtrArray[entryIndex]->refList1.referenceListCount > 0) { + predictionStructurePtr->predStructEntryPtrArray[entryIndex]->refList1.referenceList = 0; + predictionStructurePtr->predStructEntryPtrArray[entryIndex]->refList1.referenceListCount = 0; + } + // Adjust Reference Counts if list is empty predictionStructurePtr->predStructEntryPtrArray[entryIndex]->refPicsList0TotalCountMinus1 = (predictionStructurePtr->predStructEntryPtrArray[entryIndex]->refPicsList0TotalCountMinus1 == ~0) ?