bool is one of the built in, standard types in C++, there's no need for a typedef for it.
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 82 files). Show all
Unified · Split
| @@ -636,10 +636,10 @@ static void InitMbInfo (sWelsEncCtx* pEnc, SMB* pList, SDqLayer* pLayer, con · 635 unmodified lines | |||
| 636 | &pEnc->pRefIndexBlock4x4[MB_BLOCK8x8_NUM * kiOffset]); | 636 | &pEnc->pRefIndexBlock4x4[MB_BLOCK8x8_NUM * kiOffset]); |
| 637 | 637 | ||
| 638 | for (iIdx = 0; iIdx < iMbNum; iIdx++) { | 638 | for (iIdx = 0; iIdx < iMbNum; iIdx++) { |
| 639 | bool_t bLeft; | 639 | bool bLeft; |
| 640 | bool_t bTop; | 640 | bool bTop; |
| 641 | bool_t bLeftTop; | 641 | bool bLeftTop; |
| 642 | bool_t bRightTop; | 642 | bool bRightTop; |
| 643 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; | 643 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; |
| 644 | uint8_t uiSliceIdc; | 644 | uint8_t uiSliceIdc; |
| 645 | 645 | ||
| @@ -740,7 +740,7 @@ int32_t AllocMbCacheAligned (SMbCache* pMbCache, CMemoryAlign* pMa) { · 94 unmodified lines | |||
| 740 | WELS_VERIFY_RETURN_IF (1, (NULL == pMbCache->pMemPredBlk4)); | 740 | WELS_VERIFY_RETURN_IF (1, (NULL == pMbCache->pMemPredBlk4)); |
| 741 | pMbCache->pBufferInterPredMe = (uint8_t*)pMa->WelsMalloc (4 * 640 * sizeof (uint8_t), "pMbCache->pBufferInterPredMe"); | 741 | pMbCache->pBufferInterPredMe = (uint8_t*)pMa->WelsMalloc (4 * 640 * sizeof (uint8_t), "pMbCache->pBufferInterPredMe"); |
| 742 | WELS_VERIFY_RETURN_IF (1, (NULL == pMbCache->pBufferInterPredMe)); | 742 | WELS_VERIFY_RETURN_IF (1, (NULL == pMbCache->pBufferInterPredMe)); |
| 743 | pMbCache->pPrevIntra4x4PredModeFlag = (bool_t*)pMa->WelsMalloc (16 * sizeof (bool_t), | 743 | pMbCache->pPrevIntra4x4PredModeFlag = (bool*)pMa->WelsMalloc (16 * sizeof (bool), |
| 744 | "pMbCache->pPrevIntra4x4PredModeFlag"); | 744 | "pMbCache->pPrevIntra4x4PredModeFlag"); |
| 745 | WELS_VERIFY_RETURN_IF (1, (NULL == pMbCache->pPrevIntra4x4PredModeFlag)); | 745 | WELS_VERIFY_RETURN_IF (1, (NULL == pMbCache->pPrevIntra4x4PredModeFlag)); |
| 746 | pMbCache->pRemIntra4x4PredModeFlag = (int8_t*)pMa->WelsMalloc (16 * sizeof (int8_t), | 746 | pMbCache->pRemIntra4x4PredModeFlag = (int8_t*)pMa->WelsMalloc (16 * sizeof (int8_t), |
| @@ -1000,7 +1000,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 253 unmodified lines | |||
| 1000 | iDlayerIndex = 0; | 1000 | iDlayerIndex = 0; |
| 1001 | while (iDlayerIndex < iDlayerCount) { | 1001 | while (iDlayerIndex < iDlayerCount) { |
| 1002 | SDqIdc* pDqIdc = & (*ppCtx)->pDqIdcMap[iDlayerIndex]; | 1002 | SDqIdc* pDqIdc = & (*ppCtx)->pDqIdcMap[iDlayerIndex]; |
| 1003 | const bool_t bUseSubsetSps = (iDlayerIndex > BASE_DEPENDENCY_ID); | 1003 | const bool bUseSubsetSps = (iDlayerIndex > BASE_DEPENDENCY_ID); |
| 1004 | SDLayerParam* pDlayerParam = &pParam->sDependencyLayers[iDlayerIndex]; | 1004 | SDLayerParam* pDlayerParam = &pParam->sDependencyLayers[iDlayerIndex]; |
| 1005 | 1005 | ||
| 1006 | pDqIdc->uiSpatialId = iDlayerIndex; | 1006 | pDqIdc->uiSpatialId = iDlayerIndex; |
| @@ -1120,7 +1120,7 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 113 unmodified lines | |||
| 1120 | // Adaptive size_cs, size_fdec by implementation dependency | 1120 | // Adaptive size_cs, size_fdec by implementation dependency |
| 1121 | iTemporalIdx = 0; | 1121 | iTemporalIdx = 0; |
| 1122 | while (iTemporalIdx < iCntTid) { | 1122 | while (iTemporalIdx < iCntTid) { |
| 1123 | const bool_t kbBaseTemporalFlag = (iTemporalIdx == 0); | 1123 | const bool kbBaseTemporalFlag = (iTemporalIdx == 0); |
| 1124 | 1124 | ||
| 1125 | iSpatialIdx = 0; | 1125 | iSpatialIdx = 0; |
| 1126 | while (iSpatialIdx < kiNumSpatialLayers) { | 1126 | while (iSpatialIdx < kiNumSpatialLayers) { |
| @@ -1153,7 +1153,7 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 26 unmodified lines | |||
| 1153 | 1153 | ||
| 1154 | iTemporalIdx = 0; | 1154 | iTemporalIdx = 0; |
| 1155 | while (iTemporalIdx < iCntTid) { | 1155 | while (iTemporalIdx < iCntTid) { |
| 1156 | const bool_t kbBaseTemporalFlag = (iTemporalIdx == 0); | 1156 | const bool kbBaseTemporalFlag = (iTemporalIdx == 0); |
| 1157 | 1157 | ||
| 1158 | iSpatialIdx = 0; | 1158 | iSpatialIdx = 0; |
| 1159 | while (iSpatialIdx < iCountLayersNeedCs[kbBaseTemporalFlag]) { | 1159 | while (iSpatialIdx < iCountLayersNeedCs[kbBaseTemporalFlag]) { |
| @@ -1172,13 +1172,13 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 12 unmodified lines | |||
| 1172 | } | 1172 | } |
| 1173 | iTemporalIdx = 0; | 1173 | iTemporalIdx = 0; |
| 1174 | while (iTemporalIdx < iCntTid) { | 1174 | while (iTemporalIdx < iCntTid) { |
| 1175 | const bool_t kbBaseTemporalFlag = (iTemporalIdx == 0); | 1175 | const bool kbBaseTemporalFlag = (iTemporalIdx == 0); |
| 1176 | 1176 | ||
| 1177 | iSpatialIdx = 0; | 1177 | iSpatialIdx = 0; |
| 1178 | while (iSpatialIdx < kiNumSpatialLayers) { | 1178 | while (iSpatialIdx < kiNumSpatialLayers) { |
| 1179 | int32_t iMatchIndex = 0; | 1179 | int32_t iMatchIndex = 0; |
| 1180 | bool_t bInMap = false; | 1180 | bool bInMap = false; |
| 1181 | bool_t bMatchFlag = false; | 1181 | bool bMatchFlag = false; |
| 1182 | 1182 | ||
| 1183 | i = 0; | 1183 | i = 0; |
| 1184 | while (i < iCountLayersNeedCs[kbBaseTemporalFlag]) { | 1184 | while (i < iCountLayersNeedCs[kbBaseTemporalFlag]) { |
| @@ -1667,7 +1667,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 482 unmodified lines | |||
| 1667 | while (ilayer < pParam->iNumDependencyLayer) { | 1667 | while (ilayer < pParam->iNumDependencyLayer) { |
| 1668 | SDqLayer* pDq = pCtx->ppDqLayerList[ilayer]; | 1668 | SDqLayer* pDq = pCtx->ppDqLayerList[ilayer]; |
| 1669 | SDLayerParam* pDlp = &pCtx->pSvcParam->sDependencyLayers[ilayer]; | 1669 | SDLayerParam* pDlp = &pCtx->pSvcParam->sDependencyLayers[ilayer]; |
| 1670 | const bool_t kbIsDynamicSlicing = (SM_DYN_SLICE == pDlp->sMso.uiSliceMode); | 1670 | const bool kbIsDynamicSlicing = (SM_DYN_SLICE == pDlp->sMso.uiSliceMode); |
| 1671 | 1671 | ||
| 1672 | // pDq layers | 1672 | // pDq layers |
| 1673 | if (NULL != pDq) { | 1673 | if (NULL != pDq) { |
| @@ -2312,10 +2312,10 @@ void DynslcUpdateMbNeighbourInfoListForAllSlices (SSliceCtx* pSliceCtx, SMB* pMb · 638 unmodified lines | |||
| 2312 | const int32_t kiMbXY = pMb->iMbXY; | 2312 | const int32_t kiMbXY = pMb->iMbXY; |
| 2313 | const int32_t kiMbX = pMb->iMbX; | 2313 | const int32_t kiMbX = pMb->iMbX; |
| 2314 | const int32_t kiMbY = pMb->iMbY; | 2314 | const int32_t kiMbY = pMb->iMbY; |
| 2315 | bool_t bLeft; | 2315 | bool bLeft; |
| 2316 | bool_t bTop; | 2316 | bool bTop; |
| 2317 | bool_t bLeftTop; | 2317 | bool bLeftTop; |
| 2318 | bool_t bRightTop; | 2318 | bool bRightTop; |
| 2319 | int32_t uiSliceIdc; | 2319 | int32_t uiSliceIdc; |
| 2320 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; | 2320 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; |
| 2321 | 2321 | ||
| @@ -2550,7 +2550,7 @@ void WelsInitCurrentLayer (sWelsEncCtx* pCtx, · 228 unmodified lines | |||
| 2550 | SSlice* pBaseSlice = &pCurDq->sLayerInfo.pSliceInLayer[0]; | 2550 | SSlice* pBaseSlice = &pCurDq->sLayerInfo.pSliceInLayer[0]; |
| 2551 | SSlice* pSlice = NULL; | 2551 | SSlice* pSlice = NULL; |
| 2552 | const uint8_t kiCurDid = pCtx->uiDependencyId; | 2552 | const uint8_t kiCurDid = pCtx->uiDependencyId; |
| 2553 | const bool_t kbUseSubsetSpsFlag = (kiCurDid > BASE_DEPENDENCY_ID); | 2553 | const bool kbUseSubsetSpsFlag = (kiCurDid > BASE_DEPENDENCY_ID); |
| 2554 | SDLayerParam* fDlp = &pParam->sDependencyLayers[kiCurDid]; | 2554 | SDLayerParam* fDlp = &pParam->sDependencyLayers[kiCurDid]; |
| 2555 | SNalUnitHeaderExt* pNalHdExt = &pCurDq->sLayerInfo.sNalHeaderExt; | 2555 | SNalUnitHeaderExt* pNalHdExt = &pCurDq->sLayerInfo.sNalHeaderExt; |
| 2556 | SNalUnitHeader* pNalHd = &pNalHdExt->sNalHeader; | 2556 | SNalUnitHeader* pNalHd = &pNalHdExt->sNalHeader; |
| @@ -2638,7 +2638,7 @@ void WelsInitCurrentLayer (sWelsEncCtx* pCtx, · 81 unmodified lines | |||
| 2638 | 2638 | ||
| 2639 | void PreprocessSliceCoding (sWelsEncCtx* pCtx) { | 2639 | void PreprocessSliceCoding (sWelsEncCtx* pCtx) { |
| 2640 | SDqLayer* pCurLayer = pCtx->pCurDqLayer; | 2640 | SDqLayer* pCurLayer = pCtx->pCurDqLayer; |
| 2641 | const bool_t kbBaseAvail = pCurLayer->bBaseLayerAvailableFlag; | 2641 | const bool kbBaseAvail = pCurLayer->bBaseLayerAvailableFlag; |
| 2642 | 2642 | ||
| 2643 | /* function pointers conditional assignment under sWelsEncCtx, layer_mb_enc_rec (in stack) is exclusive */ | 2643 | /* function pointers conditional assignment under sWelsEncCtx, layer_mb_enc_rec (in stack) is exclusive */ |
| 2644 | 2644 | ||
| @@ -2766,7 +2766,7 @@ void ParasetIdAdditionIdAdjust (SParaSetOffsetVariable* sParaSetOffsetVariable, · 121 unmodified lines | |||
| 2766 | 2766 | ||
| 2767 | const int32_t kiEncId = kiCurEncoderParaSetId; | 2767 | const int32_t kiEncId = kiCurEncoderParaSetId; |
| 2768 | const uint32_t kuiPrevIdInBs = sParaSetOffsetVariable->iParaSetIdDelta[kiEncId] + kiEncId;//mark current_id | 2768 | const uint32_t kuiPrevIdInBs = sParaSetOffsetVariable->iParaSetIdDelta[kiEncId] + kiEncId;//mark current_id |
| 2769 | const bool_t* kpUsedIdPointer = &sParaSetOffsetVariable->bUsedParaSetIdInBs[0]; | 2769 | const bool* kpUsedIdPointer = &sParaSetOffsetVariable->bUsedParaSetIdInBs[0]; |
| 2770 | uint32_t uiNextIdInBs = sParaSetOffsetVariable->uiNextParaSetIdToUseInBs; | 2770 | uint32_t uiNextIdInBs = sParaSetOffsetVariable->uiNextParaSetIdToUseInBs; |
| 2771 | 2771 | ||
| 2772 | #if _DEBUG | 2772 | #if _DEBUG |
| @@ -2817,7 +2817,7 @@ int32_t WelsWriteParameterSets (sWelsEncCtx* pCtx, int32_t* pNalLen, int32_t* pN · 44 unmodified lines | |||
| 2817 | while (iIdx < pCtx->iSpsNum) { | 2817 | while (iIdx < pCtx->iSpsNum) { |
| 2818 | SDqIdc* pDqIdc = &pCtx->pDqIdcMap[iIdx]; | 2818 | SDqIdc* pDqIdc = &pCtx->pDqIdcMap[iIdx]; |
| 2819 | const int32_t kiDid = pDqIdc->uiSpatialId; | 2819 | const int32_t kiDid = pDqIdc->uiSpatialId; |
| 2820 | const bool_t kbUsingSubsetSps = (kiDid > BASE_DEPENDENCY_ID); | 2820 | const bool kbUsingSubsetSps = (kiDid > BASE_DEPENDENCY_ID); |
| 2821 | 2821 | ||
| 2822 | iNal = pCtx->pOut->iNalIndex; | 2822 | iNal = pCtx->pOut->iNalIndex; |
| 2823 | 2823 | ||
| @@ -3009,7 +3009,7 @@ int32_t PostProcDynamicSlicingBsWriting (sWelsEncCtx* pCtx, SLayerBSInfo* pLayer · 185 unmodified lines | |||
| 3009 | // uiSliceIdx: 0 1 2 3 4 5 6 7 8 9 10 | 3009 | // uiSliceIdx: 0 1 2 3 4 5 6 7 8 9 10 |
| 3010 | iCheckingIdx = 0; | 3010 | iCheckingIdx = 0; |
| 3011 | while (true) { | 3011 | while (true) { |
| 3012 | bool_t bMatchFlag = false; | 3012 | bool bMatchFlag = false; |
| 3013 | iPartitionIdx = 0; | 3013 | iPartitionIdx = 0; |
| 3014 | while (iPartitionIdx < kiPartitionCnt) { | 3014 | while (iPartitionIdx < kiPartitionCnt) { |
| 3015 | const int32_t coded_slice_cnt = pCurDq->pNumSliceCodedOfPartition[iPartitionIdx]; | 3015 | const int32_t coded_slice_cnt = pCurDq->pNumSliceCodedOfPartition[iPartitionIdx]; |
| @@ -3124,7 +3124,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 108 unmodified lines | |||
| 3124 | EWelsNalRefIdc eNalRefIdc = NRI_PRI_LOWEST; | 3124 | EWelsNalRefIdc eNalRefIdc = NRI_PRI_LOWEST; |
| 3125 | int8_t iCurDid = 0; | 3125 | int8_t iCurDid = 0; |
| 3126 | int8_t iCurTid = 0; | 3126 | int8_t iCurTid = 0; |
| 3127 | bool_t bAvcBased = false; | 3127 | bool bAvcBased = false; |
| 3128 | #if defined(ENABLE_PSNR_CALC) | 3128 | #if defined(ENABLE_PSNR_CALC) |
| 3129 | float snr_y = .0f, snr_u = .0f, snr_v = .0f; | 3129 | float snr_y = .0f, snr_u = .0f, snr_v = .0f; |
| 3130 | #endif//ENABLE_PSNR_CALC | 3130 | #endif//ENABLE_PSNR_CALC |
| @@ -3531,7 +3531,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, void* pDst, const SSourcePictur · 400 unmodified lines | |||
| 3531 | } else // for non-dynamic-slicing mode single threading branch.. | 3531 | } else // for non-dynamic-slicing mode single threading branch.. |
| 3532 | #endif//MT_ENABLED | 3532 | #endif//MT_ENABLED |
| 3533 | { | 3533 | { |
| 3534 | const bool_t bNeedPrefix = pCtx->bNeedPrefixNalFlag; | 3534 | const bool bNeedPrefix = pCtx->bNeedPrefixNalFlag; |
| 3535 | int32_t iSliceIdx = 0; | 3535 | int32_t iSliceIdx = 0; |
| 3536 | 3536 | ||
| 3537 | iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer->pSliceEncCtx); | 3537 | iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer->pSliceEncCtx); |
| @@ -3810,7 +3810,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 272 unmodified lines | |||
| 3810 | SWelsSvcCodingParam* pOldParam = NULL; | 3810 | SWelsSvcCodingParam* pOldParam = NULL; |
| 3811 | int32_t iReturn = 0; | 3811 | int32_t iReturn = 0; |
| 3812 | int8_t iIndexD = 0; | 3812 | int8_t iIndexD = 0; |
| 3813 | bool_t bNeedReset = false; | 3813 | bool bNeedReset = false; |
| 3814 | 3814 | ||
| 3815 | if (NULL == ppCtx || NULL == *ppCtx || NULL == pNewParam) return 1; | 3815 | if (NULL == ppCtx || NULL == *ppCtx || NULL == pNewParam) return 1; |
| 3816 | 3816 | ||
| @@ -4006,7 +4006,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 189 unmodified lines | |||
| 4006 | int32_t iAnyMbLeftInPartition = iEndMbInPartition - iFirstMbInPartition; | 4006 | int32_t iAnyMbLeftInPartition = iEndMbInPartition - iFirstMbInPartition; |
| 4007 | const EWelsNalUnitType keNalType = pCtx->eNalType; | 4007 | const EWelsNalUnitType keNalType = pCtx->eNalType; |
| 4008 | const EWelsNalRefIdc keNalRefIdc = pCtx->eNalPriority; | 4008 | const EWelsNalRefIdc keNalRefIdc = pCtx->eNalPriority; |
| 4009 | const bool_t kbNeedPrefix = pCtx->bNeedPrefixNalFlag; | 4009 | const bool kbNeedPrefix = pCtx->bNeedPrefixNalFlag; |
| 4010 | 4010 | ||
| 4011 | //init | 4011 | //init |
| 4012 | { | 4012 | { |