121
ب خ ت ن م هاد ن در دارد م ل ع م ل دو عا ن ی ا ر ص ت خ م روف ح دارد در ر م یر ن ها ج وان وی ن ر غ ی ن ا ن س

این دو عالم علم دارد در نهاد منتخب       وان جهانی رمز دارد در حروف مختصر

  • Upload
    nitsa

  • View
    34

  • Download
    3

Embed Size (px)

DESCRIPTION

این دو عالم علم دارد در نهاد منتخب       وان جهانی رمز دارد در حروف مختصر سنایی غزنوی. Image/Video Compression & VOD. برنا فيروزي نويد زرين درفش محمود قديمي مهندسي فناوري اطلاعات بهار 88. Image Compression. Compression. - PowerPoint PPT Presentation

Citation preview

Page 1: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

منتخب نهاد در دارد علم عالم دو       اینمختصر حروف در دارد رمز جهانی وان

غزنوی سنایی

Page 2: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image/Video Compression & VOD

فيروزي برنادرفش زرين نويد

قديمي محمود

فناوري مهندسياطالعات

88بهار

Page 3: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image Compression

3

Page 4: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Compression

( سازی که( Compressionفشرده است پردازشی ،عالیم به را ها داده اضافی، اطالعات حذف با

. دهد می کاهش دیجیتالی برای نیاز مورد باند پهنای به بسته پردازش این

ها داده سازی، ذخیره فضای میزان و ها داده انتقال . دهد می کاهش را

های داده انتقال امکان نیاز مورد باند پهنای کاهش . دهد می واحد زمان یک در را بیشتری

( افزونگی (redundancyكاهش4

Page 5: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

،آنالوگ ديجيتال

شود مي انجام ديجيتال فضاي در تصاوير پردازش

قبل بايد باشيم داشته آنالوگ تصويري منبع يك ما اگربه را آن به ابتدا سازي فشرده عمل هر انجام از

كنيم تبديل ديجيتال

5 5

Page 6: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Purpose of Image Compression

Saving storage space Saving transfer time Easy processing Easy to transmitted over network reduce cost

6

Page 7: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

هدف

خواستار ما آل ايده حالت در تصوير كيفيت حداكثر منابع پردازش و سازي ذخيره فضاي حداقل

شرايط بهترين در را هدف دو هر توانيم نمي ماباشيم داشته

است؟ چگونه سازي فشرده بهترين

7

Page 8: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Why we want to compress?

To transmit an RGB 512X512, 24 bit image via modem 28.2 kbaud(kilobits/second)

min) 4( second213)second/10248.28(

)/24)(512512(

bits

pixelbitspixels

8

Page 9: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image Compression

lossless compression

Huffman Coding

Run-length encoding

lossy compression

Predictive Coding Transform Coding

Image Compression Coding

9

Page 10: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

سازي فشرده اصلي كالس دوتصاوير

Lossless( اتالف ) بدون تصوير ديتاهاي روي از

دقيقا توان مي شده ذخيرهاصلي به رسيد تصوير

از بدون شده ذخیره تصویرداده كمترين دادن دست

. است تصویر خود ای،Compression rate:

2:1 (at most 3:1)

) Lossy (پراتالف تصوير ديتاهاي روي از

به توان مي شده ذخيرهتصوير نزديكتصويري به

رسيد اصلي خود شده ذخیره تصویر

بلکه نیست، اصلی تصویراطالعاتی و است آن شبیه

است داده دست از را

Compression rate: high compression 10

Page 11: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

General compression system model

Input image Output image

Encoder

Source encoder

Channel encoder Channel decoder

Source decoder

Channel

Decoder

11

Page 12: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Compression System Model

Compression

InputInput PreprocessingPreprocessing EncodingEncoding CompressedFile

CompressedFile

OutputOutputPostprocessingPostprocessingDecodingDecodingCompressedFile

CompressedFile

• Decompression

12

Page 13: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Compression Ratio

Ex Image 256X256 pixels, 256 level grayscale can be compressed file size 6554 byte.

Original Image Size = 256X256(pixels) X 1(byte/pixel)

= 65536 bytes

RCSizeFileCompressed

SizeFileedUncompressRationCompressio

106554

65536Rationcompressio

13

Page 14: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Bits per Pixel

Ex Image 256X256 pixels, 256 level grayscale can be compressed file size 6554 byte.

Original Image Size = 256X256(pixels) X 1(byte/pixel)

= 65536 bytesCompressed file = 6554(bytes)X8(bits/pixel)

= 52432 bits

PixelsofNumber

BitsofNumberPixelperBits (2)

8.065536

52432PixelperBits14

Page 15: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Key of compression

Reducing Data but Retaining Information

Various amounts of data can be used to represent the same amount of information. It’s “Data redundancy”

RD C

R1

1

Relative data redundancy

15

Page 16: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Entropy

Average information in an image.

1,,1,0, Lkwheren

np k

k

1

0

L

kkka plL

1

02 )(log

L

kkk ppEntropy

• Average number of bits per pixel

16

Page 17: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Compression Standard

Standard:

Image Video

ISO JPEGJPEG2000

MPEG1,MPEG2, MPEG4, MPEG7

ITU N/A H.261, H.263, H.263+, H.26L

17

Page 18: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image Compression

lossless compression

Huffman Coding

Run-length encoding

lossy compression

Predictive Coding Transform Coding

Image Compression Coding

18

Page 19: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Loseless Compression

No data are lost Can recreated exactly original image Often the achievable compression is mush less

19

Page 20: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Huffman Coding ( VLC,Entropy)

Using Histogram probability 5 Steps

1. Find the histogram probabilities

2. Order the input probabilities(smalllarge)

3. Addition the 2 smallest

4. Repeat step 2&3, until 2 probability are left

5. Backward along the tree assign 0 and 1

20

Page 21: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Huffman Coding(cont)

Step 1 Histogram Probability 40302010

0 1 2 3

p0 = 20/100 = 0.2p1 = 30/100 = 0.3p2 = 10/100 = 0.1p3 = 40/100 = 0.4

p3 0.4p1 0.3p0 0.2p2 0.1

Step 2 Order

21

Page 22: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Huffman Coding(cont) Step 3,4 Add 2 smallest

2

0

1

3

p

p

p

p

1.0

2.0

3.0

4.0

3.0

3.0

4.0

6.0

4.04.0

6.0

Natural Code Probability Huffman Code

00 0.2 010

01 0.3 00

10 0.1 011

11 0.4 1

Step 5 assign 0 and 1

22

Page 23: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Huffman Coding(cont)

The original Image :average 2 bits/pixel The Huffman Code:average

3

02 )(log

iii ppEntropy

)4.0(log)4.0()1.0(log)1.0(

)3.0(log)3.0()2.0(log)2.0(

22

22

pixelbits /846.1

9.1)4.0(1)1.0(3)3.0(2)2.0(33

0

i

iia plL

23

Page 24: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Run-length encoding (RLE) is a very simple form of data compression in which runs of data (that is, sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original run. This is most useful on data that contains many such runs: for example, relatively simple graphic images such as icons, line drawings, and animations.

Run Length Encoding

24

Page 25: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Run-Length Coding

Counting the number of adjacent pixels with the same gray-level value

Used primarily for binary image Mostly use horizontal RLC

25

Page 26: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Run-Length Coding(cont)

Binary Image 8X8

00000000

00101111

01100100

01001110

00111110

00000110

00001111

00000000

horizontal

1st Row 8

2nd Row 4,4

3rd Row 1,2,5

4th Row 1,5,2

5th Row 1,3,2,1,1

6th Row 2,1,2,2,1

7th Row 4,1,1,2

8th Row 8

26

Page 27: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Example of RLE

Let us take a hypothetical single scan line, with B representing a black pixel and W representing white:

WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW If we apply the run-length encoding (RLE) data compression

algorithm to the above hypothetical scan line, we get the

following:12W1B12W3B24W1B14W

27

Page 28: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Lossy Compression

Allow a loss in the actual image data Can not recreated exactly original image Commonly the achievable compression is

mush more Such as JPEG

28

Page 29: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

DM (Delta Modulation)

DPCM (Differential Pulse Code Modulation)

Predictive Coding

Common Predictive Coding

29

Page 30: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

The system consists of an encoder and a decoder, each containing an identical predictor. As each successive pixel of the input image, is introduced to the encoder, the predictor generates the anticipated value of that pixel based on some number of past inputs. The output of the predictor is then rounded to the nearest integer.

The principle of Predictive Coding

30

Page 31: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Predictive coding model I

Input image

Predictor

n Symbol encoder

Symbol decoder

‘Output image

Predictor

nf̂

'nf

nf

'ˆnf

Compressed image

Input image

Predictor

n Symbol encoder

Symbol decoder

‘Output image

Predictor

nf̂

'nf

nf

'ˆnf

Compressed image

31

Page 32: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

The predictor : ),,,(ˆknnnn fffFf 21

nnn ff ˆ

The symbol encoder : generate the next element of the compressed data stream

Decoder : perform the inverse of encoding

1

1

21 k

n

lkkkknnnn afafffFf ,),,,(ˆ

The linearity predictor :

Predictive coding model II

32

Page 33: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Delta Modulation I

Delta modulation (DM or Δ-modulation) is an analog-to-digital and digital-to-analog signal conversion technique used for transmission of voice information where quality is not of primary importance. DM is the simplest form of differential pulse-code modulation (DPCM) where the difference between successive samples is encoded into n-bit data streams. In delta modulation, the transmitted data is reduced to a 1-bit data stream.

33

Page 34: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Differential Pulse Code Modulation

Differential Pulse Code Modulation (DPCM) compares two successive analog amplitude values, quantizes and encodes the difference, and transmits the differential value.

34

Page 35: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Transform Coding I (DCT)

Transform coding is a type of data compression for "natural" data like audio signals or photographic images.

The transformation is typically lossy, resulting in a lower quality copy of the original input.

35

Page 36: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Transform Coding II

36

Page 37: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Transform Coding III

A transform coding system

Input image Forward

transform

Quantizer Symbol

encoder

Construct

subimages

Compressed

image

Merge

subimages

Symbol

decoder

Compressed

image Inverse

transform

37

Page 38: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

BMP (Bitmap) - lossless

Use 3 bytes per pixel, one each for R, G, and B

Can represent up to 224 = 16.7 million colors

No entropy coding File size in bytes =

3*length*height, which can be very large

Can use fewer than 8 bits per color, but you need to store the color palette

Performs well with ZIP, RAR, etc.

38

Page 39: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

GIF (Graphics Interchange Format)

Can use up to 256 colors from 24-bit RGB color space– If source image contains

more than 256 colors, need to reprocess image to fewer colors

Suitable for simpler images such as logos and textual graphics, not so much for photographs

39

Page 40: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

JPEG (Joint Photographic Experts Group) - lossly

Most dominant image format today

Typical file size is about 10% of that of BMP (can vary depending on quality settings)

Unlike GIF, JPEG is suitable for photographs, not so much for logos and textual graphics

40

Page 41: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

The name "JPEG" stands for Joint Photographic Experts Group, the name of the committee that created the standard. The group was organized in 1986, issuing a standard in 1992, which was approved in 1994 as ISO 10918-1. JPEG is a commonly used method of compression for photographic images. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality.

Joint Picture Expert Group

41

Page 42: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

JPEG2000

JPEG 2000 is a wavelet-based image compression standard. It was created by the Joint Photographic Experts Group committee in the year 2000 with the intention of superseding their original discrete cosine transform-based JPEG standard (created about 1991).

42

Page 43: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

JPEG Encoding Steps

Preprocess image

Apply 2D forward DCT

Quantize DCT coefficients

Apply RLE, then entropy encoding

43

Page 44: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

JPEG Block Diagram

FDCT

SourceImage

QuantizerEntropyEncoder

TableTable

Compressedimage data

DCT-based encoding

8x8 blocks

R

B

G

44

Page 45: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image Compression- JPEG

Using the DCT, the entries in Y will be organized based on the human visual system.

The most important values to our eyes will be placed in the upper left corner of the matrix.

The least important values will be mostly in the lower right corner of the matrix.

Semi-

Important

Most

Important

Least

Important

45

Page 46: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

JPEG

8 x 8 Pixels Image

46

Page 47: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image Compression

Gray-Scale Example: Value Range 0 (black) --- 255 (white)

63 33 36 28 63 81 86 98

27 18 17 11 22 48 104 108

72 52 28 15 17 16 47 77

132 100 56 19 10 9 21 55

187 186 166 88 13 34 43 51

184 203 199 177 82 44 97 73

211 214 208 198 134 52 78 83

211 210 203 191 133 79 74 86

47

Page 48: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image Compression

2D-DCT of matrix

-304 210 104 -69 10 20 -12 7

-327 -260 67 70 -10 -15 21 8

93 -84 -66 16 24 -2 -5 9

89 33 -19 -20 -26 21 -3 0

-9 42 18 27 -7 -17 29 -7

-5 15 -10 17 32 -15 -4 7

10 3 -12 -1 2 3 -2 -3

12 30 0 -3 -3 -6 12 -1

48

Page 49: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image Compression

-304 210 104 -69 10 20 -12 0-327 -260 67 70 -10 -15 0 0 93 -84 -66 16 24 0 0 0 89 33 -19 -20 0 0 0 0 -9 42 18 0 0 0 0 0 -5 15 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

As you can see, we save a little over half the original memory.

49

Page 50: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Reconstructing the Image

New Matrix and Compressed Image

55 41 27 39 56 69 92 106

35 22 7 16 35 59 88 101

65 49 21 5 6 28 62 73

130 114 75 28 -7 -1 33 46

180 175 148 95 33 16 45 59

200 206 203 165 92 55 71 82

205 207 214 193 121 70 75 83

214 205 209 196 129 75 78 85

50

Page 51: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Can You Tell the Difference?

Original Compressed

51

Page 52: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Image Compression

Original Compressed

52

Page 53: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Example - One everyday photo with file size of 2.76 MB

53

Page 54: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Example - One everyday photo with file size of 600 KB

54

Page 55: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Example - One everyday photo with file size of 350 KB

55

Page 56: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Example - One everyday photo with file size of 240 KB

56

Page 57: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Example - One everyday photo with file size of 144 KB

57

Page 58: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Example - One everyday photo with file size of 88 KB

58

Page 59: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Analysis

Near perfect image at 2.76M, so-so image at 88K Sharpness decreases as file size decreases Which file size is the best?

– No correct answer to this question– Answer depends upon how strict we are about image quality, what

purpose image is to be used for, and the resources available

59

Page 60: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Conclusion

Image compression is important Image compression has come a long way Image compression is nearly mature, but there

is always room for improvement

60

Page 61: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Video Compression

Page 62: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Video Data Size

1920x1080 1280x720 640x480 320x240 160x1201 sec 0.19 0.08 0.03 0.01 0.001 min 11.20 4.98 1.66 0.41 0.101 hour 671.85 298.60 99.53 24.88 6.22

1000 hours 671,846.40 298,598.40 99,532.80 24,883.20 6,220.80

size of uncompressed video in gigabytes

image size of video

1280x720 (1.77) 640x480 (1.33) 320x240 160x120

62

Page 63: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Video Bit Rate Calculation

width ~ pixels (160, 320, 640, 720, 1280, 1920, …)

height ~ pixels (120, 240, 480, 485, 720, 1080, …)

depth ~ bits (1, 4, 8, 15, 16, 24, …)

fps ~ frames per second (5, 15, 20, 24, 30, …)

compression factor (1, 6, 24, …)

width * height * depth * fps

compression factor= bits/sec

63

Page 64: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Effects of Compression

storage for 1 hour of compressed video in megabytes1920x1080 1280x720 640x480 320x240 160x120

1:1 671,846 298,598 99,533 24,883 6,2213:1 223,949 99,533 33,178 8,294 2,0746:1 111,974 49,766 16,589 4,147 1,037

25:1 26,874 11,944 3,981 995 249100:1 6,718 2,986 995 249 62

3 bytes/pixel, 30 frames/sec

64

Page 65: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Channel Bandwidths

65

Page 66: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Channel Bandwidth

66

Page 67: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Application Requirements

67

Page 68: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Source Video Formats

68

Page 69: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

The Need for Video Compression

High-Definition Television (HDTV)– 1920x1080 – 30 frames per second (full motion)– 8 bits for each three primary colors (RGB)

Total 1.5 Gb/sec! Cable TV: each cable channel is 6 MHz

– Max data rate of 19.2 Mb/sec– Reduced to 18 Mb/sec w/audio + control …

Compression rate must be ~ 80:1!

69

Page 70: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Some figures – Uncompressed video -> big amount of data

Color picture 800x320 pix, 24 bits/pix -> 6.3 Mbit/sSDTV 720x480, 30Hz, 16 bits/pix -> 166 Mbit/sHDTV 1920x1080, 30Hz, 16 bits/pix -> 1Gbit/s

– Communication and storage capacities limitsCable or satellite bandwidth : 38 Mbit/sADSL : 1 to 8 Mbit/sDVD capacity : 5 to 8 GB

The Need for Video Compression

70

Page 71: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

كاربرد

Video compression is now everywhere :– TV broadcasting over cable, satellite or terrestrial

networks,– CD-ROM, DVD, PC video storage,– Videophone and teleconferencing,– (VoD, IPTV),– Video over moInternet streaming biles.

71

Page 72: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

H.264/SVC

SMPTE/VC1

2000’s1990’s1980’s1970’s1960’s

Standardization (1/2)Video codecs

Transform Coding 65/80

MC Prediction 72/89

Entropy Coding 49/76

H.261

MPEG-1

H.262/MPEG62

MPEG4 ASP

H.263

H.264/AVC

DVCPRO

1950’s

DPCM 52/80

Tech

nolo

gies

Sta

ndar

ds

Videophone 56Kb/s – 2Mb/s

CD-ROM 1-1.5Mb/s

Digital TV, DVD 4 to 80 Mb/s

Camcorder, VTR 25 to 50 Mb/s

Videophone 30 Kb/s

Video streaming & post-prod 30 Kb/s to 600Mb/s

Convergence of all video applications, digital cinema 30 Kb/s to 600Mb/s

Wavelet 85/--

72

Page 73: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Bit rate evolution

Mbi

t/s

2001

0

1

2

3

4

5

6

1995 1997 1999 2003 2005 2007

MPEG-2

1st generation encoders

1st generationencoders

2nd generationencoders

MPEG-4/H.264 AVC

MPEG-4 ASP

C. Ratio from 4:2:2

166

28

Bit rate evolution for SDTV Broadcast

3rd generation encoders(advanced Pre-processing)

2nd generation encoders(Stat-Mux + Rate control improvements)

200973

Page 74: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

MPEG Compression

Compression through– Spatial– Temporal

74

Page 75: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Video Redundancies

Spatial Neighboring pixels in a frame are statistically related.

Temporal Pixels in consecutive frames are statistically related. One can achieve higher compression ratios by exploiting both spatial and temporal redundancies

75

Page 76: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Spatial Redundancy

Take advantage of similarity among most neighboring pixels

76

Page 77: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Spatial Redundancy Reduction

RGB to YUV – less information required for YUV (humans less sensitive to

chrominance) Macro Blocks

– Take groups of pixels (16x16) Discrete Cosine Transformation (DCT)

– Based on Fourier analysis where represent signal as sum of sine's and cosine’s

– Concentrates on higher-frequency values– Represent pixels in blocks with fewer numbers

Quantization– Reduce data required for co-efficients

Entropy coding– Compress77

Page 78: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Motion Compensation

Macro Block

Motion Vector

16 x 16

1 2 34 5 67 98

1

8 96

2 34 57

78

Page 79: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Video compression in MPEG-1&2 Spatial redundancy reduction (DCT example)

158 0 -1 0 0 0 0 0 -1 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

139 144 149 153 155 155 155 155144 151 153 156 159 156 156 156150 155 160 163 158 156 156 156159 161 162 160 160 159 159 159159 160 161 162 162 155 155 155161 161 161 161 160 157 157 157162 162 161 163 162 157 157 157162 162 161 161 163 158 158 158

158 0 -1 -1 -1 -1 EOBzig-zag scan

1260 -1 -12 -5 2 -2 -3 1 -23 -17 -6 -3 -3 0 0 -1 -11 -9 -2 2 0 -1 -1 0 -7 -2 0 1 1 0 0 0 -1 -1 1 2 0 -1 1 1 2 0 2 0 -1 1 1 -1 -1 0 0 -1 0 2 1 -1 -3 2 -4 -2 2 1 -1 0

DCT

Quantisation

79

Page 80: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Spatial Redundancy Reduction

Zig-Zag Scan,Run-length

coding

Quantization• major reduction• controls ‘quality’

“Intra-FrameEncoded”

80

Page 81: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Loss of Resolution

Original (63 kb)

Low (7kb)

Very Low (4 kb)

81

Page 82: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Temporal Redundancy

Take advantage of similarity between successive frames

950 951 95282

Page 83: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Temporal Redundancy Reduction

83

Page 84: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Temporal Redundancy Reduction

84

Page 85: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Temporal Redundancy Reduction

frames are independently encoded P frames are based on previous I, P frames

– Can send motion vector plus changes B frames are based on previous and following I and P

frames– In case something is uncovered

Page 86: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Group of Pictures (GOP)

Starts with an I-frame Ends with frame right before next I-frame “Open” ends in B-frame, “Closed” in P-frame MPEG Encoding a parameter, but ‘typical’:

– I B B P B B P B B I– I B B P B B P B B P B B I

86

Page 87: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Question

When may temporal redundancy reduction be ineffective?

87

Page 88: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Answer

When may temporal redundancy reduction be ineffective?– Many scene changes– High motion

88

Page 89: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Non-Temporal Redundancy

Sometimes high motion

89

Page 90: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Typical Compress. Performance

Type Size Compression--------------------- I 18 KB 7:1 P 6 KB 20:1 B 2.5 KB 50:1Avg 4.8 KB 27:1

---------------------Note, results are Variable Bit Rate, even if frame rate is constant90

Page 91: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Inter and Intra coding

To exploit spatial redundancies within a

frame (Intra coding):

8x8 DCT, similar to JPEG To exploit temporal redundancies between

frame (Inter coding):

Motion Estimation

91

Page 92: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Frame Types

Two frame types:

Intra-frames (I-frames): I-frame provides an accessing point, it uses basically JPEG.

Inter-frames (P-frames): P-frames use from previous frame ("predicted"), so frames depend on eachother.92

Page 93: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

93

Some video formats

The 4:2:2 format– Y sampling @ 13.5 MHz– C sampling @ 6.75 MHz– 8 bits per pixel– 720 active points per line– 576 lines active lines per image (2 fields) (625 lines)

and 480 active lines (525 lines) – Pixels are not square (e.g. for 480 lines, only 640 active points are needed -

VGA format)– Image size 720*576 or 720*480

The 4:2:0 format– Vertical chrominance resolution reduced by a factor 2

(average on two successive lines)

Page 94: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

December, 20, 2006AV Compression / Alain Bouffioux 94

Some video formats

SIF format (Source Intermediate Format)Half the vertical & horizontal resolution of 4:2:0For 50Hz countries:– Luminance: 360*288– Chrominance: 180*120

CIF format (Common Intermediate Format)– Intermediate format used in videoconferencing

(communication between US & Europe)– resolution: 360*288 – Sampling frequency: 30 Hz

QCIF (Quarter CIF)– Half the vertical & horizontal resolution of CIF.

Page 95: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

MPEG was an early standard for lossy compression of video and audio.

Development of the MPEG standard began in May 1988.

MPEG

95

Page 96: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

96

MPEG Coding Performance

Decoding is easy– MPEG1 decoding in software on most platforms– Hardware decoders are widely available ($150/board)– Windows graphics accelerators with MPEG decoding

now entering market (e.g., Matrox, Diamond, …) Encoding is expensive

– Sequential software encoders are 20:1 real-time– Real-time encoders use parallel processing– Real-time hardware encoders are expensive (e.g.,

$12K-$50K for MPEG1 and $100K-$500K for MPEG2)– Hardware-assisted off-line MPEG1 encoders (3:1)

used for multimedia authoring at reasonable cost ($5k)

Page 97: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

MPEG

MPEG1: low bitrate MPEG2: VCD, DVD MP3: MPEG2 profile 3, for music MPEG4: Network streaming MPEG7: Searching and indexing

Page 98: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

98

MPEG Standards

MPEG-1 ~ 1-1.5Mbps (early 90s) - vhs quality (1992)– Frame encoding– For compression of 320x240 full-motion video at rates

around 1.15Mb/s– Applications: video storage (VCD)– CIF images, 4:2:0 sampling, 1.5 Mbs

Page 99: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

99

MPEG Standards

MPEG-2 ~ 2-80Mbps (mid 90s) - broadcast quality (1994)– Frame and field encoding– For higher resolutions– Support interlaced video formats and a number of features

for HDTV– Address scalable video coding– Also used in DVD– CCIR 601 images, 4:2:2 sampling, 15 Mbs– Interlaced and progressive scanning

Page 100: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

MPEG Today

MPEG4 ~ 9-40kbps (later 90s)– Around Objects, not Frames

– For very low bit rate video and audio coding

– Applications: interactive multimedia and video telephony– Lower bandwidth

MPEG-7– Provide a fast and efficient searching, filtering

– New standard

– Internet orientated

– VOP (Video Object Plane)

– Profiles and levels100

Page 101: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

H.26x

H.261: first generation H.262 (MPEG2) H.263: video conference H.263++: enhancement H.26L: latest

Page 102: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

VOD

Watch what you want when you want

Page 103: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Standardization (2/2)DVB Transport

20011995 1997 1999 2003 2005 2007 2009

DVB-S

DVB-C

DVB-S2

DVB-T

DVB-H

DVB-IPI in progress

Satellite TV

Cable

Mobile TV

Terrestrial TV

IPTV

103

Page 104: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Video on Demand

One video server Many video data Many clients Client want to watch at any time

Clients can send request to the server and request to watch a particular video. The server have to response by streaming the requested video to the client. We want to be able to support large number of clients, and clients should be able to watch at anytime.

104

Page 105: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Streaming

– Streaming media: the ‘real-time’ playing of a video-, audio- and/or datastream on a machine from the moment the first bytes come in.

– VoD such as YouTube, MSN Video, Google Video, Yahoo Video, CNN…

– 2006 April to December: MSN Video service Client-server mode Covering over 520 million streaming requests for

more than 59,000 videos.105

Page 106: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Streaming: live vs on-demand

archive realtime

unicast

multicast

VoD Event-driven

Event-driven

scheduled

Page 107: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Live audio and/or video streaming is a completely different sport from on-demand streaming.

VoD (Video on demand) is unicast streaming from an archive.

Scheduled (a tv like netcast) is usually multicast streaming from an archive

Live (realtime) streaming can be done both in unicast and multicast.

Streaming: live vs on-demand

107

Page 108: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Motivation

VoD such as YouTube, MSN Video, Google Video, Yahoo Video, CNN…

As the trend of increasing demands on such services and higher-quality videos, it becomes a costly service to provide.

108

Page 109: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

109

Video-on-Demand Distribution Model

A client can tune in to receive any ongoing media delivery using its Set Top Box

True broadcast: Satellite and cable TV networks

VI DEO

SERVER

Multicast/ Broadcast Capable Network

STB STB STB

109

Page 110: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

VoD servers support rewind function

Set-top box

TV

customer premise

VoD servers

Rewind TV

IP backbone Unicast

110

Page 111: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

111

Broadcast feed

Media databas

e

IP Streamer

Content Management Server

EPG metadata

Encoder

Encryption Server

VOD Server

Application Servers Cable

Modem Termination System

Optical Line

Termination

DSLAM

ADSL Modem/Rout

er

Optical Network

Termination

Cable Modem/Rout

er

Core & Aggregati

on Networks

STB

DSL (Copper)

DSL (Copper)

Optical Fiber

Optical Fiber

HFC (Coax)

HFC (Coax)

Content Provider

Service Provider Network Provider

CPE

Remote Management

Server

Subscriber Management and Billing

Server

Licence Server

RT Encoder

IPTV/VOD : Full Operator model

111

Page 112: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

What is IPTV?

The fundamentals– IPTV = Internet Protocol Television

Digital TV service delivered over a broadband network using the Internet Protoc0l

IPTV usually refers to TV services over a Network Operator’s quality controlled network.

Internet TV = IPTV over the public Internet

112

Page 113: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

One of the first One of the largest 150 TV channels 250,000 subscribers

IPTV Network

113

Page 114: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Basic IPTV Structure

114

Page 115: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Set Top Box – Home gateway (BST)

115

Page 116: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

116

IPTV Set-Top Box

Broadcast TV DVR Movies On Demand On Demand

116

Page 117: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Other Services

VOD – Video on Demand– Watch what you want when you want

DVR– Record Live TV from your set top box

HD– High Definition TV. The evolution of Television

On line Gaming

117

Page 118: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

Search

>> <<

Logout | Help

Selected Video

Go

---

My Content Annotate

Title: The Hidden ChildDescription: Of the 1,600,000 Jewish children who lived in Europe before World War II, only 100,000 survived the Holocaust.

Title: Ralph Golzio interview on Paterson Silk Strike of 1913Description: Ralph Golzio was a teenager at the time of the Paterson Silk Strike of 1913.

Title: Sondra Gash interviewDescription: Evelyn Hershey of the American Labor Museum interviews

Search For and Select a Video for Annotation

118

Page 119: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

-

>> <<

Logout | Help

Search

Title: The Hidden ChildDescription: Of the 1,600,000 Jewish children who lived in Europe before World War II, only 100,000 survived the Holocaust.

Title: Ralph Golzio interview on Paterson Silk Strike of 1913Description: Ralph Golzio was a teenager at the time of the Paterson Silk Strike of 1913.

Title: Sondra Gash interviewDescription: Evelyn Hershey of the American Labor Museum interviews

---

My Content Annotate

Go

Drag and Drop Thumbnails Here To Create an Annotation

Selection of video found through search

119

Page 120: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر

-

>> <<

Logout | Help

Search Annotate

Start Time: 5:01 End Time: 8:34

Title: Amsterdam, The Netherlands

Note: City street in Amsterdam.

Indexed/Searchable: üPrivate NJVid Wide

My Content

My Institution Only

Save

Amsterdam, The Netherlands

Annotate and Capture Start/End Times

Start and stop markers can be placed.

Metadata placed here.

Once an annotation is saved it will appear in the videos timeline.

120

Page 121: این دو عالم  علم  دارد  در  نهاد  منتخب           وان جهانی رمز دارد در حروف مختصر