Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 6 files). Show all
Unified · Split
| @@ -146,36 +146,47 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 145 unmodified lines | ||
| 146 | 146 | |
| 147 | 147 | if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_SPS_NAL (pNalUnitHeader->eNalUnitType) |
| 148 | 148 | || pCtx->bSpsExistAheadFlag)) { |
| 149 | − if (pCtx->bPrintFrameErrorTraceFlag) { | |
| 149 | + if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iSpsErrorIgnored == 0) { | |
| 150 | 150 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 151 | 151 | "parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).", |
| 152 | 152 | pNalUnitHeader->eNalUnitType); |
| 153 | + } else { | |
| 154 | + pCtx->iSpsErrorIgnored++; | |
| 153 | 155 | } |
| 156 | + pCtx->sDecoderStatistics.iSpsNoExistNalNum++; | |
| 154 | 157 | pCtx->iErrorCode = dsNoParamSets; |
| 155 | 158 | return NULL; |
| 156 | 159 | } |
| 160 | + pCtx->iSpsErrorIgnored = 0; | |
| 157 | 161 | if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_PARAM_SETS_NALS (pNalUnitHeader->eNalUnitType) |
| 158 | 162 | || pCtx->bPpsExistAheadFlag)) { |
| 159 | − if (pCtx->bPrintFrameErrorTraceFlag) { | |
| 163 | + if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iPpsErrorIgnored == 0) { | |
| 160 | 164 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 161 | 165 | "parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).", |
| 162 | 166 | pNalUnitHeader->eNalUnitType); |
| 167 | + } else { | |
| 168 | + pCtx->iPpsErrorIgnored++; | |
| 163 | 169 | } |
| 170 | + pCtx->sDecoderStatistics.iPpsNoExistNalNum++; | |
| 164 | 171 | pCtx->iErrorCode = dsNoParamSets; |
| 165 | 172 | return NULL; |
| 166 | 173 | } |
| 174 | + pCtx->iPpsErrorIgnored = 0; | |
| 167 | 175 | if ((IS_VCL_NAL_AVC_BASE (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bPpsExistAheadFlag)) || |
| 168 | 176 | (IS_NEW_INTRODUCED_SVC_NAL (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bSubspsExistAheadFlag |
| 169 | 177 | || pCtx->bPpsExistAheadFlag))) { |
| 170 | − if (pCtx->bPrintFrameErrorTraceFlag) { | |
| 178 | + if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iSubSpsErrorIgnored == 0) { | |
| 171 | 179 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 172 | 180 | "ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).", |
| 173 | 181 | pNalUnitHeader->eNalUnitType); |
| 182 | + } else { | |
| 183 | + pCtx->iSubSpsErrorIgnored++; | |
| 174 | 184 | } |
| 185 | + pCtx->sDecoderStatistics.iSubSpsNoExistNalNum++; | |
| 175 | 186 | pCtx->iErrorCode |= dsNoParamSets; |
| 176 | 187 | return NULL; |
| 177 | 188 | } |
| 178 | − | |
| 189 | + pCtx->iSubSpsErrorIgnored = 0; | |
| 179 | 190 | |
| 180 | 191 | switch (pNalUnitHeader->eNalUnitType) { |
| 181 | 192 | case NAL_UNIT_AU_DELIMITER: |