modify decoder log

This commit is contained in:
dong zhang
2015-03-02 14:43:21 +08:00
parent 7c9597c36d
commit d28970d625
6 changed files with 69 additions and 11 deletions

View File

@@ -659,7 +659,12 @@ typedef struct TagVideoDecoderStatistics {
uiFreezingIDRNum; ///< number of freezing IDR with error (partly received), under resolution change
unsigned int uiFreezingNonIDRNum; ///< number of freezing non-IDR with error
int iAvgLumaQp; ///< average luma QP. default: -1, no correct frame outputted
int iSpsReportErrorNum; ///< number of Sps Invalid report
int iSubSpsReportErrorNum; ///< number of SubSps Invalid report
int iPpsReportErrorNum; ///< number of Pps Invalid report
int iSpsNoExistNalNum; ///< number of Sps NoExist Nal
int iSubSpsNoExistNalNum; ///< number of SubSps NoExist Nal
int iPpsNoExistNalNum; ///< number of Pps NoExist Nal
} SDecoderStatistics; // in building, coming soon
#endif//WELS_VIDEO_CODEC_APPLICATION_DEFINITION_H__

View File

@@ -335,9 +335,20 @@ bool bSpsExistAheadFlag; // whether does SPS NAL exist ahead of sequence?
bool bSubspsExistAheadFlag;// whether does Subset SPS NAL exist ahead of sequence?
bool bPpsExistAheadFlag; // whether does PPS NAL exist ahead of sequence?
int32_t iSpsErrorIgnored;
int32_t iSubSpsErrorIgnored;
int32_t iPpsErrorIgnored;
bool bSpsAvailFlags[MAX_SPS_COUNT];
bool bSubspsAvailFlags[MAX_SPS_COUNT];
bool bPpsAvailFlags[MAX_PPS_COUNT];
int32_t iPPSLastInvalidId;
int32_t iPPSInvalidNum;
int32_t iSPSLastInvalidId;
int32_t iSPSInvalidNum;
int32_t iSubSPSLastInvalidId;
int32_t iSubSPSInvalidNum;
bool bReferenceLostAtT0Flag;
int32_t iTotalNumMbRec; //record current number of decoded MB
#ifdef LONG_TERM_REF

View File

@@ -77,7 +77,6 @@
#define MAX_BUFFERED_NUM 3 //mamixum stored number of AU|packet to prevent overwrite
#define MAX_ACCESS_UNIT_CAPACITY 7077888 //Maximum AU size in bytes for level 5.2 for single frame
#define MAX_MACROBLOCK_CAPACITY 5000 //Maximal legal MB capacity, 15000 bits is enough
enum {
BASE_MB = 0,
NON_AVC_REWRITE_ENHANCE_MB =1,

View File

@@ -146,36 +146,47 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_SPS_NAL (pNalUnitHeader->eNalUnitType)
|| pCtx->bSpsExistAheadFlag)) {
if (pCtx->bPrintFrameErrorTraceFlag) {
if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iSpsErrorIgnored == 0) {
WelsLog (pLogCtx, WELS_LOG_WARNING,
"parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).",
pNalUnitHeader->eNalUnitType);
} else {
pCtx->iSpsErrorIgnored++;
}
pCtx->sDecoderStatistics.iSpsNoExistNalNum++;
pCtx->iErrorCode = dsNoParamSets;
return NULL;
}
pCtx->iSpsErrorIgnored = 0;
if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_PARAM_SETS_NALS (pNalUnitHeader->eNalUnitType)
|| pCtx->bPpsExistAheadFlag)) {
if (pCtx->bPrintFrameErrorTraceFlag) {
if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iPpsErrorIgnored == 0) {
WelsLog (pLogCtx, WELS_LOG_WARNING,
"parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).",
pNalUnitHeader->eNalUnitType);
} else {
pCtx->iPpsErrorIgnored++;
}
pCtx->sDecoderStatistics.iPpsNoExistNalNum++;
pCtx->iErrorCode = dsNoParamSets;
return NULL;
}
pCtx->iPpsErrorIgnored = 0;
if ((IS_VCL_NAL_AVC_BASE (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bPpsExistAheadFlag)) ||
(IS_NEW_INTRODUCED_SVC_NAL (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bSubspsExistAheadFlag
|| pCtx->bPpsExistAheadFlag))) {
if (pCtx->bPrintFrameErrorTraceFlag) {
if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iSubSpsErrorIgnored == 0) {
WelsLog (pLogCtx, WELS_LOG_WARNING,
"ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).",
pNalUnitHeader->eNalUnitType);
} else {
pCtx->iSubSpsErrorIgnored++;
}
pCtx->sDecoderStatistics.iSubSpsNoExistNalNum++;
pCtx->iErrorCode |= dsNoParamSets;
return NULL;
}
pCtx->iSubSpsErrorIgnored = 0;
switch (pNalUnitHeader->eNalUnitType) {
case NAL_UNIT_AU_DELIMITER:

View File

@@ -311,7 +311,15 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
pCtx->sDecoderStatistics.iAvgLumaQp = -1;
pCtx->bSpsLatePps = false;
pCtx->bUseScalingList = false;
pCtx->iSpsErrorIgnored = 0;
pCtx->iSubSpsErrorIgnored = 0;
pCtx->iPpsErrorIgnored = 0;
pCtx->iPPSInvalidNum = 0;
pCtx->iPPSLastInvalidId = -1;
pCtx->iSPSInvalidNum = 0;
pCtx->iSPSLastInvalidId = -1;
pCtx->iSubSPSInvalidNum = 0;
pCtx->iSubSPSLastInvalidId = -1;
}
/*

View File

@@ -566,10 +566,18 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
//add check PPS available here
if (pCtx->bPpsAvailFlags[iPpsId] == false) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "PPS id is invalid!");
pCtx->sDecoderStatistics.iPpsReportErrorNum++;
if (pCtx->iPPSLastInvalidId != iPpsId) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "PPS id (%d) is invalid, previous id (%d) error ignored (%d)!", iPpsId, pCtx->iPPSLastInvalidId, pCtx->iPPSInvalidNum);
pCtx->iPPSLastInvalidId = iPpsId;
pCtx->iPPSInvalidNum = 0;
} else {
pCtx->iPPSInvalidNum++;
}
pCtx->iErrorCode |= dsNoParamSets;
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID);
}
pCtx->iPPSLastInvalidId = -1;
pPps = &pCtx->sPpsBuffer[iPpsId];
@@ -583,16 +591,32 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
pSps = &pSubsetSps->sSps;
if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!");
pCtx->sDecoderStatistics.iSubSpsReportErrorNum++;
if (pCtx->iSubSPSLastInvalidId != pPps->iSpsId) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "Sub SPS id (%d) is invalid, previous id (%d) error ignored (%d)!", pPps->iSpsId, pCtx->iSubSPSLastInvalidId, pCtx->iSubSPSInvalidNum);
pCtx->iSubSPSLastInvalidId = pPps->iSpsId;
pCtx->iSubSPSInvalidNum = 0;
} else {
pCtx->iSubSPSInvalidNum++;
}
pCtx->iErrorCode |= dsNoParamSets;
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID);
}
pCtx->iSubSPSLastInvalidId = -1;
} else {
if (pCtx->bSpsAvailFlags[pPps->iSpsId] == false) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!");
pCtx->sDecoderStatistics.iSpsReportErrorNum++;
if (pCtx->iSPSLastInvalidId != pPps->iSpsId) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id (%d) is invalid, previous id (%d) error ignored (%d)!", pPps->iSpsId, pCtx->iSPSLastInvalidId, pCtx->iSPSInvalidNum);
pCtx->iSPSLastInvalidId = pPps->iSpsId;
pCtx->iSPSInvalidNum = 0;
} else {
pCtx->iSPSInvalidNum++;
}
pCtx->iErrorCode |= dsNoParamSets;
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID);
}
pCtx->iSPSLastInvalidId = -1;
pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
}
pSliceHead->iPpsId = iPpsId;
@@ -2051,7 +2075,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf
pCtx->bRPLRError = true;
bAllRefComplete = false; // RPLR error, set ref pictures complete flag false
HandleReferenceLost (pCtx, pNalCur);
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
"reference picture introduced by this frame is lost during transmission! uiTId: %d",
pNalCur->sNalHeaderExt.uiTemporalId);
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) {