History

modify and correct SVC slice header parse

Licai Guo committed 12 years ago

Commit 091315f1 parent fff39091 file · +10 −8Browse files

Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all

Unified · Split

codec/decoder/core/src/decoder_core.cpp+10−8
@@ -436,7 +436,11 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 435 unmodified lines
436436 if (uiSliceType > 4)
437437 uiSliceType -= 5;
438438
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)) {
440444 WelsLog (pCtx, WELS_LOG_WARNING, "Invalid slice type(%d) in IDR picture. \n", uiSliceType);
441445 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SLICE_TYPE);
442446 }
@@ -568,14 +572,12 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 125 unmodified lines
568572 //set defaults, might be overriden a few line later
569573 pSliceHead->uiRefCount[0] = pPps->uiNumRefIdxL0Active;
570574 pSliceHead->uiRefCount[1] = pPps->uiNumRefIdxL1Active;
575+
576+ bool bReadNumRefFlag = (P_SLICE == uiSliceType);
571577 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) {
579581 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //num_ref_idx_active_override_flag
580582 pSliceHead->bNumRefIdxActiveOverrideFlag = !!uiCode;
581583 if (pSliceHead->bNumRefIdxActiveOverrideFlag) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t