logo

English

How video compression works 5/5 - Deblocking, deringing, and color space conversion

by digipine posted Nov 02, 2017
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print Attachment
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print Attachment

Deblocking, deringing, and color space conversion
 
Polishing the image: deblocking and deringing
Ideally, lossy image and video compression algorithms discard only perceptually insignificant information, so that to the human eye the reconstructed image or video sequence appears identical to the original uncompressed image or video. In practice, however, some artifacts may be visible. This can happen due to a poor encoder implementation, video content that is particularly challenging to encode, or a selected bit rate that is too low for the video sequence, resolution, and frame rate. The latter case is particularly common, since many applications trade off video quality for a reduction in storage and/or bandwidth requirements.
Two types of artifacts, "blocking" and "ringing," are common in video compression applications. Blocking artifacts are due to the fact that compression algorithms divide each frame into 8x8 blocks. Each block is reconstructed with some small errors, and the errors at the edges of a block often contrast with the errors at the edges of neighboring blocks, making block boundaries visible. In contrast, ringing artifacts appear as distortions around the edges of image features. Ringing artifacts are due to the encoder discarding too much information in quantizing the high-frequency DCT coefficients.

Video compression applications often employ filters following decompression to reduce blocking and ringing artifacts. These filtering steps are known as "deblocking" and "deringing," respectively. Both deblocking and deringing use low-pass FIR (finite impulse response) filters to hide these visible artifacts.

Deblocking and deringing filters are fairly computationally demanding. Combined, these filters can easily consume more processor cycles than the video decoder itself. For example, an MPEG-4 simple-profile, level 1 (176x144 pixel, 15 fps) decoder optimized for the ARM9E general-purpose processor core requires that the processor be run at an instruction cycle rate of about 14 MHz when decoding a moderately complex video stream. If deblocking is added, the processor must be run at 33 MHz. If deringing and deblocking are both added, the processor must be run at about 39 MHz—nearly three times the clock rate required for the video decompression algorithm alone.

Post-processing or in-line?
Deblocking and deringing filters can be applied to video frames as a separate post-processing step that is independent of video decompression. This approach provides system designers the flexibility to select the best deblocking and/or deringing filters for their application or to forego these filters entirely in order to reduce computational demands. With this approach, the video decoder uses each unfiltered reconstructed frame as a reference frame for decoding future video frames, and an additional frame buffer is required for the final filtered video output.

Alternatively, deblocking and/or deringing can be integrated into the video decompression algorithm. This approach, sometimes referred to as "loop filtering," uses the filtered reconstructed frame as the reference frame for decoding future video frames. This approach requires the video encoder to perform the same deblocking and/or deringing filtering steps as the decoder in order to keep each reference frame used in encoding identical to that used in decoding. The need to perform filtering in the encoder increases processor performance requirements for encoding, but can improve image quality, especially for very low bit rates. In addition, the extra frame buffer that is required when deblocking and/or deringing are implemented as a separate post-processing step is not needed when deblocking and deringing are integrated into the decompression algorithm. Figure 6 illustrates deblocking and deringing applied "in-loop" or as a post-processing step. H.264, for example, includes an "in-loop" deblocking filter, sometimes referred to as the "loop filter."

bdtifigure36.gif

Color Space Conversion
One complication of compressing video streams is that the way color is represented in codecs is different from the way it is represented by video cameras and displays. As noted above, video compression algorithms typically represent color images using luminance and chrominance planes. In contrast, video cameras and displays typically mix red, green, and blue light to represent different colors. Therefore, the red, green, and blue pixels captured by a camera must be converted into luminance and chrominance values for video encoding, and the luminance and chrominance pixels output by the video decoder must be converted to specific levels of red, green, and blue for display. The algorithm for this conversion requires about 12 arithmetic operations per image pixel, not including the interpolation needed to compensate for the fact that the chrominance planes have a lower resolution than the luminance plane at the video compression algorithm's input and output. For a VGA (640x480 pixel) image resolution at 30 frames per second, conversion (without any interpolation) requires over 110 million operations per second. When implemented in software, this computational load can be quite significant. However, color conversion for playback is often supported by the display hardware, so it may not need to be done in software.

Know your processing—and your processor
Video compression algorithms employ a variety of signal-processing tasks such as motion estimation, transforms, and variable-length coding. Although most modern video compression algorithms share these basic tasks, there is enormous variation among algorithms and implementation techniques. Table 1 summarizes the key signal-processing tasks in a video decoder and provides approximate computational load and memory requirements of each task. (Note that there can be substantial variation in these figures depending on the implementation.) As we've discussed, encoder requirements differ from decoder requirements in some important ways, most notably due to the inclusion of the very computationally demanding motion estimation step.

9eebd4d0e6a6b8790e3ec3389efe76be.gif

 




Table 1. Major subfunctions of a typical video decompression algorithm.
A thorough understanding of signal-processing principles, practical implementations of signal-processing functions, and the details of the target processor is crucial in order to efficiently map the varied tasks in a video compression algorithm to the processor's architectural resources. 

TAG •

List of Articles
No. Subject Author Date Views
67 7 Best Music Players for Mac You Should Try file 엉뚱도마뱀 2017.12.07 601
66 CISCO Router 설정 팁 - QOS 1 digipine 2017.11.03 1817
65 CM6206 High Integrated USB Audio I/O Controller Windows Driver and PDF file digipine 2022.02.02 5658
64 Cubism Live2D Demo Windows D3D9 file lizard2019 2023.01.11 262
63 DaVinci 에 대한 소개글 digipine 2017.11.03 112
62 Facebook 게시물을 검색하여 자살 암시를 발견하는 AI 서비스 시작 1 file 엉뚱도마뱀 2017.11.29 512
61 GA-P55A-UD3R rev 2.0 / GT 240 OSX 스노우 레파드 해킨가이드 digipine 2017.11.03 754
60 Galanz Glanz BCD-467WTDH Screen-Controlled eco-smart refrigerator file lizard2019 2020.05.19 55960
59 GDPR 유럽 일반 개인 정보보호법 시행 엉뚱도마뱀 2018.05.24 879
58 HIGH QUALITY MOBILE EXPERIENCE (HQME) digipine 2017.11.03 339
57 High Quality Mobile Experience (HQME) IEEE P2200TM file lizard2019 2020.02.18 1444
56 How video compression works 1/5 file digipine 2017.11.02 1596
55 How video compression works 2/5 - Quantization, coding, and prediction file digipine 2017.11.02 5992
54 How video compression works 3/5 - Color and motion file digipine 2017.11.02 1595
53 How video compression works 4/5 - Encoder secrets and motion compensation digipine 2017.11.02 340
» How video compression works 5/5 - Deblocking, deringing, and color space conversion file digipine 2017.11.02 23720
51 iOS 14.3 업데이트 릴리즈 file digipine 2020.12.16 266
50 IoT 악성 코드 "Mirai"변종이 급증 주의 file 엉뚱도마뱀 2017.11.28 344
49 iPhone SE 2 2018년 상반기에 출시? file digipine 2017.12.11 540
48 iPhone X의 Face ID RAW 데이터 영상 분석 및 은행권 앱 동향 file 엉뚱도마뱀 2017.11.27 669
Board Pagination Prev 1 2 3 ... 4 Next
/ 4