One bool typedef is already more than enough, two is too many.
Unified · Split
| @@ -276,7 +276,7 @@ return x; · 275 unmodified lines | |||
| 276 | #define BUTTERFLY4x8(dw) (((uint64_t)(dw)<<32) | (dw)) | 276 | #define BUTTERFLY4x8(dw) (((uint64_t)(dw)<<32) | (dw)) |
| 277 | #endif//BUTTERFLY4x8 | 277 | #endif//BUTTERFLY4x8 |
| 278 | 278 | ||
| 279 | static inline BOOL_T WELS_POWER2_IF (uint32_t v) { | 279 | static inline bool_t WELS_POWER2_IF (uint32_t v) { |
| 280 | return (v && ! (v & (v - 1))); | 280 | return (v && ! (v & (v - 1))); |
| 281 | } | 281 | } |
| 282 | 282 | ||
| @@ -70,7 +70,6 @@ typedef char str_t; · 69 unmodified lines | |||
| 70 | #define EPSN (0.000001f) // (1e-6) // desired float precision | 70 | #define EPSN (0.000001f) // (1e-6) // desired float precision |
| 71 | 71 | ||
| 72 | typedef bool bool_t; | 72 | typedef bool bool_t; |
| 73 | typedef int32_t BOOL_T; | ||
| 74 | 73 | ||
| 75 | #ifndef FALSE | 74 | #ifndef FALSE |
| 76 | #define FALSE ((int32_t)0) | 75 | #define FALSE ((int32_t)0) |
| @@ -252,8 +252,8 @@ int32_t DeblockingAvailableNoInterlayer (PDqLayer pCurDqLayer, int32_t iFilterId · 251 unmodified lines | |||
| 252 | int32_t iMbY = pCurDqLayer->iMbY; | 252 | int32_t iMbY = pCurDqLayer->iMbY; |
| 253 | int32_t iMbX = pCurDqLayer->iMbX; | 253 | int32_t iMbX = pCurDqLayer->iMbX; |
| 254 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; | 254 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 255 | BOOL_T bLeftFlag = FALSE; | 255 | bool_t bLeftFlag = FALSE; |
| 256 | BOOL_T bTopFlag = FALSE; | 256 | bool_t bTopFlag = FALSE; |
| 257 | 257 | ||
| 258 | if (2 == iFilterIdc) { | 258 | if (2 == iFilterIdc) { |
| 259 | bLeftFlag = (iMbX > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - 1]); | 259 | bLeftFlag = (iMbX > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - 1]); |
| @@ -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 | ||
| 108 | inline BOOL_T CheckSliceNeedReconstruct (int16_t iCurDid, int16_t iCurQid, bool_t bStoreRefBasePicFlag, | 108 | inline bool_t CheckSliceNeedReconstruct (int16_t iCurDid, int16_t iCurQid, bool_t 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 base | 110 | return ((iCurDid == uiDidMax) && (iCurQid == BASE_QUALITY_ID) && (bStoreRefBasePicFlag)) // store base |
| 111 | || (uiLayerDqId == uiTargetDqId); // target layer | 111 | || (uiLayerDqId == uiTargetDqId); // target layer |
| @@ -1774,7 +1774,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 · 1662 unmodified lines | |||
| 1774 | * Loop decoding for slices (even FMO and/ multiple slices) within a dq layer | 1774 | * 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_t 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; |
| @@ -130,7 +130,7 @@ void PredictSadSkip (int8_t* pRefIndexCache, bool_t* pMbSkipCache, int32_t* pSad · 129 unmodified lines | |||
| 130 | 130 | ||
| 131 | // for pfGetVarianceFromIntraVaa function ptr adaptive by CPU features, 6/7/2010 | 131 | // for pfGetVarianceFromIntraVaa function ptr adaptive by CPU features, 6/7/2010 |
| 132 | void InitIntraAnalysisVaaInfo (SWelsFuncPtrList* pFuncList, const uint32_t kuiCpuFlag); | 132 | void InitIntraAnalysisVaaInfo (SWelsFuncPtrList* pFuncList, const uint32_t kuiCpuFlag); |
| 133 | BOOL_T MdIntraAnalysisVaaInfo (sWelsEncCtx* pEncCtx, uint8_t* pEncMb); | 133 | bool_t MdIntraAnalysisVaaInfo (sWelsEncCtx* pEncCtx, uint8_t* pEncMb); |
| 134 | 134 | ||
| 135 | uint8_t MdInterAnalysisVaaInfo_c (int32_t* pSad8x8); | 135 | uint8_t MdInterAnalysisVaaInfo_c (int32_t* pSad8x8); |
| 136 | 136 | ||
| @@ -73,7 +73,7 @@ int32_t iCountNals; // count number of NAL in list · 72 unmodified lines | |||
| 73 | // SVC: num_sps (MAX_D) + num_pps (MAX_D) + num_vcl (MAX_D * MAX_Q) | 73 | // SVC: num_sps (MAX_D) + num_pps (MAX_D) + num_vcl (MAX_D * MAX_Q) |
| 74 | int32_t iNalIndex; // coding NAL currently, 0 based | 74 | int32_t iNalIndex; // coding NAL currently, 0 based |
| 75 | 75 | ||
| 76 | // BOOL_T bAnnexBFlag; // annexeb flag, to figure it pOut the packetization mode whether need 4 bytes (0 0 0 1) of start code prefix | 76 | // bool_t bAnnexBFlag; // annexeb flag, to figure it pOut the packetization mode whether need 4 bytes (0 0 0 1) of start code prefix |
| 77 | } SWelsEncoderOutput; | 77 | } SWelsEncoderOutput; |
| 78 | 78 | ||
| 79 | //#define MT_DEBUG_BS_WR 0 // for MT debugging if needed | 79 | //#define MT_DEBUG_BS_WR 0 // for MT debugging if needed |
| @@ -91,9 +91,9 @@ SWelsNalRaw sNalList[2]; // nal list, PREFIX NAL(if applicable) + SLICE NAL · 11 unmodified lines | |||
| 91 | int32_t iNalLen[2]; | 91 | int32_t iNalLen[2]; |
| 92 | int32_t iNalIndex; // coding NAL currently, 0 based | 92 | int32_t iNalIndex; // coding NAL currently, 0 based |
| 93 | 93 | ||
| 94 | // BOOL_T bAnnexBFlag; // annexeb flag, to figure it pOut the packetization mode whether need 4 bytes (0 0 0 1) of start code prefix | 94 | // bool_t bAnnexBFlag; // annexeb flag, to figure it pOut the packetization mode whether need 4 bytes (0 0 0 1) of start code prefix |
| 95 | #if MT_DEBUG_BS_WR | 95 | #if MT_DEBUG_BS_WR |
| 96 | BOOL_T bSliceCodedFlag; | 96 | bool_t bSliceCodedFlag; |
| 97 | #endif//MT_DEBUG_BS_WR | 97 | #endif//MT_DEBUG_BS_WR |
| 98 | } SWelsSliceBs; | 98 | } SWelsSliceBs; |
| 99 | 99 | ||
| @@ -77,11 +77,11 @@ void WelsResetRefList (sWelsEncCtx* pCtx); · 76 unmodified lines | |||
| 77 | /* | 77 | /* |
| 78 | * update reference picture list | 78 | * update reference picture list |
| 79 | */ | 79 | */ |
| 80 | BOOL_T WelsUpdateRefList (sWelsEncCtx* pCtx); | 80 | bool_t WelsUpdateRefList (sWelsEncCtx* pCtx); |
| 81 | /* | 81 | /* |
| 82 | * build reference picture list | 82 | * build reference picture list |
| 83 | */ | 83 | */ |
| 84 | BOOL_T WelsBuildRefList (sWelsEncCtx* pCtx, const int32_t kiPOC); | 84 | bool_t WelsBuildRefList (sWelsEncCtx* pCtx, const int32_t kiPOC); |
| 85 | 85 | ||
| 86 | /* | 86 | /* |
| 87 | * update syntax for reference base related | 87 | * update syntax for reference base related |
| @@ -98,10 +98,10 @@ void ResetCountBsSizeInPartitions (uint32_t* pCountBsSizeList, const int32_t kiP · 97 unmodified lines | |||
| 98 | 98 | ||
| 99 | #ifdef _WIN32 | 99 | #ifdef _WIN32 |
| 100 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, SLayerBSInfo* pLayerBsInfo, | 100 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, SLayerBSInfo* pLayerBsInfo, |
| 101 | const uint32_t kuiNumThreads/*, int32_t *iLayerNum*/, SSliceCtx* pSliceCtx, const BOOL_T kbIsDynamicSlicingMode); | 101 | const uint32_t kuiNumThreads/*, int32_t *iLayerNum*/, SSliceCtx* pSliceCtx, const bool_t kbIsDynamicSlicingMode); |
| 102 | #else | 102 | #else |
| 103 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT** ppEventsList, SLayerBSInfo* pLayerBsInfo, | 103 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT** ppEventsList, SLayerBSInfo* pLayerBsInfo, |
| 104 | const uint32_t kuiNumThreads/*, int32_t *iLayerNum*/, SSliceCtx* pSliceCtx, const BOOL_T kbIsDynamicSlicingMode); | 104 | const uint32_t kuiNumThreads/*, int32_t *iLayerNum*/, SSliceCtx* pSliceCtx, const bool_t kbIsDynamicSlicingMode); |
| 105 | #endif//_WIN32 | 105 | #endif//_WIN32 |
| 106 | 106 | ||
| 107 | int32_t DynamicDetectCpuCores(); | 107 | int32_t DynamicDetectCpuCores(); |
| @@ -57,7 +57,7 @@ int32_t WelsMdIntraFinePartitionVaa (void* pEncCtx, void* pWelsMd, SMB* pCurMb, · 56 unmodified lines | |||
| 57 | void WelsMdIntraMb (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); | 57 | void WelsMdIntraMb (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); |
| 58 | 58 | ||
| 59 | void WelsMdBackgroundMbEnc (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache, SSlice* pSlice, bool_t bSkipMbFlag); | 59 | void WelsMdBackgroundMbEnc (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache, SSlice* pSlice, bool_t bSkipMbFlag); |
| 60 | BOOL_T WelsMdPSkipEnc (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache); | 60 | bool_t WelsMdPSkipEnc (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache); |
| 61 | int32_t WelsMdP16x16 (SWelsFuncPtrList* pFunc, SDqLayer* pCurDqLayer, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb); | 61 | int32_t WelsMdP16x16 (SWelsFuncPtrList* pFunc, SDqLayer* pCurDqLayer, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb); |
| 62 | 62 | ||
| 63 | int32_t WelsMdP16x8 (SWelsFuncPtrList* pFunc, SDqLayer* pCurDqLayer, SWelsMD* pWelsMd, SSlice* pSlice); | 63 | int32_t WelsMdP16x8 (SWelsFuncPtrList* pFunc, SDqLayer* pCurDqLayer, SWelsMD* pWelsMd, SSlice* pSlice); |
| @@ -67,17 +67,17 @@ int32_t WelsMdP8x8 (SWelsFuncPtrList* pFunc, SDqLayer* pCurDqLayer, SWelsMD* pWe · 3 unmodified lines | |||
| 67 | /*static*/ void WelsMdInterFinePartition (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, int32_t bestCost); | 67 | /*static*/ void WelsMdInterFinePartition (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, int32_t bestCost); |
| 68 | /*static*/ void WelsMdInterFinePartitionVaa (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, int32_t bestCost); | 68 | /*static*/ void WelsMdInterFinePartitionVaa (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, int32_t bestCost); |
| 69 | void WelsMdInterMbRefinement (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); | 69 | void WelsMdInterMbRefinement (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); |
| 70 | BOOL_T WelsMdFirstIntraMode (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache); | 70 | bool_t WelsMdFirstIntraMode (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache); |
| 71 | //BOOL_T svc_md_first_intra_mode_constrained(void* pEnc, void* pMd, SMB* pCurMb, SMbCache *pMbCache); | 71 | //bool_t svc_md_first_intra_mode_constrained(void* pEnc, void* pMd, SMB* pCurMb, SMbCache *pMbCache); |
| 72 | void WelsMdInterMb (void* pEncCtx, void* pWelsMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pUnused); | 72 | void WelsMdInterMb (void* pEncCtx, void* pWelsMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pUnused); |
| 73 | 73 | ||
| 74 | //both used in BL and EL | 74 | //both used in BL and EL |
| 75 | //void wels_md_inter_init ( SWelsMD* pMd, const uint8_t ref_idx, const bool_t is_highest_dlayer_flag ); | 75 | //void wels_md_inter_init ( SWelsMD* pMd, const uint8_t ref_idx, const bool_t is_highest_dlayer_flag ); |
| 76 | 76 | ||
| 77 | bool_t WelsMdInterJudgeBGDPskip (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, | 77 | bool_t WelsMdInterJudgeBGDPskip (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, |
| 78 | BOOL_T* bKeepSkip); | 78 | bool_t* bKeepSkip); |
| 79 | bool_t WelsMdInterJudgeBGDPskipFalse (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, | 79 | bool_t WelsMdInterJudgeBGDPskipFalse (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, |
| 80 | BOOL_T* bKeepSkip); | 80 | bool_t* bKeepSkip); |
| 81 | 81 | ||
| 82 | void WelsMdInterUpdateBGDInfo (SDqLayer* pCurLayer, SMB* pCurMb, const bool_t kbCollocatedPredFlag, | 82 | void WelsMdInterUpdateBGDInfo (SDqLayer* pCurLayer, SMB* pCurMb, const bool_t kbCollocatedPredFlag, |
| 83 | const int32_t kiRefPictureType); | 83 | const int32_t kiRefPictureType); |
| @@ -85,7 +85,7 @@ void WelsMdInterUpdateBGDInfoNULL (SDqLayer* pCurLayer, SMB* pCurMb, const bool · 1 unmodified line | |||
| 85 | const int32_t kiRefPictureType); | 85 | const int32_t kiRefPictureType); |
| 86 | 86 | ||
| 87 | bool_t WelsMdInterJudgePskip (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, | 87 | bool_t WelsMdInterJudgePskip (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, |
| 88 | BOOL_T bTrySkip); | 88 | bool_t bTrySkip); |
| 89 | void WelsMdInterUpdatePskip (SDqLayer* pCurDqLayer, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache); | 89 | void WelsMdInterUpdatePskip (SDqLayer* pCurDqLayer, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache); |
| 90 | void WelsMdInterDecidedPskip (sWelsEncCtx* pEncCtx, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache); | 90 | void WelsMdInterDecidedPskip (sWelsEncCtx* pEncCtx, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache); |
| 91 | 91 | ||
| @@ -96,7 +96,7 @@ void WelsMdInterSaveSadAndRefMbType (Mb_Type* pRefMbTypeList, SMbCache* pMbCache · 4 unmodified lines | |||
| 96 | const SWelsMD* kpMd); | 96 | const SWelsMD* kpMd); |
| 97 | 97 | ||
| 98 | void WelsMdInterSecondaryModesEnc (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, | 98 | void WelsMdInterSecondaryModesEnc (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, |
| 99 | SMbCache* pMbCache, const BOOL_T kbSkip); | 99 | SMbCache* pMbCache, const bool_t kbSkip); |
| 100 | void WelsMdIntraSecondaryModesEnc (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); | 100 | void WelsMdIntraSecondaryModesEnc (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); |
| 101 | //end of: both used in BL and EL | 101 | //end of: both used in BL and EL |
| 102 | 102 | ||
| @@ -231,7 +231,7 @@ BsFlush (pBs); · 230 unmodified lines | |||
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | 233 | ||
| 234 | static inline BOOL_T BsCheckByteAlign (SBitStringAux* pBs) { | 234 | static inline bool_t BsCheckByteAlign (SBitStringAux* pBs) { |
| 235 | return ! (pBs->iLeftBits & 0x7); | 235 | return ! (pBs->iLeftBits & 0x7); |
| 236 | } | 236 | } |
| 237 | 237 | ||
| @@ -57,8 +57,8 @@ void WelsEncInterY (SWelsFuncPtrList* func, SMB* pCurMb, SMbCache* pMbCache); · 56 unmodified lines | |||
| 57 | void WelsEncRecUV (SWelsFuncPtrList* func, SMB* pCurMb, SMbCache* pMbCache, int16_t* pRs, int32_t iUV); | 57 | void WelsEncRecUV (SWelsFuncPtrList* func, SMB* pCurMb, SMbCache* pMbCache, int16_t* pRs, int32_t iUV); |
| 58 | void WelsRecPskip (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc, SMB* pCurMb, SMbCache* pMbCache); | 58 | void WelsRecPskip (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc, SMB* pCurMb, SMbCache* pMbCache); |
| 59 | 59 | ||
| 60 | BOOL_T WelsTryPYskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache); | 60 | bool_t WelsTryPYskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache); |
| 61 | BOOL_T WelsTryPUVskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache, int32_t iUV); | 61 | bool_t WelsTryPUVskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache, int32_t iUV); |
| 62 | } | 62 | } |
| 63 | #endif | 63 | #endif |
| 64 | 64 | ||
| @@ -99,7 +99,7 @@ void WelsMdInterMbLoopOverDynamicSlice (sWelsEncCtx* pEncCtx, SSlice* pSlice, vo · 98 unmodified lines | |||
| 99 | const int32_t kiSliceFirstMbXY); // for inter dynamic slice | 99 | const int32_t kiSliceFirstMbXY); // for inter dynamic slice |
| 100 | 100 | ||
| 101 | 101 | ||
| 102 | BOOL_T DynSlcJudgeSliceBoundaryStepBack (void* pEncCtx, void* pSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, | 102 | bool_t DynSlcJudgeSliceBoundaryStepBack (void* pEncCtx, void* pSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, |
| 103 | SDynamicSlicingStack* pDss); | 103 | SDynamicSlicingStack* pDss); |
| 104 | } | 104 | } |
| 105 | #endif //SVC_ENCODE_SLICE_H__ | 105 | #endif //SVC_ENCODE_SLICE_H__ |
| @@ -110,18 +110,18 @@ typedef void (*PSetNoneZeroCountZeroFunc) (int8_t* pNonZeroCount); · 109 unmodified lines | |||
| 110 | 110 | ||
| 111 | typedef int32_t (*PIntraFineMdFunc) (void* pEncCtx, void* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); | 111 | typedef int32_t (*PIntraFineMdFunc) (void* pEncCtx, void* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); |
| 112 | typedef void (*PInterFineMdFunc) (void* pEncCtx, void* pWelsMd, SSlice* slice, SMB* pCurMb, int32_t bestCost); | 112 | typedef void (*PInterFineMdFunc) (void* pEncCtx, void* pWelsMd, SSlice* slice, SMB* pCurMb, int32_t bestCost); |
| 113 | typedef BOOL_T (*PInterMdFirstIntraModeFunc) (void* pEncCtx, void* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); | 113 | typedef bool_t (*PInterMdFirstIntraModeFunc) (void* pEncCtx, void* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); |
| 114 | 114 | ||
| 115 | typedef void (*PMotionSearchFunc) (SWelsFuncPtrList* pFuncList, void* pCurDqLayer, void* pMe, | 115 | typedef void (*PMotionSearchFunc) (SWelsFuncPtrList* pFuncList, void* pCurDqLayer, void* pMe, |
| 116 | void* pSlice); // here after reset all function pointers, will set as right parameter type | 116 | void* pSlice); // here after reset all function pointers, will set as right parameter type |
| 117 | typedef void (*PFillInterNeighborCacheFunc) (SMbCache* pMbCache, SMB* pCurMb, int32_t iMbWidth, int8_t* pVaaBgMbFlag); | 117 | typedef void (*PFillInterNeighborCacheFunc) (SMbCache* pMbCache, SMB* pCurMb, int32_t iMbWidth, int8_t* pVaaBgMbFlag); |
| 118 | typedef void (*PAccumulateSadFunc) (uint32_t* pSumDiff, int32_t* pGomForegroundBlockNum, int32_t* iSad8x8, | 118 | typedef void (*PAccumulateSadFunc) (uint32_t* pSumDiff, int32_t* pGomForegroundBlockNum, int32_t* iSad8x8, |
| 119 | int8_t* pVaaBgMbFlag);//for RC | 119 | int8_t* pVaaBgMbFlag);//for RC |
| 120 | typedef BOOL_T (*PDynamicSlicingStepBackFunc) (void* pEncCtx, void* pSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, | 120 | typedef bool_t (*PDynamicSlicingStepBackFunc) (void* pEncCtx, void* pSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, |
| 121 | SDynamicSlicingStack* pDynamicSlicingStack); // 2010.8.17 | 121 | SDynamicSlicingStack* pDynamicSlicingStack); // 2010.8.17 |
| 122 | 122 | ||
| 123 | typedef bool_t (*PInterMdBackgroundDecisionFunc) (void* pEncCtx, void* pWelsMd, SSlice* slice, SMB* pCurMb, | 123 | typedef bool_t (*PInterMdBackgroundDecisionFunc) (void* pEncCtx, void* pWelsMd, SSlice* slice, SMB* pCurMb, |
| 124 | SMbCache* pMbCache, BOOL_T* pKeepPskip); | 124 | SMbCache* pMbCache, bool_t* pKeepPskip); |
| 125 | typedef void (*PInterMdBackgroundInfoUpdateFunc) (SDqLayer* pCurLayer, SMB* pCurMb, const bool_t bFlag, | 125 | typedef void (*PInterMdBackgroundInfoUpdateFunc) (SDqLayer* pCurLayer, SMB* pCurMb, const bool_t bFlag, |
| 126 | const int32_t kiRefPictureType); | 126 | const int32_t kiRefPictureType); |
| 127 | 127 | ||
| @@ -396,8 +396,8 @@ void DeblockingInterMb (DeblockingFunc* pfDeblocking, SMB* pCurMb, SDeblockingFi · 395 unmodified lines | |||
| 396 | int32_t iMbX = pCurMb->iMbX; | 396 | int32_t iMbX = pCurMb->iMbX; |
| 397 | int32_t iMbY = pCurMb->iMbY; | 397 | int32_t iMbY = pCurMb->iMbY; |
| 398 | 398 | ||
| 399 | BOOL_T bLeftBsValid[2] = { (iMbX > 0), ((iMbX > 0) && (pCurMb->uiSliceIdc == (pCurMb - 1)->uiSliceIdc))}; | 399 | bool_t bLeftBsValid[2] = { (iMbX > 0), ((iMbX > 0) && (pCurMb->uiSliceIdc == (pCurMb - 1)->uiSliceIdc))}; |
| 400 | BOOL_T bTopBsValid[2] = { (iMbY > 0), ((iMbY > 0) && (pCurMb->uiSliceIdc == (pCurMb - iMbStride)->uiSliceIdc))}; | 400 | bool_t bTopBsValid[2] = { (iMbY > 0), ((iMbY > 0) && (pCurMb->uiSliceIdc == (pCurMb - iMbStride)->uiSliceIdc))}; |
| 401 | 401 | ||
| 402 | int32_t iLeftFlag = bLeftBsValid[pFilter->uiFilterIdc]; | 402 | int32_t iLeftFlag = bLeftBsValid[pFilter->uiFilterIdc]; |
| 403 | int32_t iTopFlag = bTopBsValid[pFilter->uiFilterIdc]; | 403 | int32_t iTopFlag = bTopBsValid[pFilter->uiFilterIdc]; |
| @@ -482,8 +482,8 @@ void FilteringEdgeLumaHV (DeblockingFunc* pfDeblocking, SMB* pCurMb, SDeblocking · 78 unmodified lines | |||
| 482 | int32_t iMbX = pCurMb->iMbX; | 482 | int32_t iMbX = pCurMb->iMbX; |
| 483 | int32_t iMbY = pCurMb->iMbY; | 483 | int32_t iMbY = pCurMb->iMbY; |
| 484 | 484 | ||
| 485 | BOOL_T bLeftBsValid[2] = { (iMbX > 0), ((iMbX > 0) && (pCurMb->uiSliceIdc == (pCurMb - 1)->uiSliceIdc))}; | 485 | bool_t bLeftBsValid[2] = { (iMbX > 0), ((iMbX > 0) && (pCurMb->uiSliceIdc == (pCurMb - 1)->uiSliceIdc))}; |
| 486 | BOOL_T bTopBsValid[2] = { (iMbY > 0), ((iMbY > 0) && (pCurMb->uiSliceIdc == (pCurMb - iMbStride)->uiSliceIdc))}; | 486 | bool_t bTopBsValid[2] = { (iMbY > 0), ((iMbY > 0) && (pCurMb->uiSliceIdc == (pCurMb - iMbStride)->uiSliceIdc))}; |
| 487 | 487 | ||
| 488 | int32_t iLeftFlag = bLeftBsValid[pFilter->uiFilterIdc]; | 488 | int32_t iLeftFlag = bLeftBsValid[pFilter->uiFilterIdc]; |
| 489 | int32_t iTopFlag = bTopBsValid[pFilter->uiFilterIdc]; | 489 | int32_t iTopFlag = bTopBsValid[pFilter->uiFilterIdc]; |
| @@ -537,8 +537,8 @@ void FilteringEdgeChromaHV (DeblockingFunc* pfDeblocking, SMB* pCurMb, SDeblocki · 47 unmodified lines | |||
| 537 | int32_t iMbX = pCurMb->iMbX; | 537 | int32_t iMbX = pCurMb->iMbX; |
| 538 | int32_t iMbY = pCurMb->iMbY; | 538 | int32_t iMbY = pCurMb->iMbY; |
| 539 | 539 | ||
| 540 | BOOL_T bLeftBsValid[2] = { (iMbX > 0), ((iMbX > 0) && (pCurMb->uiSliceIdc == (pCurMb - 1)->uiSliceIdc))}; | 540 | bool_t bLeftBsValid[2] = { (iMbX > 0), ((iMbX > 0) && (pCurMb->uiSliceIdc == (pCurMb - 1)->uiSliceIdc))}; |
| 541 | BOOL_T bTopBsValid[2] = { (iMbY > 0), ((iMbY > 0) && (pCurMb->uiSliceIdc == (pCurMb - iMbStride)->uiSliceIdc))}; | 541 | bool_t bTopBsValid[2] = { (iMbY > 0), ((iMbY > 0) && (pCurMb->uiSliceIdc == (pCurMb - iMbStride)->uiSliceIdc))}; |
| 542 | 542 | ||
| 543 | int32_t iLeftFlag = bLeftBsValid[pFilter->uiFilterIdc]; | 543 | int32_t iLeftFlag = bLeftBsValid[pFilter->uiFilterIdc]; |
| 544 | int32_t iTopFlag = bTopBsValid[pFilter->uiFilterIdc]; | 544 | int32_t iTopFlag = bTopBsValid[pFilter->uiFilterIdc]; |
| @@ -593,8 +593,8 @@ void DeblockingMbAvcbase (SWelsFuncPtrList* pFunc, SMB* pCurMb, SDeblockingFilte · 48 unmodified lines | |||
| 593 | int32_t iMbX = pCurMb->iMbX; | 593 | int32_t iMbX = pCurMb->iMbX; |
| 594 | int32_t iMbY = pCurMb->iMbY; | 594 | int32_t iMbY = pCurMb->iMbY; |
| 595 | 595 | ||
| 596 | BOOL_T bLeftBsValid[2] = { (iMbX > 0), ((iMbX > 0) && (pCurMb->uiSliceIdc == (pCurMb - 1)->uiSliceIdc))}; | 596 | bool_t bLeftBsValid[2] = { (iMbX > 0), ((iMbX > 0) && (pCurMb->uiSliceIdc == (pCurMb - 1)->uiSliceIdc))}; |
| 597 | BOOL_T bTopBsValid[2] = { (iMbY > 0), ((iMbY > 0) && (pCurMb->uiSliceIdc == (pCurMb - iMbStride)->uiSliceIdc))}; | 597 | bool_t bTopBsValid[2] = { (iMbY > 0), ((iMbY > 0) && (pCurMb->uiSliceIdc == (pCurMb - iMbStride)->uiSliceIdc))}; |
| 598 | 598 | ||
| 599 | int32_t iLeftFlag = bLeftBsValid[pFilter->uiFilterIdc]; | 599 | int32_t iLeftFlag = bLeftBsValid[pFilter->uiFilterIdc]; |
| 600 | int32_t iTopFlag = bTopBsValid[pFilter->uiFilterIdc]; | 600 | int32_t iTopFlag = bTopBsValid[pFilter->uiFilterIdc]; |
| @@ -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_t bLeft; |
| 640 | BOOL_T bTop; | 640 | bool_t bTop; |
| 641 | BOOL_T bLeftTop; | 641 | bool_t bLeftTop; |
| 642 | BOOL_T bRightTop; | 642 | bool_t 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 | ||
| @@ -1667,7 +1667,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 1021 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_t 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_t bLeft; |
| 2316 | BOOL_T bTop; | 2316 | bool_t bTop; |
| 2317 | BOOL_T bLeftTop; | 2317 | bool_t bLeftTop; |
| 2318 | BOOL_T bRightTop; | 2318 | bool_t 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 | ||
| @@ -494,7 +494,7 @@ void InitIntraAnalysisVaaInfo (SWelsFuncPtrList* pFuncList, const uint32_t kuiCp · 493 unmodified lines | |||
| 494 | #endif//X86_ASM | 494 | #endif//X86_ASM |
| 495 | } | 495 | } |
| 496 | 496 | ||
| 497 | BOOL_T MdIntraAnalysisVaaInfo (sWelsEncCtx* pEncCtx, uint8_t* pEncMb) { | 497 | bool_t MdIntraAnalysisVaaInfo (sWelsEncCtx* pEncCtx, uint8_t* pEncMb) { |
| 498 | 498 | ||
| 499 | SDqLayer* pCurDqLayer = pEncCtx->pCurDqLayer; | 499 | SDqLayer* pCurDqLayer = pEncCtx->pCurDqLayer; |
| 500 | const int32_t kiLineSize = pCurDqLayer->iEncStride[0]; | 500 | const int32_t kiLineSize = pCurDqLayer->iEncStride[0]; |
| @@ -108,7 +108,7 @@ void RcInitSequenceParameter (sWelsEncCtx* pEncCtx) { · 107 unmodified lines | |||
| 108 | int32_t j = 0; | 108 | int32_t j = 0; |
| 109 | int32_t iMbWidth = 0; | 109 | int32_t iMbWidth = 0; |
| 110 | 110 | ||
| 111 | BOOL_T bMultiSliceMode = FALSE; | 111 | bool_t bMultiSliceMode = FALSE; |
| 112 | int32_t iGomRowMode0 = 1, iGomRowMode1 = 1; | 112 | int32_t iGomRowMode0 = 1, iGomRowMode1 = 1; |
| 113 | #ifdef _TEST_TEMP_RC_ | 113 | #ifdef _TEST_TEMP_RC_ |
| 114 | fp_test_rc = fopen ("testRC.dat", "w"); | 114 | fp_test_rc = fopen ("testRC.dat", "w"); |
| @@ -324,7 +324,7 @@ static inline void PrefetchNextBuffer (sWelsEncCtx* pCtx) { · 323 unmodified lines | |||
| 324 | /* | 324 | /* |
| 325 | * update reference picture list | 325 | * update reference picture list |
| 326 | */ | 326 | */ |
| 327 | BOOL_T WelsUpdateRefList (sWelsEncCtx* pCtx) { | 327 | bool_t WelsUpdateRefList (sWelsEncCtx* pCtx) { |
| 328 | SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId]; | 328 | SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId]; |
| 329 | SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId]; | 329 | SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId]; |
| 330 | SDLayerParam* pParamD = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId]; | 330 | SDLayerParam* pParamD = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId]; |
| @@ -532,7 +532,7 @@ void FilterLTRMarkingFeedback (sWelsEncCtx* pCtx, SLTRMarkingFeedback* pLTRMarki · 201 unmodified lines | |||
| 532 | /* | 532 | /* |
| 533 | * build reference picture list | 533 | * build reference picture list |
| 534 | */ | 534 | */ |
| 535 | BOOL_T WelsBuildRefList (sWelsEncCtx* pCtx, const int32_t iPOC) { | 535 | bool_t WelsBuildRefList (sWelsEncCtx* pCtx, const int32_t iPOC) { |
| 536 | SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId]; | 536 | SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId]; |
| 537 | SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId]; | 537 | SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId]; |
| 538 | const int32_t kiNumRef = pCtx->pSvcParam->iNumRefFrame; | 538 | const int32_t kiNumRef = pCtx->pSvcParam->iNumRefFrame; |
| @@ -81,10 +81,10 @@ void UpdateMbListNeighborParallel (SSliceCtx* pSliceCtx, · 80 unmodified lines | |||
| 81 | const int32_t kiMbXY = pMb->iMbXY; | 81 | const int32_t kiMbXY = pMb->iMbXY; |
| 82 | const int32_t kiMbX = pMb->iMbX; | 82 | const int32_t kiMbX = pMb->iMbX; |
| 83 | const int32_t kiMbY = pMb->iMbY; | 83 | const int32_t kiMbY = pMb->iMbY; |
| 84 | BOOL_T bLeft; | 84 | bool_t bLeft; |
| 85 | BOOL_T bTop; | 85 | bool_t bTop; |
| 86 | BOOL_T bLeftTop; | 86 | bool_t bLeftTop; |
| 87 | BOOL_T bRightTop; | 87 | bool_t bRightTop; |
| 88 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; | 88 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; |
| 89 | 89 | ||
| 90 | iLeftXY = kiMbXY - 1; | 90 | iLeftXY = kiMbXY - 1; |
| @@ -688,7 +688,7 @@ int32_t AppendSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, const int32 · 597 unmodified lines | |||
| 688 | SWelsSvcCodingParam* pCodingParam = pCtx->pSvcParam; | 688 | SWelsSvcCodingParam* pCodingParam = pCtx->pSvcParam; |
| 689 | SDLayerParam* pDlp = &pCodingParam->sDependencyLayers[pCtx->uiDependencyId]; | 689 | SDLayerParam* pDlp = &pCodingParam->sDependencyLayers[pCtx->uiDependencyId]; |
| 690 | SWelsSliceBs* pSliceBs = NULL; | 690 | SWelsSliceBs* pSliceBs = NULL; |
| 691 | const BOOL_T kbIsDynamicSlicingMode = (pDlp->sMso.uiSliceMode == SM_DYN_SLICE); | 691 | const bool_t kbIsDynamicSlicingMode = (pDlp->sMso.uiSliceMode == SM_DYN_SLICE); |
| 692 | int32_t iLayerSize = 0; | 692 | int32_t iLayerSize = 0; |
| 693 | int32_t iNalIdxBase = pLbi->iNalCount; | 693 | int32_t iNalIdxBase = pLbi->iNalCount; |
| 694 | int32_t iSliceIdx = 0; | 694 | int32_t iSliceIdx = 0; |
| @@ -1252,10 +1252,10 @@ void ResetCountBsSizeInPartitions (uint32_t* pCountBsSizeList, const int32_t iPa · 557 unmodified lines | |||
| 1252 | 1252 | ||
| 1253 | #ifdef _WIN32 | 1253 | #ifdef _WIN32 |
| 1254 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, SLayerBSInfo* pLbi, | 1254 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, SLayerBSInfo* pLbi, |
| 1255 | const uint32_t uiNumThreads, SSliceCtx* pSliceCtx, const BOOL_T bIsDynamicSlicingMode) | 1255 | const uint32_t uiNumThreads, SSliceCtx* pSliceCtx, const bool_t bIsDynamicSlicingMode) |
| 1256 | #else | 1256 | #else |
| 1257 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT** pEventsList, SLayerBSInfo* pLbi, | 1257 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT** pEventsList, SLayerBSInfo* pLbi, |
| 1258 | const uint32_t uiNumThreads, SSliceCtx* pSliceCtx, const BOOL_T bIsDynamicSlicingMode) | 1258 | const uint32_t uiNumThreads, SSliceCtx* pSliceCtx, const bool_t bIsDynamicSlicingMode) |
| 1259 | #endif//WIN32 | 1259 | #endif//WIN32 |
| 1260 | { | 1260 | { |
| 1261 | int32_t iEndMbIdx = 0; | 1261 | int32_t iEndMbIdx = 0; |
| @@ -1376,7 +1376,7 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 114 unmodified lines | |||
| 1376 | int32_t iNeedAdj = 1; | 1376 | int32_t iNeedAdj = 1; |
| 1377 | // uiSliceMode of referencing spatial should be SM_FIXEDSLCNUM_SLICE | 1377 | // uiSliceMode of referencing spatial should be SM_FIXEDSLCNUM_SLICE |
| 1378 | // if using spatial base layer for complexity estimation | 1378 | // if using spatial base layer for complexity estimation |
| 1379 | const BOOL_T kbModelingFromSpatial = (pCtx->pCurDqLayer->pRefLayer != NULL && iCurDid > 0) | 1379 | const bool_t kbModelingFromSpatial = (pCtx->pCurDqLayer->pRefLayer != NULL && iCurDid > 0) |
| 1380 | && (pCtx->pSvcParam->sDependencyLayers[iCurDid - 1].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE | 1380 | && (pCtx->pSvcParam->sDependencyLayers[iCurDid - 1].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE |
| 1381 | && pCtx->pSvcParam->iMultipleThreadIdc >= pCtx->pSvcParam->sDependencyLayers[iCurDid - | 1381 | && pCtx->pSvcParam->iMultipleThreadIdc >= pCtx->pSvcParam->sDependencyLayers[iCurDid - |
| 1382 | 1].sMso.sSliceArgument.iSliceNum); | 1382 | 1].sMso.sSliceArgument.iSliceNum); |
| @@ -1307,7 +1307,7 @@ void WelsMdBackgroundMbEnc (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCac · 1306 unmodified lines | |||
| 1307 | pFunc->pfCopy8x8Aligned (pMbCache->SPicData.pCsMb[2], pCurDqLayer->iCsStride[1], pMbCache->pMemPredChroma + 64, 8); | 1307 | pFunc->pfCopy8x8Aligned (pMbCache->SPicData.pCsMb[2], pCurDqLayer->iCsStride[1], pMbCache->pMemPredChroma + 64, 8); |
| 1308 | } | 1308 | } |
| 1309 | 1309 | ||
| 1310 | BOOL_T WelsMdPSkipEnc (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache) { | 1310 | bool_t WelsMdPSkipEnc (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache) { |
| 1311 | sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pEnc; | 1311 | sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pEnc; |
| 1312 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; | 1312 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; |
| 1313 | SWelsMD* pWelsMd = (SWelsMD*)pMd; | 1313 | SWelsMD* pWelsMd = (SWelsMD*)pMd; |
| @@ -1586,7 +1586,7 @@ void WelsMdInterMbRefinement (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurM · 272 unmodified lines | |||
| 1586 | pWelsMd->iCostLuma = iBestSatdCost; | 1586 | pWelsMd->iCostLuma = iBestSatdCost; |
| 1587 | 1587 | ||
| 1588 | } | 1588 | } |
| 1589 | BOOL_T WelsMdFirstIntraMode (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache) { | 1589 | bool_t WelsMdFirstIntraMode (void* pEnc, void* pMd, SMB* pCurMb, SMbCache* pMbCache) { |
| 1590 | sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pEnc; | 1590 | sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pEnc; |
| 1591 | SWelsFuncPtrList* pFunc = pEncCtx->pFuncList; | 1591 | SWelsFuncPtrList* pFunc = pEncCtx->pFuncList; |
| 1592 | SWelsMD* pWelsMd = (SWelsMD*)pMd; | 1592 | SWelsMD* pWelsMd = (SWelsMD*)pMd; |
| @@ -1629,9 +1629,9 @@ void WelsMdInterMb (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache · 36 unmodified lines | |||
| 1629 | const bool_t bMbTopAvailPskip = ((kuiNeighborAvail & TOP_MB_POS) ? IS_SKIP (top_mb->uiMbType) : false); | 1629 | const bool_t bMbTopAvailPskip = ((kuiNeighborAvail & TOP_MB_POS) ? IS_SKIP (top_mb->uiMbType) : false); |
| 1630 | const bool_t bMbTopLeftAvailPskip = ((kuiNeighborAvail & TOPLEFT_MB_POS) ? IS_SKIP ((top_mb - 1)->uiMbType) : false); | 1630 | const bool_t bMbTopLeftAvailPskip = ((kuiNeighborAvail & TOPLEFT_MB_POS) ? IS_SKIP ((top_mb - 1)->uiMbType) : false); |
| 1631 | const bool_t bMbTopRightAvailPskip = ((kuiNeighborAvail & TOPRIGHT_MB_POS) ? IS_SKIP ((top_mb + 1)->uiMbType) : false); | 1631 | const bool_t bMbTopRightAvailPskip = ((kuiNeighborAvail & TOPRIGHT_MB_POS) ? IS_SKIP ((top_mb + 1)->uiMbType) : false); |
| 1632 | BOOL_T bTrySkip = bMbLeftAvailPskip || bMbTopAvailPskip || bMbTopLeftAvailPskip || bMbTopRightAvailPskip; | 1632 | bool_t bTrySkip = bMbLeftAvailPskip || bMbTopAvailPskip || bMbTopLeftAvailPskip || bMbTopRightAvailPskip; |
| 1633 | BOOL_T bKeepSkip = bMbLeftAvailPskip && bMbTopAvailPskip && bMbTopRightAvailPskip; | 1633 | bool_t bKeepSkip = bMbLeftAvailPskip && bMbTopAvailPskip && bMbTopRightAvailPskip; |
| 1634 | BOOL_T bSkip = FALSE; | 1634 | bool_t bSkip = FALSE; |
| 1635 | 1635 | ||
| 1636 | if (pEncCtx->pFuncList->pfInterMdBackgroundDecision (pEncCtx, pWelsMd, pSlice, pCurMb, pMbCache, &bKeepSkip)) { | 1636 | if (pEncCtx->pFuncList->pfInterMdBackgroundDecision (pEncCtx, pWelsMd, pSlice, pCurMb, pMbCache, &bKeepSkip)) { |
| 1637 | return; | 1637 | return; |
| @@ -1662,7 +1662,7 @@ void WelsMdInterMb (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache · 24 unmodified lines | |||
| 1662 | // try the ordinary Pskip | 1662 | // try the ordinary Pskip |
| 1663 | ////// | 1663 | ////// |
| 1664 | bool_t WelsMdInterJudgePskip (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, | 1664 | bool_t WelsMdInterJudgePskip (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, |
| 1665 | BOOL_T bTrySkip) { | 1665 | bool_t bTrySkip) { |
| 1666 | bool_t bRet = true; | 1666 | bool_t bRet = true; |
| 1667 | if (((pEncCtx->pRefPic->iPictureType == P_SLICE) && (pMbCache->uiRefMbType == MB_TYPE_SKIP | 1667 | if (((pEncCtx->pRefPic->iPictureType == P_SLICE) && (pMbCache->uiRefMbType == MB_TYPE_SKIP |
| 1668 | || pMbCache->uiRefMbType == MB_TYPE_BACKGROUND)) || | 1668 | || pMbCache->uiRefMbType == MB_TYPE_BACKGROUND)) || |
| @@ -1744,7 +1744,7 @@ void WelsMdInterEncode (sWelsEncCtx* pEncCtx, SSlice* pSlice, SMB* pCurMb, SMbCa · 75 unmodified lines | |||
| 1744 | // try the BGD Pskip | 1744 | // try the BGD Pskip |
| 1745 | ////// | 1745 | ////// |
| 1746 | bool_t WelsMdInterJudgeBGDPskip (void* pCtx, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, | 1746 | bool_t WelsMdInterJudgeBGDPskip (void* pCtx, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, |
| 1747 | BOOL_T* bKeepSkip) { | 1747 | bool_t* bKeepSkip) { |
| 1748 | sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pCtx; | 1748 | sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pCtx; |
| 1749 | SWelsMD* pWelsMd = (SWelsMD*)pMd; | 1749 | SWelsMD* pWelsMd = (SWelsMD*)pMd; |
| 1750 | 1750 | ||
| @@ -1776,7 +1776,7 @@ bool_t WelsMdInterJudgeBGDPskip (void* pCtx, void* pMd, SSlice* pSlice, SMB* pCu · 25 unmodified lines | |||
| 1776 | } | 1776 | } |
| 1777 | 1777 | ||
| 1778 | bool_t WelsMdInterJudgeBGDPskipFalse (void* pCtx, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, | 1778 | bool_t WelsMdInterJudgeBGDPskipFalse (void* pCtx, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, |
| 1779 | BOOL_T* bKeepSkip) { | 1779 | bool_t* bKeepSkip) { |
| 1780 | return false; | 1780 | return false; |
| 1781 | } | 1781 | } |
| 1782 | 1782 | ||
| @@ -1820,9 +1820,9 @@ void WelsMdInterSaveSadAndRefMbType (Mb_Type* pRefMbtypeList, SMbCache* pMbCache · 37 unmodified lines | |||
| 1820 | } | 1820 | } |
| 1821 | 1821 | ||
| 1822 | void WelsMdInterSecondaryModesEnc (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, | 1822 | void WelsMdInterSecondaryModesEnc (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, |
| 1823 | SMbCache* pMbCache, const BOOL_T bSkip) { | 1823 | SMbCache* pMbCache, const bool_t bSkip) { |
| 1824 | //step 2: Intra | 1824 | //step 2: Intra |
| 1825 | const BOOL_T kbTrySkip = pEncCtx->pFuncList->pfFirstIntraMode (pEncCtx, pWelsMd, pCurMb, pMbCache); | 1825 | const bool_t kbTrySkip = pEncCtx->pFuncList->pfFirstIntraMode (pEncCtx, pWelsMd, pCurMb, pMbCache); |
| 1826 | if (kbTrySkip) | 1826 | if (kbTrySkip) |
| 1827 | return; | 1827 | return; |
| 1828 | 1828 | ||
| @@ -325,7 +325,7 @@ void WelsRecPskip (SDqLayer* pCurLayer, SWelsFuncPtrList* pFuncList, SMB* pCu · 324 unmodified lines | |||
| 325 | pFuncList->pfSetMemZeroSize8 (pCurMb->pNonZeroCount, 24); | 325 | pFuncList->pfSetMemZeroSize8 (pCurMb->pNonZeroCount, 24); |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | BOOL_T WelsTryPYskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache) { | 328 | bool_t WelsTryPYskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache) { |
| 329 | int32_t iSingleCtrMb = 0; | 329 | int32_t iSingleCtrMb = 0; |
| 330 | int16_t* pRes = pMbCache->pCoeffLevel; | 330 | int16_t* pRes = pMbCache->pCoeffLevel; |
| 331 | const uint8_t kuiQp = pCurMb->uiLumaQp; | 331 | const uint8_t kuiQp = pCurMb->uiLumaQp; |
| @@ -352,7 +352,7 @@ BOOL_T WelsTryPYskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache) { · 20 unmodified lines | |||
| 352 | return TRUE; | 352 | return TRUE; |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | BOOL_T WelsTryPUVskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache, int32_t iUV) { | 355 | bool_t WelsTryPUVskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache, int32_t iUV) { |
| 356 | int16_t* pRes = ((iUV == 1) ? & (pMbCache->pCoeffLevel[256]) : & (pMbCache->pCoeffLevel[256 + 64])); | 356 | int16_t* pRes = ((iUV == 1) ? & (pMbCache->pCoeffLevel[256]) : & (pMbCache->pCoeffLevel[256 + 64])); |
| 357 | 357 | ||
| 358 | const uint8_t kuiQp = g_kuiChromaQpTable[CLIP3_QP_0_51 (pCurMb->uiLumaQp + | 358 | const uint8_t kuiQp = g_kuiChromaQpTable[CLIP3_QP_0_51 (pCurMb->uiLumaQp + |
| @@ -738,10 +738,10 @@ void UpdateMbNeighbourInfoForNextSlice (SSliceCtx* pSliceCtx, · 737 unmodified lines | |||
| 738 | const int32_t kiMbXY = pMb->iMbXY; | 738 | const int32_t kiMbXY = pMb->iMbXY; |
| 739 | const int32_t kiMbX = pMb->iMbX; | 739 | const int32_t kiMbX = pMb->iMbX; |
| 740 | const int32_t kiMbY = pMb->iMbY; | 740 | const int32_t kiMbY = pMb->iMbY; |
| 741 | BOOL_T bLeft; | 741 | bool_t bLeft; |
| 742 | BOOL_T bTop; | 742 | bool_t bTop; |
| 743 | BOOL_T bLeftTop; | 743 | bool_t bLeftTop; |
| 744 | BOOL_T bRightTop; | 744 | bool_t bRightTop; |
| 745 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; | 745 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; |
| 746 | const uint8_t kuiSliceIdc = WelsMbToSliceIdc (pSliceCtx, kiMbXY); | 746 | const uint8_t kuiSliceIdc = WelsMbToSliceIdc (pSliceCtx, kiMbXY); |
| 747 | 747 | ||
| @@ -819,7 +819,7 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 71 unmodified lines | |||
| 819 | UpdateMbNeighbourInfoForNextSlice (pSliceCtx, pMbList, iFirstMbIdxOfNextSlice, kiLastMbIdxInPartition); | 819 | UpdateMbNeighbourInfoForNextSlice (pSliceCtx, pMbList, iFirstMbIdxOfNextSlice, kiLastMbIdxInPartition); |
| 820 | } | 820 | } |
| 821 | 821 | ||
| 822 | BOOL_T DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, | 822 | bool_t DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, |
| 823 | SDynamicSlicingStack* pDss) { | 823 | SDynamicSlicingStack* pDss) { |
| 824 | sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pCtx; | 824 | sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pCtx; |
| 825 | SSlice* pCurSlice = (SSlice*)pSlice; | 825 | SSlice* pCurSlice = (SSlice*)pSlice; |
| @@ -830,12 +830,12 @@ BOOL_T DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pS · 4 unmodified lines | |||
| 830 | const int32_t kiPartitaionId = pCurSlice->uiSliceIdx % kiActiveThreadsNum; | 830 | const int32_t kiPartitaionId = pCurSlice->uiSliceIdx % kiActiveThreadsNum; |
| 831 | const int32_t kiLastMbIdxInPartition = pEncCtx->pCurDqLayer->pLastMbIdxOfPartition[kiPartitaionId]; | 831 | const int32_t kiLastMbIdxInPartition = pEncCtx->pCurDqLayer->pLastMbIdxOfPartition[kiPartitaionId]; |
| 832 | 832 | ||
| 833 | const BOOL_T kbCurMbNotFirstMbOfCurSlice = (pSliceCtx->pOverallMbMap[iCurMbIdx] == | 833 | const bool_t kbCurMbNotFirstMbOfCurSlice = (pSliceCtx->pOverallMbMap[iCurMbIdx] == |
| 834 | pSliceCtx->pOverallMbMap[iCurMbIdx - 1]); | 834 | pSliceCtx->pOverallMbMap[iCurMbIdx - 1]); |
| 835 | const BOOL_T kbCurMbNotLastMbOfCurPartition = iCurMbIdx < kiLastMbIdxInPartition; | 835 | const bool_t kbCurMbNotLastMbOfCurPartition = iCurMbIdx < kiLastMbIdxInPartition; |
| 836 | const BOOL_T kbSliceNumNotExceedConstraint = pSliceCtx->iSliceNumInFrame < | 836 | const bool_t kbSliceNumNotExceedConstraint = pSliceCtx->iSliceNumInFrame < |
| 837 | pSliceCtx->iMaxSliceNumConstraint; /*tmp choice to avoid complex memory operation, 100520, to be modify*/ | 837 | pSliceCtx->iMaxSliceNumConstraint; /*tmp choice to avoid complex memory operation, 100520, to be modify*/ |
| 838 | const BOOL_T kbSliceNumReachConstraint = (pSliceCtx->iSliceNumInFrame == | 838 | const bool_t kbSliceNumReachConstraint = (pSliceCtx->iSliceNumInFrame == |
| 839 | pSliceCtx->iMaxSliceNumConstraint); | 839 | pSliceCtx->iMaxSliceNumConstraint); |
| 840 | 840 | ||
| 841 | if (pCurSlice->bDynamicSlicingSliceSizeCtrlFlag) | 841 | if (pCurSlice->bDynamicSlicingSliceSizeCtrlFlag) |
| @@ -61,9 +61,9 @@ void WelsMdSpatialelInterMbIlfmdNoilp (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, S · 60 unmodified lines | |||
| 61 | const bool_t kbMbTopRightAvailPskip = ((kuiNeighborAvail & TOPRIGHT_MB_POS) ? IS_SKIP (( | 61 | const bool_t kbMbTopRightAvailPskip = ((kuiNeighborAvail & TOPRIGHT_MB_POS) ? IS_SKIP (( |
| 62 | kpTopMb + 1)->uiMbType) : false); | 62 | kpTopMb + 1)->uiMbType) : false); |
| 63 | 63 | ||
| 64 | BOOL_T bTrySkip = kbMbLeftAvailPskip | kbMbTopAvailPskip | kbMbTopLeftAvailPskip | kbMbTopRightAvailPskip; | 64 | bool_t bTrySkip = kbMbLeftAvailPskip | kbMbTopAvailPskip | kbMbTopLeftAvailPskip | kbMbTopRightAvailPskip; |
| 65 | BOOL_T bKeepSkip = kbMbLeftAvailPskip & kbMbTopAvailPskip & kbMbTopRightAvailPskip; | 65 | bool_t bKeepSkip = kbMbLeftAvailPskip & kbMbTopAvailPskip & kbMbTopRightAvailPskip; |
| 66 | BOOL_T bSkip = FALSE; | 66 | bool_t bSkip = FALSE; |
| 67 | 67 | ||
| 68 | if (pEncCtx->pFuncList->pfInterMdBackgroundDecision (pEncCtx, pWelsMd, pSlice, pCurMb, pMbCache, &bKeepSkip)) { | 68 | if (pEncCtx->pFuncList->pfInterMdBackgroundDecision (pEncCtx, pWelsMd, pSlice, pCurMb, pMbCache, &bKeepSkip)) { |
| 69 | return; | 69 | return; |
| @@ -114,12 +114,12 @@ class CWelsH264SVCEncoder : public ISVCEncoder { · 113 unmodified lines | |||
| 114 | int32_t m_iMaxPicHeight; | 114 | int32_t m_iMaxPicHeight; |
| 115 | 115 | ||
| 116 | int32_t m_iCspInternal; | 116 | int32_t m_iCspInternal; |
| 117 | BOOL_T m_bInitialFlag; | 117 | bool_t m_bInitialFlag; |
| 118 | 118 | ||
| 119 | #ifdef OUTPUT_BIT_STREAM | 119 | #ifdef OUTPUT_BIT_STREAM |
| 120 | FILE* m_pFileBs; | 120 | FILE* m_pFileBs; |
| 121 | FILE* m_pFileBsSize; | 121 | FILE* m_pFileBsSize; |
| 122 | BOOL_T m_bSwitch; | 122 | bool_t m_bSwitch; |
| 123 | int32_t m_iSwitchTimes; | 123 | int32_t m_iSwitchTimes; |
| 124 | #endif//OUTPUT_BIT_STREAM | 124 | #endif//OUTPUT_BIT_STREAM |
| 125 | 125 | ||