This Intel® Media SDK tutorial sample keeps multiple encode tasks “in flight” simultaneously, and SyncOperation() is not called until absolutely necessary (when all surface input buffers have been exhausted).
For more details on implementing with video memory please refer to "simple_2_decode" sample description.
This example achieves efficient operation with video memory surfaces and asynchronous implementation, minimizing gaps in the GPU pipeline. Decode and encode operations are optimally scheduled internally by Media SDK so that fixed function hardware is fully utilized with many operations occurring simultaneously. As an added benefit of fully utilizing the GPU, this will cause it to remain in turbo mode1 providing a further boost to performance.
Marginal throughput improvements may be achieved by executing several encode workloads concurrently.
This tutorial sample is found in the tutorial samples package under the name "simple_3_encode_vmem_async". The code is extensively documented with inline comments detailing each step required to setup and execute the use case.
1 Requires a system with Intel® Turbo Boost Technology. Intel Turbo Boost Technology and Intel Turbo Boost Technology 2.0 are only available on select Intel® processors. Consult your PC manufacturer. Performance varies depending on hardware, software, and system configuration. For more information, visit http://www.intel.com/go/turbo