History

add safety check for bit-reading for headers

Licai Guo committed 12 years ago

Commit a3c38b51 parent e79769f7 files · +676 −488Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+189−139
@@ -156,17 +156,20 @@ int32_t ParseRefPicListReordering (PBitStringAux pBs, PSliceHeader pSh) { · 155 unmodified lines
156156 const ESliceType keSt = pSh->eSliceType;
157157 PRefPicListReorderSyn pRefPicListReordering = &pSh->pRefPicListReordering;
158158 PSps pSps = pSh->pSps;
159+ uint32_t uiCode;
159160 if (keSt == I_SLICE || keSt == SI_SLICE)
160161 return ERR_NONE;
161162
162163 // Common syntaxs for P or B slices: list0, list1 followed if B slices used.
163164 do {
164− pRefPicListReordering->bRefPicListReorderingFlag[iList] = !!BsGetOneBit (pBs);
165+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //ref_pic_list_modification_flag_l0
166+ pRefPicListReordering->bRefPicListReorderingFlag[iList] = !!uiCode;
165167
166168 if (pRefPicListReordering->bRefPicListReorderingFlag[iList]) {
167169 int32_t iIdx = 0;
168170 do {
169− const uint32_t kuiIdc = BsGetUe (pBs);
171+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //modification_of_pic_nums_idc
172+ const uint32_t kuiIdc = uiCode;
170173
171174 //Fixed the referrence list reordering crash issue.(fault kIdc value > 3 case)---
172175 if ((iIdx >= MAX_REF_PIC_COUNT) || (kuiIdc > 3)) {
@@ -182,12 +185,13 @@ int32_t ParseRefPicListReordering (PBitStringAux pBs, PSliceHeader pSh) { · 9 unmodified lines
182185 if (kuiIdc == 0 || kuiIdc == 1) {
183186 // abs_diff_pic_num_minus1 should be in range 0 to MaxPicNum-1, MaxPicNum is derived as
184187 // 2^(4+log2_max_frame_num_minus4)
185− uint32_t uiTmp = BsGetUe (pBs);
186− WELS_CHECK_SE_UPPER_ERROR_NOLOG (uiTmp, (1 << pSps->uiLog2MaxFrameNum), "abs_diff_pic_num_minus1",
188+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //abs_diff_pic_num_minus1
189+ WELS_CHECK_SE_UPPER_ERROR_NOLOG (uiCode, (1 << pSps->uiLog2MaxFrameNum), "abs_diff_pic_num_minus1",
187190 GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_REF_REORDERING));
188− pRefPicListReordering->sReorderingSyn[iList][iIdx].uiAbsDiffPicNumMinus1 = uiTmp; // uiAbsDiffPicNumMinus1
191+ pRefPicListReordering->sReorderingSyn[iList][iIdx].uiAbsDiffPicNumMinus1 = uiCode; // uiAbsDiffPicNumMinus1
189192 } else if (kuiIdc == 2) {
190− pRefPicListReordering->sReorderingSyn[iList][iIdx].uiLongTermPicNum = BsGetUe (pBs);
193+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_pic_num
194+ pRefPicListReordering->sReorderingSyn[iList][iIdx].uiLongTermPicNum = uiCode;
191195 }
192196
193197 ++ iIdx;
@@ -205,31 +209,41 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 11 unmodified lines
205209 const bool kbIdrFlag) {
206210 PRefPicMarking const kpRefMarking = &pSh->sRefMarking;
207211 PRefPic pRefPic = &pCtx->sRefPic;
212+ uint32_t uiCode;
208213 if (kbIdrFlag) {
209− kpRefMarking->bNoOutputOfPriorPicsFlag = !!BsGetOneBit (pBs);
210− kpRefMarking->bLongTermRefFlag = !!BsGetOneBit (pBs);
214+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //no_output_of_prior_pics_flag
215+ kpRefMarking->bNoOutputOfPriorPicsFlag = !!uiCode;
216+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //long_term_reference_flag
217+ kpRefMarking->bLongTermRefFlag = !!uiCode;
211218 } else {
212− kpRefMarking->bAdaptiveRefPicMarkingModeFlag = !!BsGetOneBit (pBs);
219+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //adaptive_ref_pic_marking_mode_flag
220+ kpRefMarking->bAdaptiveRefPicMarkingModeFlag = !!uiCode;
213221 if (kpRefMarking->bAdaptiveRefPicMarkingModeFlag) {
214222 int32_t iIdx = 0;
215223 do {
216− const int32_t kiMmco = BsGetUe (pBs);
224+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //memory_management_control_operation
225+ const int32_t kiMmco = uiCode;
217226
218227 kpRefMarking->sMmcoRef[iIdx].uiMmcoType = kiMmco;
219228 if (kiMmco == MMCO_END)
220229 break;
221230
222231 if (kiMmco == MMCO_SHORT2UNUSED || kiMmco == MMCO_SHORT2LONG) {
223− kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum = 1 + BsGetUe (pBs);
232+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //difference_of_pic_nums_minus1
233+ kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum = 1 + uiCode;
224234 kpRefMarking->sMmcoRef[iIdx].iShortFrameNum = (pSh->iFrameNum - kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum) & ((
225235 1 << pSps->uiLog2MaxFrameNum) - 1);
226− } else if (kiMmco == MMCO_LONG2UNUSED)
227− kpRefMarking->sMmcoRef[iIdx].uiLongTermPicNum = BsGetUe (pBs);
228−
236+ } else if (kiMmco == MMCO_LONG2UNUSED) {
237+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_pic_num
238+ kpRefMarking->sMmcoRef[iIdx].uiLongTermPicNum = uiCode;
239+ }
229240 if (kiMmco == MMCO_SHORT2LONG || kiMmco == MMCO_LONG) {
230− kpRefMarking->sMmcoRef[iIdx].iLongTermFrameIdx = BsGetUe (pBs);
231− } else if (kiMmco == MMCO_SET_MAX_LONG)
232− kpRefMarking->sMmcoRef[iIdx].iMaxLongTermFrameIdx = -1 + BsGetUe (pBs);
241+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_frame_idx
242+ kpRefMarking->sMmcoRef[iIdx].iLongTermFrameIdx = uiCode;
243+ } else if (kiMmco == MMCO_SET_MAX_LONG) {
244+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1
245+ kpRefMarking->sMmcoRef[iIdx].iMaxLongTermFrameIdx = -1 + uiCode;
246+ }
233247 ++ iIdx;
234248
235249 } while (iIdx < MAX_MMCO_COUNT);
@@ -477,9 +491,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 241 unmodified lines
477491 int32_t iRet = ERR_NONE;
478492 uint8_t uiSliceType = 0;
479493 uint8_t uiQualityId = BASE_QUALITY_ID;
480− uint32_t uiTmp;
481494 bool bIdrFlag = false;
482495 bool bSgChangeCycleInvolved = false; // involved slice group change cycle ?
496+ uint32_t uiCode;
497+ int32_t iCode;
483498
484499 if (kpCurNal == NULL) {
485500 return ERR_INFO_OUT_OF_MEMORY;
@@ -503,9 +518,11 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 17 unmodified lines
503518 kpCurNal->sNalData.sVclNal.bSliceHeaderExtFlag = kbExtensionFlag;
504519
505520 // first_mb_in_slice
506− pSliceHead->iFirstMbInSlice = BsGetUe (pBs);
521+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //first_mb_in_slice
522+ pSliceHead->iFirstMbInSlice = uiCode;
507523
508− uiSliceType = BsGetUe (pBs);
524+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //slice_type
525+ uiSliceType = uiCode;
509526 if (uiSliceType > 9) {
510527 WelsLog (pCtx, WELS_LOG_WARNING, "slice type too large (%d) at first_mb(%d)\n", uiSliceType,
511528 pSliceHead->iFirstMbInSlice);
@@ -528,7 +545,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 16 unmodified lines
528545
529546 pSliceHead->eSliceType = static_cast <ESliceType> (uiSliceType);
530547
531− iPpsId = BsGetUe (pBs);
548+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_parameter_set_id
549+ iPpsId = uiCode;
532550
533551 if (iPpsId >= MAX_PPS_COUNT) {
534552 WelsLog (pCtx, WELS_LOG_WARNING, "iPpsId out of range\n");
@@ -583,7 +601,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 48 unmodified lines
583601 // check first_mb_in_slice
584602 WELS_CHECK_SE_UPPER_ERROR ((uint32_t) (pSliceHead->iFirstMbInSlice), pSps->uiTotalMbCount, "first_mb_in_slice",
585603 GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_FIRST_MB_IN_SLICE));
586− pSliceHead->iFrameNum = BsGetBits (pBs, pSps->uiLog2MaxFrameNum);
604+ WELS_READ_VERIFY (BsGetBits (pBs, pSps->uiLog2MaxFrameNum, &uiCode)); //frame_num
605+ pSliceHead->iFrameNum = uiCode;
587606
588607 pSliceHead->bFieldPicFlag = false;
589608 pSliceHead->bBottomFiledFlag = false;
@@ -601,11 +620,11 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 11 unmodified lines
601620 pSliceHead->iFrameNum);
602621 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_FRAME_NUM);
603622 }
604− uiTmp = BsGetUe (pBs);
623+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //idr_pic_id
605624 // standard 7.4.3 idr_pic_id should be in range 0 to 65535, inclusive.
606− WELS_CHECK_SE_UPPER_ERROR (uiTmp, SLICE_HEADER_IDR_PIC_ID_MAX, "idr_pic_id", GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER,
625+ WELS_CHECK_SE_UPPER_ERROR (uiCode, SLICE_HEADER_IDR_PIC_ID_MAX, "idr_pic_id", GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER,
607626 ERR_INFO_INVALID_IDR_PIC_ID));
608− pSliceHead->uiIdrPicId = uiTmp; /* uiIdrPicId */
627+ pSliceHead->uiIdrPicId = uiCode; /* uiIdrPicId */
609628 #ifdef LONG_TERM_REF
610629 pCtx->uiCurIdrPicId = pSliceHead->uiIdrPicId;
611630 #endif
@@ -615,23 +634,28 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 3 unmodified lines
615634 pSliceHead->iDeltaPicOrderCnt[0] =
616635 pSliceHead->iDeltaPicOrderCnt[1] = 0;
617636 if (pSps->uiPocType == 0) {
618− pSliceHead->iPicOrderCntLsb = BsGetBits (pBs, pSps->iLog2MaxPocLsb);
637+ WELS_READ_VERIFY (BsGetBits (pBs, pSps->iLog2MaxPocLsb, &uiCode)); //pic_order_cnt_lsb
638+ pSliceHead->iPicOrderCntLsb = uiCode;
619639 if (pPps->bPicOrderPresentFlag && !pSliceHead->bFieldPicFlag) {
620− pSliceHead->iDeltaPicOrderCntBottom = BsGetSe (pBs);
640+ WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //delta_pic_order_cnt_bottom
641+ pSliceHead->iDeltaPicOrderCntBottom = iCode;
621642 }
622643 } else if (pSps->uiPocType == 1 && !pSps->bDeltaPicOrderAlwaysZeroFlag) {
623− pSliceHead->iDeltaPicOrderCnt[0] = BsGetSe (pBs);
624− if (pPps->bPicOrderPresentFlag && !pSliceHead->bFieldPicFlag)
625− pSliceHead->iDeltaPicOrderCnt[1] = BsGetSe (pBs);
644+ WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //delta_pic_order_cnt[ 0 ]
645+ pSliceHead->iDeltaPicOrderCnt[0] = iCode;
646+ if (pPps->bPicOrderPresentFlag && !pSliceHead->bFieldPicFlag) {
647+ WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //delta_pic_order_cnt[ 1 ]
648+ pSliceHead->iDeltaPicOrderCnt[1] = iCode;
649+ }
626650 }
627651
628652 pSliceHead->iRedundantPicCnt = 0;
629653 if (pPps->bRedundantPicCntPresentFlag) {
630− uiTmp = BsGetUe (pBs);
654+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //redundant_pic_cnt
631655 // standard section 7.4.3, redundant_pic_cnt should be in range 0 to 127, inclusive.
632− WELS_CHECK_SE_UPPER_ERROR (uiTmp, SLICE_HEADER_REDUNDANT_PIC_CNT_MAX, "redundant_pic_cnt",
656+ WELS_CHECK_SE_UPPER_ERROR (uiCode, SLICE_HEADER_REDUNDANT_PIC_CNT_MAX, "redundant_pic_cnt",
633657 GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_REDUNDANT_PIC_CNT));
634− pSliceHead->iRedundantPicCnt = uiTmp;
658+ pSliceHead->iRedundantPicCnt = uiCode;
635659 }
636660
637661 //set defaults, might be overriden a few line later
@@ -645,9 +669,11 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 7 unmodified lines
645669 WelsLog (pCtx, WELS_LOG_WARNING, "ParseSliceHeaderSyntaxs(): kbBipredFlag = 1 not supported.\n");
646670 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_BIPRED);
647671 }
648− pSliceHead->bNumRefIdxActiveOverrideFlag = !!BsGetOneBit (pBs);
672+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //num_ref_idx_active_override_flag
673+ pSliceHead->bNumRefIdxActiveOverrideFlag = !!uiCode;
649674 if (pSliceHead->bNumRefIdxActiveOverrideFlag) {
650− pSliceHead->uiRefCount[0] = 1 + BsGetUe (pBs);
675+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //num_ref_idx_l0_active_minus1
676+ pSliceHead->uiRefCount[0] = 1 + uiCode;
651677 }
652678 }
653679
@@ -677,7 +703,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 23 unmodified lines
677703 }
678704
679705 if (kbExtensionFlag && !pSubsetSps->sSpsSvcExt.bSliceHeaderRestrictionFlag) {
680− pSliceHeadExt->bStoreRefBasePicFlag = !!BsGetOneBit (pBs);
706+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //store_ref_base_pic_flag
707+ pSliceHeadExt->bStoreRefBasePicFlag = !!uiCode;
681708 if ((pNalHeaderExt->bUseRefBasePicFlag || pSliceHeadExt->bStoreRefBasePicFlag) && !bIdrFlag) {
682709 WelsLog (pCtx, WELS_LOG_WARNING,
683710 "ParseSliceHeaderSyntaxs(): bUseRefBasePicFlag or bStoreRefBasePicFlag = 1 not supported.\n");
@@ -692,7 +719,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 8 unmodified lines
692719 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_CABAC_EL);
693720 }
694721
695− pSliceHead->iSliceQpDelta = BsGetSe (pBs);
722+ WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //slice_qp_delta
723+ pSliceHead->iSliceQpDelta = iCode;
696724 pSliceHead->iSliceQp = pPps->iPicInitQp + pSliceHead->iSliceQpDelta;
697725 if (pSliceHead->iSliceQp < 0 || pSliceHead->iSliceQp > 51) {
698726 WelsLog (pCtx, WELS_LOG_WARNING, "QP %d out of range\n", pSliceHead->iSliceQp);
@@ -711,7 +739,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 12 unmodified lines
711739 pSliceHead->iSliceAlphaC0Offset = 0;
712740 pSliceHead->iSliceBetaOffset = 0;
713741 if (pPps->bDeblockingFilterControlPresentFlag) {
714− pSliceHead->uiDisableDeblockingFilterIdc = BsGetUe (pBs);
742+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //disable_deblocking_filter_idc
743+ pSliceHead->uiDisableDeblockingFilterIdc = uiCode;
715744 //refer to JVT-X201wcm1.doc G.7.4.3.4--2010.4.20
716745 if (pSliceHead->uiDisableDeblockingFilterIdc > 6) {
717746 WelsLog (pCtx, WELS_LOG_WARNING, "disable_deblock_filter_idc (%d) out of range [0, 6]\n",
@@ -719,11 +748,13 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 1 unmodified line
719748 return ERR_INFO_INVALID_DBLOCKING_IDC;
720749 }
721750 if (pSliceHead->uiDisableDeblockingFilterIdc != 1) {
722− pSliceHead->iSliceAlphaC0Offset = BsGetSe (pBs) * 2; // slice_alpha_c0_offset_div2
751+ WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //slice_alpha_c0_offset_div2
752+ pSliceHead->iSliceAlphaC0Offset = iCode * 2;
723753 WELS_CHECK_SE_BOTH_ERROR (pSliceHead->iSliceAlphaC0Offset, SLICE_HEADER_ALPHAC0_BETA_OFFSET_MIN,
724754 SLICE_HEADER_ALPHAC0_BETA_OFFSET_MAX, "slice_alpha_c0_offset_div2 * 2", GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER,
725755 ERR_INFO_INVALID_SLICE_ALPHA_C0_OFFSET_DIV2));
726− pSliceHead->iSliceBetaOffset = BsGetSe (pBs) * 2; // iSliceBetaOffset
756+ WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //slice_beta_offset_div2
757+ pSliceHead->iSliceBetaOffset = iCode * 2;
727758 WELS_CHECK_SE_BOTH_ERROR (pSliceHead->iSliceBetaOffset, SLICE_HEADER_ALPHAC0_BETA_OFFSET_MIN,
728759 SLICE_HEADER_ALPHAC0_BETA_OFFSET_MAX, "slice_beta_offset_div2 * 2", GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER,
729760 ERR_INFO_INVALID_SLICE_BETA_OFFSET_DIV2));
@@ -738,7 +769,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 8 unmodified lines
738769 if (pPps->uiSliceGroupChangeRate > 0) {
739770 const int32_t kiNumBits = (int32_t)WELS_CEIL (log (static_cast<double> (1 + pPps->uiPicSizeInMapUnits /
740771 pPps->uiSliceGroupChangeRate)));
741− pSliceHead->iSliceGroupChangeCycle = BsGetBits (pBs, kiNumBits); // For FMO extra types
772+ WELS_READ_VERIFY (BsGetBits (pBs, kiNumBits, &uiCode)); //lice_group_change_cycle
773+ pSliceHead->iSliceGroupChangeCycle = uiCode;
742774 } else
743775 pSliceHead->iSliceGroupChangeCycle = 0;
744776 }
@@ -751,9 +783,11 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 6 unmodified lines
751783
752784 if (!pNalHeaderExt->iNoInterLayerPredFlag && BASE_QUALITY_ID == uiQualityId) {
753785 //the following should be deleted for CODE_CLEAN
754− pSliceHeadExt->uiRefLayerDqId = BsGetUe (pBs);
786+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //ref_layer_dq_id
787+ pSliceHeadExt->uiRefLayerDqId = uiCode;
755788 if (pSubsetSps->sSpsSvcExt.bInterLayerDeblockingFilterCtrlPresentFlag) {
756− pSliceHeadExt->uiDisableInterLayerDeblockingFilterIdc = BsGetUe (pBs);
789+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //disable_inter_layer_deblocking_filter_idc
790+ pSliceHeadExt->uiDisableInterLayerDeblockingFilterIdc = uiCode;
757791 //refer to JVT-X201wcm1.doc G.7.4.3.4--2010.4.20
758792 if (pSliceHeadExt->uiDisableInterLayerDeblockingFilterIdc > 6) {
759793 WelsLog (pCtx, WELS_LOG_WARNING, "disable_inter_layer_deblock_filter_idc (%d) out of range [0, 6]\n",
@@ -761,12 +795,14 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 1 unmodified line
761795 return ERR_INFO_INVALID_DBLOCKING_IDC;
762796 }
763797 if (pSliceHeadExt->uiDisableInterLayerDeblockingFilterIdc != 1) {
764− pSliceHeadExt->iInterLayerSliceAlphaC0Offset = BsGetSe (pBs) << 1;
798+ WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //inter_layer_slice_alpha_c0_offset_div2
799+ pSliceHeadExt->iInterLayerSliceAlphaC0Offset = iCode * 2;
765800 WELS_CHECK_SE_BOTH_ERROR (pSliceHeadExt->iInterLayerSliceAlphaC0Offset,
766801 SLICE_HEADER_INTER_LAYER_ALPHAC0_BETA_OFFSET_MIN, SLICE_HEADER_INTER_LAYER_ALPHAC0_BETA_OFFSET_MAX,
767802 "inter_layer_alpha_c0_offset_div2 * 2", GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER,
768803 ERR_INFO_INVALID_SLICE_ALPHA_C0_OFFSET_DIV2));
769− pSliceHeadExt->iInterLayerSliceBetaOffset = BsGetSe (pBs) << 1;
804+ WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //inter_layer_slice_beta_offset_div2
805+ pSliceHeadExt->iInterLayerSliceBetaOffset = iCode * 2;
770806 WELS_CHECK_SE_BOTH_ERROR (pSliceHeadExt->iInterLayerSliceBetaOffset, SLICE_HEADER_INTER_LAYER_ALPHAC0_BETA_OFFSET_MIN,
771807 SLICE_HEADER_INTER_LAYER_ALPHAC0_BETA_OFFSET_MAX, "inter_layer_slice_beta_offset_div2 * 2",
772808 GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SLICE_BETA_OFFSET_DIV2));
@@ -776,7 +812,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 3 unmodified lines
776812 pSliceHeadExt->uiRefLayerChromaPhaseXPlus1Flag = pSubsetSps->sSpsSvcExt.uiSeqRefLayerChromaPhaseXPlus1Flag;
777813 pSliceHeadExt->uiRefLayerChromaPhaseYPlus1 = pSubsetSps->sSpsSvcExt.uiSeqRefLayerChromaPhaseYPlus1;
778814
779− pSliceHeadExt->bConstrainedIntraResamplingFlag = !!BsGetOneBit (pBs);
815+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //constrained_intra_resampling_flag
816+ pSliceHeadExt->bConstrainedIntraResamplingFlag = !!uiCode;
780817
781818 {
782819 SPosOffset pos;
@@ -809,32 +846,45 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 26 unmodified lines
809846 pSliceHeadExt->bTCoeffLevelPredFlag = pSubsetSps->sSpsSvcExt.bSeqTCoeffLevelPredFlag;
810847
811848 if (!pNalHeaderExt->iNoInterLayerPredFlag) {
812− pSliceHeadExt->bSliceSkipFlag = !!BsGetOneBit (pBs);
849+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //slice_skip_flag
850+ pSliceHeadExt->bSliceSkipFlag = !!uiCode;
813851 if (pSliceHeadExt->bSliceSkipFlag) {
814− pSliceHeadExt->uiNumMbsInSlice = 1 + BsGetUe (pBs);
852+ WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //num_mbs_in_slice_minus1
853+ pSliceHeadExt->uiNumMbsInSlice = 1 + uiCode;
815854 } else {
816− pSliceHeadExt->bAdaptiveBaseModeFlag = !!BsGetOneBit (pBs);
855+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //adaptive_base_mode_flag
856+ pSliceHeadExt->bAdaptiveBaseModeFlag = !!uiCode;
817857 if (!pSliceHeadExt->bAdaptiveBaseModeFlag) {
818− pSliceHeadExt->bDefaultBaseModeFlag = !!BsGetOneBit (pBs);
858+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //default_base_mode_flag
859+ pSliceHeadExt->bDefaultBaseModeFlag = !!uiCode;
819860 }
820861 if (!pSliceHeadExt->bDefaultBaseModeFlag) {
821− pSliceHeadExt->bAdaptiveMotionPredFlag = !!BsGetOneBit (pBs);
822− if (!pSliceHeadExt->bAdaptiveMotionPredFlag)
823− pSliceHeadExt->bDefaultMotionPredFlag = !!BsGetOneBit (pBs);
862+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //adaptive_motion_prediction_flag
863+ pSliceHeadExt->bAdaptiveMotionPredFlag = !!uiCode;
864+ if (!pSliceHeadExt->bAdaptiveMotionPredFlag) {
865+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //default_motion_prediction_flag
866+ pSliceHeadExt->bDefaultMotionPredFlag = !!uiCode;
867+ }
824868 }
825869
826− pSliceHeadExt->bAdaptiveResidualPredFlag = !!BsGetOneBit (pBs);
870+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //adaptive_residual_prediction_flag
871+ pSliceHeadExt->bAdaptiveResidualPredFlag = !!uiCode;
827872 if (!pSliceHeadExt->bAdaptiveResidualPredFlag) {
828− pSliceHeadExt->bDefaultResidualPredFlag = !!BsGetOneBit (pBs);
873+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //default_residual_prediction_flag
874+ pSliceHeadExt->bDefaultResidualPredFlag = !!uiCode;
829875 }
830876 }
831− if (pSubsetSps->sSpsSvcExt.bAdaptiveTCoeffLevelPredFlag)
832− pSliceHeadExt->bTCoeffLevelPredFlag = !!BsGetOneBit (pBs);
877+ if (pSubsetSps->sSpsSvcExt.bAdaptiveTCoeffLevelPredFlag) {
878+ WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //tcoeff_level_prediction_flag
879+ pSliceHeadExt->bTCoeffLevelPredFlag = !!uiCode;
880+ }
833881 }
834882
835883 if (!pSubsetSps->sSpsSvcExt.bSliceHeaderRestrictionFlag) {
836− pSliceHeadExt->uiScanIdxStart = BsGetBits (pBs, 4);
837− pSliceHeadExt->uiScanIdxEnd = BsGetBits (pBs, 4);
884+ WELS_READ_VERIFY (BsGetBits (pBs, 4, &uiCode)); //scan_idx_start
885+ pSliceHeadExt->uiScanIdxStart = uiCode;
886+ WELS_READ_VERIFY (BsGetBits (pBs, 4, &uiCode)); //scan_idx_end
887+ pSliceHeadExt->uiScanIdxEnd = uiCode;
838888 if (pSliceHeadExt->uiScanIdxStart != 0 || pSliceHeadExt->uiScanIdxEnd != 15) {
839889 WelsLog (pCtx, WELS_LOG_WARNING, "uiScanIdxStart (%d) != 0 and uiScanIdxEnd (%d) !=15 not supported here\n",
840890 pSliceHeadExt->uiScanIdxStart, pSliceHeadExt->uiScanIdxEnd);
@@ -970,84 +1020,84 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 129 unmodified lines
9701020
9711021 memset (pDq, 0, sizeof (SDqLayer));
9721022
973− do {
974− const int32_t kiHshift = iPlaneIdx ? 1 : 0;
975− const int32_t kiVshift = kiHshift;
976− const int32_t kiStride = WELS_ALIGN ((kiPicStride >> kiHshift), (16 << (1 - kiHshift)));
977− const int32_t kiLine = (kiPicLines + (PADDING_LENGTH << 1)) >> kiVshift;
978− const int32_t kiSize = kiStride * kiLine;
979−
980− pCtx->pCsListXchg[i][iPlaneIdx] = (uint8_t*)WelsMalloc (kiSize * sizeof (uint8_t), "pCtx->pCsListXchg[][]");
981−
982− WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY, (NULL == pCtx->pCsListXchg[i][iPlaneIdx]))
983− pCtx->iCsStride[iPlaneIdx] = kiStride;
984−
985−
986− pCtx->pRsListXchg[i][iPlaneIdx] = (int16_t*)WelsMalloc (kiSize * sizeof (int16_t), "pCtx->pRsListXchg[][]");
987−
988− WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY , (NULL == pCtx->pRsListXchg[i][iPlaneIdx]))
989− pCtx->iRsStride[iPlaneIdx] = kiStride;
990−
991− ++ iPlaneIdx;
992− } while (iPlaneIdx < 3);
993−
994−
995− pCtx->sMb.pMbType[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
996− "pCtx->sMb.pMbType[]");
997− pCtx->sMb.pMv[i][0] = (int16_t (*)[16][2])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
998− int16_t) * MV_A * MB_BLOCK4x4_NUM, "pCtx->sMb.pMv[][]");
999− pCtx->sMb.pRefIndex[i][0] = (int8_t (*)[MB_BLOCK4x4_NUM])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
1000− int8_t) * MB_BLOCK4x4_NUM, "pCtx->sMb.pRefIndex[][]");
1001− pCtx->sMb.pLumaQp[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1002− "pCtx->sMb.pLumaQp[]");
1003− pCtx->sMb.pChromaQp[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1004− "pCtx->sMb.pChromaQp[]");
1005− pCtx->sMb.pNzc[i] = (int8_t (*)[24])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t) * 24,
1006− "pCtx->sMb.pNzc[]");
1007− pCtx->sMb.pNzcRs[i] = (int8_t (*)[24])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t) * 24,
1008− "pCtx->sMb.pNzcRs[]");
1009− pCtx->sMb.pScaledTCoeff[i] = (int16_t (*)[MB_COEFF_LIST_SIZE])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight *
1010− sizeof (int16_t) * MB_COEFF_LIST_SIZE, "pCtx->sMb.pScaledTCoeff[]");
1011− pCtx->sMb.pIntraPredMode[i] = (int8_t (*)[8])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t) * 8,
1012− "pCtx->sMb.pIntraPredMode[]");
1013− pCtx->sMb.pIntra4x4FinalMode[i] = (int8_t (*)[MB_BLOCK4x4_NUM])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight *
1014− sizeof (int8_t) * MB_BLOCK4x4_NUM, "pCtx->sMb.pIntra4x4FinalMode[]");
1015− pCtx->sMb.pChromaPredMode[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1016− "pCtx->sMb.pChromaPredMode[]");
1017− pCtx->sMb.pCbp[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1018− "pCtx->sMb.pCbp[]");
1019− pCtx->sMb.pSubMbType[i] = (int8_t (*)[MB_PARTITION_SIZE])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
1020− int8_t) * MB_PARTITION_SIZE, "pCtx->sMb.pSubMbType[]");
1021− pCtx->sMb.pSliceIdc[i] = (int32_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t),
1022− "pCtx->sMb.pSliceIdc[]"); // using int32_t for slice_idc, 4/21/2010
1023− if (pCtx->sMb.pSliceIdc[i] != NULL)
1024− memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
1025− pCtx->sMb.pResidualPredFlag[i] = (int8_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1026− "pCtx->sMb.pResidualPredFlag[]");
1027− //pCtx->sMb.pMotionPredFlag[i] = (uint8_t *) WelsMalloc(pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof(uint8_t), "pCtx->sMb.pMotionPredFlag[]");
1028− pCtx->sMb.pInterPredictionDoneFlag[i] = (int8_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
1029− int8_t), "pCtx->sMb.pInterPredictionDoneFlag[]");
1030−
1031− // check memory block valid due above allocated..
1032− WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY,
1033− ((NULL == pCtx->sMb.pMbType[i]) ||
1034− (NULL == pCtx->sMb.pMv[i][0]) ||
1035− (NULL == pCtx->sMb.pRefIndex[i][0]) ||
1036− (NULL == pCtx->sMb.pLumaQp[i]) ||
1037− (NULL == pCtx->sMb.pChromaQp[i]) ||
1038− (NULL == pCtx->sMb.pNzc[i]) ||
1039− (NULL == pCtx->sMb.pNzcRs[i]) ||
1040− (NULL == pCtx->sMb.pScaledTCoeff[i]) ||
1041− (NULL == pCtx->sMb.pIntraPredMode[i]) ||
1042− (NULL == pCtx->sMb.pIntra4x4FinalMode[i]) ||
1043− (NULL == pCtx->sMb.pChromaPredMode[i]) ||
1044− (NULL == pCtx->sMb.pCbp[i]) ||
1045− (NULL == pCtx->sMb.pSubMbType[i]) ||
1046− (NULL == pCtx->sMb.pSliceIdc[i]) ||
1047− (NULL == pCtx->sMb.pResidualPredFlag[i]) ||
1048− (NULL == pCtx->sMb.pInterPredictionDoneFlag[i])
1049− )
1050− )
1023+ do {
1024+ const int32_t kiHshift = iPlaneIdx ? 1 : 0;
1025+ const int32_t kiVshift = kiHshift;
1026+ const int32_t kiStride = WELS_ALIGN ((kiPicStride >> kiHshift), (16 << (1 - kiHshift)));
1027+ const int32_t kiLine = (kiPicLines + (PADDING_LENGTH << 1)) >> kiVshift;
1028+ const int32_t kiSize = kiStride * kiLine;
1029+
1030+ pCtx->pCsListXchg[i][iPlaneIdx] = (uint8_t*)WelsMalloc (kiSize * sizeof (uint8_t), "pCtx->pCsListXchg[][]");
1031+
1032+ WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY, (NULL == pCtx->pCsListXchg[i][iPlaneIdx]))
1033+ pCtx->iCsStride[iPlaneIdx] = kiStride;
1034+
1035+
1036+ pCtx->pRsListXchg[i][iPlaneIdx] = (int16_t*)WelsMalloc (kiSize * sizeof (int16_t), "pCtx->pRsListXchg[][]");
1037+
1038+ WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY , (NULL == pCtx->pRsListXchg[i][iPlaneIdx]))
1039+ pCtx->iRsStride[iPlaneIdx] = kiStride;
1040+
1041+ ++ iPlaneIdx;
1042+ } while (iPlaneIdx < 3);
1043+
1044+
1045+ pCtx->sMb.pMbType[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1046+ "pCtx->sMb.pMbType[]");
1047+ pCtx->sMb.pMv[i][0] = (int16_t (*)[16][2])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
1048+ int16_t) * MV_A * MB_BLOCK4x4_NUM, "pCtx->sMb.pMv[][]");
1049+ pCtx->sMb.pRefIndex[i][0] = (int8_t (*)[MB_BLOCK4x4_NUM])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
1050+ int8_t) * MB_BLOCK4x4_NUM, "pCtx->sMb.pRefIndex[][]");
1051+ pCtx->sMb.pLumaQp[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1052+ "pCtx->sMb.pLumaQp[]");
1053+ pCtx->sMb.pChromaQp[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1054+ "pCtx->sMb.pChromaQp[]");
1055+ pCtx->sMb.pNzc[i] = (int8_t (*)[24])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t) * 24,
1056+ "pCtx->sMb.pNzc[]");
1057+ pCtx->sMb.pNzcRs[i] = (int8_t (*)[24])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t) * 24,
1058+ "pCtx->sMb.pNzcRs[]");
1059+ pCtx->sMb.pScaledTCoeff[i] = (int16_t (*)[MB_COEFF_LIST_SIZE])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight *
1060+ sizeof (int16_t) * MB_COEFF_LIST_SIZE, "pCtx->sMb.pScaledTCoeff[]");
1061+ pCtx->sMb.pIntraPredMode[i] = (int8_t (*)[8])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t) * 8,
1062+ "pCtx->sMb.pIntraPredMode[]");
1063+ pCtx->sMb.pIntra4x4FinalMode[i] = (int8_t (*)[MB_BLOCK4x4_NUM])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight *
1064+ sizeof (int8_t) * MB_BLOCK4x4_NUM, "pCtx->sMb.pIntra4x4FinalMode[]");
1065+ pCtx->sMb.pChromaPredMode[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1066+ "pCtx->sMb.pChromaPredMode[]");
1067+ pCtx->sMb.pCbp[i] = (int8_t*)WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1068+ "pCtx->sMb.pCbp[]");
1069+ pCtx->sMb.pSubMbType[i] = (int8_t (*)[MB_PARTITION_SIZE])WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
1070+ int8_t) * MB_PARTITION_SIZE, "pCtx->sMb.pSubMbType[]");
1071+ pCtx->sMb.pSliceIdc[i] = (int32_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t),
1072+ "pCtx->sMb.pSliceIdc[]"); // using int32_t for slice_idc, 4/21/2010
1073+ if (pCtx->sMb.pSliceIdc[i] != NULL)
1074+ memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
1075+ pCtx->sMb.pResidualPredFlag[i] = (int8_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
1076+ "pCtx->sMb.pResidualPredFlag[]");
1077+ //pCtx->sMb.pMotionPredFlag[i] = (uint8_t *) WelsMalloc(pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof(uint8_t), "pCtx->sMb.pMotionPredFlag[]");
1078+ pCtx->sMb.pInterPredictionDoneFlag[i] = (int8_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
1079+ int8_t), "pCtx->sMb.pInterPredictionDoneFlag[]");
1080+
1081+ // check memory block valid due above allocated..
1082+ WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY,
1083+ ((NULL == pCtx->sMb.pMbType[i]) ||
1084+ (NULL == pCtx->sMb.pMv[i][0]) ||
1085+ (NULL == pCtx->sMb.pRefIndex[i][0]) ||
1086+ (NULL == pCtx->sMb.pLumaQp[i]) ||
1087+ (NULL == pCtx->sMb.pChromaQp[i]) ||
1088+ (NULL == pCtx->sMb.pNzc[i]) ||
1089+ (NULL == pCtx->sMb.pNzcRs[i]) ||
1090+ (NULL == pCtx->sMb.pScaledTCoeff[i]) ||
1091+ (NULL == pCtx->sMb.pIntraPredMode[i]) ||
1092+ (NULL == pCtx->sMb.pIntra4x4FinalMode[i]) ||
1093+ (NULL == pCtx->sMb.pChromaPredMode[i]) ||
1094+ (NULL == pCtx->sMb.pCbp[i]) ||
1095+ (NULL == pCtx->sMb.pSubMbType[i]) ||
1096+ (NULL == pCtx->sMb.pSliceIdc[i]) ||
1097+ (NULL == pCtx->sMb.pResidualPredFlag[i]) ||
1098+ (NULL == pCtx->sMb.pInterPredictionDoneFlag[i])
1099+ )
1100+ )
10511101
10521102 pCtx->pDqLayersList[i] = pDq;
10531103 ++ i;
@@ -1603,7 +1653,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 549 unmodified lines
16031653 if (NAL_UNIT_CODED_SLICE_IDR == pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.sNalUnitHeader.eNalUnitType ||
16041654 pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.bIdrFlag) {
16051655 WelsResetRefPic (pCtx); //clear ref pPic when IDR NAL
1606− iErr = SyncPictureResolutionExt (pCtx, pCtx->pSps->iMbWidth, pCtx->pSps->iMbHeight);
1656+ iErr = SyncPictureResolutionExt (pCtx, pCtx->pSps->iMbWidth, pCtx->pSps->iMbHeight);
16071657
16081658 if (ERR_NONE != iErr) {
16091659 WelsLog (pCtx, WELS_LOG_WARNING, "sync picture resolution ext failed, the error is %d", iErr);
@@ -1854,7 +1904,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 · 244 unmodified lines
18541904
18551905 if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) {
18561906 const bool kbIdrFlag = dq_cur->sLayerInfo.sNalHeaderExt.bIdrFlag
1857− || (dq_cur->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR);
1907+ || (dq_cur->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR);
18581908 // Subclause 8.2.5.2 Decoding process for gaps in frame_num
18591909 if (!kbIdrFlag &&
18601910 pSh->iFrameNum != pCtx->iPrevFrameNum &&

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