History

clean multi-threading macro

volvet committed 12 years ago

Commit 9f50e0c1 parent cad753d16 files · +12 −258Browse files

Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 16 files). Show all

Unified · Split

codec/encoder/core/src/svc_encode_slice.cpp+0−15
@@ -823,11 +823,6 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 822 unmodified lines
823 823
824 pSliceCtx->pFirstMbInSlice[iNextSliceIdc] = iFirstMbIdxOfNextSlice;824 pSliceCtx->pFirstMbInSlice[iNextSliceIdc] = iFirstMbIdxOfNextSlice;
825 825
826#if !defined(MT_ENABLED)
827 pNextSlice->uiSliceIdx = iNextSliceIdc;
828 pNextSlice->pSliceBsa = & (pEncCtx->pOut->sBsWrite);
829#endif//!MT_ENABLED
830
831 memset (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, (uint8_t)iNextSliceIdc,826 memset (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, (uint8_t)iNextSliceIdc,
832 (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1)*sizeof (uint8_t));827 (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1)*sizeof (uint8_t));
833 828
@@ -863,10 +858,8 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli · 29 unmodified lines
863#endif858#endif
864 uiLen = ((iPosBitOffset >> 3) + ((iPosBitOffset & 0x07) ? 1 : 0));859 uiLen = ((iPosBitOffset >> 3) + ((iPosBitOffset & 0x07) ? 1 : 0));
865 860
866#ifdef MT_ENABLED
867 if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1)861 if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1)
868 WelsMutexLock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);862 WelsMutexLock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);
869#endif//MT_ENABLED
870 863
871 //DYNAMIC_SLICING_ONE_THREAD: judge jump_avoiding_pack_exceed864 //DYNAMIC_SLICING_ONE_THREAD: judge jump_avoiding_pack_exceed
872 if (865 if (
@@ -874,9 +867,7 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli · 1 unmodified line
874 && JUMPPACKETSIZE_JUDGE (uiLen, iCurMbIdx, pSliceCtx->uiSliceSizeConstraint)) /*jump_avoiding_pack_exceed*/867 && JUMPPACKETSIZE_JUDGE (uiLen, iCurMbIdx, pSliceCtx->uiSliceSizeConstraint)) /*jump_avoiding_pack_exceed*/
875 && kbCurMbNotLastMbOfCurPartition) //decide to add new pSlice868 && kbCurMbNotLastMbOfCurPartition) //decide to add new pSlice
876 && (kbSliceNumNotExceedConstraint869 && (kbSliceNumNotExceedConstraint
877#ifdef MT_ENABLED
878 && ((pCurSlice->uiSliceIdx + kiActiveThreadsNum) < pSliceCtx->iMaxSliceNumConstraint)870 && ((pCurSlice->uiSliceIdx + kiActiveThreadsNum) < pSliceCtx->iMaxSliceNumConstraint)
879#endif//MT_ENABLED
880 )//able to add new pSlice871 )//able to add new pSlice
881 872
882 ) {873 ) {
@@ -885,19 +876,15 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli · 2 unmodified lines
885 876
886 ++ pSliceCtx->iSliceNumInFrame;877 ++ pSliceCtx->iSliceNumInFrame;
887 878
888#ifdef MT_ENABLED
889 if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1)879 if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1)
890 WelsMutexUnlock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);880 WelsMutexUnlock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);
891#endif//MT_ENABLED
892 881
893 return true;882 return true;
894 }883 }
895 884
896 if (885 if (
897 (kbSliceNumReachConstraint886 (kbSliceNumReachConstraint
898#ifdef MT_ENABLED
899 || ((pCurSlice->uiSliceIdx + kiActiveThreadsNum) >= pSliceCtx->iMaxSliceNumConstraint)887 || ((pCurSlice->uiSliceIdx + kiActiveThreadsNum) >= pSliceCtx->iMaxSliceNumConstraint)
900#endif//MT_ENABLED
901 )888 )
902 && ((JUMPPACKETSIZE_JUDGE (uiLen, iCurMbIdx,889 && ((JUMPPACKETSIZE_JUDGE (uiLen, iCurMbIdx,
903 pSliceCtx->uiSliceSizeConstraint - ((kiLastMbIdxInPartition - iCurMbIdx) <<890 pSliceCtx->uiSliceSizeConstraint - ((kiLastMbIdxInPartition - iCurMbIdx) <<
@@ -907,10 +894,8 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli · 3 unmodified lines
907 pCurSlice->bDynamicSlicingSliceSizeCtrlFlag = true;894 pCurSlice->bDynamicSlicingSliceSizeCtrlFlag = true;
908 }895 }
909 896
910#ifdef MT_ENABLED
911 if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1)897 if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1)
912 WelsMutexUnlock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);898 WelsMutexUnlock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);
913#endif//MT_ENABLED
914 899
915 return false;900 return false;
916}901}

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