방송시스템 13 주차 MPEG2 1
개요 MPEG2의 I, P, B picture에대해이해한다. 움직임예측과움직임보상에대해이해한다. MPEG2의압축율가변요소를이해한다. 프로파일과레벨의의미를이해한다. 2
목차 1. Compression overview 2. MPEG structure 3. Basic MPEG Video Compression Algorithms 3.1 DCT and Quantization(JPEG,MPEG) 3.2. Huffman coding(jpeg,mpeg) 3.3 Motion prediction(mpeg only) 3
1.Current Image & Video Compression Standards MPEG-3 (Was HDTV covered in MPEG-2) MPEG-7 Multimedia Content Description Interface:( 색상, 형태, 질감, 움직임 ) PSTN : Public Switched Telephone Network ISDN : Integrated Services Digital Network 4
* 동영상용비디오파일형식 -AVI (Audio Video Interleaved) : Microsoft 사가개발오디오와비디오를번갈아기록대부분의 CD-ROM 타이틀에서사용 -MOV : QuickTime 에서사용 Window 및 Macintosh 에서사용 -MPEG: ISO/IEC 표준화그룹에서제안비디오 CD, DVD, 디지털 TV 등에서사용 -ASF(Active Stream Format) : MS 에서제안한스트리밍 format -RA/RV(RealAudio/RealVideo): 비디오 / 오디오스트리밍방식 5
2. MPEG 역사 MPEG Moving Pictures Experts Group Coding of moving pictures and associated audio Picture part Can achieve compression ratio of about 50:1 through storing only the difference between successive frames Even higher compression ratios possible 6
1) MPEG-1 (1991) -Goal: progressive scan, storage media, low resolution, and low bitrates (1.5Mb/s, 352x240 size) 2) MPEG-2 (1993) -Goal: Supports Higher bit rates, Higher resolution, and progressive as well as Interlace pictures (TV(4-8Mbps) and HD TV(18-40Mbps)) 7
3. MPEG 압축율과프로파일 & 래벨 1) Uncompressed and Compressed bitrates for MPEG-2 Resolution (pels x lines x frames/s) Uncompressed Bitrate (RGB) Compressed Bitrate Film 480x480x24Hz 133Mbits/s 3 to 6 Mbits/s TV Quality (DVD) 480x480x29.97Hz 168Mbits/s 4 to 8 Mbits/s (42:1 to 21:1) HDTV 1920x1080x30Hz 1493Mbits/s 18 to 30 Mbits/s (83:1 to 50:1) 8
2) Profile(tools) and level(ranges) Film HDTV DVD, SD TV VCR quality 9
3) 포멧 *HD TV: High Definition TV, *SD TV: Standard Definition digital TV(DVD) US Congress decided that by 2006, all television programs would be broadcast in DTV - stop of analog TV signals. Interlace (i) Scanning Progressive (P) Scanning 10
4.MPEG Structure Sequence GOP Picture Slice Macro block block Sample 11
Video sequence includes one or more groups of pictures(gop), begins with a sequence header and ends with an end-of-sequence code. Group Of Pictures(GOP) is a series of one of more pictures(i,p,b). Picture is primary coding unit of a video sequence. Slice- is sequence of macroblocks Macroblock is basic coding block of an MPEG picture (16 x 16 : luminance, 8x8 :color) Block is 8 x 8 pixels block (8x8 DCT) Macro block 4:2:0 12
13
Previous Frame ( 현재프레임 ) 14
Previous Frame ( 현재프레임 ) 메크로블럭 15
Previous Frame (Frame 2: 현재프레임 )- A, B, C, D 블럭중심 16
Reference Frame (Frame1 : 기준프레임 ) 17
모션보상의예 ( 기준프레임 + 모션차 ) 18
5. MPEG2 순방향예측 / 역방향예측 I 0 picture(all data) P 3 picture (Diff + M.V) 1)Forward Prediction 2)Bi-directional Prediction B 1,B 2 pictures(diff + M.V) Diff: Motion difference M.V: Motion vector 19
MPEG2 3 Pictures 20
H:704 I picture B picture P picture V:480 H: 44 macro blcoks x 16 =704 pixel V: 30 macro blcoks x 16 =480 pixel 44 x 30=1,320 Macro Blocks I picture : Intra coded frame without prediction P picture : Forward predicted frame from I,P B picture : Bi-directionally predicted frame. 21
* 움직임예측 ( 추정 ) : Motion Estimation * 움직임보상 : Motion Compensation 동영상을일정크기의블록으로나누어보면각블록의영상은이전영상의같은위치또는주변위치와유사한경우가대부분임. 따라서같은위치에대한단순차영상을이용하는것보다, 이전영상에서가장유사한부분과의차영상을이용하는것이보다효과적임. 22
23
움직임벡터 (Motion vector) 추출 24
6. Basic MPEG Video Compression Algorithms Compression techniques exploiting the redundancies In image or Video 1) Spatial redundancy : Block Discrete cosine transform(dct) & Quantization (JPEG & MPEG) 2) Statistical redundancy : Zigzag scanning, run-length & Huffman variable length coding (JPEG & MPEG) 3) Temporal redundancy : Motion Prediction (MPEG only : P and B frames) 25
1) DCT and Quantization (JPEG &MPEG) Encoding Original Image DCT Quantization Run-length & Huffman Encoding Compressed bit stream Reconstructed Image Inverse DCT Inverse Quantization Decoding Inverse Run-length & Huffman Decoding Example in JPEG configuration 26
Example in MPEG configuration 27
DCT Discrete Cosine Transform What is it? Converts spatial image block to frequency domain Quantization Reduces number of bits required to represent image Why do it? Human Visual System(HVS) is insensitive to high frequencies Huffman coding Assign common values to short codes To reduce the bits required for the coding. 28
2) Quantization : Reducing the amplitude DCT frequency components Quantization(Encoder) : Inverse Quantization (Decoder) : Small Values 8 16 19 22 26 27 29 34 16 16 22 24 27 29 34 37 19 22 26 27 29 34 34 38 22 22 26 27 29 34 37 40 22 26 27 29 32 35 40 48 26 27 29 32 35 40 48 58 26 27 29 34 38 46 56 69 27 29 35 38 45 56 69 83 Q: Standard Intra Q matrix X Q X X ' Small reduction Bigger Values X Q Q X ' 8 4 2 1 0 0 0 0 4 2 1 0 0 0 0 0 2 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 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 Quantized coefficients 29
3) Temporal compression : Temporal redundancy from Motion Prediction(P and B frames(pictures)) I 0 picture(all data) P 3 picture (Diff + M.V) 1)Forward Prediction 2)Bi-directional Prediction B 1,B 2 pictures(diff + M.V) Diff: Motion difference M.V: Motion vector 30
4) MPEG order IBBPBBPBBPBBI (Display order) IPBBPBBPBBPBBI (Coding and Transmission order) 31
I Frames : Intra MBs Macro block 32
P Frames : Intra or Forward MBs from forwarded prediction =(Motion Difference + Motion Vector(MV)) (Previous I Frame) (Motion compensated Macro Block from Motion Estimation) (P Previous Frame) (P Frame) (Direction of motion) 33
MAE:Mean Absolute Error Motion search area : Minimum 23 x 23 pixels for two consecutive frames Ex) I 4B P structure : 51 x 51 pels (more B pictures need larger search area 34
P Frames : Intra or Forward MBs Ex) Encoding : Motion Difference (= (Current) P MB (Motion compensated previous) I MB ) plus Motion Vector P-I Decoding : Motion Difference will be added to (Motion compensated previous) I MB using Motion Vector ((P-I )+I =P) 35
5) MPEG encoder Motion Difference (P-I ) (P) (I ) (I) (P) (I) IPBBPBBPBBPBBI 36
6) MPEG decoder IPBBPBBPBBPBBI Motion Difference (P-I ) IBBPBBPBBPBBI (P-I )+I =P (I ) I 37
P block : forward processed picture 38
B Frames : Intra, Forward,backward, or Bidirectional MBs from Bi-directional prediction 39
Bi-directional (Interpolated) Prediction (I or P) (B) (I or P) (Bi-directional) 40
Mux 7) MPEG decoder step size Input data Buffer VLC Decoder Q -1 IDCT Forwarded Average 1/2 + Previous picture store + Decoded data Buffer Backwarded Future picture store 0 I Motion compensation 41
B block(1): Forward block from previous reference 42
B block(2): Backward block(red) from future block 43
B Block(3): Bi-directional Interpolated block(purple) from previous and future blocks (If Forwarded and Backwarded motion exist together) 44
Forward block: Blue, Backward block: Red, Interpolated Block: purple B Block: Mixed example 45
46
8) MPEG parameters(1) 47
MPEG parameters(2) 48
문제 1. MPEG2 의 I, P, B picture 에대해설명하시오. 2. 움직임예측과움직임보상에대해설명하시오. 3. MPEG2 의압축율가변요소는? 4. DVD 와 HDTV 의압축율범위는? 5. 프로파일과레벨의의미를설명하시오. 49