Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -436,7 +436,11 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 435 unmodified lines | ||
| 436 | 436 | if (uiSliceType > 4) |
| 437 | 437 | uiSliceType -= 5; |
| 438 | 438 | |
| 439 | − if ((eNalType == NAL_UNIT_CODED_SLICE_IDR) && (uiSliceType != 2)) { | |
| 439 | + if (B_SLICE == uiSliceType) { | |
| 440 | + WelsLog (pCtx, WELS_LOG_WARNING, "ParseSliceHeaderSyntaxs(): B slice not supported.\n"); | |
| 441 | + return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_BIPRED); | |
| 442 | + } | |
| 443 | + if ((NAL_UNIT_CODED_SLICE_IDR == eNalType) && (I_SLICE != uiSliceType)) { | |
| 440 | 444 | WelsLog (pCtx, WELS_LOG_WARNING, "Invalid slice type(%d) in IDR picture. \n", uiSliceType); |
| 441 | 445 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SLICE_TYPE); |
| 442 | 446 | } |
| @@ -568,14 +572,12 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 125 unmodified lines | ||
| 568 | 572 | //set defaults, might be overriden a few line later |
| 569 | 573 | pSliceHead->uiRefCount[0] = pPps->uiNumRefIdxL0Active; |
| 570 | 574 | pSliceHead->uiRefCount[1] = pPps->uiNumRefIdxL1Active; |
| 575 | + | |
| 576 | + bool bReadNumRefFlag = (P_SLICE == uiSliceType); | |
| 571 | 577 | if (kbExtensionFlag) { |
| 572 | − uiQualityId = pNalHeaderExt->uiQualityId; | |
| 573 | − } else if (uiSliceType == P_SLICE || uiSliceType == SP_SLICE || uiSliceType == B_SLICE) { | |
| 574 | − const bool kbBipredFlag = (B_SLICE == uiSliceType); | |
| 575 | − if (kbBipredFlag) { | |
| 576 | − WelsLog (pCtx, WELS_LOG_WARNING, "ParseSliceHeaderSyntaxs(): kbBipredFlag = 1 not supported.\n"); | |
| 577 | − return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_BIPRED); | |
| 578 | − } | |
| 578 | + bReadNumRefFlag &= (BASE_QUALITY_ID == pNalHeaderExt->uiQualityId); | |
| 579 | + } | |
| 580 | + if (bReadNumRefFlag) { | |
| 579 | 581 | WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //num_ref_idx_active_override_flag |
| 580 | 582 | pSliceHead->bNumRefIdxActiveOverrideFlag = !!uiCode; |
| 581 | 583 | if (pSliceHead->bNumRefIdxActiveOverrideFlag) { |