# An Improved Fast Mode Decision Method for H.264/AVC Intracoding

Authors: Abderrahmane Elyousfi
Journal: Advances in Multimedia
 (2014)

---

## Abstract

An improved fast and efficient mode decision method for H.264/AVC intracoding is proposed, which is based on the analysis of the gravity center method and more efficient mode selection. In contrast to the fast mode decision method where the intramodes are determined by the gravity center of the block, the mass center vector is computed for the block and the subblocks formed by the proposed subsampling techniques. This method is able to determine all correlation directions of the block that correspond to the intraprediction mode directions of the H.264/AVC. On this basis, only a small number of intraprediction modes are chosen as the best modes for rate-distortion optimization (RDO) calculation. Different video sequences are used to test the performance of the proposed method. Experimental results reveal the significant computational savings achieved with slight peak signal-to-noise ratio (PSNR) degradation and bit-rate increase.


---

## Body

## 1. Introduction

The H.264/AVC video coding standard supports intraprediction for various block sizes. For the luma samples, H.264/AVC supports three block-size types in high profile: luma4
×
4, luma 8
×
8, and luma 16
×
16. Intraluma 4
×
4 supports eight directional modes and DC mode. Figure 1 illustrates the 4
×
4 luma block and intraprediction directions. In Figure 1(b), eight out of the nine different intraprediction modes of luma 4
×
4 are shown (except DC mode). In each of the modes, the prediction pixels of the current block a-p can be obtained by the neighboring pixels A-M with a certain extrapolating operation. And the pixels A-M in Figure 1(a) belong to the reconstructed image (not the original lossless image). Except the DC mode (mean value prediction), the eight modes can be specified by their local texture direction [1]. Intraluma 8
×
8 shares the same prediction modes with intraluma 4
×
4 except that the coding block size is 8
×
8. Intraluma 16
×
16 contains three modes with directions: vertical, horizontal, and plane. For the chroma intraprediction, only 8
×
8 block is supported and the prediction modes are the same as those of intraluma 16
×
16 [1–6]. To select the optimal encoding mode for an MB, H.264/AVC video encoder calculates the rate distortion cost (denoted as RDcost) of every possible mode and chooses the mode having the minimum value, and this process is repeatedly carried out for all the possible modes for a given MB [7, 8]. Unfortunately, the computational burden of this type of exhaustively full searching algorithm is far more demanding than any other existing video coding standards.The4
×
4 luma block and prediction directions. (a) For a 4
×
4 luma block, a to p are the pixels to be predicted, and A to M are the neighboring pixels that are available of prediction. (b) Eight prediction directions for intraprediction of 4
×
4 luma block.
(a)
(b)Several fast intraprediction mode selection algorithms have been proposed [9–22]. In [15], hybrid method is used to achieve better performance than conventional edge detection methods by adapting these filters. Plus, several other improvements are also investigated. First, the sort operations at the stage of individual pixel processing are time consuming and summing method is used instead. Second, as the adaptation of the computation efficient summing method is used, more pixels can be applied to improve the filtering results with negligible time increase. Finally, local information is exploited to enhance the mode selection accuracy. Elyousfi [16] proposed a fast intramode selection algorithm for H.264/AVC that uses the gravity center vector of the block to determine the best intraprediction mode.In this paper, we present an improved gravity center method proposed by Elyousfi [16]. In [16], the authors use the idea that the direction of the gravity center vector of the block is perpendicular with the direction of the correlation of this block. However, the prediction precision of the above algorithm is hampered by the limitation that this algorithm is not applicable for all correlation directions of the block that correspond to intraprediction mode directions of H.264/AVC. In case of the blocks having a directional correlation such as horizontal-up, horizontal-down, vertical-left, and vertical-right direction, the gravity center vector direction of these blocks is not identified. From this, the gravity center method cannot determine all correlation directions of the block that correspond to intraprediction mode direction of H.264/AVC. Hence, as the best intraprediction mode direction is this that corresponds to the block correlation direction, the previous algorithm [16] cannot determine the best intraprediction mode candidates for RDO computation in intraprediction. Consequently, the previous algorithm [16] may increase the bit rate and/or may affect heavily the PSNR degradation.This work proposes a novel adaptive fast and efficient intraprediction in H.264/AVC algorithm based on center of mass and two subsampling techniques. This method is able to determine all correlation directions of the block that correspond to the intraprediction mode directions of the H.264/-AVC. The technique of the mass center used in the previous work is also applied in this paper. That is, the block mass center direction is perpendicular to the block correlation direction. However, in this paper we indicate the block correlation directions that are perpendicular to the mass center direction of the block. We note that these correlation directions are horizontal, vertical, diagonal-right, and diagonal-left. Furthermore, after the analysis of the characteristics of the blocks having these correlation directions, we observed that these blocks are symmetric.For the case of the blocks that their correlation directions are not perpendicular with the direction of the mass center vector of these blocks, the previous work [16] is not capable to determine these correlation directions. We note that these directions are horizontal-up, horizontal-down, vertical-left, and vertical-right. In this paper, in order to determine the correlation direction of these blocks with mass center direction we formed their corresponding symmetric subblock. These subblocks are formed by subsampling the pixels of the block.Two subsampling techniques are proposed in this paper. The first method named by ILHC (impair lines and half columns) and applied to vertical-left and vertical-right directional correlation blocks. The square subblock formed by this method (ILHC) is composed by the impair lines and the half columns in the middle of the block. The second method named by ICHL (impair columns and half lines) and applied to horizontal-up and horizontal-down correlation direction of the blocks. The square subblock formed by this method (ICHL) is composed by the impair columns and half lines in the middle of the block.The mass center direction computed from the subblock formed by the ILHC method can determine if the block has vertical-left or vertical-right correlation direction. Also, the mass center direction computed from the subblock formed by the ICHL method can determine if the block has horizontal-up or horizontal-down correlation direction.Based on the block correlation direction determined by the mass center method and subsampling techniques, the best intraprediction candidates are chosen for RDO calculation during intraprediction. The experiment results reveal that the proposed correlation direction detection algorithm can provide better coding performance and time reduction comparing to the previous algorithms.This paper is organized as follows. The proposed fast and efficient intraprediction algorithm will be illustrated in Section2. In Section 3, we present the experimental results and discuss the performance of the proposed algorithm, and, then, we conclude this paper in Section 4.


## 2. The Proposed Algorithm

In this section, the observations which motivate the basic idea of the proposed subsampling techniques will be discussed first. Then the proposed method will be introduced in detail, including the two proposed subsampling techniques and block correlation direction determination. Finally, to further reduce the computational complexity for intracoding in H.264/AVC, a fast intramode decision algorithm is introduced, while maintaining the original coding performance very well.


### 2.1. Observations and the Two Proposed  Subsampling Techniques

#### 2.1.1. Observations

We observed that when the block has a correlation direction, such as horizontal, vertical, diagonal-right, and diagonal-left, this block has a symmetry axis through the center of this block. The direction of this axis is perpendicular to the direction of the homogeneous pixels of the block. Figure2 shows these four correlation directions and their corresponding symmetry axes for 5
×
5 blocks. Also, we observed that when the block has a correlation direction, such as horizontal-up, horizontal-down, vertical-left, and vertical-right, this block does not have a symmetry axis through the center of this block. We note that this is valid for all block sizes.(a) The5
×
5 block horizontal homogeneous pixels and their corresponding symmetry axes. (b) The 5
×
5 block vertical homogeneous pixels and their corresponding symmetry axes. (c) The 5
×
5 block diagonal-right homogeneous pixels and their corresponding symmetry axes. (d) The 5
×
5 block diagonal-left homogeneous pixels and their corresponding symmetry axes.
(a)
(b)
(c)
(d)


#### 2.1.2. The Proposed ILHC Subsampling Method

The proposed ILHC subsampling method forms square subblocks by subsampling the pixels of the block with two main steps. In the first, it selects the impair lines of the block. In the second, it selects the half columns in the middle of the block.Figure3(a) shows the two 5
×
5 blocks and theirs corresponding square subblocks formed by ILHC subsampling method. We observed, from this figure, that the subblock formed by the proposed ILHC subsampling method for the block having, respectively, the vertical-left and vertical-right directional homogeneous pixels has a diagonal-left and diagonal-right directional homogeneous pixels. Hence, each subblock of these subblocks has a symmetry axis through the center of this subblock.(a) The two5
×
5 blocks and their corresponding square subblocks formed by ILHC method. (b) The two 5
×
5 blocks and their corresponding square subblocks formed by ICHL method.
(a)
(b)


#### 2.1.3. The Proposed ICHL Subsampling Method

The proposed ICHL subsampling method forms square subblocks by subsampling the pixels of the block with two main steps. In the first, it selects the impair columns of the block. In the second, it selects the half lines in the middle of the block.Figure3(b) shows the two 5
×
5 blocks and theirs corresponding square subblocks formed by ICHL subsampling method. from this figure we observed that the subblock formed by the proposed ICHL subsampling method for the block having, respectively, the horizontal-up and horizontal-down directional homogeneous pixels has diagonal-left and dia-gonal-right directional homogeneous pixels. Hence, each subblock of these subblocks has a symmetry axis through the center of this sub-block.We conclude that the eight correlation directions of the block can be determined if we determine the vector direction of the symmetry axis of the block (or of the subblock formed by the subsampling techniques). In this paper we prove that this direction can be determined by the mass center method. In the next section, we detail the relationship between the symmetry axes direction and mass center direction of the block.


### 2.2. Block Symmetry Axes Direction Determination

The principle of the mass center scheme is applied to the determination of the block symmetry axes. In this section, we prove that the symmetry axes direction of the block is parallel to the mass center direction of the block.


#### 2.2.1. Mass Center Theory

In this study, gray levels are regarded as the pixel mass. For a block, in a luma (or chroma) picture, we define the corresponding mass center vector,G
⟶
=
{
G
x
,
G
y
}, as
(1)
G
x
=
1
S
I
∑
x
=
x
0
x
0
+
N
∑
y
=
y
0
y
0
+
M
x
×
I
x
,
y
G
y
=
1
S
I
∑
x
=
x
0
x
0
+
N
∑
y
=
y
0
y
0
+
M
y
×
I
x
,
y
,
where I
x
,
y is the intensity of the pixel of location (
x
,
y
) of a block, (
G
x
,
G
y
) is the coordinate of the mass center of a block, (
x
0
,
y
0
) is the coordinate of the pixel up-left of a block, and (
M
+
1
,
N
+
1
) is the block dimension. S
I represents the sum of block pixels intensity values; the formula of the equation used for computation of this sum is defined as follows:
(2)
S
I
=
∑
x
=
x
0
x
0
+
N
‍
∑
y
=
y
0
y
0
+
M
‍
I
x
,
y
.The direction of the block mass center vector (G
⟶) is computed by
(3)
Ang
(
G
⟶
)
=
180
π
arctan
(
G
y
G
x
)
.


#### 2.2.2. Block Symmetry Axes Direction Determination with Mass Center Direction

A symmetry axes direction of the block can be obtained by using the mass center method. The following simple proof verifies that the mass center vector direction represents the symmetry axis direction of the block and is taken as the basis of the proposed algorithm.Suppose that in an orthonormal coordinate system(
O
,
i
⟶
,
j
⟶
), the origin is chosen to be the block’s center, i represents the horizontal direction to the right and j the vertical direction to the bottom, and each block N
×
N, N is an impair value (i.e., N
=
2
m
+
1 which m
=
{
2
,
4
,
8
}), and the possible correlation directions of this block are horizontal, vertical, diagonal-right, and diagonal-left direction; then the mass center vector direction is parallel to the symmetry axis direction of this block.Proof.
Vertical direction correlation block: we letL
v be the line through the origin O and parallel to the vector V
L
v
=
(
x
,
0
), where x is an integer number except zero. This line L
v is the symmetry axis of the vertical direction correlation block (see observation 1). Hence, all pixels in this block that are symmetrical with this line L
v have the same intensity and can be written as
(4)
I
x
,
y
=
I
x
,
-
y
,
-
m
≤
x
,
y
≤
m
.
The coordinates of the mass center of this block can be written as(5)
G
x
=
1
S
I
∑
x
=
-
m
m
‍
∑
y
=
-
m
m
‍
I
x
,
y
×
x
=
1
S
I
∑
x
=
-
m
m
‍
N
×
I
x
,
0
×
x
,
G
y
=
1
S
I
∑
y
=
-
m
m
‍
∑
x
=
-
m
m
‍
I
x
,
y
×
y
=
1
S
I
∑
y
=
1
m
‍
[
∑
x
=
-
m
m
‍
I
x
,
y
×
y
+
∑
x
=
-
m
m
‍
I
x
,
-
y
×
(
-
y
)
]
=
0
.
Hence, the mass center vector of this block isG
=
(
κ
,
0
), where κ is a constant value. From these computations, we found that the direction of the mass center vector is parallel to the symmetry axis direction of this block.
Horizontal direction correlation block: we letL
h be the line through the origin O and parallel to the vector V
h
=
(
0
,
y
), where y is an integer number except zero. This line L
h is the symmetry line of the horizontal direction correlation block (see observation 1). The pixels of this block that are symmetrical with this line L
h have the same intensity. This later expression can be written by this equality
(6)
I
x
,
y
=
I
-
x
,
y
,
-
m
≤
x
,
y
≤
m
.
The coordinates of the mass center of this block can be written as(7)
G
x
=
1
S
I
∑
x
=
1
m
[
∑
y
=
-
m
m
‍
I
x
,
y
×
x
+
∑
y
=
-
m
m
‍
I
-
x
,
y
×
(
-
x
)
]
=
0
G
y
=
1
S
I
∑
y
=
-
m
m
∑
x
=
-
m
m
‍
I
x
,
y
×
y
.
‍
=
1
S
I
∑
y
=
-
m
m
‍
N
×
I
0
,
y
×
y
.
From these computations, the mass center vector of horizontal direction correlation block is written byG
=
(
0
,
κ
), where κ is a constant value. Then the direction of this vector G is parallel to the symmetry axis of this block.


### 2.3. Mass Center Direction and Intraprediction Mode Candidates in H.264/AVC

In H.264/AVC, intraprediction uses different block sizes, and each block has a limited number of the intraprediction direction. Hence, we use the angle of the mass center vector of the block to determine the intraprediction mode of this block.


#### 2.3.1.4
×
4 Luma Block Directional Correlation

The4
×
4 luma blocks are more suitable to predict the pictures with significant details. There are nine prediction modes, the DC prediction mode and eight directional prediction modes. We classified these directional prediction modes into three classes: the first class, named by class 1, contains the mode 0: the vertical prediction mode, mode 1: the horizontal prediction mode, mode 3: the diagonal-left mode, and mode 4: the diagonal-right mode. The second class, named by class 2, contains the mode 5: the vertical-right mode and mode 7: the vertical-left mode. The third class, named by class 3, contain mode 6: the horizontal-down mode and mode 8: the horizontal-up mode. In the following, the corresponding mass center direction of each mode of each classes modes prediction of the 4
×
4 blocks is determined:
(8)
I
4
×
4
=
{
Mode
3
β
1
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
Mode
0
β
1
∈
]
7
π
16
+
k
π
,
9
π
16
+
k
π
]
Mode
4
β
1
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
1
β
1
∈
[
-
π
16
+
k
π
,
π
16
+
k
π
]
Mode
5
β
2
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
7
β
2
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
Mode
6
β
3
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
8
β
3
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
k
=
{
0,1
}
.
The angle β
1 is computed as β
1
=
θ
1
-
π
/
2, where θ
1 is the angle of the 4
×
4 block mass center computed by (3). The angle β
2 is computed as β
2
=
θ
2
-
π
/
2, where θ
2 is the mass center angle, computed by (3), for the subblocks formed by ICHL method. The angle β
3 is computed as β
3
=
θ
3
-
π
/
2, where θ
3 is the mass center angle, computed by (3), for the subblocks formed by ILHC method.


#### 2.3.2.16
×
16 Luma Block Directional Correlation

In the case of16
×
16 luma blocks, there are only horizontal and vertical prediction modes, plus a plane prediction and a DC prediction mode. So, to determine the prediction mode candidate, we associate the directional correlation for horizontal and vertical prediction modes to their corresponding areas of the block’s mass center direction and the rest of this areas is associated with the plane mode.Therefore, for each16
×
16 luma block, the mass center direction of this block and their corresponding prediction modes are represented as follows. For each 16
×
16 luma block, let θ
4 be the mass center angle and let β
4
=
θ
4
-
π
/
2; then
(9)
I
16
×
16
=
{
Mode
1
β
4
∈
[
-
π
8
,
π
8
]
∪
[
-
π
8
+
π
,
π
8
+
π
]
Mode
0
β
4
∈
]
3
π
8
,
5
π
8
]
∪
]
3
π
8
+
π
,
5
π
8
+
π
]
.


### 2.4. Mode Decision Algorithm for Intraprediction

Based on the prediction mode determined by the mass center and subsampling techniques, the efficient and fast mode decision algorithms for intraprediction select a small number of the prediction modes as the best candidates to be used in RDO computation. So, we can determine the candidate mode for intracoding block size by the following rules.Step 1.
For each chroma block, two mass center directions are computed by using (3), one from component U and the other from component V. According to (9), the intraprediction mode for each component is selected.Step 2.
If these two intraprediction modes of the two components are identical; we chose this mode as the candidate intraprediction modes for RDO calculation; otherwise, the DC mode is the mode used in the RDO calculation.Step 3.
The direction of the mass center vector is computed for the16
×
16 block by using (3). According to (9), the mode that corresponds to this direction is chosen as a candidate intraprediction mode for RDO computation. In addition to this mode, the DC mode is also chosen as the another intraprediction mode candidate for RDO computation.Step 4.
For each of the4
×
4 luma blocks (total number is sixteen for a MB), the directions of the mass center vector of the 4
×
4 block, of the subblock formed by IHCL technique, and of the subblock formed by ICHL technique are computed by using (3).Step 5.
According to (8), the modes that correspond to these directions are chosen as a candidate intraprediction modes for RDO computation. In addition to these modes, the DC mode is also chosen as the other intraprediction mode candidate for RDO computation.Step 6.
For each of the8
×
8 luma blocks (total number is four for a MB), the directions of the mass center vector of the 8
×
8 block, of the subblock formed by IHCL technique, and of the subblock formed by ICHL technique are computed by using (3).Step 7.
According to (8), the modes that correspond to these directions are chosen as a candidate intraprediction modes for RDO computation. In addition to these modes, the DC mode is also chosen as the another intraprediction mode candidate for RDO computation.


### 2.5. Computational Complexity Assessment

Table1 summarizes the number of candidates selected for RDO computation by the fast intraprediction methods. As can be seen from Table 1, the encoder with the proposed algorithm would need to perform only 1
×
(
1
×
16
+
1
×
4
+
2
)
=
22 if one intraprediction mode is selected by the mass center method for each 4
×
4 luma blocks and one for each 8
×
8 luma block. The upper limit of RDO calculations in our algorithm is 1
×
(
4
×
16
+
4
×
4
+
2
)
=
82 if three intraprediction modes are selected by the mass center method for each 4
×
4 luma block and three for each 8
×
8 luma blocks.Table 1
Comparison of the number of candidate modes.
Algorithms
Luma4
×
4
Luma8
×
8
Luma16
×
16
Chroma8
×
8
Min and max number of RDO computation
Reference [15]
2–5
2–5
2
1-2
042–204
Reference [16]
2
1–5
2–4
1-2
038–112
Proposed
1–4
1–4
2
1
022–082From these data, our proposed algorithm significantly reduces the number of RDO calculation, compared with the method presented in [15] (between 1
×
(
2
×
16
+
2
×
4
+
2
)
=
42 and 2
×
(
5
×
16
+
5
×
4
+
2
)
=
204
) and the method presented in [16] (between 1
×
(
2
×
16
+
1
×
4
+
2
)
=
38 and 2
×
(
2
×
16
+
5
×
4
+
4
)
=
112).


## 2.1. Observations and the Two Proposed  Subsampling Techniques

### 2.1.1. Observations

We observed that when the block has a correlation direction, such as horizontal, vertical, diagonal-right, and diagonal-left, this block has a symmetry axis through the center of this block. The direction of this axis is perpendicular to the direction of the homogeneous pixels of the block. Figure2 shows these four correlation directions and their corresponding symmetry axes for 5
×
5 blocks. Also, we observed that when the block has a correlation direction, such as horizontal-up, horizontal-down, vertical-left, and vertical-right, this block does not have a symmetry axis through the center of this block. We note that this is valid for all block sizes.(a) The5
×
5 block horizontal homogeneous pixels and their corresponding symmetry axes. (b) The 5
×
5 block vertical homogeneous pixels and their corresponding symmetry axes. (c) The 5
×
5 block diagonal-right homogeneous pixels and their corresponding symmetry axes. (d) The 5
×
5 block diagonal-left homogeneous pixels and their corresponding symmetry axes.
(a)
(b)
(c)
(d)


### 2.1.2. The Proposed ILHC Subsampling Method

The proposed ILHC subsampling method forms square subblocks by subsampling the pixels of the block with two main steps. In the first, it selects the impair lines of the block. In the second, it selects the half columns in the middle of the block.Figure3(a) shows the two 5
×
5 blocks and theirs corresponding square subblocks formed by ILHC subsampling method. We observed, from this figure, that the subblock formed by the proposed ILHC subsampling method for the block having, respectively, the vertical-left and vertical-right directional homogeneous pixels has a diagonal-left and diagonal-right directional homogeneous pixels. Hence, each subblock of these subblocks has a symmetry axis through the center of this subblock.(a) The two5
×
5 blocks and their corresponding square subblocks formed by ILHC method. (b) The two 5
×
5 blocks and their corresponding square subblocks formed by ICHL method.
(a)
(b)


### 2.1.3. The Proposed ICHL Subsampling Method

The proposed ICHL subsampling method forms square subblocks by subsampling the pixels of the block with two main steps. In the first, it selects the impair columns of the block. In the second, it selects the half lines in the middle of the block.Figure3(b) shows the two 5
×
5 blocks and theirs corresponding square subblocks formed by ICHL subsampling method. from this figure we observed that the subblock formed by the proposed ICHL subsampling method for the block having, respectively, the horizontal-up and horizontal-down directional homogeneous pixels has diagonal-left and dia-gonal-right directional homogeneous pixels. Hence, each subblock of these subblocks has a symmetry axis through the center of this sub-block.We conclude that the eight correlation directions of the block can be determined if we determine the vector direction of the symmetry axis of the block (or of the subblock formed by the subsampling techniques). In this paper we prove that this direction can be determined by the mass center method. In the next section, we detail the relationship between the symmetry axes direction and mass center direction of the block.


## 2.1.1. Observations

We observed that when the block has a correlation direction, such as horizontal, vertical, diagonal-right, and diagonal-left, this block has a symmetry axis through the center of this block. The direction of this axis is perpendicular to the direction of the homogeneous pixels of the block. Figure2 shows these four correlation directions and their corresponding symmetry axes for 5
×
5 blocks. Also, we observed that when the block has a correlation direction, such as horizontal-up, horizontal-down, vertical-left, and vertical-right, this block does not have a symmetry axis through the center of this block. We note that this is valid for all block sizes.(a) The5
×
5 block horizontal homogeneous pixels and their corresponding symmetry axes. (b) The 5
×
5 block vertical homogeneous pixels and their corresponding symmetry axes. (c) The 5
×
5 block diagonal-right homogeneous pixels and their corresponding symmetry axes. (d) The 5
×
5 block diagonal-left homogeneous pixels and their corresponding symmetry axes.
(a)
(b)
(c)
(d)


## 2.1.2. The Proposed ILHC Subsampling Method

The proposed ILHC subsampling method forms square subblocks by subsampling the pixels of the block with two main steps. In the first, it selects the impair lines of the block. In the second, it selects the half columns in the middle of the block.Figure3(a) shows the two 5
×
5 blocks and theirs corresponding square subblocks formed by ILHC subsampling method. We observed, from this figure, that the subblock formed by the proposed ILHC subsampling method for the block having, respectively, the vertical-left and vertical-right directional homogeneous pixels has a diagonal-left and diagonal-right directional homogeneous pixels. Hence, each subblock of these subblocks has a symmetry axis through the center of this subblock.(a) The two5
×
5 blocks and their corresponding square subblocks formed by ILHC method. (b) The two 5
×
5 blocks and their corresponding square subblocks formed by ICHL method.
(a)
(b)


## 2.1.3. The Proposed ICHL Subsampling Method

The proposed ICHL subsampling method forms square subblocks by subsampling the pixels of the block with two main steps. In the first, it selects the impair columns of the block. In the second, it selects the half lines in the middle of the block.Figure3(b) shows the two 5
×
5 blocks and theirs corresponding square subblocks formed by ICHL subsampling method. from this figure we observed that the subblock formed by the proposed ICHL subsampling method for the block having, respectively, the horizontal-up and horizontal-down directional homogeneous pixels has diagonal-left and dia-gonal-right directional homogeneous pixels. Hence, each subblock of these subblocks has a symmetry axis through the center of this sub-block.We conclude that the eight correlation directions of the block can be determined if we determine the vector direction of the symmetry axis of the block (or of the subblock formed by the subsampling techniques). In this paper we prove that this direction can be determined by the mass center method. In the next section, we detail the relationship between the symmetry axes direction and mass center direction of the block.


## 2.2. Block Symmetry Axes Direction Determination

The principle of the mass center scheme is applied to the determination of the block symmetry axes. In this section, we prove that the symmetry axes direction of the block is parallel to the mass center direction of the block.


### 2.2.1. Mass Center Theory

In this study, gray levels are regarded as the pixel mass. For a block, in a luma (or chroma) picture, we define the corresponding mass center vector,G
⟶
=
{
G
x
,
G
y
}, as
(1)
G
x
=
1
S
I
∑
x
=
x
0
x
0
+
N
∑
y
=
y
0
y
0
+
M
x
×
I
x
,
y
G
y
=
1
S
I
∑
x
=
x
0
x
0
+
N
∑
y
=
y
0
y
0
+
M
y
×
I
x
,
y
,
where I
x
,
y is the intensity of the pixel of location (
x
,
y
) of a block, (
G
x
,
G
y
) is the coordinate of the mass center of a block, (
x
0
,
y
0
) is the coordinate of the pixel up-left of a block, and (
M
+
1
,
N
+
1
) is the block dimension. S
I represents the sum of block pixels intensity values; the formula of the equation used for computation of this sum is defined as follows:
(2)
S
I
=
∑
x
=
x
0
x
0
+
N
‍
∑
y
=
y
0
y
0
+
M
‍
I
x
,
y
.The direction of the block mass center vector (G
⟶) is computed by
(3)
Ang
(
G
⟶
)
=
180
π
arctan
(
G
y
G
x
)
.


### 2.2.2. Block Symmetry Axes Direction Determination with Mass Center Direction

A symmetry axes direction of the block can be obtained by using the mass center method. The following simple proof verifies that the mass center vector direction represents the symmetry axis direction of the block and is taken as the basis of the proposed algorithm.Suppose that in an orthonormal coordinate system(
O
,
i
⟶
,
j
⟶
), the origin is chosen to be the block’s center, i represents the horizontal direction to the right and j the vertical direction to the bottom, and each block N
×
N, N is an impair value (i.e., N
=
2
m
+
1 which m
=
{
2
,
4
,
8
}), and the possible correlation directions of this block are horizontal, vertical, diagonal-right, and diagonal-left direction; then the mass center vector direction is parallel to the symmetry axis direction of this block.Proof.
Vertical direction correlation block: we letL
v be the line through the origin O and parallel to the vector V
L
v
=
(
x
,
0
), where x is an integer number except zero. This line L
v is the symmetry axis of the vertical direction correlation block (see observation 1). Hence, all pixels in this block that are symmetrical with this line L
v have the same intensity and can be written as
(4)
I
x
,
y
=
I
x
,
-
y
,
-
m
≤
x
,
y
≤
m
.
The coordinates of the mass center of this block can be written as(5)
G
x
=
1
S
I
∑
x
=
-
m
m
‍
∑
y
=
-
m
m
‍
I
x
,
y
×
x
=
1
S
I
∑
x
=
-
m
m
‍
N
×
I
x
,
0
×
x
,
G
y
=
1
S
I
∑
y
=
-
m
m
‍
∑
x
=
-
m
m
‍
I
x
,
y
×
y
=
1
S
I
∑
y
=
1
m
‍
[
∑
x
=
-
m
m
‍
I
x
,
y
×
y
+
∑
x
=
-
m
m
‍
I
x
,
-
y
×
(
-
y
)
]
=
0
.
Hence, the mass center vector of this block isG
=
(
κ
,
0
), where κ is a constant value. From these computations, we found that the direction of the mass center vector is parallel to the symmetry axis direction of this block.
Horizontal direction correlation block: we letL
h be the line through the origin O and parallel to the vector V
h
=
(
0
,
y
), where y is an integer number except zero. This line L
h is the symmetry line of the horizontal direction correlation block (see observation 1). The pixels of this block that are symmetrical with this line L
h have the same intensity. This later expression can be written by this equality
(6)
I
x
,
y
=
I
-
x
,
y
,
-
m
≤
x
,
y
≤
m
.
The coordinates of the mass center of this block can be written as(7)
G
x
=
1
S
I
∑
x
=
1
m
[
∑
y
=
-
m
m
‍
I
x
,
y
×
x
+
∑
y
=
-
m
m
‍
I
-
x
,
y
×
(
-
x
)
]
=
0
G
y
=
1
S
I
∑
y
=
-
m
m
∑
x
=
-
m
m
‍
I
x
,
y
×
y
.
‍
=
1
S
I
∑
y
=
-
m
m
‍
N
×
I
0
,
y
×
y
.
From these computations, the mass center vector of horizontal direction correlation block is written byG
=
(
0
,
κ
), where κ is a constant value. Then the direction of this vector G is parallel to the symmetry axis of this block.


## 2.2.1. Mass Center Theory

In this study, gray levels are regarded as the pixel mass. For a block, in a luma (or chroma) picture, we define the corresponding mass center vector,G
⟶
=
{
G
x
,
G
y
}, as
(1)
G
x
=
1
S
I
∑
x
=
x
0
x
0
+
N
∑
y
=
y
0
y
0
+
M
x
×
I
x
,
y
G
y
=
1
S
I
∑
x
=
x
0
x
0
+
N
∑
y
=
y
0
y
0
+
M
y
×
I
x
,
y
,
where I
x
,
y is the intensity of the pixel of location (
x
,
y
) of a block, (
G
x
,
G
y
) is the coordinate of the mass center of a block, (
x
0
,
y
0
) is the coordinate of the pixel up-left of a block, and (
M
+
1
,
N
+
1
) is the block dimension. S
I represents the sum of block pixels intensity values; the formula of the equation used for computation of this sum is defined as follows:
(2)
S
I
=
∑
x
=
x
0
x
0
+
N
‍
∑
y
=
y
0
y
0
+
M
‍
I
x
,
y
.The direction of the block mass center vector (G
⟶) is computed by
(3)
Ang
(
G
⟶
)
=
180
π
arctan
(
G
y
G
x
)
.


## 2.2.2. Block Symmetry Axes Direction Determination with Mass Center Direction

A symmetry axes direction of the block can be obtained by using the mass center method. The following simple proof verifies that the mass center vector direction represents the symmetry axis direction of the block and is taken as the basis of the proposed algorithm.Suppose that in an orthonormal coordinate system(
O
,
i
⟶
,
j
⟶
), the origin is chosen to be the block’s center, i represents the horizontal direction to the right and j the vertical direction to the bottom, and each block N
×
N, N is an impair value (i.e., N
=
2
m
+
1 which m
=
{
2
,
4
,
8
}), and the possible correlation directions of this block are horizontal, vertical, diagonal-right, and diagonal-left direction; then the mass center vector direction is parallel to the symmetry axis direction of this block.Proof.
Vertical direction correlation block: we letL
v be the line through the origin O and parallel to the vector V
L
v
=
(
x
,
0
), where x is an integer number except zero. This line L
v is the symmetry axis of the vertical direction correlation block (see observation 1). Hence, all pixels in this block that are symmetrical with this line L
v have the same intensity and can be written as
(4)
I
x
,
y
=
I
x
,
-
y
,
-
m
≤
x
,
y
≤
m
.
The coordinates of the mass center of this block can be written as(5)
G
x
=
1
S
I
∑
x
=
-
m
m
‍
∑
y
=
-
m
m
‍
I
x
,
y
×
x
=
1
S
I
∑
x
=
-
m
m
‍
N
×
I
x
,
0
×
x
,
G
y
=
1
S
I
∑
y
=
-
m
m
‍
∑
x
=
-
m
m
‍
I
x
,
y
×
y
=
1
S
I
∑
y
=
1
m
‍
[
∑
x
=
-
m
m
‍
I
x
,
y
×
y
+
∑
x
=
-
m
m
‍
I
x
,
-
y
×
(
-
y
)
]
=
0
.
Hence, the mass center vector of this block isG
=
(
κ
,
0
), where κ is a constant value. From these computations, we found that the direction of the mass center vector is parallel to the symmetry axis direction of this block.
Horizontal direction correlation block: we letL
h be the line through the origin O and parallel to the vector V
h
=
(
0
,
y
), where y is an integer number except zero. This line L
h is the symmetry line of the horizontal direction correlation block (see observation 1). The pixels of this block that are symmetrical with this line L
h have the same intensity. This later expression can be written by this equality
(6)
I
x
,
y
=
I
-
x
,
y
,
-
m
≤
x
,
y
≤
m
.
The coordinates of the mass center of this block can be written as(7)
G
x
=
1
S
I
∑
x
=
1
m
[
∑
y
=
-
m
m
‍
I
x
,
y
×
x
+
∑
y
=
-
m
m
‍
I
-
x
,
y
×
(
-
x
)
]
=
0
G
y
=
1
S
I
∑
y
=
-
m
m
∑
x
=
-
m
m
‍
I
x
,
y
×
y
.
‍
=
1
S
I
∑
y
=
-
m
m
‍
N
×
I
0
,
y
×
y
.
From these computations, the mass center vector of horizontal direction correlation block is written byG
=
(
0
,
κ
), where κ is a constant value. Then the direction of this vector G is parallel to the symmetry axis of this block.


## 2.3. Mass Center Direction and Intraprediction Mode Candidates in H.264/AVC

In H.264/AVC, intraprediction uses different block sizes, and each block has a limited number of the intraprediction direction. Hence, we use the angle of the mass center vector of the block to determine the intraprediction mode of this block.


### 2.3.1.4
×
4 Luma Block Directional Correlation

The4
×
4 luma blocks are more suitable to predict the pictures with significant details. There are nine prediction modes, the DC prediction mode and eight directional prediction modes. We classified these directional prediction modes into three classes: the first class, named by class 1, contains the mode 0: the vertical prediction mode, mode 1: the horizontal prediction mode, mode 3: the diagonal-left mode, and mode 4: the diagonal-right mode. The second class, named by class 2, contains the mode 5: the vertical-right mode and mode 7: the vertical-left mode. The third class, named by class 3, contain mode 6: the horizontal-down mode and mode 8: the horizontal-up mode. In the following, the corresponding mass center direction of each mode of each classes modes prediction of the 4
×
4 blocks is determined:
(8)
I
4
×
4
=
{
Mode
3
β
1
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
Mode
0
β
1
∈
]
7
π
16
+
k
π
,
9
π
16
+
k
π
]
Mode
4
β
1
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
1
β
1
∈
[
-
π
16
+
k
π
,
π
16
+
k
π
]
Mode
5
β
2
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
7
β
2
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
Mode
6
β
3
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
8
β
3
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
k
=
{
0,1
}
.
The angle β
1 is computed as β
1
=
θ
1
-
π
/
2, where θ
1 is the angle of the 4
×
4 block mass center computed by (3). The angle β
2 is computed as β
2
=
θ
2
-
π
/
2, where θ
2 is the mass center angle, computed by (3), for the subblocks formed by ICHL method. The angle β
3 is computed as β
3
=
θ
3
-
π
/
2, where θ
3 is the mass center angle, computed by (3), for the subblocks formed by ILHC method.


### 2.3.2.16
×
16 Luma Block Directional Correlation

In the case of16
×
16 luma blocks, there are only horizontal and vertical prediction modes, plus a plane prediction and a DC prediction mode. So, to determine the prediction mode candidate, we associate the directional correlation for horizontal and vertical prediction modes to their corresponding areas of the block’s mass center direction and the rest of this areas is associated with the plane mode.Therefore, for each16
×
16 luma block, the mass center direction of this block and their corresponding prediction modes are represented as follows. For each 16
×
16 luma block, let θ
4 be the mass center angle and let β
4
=
θ
4
-
π
/
2; then
(9)
I
16
×
16
=
{
Mode
1
β
4
∈
[
-
π
8
,
π
8
]
∪
[
-
π
8
+
π
,
π
8
+
π
]
Mode
0
β
4
∈
]
3
π
8
,
5
π
8
]
∪
]
3
π
8
+
π
,
5
π
8
+
π
]
.


## 2.3.1.4
×
4 Luma Block Directional Correlation

The4
×
4 luma blocks are more suitable to predict the pictures with significant details. There are nine prediction modes, the DC prediction mode and eight directional prediction modes. We classified these directional prediction modes into three classes: the first class, named by class 1, contains the mode 0: the vertical prediction mode, mode 1: the horizontal prediction mode, mode 3: the diagonal-left mode, and mode 4: the diagonal-right mode. The second class, named by class 2, contains the mode 5: the vertical-right mode and mode 7: the vertical-left mode. The third class, named by class 3, contain mode 6: the horizontal-down mode and mode 8: the horizontal-up mode. In the following, the corresponding mass center direction of each mode of each classes modes prediction of the 4
×
4 blocks is determined:
(8)
I
4
×
4
=
{
Mode
3
β
1
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
Mode
0
β
1
∈
]
7
π
16
+
k
π
,
9
π
16
+
k
π
]
Mode
4
β
1
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
1
β
1
∈
[
-
π
16
+
k
π
,
π
16
+
k
π
]
Mode
5
β
2
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
7
β
2
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
Mode
6
β
3
∈
]
11
π
16
+
k
π
,
13
π
16
+
k
π
]
Mode
8
β
3
∈
]
3
π
16
+
k
π
,
5
π
16
+
k
π
]
k
=
{
0,1
}
.
The angle β
1 is computed as β
1
=
θ
1
-
π
/
2, where θ
1 is the angle of the 4
×
4 block mass center computed by (3). The angle β
2 is computed as β
2
=
θ
2
-
π
/
2, where θ
2 is the mass center angle, computed by (3), for the subblocks formed by ICHL method. The angle β
3 is computed as β
3
=
θ
3
-
π
/
2, where θ
3 is the mass center angle, computed by (3), for the subblocks formed by ILHC method.


## 2.3.2.16
×
16 Luma Block Directional Correlation

In the case of16
×
16 luma blocks, there are only horizontal and vertical prediction modes, plus a plane prediction and a DC prediction mode. So, to determine the prediction mode candidate, we associate the directional correlation for horizontal and vertical prediction modes to their corresponding areas of the block’s mass center direction and the rest of this areas is associated with the plane mode.Therefore, for each16
×
16 luma block, the mass center direction of this block and their corresponding prediction modes are represented as follows. For each 16
×
16 luma block, let θ
4 be the mass center angle and let β
4
=
θ
4
-
π
/
2; then
(9)
I
16
×
16
=
{
Mode
1
β
4
∈
[
-
π
8
,
π
8
]
∪
[
-
π
8
+
π
,
π
8
+
π
]
Mode
0
β
4
∈
]
3
π
8
,
5
π
8
]
∪
]
3
π
8
+
π
,
5
π
8
+
π
]
.


## 2.4. Mode Decision Algorithm for Intraprediction

Based on the prediction mode determined by the mass center and subsampling techniques, the efficient and fast mode decision algorithms for intraprediction select a small number of the prediction modes as the best candidates to be used in RDO computation. So, we can determine the candidate mode for intracoding block size by the following rules.Step 1.
For each chroma block, two mass center directions are computed by using (3), one from component U and the other from component V. According to (9), the intraprediction mode for each component is selected.Step 2.
If these two intraprediction modes of the two components are identical; we chose this mode as the candidate intraprediction modes for RDO calculation; otherwise, the DC mode is the mode used in the RDO calculation.Step 3.
The direction of the mass center vector is computed for the16
×
16 block by using (3). According to (9), the mode that corresponds to this direction is chosen as a candidate intraprediction mode for RDO computation. In addition to this mode, the DC mode is also chosen as the another intraprediction mode candidate for RDO computation.Step 4.
For each of the4
×
4 luma blocks (total number is sixteen for a MB), the directions of the mass center vector of the 4
×
4 block, of the subblock formed by IHCL technique, and of the subblock formed by ICHL technique are computed by using (3).Step 5.
According to (8), the modes that correspond to these directions are chosen as a candidate intraprediction modes for RDO computation. In addition to these modes, the DC mode is also chosen as the other intraprediction mode candidate for RDO computation.Step 6.
For each of the8
×
8 luma blocks (total number is four for a MB), the directions of the mass center vector of the 8
×
8 block, of the subblock formed by IHCL technique, and of the subblock formed by ICHL technique are computed by using (3).Step 7.
According to (8), the modes that correspond to these directions are chosen as a candidate intraprediction modes for RDO computation. In addition to these modes, the DC mode is also chosen as the another intraprediction mode candidate for RDO computation.


## 2.5. Computational Complexity Assessment

Table1 summarizes the number of candidates selected for RDO computation by the fast intraprediction methods. As can be seen from Table 1, the encoder with the proposed algorithm would need to perform only 1
×
(
1
×
16
+
1
×
4
+
2
)
=
22 if one intraprediction mode is selected by the mass center method for each 4
×
4 luma blocks and one for each 8
×
8 luma block. The upper limit of RDO calculations in our algorithm is 1
×
(
4
×
16
+
4
×
4
+
2
)
=
82 if three intraprediction modes are selected by the mass center method for each 4
×
4 luma block and three for each 8
×
8 luma blocks.Table 1
Comparison of the number of candidate modes.
Algorithms
Luma4
×
4
Luma8
×
8
Luma16
×
16
Chroma8
×
8
Min and max number of RDO computation
Reference [15]
2–5
2–5
2
1-2
042–204
Reference [16]
2
1–5
2–4
1-2
038–112
Proposed
1–4
1–4
2
1
022–082From these data, our proposed algorithm significantly reduces the number of RDO calculation, compared with the method presented in [15] (between 1
×
(
2
×
16
+
2
×
4
+
2
)
=
42 and 2
×
(
5
×
16
+
5
×
4
+
2
)
=
204
) and the method presented in [16] (between 1
×
(
2
×
16
+
1
×
4
+
2
)
=
38 and 2
×
(
2
×
16
+
5
×
4
+
4
)
=
112).


## 3. Experimental Results and Discussion

As the most previous methods do not support intra8
×
8 block, this section presents simulation results based on Chen et al.’s algorithm [15], ELyousfi’s algorithm [16], and the proposed fast and efficient intraprediction algorithm in H.264/AVC.


### 3.1. Coding Conditions

All the algorithms were implemented into H.264/AVC reference softwareJM
18.0 [23]. The system platform is the Intel (R) Core (TM)2 Duo CPU Processor of speed 3.4 GHz, 4.00 Gbytes RAM, and Microsoft Windows Vista. The simulation condition is as RD optimization is enabled, CABAC is enabled, GOP structure is full I, the number of frames of each sequence is 150, and FREXT Profile: high profile. The group of experiments were carried out on the test sequences with the 4 quantization parameters; that is, QP
=
28
,
32
,
36, and 40. The averaged PSNR values of luma (Y) and chroma (U
,
V) are used and are based on the following equations:
(10)
PSNR
¯
=
10
×
lo
g
10
(
25
5
2
MSE
¯
)
,
where (MSE
¯) is the average mean square error [16].The comparisons with the case of exhaustive search were performed with respect to thePSNR difference (Δ
PSNR), the data bits rate difference (Δ
Bit), and the difference of coding time (Δ
Time).In order to evaluate the time saving of the fast prediction algorithm, the following calculation is defined to find the time differences. LetT
JM denote the coding time used by full search intraprediction algorithm of JM18.0 encoder and let T
FI be the time taken by the fast mode decision algorithm; the time difference is defined as
(11)
Δ
Time
=
T
FI
-
T
JM
T
JM
×
100
%
.PSNR and bit-rate differences are calculated according to the numerical averages between the RD-curves derived from JM18.0 encoder and the fast algorithm, respectively. The detailed procedures in calculating these differences can be found from a JVT document authored by Bjontegaard [24].


### 3.2. Coding Performances

In this experiment, a total number of 150 frames are used for each sequence, and the period of I-frames is set to 1; that is, all the frames in the sequence are intracoded. In all the I-frames structure encoding, for each MB in each frame of this sequence, intracoding is chosen as the possible coding modes in RDO operation; thus great time saving is expected by using the fast intracoding algorithms for this structure encoding. Table2 shows the simulation results of the proposed algorithm and Chen et al.’s [15] and Elyousfi’s [16] algorithms for various sequences with all intraframes type. Notice that in the table, positive values mean increments and negative values mean decrements.Table 2
Simulation results for all intraframes sequences.
Sequences
Δ
T
i
m
e
Δ
P
S
N
R
Δ
B
i
t
r
a
t
e
Format
Name
Reference [15]
Reference [16]
Proposed
Reference [15]
Reference [16]
Proposed
Reference [15]
Reference [16]
Proposed
QCIF
Silent
−64.855
−87.711
−92.890
−0.088
−0.134
−0.044
0.994
1.219
0.327
Container
−64.309
−80.062
−89.733
−0.106
−0.148
−0.050
1.020
1.369
0.488
Foreman
−60.426
−74.167
−84.592
−0.119
−0.153
−0.048
1.952
2.682
1.203
Hall
−68.100
−87.697
−93.747
−0.056
−0.129
−0.033
1.003
1.205
0.340
CIF
Foreman
−63.571
−75.347
−83.283
−0.103
−0.187
−0.069
2.884
3.110
1.084
Coastguard
−61.330
−75.066
−82.891
−0.147
−0.159
−0.053
2.922
3.790
1.347
Paris
−59.846
−76.884
−84.694
−0.085
−0.094
−0.031
1.470
2.178
0.728
News
−66.109
−87.650
−93.455
−0.047
−0.127
−0.024
0.825
1.090
0.390
720 p
Crew
−67.466
−82.388
−90.176
−0.089
−0.107
−0.055
1.077
1.146
0.366
Parkrun
−54.992
−71.105
−83.800
−0.072
−0.122
−0.058
0.962
1.130
0.288
Shields
−64.004
−78.503
−87.561
−0.069
−0.113
−0.041
0.883
1.193
0.211
Average
−63.183
−79.689
−87.893
−0.089
−0.134
−0.046
1.454
1.828
0.616The results show that the proposed schemes reduced execution time greater than 87.893% with only an average of 0.046 dB losses in PSNR and 0.616% increments in bitrate only. These results are compared to those obtained with Chen et al.’s [15] and Elyousfi’s [16] algorithms where the time coding is reduced in average, respectively, to 63.183% and 79.689% with an average of 0.089 dB and 0.134 dB losses in PSNR and, respectively, 1.454% and 1.828% increments in bitrate.The proposed schemes achieve faster encoding in intraprediction compared to the Chen et al.’s [15] and Elyousfi’s [16], with little RD performance enhancement. Figures 4 and 5 show the RD performance and the computation time for the all I-frames sequence “News,” respectively. In Figure 4, three RD curves resulting from the Chen et al.’s algorithm [15], Elyousfi’s algorithm [16], and the proposed schemes are nearly overlapping each other that our proposed algorithm has greater performances as compared to the other approaches in terms of PSNR and data bits but offers higher computation time saving as shown in Figure 5.Figure 4
Comparison of PSNR for the all intrasequences of news.Figure 5
The computational time comparison of news all intrasequence.


## 3.1. Coding Conditions

All the algorithms were implemented into H.264/AVC reference softwareJM
18.0 [23]. The system platform is the Intel (R) Core (TM)2 Duo CPU Processor of speed 3.4 GHz, 4.00 Gbytes RAM, and Microsoft Windows Vista. The simulation condition is as RD optimization is enabled, CABAC is enabled, GOP structure is full I, the number of frames of each sequence is 150, and FREXT Profile: high profile. The group of experiments were carried out on the test sequences with the 4 quantization parameters; that is, QP
=
28
,
32
,
36, and 40. The averaged PSNR values of luma (Y) and chroma (U
,
V) are used and are based on the following equations:
(10)
PSNR
¯
=
10
×
lo
g
10
(
25
5
2
MSE
¯
)
,
where (MSE
¯) is the average mean square error [16].The comparisons with the case of exhaustive search were performed with respect to thePSNR difference (Δ
PSNR), the data bits rate difference (Δ
Bit), and the difference of coding time (Δ
Time).In order to evaluate the time saving of the fast prediction algorithm, the following calculation is defined to find the time differences. LetT
JM denote the coding time used by full search intraprediction algorithm of JM18.0 encoder and let T
FI be the time taken by the fast mode decision algorithm; the time difference is defined as
(11)
Δ
Time
=
T
FI
-
T
JM
T
JM
×
100
%
.PSNR and bit-rate differences are calculated according to the numerical averages between the RD-curves derived from JM18.0 encoder and the fast algorithm, respectively. The detailed procedures in calculating these differences can be found from a JVT document authored by Bjontegaard [24].


## 3.2. Coding Performances

In this experiment, a total number of 150 frames are used for each sequence, and the period of I-frames is set to 1; that is, all the frames in the sequence are intracoded. In all the I-frames structure encoding, for each MB in each frame of this sequence, intracoding is chosen as the possible coding modes in RDO operation; thus great time saving is expected by using the fast intracoding algorithms for this structure encoding. Table2 shows the simulation results of the proposed algorithm and Chen et al.’s [15] and Elyousfi’s [16] algorithms for various sequences with all intraframes type. Notice that in the table, positive values mean increments and negative values mean decrements.Table 2
Simulation results for all intraframes sequences.
Sequences
Δ
T
i
m
e
Δ
P
S
N
R
Δ
B
i
t
r
a
t
e
Format
Name
Reference [15]
Reference [16]
Proposed
Reference [15]
Reference [16]
Proposed
Reference [15]
Reference [16]
Proposed
QCIF
Silent
−64.855
−87.711
−92.890
−0.088
−0.134
−0.044
0.994
1.219
0.327
Container
−64.309
−80.062
−89.733
−0.106
−0.148
−0.050
1.020
1.369
0.488
Foreman
−60.426
−74.167
−84.592
−0.119
−0.153
−0.048
1.952
2.682
1.203
Hall
−68.100
−87.697
−93.747
−0.056
−0.129
−0.033
1.003
1.205
0.340
CIF
Foreman
−63.571
−75.347
−83.283
−0.103
−0.187
−0.069
2.884
3.110
1.084
Coastguard
−61.330
−75.066
−82.891
−0.147
−0.159
−0.053
2.922
3.790
1.347
Paris
−59.846
−76.884
−84.694
−0.085
−0.094
−0.031
1.470
2.178
0.728
News
−66.109
−87.650
−93.455
−0.047
−0.127
−0.024
0.825
1.090
0.390
720 p
Crew
−67.466
−82.388
−90.176
−0.089
−0.107
−0.055
1.077
1.146
0.366
Parkrun
−54.992
−71.105
−83.800
−0.072
−0.122
−0.058
0.962
1.130
0.288
Shields
−64.004
−78.503
−87.561
−0.069
−0.113
−0.041
0.883
1.193
0.211
Average
−63.183
−79.689
−87.893
−0.089
−0.134
−0.046
1.454
1.828
0.616The results show that the proposed schemes reduced execution time greater than 87.893% with only an average of 0.046 dB losses in PSNR and 0.616% increments in bitrate only. These results are compared to those obtained with Chen et al.’s [15] and Elyousfi’s [16] algorithms where the time coding is reduced in average, respectively, to 63.183% and 79.689% with an average of 0.089 dB and 0.134 dB losses in PSNR and, respectively, 1.454% and 1.828% increments in bitrate.The proposed schemes achieve faster encoding in intraprediction compared to the Chen et al.’s [15] and Elyousfi’s [16], with little RD performance enhancement. Figures 4 and 5 show the RD performance and the computation time for the all I-frames sequence “News,” respectively. In Figure 4, three RD curves resulting from the Chen et al.’s algorithm [15], Elyousfi’s algorithm [16], and the proposed schemes are nearly overlapping each other that our proposed algorithm has greater performances as compared to the other approaches in terms of PSNR and data bits but offers higher computation time saving as shown in Figure 5.Figure 4
Comparison of PSNR for the all intrasequences of news.Figure 5
The computational time comparison of news all intrasequence.


## 4. Conclusion

This paper presented an improved fast intraprediction in H.264/AVC algorithm based on mass center method and two subsampling techniques. Extensive experimental results show that the proposed method can achieve 87.893% total encoding time reduction with only 0.046 dB PSNR degradation and 0.616% bit rate increase on average. This performance is more efficient than most of the well-known fast intramode decision algorithms for H.264/AVC.



---

*Source: 621680-2014-05-20.xml*