CN103067720B - Macroblock layer rate control method based on H264 video encoding standard - Google Patents

Macroblock layer rate control method based on H264 video encoding standard Download PDF

Info

Publication number
CN103067720B
CN103067720B CN201310044341.4A CN201310044341A CN103067720B CN 103067720 B CN103067720 B CN 103067720B CN 201310044341 A CN201310044341 A CN 201310044341A CN 103067720 B CN103067720 B CN 103067720B
Authority
CN
China
Prior art keywords
mad
frame
macro block
rate control
control method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310044341.4A
Other languages
Chinese (zh)
Other versions
CN103067720A (en
Inventor
陈晓
顾冬珏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Information Science and Technology
Original Assignee
Nanjing University of Information Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Information Science and Technology filed Critical Nanjing University of Information Science and Technology
Priority to CN201310044341.4A priority Critical patent/CN103067720B/en
Publication of CN103067720A publication Critical patent/CN103067720A/en
Application granted granted Critical
Publication of CN103067720B publication Critical patent/CN103067720B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to a macroblock layer rate control method based on an H264 video encoding standard. The macroblock layer rate control method comprises the following steps of: A, calculating a target bit number of a current frame by using a fluid blocking model and a linear tracing theory; B, distributing the bit number of a macroblock layer; C, predicting an average absolute error ratio of the current macroblock in the current frame; D, calculating quantization parameters of the corresponding macroblock; and E, realizing rate-distortion optimization of each macroblock in the current frame by using the parameter values obtained in the step D. The macroblock layer rate control method disclosed by the invention has the beneficial effects of enabling the generated error rate to be closer to the target error rate and improving the structural similarity of video output sequences, thereby obtaining better subjective video quality.

Description

A kind of macroblock layer rate control method based on H.264 video encoding standard
Technical field
The present invention relates to technical field of video coding, particularly relate to a kind of macroblock layer rate control method based on H.264 video encoding standard.
Background technology
In video communication, the information flow after compressed encoding usually needs the transmission over networks in bandwidth not homeostasis.In order to make the video flowing after coding adapt to bandwidth well, especially adapt to low bandwidth channel or time become wireless channel and make full use of limited Internet resources, Rate Control becomes a requisite link in video communication system.The main task of Rate Control is the information such as acquisition buffer zone state and picture activity, distributes certain bit number, makes bit rate output can control in given standard, and make image fault minimum to every width image.
Based on H.264/AVC video encoding standard bit rate control method in, owing to employing quantization parameter in Rate Control and rate-distortion optimization link simultaneously, result in " laying hen antinomy ", when namely rate-distortion optimization being carried out to the macro block of present frame, need the quantization parameter first being determined each macro block by the MAD of present frame or current macro, and the MAD of present frame or macro block only just can obtain after rate-distortion optimization.In order to solve " laying hen antinomy " problem, a lot of scholar has done large quantifier elimination, document [ShinI H, Lee Y L, Park H W.Rate control using linear rate-ρ model for H.264 [J] .SignalProcess Image Com-munication, 2004, 19:341-352.] on the basis of ρ domain model, done improvement, be applied in Rate Control H.264, document [Ma Siwei, Gao Wen, Lu Yan.Rate-distortion analysisfor is video coding and its application to rate control [J] .IEEE Trans onCircuit Syst for Video Technol H.264/AVC, 2005, 15 (12): 1533-1544.] code check and the relational model between quantization step and quantization step and corresponding bit rate control method is proposed, document [Ma S.W, Gao W, Wu F and Lu Y.Ratecontrol for JVT video coding scheme with HRD considerations.Proceeding of IEEEInternational Conference on Image and Processing, 2003, vol.3, pp:793-796.] by HRD consistency constraint, mean absolute error ratio considers, propose a kind of new bit rate control method.The JVT-G012 method that Li Zhengguo proposes utilizes linear MAD model to predict the MAD value of current basic unit, this method can obtain reasonable encoding efficiency, cause and pay close attention to [Li Zhengguo widely, Gao Wen, Pan Feng, et al.Adaptiverate control for is [J] .Journal of Visual Communication and Image Representation H.264, and 2006,17 (2): 376-406.].Although JVT-G012 method solves laying hen question of paradoxes preferably, but still there is a lot of problem.Code check-quantification (R-Q) model in clear and definite discussion frame is not had in such as method, therefore document [X.Jing, L.P.Chau, and W.-C Siu, " Frame complexity-based rate-quantization modelfor H.264/AVC intraframe rate control, " IEEE Signal ProcessingLetters, vol.15, pp.373-376, 2008.] propose R-Q model in a kind of adaptive frame, this method is by considering the frame complexity based on gray scale, adaptive Renewal model parameter, select the quantization parameter of intracoded frame more accurately.Such as rate distortion (R-D) parameter of colour-video signal is respectively brightness and chromatic component modelling in based on the video coding system of conventional transformation again, so document [Z.Z.Chen and K.N.Ngan, " Towards rate-distortion tradeoffin real-time color video coding ", IEEE Trans.Circuits Syst.Video Technol., 2007, vol.17, no.2, pp.158-167] propose to set up independently R-D model for color video encoding.
A kind of H.264 bit rate control method based on frame complexity is disclosed based in the H.264 bit rate control method (application number is 201010235061.8) of frame complexity.The method comprises the following steps: A, target bit according to frame complexity determination current encoded frame; B, calculate quantization parameter carry out rate-distortion optimization; Wherein, frame complexity is weighed by a complexity factor, this complexity factor is defined as the weighting sum of the mean difference of image grey level histogram and the mean absolute error ratio of luminance component image, on this complexity factor basis, by empirical equation, existing target bits formula is revised.One H.264 bit rate control method (ZL201010239407.1) provides a kind of combining image complexity and the frame layer rate control method adjusted quantization parameter, improve the average peak signal to noise ratio of sequences of video output, and quality fluctuation between video frame image can be reduced, thus improve video image quality.Above-mentioned disclosed two methods mainly distribute code check from the complexity of natural image content, there are some shortcomings: the objective characteristic according to picture material distributes code check, do not distribute code check according to the subjective characteristic of human eye, the image obtained not necessarily meets the subjective characteristic of human eye.
The people such as Z.Wang, A.C.Bovik propose the index of structural similarity (SSIM, Structural Similarity) as a kind of measurement two width image similarities.Because human vision is easy to extract structural information from image, the SSIM value therefore calculating two width images just can be used for the quality of evaluation map as subjective quality.From SSIM, many scholars propose new H.264 coding method.Someone SSIM is used for H.264 Video coding rate-distortion optimization (Cui Ziguan, Zhu Xiuchang. the similar H.264 subjective distortion performance of structure based improves mechanism. electronics and information journal, 2012,34 (2): 433-439).
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, structural similarity theory is utilized to distribute the code check of macroblock layer, more reasonably distribute macroblock layer bit, improve the well as subjective video quality of video, a kind of macroblock layer rate control method based on H.264 video encoding standard is provided, specifically has following technical scheme to realize:
The described macroblock layer rate control method based on H.264 video encoding standard, comprises the steps:
A, utilize the target bit of fluid-blocking model and Linear tracing theory calculate present frame;
B, distribute the bit number of macroblock layer according to formula (1),
R i = a T r * [ 1 - SSIM ( i ) ] 2 Σ k = i N [ 1 - SSIM ( k ) ] 2 + b T r * MAD EMV ( i ) 2 Σ k = i N MAD EMV ( k ) 2 - - - ( 1 )
Wherein, i is macro block sequence number in frame, and N is the macro block sum in frame, a and b is the weight coefficient by structure and content assignment bit number, meets a+b=1, R ifor the bit number that current macro is distributed, T rbe remaining bit number in frame, SSIM (i) is the SSIM value of i-th macro block in present frame, MAD eMVthe MAD value of i-th macro block in (i) representative frame, MAD value is the mean absolute error ratio of current macro image brightness, and k is summation variable;
The mean absolute error ratio of current macro image brightness in C, prediction present frame;
The quantization parameter of current macro in D, calculating present frame;
E, utilize the parameter value drawn from step D, realize the rate-distortion optimization of each macro block in present frame.
The further design of described macroblock layer rate control method is, according to the MAD of the corresponding macro block of last reference frame in described step C, utilizes the MAD of current macro in the linear prediction model prediction present frame based on MAD.
The further design of described macroblock layer rate control method is, described step D comprises the steps:
A, binary R-D model is utilized to calculate the quantization parameter of current macro in present frame, such as formula (2):
T ( i ) = a MAD ( i ) QP + b MAD ( i - 1 ) QP 2 - - - ( 2 )
Wherein, i is macro block sequence number in frame, and a, b are model parameter, are obtained by linear regression statistical computation; QP is the quantization parameter of i-th macro block, and MAD (i)=a1 × MAD (i-1)+a2, a1 and a2 are one-variable linear regression coefficients, and upgrade after a frame of having encoded, initial value is respectively 1 and 0.
B, in order to eliminate the blocking effect of macro block, adjust the quantization parameter of i-th macro block, Shi get ∣ QP-QPprev ∣≤2, wherein QP is the quantization parameter of i-th macro block, and QPprev is the quantization parameter of last macro block, i.e. QP=min (max (QP prev-2, QP), QP prev+ 2).
The further design of described macroblock layer rate control method is, in the preferred version in described step B, gets a=0.4, b=0.6, and the readability of picture material and the continuity of picture structure are by best effect.
Advantage of the present invention is as follows:
While described macroblock layer rate control method can make generation code check close with target bit rate, improve the SSIM of sequences of video output, thus obtain better well as subjective video quality.
Accompanying drawing explanation
Fig. 1 is the SSIM comparison diagram of the inventive method and JM10.1 method process carphone sequence.
Fig. 2 is the SSIM comparison diagram of the inventive method and JM10.1 method process foreman sequence.
Fig. 3 is the PSNR comparison diagram of the inventive method and JM10.1 method process carphone sequence.
Fig. 4 is the PSNR comparison diagram of the inventive method and JM10.1 method process foreman sequence.
Embodiment
Below in conjunction with accompanying drawing, the present invention program is described in detail.
The macroblock layer rate control method based on H.264 video encoding standard that the present embodiment provides, comprises the steps:
A utilizes the target bit of fluid-blocking model and Linear tracing theory calculate present frame;
B distributes macroblock layer bit number according to formula (1),
R i = a T r * [ 1 - SSIM ( i ) ] 2 Σ k = i N [ 1 - SSIM ( k ) ] 2 + b T r * MAD EMV ( i ) 2 Σ k = i N MAD EMV ( k ) 2 - - - ( 1 )
Wherein, i is macro block sequence number in frame, and N is the macro block sum in frame, a and b is the weight coefficient by structure and content assignment bit number, meets a+b=1, R ifor the bit number that current macro is distributed, T rbe remaining bit number in frame, SSIM (i) is the SSIM value of i-th macro block in present frame, MAD eMVi the MAD value of i-th macro block in () representative frame, MAD value is the mean absolute error ratio of current macro image brightness, and k is summation variable.
SSIM ( i ) = ( 2 u x u y + c 1 ) ( 2 δ xy + c 2 ) ( u x 2 + u y 2 + c 1 ) ( δ x 2 + δ y 2 + c 2 )
Wherein x, y represent current macro and reference macroblock respectively, u x, u yfor x, y brightness average separately, be respectively x, the standard deviation of y and the covariance between x, y, c 1, c 2be in order to avoid when denominator close to zero time the measured value unstable and little constant (Z.Wang of definition, A.C.Bovik, H.R.Sheikh, and E.P.Simoncelli.Image qualityassessment:From error visibility to structural similarity [J] .IEEE Transaction on Image processing.2004,13 (4): 600-612).
C, MAD value according to the corresponding macro block of last reference frame, utilize the linear prediction model based on MAD to predict the MAD value of current macro in present frame.
The quantization parameter of current macro in D, calculating present frame; This step comprises following two steps:
D1, binary R-D model is utilized to calculate the quantization parameter of current macro in present frame, such as formula (2):
T ( i ) = a MAD ( i ) QP + b MAD ( i - 1 ) QP 2 - - - ( 2 )
Wherein, i is macro block sequence number in frame, and a, b are model parameter, are obtained by linear regression statistical computation; QP is the quantization parameter of i-th macro block, and MAD (i)=a1 × MAD (i-1)+a2, a1 and a2 are one-variable linear regression coefficients, and upgrade after a frame of having encoded, initial value is respectively 1 and 0.
D2, in order to eliminate the blocking effect of macro block, adjust the quantization parameter of i-th macro block, Shi get ∣ QP-QPprev ∣≤2, wherein QP is the quantization parameter of i-th macro block, and QPprev is the quantization parameter of last macro block, i.e. QP=min (max (QP prev-2, QP), QP prev+ 2).
E, utilize the parameter value drawn from step D, realize the rate-distortion optimization of each macro block in present frame.
In present embodiment: fluid-blocking model, Linear tracing theory, secondary model and rate-distortion optimization are all prior art, detailed content can list of references (LiZheng-guo, Pan Feng, Lim Keng-pang, et al.Adaptive base unitlayer rate control for JVT, JVT-G012.Proceedings of 7th Meeting, Pattay II, Thailand, 2003.)
In order to verify the effect of the inventive method, the reference software platform JM10.1 testing H.264 coding efficiency achieves bit rate control method of the present invention, and carried out contrasting (because the Bit distribution method taked in JM10.1 has surmounted classical JVT-G012 standard, so this algorithm no longer contrasts with it) with JM10.1.The cycle tests that experiment uses is QCIF4:2:0 form: crew, carphone, highway, foreman, claire, arranging frame per second is 30 frames/s, and target bit rate is 64kb/s and 128kb/s, 100 frames of encoding altogether, GOP length is 20, hunting zone 16, ME precision 1/4.The experimental result obtained is as shown in table 1 below:
Table 1
As can be seen from the table, the bit rate control method Rate Control effect of bit rate control method of the present invention and JM10.1 is suitable, even more accurately a bit.
Fig. 1 and Fig. 2 give two kinds of methods calculate carphone sequences and foreman sequence gained from the first frame to the contrast of the SSIM value of the 100 frame, as can be seen from the figure, every frame SSIM value that the inventive method obtains is larger, closer to 1, therefore has better well as subjective video quality.
Fig. 3 and Fig. 4 gives the contrast that two kinds of methods calculate Y-PSNR (PSNR) value from the first frame to the 100 frame of carphone sequence and foreman sequence gained, and the PSNR that visible the inventive method and JM10.1 obtain compares and remains unchanged.
Compared to existing technology, the inventive method, while control code check precision, can obtain better well as subjective video quality, thus improve the stability of video image.The inventive method is simple, is easy to hardware implementing, has good application prospect.

Claims (4)

1., based on a macroblock layer rate control method for H.264 video encoding standard, it is characterized in that, comprise the steps:
A, utilize the target bit of fluid-blocking model and Linear tracing theory calculate present frame;
B, distribute the bit number of macroblock layer according to formula (1),
R i = a T r 9 * [ 1 - SSIM ( i ) ] 2 Σ k = i N [ 1 - SSIM ( k ) ] 2 + b T r * MAD EMV ( i ) 2 Σ k = i N MAD EMV ( k ) 2 - - - ( 1 )
Wherein, i is macro block sequence number in frame, and N is the macro block sum in frame, a and b is the weight coefficient by structure and content assignment bit number, meets a+b=1, R ifor the bit number that current macro is distributed, T rbe remaining total bit number in frame, SSIM (i) is the structural similarity value of i-th macro block in present frame, MAD eMVthe MAD value of i-th macro block in (i) representative frame, MAD value is the mean absolute error ratio of current macro image brightness, and k is summation variable;
The mean absolute error ratio of current macro image brightness in C, prediction present frame;
The quantization parameter of current macro in D, calculating present frame;
E, utilize the parameter value drawn from step D, realize the rate-distortion optimization of each macro block in present frame.
2. macroblock layer rate control method according to claim 1, is characterized in that, according to the MAD of the corresponding macro block of last reference frame in described step C, utilizes the MAD of current macro in the linear prediction model prediction present frame based on MAD.
3. macroblock layer rate control method according to claim 1, is characterized in that, described step D comprises the steps:
A, binary R-D model is utilized to calculate the quantization parameter of current macro in present frame, such as formula (2):
T ( i ) = a MAD ( i ) QP + b MAD ( i - 1 ) QP 2 - - - ( 2 )
Wherein, i is macro block sequence number in frame, and a, b are model parameter, are obtained by linear regression statistical computation; QP is the quantization parameter of i-th macro block, and MAD (i)=a1 × MAD (i-1)+a2, a1 and a2 are one-variable linear regression coefficients, and upgrade after a frame of having encoded, initial value is respectively 1 and 0;
B, in order to eliminate the blocking effect of macro block, the quantization parameter of i-th macro block to be adjusted, Shi get ∣ QP-QPprev ∣≤2, i.e. QP=min (max (QP prev-2, QP), QP prev+ 2), wherein QP is the quantization parameter of i-th macro block, and QPprev is the quantization parameter of last macro block.
4. macroblock layer rate control method according to claim 2, is characterized in that, in the preferred version in described step B, gets a=0.4, b=0.6.
CN201310044341.4A 2013-02-05 2013-02-05 Macroblock layer rate control method based on H264 video encoding standard Active CN103067720B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310044341.4A CN103067720B (en) 2013-02-05 2013-02-05 Macroblock layer rate control method based on H264 video encoding standard

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310044341.4A CN103067720B (en) 2013-02-05 2013-02-05 Macroblock layer rate control method based on H264 video encoding standard

Publications (2)

Publication Number Publication Date
CN103067720A CN103067720A (en) 2013-04-24
CN103067720B true CN103067720B (en) 2015-06-10

Family

ID=48110159

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310044341.4A Active CN103067720B (en) 2013-02-05 2013-02-05 Macroblock layer rate control method based on H264 video encoding standard

Country Status (1)

Country Link
CN (1) CN103067720B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103796036B (en) * 2014-01-17 2017-02-01 广州华多网络科技有限公司 Coding parameter adjusting method and device
CN106791848B (en) * 2016-12-20 2020-01-03 中国电建集团河南省电力勘测设计院有限公司 Two-Pass code rate control method based on HEVC
CN108200428B (en) * 2018-01-29 2020-05-08 上海兆芯集成电路有限公司 Method for controlling code rate in macroblock layer and apparatus using the same

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070177665A1 (en) * 2006-02-02 2007-08-02 Zhi Zhou Picture layer rate control for video encoding
CN101895759A (en) * 2010-07-28 2010-11-24 南京信息工程大学 H.264 code rate control method
CN101895758B (en) * 2010-07-23 2012-07-18 南京信息工程大学 H.264 code rate control method based on frame complexity
CN102158702B (en) * 2011-04-25 2013-01-30 南京信息工程大学 Self-adaption H.264 code rate control method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070177665A1 (en) * 2006-02-02 2007-08-02 Zhi Zhou Picture layer rate control for video encoding
CN101895758B (en) * 2010-07-23 2012-07-18 南京信息工程大学 H.264 code rate control method based on frame complexity
CN101895759A (en) * 2010-07-28 2010-11-24 南京信息工程大学 H.264 code rate control method
CN102158702B (en) * 2011-04-25 2013-01-30 南京信息工程大学 Self-adaption H.264 code rate control method

Also Published As

Publication number Publication date
CN103067720A (en) 2013-04-24

Similar Documents

Publication Publication Date Title
CN103179394B (en) A kind of based on area video quality stable I frame bit rate control method
CN101945275B (en) Video coding method based on region of interest (ROI)
CN101895759B (en) H.264 code rate control method
CN100562118C (en) Code rate control method for video coding
Tao et al. Adaptive model-driven bit allocation for MPEG video coding
Rehman et al. SSIM-inspired perceptual video coding for HEVC
CN103281530B (en) HEVC bit rate control method based on rate-distortion optimization
CN101572806B (en) Frame I code rate control method based on H264
CN103634601B (en) Structural similarity-based efficient video code perceiving code rate control optimizing method
CN103618906B (en) A kind of H.264 bit rate control method of subjectively-based video quality
CN101895758B (en) H.264 code rate control method based on frame complexity
CN105049850A (en) HEVC (High Efficiency Video Coding) code rate control method based on region-of-interest
KR20140042845A (en) Method and system for structural similarity based rate-distortion optimization for perceptual video coding
CN104185024B (en) A kind of HEVC quantization parameter optimization methods based on total bitrate and entropy model
CN105120282A (en) Code rate control bit distribution method of temporal dependency
CN102752591B (en) H.264 code rate control method based on comprehensive factor
CN104333761B (en) A kind of HEVC elementary cells level bit-rate distribution method
CN101056408B (en) Method and apparatus for determining a threshold for skip mode in video coding
CN104994382A (en) Optimization method for sensing rate distortion
CN104754335B (en) A kind of code rate controlling method for video coding
CN103067720B (en) Macroblock layer rate control method based on H264 video encoding standard
CN107707918A (en) Optimized algorithm based on the control of HEVC/H.265 average bit rates
CN111447446B (en) HEVC (high efficiency video coding) rate control method based on human eye visual region importance analysis
CN103237221B (en) A kind of H.264 frame layer rate control method of structure based likeness coefficient
CN104994387A (en) Code rate control method fusing image features

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant