Compare commits

...

9 Commits
main ... v1.3.1

Author SHA1 Message Date
huili2
3a182d489d Merge pull request #1686 from HaiboZhu/Debug_v1_3_No_Deblocking_when_TotalMB_equals_to_0
Force NO deblocking when no MB decoded in current slice
2014-12-31 14:14:27 +08:00
Haibo Zhu
1f887a0e95 Force NO deblocking when no MB decoded in current slice
Remove the judgment outside of the function
2014-12-30 21:18:54 -08:00
sijchen
7180adf1a2 Merge pull request #1684 from HaiboZhu/Change_v1_3_default_EC_mode
Change default EC mode
2014-12-30 17:11:29 +08:00
Haibo Zhu
8c3db53fca Change default EC mode to ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE 2014-12-30 00:20:06 -08:00
HaiboZhu
14294b64b3 Merge pull request #1681 from HaiboZhu/Debug_v1_3_Crash_1115349_AU_StartPos_Not_Reset
Reset AU start pos to 0 after construct AU
2014-12-30 05:20:36 +08:00
Haibo Zhu
f08d73553f Reset AU uiStartPos to 0 in ResetCurrentAccessUnit for svc
Reset uiStartPos to 0 when init and forceReset
2014-12-29 01:01:05 -08:00
dongzha
917d683bb2 Merge pull request #1674 from HaiboZhu/Debug_v1_3_Crash_NoAU_SPS_Update
Debug for parameter set update logic when AU num==0
2014-12-26 10:49:47 +08:00
Haibo Zhu
5c114c3ebb Add SPS/SubSPS/PPS update when AU number==0 and iOverwriteFlags==true
Add TotalNumMbRec>0 judgement for EC
2014-12-25 18:05:24 -08:00
Sijia Chen
1ed519b5bb update version.header to 1.3 2014-12-22 14:04:43 +08:00
7 changed files with 44 additions and 17 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;
} }

View File

@@ -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;

View File

@@ -589,7 +589,7 @@ class OpenH264VideoDecoder : public GMPVideoDecoder {
memset (&param, 0, sizeof (param)); memset (&param, 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 (&param)) { if (decoder_->Initialize (&param)) {