Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesCompression Scorecard


Ma y 1995 / State Of The Art / Compression Scorecard

Confused about compression? Here's how the leading codecs stack up for speed and image quality.

John Bryan

Video compression is like life: It's impossible to be too thin or too rich. In the video world, crash diets and wealth take the form of new algorithms that reduce video to its essence but keep it looking as rich as the original image. Packing video data tighter means it will look more realistic when its played back on affordable video hardware, or better yet, on the same hardware that's sitting on our desktops crunching data and processing words.

A number of compression schemes exist, each with its strengths and weaknesses. For example, just because Radius's Cinepak shines for high-motion video clips, don't expect it to be tops for a low-motion "talking-head" clip; image quality is sharp a nd few codecs (compressor/decompressors) work better than the venerable Video 1 when images change little from frame to frame.

Video compression is vital to anyone using digital video, whether you're a developer of CD-ROM titles and videoconferencing systems or a creator of corporate presentations and training tools. The codecs you choose for each project will determine how good the images look and how smoothly they flow when your audience watches them.

Compression Camps

Compression methods fall into camps. Some rely entirely on software codecs, and others use a combination of software and dedicated processors. Hardware-assisted compression algorithms have one terrific advantage over the software approach: speed. Plug in an MPEG board, and you can decompress video at the same rate and image quality as that of a VCR tape. Besides high cost, the downside to hardware-assisted compression is you gamble that all the potential viewers of your MPEG-compressed video will have th e proper MPEG decoder on his or her machine.

What's the benefit of the software approach? Cost. Some leading software codecs come bundled in products like Microsoft's Video for Windows, or you can download them from a BBS. Also, the performance inferiority of software codecs is fading as Pentiums, Power Macs, and local-bus systems become the norm. The easy distribution of software codecs increases the chances that your intended audience will be able to view your video product.

How It's Done

Most compression algorithms divide a video frame into blocks and then look for redundant data. This is known as intraframe analysis. In interframe analysis, algorithms make the same kinds of comparisons between frames. The algorithms then drop redundant data to reduce the overall size of the video file. This technique is called lossy compression, and it's used by all the major video codecs. In general, the more you compress a frame or data stream, the more losses there are. The trick is to balance the compression ratio with the resulting image quality.

Codecs may be either symmetric or asymmetric. A symmetric algorithm uses an equal amount of time for compression and decompression and is common in real-time video capture in such applications as videoconferencing. Asymmetric codecs take more time in the compression stage to try for the highest level of belt tightening possible and work best for presentations or CD-ROMs.

Once a codec saves the nonredundant data, it statistically processes the arrangement of pixels in an image. These statistical data arrangements become encoded with an RLL encoding scheme or an equivalent, with shorter codes assigned to repetitive data.

The codec then may use a variety of compression methods. Two popular ones are DCT (discrete cosine transform) and VQ (vector quantization). Both use wave equations or a similar mathematical concept. The frame is divided into blocks, generally 8 by 8 pixels each, and the transform mechanisms work on the in dividual blocks.

DCT converts pixel intensities to a frequency-based equivalent. The transform yield is a series of numbers that represent ever-finer detail in a pixel block. Compression comes by eliminating the representative numbers after a certain point in the series. The result is a loss of fine detail, but ideally that level of detail won't be detectable. MPEG codecs use DCT.

VQ uses vectors to select predefined equations. Codecs can tune quantization so that block color and intensity are handled differently on a discreet basis and in relationship to the surrounding image values. Both Cinepak and Indeo use VQ for intraframe compression. One benefit of the VQ algorithm is that it is based on a table comparison process to provide fast performance on high-end 486s and Pentiums.

Other less widely used compression methods exist beyond DCT and VQ, including fractal-image compression, a proprietary technology developed by Integrated Systems' Michael Barnsley (for details, see "Fractal Image Compression," October 1993 BYTE). An enhancement of the still-image JPEG standard, M-JPEG (motion JPEG) compresses every frame individually for high image quality.

The result of the transform process is then compressed via RLE (run-length encoding). Codecs compress these bit strings even further by scanning the patterns at a different angle and converting the values to RLA (run length/amplitude) tokens. Huffman coding then converts the most frequently occurring tokens into the shortest bit strings.

Codecs use these compression transforms for intraframe compression. Interframe compression is largely a subtractive process that a general-purpose CPU can handle.

Microsoft and Apple, with Video for Windows and QuickTime, respectively, influence the compression world, although they don't specifically provide their own codecs. The AVI (Audio Video Interleave) format in Video for Windows provides a standard file format for developers. Video for Windows includes Cinepak, Indeo, and Microsoft's RL E and Video 1.

QuickTime for Windows and QuickTime for the Macintosh support Indeo, Cinepak, and MPEG decompression boards. QuickTime for Windows files and Video for Windows files aren't compatible.

How to Choose?

To pick a codec, first decide if your audience is likely to have dedicated video hardware or general-business computers. Then select an appropriate resolution and color depth, depending on the subject of the video. Finally, process your video with a variety of codecs to compare image quality. With your eye as the final judge, your video files should be both thin and rich with impact.


PRODUCT INFORMATION


Cinepak                       Free to developers

Radius
Sunnyvale, CA
(800) 227-2795
(408) 541-6100
fax: (408) 541-6150


Indeo 3.23                    Free to developers

Intel
Santa Clara, CA
(800) 538-3373*
fax: (800) 628-2283*
BBS: (9
16) 356-3600
*Accommodates international access


Truemotion S

   
$.50 per CD or 2 percent of revenue (whichever is higher); 
   $5000 prepaid royalty required. 
   Corporate site license of playback software: $25 per PC (100 PC minimum).

Horizons Technology, Inc.
San Diego, CA
(800) 828-3808
(619) 277-7100
fax: (619) 292-9439


Video 1

   
Part of Video for Windows bundle, not sold separately.

Microsoft
Redmond, WA
(800) 426-9400
(206) 882-8080
fax: (206) 936-7329


XingCD                        $995

Xing Technologies Corp.
Arroyo Grande, CA
(800) 294-6448
(805) 473-0145
fax: (805) 473-0147


VIEW BEFORE YOU CHOOSE

For more comparative information about codecs, consider Doceo
Publishing's Video Compression Sampler. This $99 CD offers
side-by-side playback capabilities for a number of software codecs.
The sampler includes video test files. The program keeps statistics
ab
out key frame settings, frame rates, compression quality, and
average data rate for each codec. Doceo is at (404) 876-8954.




COMPRESSION QUALITY

To reflect real-world use, we compressed MPEG images at 30 fps
(frames per second) at a data rate of 150 KBps; all others were 15
fps at 290 KBps. This means the upper-right MPEG example compressed
four times more data, which accounts for the blurriness. The
lower-right box compares a software-only and an expensive
hardware-assisted MPEG codec.



Cinepak Software-only, uses vector quantization. Originally developed by SuperMac Technologies, now owned by Radius. ADVANTAGES Supports a wide range of platforms, including Windows and the Macintosh. Part of Video for Windows and QuickTime codec libraries. Uses a palette of 16.7 million colors. DISADVANTAGES Dithers to simulate colors in 8-bit mode. Host computer's pr ocessor and bus type determine performance. APPLICATIONS For high-motion video, among the best overall quality and fastest performance, although Indeo 3.23 is only slightly slower. Not as sharp as Indeo for low-motion video. Works best for 320- by 240-pixel displays, quality degrades at the lower resolutions. Fuzzy images mean it's not the best option for animated sequences.
Indeo 3.23 Intel's vector-quantization software-based descendent of DVI. Compression technology for Intel's videoconferencing products. Can handle DCI adapters. Version 4.0 planned for later this year. ADVANTAGES Palette uses 16.7 million colors. Supports Windows, Macintosh, and IBM's Ultimedia OS/2 R2.1 and Video In. Part of Video for Windows and QuickTime codec libraries. DISADVANTAGES Dithers to simulate colors in 8-bit mode. Host computer's processor and bus type determine performance. APPLICATIONS Among t he best in performance and quality for high-motion video. Performs well on low-motion videos at virtually all resolutions. Better palette handling in 8-bit mode than Cinepak. Indeo is best choice when working with resolutions lower than 320- by 240-pixels. Fuzzy animations.
MPEG MPEG-1, MPEG-2 (currently used primarily by the broadcast industry), and MPEG-4 (for video telephony) developed by the ISO Motion Picture Experts Group. Based on lossy asymmetric compression algorithms. Designed to be played back with dedicated hardware, although software-only playback products are starting to appear. ADVANTAGES Produces VCR-quality video at full-motion (30 fps) rates. Can achieve a compression ratio of up to 200:1. DISADVANTAGES Hardware-based playback limits distribution to suitably equipped computers. Not a Video for Windows codec. APPLICATIONS Limited-distribution applications where playback hardwa re is known and sharp image quality is important (i.e., training, presentations, and kiosks).
Truemotion S From Horizons Technology, uses a scalable algorithm that runs under Video for Windows. Software only. Capable of 640- by 480-pixel video at 30 fps on Pentium-class systems, although performance on 486s is much slower. Supports Windows, DOS, and Macintosh. ADVANTAGES Can run at resolutions and color depths higher or lower than the original. DISADVANTAGES Performance is dependent on the host processor and bus type. APPLICATIONS Scalability makes it suitable for a range of applications, from mass-market CD-ROM titles to high-end uses, such as sending multimedia over LANs.
Video 1 Software-based, part of the Video for Windows codec library. Originally developed by Media Vision, now owned by Microsoft. Uses the proprietary Mo tive technology for intraframe compression. ADVANTAGES Doesn't dither in low-color settings. DISADVANTAGES Lower quality than Indeo and Cinepak. Breaks up in high motion. APPLICATIONS Mass-market multimedia products and low-end machines. Works best for low-motion video sequences and animations.
XingCD -- MPEG XingCD is a software-based MPEG compression program. Image on right was compressed with FutureTel's PrimeView II, a $17,000 hardware-assisted MPEG codec. ADVANTAGES OF XINGCD Performs MPEG compression with conventional processors, such as a 486 or Pentium. The $995 price is low compared to MPEG codecs using dedicated processors (which cost from $2000 to over $50,000). DISADVANTAGES OF XINGCD Not Video for Windows compatible. Compression takes 10 to 100 times the length of playback time. APPLICATIONS FOR XINGCD Multimedia CD-ROM developers. N ote: Quality samples and test-result interpretations were derived from the video compression sampler by Jan Ozer, author of "Video Compression for Multimedia" (Academic Press).

Compression Quality

photo_link (153 Kbytes)

These photos show the differences in compression quality between the packages we looked at.


John Bryan is a technology writer and consultant based in San Jose, California. You can reach him on BIX or the Internet at editors@bix.com .

Up to the State Of The Art section contentsGo to previous article: Analog, Hands OnGo to next article: Video ConnectionsSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network