History

refine checks in ParseSps

Licai Guo committed 12 years ago

Commit 4e0b8d41 parent 2bdf6d31 file · +9 −16Browse files

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

Unified · Split

codec/decoder/core/src/au_parser.cpp+9−16
@@ -833,11 +833,11 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 832 unmodified lines
833833 WELS_READ_VERIFY (BsGetBits (pBs, 8, &uiCode)); // level_idc
834834 uiLevelIdc = uiCode;
835835 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //seq_parameter_set_id
836− iSpsId = uiCode;
837− if (iSpsId >= MAX_SPS_COUNT || iSpsId < 0) { // Modified to check invalid negative iSpsId, 12/1/2009
836+ if (uiCode >= MAX_SPS_COUNT) { // Modified to check invalid negative iSpsId, 12/1/2009
838837 WelsLog (pCtx, WELS_LOG_WARNING, " iSpsId is out of range! \n");
839838 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_SPS_ID_OVERFLOW);
840839 }
840+ iSpsId = uiCode;
841841
842842 if (kbUseSubsetFlag) {
843843 #ifdef MOSAIC_AVOID_BASED_ON_SPS_PPS_ID
@@ -891,18 +891,19 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 47 unmodified lines
891891 }
892892 pSps->uiChromaArrayType = pSps->uiChromaFormatIdc;
893893 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8
894− pSps->uiBitDepthLuma = 8 + uiCode;
895− if (pSps->uiBitDepthLuma != 8) {
896− WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", pSps->uiBitDepthLuma);
894+ if (uiCode != 0) {
895+ WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", 8 + uiCode);
897896 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
898897 }
898+ pSps->uiBitDepthLuma = 8 + uiCode;
899899
900900 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_chroma_minus8
901− pSps->uiBitDepthChroma = 8 + uiCode;
902− if (pSps->uiBitDepthChroma != 8) {
903− WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", pSps->uiBitDepthChroma);
901+ if (uiCode != 0) {
902+ WelsLog (pCtx, WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", 8 + uiCode);
904903 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
905904 }
905+ pSps->uiBitDepthChroma = 8 + uiCode;
906+
906907 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //qpprime_y_zero_transform_bypass_flag
907908 pSps->bQpPrimeYZeroTransfBypassFlag = !!uiCode;
908909 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //seq_scaling_matrix_present_flag
@@ -956,19 +957,11 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 47 unmodified lines
956957 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //gaps_in_frame_num_value_allowed_flag
957958 pSps->bGapsInFrameNumValueAllowedFlag = !!uiCode;
958959 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_width_in_mbs_minus1
959− if (uiCode == 0xffffffff) {
960− WelsLog (pCtx, WELS_LOG_ERROR, " pic_width_in_mbs read error!\n");
961− return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MB_SIZE_INFO);
962− }
963960 pSps->iMbWidth = PIC_WIDTH_IN_MBS_OFFSET + uiCode;
964961 if ((uint64_t) (pSps->iMbWidth * pSps->iMbWidth) > (8 * pSLevelLimits->iMaxFS)) {
965962 WelsLog (pCtx, WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");
966963 }
967964 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1
968− if (uiCode == 0xffffffff) {
969− WelsLog (pCtx, WELS_LOG_ERROR, " pic_height_in_mbs read error!\n");
970− return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MB_SIZE_INFO);
971− }
972965 pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode;
973966 if ((uint64_t) (pSps->iMbHeight * pSps->iMbHeight) > (8 * pSLevelLimits->iMaxFS)) {
974967 WelsLog (pCtx, WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");

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