Showing the changes to test/api/encode_decode_api_test.cpp (1 of 7 files). Show all
Unified · Split
| @@ -3788,6 +3788,7 @@ TEST_F (EncodeDecodeTestAPI, ThreadNumAndSliceNum) { · 3787 unmodified lines | |||
| 3788 | 3788 | ||
| 3789 | 3789 | ||
| 3790 | TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { | 3790 | TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { |
| 3791 | //#define DEBUG_FILE_SAVE_TRIGGER | ||
| 3791 | int iSpatialLayerNum = 1; | 3792 | int iSpatialLayerNum = 1; |
| 3792 | int iWidth = WelsClip3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, (64 << 2), MAX_WIDTH); | 3793 | int iWidth = WelsClip3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, (64 << 2), MAX_WIDTH); |
| 3793 | int iHeight = WelsClip3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, (64 << 2), | 3794 | int iHeight = WelsClip3 ((((rand() % MAX_HEIGHT) >> 1) + 1) << 1, (64 << 2), |
| @@ -3799,7 +3800,7 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 5 unmodified lines | |||
| 3799 | SEncParamExt sParam; | 3800 | SEncParamExt sParam; |
| 3800 | encoder_->GetDefaultParams (&sParam); | 3801 | encoder_->GetDefaultParams (&sParam); |
| 3801 | prepareParamDefault (iSpatialLayerNum, 1, iWidth, iHeight, fFrameRate, &sParam); | 3802 | prepareParamDefault (iSpatialLayerNum, 1, iWidth, iHeight, fFrameRate, &sParam); |
| 3802 | sParam.iMultipleThreadIdc = (rand() % 8) + 1; | 3803 | sParam.iMultipleThreadIdc = 4; |
| 3803 | sParam.bSimulcastAVC = 1; | 3804 | sParam.bSimulcastAVC = 1; |
| 3804 | sParam.sSpatialLayers[0].iVideoWidth = iWidth; | 3805 | sParam.sSpatialLayers[0].iVideoWidth = iWidth; |
| 3805 | sParam.sSpatialLayers[0].iVideoHeight = iHeight; | 3806 | sParam.sSpatialLayers[0].iVideoHeight = iHeight; |
| @@ -3815,6 +3816,11 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 9 unmodified lines | |||
| 3815 | int iIdx = 0; | 3816 | int iIdx = 0; |
| 3816 | int aLen[MAX_SPATIAL_LAYER_NUM] = {}; | 3817 | int aLen[MAX_SPATIAL_LAYER_NUM] = {}; |
| 3817 | 3818 | ||
| 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 | |||
| 3818 | //create decoder | 3824 | //create decoder |
| 3819 | for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) { | 3825 | for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) { |
| 3820 | pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2)); | 3826 | 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 | |||
| 3881 | pData[0] = pData[1] = pData[2] = 0; | 3887 | pData[0] = pData[1] = pData[2] = 0; |
| 3882 | memset (&dstBufInfo_, 0, sizeof (SBufferInfo)); | 3888 | memset (&dstBufInfo_, 0, sizeof (SBufferInfo)); |
| 3883 | 3889 | ||
| 3884 | #ifdef DEBUG_FILE_SAVE4 | 3890 | #ifdef DEBUG_FILE_SAVE_TRIGGER |
| 3885 | fwrite (pBsBuf[iIdx], aLen[iIdx], 1, fEnc[iIdx]); | 3891 | fwrite (pBsBuf[iIdx], aLen[iIdx], 1, fEnc); |
| 3886 | #endif | 3892 | #endif |
| 3887 | iResult = decoder[iIdx]->DecodeFrame2 (pBsBuf[iIdx], aLen[iIdx], pData, &dstBufInfo_); | 3893 | iResult = decoder[iIdx]->DecodeFrame2 (pBsBuf[iIdx], aLen[iIdx], pData, &dstBufInfo_); |
| 3888 | EXPECT_TRUE (iResult == cmResultSuccess) << "iResult=" << iResult << ", LayerIdx=" << iIdx; | 3894 | EXPECT_TRUE (iResult == cmResultSuccess) << "iResult=" << iResult << ", LayerIdx=" << iIdx; |
| @@ -3900,7 +3906,9 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 11 unmodified lines | |||
| 3900 | decoder[iIdx]->Uninitialize(); | 3906 | decoder[iIdx]->Uninitialize(); |
| 3901 | WelsDestroyDecoder (decoder[iIdx]); | 3907 | WelsDestroyDecoder (decoder[iIdx]); |
| 3902 | } | 3908 | } |
| 3903 | |||
| 3904 | } | 3909 | } |
| 3910 | #ifdef DEBUG_FILE_SAVE_TRIGGER | ||
| 3911 | fclose(fEnc); | ||
| 3912 | #endif | ||
| 3905 | } | 3913 | } |
| 3906 | 3914 | ||