History

astyle all cpp files

huili2 committed 12 years ago

Commit adb0fa41 parent 0dbdbfb14 files · +138 −121Browse files

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

Unified · Split

codec/decoder/core/src/au_parser.cpp+31−26
@@ -111,7 +111,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 110 unmodified lines
111111 bool bExtensionFlag = false;
112112 int32_t iErr = ERR_NONE;
113113 int32_t iBitSize = 0;
114− SLogContext* pLogCtx = &(pCtx->sLogCtx);
114+ SLogContext* pLogCtx = & (pCtx->sLogCtx);
115115 pNalUnitHeader->eNalUnitType = NAL_UNIT_UNSPEC_0;//SHOULD init it. because pCtx->sCurNalHead is common variable.
116116
117117 //remove the consecutive ZERO at the end of current NAL in the reverse order.--2011.6.1
@@ -145,8 +145,8 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 27 unmodified lines
145145 || pCtx->bSpsExistAheadFlag)) {
146146 if (pCtx->bPrintFrameErrorTraceFlag) {
147147 WelsLog (pLogCtx, WELS_LOG_WARNING,
148− "parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).\n",
149− pNalUnitHeader->eNalUnitType);
148+ "parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).\n",
149+ pNalUnitHeader->eNalUnitType);
150150 }
151151 pCtx->iErrorCode = dsNoParamSets;
152152 return NULL;
@@ -155,8 +155,8 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 2 unmodified lines
155155 || pCtx->bPpsExistAheadFlag)) {
156156 if (pCtx->bPrintFrameErrorTraceFlag) {
157157 WelsLog (pLogCtx, WELS_LOG_WARNING,
158− "parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).\n",
159− pNalUnitHeader->eNalUnitType);
158+ "parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).\n",
159+ pNalUnitHeader->eNalUnitType);
160160 }
161161 pCtx->iErrorCode = dsNoParamSets;
162162 return NULL;
@@ -166,8 +166,8 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 3 unmodified lines
166166 || pCtx->bPpsExistAheadFlag))) {
167167 if (pCtx->bPrintFrameErrorTraceFlag) {
168168 WelsLog (pLogCtx, WELS_LOG_WARNING,
169− "ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).\n",
170− pNalUnitHeader->eNalUnitType);
169+ "ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).\n",
170+ pNalUnitHeader->eNalUnitType);
171171 }
172172 pCtx->iErrorCode |= dsNoParamSets;
173173 return NULL;
@@ -622,7 +622,8 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin · 448 unmodified lines
622622 WELS_READ_VERIFY (BsGetBits (pBs, 2, &uiCode)); //extended_spatial_scalability_idc
623623 pExt->uiExtendedSpatialScalability = uiCode;
624624 if (pExt->uiExtendedSpatialScalability > 2) {
625− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "DecodeSpsSvcExt():extended_spatial_scalability (%d) != 0, ESS not supported!\n",
625+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
626+ "DecodeSpsSvcExt():extended_spatial_scalability (%d) != 0, ESS not supported!\n",
626627 pExt->uiExtendedSpatialScalability);
627628 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_ESS);
628629 }
@@ -810,7 +811,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 181 unmodified lines
810811 uiLevelIdc = uiCode;
811812 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //seq_parameter_set_id
812813 if (uiCode >= MAX_SPS_COUNT) { // Modified to check invalid negative iSpsId, 12/1/2009
813− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " iSpsId is out of range! \n");
814+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " iSpsId is out of range! \n");
814815 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_SPS_ID_OVERFLOW);
815816 }
816817 iSpsId = uiCode;
@@ -819,7 +820,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 2 unmodified lines
819820 memset (pSubsetSps, 0, sizeof (SSubsetSps));
820821 const SLevelLimits* pSLevelLimits = GetLevelLimits (uiLevelIdc, bConstraintSetFlags[3]);
821822 if (NULL == pSLevelLimits) {
822− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): level_idx (%d).\n", uiLevelIdc);
823+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): level_idx (%d).\n", uiLevelIdc);
823824 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
824825 } else pSps->pSLevelLimits = pSLevelLimits;
825826 // syntax elements in default
@@ -837,20 +838,21 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 11 unmodified lines
837838 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //chroma_format_idc
838839 pSps->uiChromaFormatIdc = uiCode;
839840 if (pSps->uiChromaFormatIdc != 1) {
840− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.\n", pSps->uiChromaFormatIdc);
841+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): chroma_format_idc (%d) = 1 supported.\n",
842+ pSps->uiChromaFormatIdc);
841843 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
842844 }
843845 pSps->uiChromaArrayType = pSps->uiChromaFormatIdc;
844846 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_luma_minus8
845847 if (uiCode != 0) {
846− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", 8 + uiCode);
848+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): bit_depth_luma (%d) Only 8 bit supported.\n", 8 + uiCode);
847849 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
848850 }
849851 pSps->uiBitDepthLuma = 8;
850852
851853 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //bit_depth_chroma_minus8
852854 if (uiCode != 0) {
853− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", 8 + uiCode);
855+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): bit_depth_chroma (%d). Only 8 bit supported.\n", 8 + uiCode);
854856 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
855857 }
856858 pSps->uiBitDepthChroma = 8;
@@ -861,7 +863,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 4 unmodified lines
861863 pSps->bSeqScalingMatrixPresentFlag = !!uiCode;
862864
863865 if (pSps->bSeqScalingMatrixPresentFlag) { // For high profile, it is not used in current application. FIXME
864− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.\n",
866+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
867+ "ParseSps(): seq_scaling_matrix_present_flag (%d). Feature not supported.\n",
865868 pSps->bSeqScalingMatrixPresentFlag);
866869 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_NON_BASELINE);
867870 }
@@ -899,7 +902,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 31 unmodified lines
899902 }
900903 }
901904 if (pSps->uiPocType > 2) {
902− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " illegal pic_order_cnt_type: %d ! \n", pSps->uiPocType);
905+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " illegal pic_order_cnt_type: %d ! \n", pSps->uiPocType);
903906 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_POC_TYPE);
904907 }
905908
@@ -910,24 +913,24 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 4 unmodified lines
910913 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_width_in_mbs_minus1
911914 pSps->iMbWidth = PIC_WIDTH_IN_MBS_OFFSET + uiCode;
912915 if (pSps->iMbWidth > MAX_MB_SIZE) {
913− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth);
916+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth);
914917 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
915918 }
916919 if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {
917− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");
920+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");
918921 }
919922 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1
920923 pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode;
921924 if (pSps->iMbHeight > MAX_MB_SIZE) {
922− WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight);
925+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight);
923926 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
924927 }
925928 if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {
926− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");
929+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");
927930 }
928931 uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight;
929932 if (uiTmp32 > (uint32_t)pSLevelLimits->iMaxFS) {
930− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!\n");
933+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!\n");
931934 }
932935 pSps->uiTotalMbCount = uiTmp32;
933936 WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames",
@@ -938,12 +941,13 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 4 unmodified lines
938941 if (uiMaxDpbFrames > SPS_MAX_NUM_REF_FRAMES_MAX)
939942 uiMaxDpbFrames = SPS_MAX_NUM_REF_FRAMES_MAX;
940943 if ((uint32_t)pSps->iNumRefFrames > uiMaxDpbFrames) {
941− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, " max_num_ref_frames exceeds level limits!\n");
944+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " max_num_ref_frames exceeds level limits!\n");
942945 }
943946 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //frame_mbs_only_flag
944947 pSps->bFrameMbsOnlyFlag = !!uiCode;
945948 if (!pSps->bFrameMbsOnlyFlag) {
946− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): frame_mbs_only_flag (%d) not supported.\n", pSps->bFrameMbsOnlyFlag);
949+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): frame_mbs_only_flag (%d) not supported.\n",
950+ pSps->bFrameMbsOnlyFlag);
947951 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_MBAFF);
948952 }
949953 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //direct_8x8_inference_flag
@@ -956,14 +960,14 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 6 unmodified lines
956960 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_right_offset
957961 pSps->sFrameCrop.iRightOffset = uiCode;
958962 if ((pSps->sFrameCrop.iLeftOffset + pSps->sFrameCrop.iRightOffset) > ((int32_t)pSps->iMbWidth * 16 / 2)) {
959− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!\n");
963+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!\n");
960964 }
961965 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_top_offset
962966 pSps->sFrameCrop.iTopOffset = uiCode;
963967 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_bottom_offset
964968 pSps->sFrameCrop.iBottomOffset = uiCode;
965969 if ((pSps->sFrameCrop.iTopOffset + pSps->sFrameCrop.iBottomOffset) > ((int32_t)pSps->iMbHeight * 16 / 2)) {
966− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!\n");
970+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!\n");
967971 }
968972 } else {
969973 pSps->sFrameCrop.iLeftOffset = 0; // frame_crop_left_offset
@@ -1100,7 +1104,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) · 130 unmodified lines
11001104 WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //slice_group_map_type
11011105 pPps->uiSliceGroupMapType = uiCode;
11021106 if (pPps->uiSliceGroupMapType > 1) {
1103− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParsePps(): slice_group_map_type (%d): support only 0,1.\n",
1107+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParsePps(): slice_group_map_type (%d): support only 0,1.\n",
11041108 pPps->uiSliceGroupMapType);
11051109 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_FMOTYPE);
11061110 }
@@ -1132,7 +1136,8 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux) · 25 unmodified lines
11321136 WELS_READ_VERIFY (BsGetBits (pBsAux, 2, &uiCode)); //weighted_bipred_idc
11331137 pPps->uiWeightedBipredIdc = uiCode;
11341138 if (pPps->bWeightedPredFlag || pPps->uiWeightedBipredIdc != 0) {
1135− WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "ParsePps(): weighted_pred_flag (%d) weighted_bipred_idc (%d) neither supported.\n",
1139+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
1140+ "ParsePps(): weighted_pred_flag (%d) weighted_bipred_idc (%d) neither supported.\n",
11361141 pPps->bWeightedPredFlag, pPps->uiWeightedBipredIdc);
11371142 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_WP);
11381143 }

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