Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a182d489d | ||
|
|
1f887a0e95 | ||
|
|
7180adf1a2 | ||
|
|
8c3db53fca | ||
|
|
14294b64b3 | ||
|
|
f08d73553f | ||
|
|
917d683bb2 | ||
|
|
5c114c3ebb | ||
|
|
1ed519b5bb |
@@ -1,6 +1,6 @@
|
|||||||
#ifndef VERSION_H
|
#ifndef VERSION_H
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
#define VERSION_NUMBER "openh264 default: 1.2"
|
#define VERSION_NUMBER "openh264 default: 1.3"
|
||||||
|
|
||||||
#endif // VERSION_H
|
#endif // VERSION_H
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
|
|||||||
pDecoder->GetOption (DECODER_OPTION_VCL_NAL, &iFeedbackVclNalInAu);
|
pDecoder->GetOption (DECODER_OPTION_VCL_NAL, &iFeedbackVclNalInAu);
|
||||||
int32_t iFeedbackTidInAu;
|
int32_t iFeedbackTidInAu;
|
||||||
pDecoder->GetOption (DECODER_OPTION_TEMPORAL_ID, &iFeedbackTidInAu);
|
pDecoder->GetOption (DECODER_OPTION_TEMPORAL_ID, &iFeedbackTidInAu);
|
||||||
int32_t iErrorConMethod = (int32_t) ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE;
|
int32_t iErrorConMethod = (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE;
|
||||||
pDecoder->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iErrorConMethod);
|
pDecoder->SetOption (DECODER_OPTION_ERROR_CON_IDC, &iErrorConMethod);
|
||||||
//~end for
|
//~end for
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) {
|
|||||||
|
|
||||||
pDeblockMb = WelsDeblockingMb;
|
pDeblockMb = WelsDeblockingMb;
|
||||||
|
|
||||||
if (1 == pSliceHeader->uiDisableDeblockingFilterIdc) {
|
if (1 == pSliceHeader->uiDisableDeblockingFilterIdc
|
||||||
|
|| pCtx->pCurDqLayer->sLayerInfo.sSliceInLayer.iTotalMbInCurSlice <= 0) {
|
||||||
return 0;//NO_SUPPORTED_FILTER_IDX
|
return 0;//NO_SUPPORTED_FILTER_IDX
|
||||||
} else {
|
} else {
|
||||||
WelsDeblockingFilterSlice (pCtx, pDeblockMb);
|
WelsDeblockingFilterSlice (pCtx, pDeblockMb);
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
|
|||||||
pCtx->pPicBuff[LIST_1] = NULL;
|
pCtx->pPicBuff[LIST_1] = NULL;
|
||||||
|
|
||||||
pCtx->bAvcBasedFlag = true;
|
pCtx->bAvcBasedFlag = true;
|
||||||
pCtx->eErrorConMethod = ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE;
|
pCtx->eErrorConMethod = ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE;
|
||||||
pCtx->pPreviousDecodedPictureInDpb = NULL;
|
pCtx->pPreviousDecodedPictureInDpb = NULL;
|
||||||
pCtx->sDecoderStatistics.iAvgLumaQp = -1;
|
pCtx->sDecoderStatistics.iAvgLumaQp = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -562,10 +562,17 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
|
|||||||
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID);
|
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pCtx->iOverwriteFlags & OVERWRITE_PPS)
|
if (pCtx->iOverwriteFlags & OVERWRITE_PPS) {
|
||||||
pPps = &pCtx->sPpsBuffer[MAX_PPS_COUNT];
|
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) {
|
||||||
else
|
pPps = &pCtx->sPpsBuffer[MAX_PPS_COUNT];
|
||||||
|
} else {
|
||||||
|
memcpy (&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof (SPps));
|
||||||
|
pCtx->iOverwriteFlags ^= OVERWRITE_PPS;
|
||||||
|
pPps = &pCtx->sPpsBuffer[iPpsId];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
pPps = &pCtx->sPpsBuffer[iPpsId];
|
pPps = &pCtx->sPpsBuffer[iPpsId];
|
||||||
|
}
|
||||||
|
|
||||||
if (pPps->uiNumSliceGroups == 0) {
|
if (pPps->uiNumSliceGroups == 0) {
|
||||||
WelsLog (pLogCtx, WELS_LOG_WARNING, "Invalid PPS referenced");
|
WelsLog (pLogCtx, WELS_LOG_WARNING, "Invalid PPS referenced");
|
||||||
@@ -574,10 +581,19 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (kbExtensionFlag) {
|
if (kbExtensionFlag) {
|
||||||
if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS)
|
if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) {
|
||||||
pSubsetSps = &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT];
|
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) {
|
||||||
else
|
pSubsetSps = &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT];
|
||||||
pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
|
} else {
|
||||||
|
memcpy (&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId],
|
||||||
|
&pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof (SSubsetSps));
|
||||||
|
pCtx->iOverwriteFlags ^= OVERWRITE_SUBSETSPS;
|
||||||
|
pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
|
||||||
|
ResetActiveSPSForEachLayer (pCtx);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
|
||||||
|
}
|
||||||
pSps = &pSubsetSps->sSps;
|
pSps = &pSubsetSps->sSps;
|
||||||
if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) {
|
if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) {
|
||||||
WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!");
|
WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!");
|
||||||
@@ -590,10 +606,18 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
|
|||||||
pCtx->iErrorCode |= dsNoParamSets;
|
pCtx->iErrorCode |= dsNoParamSets;
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID);
|
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID);
|
||||||
}
|
}
|
||||||
if (pCtx->iOverwriteFlags & OVERWRITE_SPS)
|
if (pCtx->iOverwriteFlags & OVERWRITE_SPS) {
|
||||||
pSps = &pCtx->sSpsBuffer[MAX_SPS_COUNT];
|
if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) {
|
||||||
else
|
pSps = &pCtx->sSpsBuffer[MAX_SPS_COUNT];
|
||||||
|
} else {
|
||||||
|
memcpy (&pCtx->sSpsBuffer[pCtx->sSpsBuffer[MAX_SPS_COUNT].iSpsId], &pCtx->sSpsBuffer[MAX_SPS_COUNT], sizeof (SSps));
|
||||||
|
pCtx->iOverwriteFlags ^= OVERWRITE_SPS;
|
||||||
|
pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
|
||||||
|
ResetActiveSPSForEachLayer (pCtx);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
|
pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pSliceHead->iPpsId = iPpsId;
|
pSliceHead->iPpsId = iPpsId;
|
||||||
pSliceHead->iSpsId = pPps->iSpsId;
|
pSliceHead->iSpsId = pPps->iSpsId;
|
||||||
@@ -1266,7 +1290,7 @@ void UninitialDqLayersContext (PWelsDecoderContext pCtx) {
|
|||||||
|
|
||||||
void ResetCurrentAccessUnit (PWelsDecoderContext pCtx) {
|
void ResetCurrentAccessUnit (PWelsDecoderContext pCtx) {
|
||||||
PAccessUnit pCurAu = pCtx->pAccessUnitList;
|
PAccessUnit pCurAu = pCtx->pAccessUnitList;
|
||||||
|
pCurAu->uiStartPos = 0;
|
||||||
pCurAu->uiEndPos = 0;
|
pCurAu->uiEndPos = 0;
|
||||||
pCurAu->bCompletedAuFlag = false;
|
pCurAu->bCompletedAuFlag = false;
|
||||||
if (pCurAu->uiActualUnitsNum > 0) {
|
if (pCurAu->uiActualUnitsNum > 0) {
|
||||||
@@ -1311,6 +1335,7 @@ void ForceResetCurrentAccessUnit (PAccessUnit pAu) {
|
|||||||
else
|
else
|
||||||
pAu->uiAvailUnitsNum = 0;
|
pAu->uiAvailUnitsNum = 0;
|
||||||
pAu->uiActualUnitsNum = 0;
|
pAu->uiActualUnitsNum = 0;
|
||||||
|
pAu->uiStartPos = 0;
|
||||||
pAu->uiEndPos = 0;
|
pAu->uiEndPos = 0;
|
||||||
pAu->bCompletedAuFlag = false;
|
pAu->bCompletedAuFlag = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ int32_t MemInitNalList (PAccessUnit* ppAu, const uint32_t kuiSize) {
|
|||||||
(*ppAu)->uiCountUnitsNum = kuiSize;
|
(*ppAu)->uiCountUnitsNum = kuiSize;
|
||||||
(*ppAu)->uiAvailUnitsNum = 0;
|
(*ppAu)->uiAvailUnitsNum = 0;
|
||||||
(*ppAu)->uiActualUnitsNum = 0;
|
(*ppAu)->uiActualUnitsNum = 0;
|
||||||
(*ppAu)->uiEndPos = 0;
|
(*ppAu)->uiStartPos = 0;
|
||||||
|
(*ppAu)->uiEndPos = 0;
|
||||||
(*ppAu)->bCompletedAuFlag = false;
|
(*ppAu)->bCompletedAuFlag = false;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -589,7 +589,7 @@ class OpenH264VideoDecoder : public GMPVideoDecoder {
|
|||||||
memset (¶m, 0, sizeof (param));
|
memset (¶m, 0, sizeof (param));
|
||||||
param.eOutputColorFormat = videoFormatI420;
|
param.eOutputColorFormat = videoFormatI420;
|
||||||
param.uiTargetDqLayer = UCHAR_MAX; // Default value
|
param.uiTargetDqLayer = UCHAR_MAX; // Default value
|
||||||
param.eEcActiveIdc = ERROR_CON_SLICE_COPY; // Error concealment on.
|
param.eEcActiveIdc = ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE; // Error concealment on.
|
||||||
param.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
|
param.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
|
||||||
|
|
||||||
if (decoder_->Initialize (¶m)) {
|
if (decoder_->Initialize (¶m)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user