FAST MODE DECISION ALGORITHM FOR INTRA PREDICTION IN HEVC

FINAL REPORT

LANKA NAGA VENKATA SAI SURYA TEJA

STUDENT ID: 1000916473

MAIL ID

DATE : 05/03/2014

UNDER THE GUIDANCE OF

DR. K. R. RAO

EE 5359 MULTIMEDIA PROCESSING

UNIVERSITY OF TEXAS AT ARLINGTON

LIST OF ACRONYMS AND ABBREVIATIONS:

AMVP - Advanced motion vector prediction

BD- Bitrate- Bjøntegaard Delta Bitrate

BD- PSNR - Bjøntegaard Delta Peak Signal-to-Noise Ratio

CABAC- Context adaptive binary arithmetic coding

CU- Coding Unit

DCT - Discrete Cosine Transform

DST - Discrete Sine Transform

HEVC - High Efficiency Video Coding

JCT- VC- Joint Collaborative Team on Video Coding

LCU - Largest Coding Unit

MPM - Most Probable Mode

PSNR - Peak Signal-to-Noise Ratio

PU - Prediction Unit

QP - Quantization Parameter

RDOQ - Rate Distortion Optimization Quantization

RDO - Rate- Distortion Optimization

RMD - Rough Mode Decision

SAO - Sample adaptive offset

SSIM - Structural Similarity Index

TU - Transform Unit

PROPOSAL: To improve the coding efficiency of intra frame coding, up to 34 intra prediction modes are defined in High Efficiency Video Coding (HEVC) [1]. The best mode among these pre-defined intra prediction modes is selected by rate-distortion optimization (RDO) for each block. This project describesa new method to reduce the candidates in RDO process, as it will be time-consuming if all directions are tested in the RDO process. Also in this project, it provides 20% and 28% time savings in intra high efficiency and low complexity cases on average compared to the default encoding scheme in HM 13.0 [5] with almost the same coding efficiency. Also based on PSNR, BD- PSNR and BD- Bitrate analysis of fast mode decision algorithm for intra prediction [7] in HEVC can be done by comparing with the default encoding scheme in HM 13.0 [5].

Index Terms: video coding, HEVC, intra prediction

INTRODUCTION: HEVC standard [2] provides a highly flexible hierarchy of unit representation which consists of three block concepts: coding unit (CU), prediction unit (PU), and transform unit (TU). This separation of the block structure is helpful for each unit of optimization. CU is a macroblock-like unit of region splitting which is always square and its size can be from 8x8 luma samples up to the largest coding units (LCUs). This concept allows recursive splitting into four equal sized blocks, starting from LCU. This process gives a content-adaptive coding tree structure comprised of CU blocks. Figure 4 shows coding tree structure [3]. The PU is used only for the CU which is the leaf node in the quadtree structure and the size of two PUs are 2Nx2N and NxN. The third block concept transform unit size cannot exceed that of the CU. Figure 1 shows the block diagram of H.264 encoder [20].

Figure 1: Block Diagram of H.264 Encoder [20]

Figure 2- Block diagram of HEVC encoder [15]

Figure 2 shows block diagram of HEVC encoder [15] in which each picture is partitioned into blocks of different sizes and the same is conveyed to the decoder.Figure 3 shows block diagram of HEVC decoder [15].

Figure 3- Block diagram of HEVC decoder [15]

In the following, the various features involved in hybrid video coding using HEVC are highlighted.

1) Coding tree units and coding tree block (CTB) structure: The core of the coding layer in previous standards was the macroblock, containing a 16×16 block of luma samples and, in the usual case of 4:2:0 color sampling, two corresponding 8×8 blocks of chroma samples; whereas the analogous structure in HEVC is the coding tree unit (CTU), which has a size selected by the encoder and can be larger than a traditional macroblock. The CTU consists of a luma CTB and the corresponding chroma CTBs and syntax elements. The size L×L of a luma CTB can be chosen as L = 16, 32, or 64 samples, with the larger sizes typically enabling better compression. HEVC then supports a partitioning of the CTBs into smaller blocks using a tree structure and quadtree-like signaling [26]. Figure 4 shows the coding tree structure and its components.

(c)

(d)

Figure 4- Coding tree structure [3]

2) Coding units (CUs) and coding blocks (CBs): The quadtree syntax of the CTU specifies the size and positions of its luma and chroma CBs. The root of the quadtree is associated with the CTU. Hence, the size of the luma CTB is the largest supported size for a luma CB. The splitting of a CTU into luma and chroma CBs is signaled jointly. One luma CB and ordinarily two chroma CBs, together with associated syntax, form a coding unit (CU). A CTB may contain only one CU or may be split to form multiple CUs, and each CU has an associated partitioning into prediction units (PUs) and a tree of transform units (TUs).

3) Prediction units and prediction blocks (PBs): The decision whether to code a picture area using interpicture or intrapicture prediction is made at the CU level. A PU partitioning structure has its root at the CU level. Depending on the basic prediction-type decision, the luma and chroma CBs can then be further split in size and predicted from luma and chroma prediction blocks (PBs). HEVC supports variable PB sizes from 64×64 down to 4×4 samples.

4) TUs and transform blocks: The prediction residual is coded using block transforms. A TU tree structure has its root at the CU level. The luma CB residual may be identical to the luma transform block (TB) or may be further split into smaller lumaTBs. The same applies to the ChromaTBs. Integer basis functions similar to those of a discrete cosine transform (DCT) are defined for the square TB sizes 4×4, 8×8, 16×16, and 32×32. For the 4×4 transform of lumaintrapicture prediction residuals, an integer transform derived from a form of discrete sine transform (DST) is alternatively specified.

5) Motion vector signaling: Advanced motion vector prediction (AMVP) is used, including derivation of several most probable candidates based on data from adjacent PBs and the reference picture. A merge mode for MV coding can also be used, allowing the inheritance of MVs from temporally or spatially neighboring PBs. Moreover, compared to H.264/MPEG-4 AVC, improved skipped and direct motion inference is also specified.

6) Motion compensation: Quarter-sample precision is used for the MVs, and 7-tap or 8-tap filters are used for interpolation of fractional-sample positions (compared to six-tap filtering of half-sample positions followed by linear interpolation for quarter-sample positions in H.264/MPEG-4 AVC). Similar to H.264/MPEG-4 AVC, multiple reference pictures are used. For each PB, either one or two motion vectors can be transmitted, resulting either in unipredictive or bipredictive coding, respectively. As in H.264/MPEG-4 AVC, a scaling and offset operation may be applied to the prediction signal(s) in a manner known as weighted prediction.

7) Intrapicture prediction: The decoded boundary samples of adjacent blocks are used as reference data for spatial prediction in regions where interpicture prediction is not performed. Intrapicture prediction supports 33 directional modes (compared to eight such modes in H.264/MPEG-4 AVC), plus planar (surface fitting) and DC (flat) prediction modes. The selected intrapicture prediction modes are encoded by deriving most probable modes (e.g., prediction directions) based on those of previously decoded neighboring PBs.

8) Quantization control: As in H.264/MPEG-4 AVC, uniform reconstruction quantization (URQ) is used in HEVC, with quantization scaling matrices supported for the various transform block sizes.

9) Entropy coding: Context adaptive binary arithmetic coding (CABAC) is used for entropy coding. This is similar to the CABAC scheme in H.264/MPEG-4 AVC, but has undergone several improvements to improve its throughput speed (especially for parallel-processing architectures) and its compression performance, and to reduce its context memory requirements.

10) In-loop deblocking filtering: A deblocking filter similar to the one used in H.264/MPEG-4 AVC is operated within the interpicture prediction loop. However, the design is simplified in regard to its decision-making and filtering processes, and is made more friendly to parallel processing.

11) Sample adaptive offset (SAO): A nonlinear amplitude mapping is introduced within the interpicture prediction loop after the deblocking filter. Its goal is to better reconstruct the original signal amplitudes by using a look-up table that is described by a few additional parameters that can be determined by histogram analysis at the encoder side.

In the given sequence intra prediction is applied to the very first picture which uses spatial redundancy of the picture while for rest of the frames temporal redundancy is exploited using inter prediction. Since encoder needs to exhaust all the combinations of CU, PU and TU to find the optimal solutions, it is very time-consuming. The encoder will not tolerate it if all the directions are employed in the rate-distortion optimization process. To reduce the computational complexity of the encoder, a fast intra mode decision [7] was adopted in HM 13.0 [5].

OVERVIEW OF INTRA PREDICTION IN HEVC: In H.264, intra prediction [6][7][8][9] is based on spatial extrapolation of samples from previously decoded image blocks, followed by integer discrete cosine transform (DCT) [10] based coding. HEVC utilizes the same principle, but further extends it to efficiently represent wider range of textural and structural information in images. HEVC contains several elements improving the efficiency of intra prediction over earlier solutions. The introduced methods can model accurately different structures as well as smooth regions with gradually changing sample values. Figure 5 shows the intra prediction modes of HEVC [7] and figure 6 shows the intra prediction modes of H.264 [21].

Figure 5- HEVC intra prediction modes [7]

Figure 6: H.264 intra prediction modes [21]

Prediction size / Total Intra Angular modes
HEVC/H.265(64x64) / H.264/AVC(16x16)
64x64 / 5 / NA
32x32 / 34 / NA
16x16 / 34 / 4
8x8 / 34 / 9
4x4 / 17 / 9
Total Modes / 64x(5+34+34+34+17)=7936 / 16x(16x9+4x9+4)=2944

Table 1: Comparing HEVC Intra luma prediction modes for 64x64 LCU with H.264/AVC Intra modes for a 64x64 image region [11]

METHOD FOR FAST MODE DECISON ALGORITHM FOR INTRA PREDICTION: The fast intra prediction consists of three steps.

1 - Hadamard Transformed Coefficients Of Residual Signal [13]

2 - Progressive Mode Search [13]

3 - Early RDOQ Termination [13]

By combining these three steps, fast mode decision algorithm can be performed. The unified intra in HM13.0 first determines the first N best candidate modes selected by a rough mode decision (RMD) process where all modes are tested by minimum absolute sum of Hadamard transformed coefficients of residual signal and the mode bits in the rough mode decision. Instead of the total intra prediction modes decision, the RD optimization is only applied to the N best candidate modes selected by the rough mode decision where all modes are compared in this decision. However, computation load of the encoder is still very high. On the other side, the intra prediction modes are always correlated among the neighbors which are not considered in HM 13.0. Therefore, there is still some room for further reducing the encoder complexity.

To further relieve the computation load of the encoder, it is important to reduce the candidates for RDO process and make full use of the information of its neighboring blocks. In this project, check for less number of best RMD modes for RDO, and the most probable mode (MPM) is always included in the candidates for RDO.

TEST SEQUENCES USED:

[1] BQSquare_416x240_60 [16]

[2] BQMall_ 832x480_60 [16]

[3] KristenAndSara_1280x720_60 [16]

EXPERIMENTAL RESULTS:

BQMall_832x480_60:

Tables 2 and 3 demonstrate the implementation results test sequence BQMall_832x480_60 with number of frames 30.

Analysis of results for unmodified HM 13.0 method with number of frames 30:

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 23836.5280 / 41.1352 / 519.561
28 / 16075.4080 / 38.6716 / 515.1675
32 / 10704.5280 / 36.2715 / 426.831
34 / 8506.4960 / 34.9803 / 407.187

Table 2 : Implementation results for unmodified HM 13.0 method with number of frames 30 for BQMALL__832x480_60

Analysis of results for fast mode decision algorithm[13] with number of frames 30 :

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 24074.8932 / 40.9944 / 396.944
28 / 16236.1620 / 38.5300 / 383.799
32 / 10811.5732 / 36.1225 / 312.44
34 / 8591.5609 / 34.8425 / 297.246

Table 3: Implementation results for fast mode decision algorithm[13]with number of frames 30 for BQMALL__832x480_60

Tables 4 and 5 demonstrate the implementation results test sequence BQMall_832x480_60 with number of frames 10.

Analysis of results for unmodified HM 13.0 method with number of frames 10 :

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 23754.8160 / 41.137 / 176.624
28 / 16010.5920 / 38.6744 / 161.116
32 / 10612.8000 / 36.2830 / 151.866
34 / 8447.7600 / 34.9856 / 134.619

Table 4: Implementation results for unmodified HM 13.0 method with number of frames 10 for BQMALL__832x480_60

Analysis of results for fast mode decision algorithm[13]with number of frames 10

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 24046.1849 / 40.9975 / 134.234
28 / 16227.4525 / 38.5344 / 120.837
32 / 10718.928 / 36.1320 / 112.380
34 / 8532.2376 / 34.8473 / 98.271

Table 5: Implementation results for fast mode decision algorithm[13] with number of frames 10 for BQMALL__832x480_60

KristenAndSara_1280x720_60:

Tables 6 and 7 demonstrate the implementation results test sequence KristenAndSara_1280x720_60 with number of frames 30.

Analysis of results for unmodified HM 13.0 method with number of frames 30:

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 17937.0720 / 44.5023 / 910.946
28 / 11845.0240 / 42.6064 / 885.948
32 / 7935.3600 / 40.6329 / 1090.753
34 / 6466.5440 / 39.5419 / 1148.507

Table 6 : Implementation results for unmodified HM 13.0 method with number of frames 30 for KristenAndSara_1280x720_60

Analysis of results for fast mode decision algorithm[13] with number of frames 30 :

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 17996.8211 / 44.4241 / 696.873
28 / 11992.2640 / 42.5682 / 668.890
32 / 7989.0680 / 40.5349 / 812.610
34 / 6496.2360 / 39.4498 / 844.152

Table 7: Implementation results forfast mode decision algorithm[13] with number of frames 30 for KristenAndSara_1280x720_60

Tables 8 and 9 demonstrate the implementation results test sequence KristenAndSara_1280x720_60 with number of frames 10.

Analysis of results for unmodified HM 13.0 method with number of frames 10:

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 17865.5520 / 44.5196 / 301.597
28 / 11800.8960 / 42.6232 / 272.229
32 / 7907.9040 / 40.6527 / 277.846
34 / 6449.6160 / 39.5625 / 262.815

Table 8 : Implementation results for unmodified HM 13.0 method with number of frames 10 for KristenAndSara_1280x720_60

Analysis of results forfast mode decision algorithm[13] with number of frames 10 :

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 17976.8240 / 41.1352 / 232.229
28 / 11939.9056 / 38.6716 / 204.993
32 / 7984.6425 / 36.2715 / 202.827
34 / 6498.8848 / 34.9803 / 190.540

Table 9: Implementation results forfast mode decision algorithm[13] with number of frames 10 for KristenAndSara_1280x720_60

BQSquare__416x240_60:

Tables 10 and 11 demonstrate the implementation results test sequence BQSquare__416x240_60

with number of frames 30.

Analysis of results for unmodified HM 13.0 method with number of frames 30:

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 10971.0880 / 40.5244 / 152.385
28 / 7672.0320 / 37.3928 / 133.030
32 / 5376.3360 / 34.8391 / 123.324
34 / 4475.0880 / 33.5497 / 115.036

Table 10 : Implementation results for unmodified HM 13.0 method with number of frames 30 for BQSquare__416x240_60

Analysis of results for fast mode decision algorithm[13] with number of frames 30 :

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 11387.5214 / 40.3846 / 115.8126
28 / 7891.2577 / 37.3270 / 99.7725
32 / 5461.5360 / 34.6825 / 91.259
34 / 4529.6200 / 33.4047 / 82.825

Table 11: Implementation results forfast mode decision algorithm[13] with number of frames 30 for BQSquare__416x240_60

Tables 12 and 13 demonstrate the implementation results test sequence BQSquare__416x240_60

with number of frames 10.

Analysis of results for unmodified HM 13.0 method with number of frames 10:

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 10885.8720 / 40.5471 / 59.774
28 / 7597.5840 / 37.4125 / 44.527
32 / 5324.4000 / 34.8710 / 40.159
34 / 4432.9920 / 33.5965 / 38.316

Table 12 : Implementation results for unmodified HM 13.0 method with number of frames 10 for BQSquare__416x240_60

Analysis of results for fast mode decision algorithm[13] with number of frames 10 :

QP / BITRATE
(kbps) / PSNR
(avg)
dB / ENCODING TIME
(sec)
24 / 11305.3246 / 40.3870 / 45.428
28 / 7814.7329 / 37.2947 / 33.395
32 / 5379.6111 / 34.7557 / 29.717
34 / 4488.8632 / 33.4589 / 27.587

Table 13: Implementation results forfast mode decision algorithm[13] with number of frames 10 for BQSquare__416x240_60

Encoding Time Vs QP Graphs:Unmodified method is HM 13.0 with no changes and modified method is fast mode decision algorithm[13].

BQMall_832x480_60:Figures 7 and 8 illustrate the Encoding time and QP plot for test sequence BQMall_832x480_60 for number of frames 10 and 30 respectively.

For number of frames 10

Figure 7: RD plot for BQMall_832x480_60 with number of frames 10

For number of frames 30

Figure 8: RD plot for BQMall_832x480_60 with number of frames 30

KristenAndSara_1280x720_60: Figures 9 and 10 illustrate the Encoding time and QP plot for test sequence KristenAndSara_1280x720_60 for number of frames 10 and 30 respectively.

For number of frames 10

Figure 9: RD plot for KristenAndSara_1280x720_60 with number of frames 10

For number of frames 30

Figure 10: RD plot for KristenAndSara_1280x720_60 with number of frames 30

BQSquare_416x240_60: Figures 11 and 12 illustrate the Encoding time and QP plot for test sequence BQSquare_416x240_60 for number of frames 10 and 30 respectively.

For number of frames 10

Figure 11: RD plot for BQSquare_416x240_60 with number of frames 10

For number of frames 30

Figure 12: RD plot for BQSquare_416x240_60 with number of frames 30

Graph Between PSNR (avg) vsBitrate: Unmodified method is HM 13.0 with no changes and modified method is HM 13.0 with fast mode decision algorithm.

BQMall_832x480_60: Figures 13 and 14 illustrate the Bitrate-PSNR plot for test sequence BQMall_832x480_60 for number of frames 10 and 30 respectively.

For Number of Frames 10

Figure 13: RD plot for BQMall_832x480_60 with number of frames 10

For Number of Frames 30

Figure 14: RD plot for BQMall_832x480_60 with number of frames 30

KristenAndSara_1280x720_60:Figures 15 and 16 illustrate the Bitrate-PSNR plot for test sequence KristenAndSara_1280x720_60 for number of frames 10 and 30 respectively.

For number of frames 10

Figure 15: RD plot for KristenAndSara_1280x720_60 with number of frames 10

For number of frames 30

Figure 16: RD plot for KristenAndSara_1280x720_60 with number of frames 30

BQSquare_416x240_60: Figures 17 and 18 illustrate the Bitrate-PSNR plot for test sequence for BQSquare_416x240_60 number of frames 10 and 30 respectively.

For number of frames 10

Figure 17: RD plot for BQSquare_416x240_60 with number of frames 10

For number of frames 30

Figure 18: RD plot for BQSquare_416x240_60 with number of frames 30

BD-PSNR and BD-BITRATE:

BQMall_832x480_60:Figures 19 and 20 illustrate the BD-PSNR and QP plot for test sequence BQMall_832x480_60 for number of frames 10 and 30 respectively.

Figure 19: RD plot for BQMall_832x480_60 with number of frames 10

Figure 20: RD plot for BQMall_832x480_60 with number of frames 30

KristenAndSara_1280x720_60: Figures 21 and 22 illustrate the BD-PSNR and QP plot for test sequence KristenAndSara_1280x720_60 for number of frames 10 and 30 respectively.

Figure 21: RD plot for KristenAndSara_1280x720_60 with number of frames 10

Figure 22: RD plot for KristenAndSara_1280x720_60 with number of frames 30

BQSquare_416x240_60: Figures 23 and 24 illustrate the BD-PSNR and QP plot for test sequence BQSquare_416x240_60 for number of frames 10 and 30 respectively.

Figure 23: RD plot for BQSquare_416x240_60 with number of frames 10

Figure 24: RD plot for BQSquare_416x240_60 with number of frames 30

BQMall_832x480_60: Figures 25 and 26 illustrate the BD-BITRATE and QP plot for test sequence BQMall_832x480_60 for number of frames 10 and 30 respectively.

Figure 25: RD plot for BQMall_832x480_60 with number of frames 10

Figure 26: RD plot for BQMall_832x480_60 with number of frames 30

KristenAndSara_1280x720_60: Figures 27 and 28 illustrate the BD-BITRATE and QP plot for test sequence KristenAndSara_1280x720_60 for number of frames 10 and 30 respectively.

Figure 27: RD plot for KristenAndSara_1280x720_60 with number of frames 10