I have read the SDK manual, and it seems that if I initialize with MFX_IMPL_AUTO_ANY then QuickSync hardware acceleration will be used if it is available. I can check if hardware acceleration is being used by calling MFXQueryIMPL() and if it returns MFX_IMPL_SOFTWARE then hardware acceleration is not available.
There appear to be 2 reasons why MFXQueryIMPL() would return MFX_IMPL_SOFTWARE:
1. The Intel QuickSync graphics adaptor is present but the application's affinity had been set to a different adaptor, or 2. The CPU is a model which does not have QuickSync capabilities (and may not even be an Intel model)
I need to be able to display a correct message for the user, which tells them that their CPU is not QuickSync capable; or which tells them that their CPU does have QuickSync capability but it is not available and they should check and correct the affinity setting for my program so that it is in the Intel graphics adaptor afinity list.
The question is, how can I tell the difference between cause 1 and 2 ?
I suspect that if I get MFX_IMPL_SOFTWARE then I need to do this:
if CPU is QuickSync capable then tell user to check and correct the affinity setting for this program else tell user thier CPU is not QuickSync cabable and processing will continue in software endif
But how do I tell whether the CPU is QuickSync capable ?
Is there any other situation which might cause MFX_IMPL_AUTO_ANY to return as MFX_IMPL_SOFTWARE that I might have missed ?
There are several reasons for Media SDK to fall back on SW implementation.
Keep in mind that HW acceleration will not be detected even on a QuickSync supported system if Intel graphics driver is not installed (or very old driver installed). So application may want to check that recent driver is installed or prompt user to install it.
MFX_IMPL_AUTO_ANY will detect and initialize Media SDK session even on non primary adapters, as long as the Intel graphics adapter is enabled. Keep in mind that if non primary adapter is used, DirectX device must be created and used for that specific device. If setting application affinity means that the OS somehow has the ability to hide the Intel adapter then this will not work.
Assuming that user has installed appropriate graphics driver then you can rely on Media SDK to determine if the system supports HW acceleration or not.
But is there at least a way of checking whether the actual CPU is one which WOULD be capable of QuickSync acceleration whether or not a graphics adaptor is installed. Basically it is pointless giving the user tips about installing the graphics adaptor to get QuickSync capability, or checking the affinity when they only have a pre-Quicksync CPU, or an AMD CPU that will NEVER be able to do QuickSync.
Maybe what is needed is a way to get the model of the CPU and compare it with a known list of CPUs which do have QuickSync capabilities - however this would not help when future CPU models are launched that are not in the current list.
Is there really no easy way of querying the CPU to find out if its hardware is QuickSync capable (irrespective of whether graphics drivers are properly loaded) ?
If not, is there a web page which gives a simple list of CPUs which have QuickSync capability - then at least the user could be instructed to look at the page to check whether their CPU can really do QuickSync ?
Unfortunately there is no silver bullet to easily detect everything you need.
An approach that may work for you that will cover the majority of cases is to use the CPUID feature to gather info about the installed processor part.By identifying the processor signature via CPUID you can determine if the processor is 2nd generation Core or better, which equals QuickSync support.
However, this is not foolproof since some 2-3 gen processor SKUs has disabled the QuickSync feature, specifically for the E series SKUs and some of the Xeon E3 SKUs.
For a complete mapping you would have to retrieve the supported ids from Intel ARK (see below).
Microsoft provides some code to simplify CPUID info retrieval here:
Thanks Peter. That helps, but it still puts the onus on the user to look up their processor on the Intel site to be completely sure, which is a bit of an inconvenience. It would have been much better if there had been a cpuid bit defined specifically for QuickSync present.
Also the values 0x206A and 0x306A are OK for the present models, but current software can't know what values are going to be used for future generations after Ivy bridge. Is there going to be any pattern to these values that can be used to check if future generations have QuickSync?
Using DX10 you can enumerate all the adapters even if they are not connected. Media SDK (or DXVA) needs a connected display to create a HW accelration device. DX10 query can be done if the D3D9 query failed.
Sorry no sample code, look it up in MSDN. See here
> Media SDK (or DXVA) needs a connected display to create a HW accelration device.
I thought that if you specified MFX_IMPL_AUTO_ANY then the SDK would select hardware accel even if the Intel GPU was not connected to a physical display?
Also, does the DX9 query only enumerate adaptors that are connected a physical display?
And how does any affinity setting for the application affect the above?
I'm assuming tha DX10 can enumerate the adaptor even if there is an affinity setting to a different adaptor?
> Low end CPUs that do not haveQuickSync support still have decode and
post process > capabilities. These include the Celeron/Pentium brands.
I'm pretty new to this but I thought that only Sandy and Ivy Bridge CPUs had any sort of video hardware acceleration at all. Can some Pentium/Celerons really do hardware accelerated MPEG-2 and H.264 decoding?
>I thought that if you specified MFX_IMPL_AUTO_ANY then the SDK would select hardware accel even if the Intel GPU was not connected to a physical display?
It would select any AVAILABLE intel GPU. Availble in DX9 is connected.
>Also, does the DX9 query only enumerate adaptors that are connected a physical display?
Sad but true. A DX9 limitation.
>I'm assuming tha DX10 can enumerate the adaptor even if there is an affinity setting to a different adaptor?
DX10 can enumarate all adapters with an installed driver (e.g. seen in the device manager).
>I'm pretty new to this but I thought that only Sandy and Ivy Bridge CPUs had any sort of video hardware acceleration at all. Can some Pentium/Celerons really do hardware accelerated MPEG-2 and H.264 decoding?
SandyBridge and IvyBridge are codenames for 2011/2012 client (non server) CPUs.
Each generation has several at least 5 quality/goodness levels:
i7 - best
i5 - better
i3 - good
Pentium - value
Celeron - cheap
They all have the same core architecture (.e.g SandyBridge architecture) but differ in CPU and GPU features.
Pentium have 2 cores, no HyperThreading, no Turbo, smaller cache, etc. It also loses the ability to use QuickSync encoding.
You can definitely build an HTPC using a Pentium or Celeron, but these are relatively weak machines and their CPU probably wouldn't handle future formats very well (VP8, HEVC, etc) in SW decoding.