XvMC
Encyclopedia
X-Video Motion Compensation (XvMC), is an extension of the X video extension (Xv)
X video extension
The X video extension, often abbreviated as XVideo or Xv, is a video output mechanism for the X Window System. The protocol was designed by David Carver; the specification for version 2 of the protocol was written in July 1991. Its main use today is to rescale video playback in the video controller...

 for the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

. The XvMC API allows video programs to offload portions of the video decoding process to the GPU
Graphics processing unit
A graphics processing unit or GPU is a specialized circuit designed to rapidly manipulate and alter memory in such a way so as to accelerate the building of images in a frame buffer intended for output to a display...

 video-hardware. In theory this process should also reduce bus bandwidth requirements. Currently, the supported portions to be offloaded by XvMC onto the GPU are motion compensation (mo comp)
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

 and inverse discrete cosine transform (iDCT) for MPEG-2
MPEG-2
MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission...

 video. XvMC also supports offloading decoding of mo comp
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

, iDCT, and VLD
Variable-length code
In coding theory a variable-length code is a code which maps source symbols to a variable number of bits.Variable-length codes can allow sources to be compressed and decompressed with zero error and still be read back symbol by symbol...

 ("Variable-Length Decoding", more commonly known as "slice level acceleration") for not only MPEG-2
MPEG-2
MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission...

 but also MPEG-4 ASP video on VIA Unichrome (S3 Graphics Chrome Series)
S3 Chrome
S3 Graphics' Chrome series of graphics accelerators arrived in 2004 with the DeltaChrome line of chips. They are designed to be used as discrete, mobile, and integrated graphics solutions.-Overview:...

 hardware.

XvMC was the first UNIX equivalent of the Microsoft Windows DirectX Video Acceleration (DxVA) API. Mac OS X also includes MPEG-2 acceleration capabilities, but Apple has chosen not to expose that API for use outside their own DVD-Video player application.

Popular software applications known to take advantage of XvMC include MPlayer
MPlayer
MPlayer is a free and open source media player. The program is available for all major operating systems, including Linux and other Unix-like systems, Microsoft Windows and Mac OS X. Versions for OS/2, Syllable, AmigaOS and MorphOS are also available. The Windows version works, with some minor...

, MythTV
MythTV
MythTV is a free and open source home entertainment application with a simplified "10-foot user interface" design for the living-room TV, and turns a computer with the necessary hardware into a network streaming digital video recorder, a digital multimedia home entertainment system, or home theater...

, and xine
Xine
xine is a multimedia playback engine for Unix-like operating systems released under the GNU General Public License. xine is built around a shared library that supports different frontend player applications. Another important feature of xine is the ability to manually correct the synchronization...

.

Device drivers

Each hardware video GPU capable of XvMC video acceleration requires a X11 software device driver
Device driver
In computing, a device driver or software driver is a computer program allowing higher-level computer programs to interact with a hardware device....

 to enable these features.

Nvidia

There are currently three X11 Nvidia drivers available: a 2D-only open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 but obfuscated driver maintained by Nvidia called nv, a proprietary
Proprietary software
Proprietary software is computer software licensed under exclusive legal right of the copyright holder. The licensee is given the right to use the software under certain conditions, while restricted from other uses, such as modification, further distribution, or reverse engineering.Complementary...

 binary driver by Nvidia, and an open source driver based on reverse engineering of the binary driver developed by the Linux community called Nouveau
Nouveau (graphics)
In computing, nouveau is a software project aiming to develop free software drivers for Nvidia graphics cards, by reverse engineering Nvidia's current proprietary drivers for Linux. This project by X.Org Foundation and freedesktop.org was initially based on the obfuscated 2D-only free and...

. Nouveau is not pursuing XvMC support, the 2D nv driver does not support XvMC, and the official proprietary
Proprietary software
Proprietary software is computer software licensed under exclusive legal right of the copyright holder. The licensee is given the right to use the software under certain conditions, while restricted from other uses, such as modification, further distribution, or reverse engineering.Complementary...

 binary driver by Nvidia only supports MPEG-2 offloading (mo comp and iDCT) on hardware up to and including the GeForce
GeForce
GeForce is a brand of graphics processing units designed by Nvidia. , there have been eleven iterations of the design. The first GeForce products were discrete GPUs designed for use on add-on graphics boards, intended for the high-margin PC gaming market...

 7000 series.

VIA

VIA provides open source device drivers for some of its VIA Unichrome (S3 Graphics Chrome Series)
S3 Chrome
S3 Graphics' Chrome series of graphics accelerators arrived in 2004 with the DeltaChrome line of chips. They are designed to be used as discrete, mobile, and integrated graphics solutions.-Overview:...

 hardware, supporting offloading of MPEG-2
MPEG-2
MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission...

 and MPEG-4 ASP video.
Thanks to VLD level of decoding VIA offloads much more decoding tasks from CPU than GPUs supporting iDCT or mo comp levels only.
Keep in mind that not all devices are supported and there are some other caveats.

Intel

Intel provides official open source device drivers which supports MPEG-2 offloading (mo comp and iDCT) on Intel's 8xx/9xx range of integrated graphics chips.

ATI/AMD

Although ATI was the first manufacturer to provide MPEG2 acceleration in their graphic boards with the Rage 128 GPU, it has never provided documentation on how to use it. So no XvMC is available, and will probably never be.

XvMC is supported on Radeon
Radeon
Radeon is a brand of graphics processing units and random access memory produced by Advanced Micro Devices , first launched in 2000 by ATI Technologies, which was acquired by AMD in 2006. Radeon is the successor to the Rage line. There are four different groups, which can be differentiated by...

-4000 cards (which have UVD) by Catalyst
ATI Catalyst
AMD Catalyst is a device driver and utility software package for ATI line of video cards. It runs on Microsoft Windows and Linux, on 32- and 64-bit x86 processors.- History :...

 driver from 8.10 and higher at an experimental level (meaning that it doesn't work "out of the box
Out of the box
Out of the box is the term used to denote items, functionalities, or features that do not require any additional installation. In addition to being used for tangible products, the phrase is often used in a less literal sense for software, which may not be distributed in an actual box but offer...

".)
(See also X-Video Bitstream Acceleration
X-Video Bitstream Acceleration
X-Video Bitstream Acceleration , designed by AMD for its Radeon GPU and Fusion APU, is an arbitrary extension of the X video extension for the X Window System on Linux operating-systems. XvBA API allows video programs to offload portions of the video decoding process to the GPU video-hardware...

).
Motion compensation support in other ATI/AMD hardware is planned for the future. (Now all hardware has support for MPEG-2 acceleration on iDCT and mo comp levels).

Matrox

There are no device drivers which support XvMC on Matrox hardware, (although Matrox Parhelia
Matrox Parhelia
Matrox Parhelia-512 is a GPU with full support for DirectX 8.1 and incorporating several DirectX 9.0 features. It was best known for its ability to drive three monitors and its Coral Reef tech demo.-Background:...

 hardware has support for MPEG-2 acceleration on mo comp level).

S3

Binary device driver by S3 only supports MPEG-2 offloading in initial 2.0.16 driver on Chrome 20 GPUs.
The proprietary driver which was developed by Cooper Yuan (cooperyuan at gmail.com) accelerates MPEG-2 decoding at IDCT level.

XvMC API technical overview

This is from X-Video Motion Compensation - API specification v. 1.0

XvPort

XvMC extends the X video extension (Xv)
X video extension
The X video extension, often abbreviated as XVideo or Xv, is a video output mechanism for the X Window System. The protocol was designed by David Carver; the specification for version 2 of the protocol was written in July 1991. Its main use today is to rescale video playback in the video controller...

 and makes use of the familiar concept of the XvPort. Ports have attributes that can be set and queried through Xv. In XvMC ports can also have hardware motion compensation
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

 contexts created for use with them. Ports which support XvImages (i.e. they have an "XV_IMAGE" port encoding as described in the Xv version 2.2 API addendum) can be queried for the list of XvMCSurface types they support. If they support any XvMCSurface types an XvMCContext can be created for that port.

XvMCContext

XvMCContext describes the state of the motion compensation
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

 pipeline. An individual XvMCContext can be created for use with a single port, surface type, motion compensation type, width and height combination. For example, a context might be created for a particular port that does MPEG-2
MPEG-2
MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission...

 motion compensation on 720 x 480 4:2:0 surfaces. Once the context is created, referencing it implies the port, surface type, size and the motion compensation type. Contexts may be "direct" or "indirect". For indirect contexts the X server renders all video using the data passed to it by the client. For direct contexts the client libraries render the video with little or no interaction with the X server.

XvMCSurfaces

XvMCSurfaces are buffers into which the motion compensation
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

 hardware can render. The data in the buffers themselves are not client accessible and may be stored in a hardware-specific format. Any number of buffers can be created for use with a particular context (resources permitting).

Video Pipeline

XvMC provides video acceleration starting at one of two places in the video pipeline. Acceleration starting at the first point, which we shall call the "Motion Compensation" level, begins after the inverse quantization and IDCT at the place where motion compensation
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

 is to be applied. The second point, which we shall call the "IDCT" level, begins before the IDCT just after the inverse quantization.

Rendering

Rendering
Rendering (computer graphics)
Rendering is the process of generating an image from a model , by means of computer programs. A scene file contains objects in a strictly defined language or data structure; it would contain geometry, viewpoint, texture, lighting, and shading information as a description of the virtual scene...

 is done by presenting the library with a target XvMCSurface and up to two reference XvMCSurfaces for the motion compensation, a buffer of 8x8 blocks and a command buffer which describes how to use the 8x8 blocks along with motion compensation vectors to construct the data in the target XvMCSurface. When the pipeline starts at the iDCT level, Xv will perform the IDCT on the blocks before performing the motion compensation. A function is provided to copy/overlay a portion of the XvMCSurface to a drawable with arbitrary scaling.

XvMCSubpictures

XvMCSubpictures are separate surfaces that may be blended with the target surface. Any number of XvMCSubpictures may be created for use with a context (resources permitting). Both "backend" and "frontend" subpicture behavior are supported.

Processes that could be accelerated

Even though XvMC currently only supports hardware acceleration of motion compensation
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

 (mo comp) and inverse discrete cosine transform (iDCT), (and Variable-Length Decoding for VIA Unichrome GPU), additional video decoding processes could be passed on to modern GPU
Graphics processing unit
A graphics processing unit or GPU is a specialized circuit designed to rapidly manipulate and alter memory in such a way so as to accelerate the building of images in a frame buffer intended for output to a display...

s which could be accelerated via GPU fragment programs. XvMC could be extended in the future to support the same processes as the newer competing hardware video acceleration APIs like VDPAU
VDPAU
VDPAU is an open source library and API originally designed by Nvidia for its GeForce 8 series and later GPU hardware, targeted at the X Window System on Unix-based operating systems...

, XvBA
X-Video Bitstream Acceleration
X-Video Bitstream Acceleration , designed by AMD for its Radeon GPU and Fusion APU, is an arbitrary extension of the X video extension for the X Window System on Linux operating-systems. XvBA API allows video programs to offload portions of the video decoding process to the GPU video-hardware...

, and VAAPI
Video Acceleration API
Video Acceleration API is an open source software library and API specification. It enables and provides access to graphics hardware acceleration for video processing. VA API is targeted at the X Window System on Unix-based operating systems...

:
  • Motion compensation
    Motion compensation
    Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

     (mo comp)
  • Inverse discrete cosine transform (iDCT)
    • Inverse telecine 3:2 and 2:2 pull-down correction
  • Inverse modified discrete cosine transform
    Modified discrete cosine transform
    The modified discrete cosine transform is a Fourier-related transform based on the type-IV discrete cosine transform , with the additional property of being lapped: it is designed to be performed on consecutive blocks of a larger dataset,...

     (iMDCT)
  • In-loop deblocking filter
    Deblocking filter (video)
    A deblocking filter is a video filter applied to blocks in decoded video to improve visual quality and prediction performance by smoothing the sharp edges which can form between macroblocks when block coding techniques are used...

  • Intra-frame prediction
  • Inverse quantization
    Quantization (image processing)
    Quantization, involved in image processing, is a lossy compression technique achieved by compressing a range of values to a single quantum value. When the number of discrete symbols in a given stream is reduced, the stream becomes more compressible. For example, reducing the number of colors...

     (IQ)
  • Variable-length decoding
    Huffman coding
    In computer science and information theory, Huffman coding is an entropy encoding algorithm used for lossless data compression. The term refers to the use of a variable-length code table for encoding a source symbol where the variable-length code table has been derived in a particular way based on...

     (VLD), more commonly known as slice-level acceleration
  • Spatial-temporal deinterlacing
    Deinterlacing
    Deinterlacing is the process of converting interlaced video, such as common analog television signals or 1080i format HDTV signals, into a non-interlaced form....

     and automatic interlace/progressive
    Progressive scan
    Progressive scanning is a way of displaying, storing, or transmitting moving images in which all the lines of each frame are drawn in sequence...

     source detection
  • Bitstream processing (CAVLC
    Context-adaptive variable-length coding
    Context-adaptive variable-length coding is a form of entropy coding used in H.264/MPEG-4 AVC video encoding. It is an inherently lossless compression technique, like almost all entropy-coders. In H.264/MPEG-4 AVC, it is used to encode residual, zig-zag order, blocks of transform coefficients. It...

    /CABAC
    Context-adaptive binary arithmetic coding
    Context-adaptive binary arithmetic coding is a form of entropy encoding used in H.264/MPEG-4 AVC video encoding. It is a lossless compression technique. It is notable for providing much better compression than most other encoding algorithms used in video encoding, and is one of the primary...

    )

Current limitations

Besides not matching all of the features and function of DxVA (which is the Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 equivalent API for Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

), and lacking support for other video formats than MPEG-2
MPEG-2
MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission...

 in Linux device drivers from Intel and NVIDIA
NVIDIA
Nvidia is an American global technology company based in Santa Clara, California. Nvidia is best known for its graphics processors . Nvidia and chief rival AMD Graphics Techonologies have dominated the high performance GPU market, pushing other manufacturers to smaller, niche roles...

, the XvMC API specification version 1.0 currently also has these other limitations:
  • BOB and onefield are the only deinterlacing
    Deinterlacing
    Deinterlacing is the process of converting interlaced video, such as common analog television signals or 1080i format HDTV signals, into a non-interlaced form....

     methods that work with XvMC.
  • Picture in Picture (PiP) does not work with XvMC.
  • Stepping through the video frame by frame can cause artifacts with XvMC.
  • Editing a video is difficult to impossible with XvMC activated.
  • Lacking network transparency in the XvMC API
  • Lacking the ability for the client application to be completely independent of which client side library needs to be used (i.e. a unified wrapper library).


A project called VA API
Video Acceleration API
Video Acceleration API is an open source software library and API specification. It enables and provides access to graphics hardware acceleration for video processing. VA API is targeted at the X Window System on Unix-based operating systems...

 is underway to develop a more modern video acceleration API which will support the video acceleration features of modern GPUs.

See also

  • X video extension
    X video extension
    The X video extension, often abbreviated as XVideo or Xv, is a video output mechanism for the X Window System. The protocol was designed by David Carver; the specification for version 2 of the protocol was written in July 1991. Its main use today is to rescale video playback in the video controller...

     (commonly referred to as just "XVideo" or "Xv")
  • X Window System
    X Window System
    The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

     (commonly referred to as just "X11" or "X")
  • MIT-SHM
    MIT-SHM
    The MIT Shared Memory Extension or MIT-SHM is a X Window System extension for exchange of image data between client and server using shared memory.The basic capability provided is that of shared memory XImages...

     - The MIT Shared Memory Extension for X11
  • DirectX Video Acceleration (DxVA) API - Microsoft Windows
    Microsoft Windows
    Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

     equivalent to XvMC
  • Video Acceleration API (VA API)
  • OpenMAX IL (Open Media Acceleration Integration Layer)
    OpenMAX
    OpenMAX is a royalty-free, cross-platform set of C-language programming interfaces that provides abstractions for routines especially useful for audio, video, and still images...

     - a royalty-free cross-platform media abstraction API from the Khronos Group
    Khronos Group
    The Khronos Group is a not-for-profit member-funded industry consortium based in Beaverton, Oregon, focused on the creation of open standard, royalty-free APIs to enable the authoring and accelerated playback of dynamic media on a wide variety of platforms and devices...

  • X-Video Bitstream Acceleration (XvBA)
    X-Video Bitstream Acceleration
    X-Video Bitstream Acceleration , designed by AMD for its Radeon GPU and Fusion APU, is an arbitrary extension of the X video extension for the X Window System on Linux operating-systems. XvBA API allows video programs to offload portions of the video decoding process to the GPU video-hardware...

  • VDPAU (Video Decode and Presentation API for Unix)
    VDPAU
    VDPAU is an open source library and API originally designed by Nvidia for its GeForce 8 series and later GPU hardware, targeted at the X Window System on Unix-based operating systems...

  • Video Decode Acceleration Framework is Apple Inc.s API for hardware-accelerated decoding of H.264 on Mac OS X
    Mac OS X
    Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

  • VideoToolBox is an undocumented API from Apple Inc. for hardware-accelerated decoding on Apple TV and Mac OS X
    Mac OS X
    Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

     10.5 or later.
  • OpenVideo Decode (OVD) – an new open cross-platform video acceleration API from AMD.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK