Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 7 files). Show all
Unified · Split
| @@ -363,7 +363,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 362 unmodified lines | ||
| 363 | 363 | |
| 364 | 364 | |
| 365 | 365 | bool CheckAccessUnitBoundaryExt (PNalUnitHeaderExt pLastNalHdrExt, PNalUnitHeaderExt pCurNalHeaderExt, |
| 366 | − PSliceHeader pLastSliceHeader, PSliceHeader pCurSliceHeader) { | |
| 366 | + PSliceHeader pLastSliceHeader, PSliceHeader pCurSliceHeader) { | |
| 367 | 367 | const PSps kpSps = pCurSliceHeader->pSps; |
| 368 | 368 | |
| 369 | 369 | //Sub-clause 7.1.4.1.1 temporal_id |
| @@ -559,13 +559,16 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t · 189 unmodified lines | ||
| 559 | 559 | return iErr; |
| 560 | 560 | } |
| 561 | 561 | |
| 562 | −void ParseRefBasePicMarking (PBitStringAux pBs, PRefBasePicMarking pRefBasePicMarking) { | |
| 563 | − const bool kbAdaptiveMarkingModeFlag = !!BsGetOneBit (pBs); | |
| 562 | +int32_t ParseRefBasePicMarking (PBitStringAux pBs, PRefBasePicMarking pRefBasePicMarking) { | |
| 563 | + uint32_t uiCode; | |
| 564 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //adaptive_ref_base_pic_marking_mode_flag | |
| 565 | + const bool kbAdaptiveMarkingModeFlag = !!uiCode; | |
| 564 | 566 | pRefBasePicMarking->bAdaptiveRefBasePicMarkingModeFlag = kbAdaptiveMarkingModeFlag; |
| 565 | 567 | if (kbAdaptiveMarkingModeFlag) { |
| 566 | 568 | int32_t iIdx = 0; |
| 567 | 569 | do { |
| 568 | − const uint32_t kuiMmco = BsGetUe (pBs); | |
| 570 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //MMCO_base | |
| 571 | + const uint32_t kuiMmco = uiCode; | |
| 569 | 572 | |
| 570 | 573 | pRefBasePicMarking->mmco_base[iIdx].uiMmcoType = kuiMmco; |
| 571 | 574 | |
| @@ -573,31 +576,39 @@ void ParseRefBasePicMarking (PBitStringAux pBs, PRefBasePicMarking pRefBasePicMa · 1 unmodified line | ||
| 573 | 576 | break; |
| 574 | 577 | |
| 575 | 578 | if (kuiMmco == MMCO_SHORT2UNUSED) { |
| 576 | − pRefBasePicMarking->mmco_base[iIdx].uiDiffOfPicNums = 1 + BsGetUe (pBs); | |
| 579 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //difference_of_base_pic_nums_minus1 | |
| 580 | + pRefBasePicMarking->mmco_base[iIdx].uiDiffOfPicNums = 1 + uiCode; | |
| 577 | 581 | pRefBasePicMarking->mmco_base[iIdx].iShortFrameNum = 0; |
| 578 | 582 | } else if (kuiMmco == MMCO_LONG2UNUSED) { |
| 579 | − pRefBasePicMarking->mmco_base[iIdx].uiLongTermPicNum = BsGetUe (pBs); | |
| 583 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_base_pic_num | |
| 584 | + pRefBasePicMarking->mmco_base[iIdx].uiLongTermPicNum = uiCode; | |
| 580 | 585 | } |
| 581 | 586 | ++ iIdx; |
| 582 | 587 | } while (iIdx < MAX_MMCO_COUNT); |
| 583 | 588 | } |
| 589 | + return ERR_NONE; | |
| 584 | 590 | } |
| 585 | 591 | |
| 586 | −void ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs) { | |
| 592 | +int32_t ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs) { | |
| 587 | 593 | PNalUnit pCurNal = &pCtx->sPrefixNal; |
| 594 | + uint32_t uiCode; | |
| 588 | 595 | |
| 589 | 596 | if (pCurNal->sNalHeaderExt.sNalUnitHeader.uiNalRefIdc != 0) { |
| 590 | 597 | PNalUnitHeaderExt head_ext = &pCurNal->sNalHeaderExt; |
| 591 | 598 | PPrefixNalUnit sPrefixNal = &pCurNal->sNalData.sPrefixNal; |
| 592 | − sPrefixNal->bStoreRefBasePicFlag = !!BsGetOneBit (pBs); | |
| 599 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //store_ref_base_pic_flag | |
| 600 | + sPrefixNal->bStoreRefBasePicFlag = !!uiCode; | |
| 593 | 601 | if ((head_ext->bUseRefBasePicFlag || sPrefixNal->bStoreRefBasePicFlag) && !head_ext->bIdrFlag) { |
| 594 | − ParseRefBasePicMarking (pBs, &sPrefixNal->sRefPicBaseMarking); | |
| 602 | + WELS_READ_VERIFY (ParseRefBasePicMarking (pBs, &sPrefixNal->sRefPicBaseMarking)); | |
| 595 | 603 | } |
| 596 | − sPrefixNal->bPrefixNalUnitAdditionalExtFlag = !!BsGetOneBit (pBs); | |
| 604 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //additional_prefix_nal_unit_extension_flag | |
| 605 | + sPrefixNal->bPrefixNalUnitAdditionalExtFlag = uiCode; | |
| 597 | 606 | if (sPrefixNal->bPrefixNalUnitAdditionalExtFlag) { |
| 598 | − sPrefixNal->bPrefixNalUnitExtFlag = !!BsGetOneBit (pBs); | |
| 607 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //additional_prefix_nal_unit_extension_data_flag | |
| 608 | + sPrefixNal->bPrefixNalUnitExtFlag = !!uiCode; | |
| 599 | 609 | } |
| 600 | 610 | } |
| 611 | + return ERR_NONE; | |
| 601 | 612 | } |
| 602 | 613 | |
| 603 | 614 | #define SUBSET_SPS_SEQ_SCALED_REF_LAYER_LEFT_OFFSET_MIN -32768 |
| @@ -615,11 +626,15 @@ void ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs) { · 11 unmodified lines | ||
| 615 | 626 | int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStringAux pBs) { |
| 616 | 627 | PSpsSvcExt pExt = NULL; |
| 617 | 628 | uint8_t uiChromaArrayType = 1; |
| 629 | + uint32_t uiCode; | |
| 630 | + int32_t iCode; | |
| 618 | 631 | |
| 619 | 632 | pExt = &pSpsExt->sSpsSvcExt; |
| 620 | 633 | |
| 621 | − pExt->bInterLayerDeblockingFilterCtrlPresentFlag = !!BsGetOneBit (pBs); | |
| 622 | − pExt->uiExtendedSpatialScalability = BsGetBits (pBs, 2); | |
| 634 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //inter_layer_deblocking_filter_control_present_flag | |
| 635 | + pExt->bInterLayerDeblockingFilterCtrlPresentFlag = !!uiCode; | |
| 636 | + WELS_READ_VERIFY (BsGetBits (pBs, 2, &uiCode)); //extended_spatial_scalability_idc | |
| 637 | + pExt->uiExtendedSpatialScalability = uiCode; | |
| 623 | 638 | if (pExt->uiExtendedSpatialScalability > 2) { |
| 624 | 639 | WelsLog (pCtx, WELS_LOG_WARNING, "DecodeSpsSvcExt():extended_spatial_scalability (%d) != 0, ESS not supported!\n", |
| 625 | 640 | pExt->uiExtendedSpatialScalability); |
| @@ -631,8 +646,10 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin · 5 unmodified lines | ||
| 631 | 646 | pExt->uiChromaPhaseYPlus1 = 1; |
| 632 | 647 | uiChromaArrayType = pSpsExt->sSps.uiChromaArrayType; |
| 633 | 648 | |
| 634 | − pExt->uiChromaPhaseXPlus1Flag = BsGetOneBit (pBs); | |
| 635 | − pExt->uiChromaPhaseYPlus1 = BsGetBits (pBs, 2); | |
| 649 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //chroma_phase_x_plus1_flag | |
| 650 | + pExt->uiChromaPhaseXPlus1Flag = uiCode; | |
| 651 | + WELS_READ_VERIFY (BsGetBits (pBs, 2, &uiCode)); //chroma_phase_y_plus1 | |
| 652 | + pExt->uiChromaPhaseYPlus1 = uiCode; | |
| 636 | 653 | |
| 637 | 654 | pExt->uiSeqRefLayerChromaPhaseXPlus1Flag = pExt->uiChromaPhaseXPlus1Flag; |
| 638 | 655 | pExt->uiSeqRefLayerChromaPhaseYPlus1 = pExt->uiChromaPhaseYPlus1; |
| @@ -640,28 +657,38 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin · 1 unmodified line | ||
| 640 | 657 | |
| 641 | 658 | if (pExt->uiExtendedSpatialScalability == 1) { |
| 642 | 659 | SPosOffset* const kpPos = &pExt->sSeqScaledRefLayer; |
| 643 | − pExt->uiSeqRefLayerChromaPhaseXPlus1Flag = BsGetOneBit (pBs); | |
| 644 | − pExt->uiSeqRefLayerChromaPhaseYPlus1 = BsGetBits (pBs, 2); | |
| 660 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_ref_layer_chroma_phase_x_plus1_flag | |
| 661 | + pExt->uiSeqRefLayerChromaPhaseXPlus1Flag = uiCode; | |
| 662 | + WELS_READ_VERIFY (BsGetBits (pBs, 2, &uiCode)); //seq_ref_layer_chroma_phase_y_plus1 | |
| 663 | + pExt->uiSeqRefLayerChromaPhaseYPlus1 = uiCode; | |
| 645 | 664 | |
| 646 | − kpPos->iLeftOffset = BsGetSe (pBs); | |
| 665 | + WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //seq_scaled_ref_layer_left_offset | |
| 666 | + kpPos->iLeftOffset = iCode; | |
| 647 | 667 | WELS_CHECK_SE_BOTH_WARNING (kpPos->iLeftOffset, SUBSET_SPS_SEQ_SCALED_REF_LAYER_LEFT_OFFSET_MIN, |
| 648 | 668 | SUBSET_SPS_SEQ_SCALED_REF_LAYER_LEFT_OFFSET_MAX, "seq_scaled_ref_layer_left_offset"); |
| 649 | − kpPos->iTopOffset = BsGetSe (pBs); | |
| 669 | + WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //seq_scaled_ref_layer_top_offset | |
| 670 | + kpPos->iTopOffset = iCode; | |
| 650 | 671 | WELS_CHECK_SE_BOTH_WARNING (kpPos->iTopOffset, SUBSET_SPS_SEQ_SCALED_REF_LAYER_TOP_OFFSET_MIN, |
| 651 | 672 | SUBSET_SPS_SEQ_SCALED_REF_LAYER_TOP_OFFSET_MAX, "seq_scaled_ref_layer_top_offset"); |
| 652 | − kpPos->iRightOffset = BsGetSe (pBs); | |
| 673 | + WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //seq_scaled_ref_layer_right_offset | |
| 674 | + kpPos->iRightOffset = iCode; | |
| 653 | 675 | WELS_CHECK_SE_BOTH_WARNING (kpPos->iRightOffset, SUBSET_SPS_SEQ_SCALED_REF_LAYER_RIGHT_OFFSET_MIN, |
| 654 | 676 | SUBSET_SPS_SEQ_SCALED_REF_LAYER_RIGHT_OFFSET_MAX, "seq_scaled_ref_layer_right_offset"); |
| 655 | − kpPos->iBottomOffset = BsGetSe (pBs); | |
| 677 | + WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //seq_scaled_ref_layer_bottom_offset | |
| 678 | + kpPos->iBottomOffset = iCode; | |
| 656 | 679 | WELS_CHECK_SE_BOTH_WARNING (kpPos->iBottomOffset, SUBSET_SPS_SEQ_SCALED_REF_LAYER_BOTTOM_OFFSET_MIN, |
| 657 | 680 | SUBSET_SPS_SEQ_SCALED_REF_LAYER_BOTTOM_OFFSET_MAX, "seq_scaled_ref_layer_bottom_offset"); |
| 658 | 681 | } |
| 659 | 682 | |
| 660 | − pExt->bSeqTCoeffLevelPredFlag = !!BsGetOneBit (pBs); | |
| 683 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_tcoeff_level_prediction_flag | |
| 684 | + pExt->bSeqTCoeffLevelPredFlag = !!uiCode; | |
| 661 | 685 | pExt->bAdaptiveTCoeffLevelPredFlag = false; |
| 662 | − if (pExt->bSeqTCoeffLevelPredFlag) | |
| 663 | − pExt->bAdaptiveTCoeffLevelPredFlag = !!BsGetOneBit (pBs); | |
| 664 | − pExt->bSliceHeaderRestrictionFlag = !!BsGetOneBit (pBs); | |
| 686 | + if (pExt->bSeqTCoeffLevelPredFlag) { | |
| 687 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //adaptive_tcoeff_level_prediction_flag | |
| 688 | + pExt->bAdaptiveTCoeffLevelPredFlag = !!uiCode; | |
| 689 | + } | |
| 690 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //slice_header_restriction_flag | |
| 691 | + pExt->bSliceHeaderRestrictionFlag = !!uiCode; | |
| 665 | 692 | |
| 666 | 693 | |
| 667 | 694 | |
| @@ -689,7 +716,7 @@ static const SLevelLimits g_kSLevelLimits[17] = { · 21 unmodified lines | ||
| 689 | 716 | {2073600, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16} /* level 5.2 */ |
| 690 | 717 | }; |
| 691 | 718 | |
| 692 | −const SLevelLimits *GetLevelLimits(int32_t iLevelIdx, bool bConstraint3) { | |
| 719 | +const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) { | |
| 693 | 720 | switch (iLevelIdx) { |
| 694 | 721 | case 10: |
| 695 | 722 | return &g_kSLevelLimits[0]; |
| @@ -765,7 +792,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 69 unmodified lines | ||
| 765 | 792 | ProfileIdc uiProfileIdc; |
| 766 | 793 | uint8_t uiLevelIdc; |
| 767 | 794 | int32_t iSpsId; |
| 768 | − uint32_t uiTmp; | |
| 795 | + uint32_t uiCode; | |
| 796 | + int32_t iCode; | |
| 769 | 797 | bool bConstraintSetFlags[6] = { false }; |
| 770 | 798 | const bool kbUseSubsetFlag = IS_SUBSET_SPS_NAL (pNalHead->eNalUnitType); |
| 771 | 799 | |
| @@ -787,16 +815,25 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 15 unmodified lines | ||
| 787 | 815 | #endif //MOSAIC_AVOID_BASED_ON_SPS_PPS_ID |
| 788 | 816 | } |
| 789 | 817 | |
| 790 | − uiProfileIdc = BsGetBits (pBs, 8); | |
| 791 | − bConstraintSetFlags[0] = !!BsGetOneBit (pBs); // constraint_set0_flag | |
| 792 | − bConstraintSetFlags[1] = !!BsGetOneBit (pBs); // constraint_set1_flag | |
| 793 | − bConstraintSetFlags[2] = !!BsGetOneBit (pBs); // constraint_set2_flag | |
| 794 | − bConstraintSetFlags[3] = !!BsGetOneBit (pBs); // constraint_set3_flag | |
| 795 | − bConstraintSetFlags[4] = !!BsGetOneBit (pBs); // constraint_set4_flag | |
| 796 | − bConstraintSetFlags[5] = !!BsGetOneBit (pBs); // constraint_set5_flag | |
| 797 | − BsGetBits (pBs, 2); // reserved_zero_2bits, equal to 0 | |
| 798 | − uiLevelIdc = BsGetBits (pBs, 8); // level_idc | |
| 799 | − iSpsId = BsGetUe (pBs); // seq_parameter_set_id | |
| 818 | + WELS_READ_VERIFY (BsGetBits (pBs, 8, &uiCode)); //profile_idc | |
| 819 | + uiProfileIdc = uiCode; | |
| 820 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //constraint_set0_flag | |
| 821 | + bConstraintSetFlags[0] = !!uiCode; | |
| 822 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //constraint_set1_flag | |
| 823 | + bConstraintSetFlags[1] = !!uiCode; | |
| 824 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //constraint_set2_flag | |
| 825 | + bConstraintSetFlags[2] = !!uiCode; | |
| 826 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //constraint_set3_flag | |
| 827 | + bConstraintSetFlags[3] = !!uiCode; | |
| 828 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //constraint_set4_flag | |
| 829 | + bConstraintSetFlags[4] = !!uiCode; | |
| 830 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //constraint_set5_flag | |
| 831 | + bConstraintSetFlags[5] = !!uiCode; | |
| 832 | + WELS_READ_VERIFY (BsGetBits (pBs, 2, &uiCode)); // reserved_zero_2bits, equal to 0 | |
| 833 | + WELS_READ_VERIFY (BsGetBits (pBs, 8, &uiCode)); // level_idc | |
| 834 | + uiLevelIdc = uiCode; | |
| 835 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //seq_parameter_set_id | |
| 836 | + iSpsId = uiCode; | |
| 800 | 837 | if (iSpsId >= MAX_SPS_COUNT || iSpsId < 0) { // Modified to check invalid negative iSpsId, 12/1/2009 |
| 801 | 838 | WelsLog (pCtx, WELS_LOG_WARNING, " iSpsId is out of range! \n"); |
| 802 | 839 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_SPS_ID_OVERFLOW); |
| @@ -846,25 +883,30 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 43 unmodified lines | ||
| 846 | 883 | PRO_HIGH422 == uiProfileIdc || PRO_HIGH444 == uiProfileIdc || |
| 847 | 884 | PRO_CAVLC444 == uiProfileIdc || 44 == uiProfileIdc) { |
| 848 | 885 | |
| 849 | − pSps->uiChromaFormatIdc = BsGetUe (pBs); | |
| 886 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc | |
| 887 | + pSps->uiChromaFormatIdc = uiCode; | |
| 850 | 888 | if (pSps->uiChromaFormatIdc != 1) { |
| 851 | 889 | WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.\n", pSps->uiChromaFormatIdc); |
| 852 | 890 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE); |
| 853 | 891 | } |
| 854 | 892 | pSps->uiChromaArrayType = pSps->uiChromaFormatIdc; |
| 855 | − pSps->uiBitDepthLuma = 8 + BsGetUe (pBs); | |
| 893 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8 | |
| 894 | + pSps->uiBitDepthLuma = 8 + uiCode; | |
| 856 | 895 | if (pSps->uiBitDepthLuma != 8) { |
| 857 | 896 | WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", pSps->uiBitDepthLuma); |
| 858 | 897 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE); |
| 859 | 898 | } |
| 860 | 899 | |
| 861 | − pSps->uiBitDepthChroma = 8 + BsGetUe (pBs); | |
| 900 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_chroma_minus8 | |
| 901 | + pSps->uiBitDepthChroma = 8 + uiCode; | |
| 862 | 902 | if (pSps->uiBitDepthChroma != 8) { |
| 863 | 903 | WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", pSps->uiBitDepthChroma); |
| 864 | 904 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE); |
| 865 | 905 | } |
| 866 | − pSps->bQpPrimeYZeroTransfBypassFlag = !!BsGetOneBit (pBs); | |
| 867 | − pSps->bSeqScalingMatrixPresentFlag = !!BsGetOneBit (pBs); | |
| 906 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //qpprime_y_zero_transform_bypass_flag | |
| 907 | + pSps->bQpPrimeYZeroTransfBypassFlag = !!uiCode; | |
| 908 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag | |
| 909 | + pSps->bSeqScalingMatrixPresentFlag = !!uiCode; | |
| 868 | 910 | |
| 869 | 911 | if (pSps->bSeqScalingMatrixPresentFlag) { // For high profile, it is not used in current application. FIXME |
| 870 | 912 | WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.\n", |
| @@ -872,54 +914,62 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 1 unmodified line | ||
| 872 | 914 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE); |
| 873 | 915 | } |
| 874 | 916 | } |
| 875 | − uiTmp = BsGetUe (pBs); | |
| 876 | − WELS_CHECK_SE_UPPER_ERROR (uiTmp, SPS_LOG2_MAX_FRAME_NUM_MINUS4_MAX, "log2_max_frame_num_minus4", | |
| 917 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_frame_num_minus4 | |
| 918 | + WELS_CHECK_SE_UPPER_ERROR (uiCode, SPS_LOG2_MAX_FRAME_NUM_MINUS4_MAX, "log2_max_frame_num_minus4", | |
| 877 | 919 | GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_LOG2_MAX_FRAME_NUM_MINUS4)); |
| 878 | − pSps->uiLog2MaxFrameNum = LOG2_MAX_FRAME_NUM_OFFSET + uiTmp; // log2_max_frame_num_minus4 | |
| 879 | − pSps->uiPocType = BsGetUe (pBs); // pic_order_cnt_type | |
| 920 | + pSps->uiLog2MaxFrameNum = LOG2_MAX_FRAME_NUM_OFFSET + uiCode; | |
| 921 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_order_cnt_type | |
| 922 | + pSps->uiPocType = uiCode; | |
| 880 | 923 | |
| 881 | 924 | if (0 == pSps->uiPocType) { |
| 882 | − uiTmp = BsGetUe (pBs); | |
| 925 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //log2_max_pic_order_cnt_lsb_minus4 | |
| 883 | 926 | // log2_max_pic_order_cnt_lsb_minus4 should be in range 0 to 12, inclusive. (sec. 7.4.3) |
| 884 | − WELS_CHECK_SE_UPPER_ERROR (uiTmp, SPS_LOG2_MAX_PIC_ORDER_CNT_LSB_MINUS4_MAX, "log2_max_pic_order_cnt_lsb_minus4", | |
| 927 | + WELS_CHECK_SE_UPPER_ERROR (uiCode, SPS_LOG2_MAX_PIC_ORDER_CNT_LSB_MINUS4_MAX, "log2_max_pic_order_cnt_lsb_minus4", | |
| 885 | 928 | GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_LOG2_MAX_PIC_ORDER_CNT_LSB_MINUS4)); |
| 886 | − pSps->iLog2MaxPocLsb = LOG2_MAX_PIC_ORDER_CNT_LSB_OFFSET + uiTmp; // log2_max_pic_order_cnt_lsb_minus4 | |
| 929 | + pSps->iLog2MaxPocLsb = LOG2_MAX_PIC_ORDER_CNT_LSB_OFFSET + uiCode; // log2_max_pic_order_cnt_lsb_minus4 | |
| 887 | 930 | |
| 888 | 931 | } else if (1 == pSps->uiPocType) { |
| 889 | 932 | int32_t i; |
| 890 | − pSps->bDeltaPicOrderAlwaysZeroFlag = !!BsGetOneBit (pBs); // bDeltaPicOrderAlwaysZeroFlag | |
| 891 | − pSps->iOffsetForNonRefPic = BsGetSe (pBs); // iOffsetForNonRefPic | |
| 892 | − pSps->iOffsetForTopToBottomField = BsGetSe (pBs); // iOffsetForTopToBottomField | |
| 893 | − uiTmp = BsGetUe (pBs); | |
| 894 | − WELS_CHECK_SE_UPPER_ERROR (uiTmp, SPS_NUM_REF_FRAMES_IN_PIC_ORDER_CNT_CYCLE_MAX, | |
| 933 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //delta_pic_order_always_zero_flag | |
| 934 | + pSps->bDeltaPicOrderAlwaysZeroFlag = !!uiCode; | |
| 935 | + WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //offset_for_non_ref_pic | |
| 936 | + pSps->iOffsetForNonRefPic = iCode; | |
| 937 | + WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //offset_for_top_to_bottom_field | |
| 938 | + pSps->iOffsetForTopToBottomField = iCode; | |
| 939 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //num_ref_frames_in_pic_order_cnt_cycle | |
| 940 | + WELS_CHECK_SE_UPPER_ERROR (uiCode, SPS_NUM_REF_FRAMES_IN_PIC_ORDER_CNT_CYCLE_MAX, | |
| 895 | 941 | "num_ref_frames_in_pic_order_cnt_cycle", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, |
| 896 | 942 | ERR_INFO_INVALID_NUM_REF_FRAME_IN_PIC_ORDER_CNT_CYCLE)); |
| 897 | − pSps->iNumRefFramesInPocCycle = uiTmp; // num_ref_frames_in_pic_order_cnt_cycle | |
| 898 | − for (i = 0; i < pSps->iNumRefFramesInPocCycle; i++) | |
| 899 | − pSps->iOffsetForRefFrame[ i ] = BsGetSe (pBs); // iOffsetForRefFrame[ i ] | |
| 943 | + pSps->iNumRefFramesInPocCycle = uiCode; | |
| 944 | + for (i = 0; i < pSps->iNumRefFramesInPocCycle; i++) { | |
| 945 | + WELS_READ_VERIFY (BsGetSe (pBs, &iCode)); //offset_for_ref_frame[ i ] | |
| 946 | + pSps->iOffsetForRefFrame[ i ] = iCode; | |
| 947 | + } | |
| 900 | 948 | } |
| 901 | 949 | if (pSps->uiPocType > 2) { |
| 902 | 950 | WelsLog (pCtx, WELS_LOG_WARNING, " illegal pic_order_cnt_type: %d ! \n", pSps->uiPocType); |
| 903 | 951 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_POC_TYPE); |
| 904 | 952 | } |
| 905 | 953 | |
| 906 | − pSps->iNumRefFrames = BsGetUe (pBs); // max_num_ref_frames | |
| 907 | − pSps->bGapsInFrameNumValueAllowedFlag = !!BsGetOneBit (pBs); // bGapsInFrameNumValueAllowedFlag | |
| 908 | − uiTmp = BsGetUe (pBs); // pic_width_in_mbs_minus1 | |
| 909 | − if (uiTmp == 0xffffffff) { | |
| 954 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_num_ref_frames | |
| 955 | + pSps->iNumRefFrames = uiCode; | |
| 956 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //gaps_in_frame_num_value_allowed_flag | |
| 957 | + pSps->bGapsInFrameNumValueAllowedFlag = !!uiCode; | |
| 958 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_width_in_mbs_minus1 | |
| 959 | + if (uiCode == 0xffffffff) { | |
| 910 | 960 | WelsLog (pCtx, WELS_LOG_ERROR, " pic_width_in_mbs read error!\n"); |
| 911 | 961 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MB_SIZE_INFO); |
| 912 | 962 | } |
| 913 | − pSps->iMbWidth = PIC_WIDTH_IN_MBS_OFFSET + uiTmp; | |
| 963 | + pSps->iMbWidth = PIC_WIDTH_IN_MBS_OFFSET + uiCode; | |
| 914 | 964 | if ((uint64_t) (pSps->iMbWidth * pSps->iMbWidth) > (8 * pSLevelLimits->iMaxFS)) { |
| 915 | 965 | WelsLog (pCtx, WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n"); |
| 916 | 966 | } |
| 917 | − uiTmp = BsGetUe (pBs); // pic_height_in_map_units_minus1 | |
| 918 | − if (uiTmp == 0xffffffff) { | |
| 967 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1 | |
| 968 | + if (uiCode == 0xffffffff) { | |
| 919 | 969 | WelsLog (pCtx, WELS_LOG_ERROR, " pic_height_in_mbs read error!\n"); |
| 920 | 970 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MB_SIZE_INFO); |
| 921 | 971 | } |
| 922 | − pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiTmp; | |
| 972 | + pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode; | |
| 923 | 973 | if ((uint64_t) (pSps->iMbHeight * pSps->iMbHeight) > (8 * pSLevelLimits->iMaxFS)) { |
| 924 | 974 | WelsLog (pCtx, WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n"); |
| 925 | 975 | } |
| @@ -937,21 +987,28 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 11 unmodified lines | ||
| 937 | 987 | if ((uint32_t)pSps->iNumRefFrames > uiMaxDpbFrames) { |
| 938 | 988 | WelsLog (pCtx, WELS_LOG_WARNING, " max_num_ref_frames exceeds level limits!\n"); |
| 939 | 989 | } |
| 940 | − pSps->bFrameMbsOnlyFlag = !!BsGetOneBit (pBs); // frame_mbs_only_flag | |
| 990 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //frame_mbs_only_flag | |
| 991 | + pSps->bFrameMbsOnlyFlag = !!uiCode; | |
| 941 | 992 | if (!pSps->bFrameMbsOnlyFlag) { |
| 942 | 993 | WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): frame_mbs_only_flag (%d) not supported.\n", pSps->bFrameMbsOnlyFlag); |
| 943 | 994 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_MBAFF); |
| 944 | 995 | } |
| 945 | − pSps->bDirect8x8InferenceFlag = !!BsGetOneBit (pBs); // direct_8x8_inference_flag | |
| 946 | − pSps->bFrameCroppingFlag = !!BsGetOneBit (pBs); // frame_cropping_flag | |
| 996 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //direct_8x8_inference_flag | |
| 997 | + pSps->bDirect8x8InferenceFlag = !!uiCode; | |
| 998 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //frame_cropping_flag | |
| 999 | + pSps->bFrameCroppingFlag = !!uiCode; | |
| 947 | 1000 | if (pSps->bFrameCroppingFlag) { |
| 948 | − pSps->sFrameCrop.iLeftOffset = BsGetUe (pBs); // frame_crop_left_offset | |
| 949 | − pSps->sFrameCrop.iRightOffset = BsGetUe (pBs); // frame_crop_right_offset | |
| 1001 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_left_offset | |
| 1002 | + pSps->sFrameCrop.iLeftOffset = uiCode; | |
| 1003 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_right_offset | |
| 1004 | + pSps->sFrameCrop.iRightOffset = uiCode; | |
| 950 | 1005 | if ((pSps->sFrameCrop.iLeftOffset + pSps->sFrameCrop.iRightOffset) > ((int32_t)pSps->iMbWidth * 16 / 2)) { |
| 951 | 1006 | WelsLog (pCtx, WELS_LOG_WARNING, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!\n"); |
| 952 | 1007 | } |
| 953 | − pSps->sFrameCrop.iTopOffset = BsGetUe (pBs); // frame_crop_top_offset | |
| 954 | − pSps->sFrameCrop.iBottomOffset = BsGetUe (pBs); // frame_crop_bottom_offset | |
| 1008 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_top_offset | |
| 1009 | + pSps->sFrameCrop.iTopOffset = uiCode; | |
| 1010 | + WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_bottom_offset | |
| 1011 | + pSps->sFrameCrop.iBottomOffset = uiCode; | |
| 955 | 1012 | if ((pSps->sFrameCrop.iTopOffset + pSps->sFrameCrop.iBottomOffset) > ((int32_t)pSps->iMbHeight * 16 / 2)) { |
| 956 | 1013 | WelsLog (pCtx, WELS_LOG_WARNING, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!\n"); |
| 957 | 1014 | } |
| @@ -961,7 +1018,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 3 unmodified lines | ||
| 961 | 1018 | pSps->sFrameCrop.iTopOffset = 0; // frame_crop_top_offset |
| 962 | 1019 | pSps->sFrameCrop.iBottomOffset = 0; // frame_crop_bottom_offset |
| 963 | 1020 | } |
| 964 | − pSps->bVuiParamPresentFlag = !!BsGetOneBit (pBs); // vui_parameters_present_flag | |
| 1021 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //vui_parameters_present_flag | |
| 1022 | + pSps->bVuiParamPresentFlag = !!uiCode; | |
| 965 | 1023 | |
| 966 | 1024 | // Check if SPS SVC extension applicated |
| 967 | 1025 | if (kbUseSubsetFlag && (PRO_SCALABLE_BASELINE == uiProfileIdc || PRO_SCALABLE_HIGH == uiProfileIdc)) { |
| @@ -969,7 +1027,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 1 unmodified line | ||
| 969 | 1027 | return -1; |
| 970 | 1028 | } |
| 971 | 1029 | |
| 972 | − pSubsetSps->bSvcVuiParamPresentFlag = !!BsGetOneBit (pBs); | |
| 1030 | + WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //svc_vui_parameters_present_flag | |
| 1031 | + pSubsetSps->bSvcVuiParamPresentFlag = !!uiCode; | |
| 973 | 1032 | if (pSubsetSps->bSvcVuiParamPresentFlag) { |
| 974 | 1033 | } |
| 975 | 1034 | } |
| @@ -1005,8 +1064,11 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) · 29 unmodified lines | ||
| 1005 | 1064 | PPps pPps = NULL; |
| 1006 | 1065 | uint32_t uiPpsId = 0; |
| 1007 | 1066 | uint32_t iTmp; |
| 1067 | + uint32_t uiCode; | |
| 1068 | + int32_t iCode; | |
| 1008 | 1069 | |
| 1009 | − uiPpsId = BsGetUe (pBsAux); | |
| 1070 | + WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //pic_parameter_set_id | |
| 1071 | + uiPpsId = uiCode; | |
| 1010 | 1072 | if (uiPpsId >= MAX_PPS_COUNT) { |
| 1011 | 1073 | return ERR_INFO_PPS_ID_OVERFLOW; |
| 1012 | 1074 | } |
| @@ -1019,23 +1081,28 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) · 6 unmodified lines | ||
| 1019 | 1081 | |
| 1020 | 1082 | |
| 1021 | 1083 | pPps->iPpsId = uiPpsId; |
| 1022 | − pPps->iSpsId = BsGetUe (pBsAux); | |
| 1084 | + WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //seq_parameter_set_id | |
| 1085 | + pPps->iSpsId = uiCode; | |
| 1023 | 1086 | |
| 1024 | 1087 | if (pPps->iSpsId >= MAX_SPS_COUNT) { |
| 1025 | 1088 | return ERR_INFO_SPS_ID_OVERFLOW; |
| 1026 | 1089 | } |
| 1027 | 1090 | |
| 1028 | − pPps->bEntropyCodingModeFlag = !!BsGetOneBit (pBsAux); | |
| 1029 | − pPps->bPicOrderPresentFlag = !!BsGetOneBit (pBsAux); | |
| 1091 | + WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //entropy_coding_mode_flag | |
| 1092 | + pPps->bEntropyCodingModeFlag = !!uiCode; | |
| 1093 | + WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //bottom_field_pic_order_in_frame_present_flag | |
| 1094 | + pPps->bPicOrderPresentFlag = !!uiCode; | |
| 1030 | 1095 | |
| 1031 | − pPps->uiNumSliceGroups = NUM_SLICE_GROUPS_OFFSET + BsGetUe (pBsAux); | |
| 1096 | + WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //num_slice_groups_minus1 | |
| 1097 | + pPps->uiNumSliceGroups = NUM_SLICE_GROUPS_OFFSET + uiCode; | |
| 1032 | 1098 | |
| 1033 | 1099 | if (pPps->uiNumSliceGroups > MAX_SLICEGROUP_IDS) { |
| 1034 | 1100 | return ERR_INFO_INVALID_SLICEGROUP; |
| 1035 | 1101 | } |
| 1036 | 1102 | |
| 1037 | 1103 | if (pPps->uiNumSliceGroups > 1) { |
| 1038 | − pPps->uiSliceGroupMapType = BsGetUe (pBsAux); | |
| 1104 | + WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //slice_group_map_type | |
| 1105 | + pPps->uiSliceGroupMapType = uiCode; | |
| 1039 | 1106 | if (pPps->uiSliceGroupMapType > 1) { |
| 1040 | 1107 | WelsLog (pCtx, WELS_LOG_WARNING, "ParsePps(): slice_group_map_type (%d): support only 0,1.\n", |
| 1041 | 1108 | pPps->uiSliceGroupMapType); |
| @@ -1045,7 +1112,8 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) · 3 unmodified lines | ||
| 1045 | 1112 | switch (pPps->uiSliceGroupMapType) { |
| 1046 | 1113 | case 0: |
| 1047 | 1114 | for (iTmp = 0; iTmp < pPps->uiNumSliceGroups; iTmp++) { |
| 1048 | − pPps->uiRunLength[iTmp] = RUN_LENGTH_OFFSET + BsGetUe (pBsAux); | |
| 1115 | + WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //run_length_minus1[ iGroup ] | |
| 1116 | + pPps->uiRunLength[iTmp] = RUN_LENGTH_OFFSET + uiCode; | |
| 1049 | 1117 | } |
| 1050 | 1118 | break; |
| 1051 | 1119 | default: |
| @@ -1053,34 +1121,44 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) · 1 unmodified line | ||
| 1053 | 1121 | } |
| 1054 | 1122 | } |
| 1055 | 1123 | |
| 1056 | − pPps->uiNumRefIdxL0Active = NUM_REF_IDX_L0_DEFAULT_ACTIVE_OFFSET + BsGetUe (pBsAux); | |
| 1057 | − pPps->uiNumRefIdxL1Active = NUM_REF_IDX_L1_DEFAULT_ACTIVE_OFFSET + BsGetUe (pBsAux); | |
| 1124 | + WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //num_ref_idx_l0_default_active_minus1 | |
| 1125 | + pPps->uiNumRefIdxL0Active = NUM_REF_IDX_L0_DEFAULT_ACTIVE_OFFSET + uiCode; | |
| 1126 | + WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //num_ref_idx_l1_default_active_minus1 | |
| 1127 | + pPps->uiNumRefIdxL1Active = NUM_REF_IDX_L1_DEFAULT_ACTIVE_OFFSET + uiCode; | |
| 1058 | 1128 | |
| 1059 | 1129 | if (pPps->uiNumRefIdxL0Active > MAX_REF_PIC_COUNT || |
| 1060 | 1130 | pPps->uiNumRefIdxL1Active > MAX_REF_PIC_COUNT) { |
| 1061 | 1131 | return ERR_INFO_REF_COUNT_OVERFLOW; |
| 1062 | 1132 | } |
| 1063 | 1133 | |
| 1064 | − pPps->bWeightedPredFlag = !!BsGetOneBit (pBsAux); | |
| 1065 | − pPps->uiWeightedBipredIdc = BsGetBits (pBsAux, 2); | |
| 1134 | + WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //weighted_pred_flag | |
| 1135 | + pPps->bWeightedPredFlag = !!uiCode; | |
| 1136 | + WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc | |
| 1137 | + pPps->uiWeightedBipredIdc = uiCode; | |
| 1066 | 1138 | if (pPps->bWeightedPredFlag || pPps->uiWeightedBipredIdc != 0) { |
| 1067 | 1139 | WelsLog (pCtx, WELS_LOG_WARNING, "ParsePps(): weighted_pred_flag (%d) weighted_bipred_idc (%d) neither supported.\n", |
| 1068 | 1140 | pPps->bWeightedPredFlag, pPps->uiWeightedBipredIdc); |
| 1069 | 1141 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP); |
| 1070 | 1142 | } |
| 1071 | 1143 | |
| 1072 | − pPps->iPicInitQp = PIC_INIT_QP_OFFSET + BsGetSe (pBsAux); | |
| 1144 | + WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //pic_init_qp_minus26 | |
| 1145 | + pPps->iPicInitQp = PIC_INIT_QP_OFFSET + iCode; | |
| 1073 | 1146 | WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQp, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qp_minus26 + 26", |
| 1074 | 1147 | GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_PIC_INIT_QP)); |
| 1075 | − pPps->iPicInitQs = PIC_INIT_QS_OFFSET + BsGetSe (pBsAux); | |
| 1148 | + WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //pic_init_qs_minus26 | |
| 1149 | + pPps->iPicInitQs = PIC_INIT_QS_OFFSET + iCode; | |
| 1076 | 1150 | WELS_CHECK_SE_BOTH_ERROR (pPps->iPicInitQs, PPS_PIC_INIT_QP_QS_MIN, PPS_PIC_INIT_QP_QS_MAX, "pic_init_qs_minus26 + 26", |
| 1077 | 1151 | GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_PIC_INIT_QS)); |
| 1078 | − pPps->iChromaQpIndexOffset = BsGetSe (pBsAux); | |
| 1152 | + WELS_READ_VERIFY (BsGetSe (pBsAux, &iCode)); //chroma_qp_index_offset | |
| 1153 | + pPps->iChromaQpIndexOffset = iCode; | |
| 1079 | 1154 | WELS_CHECK_SE_BOTH_ERROR (pPps->iChromaQpIndexOffset, PPS_CHROMA_QP_INDEX_OFFSET_MIN, PPS_CHROMA_QP_INDEX_OFFSET_MAX, |
| 1080 | 1155 | "chroma_qp_index_offset", GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET)); |
| 1081 | − pPps->bDeblockingFilterControlPresentFlag = !!BsGetOneBit (pBsAux); | |
| 1082 | − pPps->bConstainedIntraPredFlag = !!BsGetOneBit (pBsAux); | |
| 1083 | − pPps->bRedundantPicCntPresentFlag = !!BsGetOneBit (pBsAux); | |
| 1156 | + WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //deblocking_filter_control_present_flag | |
| 1157 | + pPps->bDeblockingFilterControlPresentFlag = !!uiCode; | |
| 1158 | + WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //constrained_intra_pred_flag | |
| 1159 | + pPps->bConstainedIntraPredFlag = !!uiCode; | |
| 1160 | + WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //redundant_pic_cnt_present_flag | |
| 1161 | + pPps->bRedundantPicCntPresentFlag = !!uiCode; | |
| 1084 | 1162 | |
| 1085 | 1163 | |
| 1086 | 1164 | #ifdef MOSAIC_AVOID_BASED_ON_SPS_PPS_ID |