If the calling test hasn't set m_iPicResSize, it is set to the maximum frame size, which takes much longer to initialize than the current actual frame size. This reduces the runtime of EncoderInterfaceTest.SkipFrameCheck in valgrind from 229 seconds to 8 seconds, and the total runtime of all the test cases in EncoderInterfaceTest from 405 seconds to 89 seconds.
Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -88,6 +88,10 @@ void EncoderInterfaceTest::PrepareOneSrcFrame() { · 87 unmodified lines | ||
| 88 | 88 | pSrcPic->iPicWidth = pParamExt->iPicWidth; |
| 89 | 89 | pSrcPic->iPicHeight = pParamExt->iPicHeight; |
| 90 | 90 | |
| 91 | + m_iWidth = pParamExt->iPicWidth; | |
| 92 | + m_iHeight = pParamExt->iPicHeight; | |
| 93 | + m_iPicResSize = m_iWidth * m_iHeight * 3 >> 1; | |
| 94 | + | |
| 91 | 95 | pYUV[0] = rand() % 256; |
| 92 | 96 | for (int i = 1; i < m_iPicResSize; i++) { |
| 93 | 97 | if ((i % 256) == 0) |