lotus

previous page: 32 How does a video accelerator work, and will one help me?
  
page up: PC Video FAQ
  
next page: 34 How does a 3D graphics accelerator work?

33 What does a video codec do?




Description

This article is from the comp.sys.ibm.pc.hardware.video Frequently Asked Questions, by Michael Scott with numerous contributions by others. (v1.0).

33 What does a video codec do?

Anybody who has played-back a movie on their computer knows that the video is choppy and low resolution. The reason is that current PC technology simply can't handle the amount of data required to display uncompressed full-screen video. To understand why, we just have to look at the amount of data contained in a video clip. If we want to record a standard video signal for digital playback, we have to digitize it at about 640x480 pixels/frame. At a refresh rate of 30 fps (frames per second), and true colour (16.7 million) we would be pumping 640x480x30x3 = 28 Mbytes/s through our computer. At that data rate, a 650 Mbyte CDROM would hold only 23 seconds of video! CDROM reader and hard drive technologies don't allow us to transfer data at such high rates, so in order to display digital video it is compressed for storage.

Compressed video streams are read from a hard drive or CDROM, then are decompressed before being displayed. This decompression is very CPU intensive, and displaying the resulting video pushes the limits of the peripheral bus (usually ISA, VLB or PCI) and video cards. If any of the hard drive/CDROM reader, CPU, bus or video card can't keep up with the high amount of data, the video clip appears choppy, or is displayed very small.

The software or hardware that performs the decompression (or compression when recording video) is called a codec (compression- decompression). Dedicated hardware codecs are available either as add-in cards or are integrated into video cards. The advantage of such hardware is that it is optimized specifically for the quick decompression and display of video data, so can provide higher frame rates and larger images than a computer using a purely software-based codec routine. Hardware codecs also reduce the computing load on the system CPU, allowing it to perform other tasks.

Several types of compressed video formats exist, including MPEG (Motion Pictures Experts Group), AVI, MOV, Indeo, MS-Video, Cinepak and Quicktime. In addition, different versions of these formats exist, some incorporating sound. Under optimal conditions, some of these formats can provide compression ratios of up to 100:1 while still providing good quality video.

Some hardware codecs are optimized to work best with a particular video format, but most support the basic operations required to display compressed digital video streams.

Any given digital video accelerator may support some or all of the following operations:

Codec - Decompression of compressed video from various formats.

Colour space conversion - Conversion of the video signal from YUV colour space to computer-display-compatible RGB. The YUV colour space is derived from the composite video signal that is the source of most video clips.

Image clipping, filtering and scaling - Filtering reduces the amount of graininess in the image. Scaling can be of different types:

Pixel replication - This simply means that pixels are doubled in both the x and y directions - a 320x240 image is displayed as a 640x480 image with larger pixels. This results in poor quality video.

Pixel interpolation - Uses an image processing filter (usually an averaging algorithm) to interpolate pixel values. This provides a smoother image than direct pixel replication.

Some of the new video cards provide a degree of hardware acceleration for video playback, while others claim to provide full-screen 30 fps video but don't have the necessary hardware. My advice is to test drive any card that you are considering in a machine that is similarly configured to your own before buying.

 

Continue to:













TOP
previous page: 32 How does a video accelerator work, and will one help me?
  
page up: PC Video FAQ
  
next page: 34 How does a 3D graphics accelerator work?