CN102724507A - GPU (graphic processing unit) accelerating encoder rate control method - Google Patents

GPU (graphic processing unit) accelerating encoder rate control method Download PDF

Info

Publication number
CN102724507A
CN102724507A CN201210201672XA CN201210201672A CN102724507A CN 102724507 A CN102724507 A CN 102724507A CN 201210201672X A CN201210201672X A CN 201210201672XA CN 201210201672 A CN201210201672 A CN 201210201672A CN 102724507 A CN102724507 A CN 102724507A
Authority
CN
China
Prior art keywords
quantization parameter
buffering area
filling
value
bit rate
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.)
Granted
Application number
CN201210201672XA
Other languages
Chinese (zh)
Other versions
CN102724507B (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.)
Shanghai Jiaotong University
Original Assignee
Shanghai Jiaotong University
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 Shanghai Jiaotong University filed Critical Shanghai Jiaotong University
Priority to CN201210201672.XA priority Critical patent/CN102724507B/en
Publication of CN102724507A publication Critical patent/CN102724507A/en
Application granted granted Critical
Publication of CN102724507B publication Critical patent/CN102724507B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to a GPU (graphic processing unit) accelerating encoder rate control method. The method includes the steps: 1) encoding a current picture group of an encoder according to initial quantized parameters, inputting encoded video streams into a buffer area, and enabling the buffer area to output the video steams according to conditions of a transmission channel; 2) enabling a rate controller to monitor degree of fullness of the buffer area and to compute new quantized parameters according to values of degree of fullness of the buffer area and variation rate of degree of fullness of the buffer area; and 3) before starting of encoding of each picture group, transmitting the current new quantized parameters to the encoder to serve as quantized parameters of the picture group. Compared with the prior art, the GPU accelerating encoder rate control method has the advantages of no addition of time and space complexity, capability of dynamically adjusting rate with unclear target rate and the like.

Description

A kind of GPU turbo encoder bit rate control method
Technical field
The present invention relates to a kind of encoder bit rate control method, especially relate to a kind of GPU turbo encoder bit rate control method.
Background technology
Along with HD video incorporates people's life gradually, GPU (Graphic Processing Unit, graphic process unit) quickens the application scenario of encoding and decoding progressively to be increased.Wherein the quilt of GPU speech coding applied more and more is with advancing real-time video transmission platforms such as HD video meeting, network monitoring, streaming media server.The GPU speech coding no doubt can improve code efficiency, but above these are used the transmission restriction that the bit rate output that all requires encoder meets channel.The limited bandwidth of transmission channel, or network condition has certain fluctuation, this just requires the video encoder will be according to the characteristics control bit rate output of channel, with the transmission rate of adaptive channel.And, cause laser propagation effect undesirable now owing to the encoder bit rate control method that quickens based on GPU and dumb.
Along with the renewal of video encoding standard, there is different code rate control motion to be proposed in succession.H.261 RM8 Rate Control model is used in the video encoder.It has adopted a buffering encoding model, and the output of encoder links to each other with a buffering area.This model construction the linear relationship of a kind of coded quantization parameter and buffering area degree of filling.But this model is the size of the size adjustment quantization parameter of the degree of filling through buffering area only, does not consider the full condition of buffering area itself, make buffering area be easy to overflow in the generation and under overflow.The bit rate control method of mentioning in " A new rate control scheme using quadratic rate distortion model " that people such as Tihao Chiang deliver in " IEEE Transactions on Circuits and Systems for Video Technology " based on the TM5 model; Need do bit number to a GOP picture group through the known target code check and distribute, this has caused inconvenience also for encoder applies in RTTS.In people's such as Ribas-Corbera J. article " Rate control in DCT video coding for low-delay communications ", adopted logarithm R-D model, this just needs to calculate the variance information in the frame.In the encoder that quickens based on GPU, Calculation variance can reduce encoder efficient, transfers in the calculating of variance calculating bottleneck.JVT-G012 is the meeting paper of JVT tissue about Rate Control, and in " Adaptive Basic Unit Layer Rate Control for JVT " literary composition, JVT-G012 has proposed a kind of motion of H.264 Rate Control.But in this algorithm, calculate MAD and rate-distortion optimization and all need carry out at the elementary cell layer, this makes and in the encoder that quickens based on GPU, is difficult to be applied to this algorithm.
Summary of the invention
The object of the invention is exactly to provide in a kind of GPU of can be applicable to accelerated video encoding device for the defective that overcomes above-mentioned prior art existence, and can not know the GPU turbo encoder bit rate control method of dynamically adjusting code check under the situation of target bit rate.
The object of the invention can be realized through following technical scheme:
A kind of GPU turbo encoder bit rate control method, this method may further comprise the steps:
1) the current picture group of encoder is with the initial quantization parameter coding, and with the video code flow input block that encodes, buffering area is exported video code flow according to the situation of transmission channel;
2) bit rate controller is kept watch on the buffering area degree of filling, and bit rate controller calculates the quantization parameter that makes new advances according to the value and the buffering area degree of filling rate of change of buffering area degree of filling;
3) before the coding of each picture group begins, import current new quantization parameter into encoder, as the quantization parameter of this picture group.
The formula of the quantization parameter that the calculating described step 2) is new does
QP i=max{0,mmin{31,QP i-1+func1(B f)+func2(dB f)}}
In the formula, QP iBe new quantization parameter, QP I-1Be the quantization parameter of last time, B fBe buffering area degree of filling value, 0≤B f≤1, dB fBuffering area degree of filling rate of change; Func1 is for adjusting the function of quantization parameter according to current buffering area degree of filling value; Func2 is for adjusting the function of quantization parameter according to current buffering area degree of filling rate of change, quantization parameter each time remains in 0~31 the scope.
The computing formula of described func1 does
func1(B f)=E(B f-B fd-β)-E(B fd-B f-β)
Wherein, B FdBe desirable buffering area degree of filling value, [B Fd-β, B Fd+ β] be between the ideal area of buffering area degree of filling, the E function is a unit step function, promptly works as B fValue drops on B FdBe the center, when length was 2 β interval outer, the func1 value was 0; Work as B fLess than between ideal area the time, the func1 value is-1, shows that the lower quantization parameter to increase bit rate output, makes B fRise between ideal area, work as B fGreater than between ideal area the time, the func1 value is 1, shows to increase quantization parameter to reduce bit rate output, makes B fBe reduced between ideal area.
Described buffering area degree of filling rate of change
Figure BDA00001780316900031
B FiBe current buffering area degree of filling value, B Fi-1Be last buffering area degree of filling value.
The computing formula of described func2 does
func 2 ( dB f ) = E ( dB f ) + E ( dB f - &alpha; 1 ) - E ( - dB f ) 0 < B f < B fd - &beta; E ( dB f - &alpha; 2 ) - E ( - dB f - &alpha; 2 ) - &beta; &le; B f &le; B fd + &beta; E ( dB f ) - E ( - dB f ) - E ( - dB f - &alpha; 1 ) B fd + &beta; < B f &le; 1
Wherein, α 1, α 2Ideal value for buffering area degree of filling rate of change; Work as B fWhen not reaching between ideal area, if B fWith less than α 1Rate increase, then keep to quantize parameter constant, if its rate of rise is greater than α 1, then increase quantization parameter value; Work as B fAfter getting between ideal area, if its rate of change is at [α 2, α 2] in, then keep quantizing parameter constant, otherwise regulate quantization parameter; Work as B fWhen being higher than between ideal area, if B fWith less than α 1Speed descend, then keep quantizing parameter constant, if its fall off rate is greater than α 1, lower quantization parameter then.
The inventive method is suitable for the encoder that quickens based on GPU, and can not know control stream output under the situation of target bit rate, is fit to be applied in the multiple real-time video transmission system.Compared with prior art, novelty of the present invention and practicality are mainly reflected in four aspects:
1) bit rate control method involved in the present invention is all accomplished at the GOP picture frame layer, does not relate to the operation below the frame layer, uses in the encoder that is adapted at quickening based on GPU.
2) bit rate control method and the interior image information of frame involved in the present invention are irrelevant, can not have influence on the GPU acceleration efficiency.After adding the Rate Control module, can't improve the time and the space complexity of whole application.
3) in bit rate control method involved in the present invention, the transmission code check of transmission channel can arbitrarily change.In the process of analyzing adjustment encoder bit rate output, need not know any information of buffering area bit rate output.
4) the present invention has made optimization to RM8 Rate Control model.Not only the size of the degree of filling through buffering area is regulated quantization parameter, can also the buffering area degree of filling be maintained in an ideal value, avoided buffering area on overflow and under overflow.
Description of drawings
Fig. 1 is the data flow diagram of the inventive method;
Fig. 2 is the bit rate output contrast sketch map of CQP pattern and RM8 model;
Fig. 3 is the inventive method and the RM8 model contrast sketch map to Rate Control;
Fig. 4 is the contrast sketch map that the inventive method and RM8 model are controlled for the buffering area degree of filling.
Embodiment
Below in conjunction with accompanying drawing the present invention is elaborated, present embodiment provided detailed execution mode and concrete operating process, but protection scope of the present invention is not limited to following embodiment being to implement under the prerequisite with technical scheme of the present invention.
Embodiment
As shown in Figure 1, a kind of GPU turbo encoder bit rate control method, this method may further comprise the steps:
1) the current picture group of encoder is with the initial quantization parameter coding, and with the video code flow input block that encodes, buffering area is exported video code flow according to the situation of transmission channel, and transmission channel can be the intermediate conveyor medium in any RTTS:
Buffering area be provided with can with the RM8 model in be provided with similarly, its size is made as the p*64k bit, p gets 160 in this example; The bit rate output of buffering area can be set to constant, also can be according to the change of the form of v (t), also can random fluctuation, and in this instance, the bit rate output of buffering area is set to 2kbit/ms; So overall maximum delay L obtains through the adjustment buffer size:
max ( Latency ) = buffer _ size min ( v ( t ) ) = 160 &times; 64 k 2 k &times; 1000 = 5.12 s .
2) bit rate controller is kept watch on the buffering area degree of filling, and bit rate controller calculates the quantization parameter that makes new advances according to the value and the buffering area degree of filling rate of change of buffering area degree of filling;
In order in the control code check, also to control the degree of filling of buffering area, not only need current B fAs parameter, also through more current B fThe B that reaches with expectation fAdjust quantization parameter, consider B simultaneously fSituation of change, the concrete formula that calculates new quantization parameter does
QP i=max{0,min{31,QP i-1+func1(B f)+func2(dB f)}}
In the formula, QP iBe new quantization parameter, QP I-1Be the quantization parameter of last time, B fBe buffering area degree of filling value, 0≤B f≤1, dB fBuffering area degree of filling rate of change; Func1 is for adjusting the function of quantization parameter according to current buffering area degree of filling value; Func2 is for adjusting the function of quantization parameter according to current buffering area degree of filling rate of change; Too not coarse in order to guarantee video encoding quality, quantization parameter each time remains in 0~31 the scope.
The computing formula of described func1 does
func1(B f)=E(B f-B fd-β)-E(B fd-B f-β)
Wherein, B FdBe desirable buffering area degree of filling value, [B Fd-β, B Fd+ β] be between the ideal area of buffering area degree of filling, B in this example FdGet 25%, β gets 0.05 in this example; The E function is a unit step function, promptly works as B fValue drops on B FdBe the center, when length was 2 β interval outer, the func1 value was 0; Work as B fLess than between ideal area the time, the func1 value is-1, shows that the lower quantization parameter to increase bit rate output, makes B fRise between ideal area, work as B fGreater than between ideal area the time, the func1 value is 1, shows to increase quantization parameter to reduce bit rate output, makes B fBe reduced between ideal area.
Described buffering area degree of filling rate of change
Figure BDA00001780316900051
B FiBe current buffering area degree of filling value, B Fi-1Be last buffering area degree of filling value.
The computing formula of described func2 does
func 2 ( dB f ) = E ( dB f ) + E ( dB f - &alpha; 1 ) - E ( - dB f ) 0 < B f < B fd - &beta; E ( dB f - &alpha; 2 ) - E ( - dB f - &alpha; 2 ) - &beta; &le; B f &le; B fd + &beta; E ( dB f ) - E ( - dB f ) - E ( - dB f - &alpha; 1 ) B fd + &beta; < B f &le; 1
Wherein, α 1, α 2Be the ideal value of buffering area degree of filling rate of change, in the present embodiment, get α 1Be 1, α 2Be 0.1; Work as B fWhen not reaching between ideal area, if B fWith less than α 1Rate increase, then keep to quantize parameter constant, if its rate of rise is greater than α 1, then increase quantization parameter value; Work as B fAfter getting between ideal area, if its rate of change is at [α 2, α 2] in, then keep quantizing parameter constant, otherwise regulate quantization parameter; Work as B fWhen being higher than between ideal area, if B fWith less than α 1Speed descend, then keep quantizing parameter constant, if its fall off rate is greater than α 1, lower quantization parameter then.
3) before the coding of each picture group begins, import current new quantization parameter into encoder, as the quantization parameter of this picture group.In the present embodiment, gop structure is set to ' IBBPBBP ', and totally 7 frames promptly whenever during at recompile I frame, are provided with new quantization parameter at a distance from 7 frames.
Implementation result:
According to above-mentioned steps, we compare the test result of the inventive method with common RM8 model, the resulting result of CQP pattern-coding.The video first half picture complexity of using in the experiment is lower, and motility is not strong, and the latter half picture complexity is higher, cut and motility strong.
Aspect Rate Control, Fig. 2-Fig. 3 has provided the bit rate output control sketch map of bit rate control method of the present invention, CQP pattern and RM8 model based coding device.Bit rate control method as can be seen from Figure 3 of the present invention and RM8 can obtain the effect of code check adjustment preferably; After picture complexity raising and sports type aggravation; The encoder bit rate output has surge, but bit rate control method of the present invention can be adjusted to ideal value with code check with the RM8 model in the identical time.
But aspect buffering area safeguards, as shown in Figure 4, can see that RM8 maintains a very high level in order to provide higher quantization parameter value in the second half section of video coding always, sometimes even near 0.9, this is easy to cause overflowing.And involved bit rate control method can return to ideal value 0.25 with the buffering area degree of filling at short notice among the present invention.
It is thus clear that bit rate control method of the present invention is fit to be applied in the coding scene of GPU acceleration, and more superior than RM8 model.

Claims (5)

1. GPU turbo encoder bit rate control method is characterized in that this method may further comprise the steps:
1) the current picture group of encoder is with the initial quantization parameter coding, and with the video code flow input block that encodes, buffering area is exported video code flow according to the situation of transmission channel;
2) bit rate controller is kept watch on the buffering area degree of filling, and bit rate controller calculates the quantization parameter that makes new advances according to the value and the buffering area degree of filling rate of change of buffering area degree of filling;
3) before the coding of each picture group begins, import current new quantization parameter into encoder, as the quantization parameter of this picture group.
2. a kind of GPU turbo encoder bit rate control method according to claim 1 is characterized in that described step 2) in the formula of the new quantization parameter of calculating do
QP i=max{0,min{31,QP i-1+func1(B f)+func2(dB f)}}
In the formula, QP iBe new quantization parameter, QP I-1Be the quantization parameter of last time, B fBe buffering area degree of filling value, 0≤B f≤1, dB fBuffering area degree of filling rate of change; Func1 is for adjusting the function of quantization parameter according to current buffering area degree of filling value; Func2 is for adjusting the function of quantization parameter according to current buffering area degree of filling rate of change, quantization parameter each time remains in 0~31 the scope.
3. a kind of GPU turbo encoder bit rate control method according to claim 2 is characterized in that the computing formula of described func1 does
func1(B f)=E(B f-B fd-β)-E(B fd-B f-β)
Wherein, B FdBe desirable buffering area degree of filling value, [B Fd-β, B Fd+ β] be between the ideal area of buffering area degree of filling, the E function is a unit step function, promptly works as B fValue drops on B FdBe the center, when length was 2 β interval outer, the func1 value was 0; Work as B fLess than between ideal area the time, the func1 value is-1, shows that the lower quantization parameter to increase bit rate output, makes B fRise between ideal area, work as B fGreater than between ideal area the time, the func1 value is 1, shows to increase quantization parameter to reduce bit rate output, makes B fBe reduced between ideal area.
4. a kind of GPU turbo encoder bit rate control method according to claim 3 is characterized in that, described buffering area degree of filling rate of change
Figure FDA00001780316800011
B FiBe current buffering area degree of filling value, B Fi-1Be last buffering area degree of filling value.
5. a kind of GPU turbo encoder bit rate control method according to claim 4 is characterized in that the computing formula of described func2 does
func 2 ( dB f ) = E ( dB f ) + E ( dB f - &alpha; 1 ) - E ( - dB f ) 0 < B f < B fd - &beta; E ( dB f - &alpha; 2 ) - E ( - dB f - &alpha; 2 ) - &beta; &le; B f &le; B fd + &beta; E ( dB f ) - E ( - dB f ) - E ( - dB f - &alpha; 1 ) B fd + &beta; < B f &le; 1
Wherein, α 1, α 2Ideal value for buffering area degree of filling rate of change: work as B fWhen not reaching between ideal area, if B fWith less than α 1Rate increase, then keep to quantize parameter constant, if its rate of rise is greater than α 1, then increase quantization parameter value; Work as B fAfter getting between ideal area, if its rate of change is at [α 2, α 2] in, then keep quantizing parameter constant, otherwise regulate quantization parameter; Work as B fWhen being higher than between ideal area, if B fWith less than α 1Speed descend, then keep quantizing parameter constant, if its fall off rate is greater than α 1, lower quantization parameter then.
CN201210201672.XA 2012-06-18 2012-06-18 GPU (graphic processing unit) accelerating encoder rate control method Active CN102724507B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210201672.XA CN102724507B (en) 2012-06-18 2012-06-18 GPU (graphic processing unit) accelerating encoder rate control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210201672.XA CN102724507B (en) 2012-06-18 2012-06-18 GPU (graphic processing unit) accelerating encoder rate control method

Publications (2)

Publication Number Publication Date
CN102724507A true CN102724507A (en) 2012-10-10
CN102724507B CN102724507B (en) 2014-10-15

Family

ID=46950152

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210201672.XA Active CN102724507B (en) 2012-06-18 2012-06-18 GPU (graphic processing unit) accelerating encoder rate control method

Country Status (1)

Country Link
CN (1) CN102724507B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104853193A (en) * 2014-02-19 2015-08-19 腾讯科技(北京)有限公司 Video compression method, device and electronic equipment
CN110662045A (en) * 2019-09-30 2020-01-07 杭州当虹科技股份有限公司 8K-oriented AVS2 ultra-high definition video coding rate control method
CN116506617A (en) * 2023-06-28 2023-07-28 鹏城实验室 Image shallow compression code rate control method and device
WO2023240799A1 (en) * 2022-06-14 2023-12-21 晶晨半导体(上海)股份有限公司 Method and module for controlling code rate of encoder, and chip, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1138805A (en) * 1994-12-14 1996-12-25 大宇电子株式会社 Method and apparatus for deciding quantization parameter
CN1175853A (en) * 1996-06-26 1998-03-11 三星电子株式会社 Image encoding method and apparatus for controlling number of bits generated using quantization activities
CN101765003A (en) * 2008-12-23 2010-06-30 上海茂碧信息科技有限公司 Method for transmitting audio and video under environment of network with different speeds
CN101855907A (en) * 2007-11-07 2010-10-06 英国电讯有限公司 Video coding
US20120033612A1 (en) * 2010-08-05 2012-02-09 Cherif Jazra Methods and apparatus for reducing data transmission overhead

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1138805A (en) * 1994-12-14 1996-12-25 大宇电子株式会社 Method and apparatus for deciding quantization parameter
CN1175853A (en) * 1996-06-26 1998-03-11 三星电子株式会社 Image encoding method and apparatus for controlling number of bits generated using quantization activities
CN101855907A (en) * 2007-11-07 2010-10-06 英国电讯有限公司 Video coding
CN101765003A (en) * 2008-12-23 2010-06-30 上海茂碧信息科技有限公司 Method for transmitting audio and video under environment of network with different speeds
US20120033612A1 (en) * 2010-08-05 2012-02-09 Cherif Jazra Methods and apparatus for reducing data transmission overhead

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104853193A (en) * 2014-02-19 2015-08-19 腾讯科技(北京)有限公司 Video compression method, device and electronic equipment
CN104853193B (en) * 2014-02-19 2019-06-07 腾讯科技(北京)有限公司 Video-frequency compression method, device and electronic equipment
CN110662045A (en) * 2019-09-30 2020-01-07 杭州当虹科技股份有限公司 8K-oriented AVS2 ultra-high definition video coding rate control method
CN110662045B (en) * 2019-09-30 2021-10-15 杭州当虹科技股份有限公司 8K-oriented AVS2 ultra-high definition video coding rate control method
WO2023240799A1 (en) * 2022-06-14 2023-12-21 晶晨半导体(上海)股份有限公司 Method and module for controlling code rate of encoder, and chip, electronic device and storage medium
CN116506617A (en) * 2023-06-28 2023-07-28 鹏城实验室 Image shallow compression code rate control method and device
CN116506617B (en) * 2023-06-28 2023-09-12 鹏城实验室 Image shallow compression code rate control method and device

Also Published As

Publication number Publication date
CN102724507B (en) 2014-10-15

Similar Documents

Publication Publication Date Title
JP4390112B2 (en) Method and apparatus for controlling rate of video sequence and video encoding apparatus
CN101795415B (en) Method and device for controlling code rate in video coding
CN101895759B (en) H.264 code rate control method
CN104469367B (en) The video code rate control method adjusted based on frame losing and quantization parameter
CN101159867B (en) Patch based self-adaptive code rate control method
CN102932641B (en) A kind of constant-quality bit rate control method
WO2009121234A1 (en) A video compression code rate control method
US20150172680A1 (en) Producing an Output Need Parameter for an Encoder
CN106993190B (en) Software-hardware synergism coding method and system
CN102761741A (en) Video encoding code rate control system and method on basis of caches at encoding and decoding ends
CN102724507B (en) GPU (graphic processing unit) accelerating encoder rate control method
JP2001094997A (en) Data transmission rate controller adaptive to network bandwidth
CN100563338C (en) A kind of control method of constant code rate
CN1332576A (en) Quantization and code stream control method for image compressing transmission
CN100448295C (en) Integration code rate control method of low complexity
CN101568025B (en) Self-adaptive controlling method for a virtual buffering region in code rate control
CN103051897A (en) Code rate control method of H264 video coding
CN104025595B (en) Method for encoding images and picture coding device
JP2004320707A (en) Apparatus for simultaneously encoding multiple video information
CN100563336C (en) A kind of constant code rate control method based on mobile TV
CN110572661B (en) Low-delay code rate control method for 4K/8K ultra-high-definition video coding
CN101854524A (en) Method for controlling code rate of video encoder with very low bit rate
CN101360229B (en) Smoothing method and device for image code stream
KR100949755B1 (en) A method and an apparatus for controlling the rate of a video sequence, a video encoding device
Yuan et al. Latest arrival time leaky bucket for HRD constrained video coding

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