Professional Documents
Culture Documents
Brought to You by
Part 1 of 4
MARCH 2004 www.securitysales.com A1
Part 1of 4
Essentials of
COMPRESSION
By Bob Wimmer
Video Security Consultants cctvbob@aol.com
DIGITAL VIDEO
Effective recording, retrieving, storing and transmitting are critical to exploit the full benefits and capabilities of digital video. The first place to start is with a solid knowledge of the methods and standards of video compression.
AT A GLANCE
Compression is the art of removing information the viewer does not need
Compression is necessary to maximize recording and the storing and transmitting of digital images
elcome to the first of a four-part series designed to educate readers on the fast and ever-changing world of digital video as found in the security industry. Part 1, brought to you by Honeywell Security, is designed to explain the need for video compression and the many different compression methods and standards used throughout most of the security industry.
Some methods eliminate irrelevant portions of images, while others nix redundant parts JPEG, MPEG and H.26* Series are
the most prevalent compression standards
The quality, speed and storage required by an application dictates compression choices
A2
There has always been a trade-off between the quality of video and file size. If you want the best quality in images, then you have to deal with an enormous file size. For example, by decreasing the file size by 50 percent, you lose some image quality but create a smaller file size that is more conducive to recording or transmitting video signals. By no means is the process behind compression easy; there is a tremendous amount of mathematical complexity required to establish the different compression methods. A quick description of the basic parts will help clarify some of the theory and explanations discussed later in this article.
Each image is assigned a numeric code in which common events or information are assigned only a few bits, while rare or uncommon events are assigned a larger amount of bits. The steps to create this data output stream are divided into signal analysis, quantization and variable-length encoding.
Video analyzer
Quantizer
Binary encoder
name lossless. However, this method can only achieve a modest amount of compression. The lossless compression of images is important in fields such as medical imaging and remote-sensing where data integrity is essential. Typically, compression ratios for lossless codes, including variable-length encoding, are listed as an average of 4:1 compression. In variable-length encoding, prior to the writing of the image, the informa-
tion is aligned according to frequency which plays an important role in the image compression process. For the most part, lower frequencies, which occur more often, are placed to the front while higher frequencies are placed at the end. In any file, certain characters are used more than others. In general, we can attain significant savings if we use variable-length prefix codes that take advantage of the relative frequencies of the symbols in the messages to be encoded.
Lossy
This image reconstruction contains degradation relative to the original. This is due to the discarding of redundant information but capable of achieving much higher compression.
Source: ACM
Lossless
The reconstructed image, after compression, is numerically identical to the original image. However, it can only achieve a modest amount of compression.
A3
Huffman compression is an example of variable-length encoding. Huffmans algorithm compresses files by assigning smaller codes to frequently used characters and longer codes to characters that are less frequently used. Using representation by binary codes (a sequence of zeros and ones that can uniquely represent a character), the number of bits required to represent each character depends on the number of characters that have to be represented. One bit can represent two characters. For example, 0 represents the first character and 1 represents the second character. Two bits can represent four characters, and so on.
Spatial reduction in the reduction between the correlation of neighboring pixel values.
Spectral reduction is the reduction between different color planes or bands within an image.
compressed. This method is usually associated with Moving Picture Experts Group (MPEG) and modified MPEG compression methods.
In the full image example (top ), each image is compressed and stored. In the conditional image example (bottom ), only changes are compressed and stored.
proven that small color changes are perceived less accurately than small changes in brightness, so why brother saving this information? It is also known that low frequency changes are more noticeable to the human eye than high frequency changes. (Low frequencies control the coarser of more noticeable conditions of an video image whereas higher frequencies are usually related to the finer details of a video image.) Redundancy reduction is accomplished by removing duplication from the signal source, which is found either within a single image or between multiple images of a video stream. The first of three redundancy reduction methods is labeled spatial reduction. This is the reduction of the correlation between neighboring pixel values. As seen in the illustration above, the data stream can be reduced to single values for each of the four quadrants. Although this is a very simple example, it shows one of the basic ways for redundancy reduction. The next reduction method is spectral reduction. This is the correlation between color planes or bands within an image. As an example, let us again look at the blue sky in the illustration above. Many areas of that sky have the same numeric value. Therefore, the amount
A4
of stored information to reproduce that same image can be reduced in the decompression mode of operation. The last area is known as temporal reduction. This is the correlation between adjacent frames in a sequence. This information is the bases for MPEG as well as H.26* series of compression methods. In temporal reduction, two types of image arrangements are viewed. The first one is a full representation of the viewed image. This is known as the Iframe and is encoded as a single image, with no reference to any past or future images. In some circles, it is also referred as the Key-frame. The concept behind the temporal method is if there is no movement then why bother saving the information? Conversely, any movement will be detected and the compression process will begin.
H.263/MPEG-2
H.264/MPEG-4 AVC
MPEG-1
MPEG-4 (version 1)
1992 1994 1996 1998
MPEG-4 (version 2)
2000 2002 2004
1990
Video compression standards have been around for almost two decades. H.264 and MPEG-4 AVC are the most recent developments.
tion matrix. It uses a set repetitive in shape, but not size.) DWT compresses an image by frequency ranges. It filters the entire image, both high and low frequencies, and repeats this procedure several times. Wavelet compression utilizes the entire image, which differs from many DCT methods.
the fact that small color changes are perceived less accurately than small changes in brightness. Thus, it is intended for compressing images that will be viewed by humans. Data compression is achieved by concentrating on the lower spatial frequencies. According to the standard, a modest compression of 20:1 can be achieved with only a small amount of image degrading. However, if you plan to machine analyze your information, the small errors generated by JPEG may cause errors. The Joint Photographic Experts Group has approved the next standard for image compression, known as JPEG2000, based on wavelet compression algorithms. By setting the mother wave for image compression and decompression ahead of time as a part of the standard, JPEG2000 will be able to provide resolution at a compression of 200:1.
MPEG Theory
20:1 up to 300:1. In todays CCTV industry, more and more manufacturers are turning to MPEG-4 for remote viewing of compressed video images. At press time, two additional standards, MPEG-7 and MPEG-21, were under consideration.
MPEG incorporates the same compression methods as JPEG (DCT ). However, MPEG is based on the group of images concept. The group of images is defined as the I-frame, PFrame and the B-Frame. The I-frame (intra) provides the starting or access point and offers only a small amount of compression. P-frames (predicted) are coded with reference to a previous picture, which can be either an I-frame or another Pframe. B-frames (bidirectional) are intended to be compressed with a low bit rate, using both the previous and future references. B-frames are never used as references. The relationship between the three frame types is described in the MPEG standard; however, it does not restrict the limit of B-frames between the two references, or the number of images between two I-frames. As previously mentioned, there are many different forms of MPEG standards. The MPEG-1 standard has a resolution of 352 X 240 pixels at 30 images a second and incorporates progressive
A6 www.securitysales.com MARCH 2004
scanning. It is designed for up to 1.5MBps with compression ratios listed as 27:1. The MPEG-2 standard has a resolution of 720 X 480 pixels and incorporates both progressive and interlaced scanning. (Interlaced scanning is the method used in the CCTV industry to produce images on monitors.) The most significant improvement over MPEG-1 is its ability to efficiently compress interlaced video. It is also capable of coding standard-definition television at bit rates from about 3MBps to 15MBps and high-definition television. Compression ratios for MPEG-2 vary. The ratio depends on the type of signal and the number of B, P and I frames. On average, this ratio can vary from 50:1 to 100:1. The MPEG-4 standard is used for multimedia and Web compression because it is designed for low bit-rate transmission. MPEG-4 is based on object-based compression. Individual objects within a scene are tracked separately and compressed together. This method offers a very efficient compression ratio that is scalable from
occurs, the smaller the overall file size of the images and the lower the image quality will be when decompressed. With the addition of JPEG2000 (mentioned previously), the approach taken by the Joint Photographic Experts Group is changing the way compression standards are being considered.
19kbyte JPEG
These photos show the improved image quality between JPEG and JPEG2000 with the same file size.
Storage in MB
there is one single item to keep in mind. The quality of the reproduced image whether from a storage device such as a DVR or a remote location will depend on the application of that system. Not every standard or compression method is designed to match all requirements. When selecting your system, keep in mind that if the image quality, speed of remote viewing and storage requirement is what you expected, then you have made the right choice. The next installment of this fourpart series will cover storage devices and their applications in the world of digital video.
Robert (Bob) Wimmer is president of Video Security Consultants and has more than 33 years of experience in CCTV. He has been a training consultant for several of the industrys leading CCTV manufacturers and other organizations. He has also written numerous articles on CCTV applications and advancing equipment technology.
H.264
The storage requirement of 90 minutes of DVD quality video is more than twice as much for MPEG-2 than it is for H.264.
Courtesy of EE Times
A7
Fusion is more than a standard DVR Series. It is an intelligent, world-class digital management system combining multiplexing, motion detection, audio, text insertion, mapping and remote notification into one extremely versatile, upgradeable unit.
8 to 32 camera units Capture rates up to 480 ips Live viewing up to 480 ips Multiplexed analog output Remote accessibility/notification Text insertion interface
With its advanced compression algorithms, fast capture rates and flexible GUI, Fusion is truly the next generation of DVR technology.
Display maps of facilities Smart Search Index Search Easy installation and operation
For more information on these and other Honeywell Video Systems products, please call our Sales Support Center at 1.800.796.CCTV. Reader Service Card No. 103
www.honeywellvideo.com