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
27 무료 파티션 도구 AOMEI Partition Assistant v6.6 exFAT를 완벽하게 지원 file 엉뚱도마뱀 2017.11.27 1339
26 반도체 장비/공정 기술 용어집 digipine 2017.11.02 1890
25 반도체 전공정 후공정 설명 digipine 2017.11.02 4305
24 블럭체인 기술자료 링크 digipine 2018.02.08 3103
23 삼성의 새로운 갤럭시 S 폰 예상보다 빨리 출시 예정 file digipine 2020.11.05 926
22 삼성전자 갤럭시 S22 발표, S펜을 탑재한 첫 S시리즈 file digipine 2022.02.10 249
21 서드파티 애플 뮤직 앱 Soor, 맞춤형 Magic Mix 음악 리스트 file digipine 2022.02.04 484
20 서보 모터 (Servo-motor) 의 내부 구조와 회전 원리 file digipine 2017.11.02 807
19 서보모터의 기초와 제어 file digipine 2017.11.02 423
18 스니핑 개념, 공격기법, 방어법, 참고할만한 오픈소스 라이브러리 및 툴 digipine 2017.11.03 1301
17 안드로이드 의 써드파티 어플의 SD RW 권한 부여 digipine 2017.11.03 336
16 암호화폐 (Crypto Currency) 비트코인 file digipine 2018.02.08 3515
15 애플 드디어 ARM 기반의 맥 출시 예정, 11월 10일 digipine 2020.11.09 300
14 애플 워치와 모방제품과의 승부 file lizard2019 2020.05.26 454
13 애플, 맥미니 2011 지원 종료 공식화, 신제품 출시는 미정 file 엉뚱도마뱀 2017.12.08 748
12 애플, 서드파티 앱마켓 진출 허용하나 lizard2019 2022.12.18 239
11 영화의 매트릭스의 네오의 컴퓨터 화면 프로그램 digipine 2021.02.04 1051
10 윈도우XP 배경화면, '스마트폰용' 속편 출시 file 엉뚱도마뱀 2017.11.27 762
9 이더리움 (Ethereum) digipine 2018.02.08 826
8 임베디드 Linux 시스템 부팅 시 프로그램 자동 실행 digipine 2017.11.03 4154
Board Pagination Prev 1 ... 2 3 ... 4 Next
/ 4