Permalink
Browse files

use number of threads * 3/2 as decoding threads since it's faster

git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4474 10f7b99b-c216-0410-bff0-8a66a9350fd8
  • Loading branch information...
XhmikosR XhmikosR
XhmikosR authored and XhmikosR committed Apr 22, 2012
1 parent 34de3d2 commit 7beb197e490380b3c5b871cd7076cc33f66484a1
@@ -197,8 +197,5 @@ int CCpuId::GetProcessorNumber()
SYSTEM_INFO SystemInfo;
GetSystemInfo(&SystemInfo);
- // TODO: maybe use dwNumberOfProcessors * 3 / 2.
- // It seems to be significantly faster; 62 vs 69 fps for a 2160p sample
- // on a i7-2600k
return SystemInfo.dwNumberOfProcessors;
}
@@ -1105,7 +1105,7 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction,const CMediaTyp
m_pAVCtx = avcodec_alloc_context3(m_pAVCodec);
CheckPointer (m_pAVCtx, E_POINTER);
- int nThreadNumber = m_nThreadNumber ? m_nThreadNumber : m_pCpuId->GetProcessorNumber();
+ int nThreadNumber = m_nThreadNumber ? m_nThreadNumber : m_pCpuId->GetProcessorNumber() * 3 / 2;
if ((nThreadNumber > 1) && IsMultiThreadSupported (m_nCodecId)) {
FFSetThreadNumber(m_pAVCtx, m_nCodecId, (IsDXVASupported() || (m_nCodecId == CODEC_ID_THEORA && !m_bTheoraMTSupport)) ? 1 : nThreadNumber);
}

0 comments on commit 7beb197

Please sign in to comment.