Revision 158628408 of "Benutzer:Subamaggus/Video Acceleration API" on dewiki

{{Cleanup|date=September 2009}}
{{Infobox software










| name                   = libVA
| title                  = libVA
| logo                   = <!-- [[File: ]] -->
| screenshot             = <!-- [[File: ]] -->
| caption                = 
| collapsible            = 
| author                 = [[Intel]]
| developer              = 
| released               = {{Start date and age|2007|09|13}} <!-- First commit to git -->
| discontinued           = 
| latest release version = 1.6.1
| latest release date    = {{Start date and age|2015|09|09}}
| latest preview version = 
| latest preview date    = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| frequently updated     = <!-- DO NOT include this parameter unless you know what it does -->
| programming language   = [[C (programming language)|C]]
| operating system       = [[Linux]], [[Android (operating system)|Android]], and [[Berkeley Software Distribution|BSD]]-based systems
| platform               = 
| size                   = 
<!-- | status                 = Active -->
| genre                  = [[API]]<br/>[[Library (computing)|Library]]
| license                = [[MIT License]]
| website                = {{URL|http://www.freedesktop.org/wiki/Software/vaapi}}
}}

'''Video Acceleration API''' ('''VA API''') is a royalty-free [[Application programming interface|API]] as well as its implementation as [[free and open-source]] [[Library (computing)|library]] (<tt>libVA</tt>) distributed under the [[MIT License]].

The VA API interface is to be implemented by [[device driver]]s to offer end-user software, such as [[VLC media player]] or [[GStreamer]], access to available video acceleration hardware, such as [[Nvidia PureVideo|PureVideo]] (through the <tt>libva-vdpau</tt> driver, which implements VA API in terms of [[VDPAU]]) or [[Unified Video Decoder]].

The API enables and provides access to hardware-accelerated video processing, using hardware such as [[graphics processing unit]]s (GPU) to accelerate video encoding and decoding by offloading processing from the [[central processing unit]] (CPU).

VA API video decode/encode interface is platform and window system independent but is today primarily targeted at [[Direct Rendering Infrastructure]] (DRI) in [[X Window System]] on [[Unix]]-like [[operating system]]s (including [[Linux]], [[FreeBSD]], [[Solaris (operating system)|Solaris]]), and [[Android (operating system)|Android]], however it can potentially also be used with direct [[framebuffer]] and graphics sub-systems for video output. Accelerated processing includes support for [[Video codec|video decoding]], [[video coding|video encoding]], subpicture blending, and rendering.<ref>http://www.phoronix.com/scan.php?page=news_item&px=MTA0NDI VA-API Video Acceleration On Intel Medfield</ref>

The VA API specification was originally designed by [[Intel]] for its [[Intel GMA|GMA (Graphics Media Accelerator)]] series of [[Graphics processing unit|GPU]] hardware with the specific purpose of eventually replacing the [[XvMC]] standard as the default Unix multi-platform equivalent of [[DirectX Video Acceleration|Microsoft Windows DirectX Video Acceleration (DxVA) API]], but today the API is no longer limited to Intel-specific hardware or GPUs.<ref>https://events.linuxfoundation.org/images/stories/pdf/lceu2012_debski.pdf Video4Linux2 - Path to a Standardized Video Codec API</ref> Other hardware and manufacturers can freely use this open standard API for hardware accelerated video processing with their own hardware without paying a royalty fee.<ref name="lwn.net">{{cite web |url=http://lwn.net/Articles/339349/ |title=VA API slowly, but surely, making progress |author=Nathan Willis |date=2009-07-01 |publisher=lwn.net}}</ref>

== Overview ==
The main motivation for VA API is to enable hardware-accelerated video decode at various entry-points ([[Variable-length code|VLD]], [[IDCT]], [[motion compensation]], [[Deblocking filter (video)|deblocking]]<ref name="MPlayer, FFmpeg Gain VA-API Support">[http://www.phoronix.com/vr.php?view=13300 MPlayer, FFmpeg Gain VA-API Support]</ref>) for the prevailing coding standards today ([[H.262/MPEG-2 Part 2|MPEG-2]], [[MPEG-4 Part 2|MPEG-4 ASP]]/[[H.263]], [[H.264/MPEG-4 AVC|MPEG-4 AVC/H.264]], and [[VC-1|VC-1/WMV3]]). Extending XvMC was considered, but due to its original design for MPEG-2 [[Motion Compensation|MotionComp]] only, it made more sense to design an interface from scratch that can fully expose the video decode capabilities in today's [[Graphics processing unit|GPU]]s.<ref name="freedesktop.org">[http://www.freedesktop.org/wiki/Software/vaapi freedesktop.org - Software/vaapi, About]</ref>

=== Supported hardware and drivers ===
As of January 17, 2012 VA API is natively supported by :
* The free and open source drivers of [[Broadcom Crystal HD]] (example of a non-GPU based hardware)<ref>http://gitorious.org/crystalhd-video CrystalHD backend for VA-API (libva)</ref>
* The free and open source drivers of the integrated graphics known as "''Intel HD Graphics''" (Intel HD Graphics 2000/2500/3000/4000) inside [[Intel Core|Intel Core i3 / i5 / i7 Processor Family (Nehalem, Sandy Bridge, Ivy Bridge microarchitecture based)]] processor family.<ref>http://intellinuxgraphics.org/h264.html Intel hardware-accelerated media decoding and encoding on Linux</ref>
* The free and open source drivers of the Intel [[List of Intel chipsets#Core 2 chipsets|G45 chipset (with Intel GMA X4500HD integrated graphics)]], and later<ref>http://intellinuxgraphics.org/documentation.html</ref>
* The closed source proprietary drivers for [[Intel]]'s [[Poulsbo (chipset)|Poulsbo chipset]] with [[Imagination Technologies]]'s [[PowerVR]]-based [[GMA 500]] integrated graphics<ref>[http://www.phoronix.com/scan.php?page=news_item&px=NzAyOQ Intel's Poulsbo Driver A Bloody Mess?]</ref>
* The closed source proprietary drivers for [[List_of_Intel_Atom_microprocessors#Embedded_processors|Atom E6xx]] and [[List of Intel microprocessors#Intel 806xx product codes|Penwell]] based [[System-on-a-chip|SoC]]s are also supported via its ''Media Infrastructure Accelerator'' (MI-X).<ref name="ReferenceA">http://www.phoronix.com/scan.php?page=news_item&px=MTA0NDI VA-API Video Acceleration On Intel Medfield</ref>
* The closed source proprietary drivers Intel [[Mobile_Internet_device#Medfield_platform_.282011.29|Medfield]] [[System-on-a-chip|SoC]]s with [[Imagination Technologies]]'s [[PowerVR]] (VXD375/385 and VXE250/285) based integrated graphics.<ref name="ReferenceA"/>
* The closed source proprietary drivers of [[S3 Graphics]]'s [[S3 Graphics Chrome 400|Chrome 400]] and later series are also supported.<ref>[http://www.phoronix.com/scan.php?page=article&item=s3_linux_ogl3_vaapi&num=1 S3 Graphics Releases Linux Driver With OpenGL 3.0, VA API]</ref>
* In November 2009, VA-API also gained a new [[Proprietary software|proprietary]] backend named "''xvba-video''" which allows VA-API powered applications to take advantage of AMD Radeon's [[AMD Catalyst|proprietary fglrx drivers]] for its chipsets with [[Unified Video Decoder|UVD]]2 support via the [[XvBA]] library (X-Video Bitstream Acceleration API designed by AMD), for closed source proprietary driver only.
* Additionally, [[VDPAU|VDPAU (Video Decode and Presentation API for Unix)]], a competing API designed by [[NVIDIA]], can potentially also be used as a backend for the VA API.  If this is supported, any software that supports VA API then also indirectly supports a subset of VDPAU.<ref>{{cite web
| url         = http://www.phoronix.com/scan.php?page=article&item=xorg_vdpau_vaapi
| title       = A NVIDIA VDPAU Back-End For Intel's VA-API
| accessdate  = 2009-03-13
| author      = [[Michael Larabel]]
| date        = 2009-02-03
| work        = [[Phoronix]]
}}</ref>

=== Supported video codecs ===
VA API currently supports these video codecs in the official mainline version, but note that exactly which video codecs are supported depends on the hardware and the driver's capabilities.
* Supports MPEG-2 decode acceleration Main Profile
* Supports VC-1 / WMV3 decode acceleration Advanced Profile
* Supports [[MPEG-4 Part 2|MPEG-4 Part 2 (H.263)]] (a.k.a. MPEG-4 SP / MPEG-4 ASP, more commonly known as [[Xvid]]) decode acceleration
* Supports [[H.264/MPEG-4 AVC|H.264 AVC]] encode acceleration Main Profile
* Supports H.264 AVC decode acceleration High Profile
** H.264 / AVC Hardware Variable Length Decoding (VLD) - CABAC
** H.264 / AVC Hardware Variable Length Decoding (VLD) - CAVLC
** H.264 / AVC Hardware Inverse Transform (IT)
** H.264 / AVC Hardware Motion Compensation (HWMC)
** H.264 / AVC Hardware In-Loop Deblocking (ILDB)

== Processes that can be accelerated with VA API ==
Video decoding and post-processing processes that can be offloaded and accelerated if both the device drivers and GPU hardware supports them:
* [[Motion compensation]] (mocomp)
* [[Inverse discrete cosine transform]] (iDCT)
* In-loop [[deblocking filter (video)|deblocking filter]]
* Intra-frame prediction
* [[Huffman coding|Variable-Length Decoding]] (VLD), more commonly known as slice-level acceleration
* Bitstream processing ([[Context-adaptive variable-length coding|CAVLC]]/[[Context-adaptive binary arithmetic coding|CABAC]])

== Software architecture ==
[[File:Vaapi illustration.svg|thumb|right|350px|Video Acceleration API (VA API) interface architecture]]

The current interface is window system independent, so that it can potentially be used with graphics sub-systems other than the [[Direct Rendering Infrastructure|DRI (Direct Rendering Infrastructure)]] in [[X Window System]], such as direct with [[framebuffer]], and it can work with third-party [[Direct Rendering Manager|DRM (Direct Rendering Manager)]] libraries. In a nutshell, it is a scheme to pass various types of data buffers from the application to the [[Graphics processing unit|GPU]] for [[Video codec|decoding or encoding]] a [[Elementary stream|compressed bit-stream]].

== Sources ==
<!-- STEP 3: All articles must cite at least one PUBLISHED, SPECIFIC,   -->
<!--         THIRD-PARTY source for the information, such as a book or  -->
<!--         a page on a reputable website. Please provide a URL or     -->
<!--         link if you wish to use an internet source. WE MUST BE     -->
<!--         ABLE TO VERIFY YOUR SOURCE, so sources such as "Google" or -->
<!--         "personal knowledge" will be rejected.                     -->
<!--         IF YOU DO NOT INCLUDE AT LEAST ONE VALID SOURCE, YOUR      -->
<!--         ARTICLE WILL BE REJECTED.                                  -->

<!--         Please add your source(s) below this line.                 -->

"The main motivation for VA-API (Video Acceleration API) is to enable hardware accelerated video decode/encode at various entry-points (VLD, IDCT, Motion Compensation etc.) for the prevailing coding standards today (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3)."
http://www.freedesktop.org/wiki/Software/vaapi

"A new video acceleration API is being developed, in an effort led by Intel. This new API supports more complete offload (VLD) as well as iDCT+MC, and can support acceleration of MPEG4, H.264, VC-1, as well as MPEG-2."
http://www.mythtv.org/wiki/XvMC

The "VA API" and "libVA" can also be read about here:
"The end user impact is improved performance of H.264, VC-1, MPEG-2 and MPEG-4 video playback with media players that use the new API compared to playback using a pure software implementation."
https://wiki.ubuntu.com/mobile-hw-decode

== Software supporting VA API ==
<!-- MPlayer does not support VA-API, please see discussion -->
* [[Helix (project)|Helix media player]] ([[Linux]])<ref>[http://lists.moblin.org/pipermail/dev/2008-September/002750.html Mailing list entry that describes uses of VA-API]</ref><ref>https://community.helixcommunity.org/Licenses/realplayer_for_mid_faq.html RealPlayer for MID & Intel/Linux FAQ</ref>
* [[Clutter (toolkit)]]
* [[Gnash (software)|Gnash]] Flash / [[SWF]] player<ref>[http://www.phoronix.com/scan.php?page=news_item&px=NzU1MA .264 VA-API GPU Video Acceleration For Flash]</ref>
* [[GStreamer]] through <tt>gstreamer-vaapi</tt><ref>{{cite web |url=https://gitorious.org/vaapi/gstreamer-vaapi |title=gstreamer-vaapi git}}</ref>
<!--As of May 12th, 2011, ffmpeg does not support VA-API (libavcodec contains code that allows other applications to use VA-API). Before changing the following sentence, please discuss on the Discussion page! -->
* ''ffmpeg'', a command line tool from the [[FFmpeg]] project, does not support VA-API, but [[libavcodec]] (also part of the FFmpeg project) does contain code that other applications use to support hardware accelerated decoding, including VA API.<ref>[http://wiki.gnashdev.org/Hardware_Video_decoding Gnash uses libavcodec's VA-API code for hardware accelerated video decoding]</ref>
* [[Fluendo]]<ref>[http://www.phoronix.com/scan.php?page=news_item&px=ODEwMw Fluendo's New Codecs Support VDPAU, VA-API]</ref>
* [[MPlayer]] (v1 with patches)<ref>[https://gitorious.org/vaapi/mplayer mplayer branch soon to be merged mainline]</ref> and its fork [[MPlayer#Forks|mpv]] (native)
* [[Kodi (software)|Kodi]] (formerly XBMC Media Center) ([[Linux]])<ref name="phoronix.com">[http://www.phoronix.com/scan.php?page=news_item&px=ODEyNw XBMC Gets Working Intel VA-API Support]</ref>
* [[Kodi (software)#Kodibuntu|Kodibuntu]] (formerly XBMC Live) (Linux Live CD/USB operating-system)<ref name="phoronix.com"/>
* [[VLC media player]] (starting from release 1.1.0)<ref>[http://www.videolan.org/vlc/releases/1.1.0.html VLC 1.1.0 release notes]</ref>
* [[MythTV]] (starting from release 0.25)<ref>[http://www.mythtv.org/wiki/Release_Notes_-_0.25 MythTV 0.25 release notes]</ref>
Some software may gain VA API support in the future : [[Lightspark]] (Flash / [[SWF]] player),<ref>{{En icon}} [https://bugs.launchpad.net/lightspark/+bug/859466 Bug report on Launchpad]</ref> and [[Xine]] (via "''xine-lib-vaapi''" library).<ref>{{En icon}} [http://old.nabble.com/VAAPI-support-for-xine-td32502350.html VA API support for Xine on xine-devel mailing list]</ref>

== See also ==
{{Portal|Free software}}
* [[VDPAU]] (Video Decode and Presentation API for Unix)
* [[X-Video Bitstream Acceleration]] (XvBA)
* [[X-Video Motion Compensation]] (XvMC)
* [[DirectX Video Acceleration]] (DxVA) — Microsoft Windows API analogue
* [[Distributed Codec Engine]] (libdce) — Texas Instruments API for the video codec engine in OMAP based embedded systems
* [[OpenMAX]] — a royalty-free cross-platform media abstraction API from the Khronos Group
* [[Nvidia PureVideo]] — the bit-stream technology from NVIDIA used in their graphics chips to accelerate video decoding on hardware GPU
* [[Unified Video Decoder]] (UVD) — the bit-stream technology from ATI used in their graphics chips to accelerate video decoding on hardware GPU

== References ==
{{Reflist|30em}}

== External links ==
* http://www.freedesktop.org/wiki/Software/vaapi
* [http://lwn.net/Articles/339349/ an overview article]
* http://intellinuxgraphics.org/vaapi.html
* http://wiki.ubuntu.com/mobile-hw-decode
* [http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/ Splitted-Desktop Systems patches to add VA API support to FFmpeg and MPlayer]
* [http://www.phoronix.com/scan.php?page=article&item=xorg_vaapi_mplayer/ MPlayer, FFmpeg Gain VA-API Support]

{{XWinSys}}
{{freedesktop.org}}

[[Category:Application layer protocols]]
[[Category:Application programming interfaces]]
[[Category:Freedesktop.org]]
[[Category:Video acceleration]]
[[Category:Video acceleration APIs available on Linux]]
[[Category:X Window extensions]]