CN102724507B - 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
CN102724507B
CN102724507B CN201210201672.XA CN201210201672A CN102724507B CN 102724507 B CN102724507 B CN 102724507B CN 201210201672 A CN201210201672 A CN 201210201672A CN 102724507 B CN102724507 B CN 102724507B
Authority
CN
China
Prior art keywords
buffering area
quantization parameter
filling
value
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.)
Active
Application number
CN201210201672.XA
Other languages
Chinese (zh)
Other versions
CN102724507A (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

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) accelerates the application scenario of encoding and decoding progressively to be increased.Wherein GPU speech coding application is more and more by with entering the real-time transmission of video platforms such as HD video meeting, network monitoring, streaming media server.GPU speech coding no doubt can improve code efficiency, but these application all require the bit rate output of encoder to meet the transmission restriction of channel above.The Bandwidth-Constrained of transmission channel, or network condition has certain fluctuation, and this just requires video encoder to control bit rate output according to the feature of channel, with the transmission rate of adaptive channel.And now due to the encoder bit rate control method accelerating based on GPU dumb, cause laser propagation effect undesirable.
Along with the renewal of video encoding standard, there is different Rate Control motions in succession to be proposed.H.261 RM8 Rate Control model is used in video encoder.It has adopted a buffering encoding model, and the output of encoder is connected with a buffering area.This Construction of A Model the linear relationship of a kind of coded quantization parameter and buffering area degree of filling.But this model only size of the degree of filling by buffering area is adjusted the size of quantization parameter, does not consider the full condition of buffering area itself, make buffering area be easy to overflow in generation and under overflow.The bit rate control method based on TM5 model of mentioning in " A new rate control scheme using quadratic rate distortion model " that the people such as Tihao Chiang deliver in " IEEE Transactions on Circuits and Systems for Video Technology ", need to a GOP picture group, do bit number by known target bit rate and distribute, this has caused inconvenience also to encoder applies in RTTS.In the 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 need to calculate the variance information in frame.In the encoder accelerating based on GPU, calculate variance and can reduce encoder efficiency, Calculation bottleneck is transferred in the calculating of variance.JVT-G012 is that JVT tissue is about the meeting paper of Rate Control, in < < Adaptive Basic Unit Layer Rate Control for JVT > > mono-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 to carry out at elementary cell layer, this makes to be difficult to be applied to this algorithm in the encoder accelerating based on GPU.
Summary of the invention
Object of the present invention is exactly to provide in a kind of GPU of can be applicable to accelerated video encoding device in order to overcome the defect of above-mentioned prior art existence, and can in the situation that not knowing target bit rate, dynamically adjust the GPU turbo encoder bit rate control method of code check.
Object of the present invention can be achieved through the following technical solutions:
A GPU turbo encoder bit rate control method, the method comprises the following steps:
1) the current picture group of encoder is encoded with initial quantization parameters, and by the video code flow input block encoding, export video code flow according to the situation of transmission channel buffering area;
2) bit rate controller monitors buffering area degree of filling, and bit rate controller calculates according to the value of buffering area degree of filling and buffering area degree of filling rate of change the quantization parameter making new advances;
3), before the coding of each picture group starts, import current new quantization parameter into encoder, as the quantization parameter of this picture group.
The formula of the quantization parameter that calculating described step 2) is new is
QP i=max{0,mmin{31,QP i-1+func1(B f)+func2(dB f)}}
In formula, QP ifor new quantization parameter, QP i-1for last quantization parameter, B ffor 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 adjust the function of quantization parameter according to current buffering area degree of filling rate of change, and quantization parameter each time remains in 0~31 scope.
The computing formula of described func1 is
func1(B f)=E(B f-B fd-β)-E(B fd-B f-β)
Wherein, B fdfor desirable buffering area degree of filling value, [B fd-β, B fd+ β] be the ideal interval of buffering area degree of filling, E function is unit step function, works as B fvalue drops on B fdcentered by, length is outside the interval of 2 β time, func1 value is 0; Work as B fwhile being less than ideal interval, func1 value is-1, shows that lower quantization parameter, to increase bit rate output, makes B frise to ideal interval, work as B fwhile being greater than ideal interval, func1 value is 1, shows to increase quantization parameter to reduce bit rate output, makes B fbe reduced to ideal interval.
Described buffering area degree of filling rate of change b fifor current buffering area degree of filling value, B fi-1for last buffering area degree of filling value.
The computing formula of described func2 is
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 fwhile not reaching ideal interval, if B fto be less than α 1rate increase, keep to quantize parameter constant, if its rate of rise is greater than α 1, increase quantization parameter value; Work as B fenter after ideal interval, if its rate of change is at [α 2, α 2] in, keep quantizing parameter constant, otherwise regulate quantization parameter; Work as B fduring higher than ideal interval, if B fto be less than α 1speed decline, keep quantizing parameter constant, if its fall off rate is greater than α 1, lower quantization parameter.
The inventive method is suitable for the encoder accelerating based on GPU, and can in the situation that not knowing target bit rate, export by control stream, is applicable to being applied in multiple RTP Transport System for Real-time.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 all completes at GOP picture frame layer, does not relate to the operation below frame layer, in the encoder that is adapted at accelerating based on GPU, applies.
2) in bit rate control method involved in the present invention and frame, image information is irrelevant, can not have influence on GPU acceleration efficiency.After adding Rate Control module, can't improve the Time & 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 analysis and regulation encoder bit rate output, do not need to 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 by buffering area regulates quantization parameter, buffering area degree of filling can also be maintained in to an ideal value, avoided buffering area on overflow and under overflow.
Accompanying drawing explanation
Fig. 1 is the data flow diagram of the inventive method;
Fig. 2 is the bit rate output contrast schematic diagram of CQP pattern and RM8 model;
Fig. 3 is the inventive method and the contrast schematic diagram of RM8 model to Rate Control;
Fig. 4 is the contrast schematic diagram that the inventive method and RM8 model are controlled for buffering area degree of filling.
Embodiment
Below in conjunction with accompanying drawing, the present invention is elaborated, the present embodiment is implemented take technical solution of the present invention under prerequisite, provided detailed execution mode and concrete operating process, but protection scope of the present invention is not limited to following embodiment.
Embodiment
As shown in Figure 1, a kind of GPU turbo encoder bit rate control method, the method comprises the following steps:
1) the current picture group of encoder is encoded with initial quantization parameters, and by the video code flow input block encoding, export video code flow according to the situation of transmission channel buffering area, and transmission channel can be the intermediate conveyor medium in any RTTS:
Buffering area arrange can with RM8 model in arrange similarly, its size is made as 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 form change of v (t), also can random fluctuation, and in this example, the bit rate output of buffering area is set to 2kbit/ms; So overall maximum delay L obtains by adjusting buffer size:
max ( Latency ) = buffer _ size min ( v ( t ) ) = 160 &times; 64 k 2 k &times; 1000 = 5.12 s .
2) bit rate controller monitors buffering area degree of filling, and bit rate controller calculates according to the value of buffering area degree of filling and buffering area degree of filling rate of change the quantization parameter making new advances;
In order also to control the degree of filling of buffering area when controlling code check, not only need current B fas parameter, also by more current B fthe B reaching with expectation fadjust quantization parameter, consider B simultaneously fsituation of change, the concrete formula that calculates new quantization parameter is
QP i=max{0,min{31,QP i-1+func1(B f)+func2(dB f)}}
In formula, QP ifor new quantization parameter, QP i-1for last quantization parameter, B ffor 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 scope.
The computing formula of described func1 is
func1(B f)=E(B f-B fd-β)-E(B fd-B f-β)
Wherein, B fdfor desirable buffering area degree of filling value, [B fd-β, B fd+ β] be the ideal interval of buffering area degree of filling, in this example B fdget 25%, β and get in this example 0.05; E function is unit step function, works as B fvalue drops on B fdcentered by, length is outside the interval of 2 β time, func1 value is 0; Work as B fwhile being less than ideal interval, func1 value is-1, shows that lower quantization parameter, to increase bit rate output, makes B frise to ideal interval, work as B fwhile being greater than ideal interval, func1 value is 1, shows to increase quantization parameter to reduce bit rate output, makes B fbe reduced to ideal interval.
Described buffering area degree of filling rate of change b fifor current buffering area degree of filling value, B fi-1for last buffering area degree of filling value.
The computing formula of described func2 is
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, α 2for 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 fwhile not reaching ideal interval, if B fto be less than α 1rate increase, keep to quantize parameter constant, if its rate of rise is greater than α 1, increase quantization parameter value; Work as B fenter after ideal interval, if its rate of change is at [α 2, α 2] in, keep quantizing parameter constant, otherwise regulate quantization parameter; Work as B fduring higher than ideal interval, if B fto be less than α 1speed decline, keep quantizing parameter constant, if its fall off rate is greater than α 1, lower quantization parameter.
3), before the coding of each picture group starts, 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 during at recompile I frame, arrange new quantization parameter every 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 experiment is lower, and motility is not strong, and latter half picture complexity is higher, cut and motility strong.
Aspect Rate Control, Fig. 2-Fig. 3 has provided the bit rate output of bit rate control method of the present invention, CQP pattern and RM8 model based coding device and has controlled schematic diagram.As can be seen from Figure 3 bit rate control method of the present invention and RM8 can obtain good rate adjust effect, after picture complexity raising and sports type aggravation, encoder bit rate output has surge, but bit rate control method of the present invention and RM8 model can be within the identical time by rate adjust to ideal value.
But aspect safeguarding in buffering area, as shown in Figure 4, can see, RM8, in order to provide higher quantization parameter value, maintains a very high level in the second half section of Video coding always, sometimes even approaches 0.9, and this is easy to cause overflowing.And involved bit rate control method can return to ideal value 0.25 by buffering area degree of filling at short notice in the present invention.
Visible, bit rate control method of the present invention is applicable to being applied in the coding scene of GPU acceleration, and more superior than RM8 model.

Claims (1)

1. a GPU turbo encoder bit rate control method, is characterized in that, the method comprises the following steps:
1) the current picture group of encoder is encoded with initial quantization parameters, and by the video code flow input block encoding, export video code flow according to the situation of transmission channel buffering area;
2) bit rate controller monitors buffering area degree of filling, and bit rate controller calculates according to the value of buffering area degree of filling and buffering area degree of filling rate of change the quantization parameter making new advances;
3), before the coding of each picture group starts, import current new quantization parameter into encoder, as the quantization parameter of this picture group;
The formula of the quantization parameter that calculating described step 2) is new is
QP i=max{0,min{31,QP i-1+func1(B f)+func2(dB f)}}
In formula, QP ifor new quantization parameter, QP i-1for last quantization parameter, B ffor 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 adjust the function of quantization parameter according to current buffering area degree of filling rate of change, and quantization parameter each time remains in 0~31 scope;
The computing formula of described func1 is
func1(B f)=E(B f-B fd-β)-E(B fd-B f-β)
Wherein, B fdfor desirable buffering area degree of filling value, [B fd-β, B fd+ β] be the ideal interval of buffering area degree of filling, E function is unit step function, works as B fvalue drops on B fdcentered by, length is outside the interval of 2 β time, func1 value is 0; Work as B fwhile being less than ideal interval, func1 value is-1, shows that lower quantization parameter, to increase bit rate output, makes B frise to ideal interval, work as B fwhile being greater than ideal interval, func1 value is 1, shows to increase quantization parameter to reduce bit rate output, makes B fbe reduced to ideal interval;
Described buffering area degree of filling rate of change b fifor current buffering area degree of filling value, B fi-1for last buffering area degree of filling value;
The computing formula of described func2 is
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 fwhile not reaching ideal interval, if B fto be less than α 1rate increase, keep to quantize parameter constant, if its rate of rise is greater than α 1, increase quantization parameter value; Work as B fenter after ideal interval, if its rate of change is at [α 2, α 2] in, keep quantizing parameter constant, otherwise regulate quantization parameter; Work as B fduring higher than ideal interval, if B fto be less than α 1speed decline, keep quantizing parameter constant, if its fall off rate is greater than α 1, lower quantization parameter.
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 CN102724507A (en) 2012-10-10
CN102724507B true 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)

Families Citing this family (4)

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

Citations (4)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8441965B2 (en) * 2010-08-05 2013-05-14 Apple Inc. Methods and apparatus for reducing data transmission overhead

Patent Citations (4)

* 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

Also Published As

Publication number Publication date
CN102724507A (en) 2012-10-10

Similar Documents

Publication Publication Date Title
JP4390112B2 (en) Method and apparatus for controlling rate of video sequence and video encoding apparatus
CN104469367B (en) The video code rate control method adjusted based on frame losing and quantization parameter
CN101795415B (en) Method and device for controlling code rate in video coding
CN101895759B (en) H.264 code rate control method
CN106993190B (en) Software-hardware synergism coding method and system
WO2009121234A1 (en) A video compression code rate control method
CN102932641A (en) Constant quality code rate controlling method
CN102724507B (en) GPU (graphic processing unit) accelerating encoder rate control method
CN101835042A (en) Wyner-Ziv video coding system controlled on the basis of non feedback speed rate and method
CN105681793A (en) Very-low delay and high-performance video coding intra-frame code rate control method based on video content complexity adaption
CN100563338C (en) A kind of control method of constant code rate
JP2001094997A (en) Data transmission rate controller adaptive to network bandwidth
CN100448295C (en) Integration code rate control method of low complexity
CN1332576A (en) Quantization and code stream control method for image compressing transmission
CN103051897A (en) Code rate control method of H264 video coding
CN104025595B (en) Method for encoding images and picture coding device
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
CN115633176B (en) Method, device and storage medium for dynamically adjusting length of picture group
CN101854524A (en) Method for controlling code rate of video encoder with very low bit rate
CN110677664B (en) Low-jitter code rate control method for 4K/8K ultra-high-definition video coding
Wang et al. Adaptive rate control for dynamic bandwidth in video transcoding
KR100949755B1 (en) A method and an apparatus for controlling the rate of a video sequence, a video encoding device
CN101360229B (en) Smoothing method and device for image code stream
Kang et al. SNR-based bit allocation in video quality smoothing

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