shithub: openh264

Download patch

ref: 38cc9acdd3a763a6ac8ec28d48918338a1abdfcd
parent: c3702d9075834a03f89fc99471e8e15769f267d9
author: Martin Storsjö <[email protected]>
date: Fri Aug 8 08:24:57 EDT 2014

Set a specific frame size in TemporalLayerSettingTest

Previously, this test used whatever size was set in m_iWidth
and m_iHeight before, which depended on the order that the tests
were executed. When this test was the first one executed in the
EncoderInterfaceTest, the width and height were set to the max.

Instead of having the test behaviour depend on the test order,
set a specific size, just as InitializeParamExt and MemoryCheckTest
do.

This reduces the runtime of TemporalLayerSettingTest from 86 seconds
to 26 seconds, when run in valgrind.

--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -138,8 +138,10 @@
 
 TEST_F (EncoderInterfaceTest, TemporalLayerSettingTest) {
 
-  pParamExt->iPicWidth = m_iWidth;
-  pParamExt->iPicHeight = m_iHeight;
+  pParamExt->iPicWidth = 1280;
+  pParamExt->iPicHeight = 720;
+  m_iWidth = pParamExt->iPicWidth;
+  m_iHeight = pParamExt->iPicHeight;
   pParamExt->iTargetBitrate = 60000;
   pParamExt->sSpatialLayers[0].iVideoHeight = pParamExt->iPicHeight;
   pParamExt->sSpatialLayers[0].iVideoWidth = pParamExt->iPicWidth;