remove duplicated operation after thread pool and rename a task for clearer meaning
This commit is contained in:
@@ -3788,6 +3788,7 @@ TEST_F (EncodeDecodeTestAPI, ThreadNumAndSliceNum) {
|
||||
|
||||
|
||||
TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) {
|
||||
//#define DEBUG_FILE_SAVE_TRIGGER
|
||||
int iSpatialLayerNum = 1;
|
||||
int iWidth = WelsClip3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, (64 << 2), MAX_WIDTH);
|
||||
int iHeight = WelsClip3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, (64 << 2),
|
||||
@@ -3799,7 +3800,7 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) {
|
||||
SEncParamExt sParam;
|
||||
encoder_->GetDefaultParams (&sParam);
|
||||
prepareParamDefault (iSpatialLayerNum, 1, iWidth, iHeight, fFrameRate, &sParam);
|
||||
sParam.iMultipleThreadIdc = (rand() % 8) + 1;
|
||||
sParam.iMultipleThreadIdc = 4;
|
||||
sParam.bSimulcastAVC = 1;
|
||||
sParam.sSpatialLayers[0].iVideoWidth = iWidth;
|
||||
sParam.sSpatialLayers[0].iVideoHeight = iHeight;
|
||||
@@ -3815,6 +3816,11 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) {
|
||||
int iIdx = 0;
|
||||
int aLen[MAX_SPATIAL_LAYER_NUM] = {};
|
||||
|
||||
#ifdef DEBUG_FILE_SAVE_TRIGGER
|
||||
FILE* fEnc = fopen ("trigger00.264", "wb");
|
||||
printf("Current Threads is %d\n", sParam.iMultipleThreadIdc);
|
||||
#endif
|
||||
|
||||
//create decoder
|
||||
for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
|
||||
pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
|
||||
@@ -3881,8 +3887,8 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) {
|
||||
pData[0] = pData[1] = pData[2] = 0;
|
||||
memset (&dstBufInfo_, 0, sizeof (SBufferInfo));
|
||||
|
||||
#ifdef DEBUG_FILE_SAVE4
|
||||
fwrite (pBsBuf[iIdx], aLen[iIdx], 1, fEnc[iIdx]);
|
||||
#ifdef DEBUG_FILE_SAVE_TRIGGER
|
||||
fwrite (pBsBuf[iIdx], aLen[iIdx], 1, fEnc);
|
||||
#endif
|
||||
iResult = decoder[iIdx]->DecodeFrame2 (pBsBuf[iIdx], aLen[iIdx], pData, &dstBufInfo_);
|
||||
EXPECT_TRUE (iResult == cmResultSuccess) << "iResult=" << iResult << ", LayerIdx=" << iIdx;
|
||||
@@ -3900,7 +3906,9 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) {
|
||||
decoder[iIdx]->Uninitialize();
|
||||
WelsDestroyDecoder (decoder[iIdx]);
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef DEBUG_FILE_SAVE_TRIGGER
|
||||
fclose(fEnc);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user