• 沒有找到結果。

Transform-domain intra prediction for H.264

N/A
N/A
Protected

Academic year: 2021

Share "Transform-domain intra prediction for H.264"

Copied!
4
0
0

加載中.... (立即查看全文)

全文

(1)

Transform-Domain Intra Prediction for H.264

Chen Chen and Ping-Hao Wu

Graduate Institute of Communications Engineering, National Taiwan University,

Taipei, Taiwan 10617, R.O.C. Email: {r92942081, b89901043}@ntu.edu.tw

Homer Chen

Department of Electrical Engineering, GICE, and INM. National Taiwan University,

Taipei, Taiwan 10617, R.O.C. Email: homer@cc.ee.ntu.edu.tw

Abstract—H.264/AVC is the newest video coding standard jointly developed by the ITU-T Video Coding Experts Group and the ISO/IEC Moving Picture Experts Group. In contrast to some previous coding standards such as H.263+ and MPEG-4 Part-2, where intra prediction is performed in the transform domain, the intra prediction of H.264 is completely defined in the pixel domain. This presents a challenge to multimedia systems in which transcoding is conducted in the transform domain for the purpose of computational efficiency. In this paper, we show how to obtain the transform domain predictions for various intra modes of H264. We begin by converting the intra prediction from the pixel domain to the transform domain through matrix manipulation. Then we show how the operations involved in the matrix manipulation can be simplified. A computational complexity analysis of each intra prediction mode of H.264 is provided.

I. INTRODUCTION

In view of the successful adoption of MPEG-2 technology in the DVD and DTV industries and the growing market potential of the newly developed H.264 standard, we are motivated to investigate the conversion of existing MPEG-2 multimedia content to the H.264 format. The overall architecture of our proposed scheme for MPEG-2 to H.264 transcoding is described in [6]. In this paper, we present the details of our transform-domain approach for H.264 intra prediction.

H.264/AVC [1] is the newest video coding standard jointly developed by the ITU-T Video Coding Experts Group and the ISO/IEC Moving Picture Experts Group. It provides better compression efficiency than previous video coding standards. Transcoding is one of the key technologies for enabling interoperability between different systems and devices [1], [2]. The purpose of transcoding is to convert a multimedia signal from one format to another. The format conversion is characterized by bitrate, frame rate, coding standard, etc.

In contrast to some previous coding standards such as H.263+ and MPEG-4 Part-2, where intra prediction is performed in the transform domain, the intra prediction of H.264 is completely defined in the pixel domain by referring to neighboring samples of the previously coded blocks. Transcoding in the transform (or compressed) domain has been a desired approach [3], [4] because it avoids complete decoding and re-encoding, which is

computationally expensive. Therefore, there is a need to investigate transform-domain intra prediction for H.264.

This paper is organized as follows. In Section II, we describe the proposed transform-domain intra prediction algorithm. The complexity of the algorithm is presented In Section III. Finally, a conclusion is given in Section IV.

II. INTRA PREDICTION

In H.264, there are a total of 9 prediction modes for a

4 4× sub-block and 4 for a 16 16× macroblock. If a sub-block or a macrosub-block is to be coded in intra mode, a prediction block is formed based on the neighboring samples of previously-coded blocks that are to the left and/or immediately above the block to be coded. The prediction block is then subtracted from the current block prior to encoding. In this section, the transform-domain intra prediction for luma samples is discussed. The transform-domain intra prediction of chroma samples can be easily derived in a similar way and is not described here.

A. Intra 4 4×

The intra prediction of 4 4× blocks defined by H.264 is illustrated in Fig. 1(a), where the symbols a to p denote the pixels of current block, and the symbols A to M denote the neighboring pixels based on which the prediction block is calculated. The direction of prediction is show in Fig. 1(b). Due to the page limit, we choose the first four modes of the

4 4× intra prediction to illustrate our approach.

1) Vertical

The prediction samples in this mode (mode 0) are obtained from the four neighboring pixels (A to D) above the block to be coded. Sample A is copied to every pixel in the first column of the block, sample B is copied to every pixel in the second column of the block, and so on.

This work was supported in part by the National Science Council of Taiwan under contract NSC93-2752-E-002-006- PAE.

(a) (b) Figure 1. Illustration of 4 4× intra prediction

1497

0-7803-8834-8/05/$20.00 ©2005 IEEE.

(2)

Mathematically, we can express this prediction block by the following matrix equation:

0 0 0 1 0 0 0 1 , 0 0 0 1 0 0 0 1 (1) A B C D A B C D A B C D A B C D A B C D × × × ×           × × × ×   =        × × × ×            

where the symbol “ × ” represents “don’t care” pixel. Denoting the modified DCT used in H.264 by T( ) and applying it both sides of (1), we have:

T A B C D A B C D A B C D A B C D               0 0 0 1 0 0 0 1 T T 0 0 0 1 0 0 0 1 A B C D   × × × ×   × × × ×     =   × × × ×             1 1.2649 1 0.6325 0 0 0 0 T . 0 0 0 0 0 0 0 0 (2) A B C D   − − × × × ×         × × × ×       = × × × ×          

Therefore, this 4 4× intra prediction mode can be performed in the transformed domain. Furthermore, given the transform coefficients of the upper block, a total of 8 multiplications and 12 additions are required to compute the prediction samples of the current block in the transform domain.

2) Horizontal

Following the procedure described above, the prediction block of this mode can be expressed as:

0 0 0 0 0 0 0 0 , 0 0 0 0 1 1 1 1 (3) I I I I I J J J J J K K K K K L L L L L × × ×         × × ×      =      × × ×          × × ×      

which has the same computational complexity as (2).

3) DC

In this mode, the prediction samples are obtained from both upper and left blocks and can be expressed as:

1 1 1 1 1 1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 1 1 1 1 A B C D I J K L A B C D I J K L A B C D A B C D A B C D A B C D   + + + + + + +                + + + + + +       = +                 =   +         . 1 1 1 1 (4) I I I I J J J J K K K K L L L L                    

The modified DCT of every matrix in (4), except the one with all elements equal to one, have already been computed in the previous two modes. Note that

1 1 1 1 4 0 0 0 1 1 1 1 0 0 0 0 T . 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 (5)          =            

Therefore, only one multiplication and one addition are required to obtain the prediction samples of this mode in the transform domain.

4) Diagonal_Down_Left

The operation involved in this mode is much more complicated than the previous three modes.

First, we divide the prediction samples of this mode into two terms according to the sources of the pixel value (from the upper block or from the upper-right block):

2 2 2 2 2 2 2 2 1 2 2 2 2 4 2 2 2 3 A B C B C D C D E D E F B C D C D E D E F E F G C D E D E F E F G F G H D E F E F G F G H G H + + + + + + + +    + + + + + + + +     + + + + + + + +   + + + + + + +    2 2 2 2 2 0 1 2 0 0 4 0 0 0 0 0 2 0 2 2 . 2 2 2 2 2 2 3 (6) A B C B C D C D D B C D C D D C D D D E E F E E F E F G E E F E F G F G H E F E F G F G H G H  + + + + +    + + +     =  +         +      + + +     + + + + + + + + + + + +     

Then each row in the first term can be calculated as follows:

2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 2 1 0 0 , 0 0 0 0 1 2 1 0 0 0 0 0 0 1 2 1 (7) A B C B C D C D D A B C D + + + + +             × × × ×         × × × ×         =     × × × ×             0 0 0 0 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 , 0 0 0 0 2 1 0 0 0 0 0 0 1 2 1 0 (8) B C D C D D A B C D    + + +          × × × ×         × × × ×         =     × × × ×             0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 , 0 0 0 1 1 0 0 0 0 0 0 0 2 1 0 0 (9) C D D A B C D        +      × × × ×         × × × ×         =  × × × ×             

1498

(3)

and 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 (10) D A B C D             × × × ×         × × × ×         =   × × × ×              

The summation of the four blocks described by (7)-(10) gives rise to the first matrix on the right-hand side of (6). The second matrix on the right-hand side of (6) can be calculated in a similar way.

At the first sight, it may seem that this intra prediction mode involves a lot of matrix multiplications. A closer look at the above four equations indicates that the first matrices on the right-hand side of (7)-(10) have a vertical shift relationship. We exploit such relationship to simplify the computation.

First, take the modified transform of the first matrices described above and denote them by U1, U2, U3, and U4, respectively: 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 T , T , 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 T , T . 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1             = =                         = =             1 2 3 4 U U U U

Then, multiply U1 with the modified DCT of the upper block and denote the resulting matrix by Y1. We thus have:

a b a c 1.264a 1.264b 1.264a 1.264c , a b a c 0.632a 0.632b 0.632a 0.632c (11) −       = −   −   1 1 Y = U X X

where a=0.25, b=0.316, c=0.159, and

. (12) 11 12 13 14 21 22 23 24 31 32 33 34 41 42 43 44 X X X X X X X X X X X X X X X X A B C D × × × ×   × × × ×       =  = × × × ×        X T Let , , , (13) 0 11 31 21 41 1 12 32 22 42 2 13 33 23 43 3 14 34 24 44 S = a(X + X )- bX + cX S = a(X + X )- bX + cX S = a(X + X )- bX + cX S = a(X + X )- bX + cX . Then, (11) can be rewritten as:

1.264 1.264 1.264 1.264 , (14 0.632 0.632 0.632 0.632 ) 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 S S S S S S S S S S S S S S S S             = =             1 2 1 1 3 Y Y Y Y Y    

whereYi,1≤ ≤i 3,denote different row vectors of Y1. Note

that the computation of the matrix Y1 is now reduced to 20

multiplications and 12 additions. Because of the vertical shift relationship, the remaining three matrices Y2= U2X,

Y3= U3X, and Y4= U4X are also composed of Y Y1, 2, andY3.

, , and . (15)                   = = = = = =                     1 1 1 2 3 3 2 2 3 3 4 4 1 1 1 3 2 2 Y Y Y -Y Y -Y Y U X Y U X Y U X Y -Y -Y -Y -Y Y            

Therefore, Y2, Y3, and Y4 are readily available without any

additional calculation. Moreover, since the matrices Y1, Y2,

Y3, and Y4 are needed in the prediction process of other

modes, we can store them in memory to avoid unnecessary computation.

Using a similar procedure described previously, the prediction processes of the remaining intra 4x4 modes can be derived easily. Due to the page limit, we omit the derivation of other modes here.

B. Intra 16 × 16

Intra 16 16× prediction of H.264 contains four modes: Vertical, Horizontal, DC and Plane mode. The transform domain prediction of the first three modes can be derived by the procedure described previously in Section II.A. Here, we focus on the Plane mode which is more complicated than the other three modes. Fig. 2 shows the notations used to denote neighboring pixels around the current block for which a prediction block in the transform domain is to be determined.

The prediction samples of the Plane mode can be represented as: -7 -7 1 1 -7 -6 8 -6 -6 , (16) 1 1 -7 -6 8 8 8 a b c                       +   + " " " " # % # # # # # # " # " " " where

Figure 2. Illustration of the 16 16× intra prediction.

(4)

(

)

(

)

(

)

16 5 32 6 5 32 6 (17) 15 15 a H V b H c V = + = + >> = + >> and

(

15

)

6

(

)(

8+ 6-

)

0 (18) 8 1 h h , h= H = H - M +

h+ H - H

(

15

)

6

(

)(

8 6

)

0 (19)

8

1

+v -v

v=

V = V - M

+

v+

V

-V

.

The values a, b, and c are dependent on the neighboring pixel values. We now show how to obtain H. The calculation of V, H15, and V15 can be easily accomplished by

following the same procedure.

Since we only have 4 4× blocks of modified DCT coefficients, we expand (18) into five terms according to the pixel location: 12 13 14 15 8 9 10 11 4 5 6 0 1 2 3 (5 6 7 8 ) ( 2 3 4 ) (3 2 ) (7 6 5 4 ) 8 , (20) H H H H H H H H H H H H H H H H M = + + + + + + + − + + − + + + −

where

(

5H12+6H13+7H14+8H15

)

can be determined by making use of the following equation:

12 13 14 15 12 13 14 15 0 0 0 1 5 5 5 5 0 0 0 1 6 6 6 6 0 0 0 1 7 7 7 7 0 0 0 1 8 8 8 8 1 1 1 1 1 1 1 1 (5 6 7 8 ) . (21) 1 1 1 1 1 1 1 1 H H H H H H H H × × × ×           × × × ×             × × × ×                   = + + +    

According to (5), the value of

(

5H12+6H13+7H14+ 8H15

)

can be determined by extracting the DC value of the modified transform of the left hand side of (21). The remaining terms of H in (20) can be obtained in a similar way.

III. COMPUTATIONALCOMPLEXITY

In this section, we show the computational complexity of the proposed algorithm by the number of operations required to obtain the prediction samples.

First, note that the prediction blocks are computed row by row and the pre-computed matrices are shared by different modes. For example, the values S0, S1, S2, and S3 computed

in the Diagonal_Down_Left mode can also be used in the prediction process of the Vertical_Left, the Vertical_Right, the Diagonal_Down_Right, and the Horizontal_Down modes. Thus we only need to calculate those matrices once.

The number of operations required for each intra prediction mode is shown in Table I and Table II. Note that in the first two modes of the 16 16× intra prediction, the

operation counts are all zero because the data required by these modes have already been calculated in the first two modes of intra 4 4× prediction.

IV. CONCLUSION

In this paper, we have provided a sound theoretical basis for converting various intra prediction modes of H.264 from the pixel domain to the transform domain. We have also analyzed the operations involved in the conversion and shown means for efficient implementation of the algorithm. This work is motivated by a practical need for conducting transcoding in the transform domain. The methods developed are readily applicable to multimedia gateways or systems for converting, for example, MPEG-2 videos to the H.264 format.

REFERENCES

[1] A. Vetro, C. Christopoulos, and Huifang Sun, “Video transcoding architectures and techniques: An overview,” IEEE Signal Processing Magazine, pp. 18-29, Mar. 2003.

[2] J. Xin, C.-W. Lin, and M.-T. Sun, “Digital video transcoding,” to appear in Proc. IEEE, Dec. 2004.

[3] P. A. A. Assuncao and M. Ghanbari, “Transcoding of MPEG-2 video in the frequency domain,” in IEEE Int. Conf. Acoustics., Speech, Signal Processing, ICASSP’97, Munich, Germany, Apr. 1997, vol. 4, pp. 2633-2636.

[4] T. Shanableh, and M. Ghanbari, “Hybrid DCT/pixel domain architecture for heterogeneous video transcoding,” Signal Processing: Image Commun., vol. 18, no. 8, pp. 601-620, Sep. 2003.

[5] Draft ITU-T Recommendation and Final Draft International Standard of Joint Video Specification (ITU-T Rec. H.264 | ISO/IEC 14496-10 AVC), 2003.

[6] C. Chen, P.-H. Wu, and H. Chen, “MPEG-2 to H.264 transcoding,” Picture Coding Symposium, Dec. 2004.

TABLE II. COMPUTATIONAL COMPLEXITY OF 16 16× INTRA

PREDICTION

Mode Multiplication Addition

Vertical 0 0 Horizontal 0 0

DC 1 7

Plane 26 72

TABLE I. COMPUTATIONAL COMPLEXITY OF 4 4× INTRA

PREDICTION

Mode Multiplication Addition

Vertical 8 12 Horizontal 8 12 DC 1 1 Diagonal_Down_Left 168 136 Diagonal_Down_Right 232 200 Vertical_Right 192 176 Horizontal_Down 192 176 Vertical_Left 128 112 Horizontal_Up 64 48

1500

數據

Figure 2 . Illustration of the 16 16 ×  intra prediction.
TABLE II.   C OMPUTATIONAL  C OMPLEXITY OF  16 16 × I NTRA

參考文獻

相關文件

Using a one-factor higher-order item response theory (HO-IRT) model formulation, it is pos- ited that an examinee’s performance in each domain is accounted for by a

• We have found a plausible model in AdS/CFT that captures some essential features of the quantum hall eect as well as a possible experimental prediction. • Even if this is the

To improve the convergence of difference methods, one way is selected difference-equations in such that their local truncation errors are O(h p ) for as large a value of p as

“Since our classification problem is essentially a multi-label task, during the prediction procedure, we assume that the number of labels for the unlabeled nodes is already known

As we shall see in Section 30.2, if we choose “complex roots of unity” as the evaluation points, we can produce a point-value representation by taking the discrete Fourier transform

In this paper, a novel subspace projection technique, called Basis-emphasized Non-negative Matrix Factorization with Wavelet Transform (wBNMF), is proposed to represent

The proof is suitable for R n if the statement is that every closed set in R n is the intersection of a countable collection of open sets.. All we need is to change intervals

The purpose of this thesis is to propose a model of routes design for the intra-network of fixed-route trucking carriers, named as the Mixed Hub-and-Spoke