title: OpenH264 performance versus encoded data size (SEncParamExt)
body: <p>I am trying to get about 24 frames per second for a 960x540 video using OpenH264 C++ library. I tried different parameters for SEncParamExt and I cannot get better codec performance instead of smaller encoded data. I get about 16-20 fps on my computer.</p>
  
  <p>Here is my current config.</p>
  
  <pre><code>SEncParamExt param;
  m_pEncoder-&gt;GetDefaultParams(&amp;param);
  
  param.fMaxFrameRate = 30;
  
  param.bEnableFrameSkip = false;
  param.iMinQp = 20;
  param.iMaxQp = 30;
  param.iPicWidth = m_frameFormat.GetWidth();
  param.iPicHeight = m_frameFormat.GetHeight();
  param.iTargetBitrate = 5000000;
  param.bEnableDenoise = false;
  param.iSpatialLayerNum = 1;
  param.iTemporalLayerNum = 1;
  param.bIsLosslessLink = false;
  param.bEnableLongTermReference = true;
  param.iEntropyCodingModeFlag = 0;
  param.iMultipleThreadIdc = 2;
  param.bUseLoadBalancing = true;
  
  for (int i = 0; i &lt; param.iSpatialLayerNum; i++)
  {
      param.sSpatialLayers[i].iVideoWidth = m_frameFormat.GetWidth()  &gt;&gt; (param.iSpatialLayerNum - 1 - i);
      param.sSpatialLayers[i].iVideoHeight = m_frameFormat.GetHeight() &gt;&gt; (param.iSpatialLayerNum - 1 - i);
      param.sSpatialLayers[i].fFrameRate = 30;
      param.sSpatialLayers[i].iSpatialBitrate = param.iTargetBitrate;
      param.sSpatialLayers[i].sSliceArgument.uiSliceMode = SM_FIXEDSLCNUM_SLICE;
      param.sSpatialLayers[i].sSliceArgument.uiSliceNum = 2;
  }
  
  param.iTargetBitrate *= param.iSpatialLayerNum;
  </code></pre>
  
  <p>I tried different values for <strong>param.iComplexityMode</strong> and <strong>param.iRCMode</strong> and I get the necessary frame rate but a very bad picture quality. Also I played with quantization levels and it did not help.</p>
  
  <p>Also I use <strong>VP8 codec</strong>. It easily produces 24 frames per second for the same video. The encoded data size is bigger (about 500Kb per second vs 200Kb per second in the case of OpenH264) but it is very convenient for me.</p>
  
  <p>What am I doing wrong? What should I do to increase OpenH264 performance?</p>