History

Use bool instead of bool_t

bool is one of the built in, standard types in C++, there's no need for a typedef for it.

Martin Storsjö committed 12 years ago

Commit 2b77fe71 parent 17d7b5d82 files · +468 −471Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+19−19
@@ -105,7 +105,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 104 unmodified lines
105 return 0;105 return 0;
106}106}
107 107
108inline bool_t CheckSliceNeedReconstruct (int16_t iCurDid, int16_t iCurQid, bool_t bStoreRefBasePicFlag,108inline bool CheckSliceNeedReconstruct (int16_t iCurDid, int16_t iCurQid, bool bStoreRefBasePicFlag,
109 uint8_t uiDidMax, uint8_t uiLayerDqId, uint8_t uiTargetDqId) {109 uint8_t uiDidMax, uint8_t uiLayerDqId, uint8_t uiTargetDqId) {
110 return ((iCurDid == uiDidMax) && (iCurQid == BASE_QUALITY_ID) && (bStoreRefBasePicFlag)) // store base110 return ((iCurDid == uiDidMax) && (iCurQid == BASE_QUALITY_ID) && (bStoreRefBasePicFlag)) // store base
111 || (uiLayerDqId == uiTargetDqId); // target layer111 || (uiLayerDqId == uiTargetDqId); // target layer
@@ -201,7 +201,7 @@ int32_t ParseRefPicListReordering (PBitStringAux pBs, PSliceHeader pSh) { · 89 unmodified lines
201}201}
202 202
203int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSliceHeader pSh, PSps pSps,203int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSliceHeader pSh, PSps pSps,
204 const bool_t kbIdrFlag) {204 const bool kbIdrFlag) {
205 PRefPicMarking const kpRefMarking = &pSh->sRefMarking;205 PRefPicMarking const kpRefMarking = &pSh->sRefMarking;
206 206
207 if (kbIdrFlag) {207 if (kbIdrFlag) {
@@ -238,7 +238,7 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 30 unmodified lines
238 return ERR_NONE;238 return ERR_NONE;
239}239}
240 240
241bool_t FillDefaultSliceHeaderExt (PSliceHeaderExt pShExt, PNalUnitHeaderExt pNalExt) {241bool FillDefaultSliceHeaderExt (PSliceHeaderExt pShExt, PNalUnitHeaderExt pNalExt) {
242 if (pShExt == NULL || pNalExt == NULL)242 if (pShExt == NULL || pNalExt == NULL)
243 return false;243 return false;
244 244
@@ -392,7 +392,7 @@ int32_t CheckPpsId (PWelsDecoderContext pCtx, PPps* ppPps, uint32_t uiPpsId) { · 147 unmodified lines
392}392}
393 393
394int32_t CheckSpsId (PWelsDecoderContext pCtx, PSubsetSps* ppSubsetSps, PSps* ppSps, int32_t iSpsId,394int32_t CheckSpsId (PWelsDecoderContext pCtx, PSubsetSps* ppSubsetSps, PSps* ppSps, int32_t iSpsId,
395 bool_t bExtensionFlag) {395 bool bExtensionFlag) {
396 PSps pSpsList = pCtx->sSpsBuffer;396 PSps pSpsList = pCtx->sSpsBuffer;
397 PSubsetSps pSubspsList = pCtx->sSubsetSpsBuffer;397 PSubsetSps pSubspsList = pCtx->sSubsetSpsBuffer;
398 398
@@ -455,7 +455,7 @@ int32_t CheckSpsId (PWelsDecoderContext pCtx, PSubsetSps* ppSubsetSps, PSps* ppS · 56 unmodified lines
455 * decode_slice_header_avc455 * decode_slice_header_avc
456 * Parse slice header of bitstream in avc for storing data structure456 * Parse slice header of bitstream in avc for storing data structure
457 */457 */
458int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, const bool_t kbExtensionFlag) {458int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, const bool kbExtensionFlag) {
459 PNalUnit const kpCurNal = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1];459 PNalUnit const kpCurNal = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1];
460 460
461 PNalUnitHeaderExt pNalHeaderExt = NULL;461 PNalUnitHeaderExt pNalHeaderExt = NULL;
@@ -469,8 +469,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 7 unmodified lines
469 int32_t iRet = ERR_NONE;469 int32_t iRet = ERR_NONE;
470 uint8_t uiSliceType = 0;470 uint8_t uiSliceType = 0;
471 uint8_t uiQualityId = BASE_QUALITY_ID;471 uint8_t uiQualityId = BASE_QUALITY_ID;
472 bool_t bIdrFlag = false;472 bool bIdrFlag = false;
473 bool_t bSgChangeCycleInvolved = false; // involved slice group change cycle ?473 bool bSgChangeCycleInvolved = false; // involved slice group change cycle ?
474 474
475 if (kpCurNal == NULL) {475 if (kpCurNal == NULL) {
476 return ERR_INFO_OUT_OF_MEMORY;476 return ERR_INFO_OUT_OF_MEMORY;
@@ -484,7 +484,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 7 unmodified lines
484 484
485 if (pSliceHeadExt) {485 if (pSliceHeadExt) {
486 SRefBasePicMarking sBaseMarking;486 SRefBasePicMarking sBaseMarking;
487 const bool_t kbStoreRefBaseFlag = pSliceHeadExt->bStoreRefBasePicFlag;487 const bool kbStoreRefBaseFlag = pSliceHeadExt->bStoreRefBasePicFlag;
488 memcpy (&sBaseMarking, &pSliceHeadExt->sRefBasePicMarking, sizeof (SRefBasePicMarking)); //confirmed_safe_unsafe_usage488 memcpy (&sBaseMarking, &pSliceHeadExt->sRefBasePicMarking, sizeof (SRefBasePicMarking)); //confirmed_safe_unsafe_usage
489 memset (pSliceHeadExt, 0, sizeof (SSliceHeaderExt));489 memset (pSliceHeadExt, 0, sizeof (SSliceHeaderExt));
490 pSliceHeadExt->bStoreRefBasePicFlag = kbStoreRefBaseFlag;490 pSliceHeadExt->bStoreRefBasePicFlag = kbStoreRefBaseFlag;
@@ -619,7 +619,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 128 unmodified lines
619 if (kbExtensionFlag) {619 if (kbExtensionFlag) {
620 uiQualityId = pNalHeaderExt->uiQualityId;620 uiQualityId = pNalHeaderExt->uiQualityId;
621 } else if (uiSliceType == P_SLICE || uiSliceType == SP_SLICE || uiSliceType == B_SLICE) {621 } else if (uiSliceType == P_SLICE || uiSliceType == SP_SLICE || uiSliceType == B_SLICE) {
622 const bool_t kbBipredFlag = (B_SLICE == uiSliceType);622 const bool kbBipredFlag = (B_SLICE == uiSliceType);
623 if (kbBipredFlag) {623 if (kbBipredFlag) {
624 WelsLog (pCtx, WELS_LOG_WARNING, "ParseSliceHeaderSyntaxs(): kbBipredFlag = 1 not supported.\n");624 WelsLog (pCtx, WELS_LOG_WARNING, "ParseSliceHeaderSyntaxs(): kbBipredFlag = 1 not supported.\n");
625 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_BIPRED);625 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_UNSUPPORTED_BIPRED);
@@ -820,7 +820,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 194 unmodified lines
820 * pSrc: mark as decoded prefix NAL820 * pSrc: mark as decoded prefix NAL
821 * ppDst: succeeded VCL NAL based AVC (I/P Slice)821 * ppDst: succeeded VCL NAL based AVC (I/P Slice)
822 */822 */
823bool_t PrefetchNalHeaderExtSyntax (PWelsDecoderContext pCtx, PNalUnit const kppDst, PNalUnit const kpSrc) {823bool PrefetchNalHeaderExtSyntax (PWelsDecoderContext pCtx, PNalUnit const kppDst, PNalUnit const kpSrc) {
824 PNalUnitHeaderExt pNalHdrExtD = NULL, pNalHdrExtS = NULL;824 PNalUnitHeaderExt pNalHdrExtD = NULL, pNalHdrExtS = NULL;
825 PSliceHeaderExt pShExtD = NULL;825 PSliceHeaderExt pShExtD = NULL;
826 PPrefixNalUnit pPrefixS = NULL;826 PPrefixNalUnit pPrefixS = NULL;
@@ -1297,7 +1297,7 @@ void_t RefineIdxNoInterLayerPred (PAccessUnit pCurAu, int32_t* pIdxNoInterLayerP · 470 unmodified lines
1297 int32_t iCurNalDependId, iCurNalQualityId, iCurNalTId, iCurNalFrameNum, iCurNalPoc, iCurNalFirstMb, iCurIdx,1297 int32_t iCurNalDependId, iCurNalQualityId, iCurNalTId, iCurNalFrameNum, iCurNalPoc, iCurNalFirstMb, iCurIdx,
1298 iFinalIdxNoInterLayerPred;1298 iFinalIdxNoInterLayerPred;
1299 1299
1300 bool_t bMultiSliceFind = false;1300 bool bMultiSliceFind = false;
1301 1301
1302 iFinalIdxNoInterLayerPred = 0;1302 iFinalIdxNoInterLayerPred = 0;
1303 iCurIdx = *pIdxNoInterLayerPred - 1;1303 iCurIdx = *pIdxNoInterLayerPred - 1;
@@ -1332,7 +1332,7 @@ void_t RefineIdxNoInterLayerPred (PAccessUnit pCurAu, int32_t* pIdxNoInterLayerP · 28 unmodified lines
1332 }1332 }
1333}1333}
1334 1334
1335bool_t CheckPocOfCurValidNalUnits (PAccessUnit pCurAu, int32_t pIdxNoInterLayerPred) {1335bool CheckPocOfCurValidNalUnits (PAccessUnit pCurAu, int32_t pIdxNoInterLayerPred) {
1336 int32_t iEndIdx = pCurAu->uiEndPos;1336 int32_t iEndIdx = pCurAu->uiEndPos;
1337 int32_t iCurAuPoc =1337 int32_t iCurAuPoc =
1338 pCurAu->pNalUnitsList[pIdxNoInterLayerPred]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.iPicOrderCntLsb;1338 pCurAu->pNalUnitsList[pIdxNoInterLayerPred]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.iPicOrderCntLsb;
@@ -1347,7 +1347,7 @@ bool_t CheckPocOfCurValidNalUnits (PAccessUnit pCurAu, int32_t pIdxNoInterLayerP · 8 unmodified lines
1347 return true;1347 return true;
1348}1348}
1349 1349
1350bool_t CheckIntegrityNalUnitsList (PWelsDecoderContext pCtx) {1350bool CheckIntegrityNalUnitsList (PWelsDecoderContext pCtx) {
1351 PAccessUnit pCurAu = pCtx->pAccessUnitList;1351 PAccessUnit pCurAu = pCtx->pAccessUnitList;
1352 const int32_t kiEndPos = pCurAu->uiEndPos;1352 const int32_t kiEndPos = pCurAu->uiEndPos;
1353 int32_t iIdxNoInterLayerPred = 0;1353 int32_t iIdxNoInterLayerPred = 0;
@@ -1391,7 +1391,7 @@ bool_t CheckIntegrityNalUnitsList (PWelsDecoderContext pCtx) { · 37 unmodified lines
1391 pCurAu->pNalUnitsList[pCurAu->uiEndPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.iMbHeight << 4;1391 pCurAu->pNalUnitsList[pCurAu->uiEndPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.iMbHeight << 4;
1392 } else { //P_SLICE1392 } else { //P_SLICE
1393 //step 1: search uiDependencyId equal to pCtx->cur_seq_interval_target_dependency_id1393 //step 1: search uiDependencyId equal to pCtx->cur_seq_interval_target_dependency_id
1394 bool_t bGetDependId = false;1394 bool bGetDependId = false;
1395 int32_t iIdxDependId = 0;1395 int32_t iIdxDependId = 0;
1396 1396
1397 iIdxDependId = kiEndPos;1397 iIdxDependId = kiEndPos;
@@ -1406,7 +1406,7 @@ bool_t CheckIntegrityNalUnitsList (PWelsDecoderContext pCtx) { · 8 unmodified lines
1406 1406
1407 //step 2: switch according to whether or not find the index of pNalUnit whose uiDependencyId equal to iCurSeqIntervalTargetDependId1407 //step 2: switch according to whether or not find the index of pNalUnit whose uiDependencyId equal to iCurSeqIntervalTargetDependId
1408 if (bGetDependId) { //get the index of pNalUnit whose uiDependencyId equal to iCurSeqIntervalTargetDependId1408 if (bGetDependId) { //get the index of pNalUnit whose uiDependencyId equal to iCurSeqIntervalTargetDependId
1409 bool_t bGetNoInterPredFront = false;1409 bool bGetNoInterPredFront = false;
1410 //step 2a: search iNoInterLayerPredFlag [0....iIdxDependId]1410 //step 2a: search iNoInterLayerPredFlag [0....iIdxDependId]
1411 iIdxNoInterLayerPred = iIdxDependId;1411 iIdxNoInterLayerPred = iIdxDependId;
1412 while (iIdxNoInterLayerPred >= 0) {1412 while (iIdxNoInterLayerPred >= 0) {
@@ -1650,7 +1650,7 @@ void_t WelsDqLayerDecodeStart (PWelsDecoderContext pCtx, PNalUnit pCurNal, PSps · 237 unmodified lines
1650 }1650 }
1651}1651}
1652 1652
1653int32_t InitRefPicList (PWelsDecoderContext pCtx, const uint8_t kuiNRi, const bool_t kbFirstSlice, int32_t iPoc) {1653int32_t InitRefPicList (PWelsDecoderContext pCtx, const uint8_t kuiNRi, const bool kbFirstSlice, int32_t iPoc) {
1654 int32_t iRet = ERR_NONE;1654 int32_t iRet = ERR_NONE;
1655 if (kbFirstSlice)1655 if (kbFirstSlice)
1656 iRet = WelsInitRefList (pCtx, iPoc);1656 iRet = WelsInitRefList (pCtx, iPoc);
@@ -1718,7 +1718,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 · 61 unmodified lines
1718 int16_t iLastIdD = -1, iLastIdQ = -1;1718 int16_t iLastIdD = -1, iLastIdQ = -1;
1719 int16_t iCurrIdD = 0, iCurrIdQ = 0;1719 int16_t iCurrIdD = 0, iCurrIdQ = 0;
1720 uint8_t uiNalRefIdc = 0;1720 uint8_t uiNalRefIdc = 0;
1721 bool_t bFreshSliceAvailable =1721 bool bFreshSliceAvailable =
1722 true; // Another fresh slice comingup for given dq layer, for multiple slices in case of header parts of slices sometimes loss over error-prone channels, 8/14/20081722 true; // Another fresh slice comingup for given dq layer, for multiple slices in case of header parts of slices sometimes loss over error-prone channels, 8/14/2008
1723 PPicture pStoreBasePic = NULL;1723 PPicture pStoreBasePic = NULL;
1724 1724
@@ -1774,7 +1774,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 · 49 unmodified lines
1774 * Loop decoding for slices (even FMO and/ multiple slices) within a dq layer1774 * Loop decoding for slices (even FMO and/ multiple slices) within a dq layer
1775 */1775 */
1776 while (iIdx <= iEndIdx) {1776 while (iIdx <= iEndIdx) {
1777 bool_t bReconstructSlice;1777 bool bReconstructSlice;
1778 iCurrIdQ = pNalCur->sNalHeaderExt.uiQualityId;1778 iCurrIdQ = pNalCur->sNalHeaderExt.uiQualityId;
1779 iCurrIdD = pNalCur->sNalHeaderExt.uiDependencyId;1779 iCurrIdD = pNalCur->sNalHeaderExt.uiDependencyId;
1780 pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;1780 pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;
@@ -1823,7 +1823,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 · 42 unmodified lines
1823 InitDqLayerInfo (dq_cur, &pLayerInfo, pNalCur, pCtx->pDec);1823 InitDqLayerInfo (dq_cur, &pLayerInfo, pNalCur, pCtx->pDec);
1824 1824
1825 if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) {1825 if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) {
1826 const bool_t kbIdrFlag = dq_cur->sLayerInfo.sNalHeaderExt.bIdrFlag1826 const bool kbIdrFlag = dq_cur->sLayerInfo.sNalHeaderExt.bIdrFlag
1827 || (dq_cur->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR);1827 || (dq_cur->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR);
1828 // Subclause 8.2.5.2 Decoding process for gaps in frame_num1828 // Subclause 8.2.5.2 Decoding process for gaps in frame_num
1829 if (!kbIdrFlag &&1829 if (!kbIdrFlag &&

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