Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Fix B-frame without positive reference frames as P-frame. #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Source/Lib/Codec/EbPictureDecisionProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
7 changes: 7 additions & 0 deletions Source/Lib/Codec/EbPredictionStructure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ?
Expand Down