200 likes | 497 Views
Video Compression. Bee Fong. Lossy Compression. Inter Frame Compression Compression among frames Intra Frame Compression Compression in a frame. Intra Frame Compression. Similar to Image Compression Do not discussion, please refer to the image compression section (JPEG).
E N D
Video Compression Bee Fong
Lossy Compression • Inter Frame Compression • Compression among frames • Intra Frame Compression • Compression in a frame
Intra Frame Compression • Similar to Image Compression • Do not discussion, please refer to the image compression section (JPEG)
Coding Order != Display Order • Figure 1 • Figure 2 Encoding rate may be slow, but Decoding rate is fast
Inter Frame Compression • I Frame • Intra Frame • P Frame • Predictive Frame • B Frame • Bidirectional Frame • D Frame
Compression Methods • Subsampling • Duplicate frames, 1 compression stream • Differencing • Compare a Frame with its predecessor. Take the difference. • Block Differencing • Frame divided into blocks, compare block difference.
Compression Methods • Motion Compensation • Motion vector, compare blocks with location difference. • Frame Segmentation • Frame divided into equal-size nonoverlapping blocks, block size affecting the chance of matching • Search Threshold • Compare #difference with a predefined value
Compression Methods • Block Search • Search area = (width + 2dx)(height + 2dy) • Distortion Measure • Use Pel difference instead of mean absolute difference
Compression Methods • Suboptimal Search Methods • Do some search in the search area, not all. • Coding Motion Vector • Use prediction motion vector • Grouping motion vectors • Image Objects • Use overlapping object layers
My Ideas • “Cutting-Sandwich Compression” • Motivation: for high quality compression, or lossless video compression compression rate is low.
Cutting-Sandwich Compression • Cutting Frames horizontally or vertically, then do compression • Reason: for a single frame, the repeating rate of pixels is low • Assumption: the repeating chance of the same line of frames may be higher.
Implementation • Base on the general Video compression approach, treat images in another dimensions (horizontal cutting images, or vertical cutting images) • Treat as a 3-d block of frames, stored in buffer for encoding / decoding.
Implementation • For each 3-d block, compare the general, horizontal and vertical compression rate, take the best. • Add two extra bits for mode selection. • 00 for general mode, 01 for vertical mode, 10 for horizontal mode and 11 for open. • Tradeoff is low.
Tradeoff • For example, 1 block = 640 frames of (640 x 480) image, 3 bits per pixel. • 2 extra bits / (640 x 640 x 480 x 3) bits ~= 0%.
Tradeoff • More resources are needed for the compression (time, software, hardware) • Encoding rate may be slower, Decoding rate – no big difference if we take some buffer (again, only decoding needed to be fast in general case) • Software and hardware are cheap now, not a technical problem.
Tradeoff • Buffer is needed for encoding and decoding in video compression, not a big deal.
Other supportive compression methods in Sandwich • Run-Length Encoding • LZ77 • LZW