History

Add Windows 64-bit build to VS project files

licaiguo committed 12 years ago

Commit 077ffed1 parent ac6828f73 files · +7126 −219Browse files

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

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+35−35
@@ -309,11 +309,11 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx, · 308 unmodified lines
309309 const int32_t kiThreadNum = pCtx->pSvcParam->iCountThreadsNum;
310310 int32_t iThreadIdx = 0;
311311 do {
312−#ifdef WIN32
312+#ifdef _WIN32
313313 WelsEventSignal (&pCtx->pSliceThreading->pUpdateMbListEvent[iThreadIdx]);
314314 #else
315315 WelsEventSignal (pCtx->pSliceThreading->pUpdateMbListEvent[iThreadIdx]);
316−#endif//WIN32
316+#endif//_WIN32
317317 ++ iThreadIdx;
318318 } while (iThreadIdx < kiThreadNum);
319319
@@ -367,7 +367,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 47 unmodified lines
367367 "pThreadHandles");
368368 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pThreadHandles), FreeMemorySvc (ppCtx))
369369
370−#ifdef WIN32
370+#ifdef _WIN32
371371 pSmt->pSliceCodedEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pSliceCodedEvent");
372372 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pSliceCodedEvent), FreeMemorySvc (ppCtx))
373373 pSmt->pReadySliceCodingEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum,
@@ -375,7 +375,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 1 unmodified line
375375 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pReadySliceCodingEvent), FreeMemorySvc (ppCtx))
376376 pSmt->pFinSliceCodingEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinSliceCodingEvent");
377377 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinSliceCodingEvent), FreeMemorySvc (ppCtx))
378−#endif//WIN32
378+#endif//_WIN32
379379
380380 #if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
381381 #if defined(__GNUC__)
@@ -383,18 +383,18 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 1 unmodified line
383383 "pUpdateMbListThrdHandles");
384384 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListThrdHandles), FreeMemorySvc (ppCtx))
385385 #endif//__GNUC__
386−#ifdef WIN32
386+#ifdef _WIN32
387387 pSmt->pUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pUpdateMbListEvent");
388388 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListEvent), FreeMemorySvc (ppCtx))
389389 pSmt->pFinUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinUpdateMbListEvent");
390390 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinUpdateMbListEvent), FreeMemorySvc (ppCtx))
391−#endif//WIN32
391+#endif//_WIN32
392392 #endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
393393
394−#ifdef WIN32
394+#ifdef _WIN32
395395 pSmt->pExitEncodeEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pExitEncodeEvent");
396396 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pExitEncodeEvent), FreeMemorySvc (ppCtx))
397−#endif//WIN32
397+#endif//_WIN32
398398
399399 #if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG)
400400 iIdx = 0;
@@ -428,11 +428,11 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 27 unmodified lines
428428 fclose (pSmt->pFSliceDiff);
429429 pSmt->pFSliceDiff = NULL;
430430 }
431−#ifdef WIN32
431+#ifdef _WIN32
432432 pSmt->pFSliceDiff = fopen (".\\slice_time.txt", "wt+");
433433 #else
434434 pSmt->pFSliceDiff = fopen ("/tmp/slice_time.txt", "wt+");
435−#endif//WIN32
435+#endif//_WIN32
436436 #endif//MT_DEBUG
437437
438438 #if defined(ENABLE_TRACE_MT)
@@ -452,7 +452,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 13 unmodified lines
452452 pSmt->pThreadHandles[iIdx] = 0;
453453
454454 #if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
455−#ifdef WIN32
455+#ifdef _WIN32
456456 WelsEventInit (&pSmt->pUpdateMbListEvent[iIdx]);
457457 WelsEventInit (&pSmt->pFinUpdateMbListEvent[iIdx]);
458458 #else
@@ -468,10 +468,10 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 9 unmodified lines
468468 #if defined(ENABLE_TRACE_MT)
469469 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pFinUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
470470 #endif
471−#endif//WIN32
471+#endif//_WIN32
472472 #endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
473473
474−#ifdef WIN32
474+#ifdef _WIN32
475475 WelsEventInit (&pSmt->pSliceCodedEvent[iIdx]);
476476 WelsEventInit (&pSmt->pReadySliceCodingEvent[iIdx]);
477477 WelsEventInit (&pSmt->pFinSliceCodingEvent[iIdx]);
@@ -490,7 +490,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 12 unmodified lines
490490 WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pReadySliceCodingEvent%d = 0x%p named(%s) ret%d err%d\n", iIdx,
491491 (void*)pSmt->pReadySliceCodingEvent[iIdx]), (void*) (*ppCtx), err, errno);
492492 #endif
493−#endif//WIN32
493+#endif//_WIN32
494494
495495 ++ iIdx;
496496 }
@@ -557,7 +557,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 60 unmodified lines
557557 return;
558558
559559 while (iIdx < iThreadNum) {
560−#ifdef WIN32
560+#ifdef _WIN32
561561 if (pSmt->pThreadHandles != NULL && pSmt->pThreadHandles[iIdx] != NULL)
562562 WelsThreadDestroy (&pSmt->pThreadHandles[iIdx]);
563563
@@ -592,12 +592,12 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 28 unmodified lines
592592 ename[used_len] = '\0';
593593 WelsEventClose (pSmt->pFinUpdateMbListEvent[iIdx], ename);
594594 #endif//DYNAMIC_SLICE_ASSIGN && TRY_SLICING_BALANCE
595−#endif//WIN32
595+#endif//_WIN32
596596
597597 ++ iIdx;
598598 }
599599
600−#ifdef WIN32
600+#ifdef _WIN32
601601 if (pSmt->pExitEncodeEvent != NULL) {
602602 pMa->WelsFree (pSmt->pExitEncodeEvent, "pExitEncodeEvent");
603603 pSmt->pExitEncodeEvent = NULL;
@@ -614,7 +614,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 10 unmodified lines
614614 pMa->WelsFree (pSmt->pFinSliceCodingEvent, "pFinSliceCodingEvent");
615615 pSmt->pFinSliceCodingEvent = NULL;
616616 }
617−#endif//WIN32
617+#endif//_WIN32
618618
619619 #ifdef PACKING_ONE_SLICE_PER_LAYER
620620 if (NULL != pSmt->pCountBsSizeInPartition) {
@@ -669,7 +669,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 48 unmodified lines
669669
670670 #if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
671671
672−#ifdef WIN32
672+#ifdef _WIN32
673673 if (pSmt->pUpdateMbListEvent != NULL) {
674674 pMa->WelsFree (pSmt->pUpdateMbListEvent, "pUpdateMbListEvent");
675675 pSmt->pUpdateMbListEvent = NULL;
@@ -683,7 +683,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 7 unmodified lines
683683 pMa->WelsFree (pSmt->pUpdateMbListThrdHandles, "pUpdateMbListThrdHandles");
684684 pSmt->pUpdateMbListThrdHandles = NULL;
685685 }
686−#endif//WIN32
686+#endif//_WIN32
687687
688688 #endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
689689
@@ -901,7 +901,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 211 unmodified lines
901901 SDqLayer* pCurDq = NULL;
902902 SSlice* pSlice = NULL;
903903 SWelsSliceBs* pSliceBs = NULL;
904−#ifdef WIN32
904+#ifdef _WIN32
905905 WELS_EVENT pEventsList[3];
906906 int32_t iEventCount = 0;
907907 #endif
@@ -925,16 +925,16 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 17 unmodified lines
925925 iThreadIdx = pPrivateData->iThreadIndex;
926926 iEventIdx = iThreadIdx;
927927
928−#ifdef WIN32
928+#ifdef _WIN32
929929 pEventsList[iEventCount++] = pEncPEncCtx->pSliceThreading->pReadySliceCodingEvent[iEventIdx];
930930 pEventsList[iEventCount++] = pEncPEncCtx->pSliceThreading->pExitEncodeEvent[iEventIdx];
931931 #if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
932932 pEventsList[iEventCount++] = pEncPEncCtx->pSliceThreading->pUpdateMbListEvent[iEventIdx];
933933 #endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
934−#endif//WIN32
934+#endif//_WIN32
935935
936936 do {
937−#ifdef WIN32
937+#ifdef _WIN32
938938 iWaitRet = WelsMultipleEventsWaitSingleBlocking (iEventCount,
939939 &pEventsList[0],
940940 (uint32_t) - 1); // blocking until at least one event is
@@ -1058,7 +1058,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 117 unmodified lines
10581058 pSliceBs->bSliceCodedFlag = TRUE;
10591059 #endif//MT_DEBUG_BS_WR
10601060
1061−#ifdef WIN32
1061+#ifdef _WIN32
10621062 WelsEventSignal (
10631063 &pEncPEncCtx->pSliceThreading->pSliceCodedEvent[iEventIdx]); // mean finished coding current pSlice
10641064 #else
@@ -1174,14 +1174,14 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 109 unmodified lines
11741174 if (uiThrdRet) // any exception??
11751175 break;
11761176
1177−#ifdef WIN32
1177+#ifdef _WIN32
11781178 WelsEventSignal (&pEncPEncCtx->pSliceThreading->pSliceCodedEvent[iEventIdx]); // mean finished coding current pSlice
11791179 #else
11801180 WelsEventSignal (pEncPEncCtx->pSliceThreading->pSliceCodedEvent[iEventIdx]); // mean finished coding current pSlice
11811181 #endif//WIN32
11821182 }
11831183 }
1184−#ifdef WIN32
1184+#ifdef _WIN32
11851185 else if (WELS_THREAD_ERROR_WAIT_OBJECT_0 + 1 == iWaitRet) { // exit thread signal
11861186 uiThrdRet = 0;
11871187 break;
@@ -1206,7 +1206,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 18 unmodified lines
12061206 }
12071207 } while (1);
12081208
1209−#ifdef WIN32
1209+#ifdef _WIN32
12101210 WelsEventSignal (&pEncPEncCtx->pSliceThreading->pFinSliceCodingEvent[iEventIdx]); // notify to mother encoding threading
12111211 #endif//WIN32
12121212
@@ -1216,7 +1216,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 3 unmodified lines
12161216 int32_t CreateSliceThreads (sWelsEncCtx* pCtx) {
12171217 const int32_t kiThreadCount = pCtx->pSvcParam->iCountThreadsNum;
12181218 int32_t iIdx = 0;
1219−#if defined(WIN32) && defined(BIND_CPU_CORES_TO_THREADS)
1219+#if defined(_WIN32) && defined(BIND_CPU_CORES_TO_THREADS)
12201220 DWORD dwProcessAffinity;
12211221 DWORD dwSystemAffinity;
12221222 GetProcessAffinityMask (GetCurrentProcess(), &dwProcessAffinity, &dwSystemAffinity);
@@ -1225,7 +1225,7 @@ int32_t CreateSliceThreads (sWelsEncCtx* pCtx) { · 2 unmodified lines
12251225 while (iIdx < kiThreadCount) {
12261226 WelsThreadCreate (&pCtx->pSliceThreading->pThreadHandles[iIdx], CodingSliceThreadProc,
12271227 &pCtx->pSliceThreading->pThreadPEncCtx[iIdx], 0);
1228−#if defined(WIN32) && defined(BIND_CPU_CORES_TO_THREADS)
1228+#if defined(_WIN32) && defined(BIND_CPU_CORES_TO_THREADS)
12291229 if (dwProcessAffinity > 1
12301230 && pCtx->pSliceThreading->pThreadHandles[iIdx] != NULL) { // multiple cores and thread created successfully
12311231 DWORD dw = 0;
@@ -1264,7 +1264,7 @@ void ResetCountBsSizeInPartitions (uint32_t* pCountBsSizeList, const int32_t iPa · 32 unmodified lines
12641264 }
12651265 #endif//PACKING_ONE_SLICE_PER_LAYER
12661266
1267−#ifdef WIN32
1267+#ifdef _WIN32
12681268 int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, SLayerBSInfo* pLbi,
12691269 const uint32_t uiNumThreads, SSliceCtx* pSliceCtx, const BOOL_T bIsDynamicSlicingMode)
12701270 #else
@@ -1299,7 +1299,7 @@ int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT** pEven · 28 unmodified lines
12991299 while (iIdx < kiEventCnt) {
13001300 pPriData[iIdx].pLayerBs = pLbi;
13011301 pPriData[iIdx].iSliceIndex = iIdx;
1302−#ifdef WIN32
1302+#ifdef _WIN32
13031303 if (pEventsList[iIdx])
13041304 WelsEventSignal (&pEventsList[iIdx]);
13051305 #else
@@ -1325,7 +1325,7 @@ int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT** pEven · 19 unmodified lines
13251325 while (iIdx < kiEventCnt) {
13261326 pPriData[iIdx].pLayerBs = pLbi;
13271327 pPriData[iIdx].iSliceIndex = iIdx;
1328−#ifdef WIN32
1328+#ifdef _WIN32
13291329 if (pEventsList[iIdx])
13301330 WelsEventSignal (&pEventsList[iIdx]);
13311331 #else
@@ -1371,7 +1371,7 @@ int32_t AdjustBaseLayer (sWelsEncCtx* pCtx) { · 39 unmodified lines
13711371 iT0 = WelsTime() - iT0;
13721372 if (pCtx->pSliceThreading->pFSliceDiff) {
13731373 fprintf (pCtx->pSliceThreading->pFSliceDiff,
1374−#ifdef WIN32
1374+#ifdef _WIN32
13751375 "%6I64d us adjust time at base spatial layer, iNeedAdj %d, DynamicAdjustSlicing()\n",
13761376 #else
13771377 "%6lld us adjust time at base spatial layer, iNeedAdj %d, DynamicAdjustSlicing()\n",
@@ -1429,7 +1429,7 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 51 unmodified lines
14291429 iT1 = WelsTime() - iT1;
14301430 if (pCtx->pSliceThreading->pFSliceDiff) {
14311431 fprintf (pCtx->pSliceThreading->pFSliceDiff,
1432−#ifdef WIN32
1432+#ifdef _WIN32
14331433 "%6I64d us adjust time at spatial layer %d, iNeedAdj %d, DynamicAdjustSlicing()\n",
14341434 #else
14351435 "%6lld us adjust time at spatial layer %d, iNeedAdj %d, DynamicAdjustSlicing()\n",

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