mpeg-1 part 2 video encoding

Download MPEG-1 Part 2 Video Encoding

If you can't read please download the document

Upload: christian-kehl

Post on 17-May-2015

508 views

Category:

Technology


3 download

DESCRIPTION

Theory of MPEG-Encoding (focus: MPEG-I Part 2 Video-Stream) and practical details in implementing a full GPU-based solution

TRANSCRIPT

  • 1. MPEG COMPRESSION Group 821

2. CONTENTS MPEG compressionStandardsMPEG-1 Part 2Implementation 3. What is MPEG? Moving Picture Experts Group standards for audio video compression and transmission asymmetric: encoder more complex than decoder 4. MPEG standards MPEG-1 first standard for audio and video (lossy compression) composed of 5 parts: Systems, Video, Audio, Compliance testing, Software simulation up to 1.5 Mbit/s moderate quality MP3 audio format 5. MPEG-1 Part 2 6. Frames Types of pictures: I (intra) frame compressed using only intra-frame coding Moderate compression but faster random accessP (predicted) frame Coded with motion compression using past I frames or P frames Can be used as reference pictures for additional motion compensationB (bidirectional) frame Coded by motion compensation by either past or future I or P framesD (DC) frame Limited use: encodes only DC components of intra-frame coding Only found in MPEG-1 7. Macroblocks Macroblocks -blocks of 16 x 16 pixels -the smallest unit of data that can select a method of compression, therefore they can be considered as the minimum coded units in a picture. Blocks -are 8 x 8 blocks of pixels. There are six of these blocks in each macroblock 8. Color Space conversion to YcbCr (luma, chroma blue, chroma red)the human eye is more sensitive to changes in brightness => chroma subsampling - 4:2:0 subsampling - Cb and Cr are subsampled at a factor of 2 both horizontally and vertically 9. Motion Estimation Base compression method for a variety of CodecsIdea: create a prediction frame (previous frame + motion)determine the prediction errorstorage needed: prediction error (small) + one 2D vector per blockSmall prediction errors easy to compress with DCT+Quantization+Entropy EncodingMany possible approaches for Motion Estimation: Hierachical Block MatchingOptical FlowNetravali-Robbins AlgorithmBlock Matching (Sum of Mean Difference, Sum of Absolute Difference)...Encoding speed highly dependend on used Motion Estimation Algorithm 10. Motion Estimation Sum of absolute Differences Search for the minimum sum of absolute difference between a Macroblock in previous- and a shifted Macroblock in current frameMacroblock with minimum SAD inherits a shift -> Motion VectorBuild a prediction picture from previous frame + Motion VectorsCompute delta(current image, predicition image)Store difference image + motion vectorlot's of motion -> hard to compressminor motion -> good to compress 11. DCT 8x8 block values are coded by means of the discrete cosine transform main idea is to determine the brightness (64 pixels) and scale it to some limits 0 255, 0 is black while 255 white (In MPEG a range from -256 to 255 is used.)64values5values by using the following formulasWhere f(x,y) is the brightness of the pixel at position [x,y]. 12. Examplethe matrix is transfered to the receiver in zigzag scan order So the trasmited code is: 700 90 90 -89 0 100 0 0 0 .... 0 Of course, the zeros are not transferred. An End-Of-Block sign is coded instead. 13. Quantization The decoder can reconstruct the pixel values by the following formula called inverse discrete cosine transform (IDCT):Where F(u,v) is the transform matrix value at position [u,v]. The results are exactly the original pixel values. Therefore the MPEG compression could be regarded as loss-less. But that isn't true, because the transformed values are quantized. That means they are (integer) divided by a certain value. To reduce them under the byte length at least the quantization value 8 is applied. The decoder multiplies the result by the same value. Of course the result differs from the original value. But again because of some properties of the human eye the error isn't visible. In MPEG there is a quantization matrix which defines a different quantization value for every transform value depending on its position. 14. Entropy coding Huffman table, small value -> small code Input has many 0's and values near 0 Implemented RunLevel coding for AC DC coding regular-> 15. Run level coding All AC values has at least 8 bitsRS = 00000000 -> EOB R = 1111 can mean ZRL but is ignoredArranged as RRRRSSSSRS = 11110000 meansR is run length of 0's15 0's with a 0 after it.S is category 1-15Not done on the GPU because of wierd errors. 16. Implementation MPEG-1 supports resolutions up to 40954095 and bitrates up to 100 Mbit/s The algorithms used in compression allow SIMD operations Implementation done with GPU computing using the OpenCL standard