SOURCE CODING: IMAGE AND VIDEO
Image and Video Formats – GIF, TIFF, SIF, CIF, QCIF Image compression: READ, JPEG Video Compression: Principles-I,B,P frames, Motion estimation, Motion compensation, H.261, MPEG standard
• All types of images are displayed ( and printed ) in the form of a two dimensional matrix of individual picture elements – known as pixels or some time pels. • For example VGA ( video graphics array ) is a common type of display and , so we show in fig , consists of a matrix of 640 horizontal pixels by 480 vertical pixels with, for example 8 bits per pixel which allows each pixel to have one of 256 different colors.
• The graphics interchange format is used extensively with the Internet for the representation and compression of graphical images
• Although colour images comprising 24-bit pixels are ed GIF
reduces the number of possible colours that are present by choosing 256 entries from the original set of 224 colours that match closely to the original image • Hence instead of sending as 24-bit colour values only 8-bit index to the table entry that contains the closest match to the original is sent. This results in a 3:1 compression ratio • The contents of the table are sent in addition to the screen size and aspect ratio information •The image can also be transferred over the network using the interlaced mode.
• The LZW can be used to obtain further levels of compression
1/8 and 1/8 of the total compressed image
• GIF also allows an image to be stored and subsequently
transferred over the network in an interlaced mode; useful over either low bit rate channels or the Internet which provides a variable transmission rate
Further ¼ and remaining ½ of the image
The compression image data is organized so that the decompressed image is built up in a progressive way as the data arrives •
• RGB - 24 or 48 bits, • 16 bits are used for each R,G,B colors • For TIF files, most programs allow either no compression or LZW compression • Code number indicates particular format • Code 1- uncompressed format • Codes 2,3,4- digitized format
Color Signals Three properties of a color -Brightness: amount of energy that stimulates the eye - Hue (Tint):actual color of source(each color-different freq) - Saturation: represents strength of the color. Color production: an equation of R, G, and B - 0.299 R + 0.587 G + 0.114 B where, 0.299+0.587+0.114=1 Luminance refers to the brightness of a source, the hue & the saturation called, chrominance characteristics -say, luminance Ys = 0.299 Rs + 0.587 Gs + 0.114 Bs Ys: magnitude of luminance signal Rs, Gs, Bs: magnitudes of three major colors Two color difference signals: Blue chrominance Cb and Red chrominance Cr -
Cb = Bs-Ys, Cr = Rs -Ys
11
Chrominance Components Composite Video Signal for Transmission - Ys, Cb, and Cr signals are combined together and signal differences are scaled down before transmission In PAL - Y = 0.299 R + 0.587 G + 0.114 B - U(Cb) = 0.493(B-Y) = -0.147R-0.289G+0.437B - V(Cr ) = 0.877(R-Y) = 0.615R-0.515G-0.1B In NTSC - Y = 0.299 R + 0.587 G + 0.114 B - I(Cb) = 0.74(R-Y)-0.27(B-Y) = 0.599R-0.276G-0.324B - Q(Cr ) = 0.48(R-Y)+0.41(B-Y) = 0.212R-0.528+0.311B
12
Advantages of DV Easy to store in computer Easy to edit and integrate with other types Easy to digitize three RGB component signals The resolution of eyes are less sensitive for color than it is for luminance. Hence, two chrominance signals can tolerate a reduced resolution Transmission bandwidth is achieved by using the luminance and two color difference signals, instead of the RGB signals directly. CCIR-601 Recommendations: standard for the digitization of video pictures 13
4:2:2 format(CCIR-601)
Recommendation for use in TV studio Three component (analog) video signals may have bandwidths up to 6Mhz for the luminance ⇒ 12Mhz sps less than 3Mhz for the two chrominance signals ⇒ 6 Mhz sps In reality, 13.5M sps for luminance, 6.75 M sps for the two chrominance signals
Y Cb Cr
In NTSC(525-line) system, total line sweep time 63.56μsec = retrace time 11.56 μsec + an active line sweep time 52 μsec
In PAL(625-line) system, total line sweep time 64μsec = retrace time 12 μsec + an active line sweep time 52 μsec Line sampling rate:Orthogonal samplingLine sampling rate: 52× 10-6× 13.5× 106 = 702 samples/line 52× 10-6× 6.75× 106 = 351 samples/line In reality, 720 samples/line In reality, 360 samples/line
4Y samples for every 2Cb and 2Cr samples(4:2:2) 14
4:2:2 Format Bit Rate & Storage (NTSC 525-line) PAL
ine l 5 62
The number of active (visible) lines: 480 576 The number of samples per line: 720 720 ⇒ Resolution of luminance Y = 720× 480 720× 57 7 5 × 0 6 Two chrominance signals C = C = 360× 480 36 b
r
6 for both C & C Line sampling rate: 13.5sps for Y & 6.75sps b r
Bits per sample: 8 bits ⇒ Bit rate per line = 13.5× 106× 8 + 2× (6.75× 106× 8) = 216Mbps ⇒ Bits per line = 720× 8 + 62× (360× 8) = 11.52Kbits its b 57 M 5 ⇒ Bits per frame = 480× 11.52 = 5.5296Mbits 6.6355 ⇒ Bits for 1.5 hrs Video assuming 60 refresh rate = 5.5296× 60× 1.5× 3600 × 50 5 5 5 3 6.6 = 223.9488GBytes 15
4:2:0 Format used in Digital Broadcast Applications interlaced scanning with the absence of chrominance samples in alternative lines 525-line system Y = 720× 480(the same as 4:2:2 format), Cb = Cr = 360× 240 625-line system Y = 720× 576, Cb = Cr = 360× 288 bit rate per line: 13.5× 106× 8 + 2× (3.375× 106× 8) = 162Mbps
HDTV Format used in High-Definition Television (four times bit rate) 4/3 1440× 1152 pixels(50/60 Hz refresh rate) & 16/9 wide-screen 1920× 1152 pixels(25/30 Hz) with # of visible lines per frame 1080 16
SIF (Source Intermediate Format), 4:1:1 Format used in Video Cassette Recorders (VCRs) progressive (non-interlaced) scanning since it is intended for storage applications Half of 4:2:0 format: “Subsampling & Temporal Resolution” Uses half the refresh rate -temporal resolution Frame refresh rate- 30 Hz for 525 line system and 25 Hz for 625 line system.
525-line system Y = 360× 240, Cb = Cr = 180× 120 625-line system Y = 360× 288, Cb = Cr = 180× 144 bit rate per line 6.75× 106× 8 + 2× (1.6875× 106× 8) = 81Mbps
17
CIF (Common Intermediate Format), 4:1:1 format used in Video Conferencing applications also known as FCIF (Full Common Intermediate Format), spatial resolution of the SIF 625-line system plus temporal resolution of the SIF 525-line system Y = 360× 288, Cb = Cr = 180× 144 refresh rate: 30 Hz bit rate per line: 6.75× 106× 8 + 2× (1.6875× 106× 8) = 81Mbps many variants for videoconferencing using desktop PCs or ISDN/PSTN say, typically 4 or 16 64Kbps channels used 4CIF: Y = 720× 576, Cb = Cr = 360× 288 16CIF: Y = 1440× 1152, C = C = 720× 576
18
QCIF (Quarter CIF), 4:1:1 Format used in Video Telephony applications half spatial resolution of the CIF and either half or quarter temporal resolution of the CIF Y = 180× 144, Cb = Cr = 90× 72 refresh rate: 15 or 7.5 Hz bit rate per line: 3.375× 106× 8 + 2× (0.84375× 106× 8) = 81Mbps a lower version is typically used for single 64Kbps channel ISDN or PSTN with modems: sub-QCIF(SQCIF) Y = 128× 96, Cb = Cr = 64× 48 19
PC Video Digitization Digitization System Spatial Resolution Format 4:2:2 525-line Y = 640× 480, Cb = Cr = 320× 240 625-line Y = 768× 576, Cb = Cr = 384× 288
Temporal Resolution 60Hz 50Hz
SIF
Y = 320× 240, Cb = Cr = 160× 240 Y = 384× 288, Cb = Cr = 192× 144
30Hz 25Hz
CIF
Y = 384× 288, Cb = Cr = 192× 144
30Hz
QCIF
Y = 192× 144, Cb = Cr = 96× 72
15/7.5Hz
525-line 625-line
- Video capture board or S/W required - All PC monitors use “progressive (non-interlaced) scanning” 20
Since FAX machines are used with public carrier networks, the ITU-T has produced standards relating to them •
• These are T2(Group1), T3 (Group2), T4 (Group3) (PSTN), and T6 (Group 4) (ISDN) • Both use data compression ratio in the range of 10:1 • The resulting codewords are grouped into terminationcodes table (white or black run-lengths from 0 to 63 pels in steps of 1) and the make-up codes table (contains in multiples of 64 pels) • Since this codeword uses two sets of codeword it is known as the modified Huffman codes
ITU –T Group 3 and 4 facsimile conversion codes: terminationcodes •
Termination code table
• ITU –T Group 3 and 4 facsimile conversion codes: make-up codes Make-up of 64 codewords
Each scanned line is terminated with an EOL code. In this way the receiver fails to decode a word it starts to search for an EOL pattern •
• If it fails to decode an EOL after a preset number of lines it aborts the reception process and informs the sending machine • A single EOL precedes the end of each scanned line and six consecutive EOLs indicate the end of each page • The T4 coding is known as one-dimensional coding
The modified-modified relative element address designate coding explores the fact that most scanned lines differ from the previous line by only a few pels •
• E.g. if a line contains a black-run then the next line will normally contain the same run pels plus or minus 3 pels • In MMR the run-lengths associated with a line are identified by comparing the line contents, known as the coding line (CL), relative to the immediately preceding line known as the reference line (RL) • The run lengths associated with a coding line are classified into three groups relative to the reference line
mode
• This is the case when the run-length in the reference line(b1b2) is to the left of the next run-length in the coding line (a1a2), that is b2 is to the left of a1
Vertical mode
• This is the case when the run-length in the reference line (b1b2) overlaps the next run-length in the coding line(a1a2) by a maximum of plus or minus 3 pels
• This is the case when the run-length in the reference line (b1b2) overlaps the run-length (a1a2) by more than plus or minus 3 pels