Http://www.google.cn/search? Complete = 1 & HL = ZH-CN & Q = QP + % E5 % BF % AB % E9 % 80% 9f % E7 % AE % 97% E6 % B3 % 95 & meta =
Http://www.paper.edu.cn
-1-
H.264 inter-frame prediction mode selection and quick motion estimation Optimization Algorithms
Liang Rui
School of telecommunication engineering, Beijing University of Posts and Telecommunications, Beijing (100876)
E-mail: liangrui.bupt@gmail.com
Abstract: H.264 is a new video coding standard jointly developed by ISO/IEC and ITU-T.
Domain has broad application prospects. However, due to the adoption of multi-frame and multi-Macro Block Motion Estimation, Rate Distortion Optimization and other technologies
The complexity of code computing has greatly increased, limiting H.264 Real-time applications. In order to reduce the complexity
Effective inter-frame prediction mode selection algorithm, while making full use of the results of mode selection to modify the original motion estimation algorithm
To significantly improve the encoding speed. The experiment results show that the optimization algorithm can be reduced evenly for different quantitative step sizes.
It takes less than 70% of motion estimation time, and the average decrease of SNR is less than 0.11db, which can affect image quality.
Ignore, while the output bit rate is only increased within 2.5%.
Key words: H.264 inter-frame prediction mode selection Motion Estimation
Graph classification: tn915
1. Introduction
H.264 is a new video encoding standard [1] jointly developed by ISO/IEC and ITU-T. Multi-mode prediction,
Optimized Rate Distortion and flexible and efficient entropy coding, which improves the coding efficiency by 264 compared with H.263.
At the same time, the image quality is better, and it has better fault tolerance and network adaptability. It can be widely used in Multimedia Streams.
Services, mobile multimedia communications, interactive multimedia, and other applications [2]. However, H.264 significantly improves the encoding performance while,
The complexity of coding increases dramatically, which limits its practical application to a large extent.
The experimental results show that the average part of the inter-Frame Prediction occupies about 50% of the total coding time, so the optimization of its algorithm is
The key to high coding efficiency. H.264 inter-Frame Prediction includes mode selection and motion compensation. In order to achieve good compression performance
Rdo is used to select the optimal prediction mode and motion vector [3]. However
H.264 the original algorithm is complex in computing and significantly increases coding time, which cannot meet the requirements of real-time applications. Therefore, many fast operations
The dynamic estimation algorithm and pattern decision algorithm are proposed. For example, an algorithm that uses the threshold value to terminate the pattern selection in advance [4] [5] [6 ],
To reduce the search for candidate prediction modes, thus reducing the time consumption. There are also ways to use edge ing, based on the macro block graph
Allocate a suitable prediction mode to each macro block and its sub-division.
Through the analysis of image characteristics, we found that there are a large part of the image sequence in a uniform and stable area, they are divided
There is little chance of small size, and there is no need to perform rdo searches for Small Size Blocks. By establishing some judgments
The macro block mode can be determined in advance, greatly saving coding time and reducing complexity. Based on the Image
This paper presents an effective inter-frame prediction mode selection algorithm, and makes full use of the results of the mode selection to estimate the motion.
Algorithm. The organizational structure of this paper is roughly as follows: Part 1 analyzes H.264 original Mode Selection Algorithm
Limitation, and an optimized algorithm is proposed. In Part 2, a new fast motion estimation is proposed based on the selection result in Part 3.
Algorithm, Part 1 performs mathematical and simulation analysis on the two optimization algorithms introduced to verify that the algorithm reduces coding time.
And maintain the advantages of the encoding feature. At last, we will summarize the full text in section 5th.
2. Optimization Algorithm for Mode Selection
2.1 Overview of Image Correlation Analysis and Optimization Algorithms
H.264 in the original algorithm, the image features were not analyzed, and each image was predicted in seven modes.
Motion Estimation is also required for each sub-Macro Block in the mode, and the Utilization Rate Distortion algorithm is used to compare all possible modes.
Select the optimal prediction mode [3]. Although Rate Distortion Optimization can bring about excellent encoding performance
Http://www.paper.edu.cn
-2-
Searching consumes a lot of time.
Through statistical analysis of multiple sets of standard test sequences in qcif and CIF formats, it is found that frame skipping and 16x16 modes account for approximately
The total mode is 70%, while the 4x4, 4x8, and 8x4 modes only account for 3%-5%, while the encoding processing time accounts for 30%.
-50% indicates that a large part of the image sequence is even and stable. Through the block mode of the encoded Image
Based on the analysis of the division, we found that the use of 16x16 macro blocks is more suitable for even areas due to time stability. Including
Smaller sizes should be used for areas with obvious boundary features. Images with complex features and more motion should be smaller
Encoding. Block Mode Division 1 of the encoded image is shown in. Determine stability in advance by establishing some judgment criteria
The region macro block mode greatly saves coding time and reduces complexity [8] [9], so as to adapt to real-time business coding.
Code requirements.
Figure 1 Best block Division after H.264 Encoding
Video encoding theory has an important application parameter: The sum of absolute differences (SAD) corresponding to pixel points ).
Σ
=
= −
N
I
N
J
I j I j sad X Y
1 1
,,
(1)
A relatively small sad value appears in the moving area or contains many details.
Uniform, stable area. The purpose of inter-frame prediction is to remove the time correlation between adjacent frames. The core of the optimization solution in this paper is
Select as few candidates as possible based on the relevance of the image by using sad as the correlation judgment.
Select the optimal partitioning mode only in the Candidate mode, which can significantly reduce the coding time.
2.2 inter-frame mode selection optimization algorithm
The optimization algorithm first divides 16x16 macro blocks of image frames and computes the sad of each macro block.
The preset threshold value of TH1 is compared. The macro blocks smaller than the threshold are inter16x16, 16x8, and 8x16 modes,
It is defined as type A. When the threshold is greater than the threshold, the inter8x8, 8 x, 4x8, and 4x4 modes are used and defined as type B. The preceding genus
In rough division, macro blocks are divided into two major categories.
After rough selection, the optimization algorithm performs quick motion estimation on the corresponding integer pixels for the two types respectively.
To find the best matching position, and then according to the sad value of the pixels around this pixel, We will classify the two big
The specific steps are as follows:
Step 1:
For type A, execute the Improved Fast Algorithm in 16x16 mode (we will discuss it later) to find the matching position.
For type B, execute the improved Quick Algorithm in 8x8 mode to find the matching position.
Step 2:
Http://www.paper.edu.cn
-3-
Calculate the sad value of the pixels around the matching position, and find the maximum horizontal sad value (sad_vmax) and
A large vertical sad value (sad_vmax) is used to compare the two and select different partitioning modes based on different situations.
Step 3:
For type A: If sad_hmax> sad_vmax, select 16x16 and 16x8 as the candidate mode.
The input fast motion estimation algorithm is used for rate distortion optimization, and the pattern with the minimum rate distortion value (rdcost) is selected
Optimal mode. If sad_hmax <sad_vmax, select 16x16 and 8x16 as the candidate mode.
If sad_hmax = sad_vmax, select 16x16, 16x8, and 8x16 as candidate modes.
The motion estimation algorithm is used to optimize rate distortion. The model with the minimum rdcost value among the three candidate modes is used as the optimal model.
.
For type B, it is similar to type.
Step 4: Set the search results in the above best mode as the most matched position and record the motion vector.
The entire process 2 shows
Figure 2 Method for Determining the optimized H.264 inter-frame prediction Mode
3. Improvement of the quick motion estimation algorithm
When performing motion estimation, the original H.264 algorithm first predicts the motion vector, obtains the initial motion vector, and then
Use this as the search center for block matching and search for the best motion vector to minimize the difference between the reference block and the candidate block.
That is, the value of the Motion Vector V is equal to (2.
) 1, (), (Min Sigma
ε
− + −
V S R W
F r t f r V T
(2)
F (R, T) indicates the intensity of the brightness or color information at the R position on the frame at t time, W indicates the waiting time of n × n.
Matching block. S is the search area. Its size is (2 W + 1) × (2 W + 1) [10].
Http://www.paper.edu.cn
-4-
H.264 the lack of original full-pixel search fast motion estimation algorithms is mainly manifested in the following aspects:
(1) All images adopt a unified and fixed algorithm for multiple reference frames and multi-Macro Block estimation.
Analysis.
(2) the search radius is fixed. For an even image area, a large search radius does not play a major role in improving performance, but it costs much.
Time.
(3) ds search method and hexbs search method. For block mode with the shape of Square, the coverage effect is better and the search range is better.
It is similar to a circle, but for 16x8, 8x16, 8x4, 4x8 blocks, the Search coverage is effective due to the inconsistent length and width of the blocks.
Poor results.
An excellent motion estimation algorithm dynamically selects a quick search method based on the classification of motion conditions [11]. Our
The algorithm classifies motion conditions based on the Inter-frame prediction mode, making full use of the results of mode selection. The improved algorithm is as follows:
(A) If motion = low, that is, 16x16, 16x8, 8x16, we use diamond (diamond)
Until you find the best matching pixel.
(B) If motion = medium, 8x8, 8x4, 4x8 is used for dimension division, first select hexagon (six sides
To find the initial matching point. Take this point as the center and go to the diamond mode for search until the most
Excellent matching pixel.
(C) If motion = high, that is, the 4x4 Division mode is used, use big hexagon (large hexagonal) for search first,
Locate the range indicated by the motion vector. Search in hexagon mode to find the initial match point. Take this point as the center, cut
Search in diamond mode until the best matching pixel is found.
(D) adaptive change of the search range. For large block models, the search radius is reduced to ensure motion estimation performance.
At the same time, the algorithm complexity is simplified. For small modules, the search radius increases accordingly to ensure the accuracy of matching points.
In this way, the search results are optimal within the range with the highest probability.
Figure 3 compares the pixels to be searched by the improved algorithm and the original algorithm based on different test sequences.
Figure 3 the improved motion estimation algorithm is more complex than the original JM algorithm. Green is the improved algorithm, and red is the original algorithm.
4. Experiment results and analysis
4.1 experiment platform and test conditions
The experiment uses the JVT reference test model jm9.3 [12] as the optimization algorithm test platform. Lab conditions: (1) Editing
First 100 frames of the image sequence; (2) cavlc entropy encoding; (3) 5 reference frames; (4) search range: 32 pixels; (5) Use Hadamard
Http://www.paper.edu.cn
-5-
(6) utilization distortion optimization; (7) encoding sequence GOP is ippp; (8) quantization coefficient is divided into three groups: 28, 32, and 36
Row comparison. The standard video sequence of various qcif and CIF formats is tested, and the optimization algorithm and original
H.264 encoding result.
In order to achieve better classification performance and ensure encoding performance, it is very important to select the threshold value of Th1. Selection basis
It is to find a good balance between the time consumption of Motion Compensation and the bit rate of the output code stream, and the image quality SNR.
4.2 experiment platform and test conditions
In this paper, the JVT standard test sequence is used to estimate the time consumption of motion, the bit rate of the output code stream, and the image quality (SNR)
For comparison, the experiment results are listed in Table 1. A positive value indicates an increase, and a negative value indicates a decrease.
Table 1 motion estimation time consumption, SNR, bit rate comparison QP = 28
Sequential motion estimation time consumption change (%) SNR change (db) Bit Rate Change (%)
News (qcif)-72.992-0.060 2.436
Salesman (qcif)-74.448-0.200 1.890
Carphone (qcif)-67.226-0.100 3.857
Foreman (qcif)-55.938-0.060 6.081
Clare (qcif)-57.290-0.140 1.256
Container (qcif)-69.313-0.060 0.037
Mother & daughter (qcif)-84.840-0.110 1.563
Mobile (CIF)-46.944-0.040 2.836
Tempete (CIF)-48.234-0.020 2.763
Average-64.136-0.088 2.524
The test sequence is classified by QP value. The algorithm we designed is more time-consuming than the original algorithm's motion estimation.
QP = 28, up to 84.8% (mother and daughter sequence) can be reduced, for image sequences with intense Motion
The minimum value can also be increased by 46.9% (mobile sequence), and the average time consumption of motion estimation can be reduced by 64.1%. QP = 32 and qP
In the case of 36, the average time consumption of motion estimation can be reduced by 71.1% and 75.9% respectively. Figure 4 shows the comparison result,
The red column indicates the time consumed by the original algorithm, the green column indicates the time consumed by the optimization algorithm, and the number is 1 ~ 9 indicates the preceding table in sequence
9 standard video sequences.
Through experiments, we can find that the optimization algorithm of the Macro Block Mode Selection for interframe prediction proposed in this paper requires a small amount of computing.
The macro block mode can be determined by comparison, which reduces a large amount of unnecessary calculations and significantly improves the encoding speed. Fast Motion Estimation
It dynamically adjusts the search range and search operations, saves the search time, and increases the motion estimation speed.
Step by step. The combination of the two methods can significantly reduce the time consumption of motion estimation under various quantitative step sizes, while maintaining
The image quality remains unchanged and the encoding rate increases slightly.
1 2 3 4 5 6 7 8 9
0
1
2
3
4
5
6
7
8
QP = 28 me time (
S) sequences
JM Algorithm
New Algorithm
1 2 3 4 5 6 7 8 9
0
1
2
3
4
5
6
7
8
QP = 32
Me time (s)
Sequences
JM Algorithm
New Algorithm
(A) QP = 28 (B) QP = 32
Http://www.paper.edu.cn
-6-
1 2 3 4 5 6 7 8 9
0
1
2
3
4
5
6
7
8
QP = 36
Me time (s)
Sequences
JM Algorithm
New Algorithm
(C) QP = 36
Figure 4 Comparison of the time consumption of motion estimation between the two algorithms. Figure (a) shows the quantization step 28, figure (B) shows the quantization step 32, and figure (c) shows the quantization step 36.
5. Conclusion
H.264, as a new generation of video coding and decoding standard, adopts mature technologies and is pursuing higher coding efficiency and simplicity.
The expression of Jie also provides excellent video quality and is currently the most efficient video compression method.
. However, due to the significant increase in computing complexity, H.264 Real-time applications are restricted, and many algorithms need to be optimized.
Interframe prediction is a key technique of H.264, which can effectively eliminate the time-based phase of video sequences.
It occupies a large part of the coding time. The Optimization of the inter-frame prediction algorithm is very important to reduce the time consumption of H.264 encoding.
. This paper proposes an effective inter-frame prediction mode selection algorithm and an estimation of the original motion based on the prediction mode.
The improvement of the calculation method greatly reduces the time required for motion estimation. Jm9.3 according to the model test results, after optimization
Compared with the original algorithm, different quantitative step sizes can reduce the average motion estimation time by 70.4%.
The average decrease in SNR is less than 0.11db, which can ignore the impact on image quality, while the increase in the output bit rate
Less than 2.5%.
Http://www.paper.edu.cn
-7-
References
[1] ISO/IEC 14496-10 AVC)-JVT-f100. "Joint Video specification (ITU-T Rec. H.264 | ISO/IEC 264-10
AVC)-JVT-f100 "[s]. Joint Video Team (JVT) of ISO/IEC mepg & ITU-T VCEG., Dec. 2002.
[2] Thomas Wiegand, Gary J. Sullivan, gisle bjontegaard, et al. "Overview of the H.264/AVC Video Coding
Standard "[J]. IEEE Trans. On circuits and systems for video technology, July 2003, vol. 13, No. 7: pp. 560-
576.
[3] T. Wiegand, M. lightstone, T. G. Campbell, et al. "rate-distortion optimized mode selection for very low bit
Rate Video Coding and the emerging H.263 standard "[J]. IEEE Trans. Circuits System Video Tech., Apr. 1996, vol.
6, no. 2: pp. 182-190.
[4] D. Wu, S. Wu, k.p. Lim, et al. "Block inter mode demo-for fast encoding of H.264" [J]. Proc. of IEEE
International Conf. On acoustics, speech and signal processing, May 2004, Vol. 3: pp. iii-181-184.
[5] Andy Chang, AU, O. c. Yeung and Y. M. "A novel approach to fast multi-Block Motion Estimation
H.264 video coding "[J]. Proc. Of International Conf. on multimedia and Expo., July 264, vol. 1: pp. i-105-
108.
[6] jeyun Lee and byeungwoo Jeon. "fast mode demo-for H.264" [J]. Proc. of IEEE International Conf. On
Multimedia and Expo., June 2004, vol. 2: pp. 27-30.
[7] k.p. Lim, S. Wu, S. rahardja, et al. "Fast inter mode selection" [Z]. Document i020, JVT 9th meeting, Sept.
2003.
[8] section height, Cui yansong, Deng Zhongliang. "H. 264 inter-frame Macro Block Mode Selection Algorithm" [J]. Modern wired transmission, March 2004, 3rd
Period: 77-79.
[9] Lou Jian, Lu Liang, Yu Lu, and so on. "H. 264 Study on the features and improvement of the standard [J]. TV technology, September June 2003, 6th: 13-15.
[10] zhixihu, zhiai. "264-encoded motion estimation quick search algorithm" [J]. Computer Application, September 4th, Issue 1: 72-74.
[11] Zhu Dongdong, Dai Qionghai. "H.264 Algorithm for selection of Fast inter-frame encoding modes" [J]. Electronic Design Application, September 264, pp.: 36-38.
[12] JVT reference software unofficial version jm9.3, http://bs.hhi.de /~ Suehring/TMl/download.
Inter-frame mode selection and Fast Motion Estimation
Optimized Algorithm in H.264/AVC
Liang Rui
School of telecommunication engineering, Beijing University of Posts and Telecommunications,
Beijing (100876)
Abstract
H.264 is the newest international video coding standard developed by the Joint ITU-T and ISO/IEC
Standards Organizations. Compared to the H.263 standard, H.264 standard can greatly increase
Coding performance in terms of the better picture quality and more than 50% compression ratio
Improvement. However the computation complexity increases dramatically which limits its real-time
Application due to the implementation of multi-frame, multi-Block Motion Estimation and rate-distortion
Optimization. In order to fetch the complexity, In this paper, an efficient inter-Frame Motion
Estimation mode selection algorithm together with an improved fast motion estimation algorithm was
Proposed. The experiment results show that the new schemes are able to achieve a limit ction of more
Than 70% estimation time on average for different quantization step (qP), with a negligible average
SNR loss of less than 0.11 dB and a mere 2.5% bit rate increase compared with the jm9.3-H. 264
Reference software.
Keywords: H.264, mode selection, Motion Estimation