Intel® Media SDK is a framework for developing media applications. It provides the hardware implementations for some of the founding algorithms for Media - encode, decode, video processing; and also exposes a numbers of relevant parameters that can be used to tune the application to one's need. The hardware implementation is the recommended implementation to use, but sometimes, the implementation can default to software due to the lack of underlying hardware. To leverage the full potential of the SDK, the developer has to ensure the features they want (achieved by specifying the parameters) are supported by the underlying hardware.
If you would the application to be portable and easily deployable across many platforms, it is not practical to check the compatibility of each system and customize the media application accordingly. This where the QUERY functionality of Intel Media SDK comes into the picture. The developer can use this functionality to not only check the capabilities of the underlying system, it can also suggest the best possible configuration one can achieve using the underlying system. In the following table, I will list some of the commonly used Query functions and their usage.
All the above-mentioned query functions greatly aid in portability and programmability. The first two (QueryImpl and QueryVersion) can help you choose the best possible implementation for the underlying hardware. The other query functions (Query and QueryIOSurf) are focused on the pipeline being used, and help with feature-check and ensuring enough resources are allocated for the requested features.
Code Snippets:
Query for Surfaces
Some optimization tips:
The hardware implementation is always faster than the software counterpart. You can achieve the best performance with hardware by using the video memory which is local to the hardware (GPU or fixed-function logic). When defaulting to software implementation, make sure you use the system memory and not the video memory. You can do this by adding a simple check to the output of the QueryIMPL function, and conditionally allocating the surfaces based on the output. For example,
For surface allocation, refer to the tutorials such as simple_3_encode_vmem and surface_3_encode. The former uses video memory, while the latter uses system memory.