Advanced video coding techniques are important for multimedia storage and transmission. For this reason, many video coding standards have been standardized. H.264 is the latest video coding standard. H.264/AVC standard jointly developed by ISO and ITU-T—Joint Video Team (JVT), also known as MPEG-4 Part 10 and H.264 in the H.26x serial standards, has substantially outperformed the previous video coding standards by utilizing a variety of temporal and spatial predictions. Rate control is an important technique although it does not belong to the normative part in video coding standards. However, without rate control any video coding scheme would be practically useless in many applications because the client buffer may often under-flow and over-flow when a channel used to deliver the compressed stream is of constant bandwidth. Therefore, every video coding standard has its own rate control technique, for example, TM5 for MPEG-2 and TMN8 for H.263.
RDO is one of important video coding techniques. It is used to select optimal motion vectors an optimal coding mode for every macroblock. Yet the RDO used in H.264 test model makes it difficult to adopt the existing rate control techniques. Because rate control usually requires a pre-determined set of motion vectors and coding modes to select the quantization parameter, whereas RDO requires a pre-determined quantization parameter to select motion vectors and coding modes. On the other hand, as the complexity ratio between coded frame, the bit allocation model and adaptive quantization scheme should also be improved. The invention is a method and apparatus for rate distortion optimization based rate control. The invention can be used for video streaming, transmission, and storage coding.
The invention is to provide a method and apparatus of rate control for a video encoder, in which rate distortion optimization technique is used to improve coding efficiency.
As shown in
JVT processing module receives the input frame data, and it is connected with RDO mode selection module, virtual buffer module and global complexity estimation module;
RDO mode selection module is connected with virtual buffer and global complexity estimation module. It receives the input signal from JVT processing module, and processes it based on the virtual buffer module and global complexity module status. In the last, the output signal is sent back to JVT processing module, JVT module will output the final coded macroblock.
Before coding a GOP, does bit allocation for the pictures in the GOP with the average picture size; The average picture size is calculated as:
R/F=R÷F, here, R is the target bit rate. F is the picture rate. R/F is the average picture size.
The bit allocation adjustment in the coded GOP is shown as follows:
here, TI, Tp and Tb is the bits allocated to the I, P or B frame respectively. Ni, Np and Nb is the remained none coded I, P or B frames in the GOP respectively. Xi, Xp and Xb is the global complexity estimation for the I, P or B frame respectively and is defined as the multiplier between coded bits and average quantization parameter for the frame.
bit_rate is the target bit rate. picture rate is the frame rate.
Kp and Kb are constants. Kp, Kb means the complexity ration between P, B frame and I frame respectively.
R is the remained bits for the GOP, and after coding a picture is updated as follows:
R=R−Si,p,b
Si,p,b is the coded bits for the current frame.
Xi, Xp and Xb are initialized as:
Xi=a×bit_rate
Xp=b×bit_rate
Xb=c×bit_rate
here a, b and c are constants.
bit_rate is the target bitrate.
Does the mode selection while using the quantization parameter of previous macroblock as a prediction value for the current macroblock. The mode minimizes the following expression is selected as the initial coding mode for the current macroblock:
D(s,c,MODE|QP)+λMODER(s,c,MODE|QP)
here, s is the luma value of the original macroblock. c is the luma value of the reconstructed macroblock. λMODE is the lagrangian constant.
For I/P frame, λMODE=0.85×2Q
For B frame, λMODE=4×0.85×2Q
D(s,c,MODE|QP) is used to evaluate the distortion of the current macroblock after it is coded.
R(s,c,MODE|QP) is the bits used to code the macroblock with mode MODE.
QP is the quantization parameter for current macroblock. for motion estimation in P or B frame, the motion vectors minimizes following expression are selected as the motion vectors for the current macroblock:
J(m,λMOTION)=SA(T)D(s,c(m))+λMOTIONR(m−p)
After the first rate distortion mode selection, the output of RDO mode selection module is sent to JVT processing module. A new quantization parameter will be calculated by the JVT processing module. The quantization parameter is adjusted according to macroblock activity.
After first rate distortion mode selection, the sum of the absolute difference is used as the macroblock activity estimation. The macroblock activity is calculated as:
here, i is the horizontal position of the pixel in the current macroblock. j is the vertical position of the pixel in the current macroblock. N_actm is the activity of the current macroblock. s(i,j) is the luma value of the original pixel(i,j), c(i,j) is the prediction value of pixel(i,j). avg_act is the average act, in the previous coded picture which is coded with the same type as current picture. actm is the sum of the absolute difference after motion compensation or intra prediction.
When coding the first frame, the virtual buffer occupancy is initialized with:
d0i=10×r/31
d0P=Kp×d0i
d0b=Kb×d0i
here r is the virtual buffer size; d0i, d0p, and d0b is the initial virtual buffer occupancy for i, p, or b frame. Kp is the complexity ration between I, P frame; Kb is the complexity ratio between I, B frame.
The RDO based rate control also includes a second RDO mode selection, after quantization parameter decision for the current macroblock. That is to say, the decided quantization parameter for the current macroblock will be used to RDO mode selection again. The mode which minimizes the following expression will be selected as coding mode for the current macroblock:
here, s is the luma value of the original macroblock. c is the luma value of the reconstructed macroblock. λMODE is the lagrangian constant.
For I/P frame, λMODE=0.85×2Q
For B frame, λMODE=4×0.85×2Q
D(s,c,MODE|QP) is used to evaluate the distortion of the current macroblock after it is coded.
R(s,c,MODE|QP) is the bits used to code the macroblock with mode MODE.
QP is the quantization parameter for current macroblock.
Quantization parameter from JVT processing module is sent back to JVT processing module, the macroblock is coded by JVT processing module and output.
Based on above modules, the drawbacks of traditional rate control schemes are removed. As RDO and rate control are considered together, the RDO based video coding can reach accurate target bitrate control while with good performance.
Number | Date | Country | Kind |
---|---|---|---|
02 1 25274 | Jul 2002 | CN | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/CN02/00673 | 9/23/2002 | WO | 00 | 10/24/2005 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2004/010702 | 1/29/2004 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
5778192 | Schuster et al. | Jul 1998 | A |
6115421 | Katta et al. | Sep 2000 | A |
6507616 | Ryu | Jan 2003 | B1 |
6807231 | Wiegand et al. | Oct 2004 | B1 |
7280700 | Tourapis et al. | Oct 2007 | B2 |
20020163966 | Ramaswamy | Nov 2002 | A1 |
20030063667 | Sriram et al. | Apr 2003 | A1 |
Number | Date | Country |
---|---|---|
WO 0049570 | Aug 2000 | WO |
Number | Date | Country | |
---|---|---|---|
20060088099 A1 | Apr 2006 | US |