History

make the decoder compile and run with treason

Sigrid Solveig Haflínudóttir committed 5 years ago

Commit 37423d41 parent be8e62f71 files · +961 −1217Browse files

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

Unified · Split

codec/decoder/core/src/au_parser.cpp+21−24
@@ -48,7 +48,6 @@ · 47 unmodified lines
4848
4949 #define _PARSE_NALHRD_VCLHRD_PARAMS_ 1
5050
51−namespace WelsDec {
5251 /*!
5352 *************************************************************************************
5453 * \brief Start Code Prefix (0x 00 00 00 01) detection
@@ -107,13 +106,13 @@ uint8_t* DetectStartCodePrefix (const uint8_t* kpBuf, int32_t* pOffset, int32_t · 52 unmodified lines
107106 */
108107 uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeader, uint8_t* pSrcRbsp,
109108 int32_t iSrcRbspLen, uint8_t* pSrcNal, int32_t iSrcNalLen, int32_t* pConsumedBytes) {
110− PNalUnit pCurNal = NULL;
109+ PNalUnit pCurNal;
111110 uint8_t* pNal = pSrcRbsp;
112111 int32_t iNalSize = iSrcRbspLen;
113− PBitStringAux pBs = NULL;
112+ PBitStringAux pBs;
114113 bool bExtensionFlag = false;
115− int32_t iErr = ERR_NONE;
116− int32_t iBitSize = 0;
114+ int32_t iErr;
115+ int32_t iBitSize;
117116 SDataBuffer* pSavedData = &pCtx->sSavedData;
118117 SLogContext* pLogCtx = & (pCtx->sLogCtx);
119118 pNalUnitHeader->eNalUnitType = NAL_UNIT_UNSPEC_0;//SHOULD init it. because pCtx->sCurNalHead is common variable.
@@ -121,7 +120,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 1 unmodified line
121120 //remove the consecutive ZERO at the end of current NAL in the reverse order.--2011.6.1
122121 {
123122 int32_t iIndex = iSrcRbspLen - 1;
124− uint8_t uiBsZero = 0;
123+ uint8_t uiBsZero;
125124 while (iIndex >= 0) {
126125 uiBsZero = pSrcRbsp[iIndex];
127126 if (0 == uiBsZero) {
@@ -266,7 +265,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 138 unmodified lines
266265 bExtensionFlag = true;
267266 case NAL_UNIT_CODED_SLICE:
268267 case NAL_UNIT_CODED_SLICE_IDR: {
269− PAccessUnit pCurAu = NULL;
268+ PAccessUnit pCurAu;
270269 uint32_t uiAvailNalNum;
271270 pCurNal = MemGetNextNal (&pCtx->pAccessUnitList, pCtx->pMemAlign);
272271 if (NULL == pCurNal) {
@@ -574,11 +573,11 @@ bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const · 301 unmodified lines
574573 */
575574 int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t kiSrcLen, uint8_t* pSrcNal,
576575 const int32_t kSrcNalLen) {
577− PBitStringAux pBs = NULL;
578− EWelsNalUnitType eNalType = NAL_UNIT_UNSPEC_0; // make initial value as unspecified
576+ PBitStringAux pBs;
577+ EWelsNalUnitType eNalType; // make initial value as unspecified
579578 int32_t iPicWidth = 0;
580579 int32_t iPicHeight = 0;
581− int32_t iBitSize = 0;
580+ int32_t iBitSize;
582581 int32_t iErr = ERR_NONE;
583582 if (kiSrcLen <= 0)
584583 return iErr;
@@ -720,7 +719,7 @@ int32_t ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs) { · 135 unmodified lines
720719
721720
722721 int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStringAux pBs) {
723− PSpsSvcExt pExt = NULL;
722+ PSpsSvcExt pExt;
724723 uint32_t uiCode;
725724 int32_t iCode;
726725
@@ -832,7 +831,6 @@ const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) { · 105 unmodified lines
832831 default:
833832 return NULL;
834833 }
835− return NULL;
836834 }
837835
838836 bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) {
@@ -912,15 +910,15 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 73 unmodified lines
912910 uint8_t* pSrcNal, const int32_t kSrcNalLen) {
913911 PBitStringAux pBs = pBsAux;
914912 SSubsetSps sTempSubsetSps;
915− PSps pSps = NULL;
916− PSubsetSps pSubsetSps = NULL;
913+ PSps pSps;
914+ PSubsetSps pSubsetSps;
917915 SNalUnitHeader* pNalHead = &pCtx->sCurNalHead;
918916 ProfileIdc uiProfileIdc;
919917 uint8_t uiLevelIdc;
920918 int32_t iSpsId;
921919 uint32_t uiCode;
922920 int32_t iCode;
923− int32_t iRet = ERR_NONE;
921+ int32_t iRet;
924922 bool bConstraintSetFlags[6] = { false };
925923 const bool kbUseSubsetFlag = IS_SUBSET_SPS_NAL (pNalHead->eNalUnitType);
926924
@@ -1185,7 +1183,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 258 unmodified lines
11851183 SBitStringAux sSubsetSpsBs;
11861184 CMemoryAlign* pMa = pCtx->pMemAlign;
11871185
1188− uint8_t* pBsBuf = static_cast<uint8_t*> (pMa->WelsMallocz (SPS_PPS_BS_SIZE + 4,
1186+ uint8_t* pBsBuf = (uint8_t*) (pMa->WelsMallocz (SPS_PPS_BS_SIZE + 4,
11891187 "Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer
11901188 if (NULL == pBsBuf) {
11911189 WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "sps buffer alloc failed for parse only!");
@@ -1258,7 +1256,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 66 unmodified lines
12581256
12591257 *pPicWidth = pSps->iMbWidth << 4;
12601258 *pPicHeight = pSps->iMbHeight << 4;
1261− PSps pTmpSps = NULL;
1259+ PSps pTmpSps;
12621260 if (kbUseSubsetFlag) {
12631261 pTmpSps = &pCtx->sSpsPpsCtx.sSubsetSpsBuffer[iSpsId].sSps;
12641262 } else {
@@ -1325,10 +1323,10 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 60 unmodified lines
13251323 */
13261324 int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, uint8_t* pSrcNal,
13271325 const int32_t kSrcNalLen) {
1328−
1329− PPps pPps = NULL;
1326+ USED(pPpsList);
1327+ PPps pPps;
13301328 SPps sTempPps;
1331− uint32_t uiPpsId = 0;
1329+ uint32_t uiPpsId;
13321330 uint32_t iTmp;
13331331 uint32_t uiCode;
13341332 int32_t iCode;
@@ -1545,7 +1543,7 @@ int32_t ParseVui (PWelsDecoderContext pCtx, PSps pSps, PBitStringAux pBsAux) { · 210 unmodified lines
15451543 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //timing_info_present_flag
15461544 pVui->bTimingInfoPresentFlag = !!uiCode;
15471545 if (pVui->bTimingInfoPresentFlag) {
1548− uint32_t uiTmp = 0;
1546+ uint32_t uiTmp;
15491547 WELS_READ_VERIFY (BsGetBits (pBsAux, 16, &uiCode)); //num_units_in_tick
15501548 uiTmp = (uiCode << 16);
15511549 WELS_READ_VERIFY (BsGetBits (pBsAux, 16, &uiCode)); //num_units_in_tick
@@ -1657,7 +1655,8 @@ int32_t ParseVui (PWelsDecoderContext pCtx, PSps pSps, PBitStringAux pBsAux) { · 105 unmodified lines
16571655 */
16581656 int32_t ParseSei (void* pSei, PBitStringAux pBsAux) { // reserved Sei_Msg type
16591657
1660−
1658+ USED(pSei);
1659+ USED(pBsAux);
16611660 return ERR_NONE;
16621661 }
16631662 /*
@@ -1783,5 +1782,3 @@ int32_t ResetFmoList (PWelsDecoderContext pCtx) { · 119 unmodified lines
17831782 }
17841783 return iCountNum;
17851784 }
1786−
1787−} // namespace WelsDec

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