Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 5 files). Show all
Unified · Split
| @@ -63,9 +63,7 @@ · 62 unmodified lines | ||
| 63 | 63 | #include "cpu.h" |
| 64 | 64 | #endif//X86_ASM |
| 65 | 65 | |
| 66 | −#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) | |
| 67 | 66 | #include "measure_time.h" |
| 68 | −#endif//DYNAMIC_SLICE_ASSIGN | |
| 69 | 67 | namespace WelsSVCEnc { |
| 70 | 68 | void UpdateMbListNeighborParallel (SSliceCtx* pSliceCtx, |
| 71 | 69 | SMB* pMbList, |
| @@ -144,12 +142,8 @@ void CalcSliceComplexRatio (void* pRatio, SSliceCtx* pSliceCtx, uint32_t* pSlice · 72 unmodified lines | ||
| 144 | 142 | } |
| 145 | 143 | } |
| 146 | 144 | |
| 147 | −#if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN) && defined(NOT_ABSOLUTE_BALANCING) | |
| 145 | +#if defined(MT_ENABLED) | |
| 148 | 146 | int32_t NeedDynamicAdjust (void* pConsumeTime, const int32_t iSliceNum) { |
| 149 | −#if !defined(USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING) | |
| 150 | − const float fRatioLower = TOLERANT_BALANCING_RATIO_LOWER (uiSliceNum); | |
| 151 | − const float fRatioUpper = TOLERANT_BALANCING_RATIO_UPPER (uiSliceNum); | |
| 152 | −#endif//USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING | |
| 153 | 147 | uint32_t* pSliceConsume = (uint32_t*)pConsumeTime; |
| 154 | 148 | uint32_t uiTotalConsume = 0; |
| 155 | 149 | int32_t iSliceIdx = 0; |
| @@ -172,7 +166,6 @@ int32_t NeedDynamicAdjust (void* pConsumeTime, const int32_t iSliceNum) { · 16 unmodified lines | ||
| 172 | 166 | } |
| 173 | 167 | |
| 174 | 168 | iSliceIdx = 0; |
| 175 | −#if defined(USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING) | |
| 176 | 169 | float fThr = EPSN; // threshold for various cores cases |
| 177 | 170 | float fRmse = .0f; // root mean square error of pSlice consume ratios |
| 178 | 171 | const float kfMeanRatio = 1.0f / iSliceNum; |
| @@ -198,27 +191,11 @@ int32_t NeedDynamicAdjust (void* pConsumeTime, const int32_t iSliceNum) { · 19 unmodified lines | ||
| 198 | 191 | "[MT] NeedDynamicAdjust(), herein adjustment decision is made (iNeedAdj= %d) by: fRmse of pSlice complexity ratios %.6f, the corresponding threshold %.6f, iCountSliceNum %d\n", |
| 199 | 192 | iNeedAdj, fRmse, fThr, iSliceNum); |
| 200 | 193 | #endif//ENABLE_TRACE_MT |
| 201 | −#else | |
| 202 | − do { | |
| 203 | − const float kfRatio = 1.0f * pSliceConsume[uiSliceIdx] / uiTotalConsume; | |
| 204 | − if (kfRatio + EPSN < fRatioLower || kfRatio > ratio_upper + EPSN) { | |
| 205 | −#if defined(ENABLE_TRACE_MT) | |
| 206 | − WelsLog (NULL, WELS_LOG_DEBUG, | |
| 207 | − "[MT] NeedDynamicAdjust(), herein adjustment decision is made by pSlice consume time not balanced at all, uiSliceIdx= %d, comp_ratio= %.6f, pSliceConsumeTime= %d, total_consume_time= %d, iCountSliceNum= %d\n", | |
| 208 | − uiSliceIdx, kfRatio, pSliceConsume[uiSliceIdx], uiTotalConsume, uiSliceNum); | |
| 209 | −#endif//ENABLE_TRACE_MT | |
| 210 | − iNeedAdj = true; | |
| 211 | − break; | |
| 212 | − } | |
| 213 | − ++ uiSliceIdx; | |
| 214 | − } while (uiSliceIdx + 1 < uiSliceNum); | |
| 215 | −#endif//USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING | |
| 216 | 194 | |
| 217 | 195 | return iNeedAdj; |
| 218 | 196 | } |
| 219 | −#endif//.. | |
| 197 | +#endif | |
| 220 | 198 | |
| 221 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 222 | 199 | void DynamicAdjustSlicing (sWelsEncCtx* pCtx, |
| 223 | 200 | SDqLayer* pCurDqLayer, |
| 224 | 201 | void* pComplexRatio, |
| @@ -320,20 +297,7 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx, · 95 unmodified lines | ||
| 320 | 297 | WelsMultipleEventsWaitAllBlocking (kiThreadNum, &pCtx->pSliceThreading->pFinUpdateMbListEvent[0]); |
| 321 | 298 | } |
| 322 | 299 | } |
| 323 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 324 | 300 | |
| 325 | −#ifdef PACKING_ONE_SLICE_PER_LAYER | |
| 326 | −void ResetEnvMt (sWelsEncCtx* pCtx) { | |
| 327 | − const int16_t kiSliceCount = pCtx->iMaxSliceCount; | |
| 328 | − int32_t iIdx = 0; | |
| 329 | − | |
| 330 | − while (iIdx < kiSliceCount) { | |
| 331 | − SWelsSliceBs* pSliceBs = &pCtx->pSliceBs[iIdx]; | |
| 332 | − pSliceBs->uiBsPos = 0; | |
| 333 | − ++ iIdx; | |
| 334 | − } | |
| 335 | −} | |
| 336 | −#endif//PACKING_ONE_SLICE_PER_LAYER | |
| 337 | 301 | |
| 338 | 302 | int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingParam, const int32_t iCountBsLen, |
| 339 | 303 | const int32_t iTargetSpatialBsSize) { |
| @@ -378,7 +342,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 38 unmodified lines | ||
| 378 | 342 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinSliceCodingEvent), FreeMemorySvc (ppCtx)) |
| 379 | 343 | #endif//_WIN32 |
| 380 | 344 | |
| 381 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 382 | 345 | #if defined(__GNUC__) |
| 383 | 346 | pSmt->pUpdateMbListThrdHandles = (WELS_THREAD_HANDLE*)pMa->WelsMalloc (sizeof (WELS_THREAD_HANDLE) * iThreadNum, |
| 384 | 347 | "pUpdateMbListThrdHandles"); |
| @@ -390,14 +353,12 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 5 unmodified lines | ||
| 390 | 353 | pSmt->pFinUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinUpdateMbListEvent"); |
| 391 | 354 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinUpdateMbListEvent), FreeMemorySvc (ppCtx)) |
| 392 | 355 | #endif//_WIN32 |
| 393 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 394 | 356 | |
| 395 | 357 | #ifdef _WIN32 |
| 396 | 358 | pSmt->pExitEncodeEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pExitEncodeEvent"); |
| 397 | 359 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pExitEncodeEvent), FreeMemorySvc (ppCtx)) |
| 398 | 360 | #endif//_WIN32 |
| 399 | 361 | |
| 400 | −#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) | |
| 401 | 362 | iIdx = 0; |
| 402 | 363 | while (iIdx < iNumSpatialLayers) { |
| 403 | 364 | SSliceConfig* pMso = &pPara->sDependencyLayers[iIdx].sSliceCfg; |
| @@ -406,20 +367,15 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 2 unmodified lines | ||
| 406 | 367 | && pPara->iMultipleThreadIdc >= kiSliceNum) { |
| 407 | 368 | pSmt->pSliceConsumeTime[iIdx] = (uint32_t*)pMa->WelsMallocz (kiSliceNum * sizeof (uint32_t), "pSliceConsumeTime[]"); |
| 408 | 369 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pSliceConsumeTime[iIdx]), FreeMemorySvc (ppCtx)) |
| 409 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 410 | 370 | pSmt->pSliceComplexRatio[iIdx] = (float*)pMa->WelsMalloc (kiSliceNum * sizeof (float), "pSliceComplexRatio[]"); |
| 411 | 371 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pSliceComplexRatio[iIdx]), FreeMemorySvc (ppCtx)) |
| 412 | −#endif//TRY_SLICING_BALANCE | |
| 413 | 372 | } else { |
| 414 | 373 | pSmt->pSliceConsumeTime[iIdx] = NULL; |
| 415 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 416 | 374 | pSmt->pSliceComplexRatio[iIdx] = NULL; |
| 417 | −#endif//TRY_SLICING_BALANCE | |
| 418 | 375 | } |
| 419 | 376 | ++ iIdx; |
| 420 | 377 | } |
| 421 | 378 | // NULL for pSliceConsumeTime[iIdx]: iIdx from iNumSpatialLayers to MAX_DEPENDENCY_LAYERS |
| 422 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) | |
| 423 | 379 | |
| 424 | 380 | #ifdef MT_DEBUG |
| 425 | 381 | // file handle for MT debug |
| @@ -447,7 +403,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 21 unmodified lines | ||
| 447 | 403 | pSmt->pThreadPEncCtx[iIdx].iThreadIndex = iIdx; |
| 448 | 404 | pSmt->pThreadHandles[iIdx] = 0; |
| 449 | 405 | |
| 450 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 451 | 406 | #ifdef _WIN32 |
| 452 | 407 | WelsEventInit (&pSmt->pUpdateMbListEvent[iIdx]); |
| 453 | 408 | WelsEventInit (&pSmt->pFinUpdateMbListEvent[iIdx]); |
| @@ -464,7 +419,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 10 unmodified lines | ||
| 464 | 419 | WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pFinUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno); |
| 465 | 420 | #endif |
| 466 | 421 | #endif//_WIN32 |
| 467 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 468 | 422 | |
| 469 | 423 | #ifdef _WIN32 |
| 470 | 424 | WelsEventInit (&pSmt->pSliceCodedEvent[iIdx]); |
| @@ -488,11 +442,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 17 unmodified lines | ||
| 488 | 442 | ++ iIdx; |
| 489 | 443 | } |
| 490 | 444 | |
| 491 | −#ifdef PACKING_ONE_SLICE_PER_LAYER | |
| 492 | − pSmt->pCountBsSizeInPartition = (uint32_t*)pMa->WelsMalloc (sizeof (uint32_t) * iThreadNum, "pCountBsSizeInPartition"); | |
| 493 | − WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pCountBsSizeInPartition), FreeMemorySvc (ppCtx)) | |
| 494 | −#endif//PACKING_ONE_SLICE_PER_LAYER | |
| 495 | − | |
| 496 | 445 | (*ppCtx)->pSliceBs = (SWelsSliceBs*)pMa->WelsMalloc (sizeof (SWelsSliceBs) * iMaxSliceNum, "pSliceBs"); |
| 497 | 446 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pSliceBs), FreeMemorySvc (ppCtx)) |
| 498 | 447 | |
| @@ -566,12 +515,10 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 67 unmodified lines | ||
| 566 | 515 | WelsEventDestroy (&pSmt->pFinSliceCodingEvent[iIdx]); |
| 567 | 516 | if (pSmt->pExitEncodeEvent != NULL) |
| 568 | 517 | WelsEventDestroy (&pSmt->pExitEncodeEvent[iIdx]); |
| 569 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 570 | 518 | if (pSmt->pUpdateMbListEvent != NULL) |
| 571 | 519 | WelsEventDestroy (&pSmt->pUpdateMbListEvent[iIdx]); |
| 572 | 520 | if (pSmt->pFinUpdateMbListEvent != NULL) |
| 573 | 521 | WelsEventDestroy (&pSmt->pFinUpdateMbListEvent[iIdx]); |
| 574 | −#endif//DYNAMIC_SLICE_ASSIGN && TRY_SLICING_BALANCE | |
| 575 | 522 | #else |
| 576 | 523 | char ename[SEM_NAME_MAX] = {0}; |
| 577 | 524 | // length of semaphore name should be system constrained at least on mac 10.7 |
| @@ -579,12 +526,10 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 1 unmodified line | ||
| 579 | 526 | WelsEventClose (pSmt->pSliceCodedEvent[iIdx], ename); |
| 580 | 527 | WelsSnprintf (ename, SEM_NAME_MAX, "rc%d%p", iIdx, (void*) (*ppCtx)); |
| 581 | 528 | WelsEventClose (pSmt->pReadySliceCodingEvent[iIdx], ename); |
| 582 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 583 | 529 | WelsSnprintf (ename, SEM_NAME_MAX, "ud%d%p", iIdx, (void*) (*ppCtx)); |
| 584 | 530 | WelsEventClose (pSmt->pUpdateMbListEvent[iIdx], ename); |
| 585 | 531 | WelsSnprintf (ename, SEM_NAME_MAX, "fu%d%p", iIdx, (void*) (*ppCtx)); |
| 586 | 532 | WelsEventClose (pSmt->pFinUpdateMbListEvent[iIdx], ename); |
| 587 | −#endif//DYNAMIC_SLICE_ASSIGN && TRY_SLICING_BALANCE | |
| 588 | 533 | #endif//_WIN32 |
| 589 | 534 | |
| 590 | 535 | ++ iIdx; |
| @@ -609,13 +554,6 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 18 unmodified lines | ||
| 609 | 554 | } |
| 610 | 555 | #endif//_WIN32 |
| 611 | 556 | |
| 612 | −#ifdef PACKING_ONE_SLICE_PER_LAYER | |
| 613 | − if (NULL != pSmt->pCountBsSizeInPartition) { | |
| 614 | − pMa->WelsFree (pSmt->pCountBsSizeInPartition, "pCountBsSizeInPartition"); | |
| 615 | − pSmt->pCountBsSizeInPartition = NULL; | |
| 616 | − } | |
| 617 | −#endif//PACKING_ONE_SLICE_PER_LAYER | |
| 618 | − | |
| 619 | 557 | WelsMutexDestroy (&pSmt->mutexSliceNumUpdate); |
| 620 | 558 | WelsMutexDestroy (&((*ppCtx)->mutexEncoderError)); |
| 621 | 559 | |
| @@ -643,24 +581,18 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 21 unmodified lines | ||
| 643 | 581 | pMa->WelsFree ((*ppCtx)->pSliceBs, "pSliceBs"); |
| 644 | 582 | (*ppCtx)->pSliceBs = NULL; |
| 645 | 583 | } |
| 646 | −#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) | |
| 647 | 584 | iIdx = 0; |
| 648 | 585 | while (iIdx < pCodingParam->iSpatialLayerNum) { |
| 649 | 586 | if (pSmt->pSliceConsumeTime[iIdx]) { |
| 650 | 587 | pMa->WelsFree (pSmt->pSliceConsumeTime[iIdx], "pSliceConsumeTime[]"); |
| 651 | 588 | pSmt->pSliceConsumeTime[iIdx] = NULL; |
| 652 | 589 | } |
| 653 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 654 | 590 | if (pSmt->pSliceComplexRatio[iIdx] != NULL) { |
| 655 | 591 | pMa->WelsFree (pSmt->pSliceComplexRatio[iIdx], "pSliceComplexRatio[]"); |
| 656 | 592 | pSmt->pSliceComplexRatio[iIdx] = NULL; |
| 657 | 593 | } |
| 658 | −#endif//TRY_SLICING_BALANCE | |
| 659 | 594 | ++ iIdx; |
| 660 | 595 | } |
| 661 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) | |
| 662 | − | |
| 663 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 664 | 596 | |
| 665 | 597 | #ifdef _WIN32 |
| 666 | 598 | if (pSmt->pUpdateMbListEvent != NULL) { |
| @@ -678,8 +610,6 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 11 unmodified lines | ||
| 678 | 610 | } |
| 679 | 611 | #endif//_WIN32 |
| 680 | 612 | |
| 681 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 682 | − | |
| 683 | 613 | #ifdef MT_DEBUG |
| 684 | 614 | // file handle for debug |
| 685 | 615 | if (pSmt->pFSliceDiff) { |
| @@ -781,12 +711,8 @@ int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFr · 95 unmodified lines | ||
| 781 | 711 | const int32_t kiNalCnt = pSliceBs->iNalIndex; |
| 782 | 712 | int32_t iNalIdx = 0; |
| 783 | 713 | int32_t iNalSize = 0; |
| 784 | −#if !defined(PACKING_ONE_SLICE_PER_LAYER) | |
| 785 | 714 | const int32_t iFirstSlice = (iSliceIdx == 0); |
| 786 | 715 | int32_t iNalBase = iFirstSlice ? 0 : pLbi->iNalCount; |
| 787 | −#else | |
| 788 | − int32_t iNalBase = 0; | |
| 789 | −#endif//!PACKING_ONE_SLICE_PER_LAYER | |
| 790 | 716 | int32_t iReturn = ENC_RETURN_SUCCESS; |
| 791 | 717 | const int32_t kiWrittenLength = pCtx->iPosBsBuffer; |
| 792 | 718 | iSliceSize = 0; |
| @@ -803,7 +729,6 @@ int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFr · 10 unmodified lines | ||
| 803 | 729 | ++ iNalIdx; |
| 804 | 730 | } |
| 805 | 731 | |
| 806 | −#if !defined(PACKING_ONE_SLICE_PER_LAYER) | |
| 807 | 732 | pSliceBs->uiBsPos = iSliceSize; |
| 808 | 733 | if (iFirstSlice) { |
| 809 | 734 | // pBsBuffer has been updated at coding_slice_0_in_encoder_mother_thread() |
| @@ -816,14 +741,6 @@ int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFr · 6 unmodified lines | ||
| 816 | 741 | } else { |
| 817 | 742 | pLbi->iNalCount += kiNalCnt; |
| 818 | 743 | } |
| 819 | −#else | |
| 820 | − pLbi->uiLayerType = VIDEO_CODING_LAYER; | |
| 821 | − pLbi->uiSpatialId = pNalHdrExt->uiDependencyId; | |
| 822 | − pLbi->uiTemporalId = pNalHdrExt->uiTemporalId; | |
| 823 | − pLbi->uiQualityId = 0; | |
| 824 | − pLbi->uiPriorityId = 0; | |
| 825 | − pLbi->iNalCount = kiNalCnt; | |
| 826 | −#endif//PACKING_ONE_SLICE_PER_LAYER | |
| 827 | 744 | |
| 828 | 745 | return ENC_RETURN_SUCCESS; |
| 829 | 746 | } |
| @@ -858,7 +775,6 @@ int32_t WriteSliceBs (sWelsEncCtx* pCtx, uint8_t* pSliceBsBuf, const int32_t iSl · 28 unmodified lines | ||
| 858 | 775 | return iReturn; |
| 859 | 776 | } |
| 860 | 777 | |
| 861 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 862 | 778 | #if defined(__GNUC__) && !defined(_WIN32) |
| 863 | 779 | WELS_THREAD_ROUTINE_TYPE UpdateMbListThreadProc (void* arg) { |
| 864 | 780 | SSliceThreadPrivateData* pPrivateData = (SSliceThreadPrivateData*)arg; |
| @@ -899,7 +815,6 @@ WELS_THREAD_ROUTINE_TYPE UpdateMbListThreadProc (void* arg) { · 34 unmodified lines | ||
| 899 | 815 | WELS_THREAD_ROUTINE_RETURN (uiThrdRet); |
| 900 | 816 | } |
| 901 | 817 | #endif//__GNUC__ |
| 902 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 903 | 818 | |
| 904 | 819 | // thread process for coding one pSlice |
| 905 | 820 | WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { |
| @@ -936,9 +851,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 30 unmodified lines | ||
| 936 | 851 | #ifdef _WIN32 |
| 937 | 852 | pEventsList[iEventCount++] = pEncPEncCtx->pSliceThreading->pReadySliceCodingEvent[iEventIdx]; |
| 938 | 853 | pEventsList[iEventCount++] = pEncPEncCtx->pSliceThreading->pExitEncodeEvent[iEventIdx]; |
| 939 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 940 | 854 | pEventsList[iEventCount++] = pEncPEncCtx->pSliceThreading->pUpdateMbListEvent[iEventIdx]; |
| 941 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 942 | 855 | #endif//_WIN32 |
| 943 | 856 | |
| 944 | 857 | do { |
| @@ -973,17 +886,13 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 28 unmodified lines | ||
| 973 | 886 | pSlice = &pCurDq->sLayerInfo.pSliceInLayer[iSliceIdx]; |
| 974 | 887 | pSliceBs = &pEncPEncCtx->pSliceBs[iSliceIdx]; |
| 975 | 888 | |
| 976 | −#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) | |
| 977 | 889 | bDsaFlag = (pParamD->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE && |
| 978 | 890 | pCodingParam->iMultipleThreadIdc > 1 && |
| 979 | 891 | pCodingParam->iMultipleThreadIdc >= pParamD->sSliceCfg.sSliceArgument.uiSliceNum); |
| 980 | 892 | if (bDsaFlag) |
| 981 | 893 | iSliceStart = WelsTime(); |
| 982 | −#endif//DYNAMIC_SLICE_ASSIGN || MT_DEBUG | |
| 983 | 894 | |
| 984 | −#if !defined(PACKING_ONE_SLICE_PER_LAYER) | |
| 985 | 895 | pSliceBs->uiBsPos = 0; |
| 986 | −#endif//!PACKING_ONE_SLICE_PER_LAYER | |
| 987 | 896 | pSliceBs->iNalIndex = 0; |
| 988 | 897 | assert ((void*) (&pSliceBs->sBsWrite) == (void*)pSlice->pSliceBsa); |
| 989 | 898 | InitBits (&pSliceBs->sBsWrite, pSliceBs->pBsBuffer, pSliceBs->uiSize); |
| @@ -1014,7 +923,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 24 unmodified lines | ||
| 1014 | 923 | |
| 1015 | 924 | WelsUnloadNalForSlice (pSliceBs); |
| 1016 | 925 | |
| 1017 | −#if !defined(PACKING_ONE_SLICE_PER_LAYER) | |
| 1018 | 926 | if (0 == iSliceIdx) { |
| 1019 | 927 | pLbi->pBsBuf = pEncPEncCtx->pFrameBs + pEncPEncCtx->iPosBsBuffer; |
| 1020 | 928 | iReturn = WriteSliceToFrameBs (pEncPEncCtx, pLbi, pLbi->pBsBuf, iSliceIdx, iSliceSize); |
| @@ -1031,25 +939,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 10 unmodified lines | ||
| 1031 | 939 | break; |
| 1032 | 940 | } |
| 1033 | 941 | } |
| 1034 | −#else// PACKING_ONE_SLICE_PER_LAYER | |
| 1035 | − if (0 == iSliceIdx) { | |
| 1036 | − pLbi->pBsBuf = pEncPEncCtx->pFrameBs + pEncPEncCtx->iPosBsBuffer; | |
| 1037 | − iReturn = WriteSliceToFrameBs (pEncPEncCtx, pLbi, pLbi->pBsBuf, iSliceIdx, &iSliceSize); | |
| 1038 | − if (ENC_RETURN_SUCCESS!=iReturn) { | |
| 1039 | − uiThrdRet = iReturn; | |
| 1040 | − break; | |
| 1041 | − } | |
| 1042 | − pEncPEncCtx->iPosBsBuffer += iSliceSize; | |
| 1043 | − } else { | |
| 1044 | − pLbi->pBsBuf = pSliceBs->bs + pSliceBs->uiBsPos; | |
| 1045 | − iReturn = WriteSliceToFrameBs (pEncPEncCtx, pLbi, pLbi->pBsBuf, iSliceIdx, &iSliceSize); | |
| 1046 | − if (ENC_RETURN_SUCCESS!=iReturn) { | |
| 1047 | − uiThrdRet = iReturn; | |
| 1048 | − break; | |
| 1049 | − } | |
| 1050 | − pSliceBs->uiBsPos += iSliceSize; | |
| 1051 | − } | |
| 1052 | −#endif//!PACKING_ONE_SLICE_PER_LAYER | |
| 1053 | 942 | |
| 1054 | 943 | if (pCurDq->bDeblockingParallelFlag && pSlice->sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc != 1 |
| 1055 | 944 | #if !defined(ENABLE_FRAME_DUMP) |
| @@ -1060,7 +949,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 4 unmodified lines | ||
| 1060 | 949 | DeblockingFilterSliceAvcbase (pCurDq, pEncPEncCtx->pFuncList, iSliceIdx); |
| 1061 | 950 | } |
| 1062 | 951 | |
| 1063 | −#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) | |
| 1064 | 952 | if (bDsaFlag) { |
| 1065 | 953 | pEncPEncCtx->pSliceThreading->pSliceConsumeTime[pEncPEncCtx->uiDependencyId][iSliceIdx] = (uint32_t) ( |
| 1066 | 954 | WelsTime() - iSliceStart); |
| @@ -1072,7 +960,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 5 unmodified lines | ||
| 1072 | 960 | pCurDq->pSliceEncCtx->pFirstMbInSlice[iSliceIdx], pCurDq->pSliceEncCtx->pCountMbNumInSlice[iSliceIdx]); |
| 1073 | 961 | #endif//ENABLE_TRACE_MT |
| 1074 | 962 | } |
| 1075 | −#endif//DYNAMIC_SLICE_ASSIGN || MT_DEBUG | |
| 1076 | 963 | |
| 1077 | 964 | #if defined(SLICE_INFO_OUTPUT) |
| 1078 | 965 | fprintf (stderr, |
| @@ -1095,9 +982,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 16 unmodified lines | ||
| 1095 | 982 | WelsEventSignal (pEncPEncCtx->pSliceThreading->pSliceCodedEvent[iEventIdx]); // mean finished coding current pSlice |
| 1096 | 983 | #endif//WIN32 |
| 1097 | 984 | } else { // for SM_DYN_SLICE parallelization |
| 1098 | −#ifdef PACKING_ONE_SLICE_PER_LAYER | |
| 1099 | − SLayerBSInfo* pLbiPacking = NULL; | |
| 1100 | −#endif//PACKING_ONE_SLICE_PER_LAYER | |
| 1101 | 985 | SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx; |
| 1102 | 986 | const int32_t kiPartitionId = iThreadIdx; |
| 1103 | 987 | const int32_t kiSliceIdxStep = pEncPEncCtx->iActiveThreadsNum; |
| @@ -1124,9 +1008,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 20 unmodified lines | ||
| 1124 | 1008 | pSlice = &pCurDq->sLayerInfo.pSliceInLayer[iSliceIdx]; |
| 1125 | 1009 | pSliceBs = &pEncPEncCtx->pSliceBs[iSliceIdx]; |
| 1126 | 1010 | |
| 1127 | −#if !defined(PACKING_ONE_SLICE_PER_LAYER) | |
| 1128 | 1011 | pSliceBs->uiBsPos = 0; |
| 1129 | −#endif//!PACKING_ONE_SLICE_PER_LAYER | |
| 1130 | 1012 | pSliceBs->iNalIndex = 0; |
| 1131 | 1013 | InitBits (&pSliceBs->sBsWrite, pSliceBs->pBsBuffer, pSliceBs->uiSize); |
| 1132 | 1014 | |
| @@ -1152,7 +1034,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 19 unmodified lines | ||
| 1152 | 1034 | |
| 1153 | 1035 | WelsUnloadNalForSlice (pSliceBs); |
| 1154 | 1036 | |
| 1155 | −#if !defined(PACKING_ONE_SLICE_PER_LAYER) | |
| 1156 | 1037 | if (0 == kiPartitionId) { |
| 1157 | 1038 | if (0 == iSliceIdx) |
| 1158 | 1039 | pLbi->pBsBuf = pEncPEncCtx->pFrameBs + pEncPEncCtx->iPosBsBuffer; |
| @@ -1170,28 +1051,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 11 unmodified lines | ||
| 1170 | 1051 | break; |
| 1171 | 1052 | } |
| 1172 | 1053 | } |
| 1173 | −#else// PACKING_ONE_SLICE_PER_LAYER | |
| 1174 | − pLbiPacking = pLbi + (iSliceIdx - kiPartitionId); | |
| 1175 | − | |
| 1176 | − if (0 == kiPartitionId) { | |
| 1177 | − pLbiPacking->pBsBuf = pEncPEncCtx->pFrameBs + pEncPEncCtx->iPosBsBuffer; | |
| 1178 | − iReturn = WriteSliceToFrameBs (pEncPEncCtx, pLbiPacking, pLbiPacking->pBsBuf, iSliceIdx, iSliceSize); | |
| 1179 | − if (ENC_RETURN_SUCCESS!=iReturn) { | |
| 1180 | − uiThrdRet = iReturn; | |
| 1181 | − break; | |
| 1182 | − } | |
| 1183 | − pEncPEncCtx->iPosBsBuffer += iSliceSize; | |
| 1184 | − } else { | |
| 1185 | − pLbiPacking->pBsBuf = pSliceBs->bs + pSliceBs->uiBsPos; | |
| 1186 | − iReturn = WriteSliceToFrameBs (pEncPEncCtx, pLbiPacking, pLbiPacking->pBsBuf, iSliceIdx, iSliceSize); | |
| 1187 | − if (ENC_RETURN_SUCCESS!=iReturn) { | |
| 1188 | − uiThrdRet = iReturn; | |
| 1189 | − break; | |
| 1190 | − } | |
| 1191 | − pSliceBs->uiBsPos += iSliceSize; | |
| 1192 | − } | |
| 1193 | − pEncPEncCtx->pSliceThreading->pCountBsSizeInPartition[kiPartitionId] += iSliceSize; | |
| 1194 | −#endif//!PACKING_ONE_SLICE_PER_LAYER | |
| 1195 | 1054 | |
| 1196 | 1055 | if (pCurDq->bDeblockingParallelFlag && pSlice->sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc != 1 |
| 1197 | 1056 | #if !defined(ENABLE_FRAME_DUMP) |
| @@ -1238,7 +1097,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 40 unmodified lines | ||
| 1238 | 1097 | uiThrdRet = 0; |
| 1239 | 1098 | break; |
| 1240 | 1099 | } |
| 1241 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 1242 | 1100 | else if (WELS_THREAD_ERROR_WAIT_OBJECT_0 + 2 == iWaitRet) { // update pMb list singal |
| 1243 | 1101 | iSliceIdx = |
| 1244 | 1102 | iEventIdx; // pPrivateData->iSliceIndex; old threads can not be terminated, pPrivateData is not correct for applicable |
| @@ -1247,7 +1105,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 2 unmodified lines | ||
| 1247 | 1105 | WelsEventSignal ( |
| 1248 | 1106 | &pEncPEncCtx->pSliceThreading->pFinUpdateMbListEvent[iEventIdx]); // mean finished update pMb list for this pSlice |
| 1249 | 1107 | } |
| 1250 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 1251 | 1108 | #endif//WIN32 |
| 1252 | 1109 | else { // WELS_THREAD_ERROR_WAIT_TIMEOUT, or WELS_THREAD_ERROR_WAIT_FAILED |
| 1253 | 1110 | WelsLog (pEncPEncCtx, WELS_LOG_WARNING, |
| @@ -1299,12 +1156,10 @@ int32_t CreateSliceThreads (sWelsEncCtx* pCtx) { · 45 unmodified lines | ||
| 1299 | 1156 | // We need extra threads for update_mb_list_proc on __GNUC__ like OS (mac/linux) |
| 1300 | 1157 | // due to WelsMultipleEventsWaitSingleBlocking implememtation can not work well |
| 1301 | 1158 | // in case waiting pUpdateMbListEvent and pReadySliceCodingEvent events at the same time |
| 1302 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 1303 | 1159 | #if defined(__GNUC__) && !defined(_WIN32) |
| 1304 | 1160 | WelsThreadCreate (&pCtx->pSliceThreading->pUpdateMbListThrdHandles[iIdx], UpdateMbListThreadProc, |
| 1305 | 1161 | &pCtx->pSliceThreading->pThreadPEncCtx[iIdx], 0); |
| 1306 | 1162 | #endif//__GNUC__ |
| 1307 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 1308 | 1163 | |
| 1309 | 1164 | ++ iIdx; |
| 1310 | 1165 | } |
| @@ -1314,14 +1169,6 @@ int32_t CreateSliceThreads (sWelsEncCtx* pCtx) { · 3 unmodified lines | ||
| 1314 | 1169 | return 0; |
| 1315 | 1170 | } |
| 1316 | 1171 | |
| 1317 | −#ifdef PACKING_ONE_SLICE_PER_LAYER | |
| 1318 | −void ResetCountBsSizeInPartitions (uint32_t* pCountBsSizeList, const int32_t iPartitionCnt) { | |
| 1319 | − if (pCountBsSizeList != NULL && iPartitionCnt > 0) { | |
| 1320 | − memset (pCountBsSizeList, 0, sizeof (pCountBsSizeList[0]) * iPartitionCnt); | |
| 1321 | − } | |
| 1322 | −} | |
| 1323 | −#endif//PACKING_ONE_SLICE_PER_LAYER | |
| 1324 | − | |
| 1325 | 1172 | #ifdef _WIN32 |
| 1326 | 1173 | int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, SLayerBSInfo* pLbi, |
| 1327 | 1174 | const uint32_t uiNumThreads, SSliceCtx* pSliceCtx, const bool bIsDynamicSlicingMode) |
| @@ -1341,33 +1188,6 @@ int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT** pEven · 13 unmodified lines | ||
| 1341 | 1188 | return 1; |
| 1342 | 1189 | } |
| 1343 | 1190 | |
| 1344 | −#if defined(PACKING_ONE_SLICE_PER_LAYER) | |
| 1345 | − //////////////////////////////////////// | |
| 1346 | − if (bIsDynamicSlicingMode) { | |
| 1347 | − iEndMbIdx = pSliceCtx->iMbNumInFrame; | |
| 1348 | − for (iIdx = kiEventCnt - 1; iIdx >= 0; --iIdx) { | |
| 1349 | − const int32_t kiFirstMbIdx = pSliceCtx->pFirstMbInSlice[iIdx]; | |
| 1350 | − pPriData[iIdx].iStartMbIndex = kiFirstMbIdx; | |
| 1351 | − pPriData[iIdx].iEndMbIndex = iEndMbIdx; | |
| 1352 | − iEndMbIdx = kiFirstMbIdx; | |
| 1353 | − } | |
| 1354 | − } | |
| 1355 | − | |
| 1356 | − iIdx = 0; | |
| 1357 | − while (iIdx < kiEventCnt) { | |
| 1358 | − pPriData[iIdx].pLayerBs = pLbi; | |
| 1359 | − pPriData[iIdx].iSliceIndex = iIdx; | |
| 1360 | −#ifdef _WIN32 | |
| 1361 | − if (pEventsList[iIdx]) | |
| 1362 | − WelsEventSignal (&pEventsList[iIdx]); | |
| 1363 | −#else | |
| 1364 | − WelsEventSignal (pEventsList[iIdx]); | |
| 1365 | −#endif//WIN32 | |
| 1366 | − ++ pLbi; | |
| 1367 | − ++ iIdx; | |
| 1368 | − } | |
| 1369 | − //////////////////////////////////////// | |
| 1370 | −#else | |
| 1371 | 1191 | //////////////////////////////////////// |
| 1372 | 1192 | if (bIsDynamicSlicingMode) { |
| 1373 | 1193 | iEndMbIdx = pSliceCtx->iMbNumInFrame; |
| @@ -1391,8 +1211,6 @@ int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT** pEven · 17 unmodified lines | ||
| 1391 | 1211 | #endif//WIN32 |
| 1392 | 1212 | ++ iIdx; |
| 1393 | 1213 | } |
| 1394 | − //////////////////////////////////////// | |
| 1395 | −#endif//PACKING_ONE_SLICE_PER_LAYER | |
| 1396 | 1214 | |
| 1397 | 1215 | return 0; |
| 1398 | 1216 | } |
| @@ -1403,28 +1221,23 @@ int32_t DynamicDetectCpuCores() { · 4 unmodified lines | ||
| 1403 | 1221 | return info.ProcessorCount; |
| 1404 | 1222 | } |
| 1405 | 1223 | |
| 1406 | −#if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN) | |
| 1407 | − | |
| 1224 | +#if defined(MT_ENABLED) | |
| 1408 | 1225 | int32_t AdjustBaseLayer (sWelsEncCtx* pCtx) { |
| 1409 | 1226 | SDqLayer* pCurDq = pCtx->ppDqLayerList[0]; |
| 1410 | 1227 | int32_t iNeedAdj = 1; |
| 1411 | 1228 | #ifdef MT_DEBUG |
| 1412 | 1229 | int64_t iT0 = WelsTime(); |
| 1413 | 1230 | #endif//MT_DEBUG |
| 1414 | −#ifdef TRY_SLICING_BALANCE | |
| 1415 | 1231 | |
| 1416 | 1232 | pCtx->pCurDqLayer = pCurDq; |
| 1417 | 1233 | |
| 1418 | −#ifdef NOT_ABSOLUTE_BALANCING | |
| 1419 | 1234 | // do not need adjust due to not different at both slices of consumed time |
| 1420 | 1235 | iNeedAdj = NeedDynamicAdjust (pCtx->pSliceThreading->pSliceConsumeTime[0], pCurDq->pSliceEncCtx->iSliceNumInFrame); |
| 1421 | 1236 | if (iNeedAdj) |
| 1422 | −#endif//NOT_ABSOLUTE_BALANCING | |
| 1423 | 1237 | DynamicAdjustSlicing (pCtx, |
| 1424 | 1238 | pCurDq, |
| 1425 | 1239 | pCtx->pSliceThreading->pSliceComplexRatio[0], |
| 1426 | 1240 | 0); |
| 1427 | −#endif//TRY_SLICING_BALANCE | |
| 1428 | 1241 | #ifdef MT_DEBUG |
| 1429 | 1242 | iT0 = WelsTime() - iT0; |
| 1430 | 1243 | if (pCtx->pSliceThreading->pFSliceDiff) { |
| @@ -1455,33 +1268,25 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 24 unmodified lines | ||
| 1455 | 1268 | 1].sSliceCfg.sSliceArgument.uiSliceNum); |
| 1456 | 1269 | |
| 1457 | 1270 | if (kbModelingFromSpatial) { // using spatial base layer for complexity estimation |
| 1458 | −#ifdef TRY_SLICING_BALANCE | |
| 1459 | −#ifdef NOT_ABSOLUTE_BALANCING | |
| 1460 | 1271 | // do not need adjust due to not different at both slices of consumed time |
| 1461 | 1272 | iNeedAdj = NeedDynamicAdjust (pCtx->pSliceThreading->pSliceConsumeTime[iCurDid - 1], |
| 1462 | 1273 | pCtx->pCurDqLayer->pSliceEncCtx->iSliceNumInFrame); |
| 1463 | 1274 | if (iNeedAdj) |
| 1464 | −#endif//NOT_ABSOLUTE_BALANCING | |
| 1465 | 1275 | DynamicAdjustSlicing (pCtx, |
| 1466 | 1276 | pCtx->pCurDqLayer, |
| 1467 | 1277 | pCtx->pSliceThreading->pSliceComplexRatio[iCurDid - 1], |
| 1468 | 1278 | iCurDid |
| 1469 | 1279 | ); |
| 1470 | −#endif//TRY_SLICING_BALANCE | |
| 1471 | 1280 | } else { // use temporal layer for complexity estimation |
| 1472 | −#ifdef TRY_SLICING_BALANCE | |
| 1473 | −#ifdef NOT_ABSOLUTE_BALANCING | |
| 1474 | 1281 | // do not need adjust due to not different at both slices of consumed time |
| 1475 | 1282 | iNeedAdj = NeedDynamicAdjust (pCtx->pSliceThreading->pSliceConsumeTime[iCurDid], |
| 1476 | 1283 | pCtx->pCurDqLayer->pSliceEncCtx->iSliceNumInFrame); |
| 1477 | 1284 | if (iNeedAdj) |
| 1478 | −#endif//NOT_ABSOLUTE_BALANCING | |
| 1479 | 1285 | DynamicAdjustSlicing (pCtx, |
| 1480 | 1286 | pCtx->pCurDqLayer, |
| 1481 | 1287 | pCtx->pSliceThreading->pSliceComplexRatio[iCurDid], |
| 1482 | 1288 | iCurDid |
| 1483 | 1289 | ); |
| 1484 | −#endif//TRY_SLICING_BALANCE | |
| 1485 | 1290 | } |
| 1486 | 1291 | |
| 1487 | 1292 | #ifdef MT_DEBUG |
| @@ -1500,11 +1305,11 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 12 unmodified lines | ||
| 1500 | 1305 | return iNeedAdj; |
| 1501 | 1306 | } |
| 1502 | 1307 | |
| 1503 | −#endif//#if defined(MT_ENABLED) && defined(DYNAMIC_SLICE_ASSIGN) | |
| 1308 | +#endif//#if defined(MT_ENABLED) | |
| 1504 | 1309 | |
| 1505 | 1310 | #if defined(MT_ENABLED) |
| 1506 | 1311 | |
| 1507 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) && defined(MT_DEBUG) | |
| 1312 | +#if defined(MT_DEBUG) | |
| 1508 | 1313 | void TrackSliceComplexities (sWelsEncCtx* pCtx, const int32_t iCurDid) { |
| 1509 | 1314 | const int32_t kiCountSliceNum = pCtx->pCurDqLayer->pSliceEncCtx->iSliceNumInFrame; |
| 1510 | 1315 | if (kiCountSliceNum > 0) { |
| @@ -1516,9 +1321,9 @@ void TrackSliceComplexities (sWelsEncCtx* pCtx, const int32_t iCurDid) { · 5 unmodified lines | ||
| 1516 | 1321 | } while (iSliceIdx < kiCountSliceNum); |
| 1517 | 1322 | } |
| 1518 | 1323 | } |
| 1519 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE) | |
| 1324 | +#endif | |
| 1520 | 1325 | |
| 1521 | −#if defined(DYNAMIC_SLICE_ASSIGN) && defined(MT_DEBUG) | |
| 1326 | +#if defined(MT_DEBUG) | |
| 1522 | 1327 | void TrackSliceConsumeTime (sWelsEncCtx* pCtx, int32_t* pDidList, const int32_t iSpatialNum) { |
| 1523 | 1328 | SWelsSvcCodingParam* pPara = NULL; |
| 1524 | 1329 | int32_t iSpatialIdx = 0; |
| @@ -1557,7 +1362,7 @@ void TrackSliceConsumeTime (sWelsEncCtx* pCtx, int32_t* pDidList, const int32_t · 32 unmodified lines | ||
| 1557 | 1362 | ++ iSpatialIdx; |
| 1558 | 1363 | } |
| 1559 | 1364 | } |
| 1560 | −#endif//#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) | |
| 1365 | +#endif//#if defined(MT_DEBUG) | |
| 1561 | 1366 | |
| 1562 | 1367 | #endif//MT_ENABLED |
| 1563 | 1368 | } |