History

remove duplicated operation after thread pool and rename a task for clearer meaning

sijchen committed 10 years ago

Commit 05c89b71 parent 67dab5d7 files · +26 −23Browse files

Showing the changes to test/api/encode_decode_api_test.cpp (1 of 7 files). Show all

Unified · Split

test/api/encode_decode_api_test.cpp+12−4
@@ -3788,6 +3788,7 @@ TEST_F (EncodeDecodeTestAPI, ThreadNumAndSliceNum) { · 3787 unmodified lines
37883788
37893789
37903790 TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) {
3791+//#define DEBUG_FILE_SAVE_TRIGGER
37913792 int iSpatialLayerNum = 1;
37923793 int iWidth = WelsClip3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, (64 << 2), MAX_WIDTH);
37933794 int iHeight = WelsClip3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, (64 << 2),
@@ -3799,7 +3800,7 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 5 unmodified lines
37993800 SEncParamExt sParam;
38003801 encoder_->GetDefaultParams (&sParam);
38013802 prepareParamDefault (iSpatialLayerNum, 1, iWidth, iHeight, fFrameRate, &sParam);
3802− sParam.iMultipleThreadIdc = (rand() % 8) + 1;
3803+ sParam.iMultipleThreadIdc = 4;
38033804 sParam.bSimulcastAVC = 1;
38043805 sParam.sSpatialLayers[0].iVideoWidth = iWidth;
38053806 sParam.sSpatialLayers[0].iVideoHeight = iHeight;
@@ -3815,6 +3816,11 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 9 unmodified lines
38153816 int iIdx = 0;
38163817 int aLen[MAX_SPATIAL_LAYER_NUM] = {};
38173818
3819+#ifdef DEBUG_FILE_SAVE_TRIGGER
3820+ FILE* fEnc = fopen ("trigger00.264", "wb");
3821+ printf("Current Threads is %d\n", sParam.iMultipleThreadIdc);
3822+#endif
3823+
38183824 //create decoder
38193825 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
38203826 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
@@ -3881,8 +3887,8 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 60 unmodified lines
38813887 pData[0] = pData[1] = pData[2] = 0;
38823888 memset (&dstBufInfo_, 0, sizeof (SBufferInfo));
38833889
3884−#ifdef DEBUG_FILE_SAVE4
3885− fwrite (pBsBuf[iIdx], aLen[iIdx], 1, fEnc[iIdx]);
3890+#ifdef DEBUG_FILE_SAVE_TRIGGER
3891+ fwrite (pBsBuf[iIdx], aLen[iIdx], 1, fEnc);
38863892 #endif
38873893 iResult = decoder[iIdx]->DecodeFrame2 (pBsBuf[iIdx], aLen[iIdx], pData, &dstBufInfo_);
38883894 EXPECT_TRUE (iResult == cmResultSuccess) << "iResult=" << iResult << ", LayerIdx=" << iIdx;
@@ -3900,7 +3906,9 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 11 unmodified lines
39003906 decoder[iIdx]->Uninitialize();
39013907 WelsDestroyDecoder (decoder[iIdx]);
39023908 }
3903−
39043909 }
3910+#ifdef DEBUG_FILE_SAVE_TRIGGER
3911+ fclose(fEnc);
3912+#endif
39053913 }
39063914

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