shithub: openh264

Download patch

ref: 4394d22b705a121d4331385e6e0e4ed03e854f06
parent: 9b442b3d44bbb2afcdf0bea6e75191d4bacc8982
author: Martin Storsjö <martin@martin.st>
date: Fri Jan 30 09:46:37 EST 2015

Set m_iPicResSize in PrepareOneSrcFrame

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.

--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -88,6 +88,10 @@
   pSrcPic->iPicWidth = pParamExt->iPicWidth;
   pSrcPic->iPicHeight = pParamExt->iPicHeight;
 
+  m_iWidth = pParamExt->iPicWidth;
+  m_iHeight = pParamExt->iPicHeight;
+  m_iPicResSize =  m_iWidth * m_iHeight * 3 >> 1;
+
   pYUV[0] = rand() % 256;
   for (int i = 1; i < m_iPicResSize; i++) {
     if ((i % 256) == 0)