[Beignet] Use OpenCL to do video post processing for libva.

Zou, Nanhai nanhai.zou at intel.com
Wed Oct 30 09:02:38 CET 2013


In the previous versions of libva intel-driver, video post processing features are mostly developed by GEN assembly.
Those assembly are extremely hard to write/debug and understand, could not be reused across different GEN platform.
This limited developers to develop their video processing algorithm over libva.

Now we have setup an experimental branch in libva to use OpenCL as the video post processing language.
This branch can share video buffer with beignet driver as bo, then call OpenCL to process the video buffer as an image object.
So that people develop high performance VPP with high level language on GPU with zero copy. (in current stage, beignet only support HD4000).

For those who are interested in develop their own VPP algorithm, you may try it and give feedback to us.
We have put 4 example post processing kernels in that branch.


1.       Make and Install Beignet from git://anongit.freedesktop.org/beignet with opencl-1.2 branch.

2.       Install ocl-icd driver
3  Make and Install libva driver and libva intel-driver from
         git://people.freedesktop.org/~yakuiz/libva
git://people.freedesktop.org/~yakuiz/intel-driver

Please add  --enable-opencl when configuring libva intel-driver.



export INTEL_OCL="gray" to specify which opencl kernel to use.

We have put 4 sample opencl kernels in the branch, "gray", "blur", "mirror" and "pixelated".



Use a vaapi enabled mplayer to playback a video.

mplayer -vo vaapi:scaling=fast -va vaapi  <your-mp4-video-file>

Then you will see the post processing effect.

TODOs.
Extend the API to a more flexible version, so that OpenCL can handle more than 1 reference buffer or used in other video processing function.
E.g. video-encoding processing and camera pipeline.

Expose more ways to access video buffer, to access video buffer as raw data or with other pixel format.
Expose the hardware media sampler function to OCL as built-in.

Thanks
Zou Nanhai

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20131030/bc57e1cd/attachment.html>


More information about the Beignet mailing list