data compression. compression? compression refers to the ways in which the amount of data needed to...

16
Data Compression

Upload: lewis-miller

Post on 02-Jan-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Data Compression

Page 2: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Compression?

Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This can help to reduce the amount of storage space needed to store your animation files and also to reduce the bandwidth needed to play them back.

Lossy/Lossless compression Spatial/Temporal compression Compression features both software(Codec, compression

algorithm) and hardware side(chips, graphic card).

Page 3: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Lossless Compression

encodes and decodes the data perfectly the resulting image matches the original image perfectly no degradation, no data loss Run Length Encoding, Huffman coding, LZW( for GIF) Strategy : the more frequently used, the less data storage is

used AAAABBBBBBCCCCEEE -> 4A6B4C3E For Images with high degree of detail that shouln’t be lost For computer generated graphics with large areas of the same

color

Page 4: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Lossy Compression

Allows redundant and nonessential information to be lost Removes data from an image that the human eye

wouldn’t notice There us a tradeoff between compression and image

quality Continuous tone images with complex shapes and

shading More complicate algorithm JPEG, MPEG

Page 5: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Spatial Compression

Techniques that operate on a single still image compression

Has both lossy & lossless compression

Page 6: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Temporary Compression ( Inter-Frame Compression)

Compression applied to a sequence of video frames, rather than a single image.

Strategy: To save on space by recording only the areas of the image that have changed.

Keyframe : frames of which information is fully stored to judge the differences in the scene in-between two keyframes

Delta frame : Frames that record only those pixels that have changed since the previous frame

Excessive use of keyframes will restrict the potential compression achieved.

Where rapid motion exists in the sequence temporal compression can introduce undesirable artifacts

Page 7: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

File Format

A standard means of storing data Computer memory stores numbers in linear memory Any additional information like rows, cols., bits/pixel must be

stored with the “data” - typically as a “header” Directly related to software and compression algorithm Many file formats use compression to reduce the file size of

bitmap images. - GIF, TIFF, PNG, JPG Header

Data

TagTag

Page 8: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Image File Formats - GIF

Graphics Interchange Format

8 bits TOTAL/image (256 colors maximum)

- Built in lossless compression

- Has transparancy & interlacing features

- Gif89a allows for easy animation

- Better suited for line-art, cartoons,graphs etc. (as compared to JPEG)

•Cons: Limited bit depth

Page 9: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Image File Formats - JPEG

Joint Photographic Experts Group (JPEG) format to display photographs and other continuous-tone images on the

Web. supports CMYK, RGB, and Grayscale color modes does not support alpha channels. retains all color information in an RGB image but compresses file

size by selectively discarding data. (Lossy)

A higher level of compression results in lower image quality, and a lower level of compression results in better image quality.

Page 10: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Workflow of baseline JPEG encoding

Transform image to luminance/chrominance color space(YCbCr)

Reduce the color component( subsampling by 2)(1st lossy procedure)

Partition image into 8*8 pixel blocks and perform DCT on each block

Quantize resulting DCT coefficients(2nd lossy procedure)

Entropy code the reduced coefficients(lossless)

Page 11: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Image File Formats - PNG

Developed as a patent-free alternative to GIF Portable Network Graphics (PNG) format for lossless compression and for display of images on the World

Wide Web. Unlike GIF, PNG supports 24-bit images and produces

background transparency without jagged edges some Web browsers do not support PNG images. supports RGB, indexed-color, grayscale, and Bitmap-mode

images without alpha channels. preserves transparency in grayscale and RGB images.

Page 12: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Image File Formats - TIFF

Tagged-Image File Format used to exchange files between applications and computer

platforms. - 8 bits/channel (24 bits for color) - Lossless image compression (2:1) - CMYK, RGB, Lab, indexed-color, and grayscale with alpha

channels - Newer versions allows for additional compression techniques

(JPEG) and color spaces - for scanner - big in file size

Page 13: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Data rate / Bandwidth

Data Rates - the amount of data per second that has to flow to play back that sequence smoothly.

Ex. 720 by 576 uncompressed PAL video the data rate is 1.244 Mb per image × 25 frames per second = 31.1 Mb/s.

Bandwidth - the ability of a system to deliver data. Data rate of a data stream (like a digital video file) > bandwidth of playback – not smooth

Data rate of a data stream (like a digital video file) < bandwidth of playback –smooth

Uncompressed, broadcast-quality video requires 160 megabits per second (Mbps) of network bandwidth. Uncompressed, CD-quality audio requires approximately 2.8 Mbps.

Page 14: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

MPEG (Moving Picture Experts Group) image compression standards

MPEG is similar to JPEG (for individual frames) but exploits temporal redundancy (between frames) as well by estimating motion between frames.

MPEG-1 - upto 1.5 Mbit/sec (Video CD)

MPEG-2 -> 4Mb/sec – HDTV/DVD standard

MPEG-4 - content based/MULTIMEDIA

Page 15: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Considerations in video compression

Delivery method( CD, Internet(broadband), Internet(modem))

Image quality(color depth), Output data rate, number of Key frame

Codec compatibility

Page 16: Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This

Codec Comparison