CN102148973A - Three-layer rate control method based on Lagrange's multiplier factors - Google Patents

Three-layer rate control method based on Lagrange's multiplier factors Download PDF

Info

Publication number
CN102148973A
CN102148973A CN 201010106100 CN201010106100A CN102148973A CN 102148973 A CN102148973 A CN 102148973A CN 201010106100 CN201010106100 CN 201010106100 CN 201010106100 A CN201010106100 A CN 201010106100A CN 102148973 A CN102148973 A CN 102148973A
Authority
CN
China
Prior art keywords
gop
frame
lagrange
formula
multiplier factor
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.)
Pending
Application number
CN 201010106100
Other languages
Chinese (zh)
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.)
Chengdu Bosheng Information Technology Co., Ltd.
Original Assignee
CHENGDU SHIJIA ELECTRONICS INDUSTRIAL Co Ltd
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 CHENGDU SHIJIA ELECTRONICS INDUSTRIAL Co Ltd filed Critical CHENGDU SHIJIA ELECTRONICS INDUSTRIAL Co Ltd
Priority to CN 201010106100 priority Critical patent/CN102148973A/en
Publication of CN102148973A publication Critical patent/CN102148973A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a three-layer rate control method based on Lagrange's multiplier factors. At a macro block stage, a Lagrange's multiplier factor model is dynamically corrected in the algorithm, so that a preferable encoding mode is selected. At a frame stage, a quantitative parameter selection method which is more flexible and effective to I frame is used in the algorithm, thereby avoiding the overflow of an internal memory. At a group of picture (GOP) stage, an effective bit distribution method is provided in the algorithm.

Description

3 layer bit rate control methods based on the Lagrange's multiplier factor
Technical field
The present invention relates to field of video encoding, particularly a kind of 3 layer bit rates control (Rate Control) algorithm based on the Lagrange's multiplier factor.
Background technology
H.264/AVC the up-to-date video standard of developing jointly as ITU and MPEG has obtained very big raising than traditional video standard, and has integrated a lot of advanced technologies, is exactly wherein a kind of based on the rate-distortion optimization technology of Lagrange's equation.In H.264/AVC, the Lagrange's multiplier factor is a constant in macro-block level, though satisfied re-set target, for the frame condition of complexity, but is not optimal selection.Because the image in the real world is even same frame also has the different complexities and the distortion factor.
Summary of the invention
Purpose of the present invention comprises the Bit Allocation in Discrete of the adjustment, quantization parameter adjustment, GOP (GOP below appears being abbreviated as in set of pictures) of the self adaptation Lagrange's multiplier factor, is to realize by following steps:
1. determine image complexity, calculate the MAD (MAD below appears being abbreviated as in mean absolute difference) of i macro block of n-1 frame (former frame), formula is as follows:
MAD MB [ i , n - 1 ] = 1 M × N × Σ x = 0 M - 1 Σ y = 0 N - 1 | I cur ( x , y ) - I ref ( x - Δx , y - Δy ) | ; - - - ( 1 )
I wherein Cur(x y) is positioned at (x, brightness value y), I for present frame Ref(x-Δ x, y-Δ y) is positioned at the brightness value of (x-Δ x, y-Δ y) for reference frame, and Δ x and Δ y are motion vector, and M is the horizontal dimensions of current macro, and N is the vertical dimensions of current macro.
2. calculate the adjustment parameter of the Lagrange's multiplier factor, for i macro block of n frame (present frame),
Formula is as follows:
α i , n = ( MAD Frame [ n - 1 ] MAD MB [ i , n - 1 ] ) φ ; - - - ( 2 )
MAD wherein Frame[n-1]Be the mean value of each macro block MAD of n-1 frame (former frame), MAD MB[i, n-1]Be the MAD of n-1 frame (former frame) i macro block, parameter phi is chosen according to actual needs, and recommended value is 0.25.
3. calculate the Lagrange's multiplier factor of i macro block of n frame (present frame), formula is as follows:
λ MODE[i,n]=α i,n×λ MODE; (3)
λ MODE=0.85×2 (QP-12)/3; (4)
Wherein QP is a quantization parameter.
4. calculate I frame quantization parameter, formula is as follows:
QP I = QP I - 1 , BR ≤ th 1 ≤ N SP N p QP I + 1 , th 1 ≤ N SP N p ≤ th 2 QP I + 1 , BR ≥ th 2 QP I + 2 , th 2 ≤ N SP N p ≤ th 3 QP I + 4 , N SP N p > th 3 ; - - - ( 5 )
N wherein SPBe the P frame number of skipping among the previous GOP, N pBe P frame number total among the previous GOP.Th 1, th 2, th 33 valve values for the current cache utilance are set at 10%, 30%, 55% usually, and BR is the buffer memory occupancy before the current GOP of coding.
5. in whole cataloged procedure H.264/AVC, the Bit Allocation in Discrete of GOP level all determined by formula (6), and that current GOP former frame coding is finished the also remaining bit number in back is definite by formula (7).And in the present invention, when previous GOP had used too much bit, the Bit Allocation in Discrete of GOP level changes by formula (8) to be determined, also remaining bit number was determined by formula (10) after current GOP last frame coding was finished.Each formula is as follows:
T r ( n i , 0 ) = u ( n i , 1 ) F r × N GOP + T r ( n i - 1 , N GOP ) ; - - - ( 6 )
N wherein GOPBe a totalframes among the GOP, u (n I, 1) when being first frame of i GOP, available bandwidth,
Figure GSA00000010913400032
In the previous GOP process of encoding, the occupation rate of buffer memory, F rBe predefined frame per second.
T r(n i,j)=T r(n i,j-1)-A(n i,j-1); (7)
A (n wherein I, j-1) be in i GOP, the bit number behind the j-1 frame coding, T r(n I, j) for after finishing at j-1 frame coding, also remaining bit number.
T r ( n i , 0 ) = u ( n i , 1 ) F r × N GOP + β × T r ( n i - 1 , N GOP ) ; - - - ( 8 )
β=a×N GOP+b; (9)
The present invention is after extensive testing, and a=0.003, b=0.02 are got in suggestion.
T r ‾ ( n i , N GOP ) = T r ( n i , N GOP ) + ( 1 - β ) × T r ( n i - 1 , N GOP ) ; - - - ( 10 )
Wherein
Figure GSA00000010913400035
For current GOP last frame coding finish after the correction value of remaining bit number also.
For algorithm performance of the present invention is described, oppose than test with dissimilar video sequences and JVT-G012 algorithm, be specially: " Akyio ", " Foreman ", " Silent ", " Foreman-Silent ", " Hall-Monitor ", " Coastguard ", " Bus ".
Figure GSA00000010913400041
Table one
Can find out that from table 1 this compares with the JVT-G012 algorithm based on 3 layer bit rate control algolithms of the Lagrange's multiplier factor, effect is obvious.
Specific implementation process
To these 3 layer bit rate control algolithms based on the Lagrange's multiplier factor, concrete implementation step is described below:
1. determine image complexity, calculate the MAD (MAD below appears being abbreviated as in mean absolute difference) of i macro block of n-1 frame (former frame), formula is as follows:
MAD MB [ i , n - 1 ] = 1 M × N × Σ x = 0 M - 1 Σ y = 0 N - 1 | I cur ( x , y ) - I ref ( x - Δx , y - Δy ) | ; - - - ( 1 )
I wherein Cur(x y) is positioned at (x, brightness value y), I for present frame Ref(x-Δ x, y-Δ y) is positioned at the brightness value of (x-Δ x, y-Δ y) for reference frame, and Δ x and Δ y are motion vector, and M is the horizontal dimensions of current macro, and N is the vertical dimensions of current macro.
2. calculate the adjustment parameter of the Lagrange's multiplier factor, for i macro block of n frame (present frame), formula is as follows:
α i , n = ( MAD Frame [ n - 1 ] MAD MB [ i , n - 1 ] ) φ ; - - - ( 2 )
MAD wherein Frame[n-1]Be the mean value of each macro block MAD of n-1 frame (former frame), MAD MB[i, n-1]Be the MAD of n-1 frame (former frame) i macro block, parameter phi is chosen according to actual needs, and recommended value is 0.25.
3. calculate the Lagrange's multiplier factor of i macro block of n frame (present frame), formula is as follows:
λ MODE[i,n]=α i,n×λ MODE; (3)
λ MODE=0.85×2 (QP-12)/3; (4)
Wherein QP is a quantization parameter.
4. calculate I frame quantization parameter, formula is as follows:
QP I = QP I - 1 , BR ≤ th 1 ≤ N SP N p QP I + 1 , th 1 ≤ N SP N p ≤ th 2 QP I + 1 , BR ≥ th 2 QP I + 2 , th 2 ≤ N SP N p ≤ th 3 QP I + 4 , N SP N p > th 3 ; - - - ( 5 )
N wherein SPBe the P frame number of skipping among the previous GOP, N pBe P frame number total among the previous GOP.Th 1, th 2, th 33 valve values for the current cache utilance are set at 10%, 30%, 55% usually, and BR is the buffer memory occupancy before the current GOP of coding.
5. in whole cataloged procedure H.264/AVC, the Bit Allocation in Discrete of GOP level all determined by formula (6), and that current GOP former frame coding is finished the also remaining bit number in back is definite by formula (7).And in the present invention, when previous GOP had used too much bit, the Bit Allocation in Discrete of GOP level changes by formula (8) to be determined, also remaining bit number was determined by formula (10) after current GOP last frame coding was finished.Each formula is as follows:
T r ( n i , 0 ) = u ( n i , 1 ) F r × N GOP + T r ( n i - 1 , N GOP ) ; - - - ( 6 )
N wherein GOPBe a totalframes among the GOP, u (n I, 1) when being first frame of i GOP, available bandwidth,
Figure GSA00000010913400062
In the previous GOP process of encoding, the occupation rate of buffer memory, F rBe predefined frame per second.
T r(n i,j)=T r(n i,j-1)-A(n i,j-1); (7)
A (n wherein I, j-1) be in i GOP, the bit number behind the j-1 frame coding, T r(n I, j) for after finishing at j-1 frame coding, also remaining bit number.
T r ( n i , 0 ) = u ( n i , 1 ) F r × N GOP + β × T r ( n i - 1 , N GOP ) ; - - - ( 8 )
β=a×N GOP+b; (9)
The present invention is after extensive testing, and a=0.003, b=0.02 are got in suggestion.
T r ‾ ( n i , N GOP ) = T r ( n i , N GOP ) + ( 1 - β ) × T r ( n i - 1 , N GOP ) ; - - - ( 10 )
Wherein
Figure GSA00000010913400065
For current GOP last frame coding finish after the correction value of remaining bit number also.

Claims (6)

1. 3 layer bit rate control algolithms based on the Lagrange's multiplier factor is characterized in that, comprise the steps:
1) MAD of i macro block of calculating n-1 frame.
2) the adjustment parameter of the calculating Lagrange's multiplier factor.
3) the Lagrange's multiplier factor of i macro block of calculating n frame.
4) calculate I frame quantization parameter.
5) determine the Bit Allocation in Discrete of GOP level.
2. 3 layer bit rate control algolithms based on the Lagrange's multiplier factor as claimed in claim 1 is characterized in that described step 2) the middle formula that calculates the adjustment parameter of the Lagrange's multiplier factor:
α i , n = ( MAD Frame [ n - 1 ] MAD MB [ i , n - 1 ] ) φ ; - - - ( 2 )
MAD wherein Frame[n-1]Be the mean value of each macro block MAD of n-1 frame (former frame), MAD MB[i, n-1]Be the MAD of n-1 frame (former frame) i macro block, the parameter phi recommended value is 0.25.
3. 3 layer bit rate control algolithms based on the Lagrange's multiplier factor as claimed in claim 1 is characterized in that in the described step 3) calculating the formula of the Lagrange's multiplier factor of i macro block of n frame:
λ MODE[i,n]=α i,n×λ MODE; (3)
λ MODE=0.85×2 (QP-12)/3; (4)
Wherein QP is a quantization parameter.
4. 3 layer bit rate control algolithms based on the Lagrange's multiplier factor as claimed in claim 1 is characterized in that in the described step 4) calculating the formula of I frame quantization parameter:
QP I = QP I - 1 , BR ≤ th 1 ≤ N SP N P QP I + 1 , th 1 ≤ N SP N P ≤ th 2 QP I + 1 , BR ≥ th 2 QP I + 2 , th 2 ≤ N SP N P ≤ th 3 QP I + 4 , Q SP N P > th 3 ; - - - ( 5 )
N wherein SPBe the P frame number of skipping among the previous GOP, N PBe P frame number total among the previous GOP.Th 1, th 2, th 33 valve values for the current cache utilance are set at 10%, 30%, 55% usually, and BR is the buffer memory occupancy before the current GOP of coding.
5. 3 layer bit rate control algolithms based on the Lagrange's multiplier factor as claimed in claim 1 is characterized in that being different from the described step 5) formula of the Bit Allocation in Discrete of definite GOP level H.264/AVC:
T r ( n i , 0 ) = u ( n i , 1 ) F r × F GOP + β × T r ( n i - 1 , N GOP ) ; - - - ( 8 )
β=a×N GOP+b; (9)
T r ‾ ( n i , N GOP ) = T r ( n i , N GOP ) + ( 1 - β ) × T r ( n i - 1 , N GOP ) ; - - - ( 10 )
Wherein
Figure FSA00000010913300024
For current GOP last frame coding finish after the correction value of remaining bit number also.
6. 3 layer bit rate control algolithms based on the Lagrange's multiplier factor as claimed in claim 1, it is characterized in that in the described step 5) determining the using priciple of formula of the Bit Allocation in Discrete of GOP level, wherein formula (6) and formula (7) do not belong to the feature of the described 3 layer bit rate control algolithms based on the Lagrange's multiplier factor of claim 1:
In whole cataloged procedure H.264/AVC, the Bit Allocation in Discrete of GOP level all determined by formula (6), and that current GOP former frame coding is finished the also remaining bit number in back is definite by formula (7).And in the present invention, when previous GOP had used too much bit, the Bit Allocation in Discrete of GOP level changes by formula (8) to be determined, also remaining bit number was determined by formula (10) after current GOP last frame coding was finished.
CN 201010106100 2010-02-04 2010-02-04 Three-layer rate control method based on Lagrange's multiplier factors Pending CN102148973A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010106100 CN102148973A (en) 2010-02-04 2010-02-04 Three-layer rate control method based on Lagrange's multiplier factors

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010106100 CN102148973A (en) 2010-02-04 2010-02-04 Three-layer rate control method based on Lagrange's multiplier factors

Publications (1)

Publication Number Publication Date
CN102148973A true CN102148973A (en) 2011-08-10

Family

ID=44422933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010106100 Pending CN102148973A (en) 2010-02-04 2010-02-04 Three-layer rate control method based on Lagrange's multiplier factors

Country Status (1)

Country Link
CN (1) CN102148973A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780884A (en) * 2012-07-23 2012-11-14 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102780885A (en) * 2012-07-23 2012-11-14 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102821280A (en) * 2012-08-21 2012-12-12 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102821281A (en) * 2012-08-21 2012-12-12 深圳广晟信源技术有限公司 Rate distortion optimization method
CN103237210A (en) * 2013-04-03 2013-08-07 中国科学技术大学 Bit allocation method and bit allocation system in audio coding
CN103561266A (en) * 2013-11-06 2014-02-05 北京牡丹电子集团有限责任公司数字电视技术中心 Rate control method based on logarithm R-Q model and hierarchical bit allocation
CN104202598A (en) * 2013-04-03 2014-12-10 中国科学技术大学 System and method for bit distribution in video coding
CN108235025A (en) * 2018-03-13 2018-06-29 电子科技大学 The Lagrange multiplier optimization method of reference configuration between adaptive frame
CN114793282A (en) * 2021-01-25 2022-07-26 脸萌有限公司 Neural network based video compression with bit allocation

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780884A (en) * 2012-07-23 2012-11-14 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102780885A (en) * 2012-07-23 2012-11-14 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102780884B (en) * 2012-07-23 2015-05-06 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102780885B (en) * 2012-07-23 2014-12-31 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102821280A (en) * 2012-08-21 2012-12-12 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102821281A (en) * 2012-08-21 2012-12-12 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102821281B (en) * 2012-08-21 2015-07-22 深圳广晟信源技术有限公司 Rate distortion optimization method
CN102821280B (en) * 2012-08-21 2015-05-06 深圳广晟信源技术有限公司 Rate distortion optimization method
CN103237210B (en) * 2013-04-03 2015-03-18 中国科学技术大学 Bit allocation method and bit allocation system in audio coding
CN104202598A (en) * 2013-04-03 2014-12-10 中国科学技术大学 System and method for bit distribution in video coding
CN103237210A (en) * 2013-04-03 2013-08-07 中国科学技术大学 Bit allocation method and bit allocation system in audio coding
CN104202598B (en) * 2013-04-03 2018-05-01 中国科学技术大学 The method and system that bit distributes in a kind of Video coding
CN103561266A (en) * 2013-11-06 2014-02-05 北京牡丹电子集团有限责任公司数字电视技术中心 Rate control method based on logarithm R-Q model and hierarchical bit allocation
CN103561266B (en) * 2013-11-06 2016-11-02 北京牡丹电子集团有限责任公司数字电视技术中心 The bit rate control method distributed based on logarithm R-Q model and stratification bit
CN108235025A (en) * 2018-03-13 2018-06-29 电子科技大学 The Lagrange multiplier optimization method of reference configuration between adaptive frame
CN108235025B (en) * 2018-03-13 2021-10-26 电子科技大学 Lagrange multiplier optimization method of self-adaptive inter-frame reference structure
CN114793282A (en) * 2021-01-25 2022-07-26 脸萌有限公司 Neural network based video compression with bit allocation
CN114793282B (en) * 2021-01-25 2024-01-12 脸萌有限公司 Neural network-based video compression with bit allocation
US11895330B2 (en) 2021-01-25 2024-02-06 Lemon Inc. Neural network-based video compression with bit allocation

Similar Documents

Publication Publication Date Title
CN102148973A (en) Three-layer rate control method based on Lagrange's multiplier factors
CN101547349B (en) Method for controlling code rate of secondary AVS encoding of video signal
US8189660B2 (en) Bit rate control method and apparatus
CN103634601B (en) Structural similarity-based efficient video code perceiving code rate control optimizing method
CN101572806B (en) Frame I code rate control method based on H264
CN101895759B (en) H.264 code rate control method
CN100425077C (en) Video compression code ratio control method using uneven distribution of frame target bit number
CN101159871B (en) Macro block group video code rate control method
CN102137258B (en) Method for controlling three-dimensional video code rates
CN101917614A (en) Bit rate control method based on H.264 hierarchical B-frame coding structure
JPH10108187A (en) Quantization method for video coding
US20090310673A1 (en) Method and apparatus for controlling a bitrate in a video processing system
CN106231320B (en) Joint code rate control method and system supporting multi-machine parallel coding
CN104994382A (en) Optimization method for sensing rate distortion
CN101895758B (en) H.264 code rate control method based on frame complexity
CN103281530A (en) HEVC (High Efficiency Video Coding) rate control method based on rate distortion optimization
CN105120282A (en) Code rate control bit distribution method of temporal dependency
Zhou et al. Improvement on rate-distortion performance of H. 264 rate control in low bit rate
CN107707918A (en) Optimized algorithm based on the control of HEVC/H.265 average bit rates
CN101313581B (en) Method and device for coding a video image
CN110139101B (en) Frame-level bit distribution method based on lambda domain code rate control
CN104796703B (en) The bit rate control method of scalable video based on predictive mode rate smoothing
CN101184239A (en) Control method of constant code rate
CN102752591A (en) H.264 code rate control method based on comprehensive factor
CN101511026B (en) Code rate control method for AVS secondary encode based on scene

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: CHENGDU BOSHENG INFORMATION TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: CHENGDU SHIJIA ELECTRONIC INDUSTRIAL CO., LTD.

Effective date: 20120620

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 610041 CHENGDU, SICHUAN PROVINCE TO: 610000 CHENGDU, SICHUAN PROVINCE

TA01 Transfer of patent application right

Effective date of registration: 20120620

Address after: 610000 Chengdu Province, high tech Zone, North Road, No. 19

Applicant after: Chengdu Bosheng Information Technology Co., Ltd.

Address before: 610041, nine Avenue, Wuhou District, Sichuan, Chengdu

Applicant before: Chengdu Shijia Electronics industrial Co., Ltd.

C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20110810