CN103686172A - Code rate control method based on variable bit rate in low latency video coding - Google Patents

Code rate control method based on variable bit rate in low latency video coding Download PDF

Info

Publication number
CN103686172A
CN103686172A CN201310711663.XA CN201310711663A CN103686172A CN 103686172 A CN103686172 A CN 103686172A CN 201310711663 A CN201310711663 A CN 201310711663A CN 103686172 A CN103686172 A CN 103686172A
Authority
CN
China
Prior art keywords
frame
coding
bit rate
value
quantization parameter
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
CN201310711663.XA
Other languages
Chinese (zh)
Other versions
CN103686172B (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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN201310711663.XA priority Critical patent/CN103686172B/en
Publication of CN103686172A publication Critical patent/CN103686172A/en
Application granted granted Critical
Publication of CN103686172B publication Critical patent/CN103686172B/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 provides a code rate control method based on a variable bit rate in low latency video coding. By the aid of a built rate-distortion model, the linear relation between every two of a quantization parameter, a frame coding output bit and coding image texture complexity in video image coding is discovered, and a novel method for adjusting the quantization parameter is given. Moreover, in order to reasonably adjust the quantization parameter, adjusting intensity Ipt (t) is introduced and is decreased when the change frequency and intensity of a plurality of continuous frame coding quantization parameter values are higher, and the adjusting intensity Ipt (t) is increased when the change frequency and intensity of the continuous frame coding quantization parameter values are lower. The quantization parameter values are determined based on the rate-distortion model, so that a code rate is controlled by adjusting the variable bit rate with high stability, an actual output pixel bit is extremely close to a target pixel bit, and an actual output pixel can be rapidly closer to change of the target pixel bit.

Description

Low delayed video coding variable bit rate bit rate control method
Technical field
The present invention relates to video image compression coding technology.
Background technology
Rate Control is the integration module of encoding video pictures device one end.In Video coding, low delay (Low-delay) is refered in particular to and in inter prediction encoding process, is only comprised infra-frame prediction I-frame and single directional prediction P-frame, does not use the bi-directional predicted B-frame structure coding that do not adopt.Low delay coding is the sequential encoding of carrying out fast, and feature is that coded sequence is consistent with playing sequence.Modal low delay is encoded to " IPP.. " or " IPP..IPP.. " structure.
For target bit rate (TBR) unit bits per second (bps), when coding starts, be set up, any time in cataloged procedure can be rewritten.After TBR initial setting up, the situation of not rewritten is called constant bit rate (CBR), rewritten once or once above situation be called variable bit rate (VBR).
The adjustment of coding bit rate is inputted to quantization parameter Q by control coding and realize, quantization parameter Q is a nonnegative integer.At MPEG-1, MPEG-2, MPEG-4, H.261, H.263, in WMV1, WMV2, the encoder such as RV10, RV20 its reasonable value scope in [2,31], H.264/AVC, H.264/SVC, in the encoder such as HEVC its reasonable value scope in [0,51].
Summary of the invention
Technical problem to be solved by this invention is that a kind of bit rate control method based on variable bit rate that can rationally regulate quantization parameter Q is provided.
The present invention solves the problems of the technologies described above the technical scheme just adopting to be, the bit rate control method based on variable bit rate in low delayed video coding, comprising:
Coding moment t current, while being I-frame as current volume frame, is used quantization parameter Q:
Q t = Q t - 1 + Q t - 1 a · [ ΔR R t - 1 - b · ( C t - C t - 1 ) C t - 1 ] ;
Coding moment t current, while being P-frame as current volume frame, is used quantization parameter Q:
Q t = Q t - 1 + Q t - 1 a · ΔR R t - 1 ;
Wherein, Q tfor the current coding quantization parameter Q that t is used constantly, Q t-1for a upper coding quantization parameter Q that t-1 is used constantly, R t-1represent the coding frame coding output bit of t-1 constantly, C tfor the coded image Texture complication of current coding moment t, C t-1coded image Texture complication for a upper coding moment t-1; △ R is that coding moment t needs to revise
Figure BDA0000443395030000021
current coding is the buffer pool size of t constantly, and B (t-1) is the upper coding buffer pool size of t-1 constantly, is α, and β is called controller parameter, and μ prevents and kill off 0 empirical parameter;
When current volume frame is I-frame, distortion rate model is lnR=alnQ+blnC+c, Q represents quantization parameter, and R represents frame coding output bit, C presentation code image texture complexity, a, b, c are distortion rate model parameter, and the value of distortion rate model parameter a, b is by how far linear regression is upgraded; When current volume frame is P-frame, distortion rate model is lnR=alnQ+c, and the value of distortion rate model parameter a is upgraded by one-variable linear regression.
The present invention, by the rate-distortion model of setting up, has found the linear relationship existing between two between quantization parameter, frame coding output bit, coded image Texture complication in encoding video pictures, has provided a kind of new method that regulates quantization parameter.And, in order reasonably to carry out the adjusting of quantization parameter, introduced adjusting strength Ipt (t), the frequency that the quantization parameter value of encoding when continuous some frames changes and intensity greatly, will reduce adjusting strength Ipt (t) so; Frequency and intensity that the quantization parameter value of continuous some frame codings changes are less, will increase so adjusting strength Ipt (t).
Further, the present invention can also control code check by adjusting present encoding frame per second by when regulating quantization parameter to control code check, and the inventive method also comprises, by current quantization parameter Q, regulates present encoding frame per second F c: when the value of quantization parameter Q is in low section of interval, in not higher than frame per second upper range, increase present encoding frame per second F c; Interval in high section when the value of quantization parameter Q, in being not less than frame per second lower range, reduce present encoding frame per second F c; Interval in stage casing when the value of quantization parameter Q, keep present encoding frame per second F cconstant;
When quantization parameter Q value frequently drops on low section interval time, suitably increase frame per second, will directly reduce frame coding output bit number, Rate Control will regulate follow-up QP value to interval, stage casing; When quantization parameter Q value frequently drops on high section interval, suitably reduce frame per second, will directly increase frame coding output bit number, also can, so that follow-up QP value is adjusted to interval, stage casing, guarantee that visual quality keeps level and smooth and excellent.
As the upper coding frame per second F of coding in the moment cafter variation, need to be according to new coding frame per second F credefine pixel target bits Tbpp,
Figure BDA0000443395030000022
thereby present encoding buffer pool size B (t) constantly, B (t)=B (t-1)+R t-1-Tbpp, R t-1represent coding t-1 time frame coding output bit constantly, TBR is target bit rate, and W is that image pixel is wide, is the high H of image pixel.
In Rate Control, output code flow data are affected obviously by quantization parameter Q value, but are subject to the impact of picture material also very large simultaneously.The video source that scene texture is complicated, motion change is violent will consume more bit.For balance code consumes, bit is few consumes with coding the video source that bit is extremely many, and the frame rate adjustment of taking the initiative both can guarantee the Rate Control in transmitting procedure, can on visual quality, keep again level and smooth and excellent.
Concrete, by frame per second changed factor
Figure BDA0000443395030000031
regulate present encoding frame per second F c,
Figure BDA0000443395030000032
wherein ← expression is to the parameter assignment of the direction of arrow, F sfor the sampling frame per second obtaining from video source;
Increase present encoding frame per second F cfor reduce present encoding frame per second F cfor
Figure BDA0000443395030000034
Under frame per second, be limited to 10Hz, frame per second upper limit 100Hz.
Concrete, current quantization parameter Q is expressed as the mean value of the quantization parameter using in nearest 1 second coding till present encoding moment t
Figure BDA0000443395030000036
Further, the present invention can also control code check by adjusting image sets GOP by when regulating quantization parameter to control code check, comprises the following steps:
1) calculate the grey level histogram of present frame;
2) by the grey level histogram of present frame and the grey level histogram of previous frame, calculate the index of similarity of two consecutive frames; Described index of similarity represents by cosine similarity:
cos ( θ t - 1 , t ) = Σ i = 1 n H t - 1 [ i ] · H t [ i ] Σ i = 1 n ( H t - 1 [ i ] ) 2 Σ i = 1 n ( H t [ i ] ) 2 ;
Wherein, cos (θ t-1, t) be the histogrammic cosine similarity of two consecutive frames, t represents present encoding constantly, H t[i] is illustrated in the coding pixel sum that the video frame image grey scale pixel value of t is i constantly, H t-1[i] is illustrated in the coding pixel sum that constantly the video frame image grey scale pixel value of t-1 is i, and the scope of video frame image grey scale pixel value is 1 to n, and n is the total element number of grey level histogram while representing by one-dimension array;
3) index of similarity when two consecutive frames is less than threshold value, represents that occurrence scene switches, and enters step 4); Otherwise present frame type is set and is set to P-frame, after extraction next frame data, return to step 1);
4) in statistics present image group GOP, whether the P-frame with coding reaches frame per second cycle numerical value, in this way, enters step 5), otherwise present frame type is set, is set to P-frame, after extraction next frame data, returns to step 1);
5) present frame type is set and is set to I-frame, start a new GOP, after extraction next frame data, return to step 1).
Like this, scene change detection and variable GOP length mutually combine, and will make for long video source to be encoded, and the result of coding output presents the different feature of GOP length.Initial corresponding a new scene of each GOP.
Further, introduce linearly dependent coefficient, come together to characterize index of similarity with cosine similarity;
r t - 1 , t = Σ i = 1 n ( H t - 1 [ i ] - H ‾ t - 1 ) ( H t [ i ] - H ‾ t ) Σ i = 1 n ( H t - 1 [ i ] - H ‾ t - 1 ) 2 Σ i = 1 n ( H t [ i ] - H ‾ t ) 2
H ‾ t = 1 n Σ i = 1 n H t [ i ]
Wherein, r t-1, tbe the histogrammic linearly dependent coefficients of crossing of two consecutive frames,
Figure BDA0000443395030000043
for the video frame image grey scale pixel value average at coding moment t, for, in the video frame image grey scale pixel value average of coding moment t-1.
The invention has the beneficial effects as follows, determine that based on rate-distortion model thereby quantization parameter value realizes the variable bit rate adjustment that stability is higher and control code check, actual output pixel point bit and target pixel points bit are very approaching, the more variation of close-target pixel bit fast of actual output pixel point, further, can also be simultaneously by regulating present encoding frame per second, adjustment image sets GOP to control code check.
Accompanying drawing explanation
Fig. 1 is the position of the integrated bit rate controller of embodiment in whole video coding system.
Fig. 2 is the integrated bit rate controller fundamental diagram of embodiment.
Fig. 3 is that embodiment scene change detection is adjusted flow chart with dynamic GOP.
Fig. 4 is the adjusting flow chart of embodiment variable frame rate.
Fig. 5 is the control flow chart of embodiment variable bit rate.
Fig. 6 is test result buffering area, similarity and the scene change detection state diagram of embodiment in different sequence set.
Fig. 7 is that embodiment is controlled at the state diagram after Deadline sequential coding with full I-frame variable bit rate.
Embodiment
In the present embodiment, Rate Control completes by encoding video pictures bit rate controller, the function that particularly comprises three parts: variable bit rate is controlled function, scene change detection and dynamically GOP adjust the regulatory function of function, variable frame rate, the regulatory function of variable bit rate control, variable frame rate and scene change detection and dynamically GOP adjust the regulatory function of function, variable frame rate and can carry out simultaneously, except the adjusting result of variable frame rate, controlled impact to some extent for one next time on variable bit rate, these three functions are substantially independent of one another.
One, variable bit rate is controlled
The resolution of video image is given before coding starts, represented with the product form of pixel wide (W) and high (H).Owing to may having the existence of multiple sample mode in video image source sampling, two resolution in its colourity direction may have different sizes.Without loss of generality, with the resolution of pixel gray component, represent the true resolution of this image.
For target bit rate (TBR) unit bits per second (bps), when coding starts, be set up, any time in cataloged procedure can be rewritten.After TBR initial setting up, the situation of not rewritten is called constant bit rate (CBR), rewritten once or once above situation be called variable bit rate (VBR).Do not causing obscure in the situation that, TBR is considered to the input parameter that can change, and when TBR value remains unchanged in cataloged procedure, thinks CBR pattern, when TBR value changes (even for once) in cataloged procedure, think VBR pattern.Frame per second (F) is the quantity of the frame of broadcasting per second, unit frame (fps) per second.Be subject to the restriction of image sampling, information source frame per second (F s) given before Video coding.Actual coding frame per second (F c) be conventionally initially set to and F sbe consistent, but also can be set to and F sunequal.Video frequency coding rate can carry out index by every pixel bit (bpp) uniformly to be unified, and so, target bit rate standard can be turned to pixel target bits (Tbpp), by formula (1), is calculated and is obtained.
Tbpp = TBR W · H · F C - - - ( 1 )
Wherein, the value of W and H is fixing, TBR and F cin cataloged procedure, probable value changes, as coding frame per second F cafter adjusting, Tbpp needs to upgrade.
Coding input quantization parameter (QP) represents with Q, is a nonnegative integer.At MPEG-1, MPEG-2, MPEG-4, H.261, H.263, in WMV1, WMV2, the encoder such as RV10, RV20 its reasonable value scope in [2,31], H.264/AVC, H.264/SVC, in the encoder such as HEVC its reasonable value scope in [0,51].
Picture frame level Texture complication represents with C, and the details of token image content itself is enriched degree, with the average of pixel shade of gray, portrays.As shown in formula (2), l wherein i,junder expression, be designated as the pixel gray value of (i, j).Calculating for picture frame level Texture complication is not limited to formula (2), existingly for calculating chart picture frame level Texture complication algorithm, all can be suitable for.
C = Σ i = 1 W - 1 Σ j = 1 H - 1 ( l i , j - l i + 1 , j ) 2 + ( l i , j - l i , j + 1 ) 2 ( W - 1 ) ( H - 1 ) - - - ( 2 )
The distortion of decoded video represents with D, with the pixel average variance (MSE) of Recovery image after original image and coding, portrays.Common picture engraving distortion factor value peak signal is converted and is got by D exactly than the calculating of (PSNR), as shown in formula (3).
PSNR = 10 · 1 g ( 2 K - 1 ) 2 MSE - - - ( 3 )
Figure place when wherein, K represents pixel gray value with binary representation.For example, while representing that with 1 byte (8) 1 pixel grey scale is 256 look, the value of K is 8; While representing a pixel gray value with 10-bit, the value of K is 10.
Frame coding is exported bit and is represented with R, and the rate-distortion model of foundation, as shown in formula (4), also can be rewritten as formula (4) as formula (5).Implicit relation is three variable lnR in encoding video pictures, and lnQ, exists binary once linear relationship between lnC.
lnR=a·lnQ+b·lnC+c (4)
R=Q a·C b·e c (5)
Binary once linear relationship (4) will be directly used in Rate Control, a, and b, c is three model parameters, and Q and C are independents variable, and R is dependent variable.For different information sources, adopt different encoders, configure different coding structures and all can cause a, b, the value of tri-model parameters of c is not identical.But for definite information source, definite encoder, definite coding structure, the value of above-mentioned three model parameters is just highly stable.What binary linearity relation (5) represented is the relation between distortion and bit, intuitively, between the bit number of input and distortion, presents monotonic functional relationship.
To a in I-frame encoding rate distortion model (4), b, the value of tri-parameters of c is introduced multiple linear regression and is upgraded.The input matrix of structure is as shown in formula (6).At coding moment t, the nearest Q of the s frame data of I-frame continuously before collecting, C and R construct the matrix that s capable 3 is listed as.Output rusults in formula (6) after the corresponding I-frame coding of the data of the every a line of matrix.
ln Q t - 1 ln C t - 1 ln R t - 1 ln Q t - 2 ln C t - 2 ln R t - 2 ln Q t - 3 ln C t - 3 ln R t - 3 . . . . . . . . . ln Q t - s ln C t - s ln R t - s s × 3 - - - ( 6 )
When carrying out P-frame Rate Control, parameter b is forced to be set as 0, not consider the impact of Texture complication on coding.Now only have a, two parameters of c are retained, and introduce one-variable linear regression and upgrade.The input matrix of structure is as shown in formula (7).Similarly, at coding moment t, before collecting, the Q of the s frame data of nearest continuous P-frame and R construct the matrix of capable 2 row of s.Output rusults in formula (7) after the corresponding P-frame coding of the data of the every a line of matrix.
ln Q t - 1 ln R t - 1 ln Q t - 2 ln R t - 2 ln Q t - 3 ln R t - 3 . . . . . . ln Q t - s ln R t - s s × 2 - - - ( 7 )
Linear regression is modal statistics and analysis instrument, is easy to obtain its realization.The monobasic that the present invention is used and multiple linear regression adopt least square approximation to carry out matching.Certainly, it also may carry out matching with method for distinguishing, such as least absolute error recurrence etc.Input matrix line number s shown in formula (6) and (7) is the sample number of multiple linear regression, also can be called as window size.In the present invention, the value of s is between minimum 5, the reasonable maximum between maximum 30.
Illusion reference decoder buffering area (being called for short afterwards buffering area) is set, with B (t), represents current t buffer pool size constantly, unit is every pixel bit (bpp).It is 0 that its initial value and desired value are all fixedly installed, i.e. B (0)=0.After each frame coding, buffer pool size will be updated, as shown in formula (8).
B(t)=B(t-1)+R t-1-Tbpp (8)
For formula (8), when B (t) >0, represent excessively to use bit; When B (t) <0, represent to use bit not enough.The target of Rate Control is exactly to make as much as possible B (t) value approach desired value 0.The bit of frame level coding is distributed in the feedback that must consider B (t) on specified Tbpp basis.For the variation of response variance fast, make amount to be regulated within the shortest time, reach target, the present invention selects PD controller to revise B (t).Makeover process is as shown in formula (9).
B ^ ( t ) = f PD ( B ( t ) ) = &alpha; &CenterDot; B ( t ) + &beta; &CenterDot; [ B ( t ) - B ( t - 1 ) ] - - - ( 9 )
Wherein,
Figure BDA0000443395030000072
represent the result after B (t) is corrected, parameter alpha, β is called its value of controller parameter and can relies on empirical value to choose.The value that the present invention recommends is α=0.45, β=0.55.
In order reasonably to carry out the adjusting that in Rate Control, QP value changes, introduce the factor of adjusting strength (Ipt), the consideration based on such: the frequency that continuous some frame coding QP values change and intensity greatly, will reduce the intensity of adjusting so; Frequency and intensity that continuous some frame coding QP values change are less, will increase the intensity regulating so.At present encoding t constantly, the absolute difference that calculates consecutive frame coding QP value in 1 frame per second cycle with, the calculating of Ipt (t) is as shown in formula (10).
Ipt ( t ) = 1 F C &Sigma; i = 1 F C | Q ( t - i ) - Q ( t - i - 1 ) | - - - ( 10 )
So, at the coding bit increment △ R that t need to revise constantly, will calculate and obtain by formula (11).
&Delta;R = B ^ ( t ) &mu; + Ipt ( t ) - - - ( 11 )
Wherein, μ is empirical parameter, and its value drops in interval [0.5,1.0] conventionally, and the intensity that is worth less adjusting is larger, and the intensity that is worth larger adjusting is less.The μ value that the present invention recommends is golden section point 0.618.
For existing, measure for parameter adjustment, conventionally directly employing
Figure BDA0000443395030000075
or the form of △ R=B (t), △ R has reacted and has adjusted the frequency of measuring parameter, when △ R=B (t), for the adjustment of measuring parameter too frequent, and time, can not adjust the long period again, in the present invention, introduce Ipt (t) and revise
Figure BDA0000443395030000077
make encoding efficiency better, fluctuate less.
LnR=alnQ+blnC+c in rate-distortion model formula (4) is partly carried out to total differential differentiate, as shown in formula (12).
d ln R = d ( a &CenterDot; ln Q ) + d ( b &CenterDot; ln C ) + d ( g ) &DoubleRightArrow; 1 R dR = a Q dQ + b C dC &DoubleRightArrow; &Delta;R R = a &CenterDot; &Delta;Q Q + b &CenterDot; &Delta;C C - - - ( 12 )
At current coding moment t, definition △ Q=Q t-Q t-1, △ C=C t-C t-1, calculate so the quantization parameter Q of current I-frame, rely on formula (13) and carry out.For P-frame coding, b is forced to be set as 0, and quantization parameter Q dependence formula (14) carries out so.
Q t = Q t - 1 + Q t - 1 a &CenterDot; [ &Delta;R R t - 1 - b &CenterDot; ( C t - C t - 1 ) C t - 1 ] - - - ( 13 )
Q t = Q t - 1 + Q t - 1 a &CenterDot; &Delta;R R t - 1 - - - ( 14 )
The bit increment △ R introducing in formula (13) and formula (14) is calculated and is obtained by formula (11).
Two, scene change detection and dynamically GOP method of adjustment
Video image usually runs into the situation that scene is switched in broadcasting, and the content of conventionally switching and the frequency of switching are all irregular.From encoding and decoding aspect, due to the extensive use of inter prediction mode in Video coding, subsequent frame is with reference to decoded frame in the early time, so, the moment of switching in scene, current encoded frame cannot be directly obtains from decoded frame in the early time effectively can reference picture (piece).From the angle of application, when scene is switched, should be that image is when carrying out rationally grouping again just.Unnecessary distortion (mosaic phenomenon) blocking-up that the independence grouping of each image sets both can cause packet loss in data transmission procedure, in a GOP, can be also the provide support playing function of random select time point of user.In a word, when scene is switched, carry out new GOP initialization, aspect raising video objective visual quality and service quality, all having a clear superiority in.
The present invention proposes two kinds of scene change detection computational methods.These two kinds of methods all rely on the statistics of histogram of video image, both can implement separately, also can Joint Implementation.
With one-dimension array H, carry out the grey level histogram of presentation video, figure place when K represents pixel gray value with binary representation, total element number of array H is n=2 so k, for example, when a byte of common use (8bit) represents a grey scale pixel value, total element number of H is n=256.Definition H t[i] is illustrated in the coding pixel sum that t video frame image grey scale pixel value is i constantly.With Ka Er Pearson linearly dependent coefficient, represent that the relation of two continuous frames image grey level histogram is as shown in formula (15).
H &OverBar; t = 1 n &Sigma; i = 1 n H t [ i ]
r t - 1 , t = &Sigma; i = 1 n ( H t - 1 [ i ] - H &OverBar; t - 1 ) ( H t [ i ] - H &OverBar; t ) &Sigma; i = 1 n ( H t - 1 [ i ] - H &OverBar; t - 1 ) 2 &Sigma; i = 1 n ( H t [ i ] - H &OverBar; t ) 2 - - - ( 15 )
In formula (16), correlation coefficient r t-1, tspan is [1,1], and on the occasion of representing positive correlation, negative value represents negative correlation.To r t-1, tcarry out square,
Figure BDA0000443395030000085
value can be dropped on to [0,1] scope,
Figure BDA0000443395030000086
the Histogram correlation that more approaches 1 expression two continuous frames is stronger;
Figure BDA0000443395030000087
the Histogram correlation that more approaches 0 expression two continuous frames is more weak.It has been generally acknowledged that,
Figure BDA0000443395030000088
value is greater than at 0.8 o'clock, and linear dependence is remarkable.Complexity computing time of formula (16) is O (n 2).
The correlation that can describe two high dimension vectors by high dimension vector included angle cosine value, is called cosine similitude.By measuring the cosine value of the angle in two inner product of vectors spaces, measure the similitude between them.Formula (16) has provided take the cosine similarity calculation method that statistics with histogram value is high dimension vector.
cos ( &theta; t - 1 , t ) = H t - 1 &CenterDot; H t | | H t - 1 | | &CenterDot; | | H t | | = &Sigma; i = 1 n H t - 1 [ i ] &CenterDot; H t [ i ] &Sigma; i = 1 n ( H t - 1 [ i ] ) 2 &Sigma; i = 1 n ( H t [ i ] ) 2 - - - ( 16 )
In formula (17), in statistics of histogram, H t[i] value is always non-negative, so H t-1and H tvector always drop on the first quartile of higher dimensional space, so their angle theta t-1, tdrop between 0 ° and 90 °.Therefore, cosine similarity cos (θ t-1, t) value be between 0 to 1.θ t-1, tvalue more meets 0 ° of cos (θ so t-1, t) more approaching 1, this represents that two vector correlations are stronger, otherwise more weak.Similar with the computation complexity of formula (16), the time complexity of formula (17) is O (n 2).
Definition Sim tpresentation code is the similitude between adjacent two frames of t constantly, as shown in formula (17).
Sim t = 1 ( t = 0 ) r t - 1 , t 2 &CenterDot; cos ( &theta; t - 1 , t ) ( t &GreaterEqual; 1 ) - - - ( 17 )
The detection method that judgement scene is switched is to work as Sim t>=ξ represents that occurrence scene does not switch; Work as Sim t< ξ represents that scene switching occurs.Here ξ is an empirical value, expresses the sensitivity to scene detection.The value of ξ is large (such as 0.95) too, and flase drop may appear in testing result so; The value too little (such as 0.5) of ξ, testing result may occur undetected so.The value of the present invention's suggestion is 0.85.
If scene change detection is to occurring, present frame type is set to I-frame immediately, and the counter about the P-frame of encoding in GOP is set to 0, and relevant environment is done the initialization of GOP, restarts the coding of a GOP.In the present invention, scene change detection and variable GOP length mutually combine, and will make for long video source to be encoded, and the result of coding output presents the different feature of GOP length.Initial corresponding a new scene of each GOP.
Three, the control method of variable frame rate
The frame per second of Video coding (F) is a scalar-unit, is illustrated in the quantity of the interior frame that shows or refresh of unit interval, and conventional unit is demonstration frame number per second (frames per second, fps or Hz).The restriction that frame per second is sampled, common value has film: 24fps, TV (PAL): 25fps, TV (NTSC): 29.97fps, CRT monitor: 60Hz-85Hz, liquid crystal display: 60Hz, 3D display: 120Hz.From video compression source, conventionally include 20fps, 24fps, 30fps, 50fps, several typical frame per second types such as 60fps.
The sampling frame per second F obtaining from video source snormally fixing, if change frame per second in encoding-decoding process, may there be two kinds of methods.One, more newly-generated frames, expand frame per second.Motion compensation class frame per second promotes and relies on large-scale computing, and interpolation algorithm class frame per second promotes will cause moving object edge blurry or still frame jitter phenomenon.Its two, initiatively give up some frames, selected frame is not encoded.
In Rate Control, output code flow data are affected obviously by QP value, but are subject to the impact of picture material also very large simultaneously.The video source that scene texture is complicated, motion change is violent will consume more bit.For balance code consumes, bit is few consumes with coding the video source that bit is extremely many, and the frame rate adjustment of taking the initiative both can guarantee the Rate Control in transmitting procedure, can on visual quality, keep again level and smooth and excellent.
The legal QP value of coding is carried out to segmentation.Take 20% as experience cut-point, low section 20%, stage casing 60%, high section 20%.Encoder for QP span in [0,31], it is segmented into low section [0,8], stage casing [9,24], high section [25,31].Encoder for QP span in [0,51], it is segmented into low section [0,10], stage casing [11,40], high section [41,51].
The thought of the adjusting of variable frame rate is, when frame coding QP value frequently drops on low section interval time, suitably increases frame per second, will directly reduce frame coding output bit number, and Rate Control will regulate follow-up QP value to interval, stage casing; When frame coding QP value frequently drops on high section interval, suitably reduce frame per second, will directly increase frame coding output bit number, also can be so that follow-up QP value be adjusted to interval, stage casing.
At the initial phase of coding, actual coding frame per second is set to F c← F s, equate with sampling frame per second.Frame per second changed factor is set
Figure BDA0000443395030000101
frame per second of the present invention is revised strategy, at present encoding moment t, asks in nearest 1 second coding, tries to achieve the average as shown in formula (18) of QP value.
Q &LeftArrow; ( t ) = 1 F C &Sigma; i = 1 F C Q ( t - i ) - - - ( 18 )
Judgement
Figure BDA0000443395030000103
span, may there are three kinds of situations:
The first situation, if drop on low section of interval, so
Figure BDA0000443395030000105
The second situation, if drop on interval, stage casing, frame per second keeps so
Figure BDA0000443395030000107
constant;
The third situation, if
Figure BDA0000443395030000108
drop on high section interval, so
Figure BDA0000443395030000109
Finally, actual coding frame per second is modified to
Figure BDA00004433950300001010
certainly, in order to guarantee the ability of the continuous and playback equipment of visual experience, F cmodification will be strictly limited between 10Hz-100Hz.
In the first situation, the double frame that needs is newly inserted to respective numbers of frame per second.Regulation of the present invention, with closing on most the video source data of frame as the video data of new insertion frame,, in the situation that frame per second is double, repeats twice of same frame coding.This method can effectively be avoided the unnecessary distortion that adopts interpolation class and motion compensation class methods to bring.
In the third situation, meaning by half there being the frame of half quantity not to be encoded of frame per second, encodes with the frame of fixed intervals step-length.The video source data being skipped can not be introduced in encoder, and the part of the interframe encode in cataloged procedure will can not use frame-skipping data so.Therefore, when watching video, user can not experience because of frame losing the sudden change of visual quality.
At the first and the 3rd both of these case, revise after frame per second, all need new F cvalue substitution formula (1) recalculates pixel target bits Tbpp.After the modification of conducting frame rate, next code must complete all after dates of a frame per second more just can carry out frame per second judgement next time and revise.
Embodiment
Fig. 1 is the key step flow chart of coding implementation procedure, particularly comprises:
Step 101: select/determine encoder.The standard of encoding video pictures has many, common are: MPEG-1, MPEG-2, MPEG-4, H.261, H.263, WMV1, WMV2, RV10, RV20, H.264/AVC, H.264/SVC, HEVC etc.From configuration file, read selection and the code stream encapsulation format of encoder.
Step 102: initialization code check is controlled parameter.The target bit rate that input bit rate is controlled from configuration file, the frame per second of information source video, resolution, GOP preset length.According to specified file encapsulation format (container), set up the rear output file interface of coding.
Step 103: loop coding starts, reads the frame data of information source video.Rely on actual coding frame per second and from information source video file or data flow, obtain a frame video initial data.
Step 104: the integrated bit rate controller of the present invention.Carry out frame level bit-rate control, include the regulatory function of scene detection and GOP length regulation function, variable frame rate, the control function of variable bit rate.Former reason Fig. 2 of specific works of this step is described in detail.
Step 105: encoder is encoded.The coding parameter providing according to integrated bit rate controller comprises the key parameters such as frame type, QP value, frame per second, the original video data obtaining is carried out to the Video coding of a frame in step 103.
Step 106:NAL packing.The stream that in step 105, coding obtains is carried out to NAL packing operation, and soon NAL stream writes and presets in file format (container).Statistics NAL length is bit number, the objective visual quality distortion PSNR after statistical coding.
Step 107: whether cycle criterion coding completes.The situation of end-of-encode judgement may have information source video to finish and preset coding frame number and reaches and expect these two kinds.May appoint and have one for true time when above-mentioned two kinds, end loop, proceeds next frame coding otherwise jump to step 103.
The above-mentioned description to Fig. 1 has represented the residing position of integrated bit rate controller of realizing Rate Control in video coding process.Fig. 2 has provided the integrated bit rate controller operation principle of the present embodiment.As shown in Figure 2, include unique entrance and unique outlet, wherein crucial step has:
Step 201: Rate Control relevant parameter initialization/renewal operation.At coding, carry out the first frame time, initialization that need to be to Rate Control relevant parameter, includes target bit rate, information source resolution, information source frame per second, default GOP length, buffering area and is initialized as 0, reads default QP value.The switch that checks integrated bit rate controller is controlled, if variable bit rate is controlled, opens, and variable GOP length adjustment variable frame rate regulates according to configuration input and is set to open or close; If variable bit rate is controlled and closed, variable GOP length adjustment variable frame rate regulates and forces to be set to close.Frame per second changed factor is set
Figure BDA0000443395030000111
be initialized as 1.In whole cataloged procedure, initialization operation only once configures.When coding proceeds to non-the first frame, carry out Rate Control relevant parameter and upgrade operation: the frame type of statistics previous frame coding, actual QP value Q t-1, NAL output bit number R t-1if previous frame coded frame is I-frame, the I-frame number value of having encoded add 1 and the P-frame number value of having encoded set to 0, if previous frame coded frame is P-frame, the current GOP P-frame number value of having encoded adds 1.In whole cataloged procedure, upgrade operation each frame except the first frame is carried out.
Step 202: coder parameters is rewritten.The coding parameter of each frame stores and adjusts in this step.The process of adjusting is rewritten one by one by external step 203 splitter exactly.
Step 203: Rate Control functional branch device.This splitter separates the function of three parts one by one, first carries out calling and rewriting of step 204, then carries out calling and rewriting of step 205, finally carries out calling and rewriting of step 206.Here emphasize step 204,205,206 call and must sequentially carry out.
Step 204: variable GOP length adjustment.When scene detection and GOP length adjustment control switch are opened, carry out the adjustment of scene detection and GOP length; While closing, redirect is returned and is not done any operation.The idiographic flow of this step is provided by Fig. 3.
Step 205: variable frame rate regulates.When variable frame rate regulation control switch is opened, carry out the change of frame per second is related to the setting to the reading manner of information source data thereafter simultaneously; While closing, redirect is returned and is not done any operation.The idiographic flow of this step is provided by Fig. 4.
Step 206: variable bit rate is controlled.When variable bit rate control switch is opened, carry out this step, otherwise redirect is returned to and is not done any operation.The idiographic flow of this step is provided by Fig. 5.
Step 207: storage and record coding data.Include information source video data, the coding outputting video streams NAL of each frame, current buffering area height.These encode relevant data by for step 204,205,206, provide calculating according to feedback.
In above-mentioned Fig. 2, topmost three partial functions are launched by Fig. 3, Fig. 4 and Fig. 5.Fig. 3 has provided scene change detection and has adjusted flow chart with dynamic GOP, particularly comprises:
Step 301: read and obtain current frame to be encoded (t), information source video data.Regulation t=0,1,2 ...
Step 302: temporary cache information source video data.Z -1be a hysteresis memory, be input as the information source video data of present frame (t), be output as the information source video data of an adjacent upper moment coded frame (t-1).
Step 303: the grey level histogram H of statistics present frame and nearest neighbor frame t-1and H t.
Step 304: similarity Branch Computed device.By grey level histogram data H t-1and H tsend to simultaneously and in step 305 and step 306, carry out computing.
Step 305: for t>=1, computer card that Pearson linearly dependent coefficient r t-1, t:
r t - 1 , t = &Sigma; i = 1 n ( H t - 1 [ i ] - H &OverBar; t - 1 ) ( H t [ i ] - H &OverBar; t ) &Sigma; i = 1 n ( H t - 1 [ i ] - H &OverBar; t - 1 ) 2 &Sigma; i = 1 n ( H t [ i ] - H &OverBar; t ) 2 Wherein, H &OverBar; t = 1 n &Sigma; i = 1 n H t [ i ]
Step 306: for t>=1, calculate high dimension vector included angle cosine value cos (θ t-1, t):
cos ( &theta; t - 1 , t ) = H t - 1 &CenterDot; H t | | H t - 1 | | &CenterDot; | | H t | | = &Sigma; i = 1 n H t - 1 [ i ] &CenterDot; H t [ i ] &Sigma; i = 1 n ( H t - 1 [ i ] ) 2 &Sigma; i = 1 n ( H t [ i ] ) 2 .
Step 307: similarity is calculated component and gathered.According to calculating the r obtaining in step 305 and step 306 t-1, tand cos (θ t-1, t) carry out index of similarity Sim tcomputing Sim 0=1,
Figure BDA0000443395030000134
Step 308: judge whether index of similarity Sim t< ξ, if very think that scene switching produces and go to step 309, if scene is thought in vacation, switching does not produce, and does not deal with and finishes.The value of ξ is empirical value 0.85.
Step 309: whether the P-number of frames of adding up encoded in current GOP reaches the numerical value in a frame per second cycle, is to go to step 310 to carry out GOP length adjustment, otherwise finishes.
Step 310: finish a upper GOP, newly start a GOP, present frame type is set to I-frame.
Step 311: new GOP is set, the GOP P-frame number of having encoded is set to 0, it is preset value that GOP length is set.
Fig. 4 has provided the flow chart that variable frame rate is adjusted, and particularly comprises:
Step 401: calculate current employing encoder QP value low (20%), in (80%), high (20%) three section of interval.For QP span the encoder of [0,31] (as MPEG-1, MPEG-2, MPEG-4, H.261, H.263, WMV1, WMV2, RV10, RV20), it is segmented into low section [0,8], stage casing [9,24], high section [25,31].For QP span the encoder of [0,51] (as H.264/AVC, H.264/SVC, HEVC), it is segmented into low section [0,10], stage casing [11,40], high section [41,51].
Step 402: judge whether the frame number of having encoded reaches frame per second numerical value (i.e. the frame number of 1 second video), be to enter step 403, otherwise finish.
Step 403: add up QP average in nearest 1 second coding,
Q &LeftArrow; ( t ) = 1 F C &Sigma; i = 1 F C Q ( t - i ) ,
Wherein, actual coding frame per second F cthe initialization frame per second F that is set to sample s.
Step 404: calculate the QP average getting in determining step 403
Figure BDA0000443395030000136
whether dropping on high section QP interval, is to go to step 407, otherwise go to step 405, judges again.
Step 405: calculate the QP average getting in determining step 403 whether dropping on low section of QP interval, is to go to step 406, otherwise explanation
Figure BDA0000443395030000141
drop on stage casing QP interval, do not deal with and exit.
Step 406: the double processing of frame per second.If
Figure BDA0000443395030000142
Figure BDA0000443395030000143
and
Figure BDA0000443395030000144
otherwise F cremain unchanged.
Step 407: frame per second is processed by half.If
Figure BDA0000443395030000145
Figure BDA0000443395030000146
and
Figure BDA0000443395030000147
otherwise F cremain unchanged
The frame per second changed factor occurring in above-mentioned Fig. 4 step
Figure BDA0000443395030000148
initialization operation in Fig. 2 step 201, complete.Changed factor
Figure BDA0000443395030000149
numerical value will limit for reading of information source video in follow-up Rate Control.
Fig. 5 has provided the control flow chart of variable bit rate, particularly comprises:
Step 501: calculate current frame pixel point target bit value,
Tbpp = TBR W &CenterDot; H &CenterDot; F C ,
Wherein, target bit rate TBR is initially set when coding starts, and in cataloged procedure, can be rewritten, and adopts up-to-date nearest numerical value here; Actual coding frame per second is designated as information source frame per second F when initialization c← F s, adopt up-to-date nearest numerical value here.
Step 502: the more new data according in Fig. 2 step 201, carry out buffer size renewal,
B ( 0 ) = 0 ( t = 0 ) B ( t ) = B ( t - 1 ) + R t - 1 - Tbpp ( t &GreaterEqual; 1 ) ,
Adopt PD controller to revise buffer size, be calculated as B ^ ( t ) = f PD ( B ( t ) ) = &alpha; &CenterDot; B ( t ) + &beta; &CenterDot; [ B ( t ) - B ( t - 1 ) ] , Wherein
Figure BDA00004433950300001413
represent the result after B (t) is corrected, parameter alpha, β relies on empirical value to choose α=0.5, β=0.55; The absolute difference that calculates consecutive frame coding QP value in 1 frame per second cycle with,
Ipt ( t ) = 1 F C &Sigma; i = 1 F C | Q ( t - i ) - Q ( t - i - 1 ) | ,
Last bit increment △ R is calculated as:
&Delta;R = B ^ ( t ) &mu; + Ipt ( t ) ,
Wherein, μ is that empirical parameter value is 0.618.
Step 503: carry out frame type judgement branch.If I-frame coding goes to step 504, if P frame goes to step 506, if B-frame goes to step 508, report an error and exit.
Step 504:I-frame per second distortion model lnR=alnQ+blnC+c parameter is upgraded.The Q of the s frame data of recently continuous I-frame before collecting, C and R construct the matrix of capable 3 row of s,
ln Q t - 1 ln C t - 1 ln R t - 1 ln Q t - 2 ln C t - 2 ln R t - 2 ln Q t - 3 ln C t - 3 ln R t - 3 . . . . . . . . . ln Q t - s ln C t - s ln R t - s s &times; 3 ,
The value of window size s is between minimum 5, the reasonable maximum between maximum 30.Utilize multiple linear regression, adopt least square approximation to carry out matching, calculate and obtain model parameter a, b, c.
Step 505: calculate present frame Texture complication,
C = &Sigma; i = 1 W - 1 &Sigma; j = 1 H - 1 ( l i , j - l i + 1 , j ) 2 + ( l i , j - l i , j + 1 ) 2 ( W - 1 ) ( H - 1 ) ,
Incremental computations obtains present encoding I-frame QP value,
Q t = Q t - 1 + Q t - 1 a &CenterDot; [ &Delta;R R t - 1 - b &CenterDot; ( C t - C t - 1 ) C t - 1 ,
Finally, Q tvalue is bound, Q t← min{Q t-1+ 2, max{Q t, Q t-1-2}}, and be limited in legal span.
Step 506:P-frame per second distortion model lnR=alnQ+c parameter is upgraded.Before collecting, the Q of the s frame data of nearest continuous P-frame and R construct the matrix of capable 2 row of s:
ln Q t - 1 ln R t - 1 ln Q t - 2 ln R t - 2 ln Q t - 3 ln R t - 3 . . . . . . ln Q t - s ln R t - s s &times; 2
The value of window size s is between minimum 5, the reasonable maximum between maximum 30.Utilize one-variable linear regression, adopt least square approximation to carry out matching, calculate and obtain model parameter a, c.
Step 507: incremental computations obtains present encoding P-frame QP value,
Q t = Q t - 1 + Q t - 1 a &CenterDot; &Delta;R R t - 1 ,
Finally, Q tvalue is bound, Q t← min{Q t-1+ 2, max{Q t, Q t-1-2}}, and be limited in legal span.
In foregoing description, Fig. 3 calculates the GOP of modification and frame per second that frame type, Fig. 4 calculate modification, QP value that Fig. 5 calculates acquisition all will be used directly to next code device and carry out a frame coding.
The present invention has realized integrated and provides interface in the mode of dynamic link.For overall performance of the present invention is described, with the speedy coder x265[Compatible to HM-10.0 increasing income after encoder platform HEVC cutting, Win32SDK, http://code.google.com/p/x265/] be example, interface of the present invention be can directly call, unified variable bit rate, variable frame rate, variable GOP length Rate Control realized.
With CIF, (352 * 288,4:2:0) sequence is example, constructs three groups of video datas as shown in table 1 with 20 common YUV sequence assemblies in the present invention.
Table 1CIF sequence of packets and totalframes
Figure BDA0000443395030000161
*note: contain Table sequence in M-cif, Table sequence itself has 2 scenes.Therefore the total scene number of M-cif is also 7.
Three groups of video sequences to structure carry out encoded test, and the Output rusults of encoding under (IPP..PP) structure with the low delay of fixing QP value (being respectively 17,22,27,32,37,42), for target, carries out test of the present invention.Target bit rate and initial Q P value all configure according to the Output rusults that fixedly QP value is encoded.As shown in table 2, RC (on/off), SC (on/off), AS (on/off) represent respectively Rate Control switch, scene detection switch, frame per second control switch.The fixed bit rate (CBR) of take in table 2 is tested as controlling target.BD-Rate represents the curved line relation between bit rate and distortion, and it is a percentages, and its value reaches identical visual quality for negative indication, and the ratio that bit rate is saved is the ratio that just represents that bit rate too much consumes.As can be seen from Table 2, Rate Control of the invention process, scene detection, frame per second are controlled at the situation that all occurs bit rate saving under three kinds of different switch combinations.BD-Rate numerical value reaches respectively-32.89% on Y component, and-31.74% ,-42.71%, this explanation the invention process will be directly for Video coding brings obvious performance boost.The numerical value that last column of table 2 is listed is the formula result of calculation of BD-Rate-Old, to do control reference, does not do special discussion.
After table 2 the invention process, BD-Rate Performance Ratio
Figure BDA0000443395030000162
H-cif as shown in Figure 6, M-cif, the test result of tri-groups of cycle testss of L-cif under coding structure IPP..PP, X-axial coordinate represents the time scale that CIF (30Hz) video image is play, Y-axle has represented respectively buffering area height and interframe similarity numerical value.With Y-axle, represent in three width subgraphs of buffering area, can see that buffering area curve presents closely around also frequent moving near theoretical level 0 line.In scene, switch and to cause GOP initialization, its first frame (I-frame) coding causes that buffering area obviously leaps high, and then Rate Control can effectively make buffering area again be tending towards 0 line fast, shows that Rate Control ability of the present invention is strong.Take in the three width subgraphs that similarity is Y-axial coordinate, can obviously see the validity of the index of similarity proposing due to the present invention, when scene is unified, index of similarity is the unusual theoretical optimal value 1 of convergence all, when scene is switched generation, there is obvious tenesmus in various degree in index of similarity.In enforcement test of the present invention, for above-mentioned three kinds of sequences,, there is not false retrieval and undetected in the scene change detection method of utilizing the present invention to propose, accuracy rate 100%.
Complete as shown in Figure 7 I-frame continuous programming code CIF (30Hz) sequence D ealdline is totally 1372 frames.In Fig. 7, X-coordinate represents coded frame flowing water.Offered target bit rate increment is 1mbps, closes target pixel points bit 0.328809.Take 196 frames as bit rate variation section, be divided into 7 sections: 0 frame-195 frame TBR=2mbps, Tbpp=0.657618; 196 frame-391 frame TBR=3mbps, Tbpp=0.986427; 392 frame-587 frame TBR=4mbps, Tbpp=1.315236; 588 frame-783 frame TBR=5mbps, Tbpp=1.644045; 784 frame-979 frame TBR=4mbps, Tbpp=1.315236; 980 frame-1175 frame TBR=3mbps, Tbpp=0.986427; 1176 frame-1371 frame TBR=2mbps, Tbpp=0.657618.From first subgraph of Fig. 7, can see, the actual output of frame mean pixel point and target are extraordinary presses close to, and along with growth and the reduction of target pixel points bit, the frame mean pixel point bit of actual output has carried out following up and around fluctuation rapidly.The second width subgraph shows, in very narrow interval, buffering area [1,1], the present invention can effectively control the Video coding under variable bit rate.The third and fourth width subgraph has provided respectively PSNR curve and frame actual coding QP value.Can see, along with the variation of target bit rate, PSNR curve and QP value distribute and present the corresponding feature of segmentation, have good fluctuation or distribution rule in each segmentation.

Claims (9)

1. low delayed video coding variable bit rate bit rate control method, is characterized in that, comprising:
At current coding moment t, while being I-frame as current volume frame, the quantization parameter Q of use is:
Q t = Q t - 1 + Q t - 1 a &CenterDot; [ &Delta;R R t - 1 - b &CenterDot; ( C t - C t - 1 ) C t - 1 ] ;
At current coding moment t, while being P-frame as current volume frame, the quantization parameter Q of use is:
Q t = Q t - 1 + Q t - 1 a &CenterDot; &Delta;R R t - 1 ;
Wherein, Q tfor the current coding quantization parameter Q that t is used constantly, Q t-1for a upper coding quantization parameter Q that t-1 is used constantly, R t-1represent the coding frame coding output bit of t-1 constantly, C tfor the coded image Texture complication of current coding moment t, C t-1coded image Texture complication for a upper coding moment t-1; △ R is that coding moment t needs to revise
Figure FDA0000443395020000013
Figure FDA0000443395020000014
b (t) is the current coding true buffer pool size of t constantly, and B (t-1) be the true buffer pool size of a upper coding moment t-1, is α, and β is called controller parameter, and μ prevents and kill off 0 empirical parameter;
When current volume frame is I-frame, distortion rate model is lnR=alnQ+blnC+c, Q represents quantization parameter, and R represents frame coding output bit, C presentation code image texture complexity, a, b, c are distortion rate model parameter, and the value of distortion rate model parameter a, b is upgraded by multiple linear regression; When current volume frame is P-frame, distortion rate model is lnR=alnQ+c, and the value of distortion rate model parameter a is upgraded by one-variable linear regression.
2. low delayed video coding variable bit rate bit rate control method as claimed in claim 1, is characterized in that, also comprises, by current quantization parameter Q, regulates present encoding frame per second F c, when the value of quantization parameter Q is in low section of interval, in not higher than frame per second upper range, increase present encoding frame per second F c; Interval in high section when the value of quantization parameter Q, in being not less than frame per second lower range, reduce present encoding frame per second F c; Interval in stage casing when the value of quantization parameter Q, keep present encoding frame per second F cconstant;
As the upper coding frame per second F of coding in the moment cafter variation, need to be according to new coding frame per second F credefine pixel target bits Tbpp,
Figure FDA0000443395020000015
thereby present encoding buffer pool size B (t) constantly, B (t)=B (t-1)+R t-1-Tbpp, R t-1represent coding t-1 time frame coding output bit constantly, TBR is target bit rate, and W is that image pixel is wide, is the high H of image pixel.
3. low delayed video coding variable bit rate bit rate control method as claimed in claim 2, is characterized in that, by frame per second changed factor
Figure FDA0000443395020000016
regulate present encoding frame per second F c,
Figure FDA0000443395020000017
wherein ← expression is to the parameter assignment of the direction of arrow, F sfor the sampling frame per second obtaining from video source;
Increase present encoding frame per second F cfor
Figure FDA0000443395020000018
reduce present encoding frame per second F cfor
Figure FDA0000443395020000019
4. low delayed video coding variable bit rate bit rate control method as claimed in claim 2, is characterized in that, current quantization parameter Q is expressed as the mean value of the quantization parameter constantly using in nearest 1 second coding till t in present encoding
Q &LeftArrow; t = 1 F C &Sigma; i = 1 F C Q t - i .
5. low delayed video coding variable bit rate bit rate control method as claimed in claim 2, is characterized in that, is limited to 10Hz, frame per second upper limit 100Hz under frame per second.
6. low delayed video coding variable bit rate bit rate control method as claimed in claim 2, it is characterized in that, described low section of interval is in legal quantization parameter Q value span low section 20%, high section interval is high section 20% in legal quantization parameter Q value span, and in quantization parameter Q value span, remaining 60% is that stage casing is interval.
7. low delayed video coding variable bit rate bit rate control method as claimed in claim 1, is characterized in that, also comprise that present image group GOP regulates, described GOP regulates and comprises the following steps:
1) calculate the grey level histogram of present frame;
2) by the grey level histogram of present frame and the grey level histogram of previous frame, calculate the index of similarity of two consecutive frames; Described index of similarity represents by cosine similarity:
cos ( &theta; t - 1 , t ) = &Sigma; i = 1 n H t - 1 [ i ] &CenterDot; H t [ i ] &Sigma; i = 1 n ( H t - 1 [ i ] ) 2 &Sigma; i = 1 n ( H t [ i ] ) 2 ;
Wherein, cos (θ t-1, t) be the histogrammic cosine similarity of two consecutive frames, t represents present encoding constantly, H t[i] is illustrated in the coding pixel sum that the video frame image grey scale pixel value of t is i constantly, H t-1[i] is illustrated in the coding pixel sum that constantly the video frame image grey scale pixel value of t-1 is i, and the scope of video frame image grey scale pixel value is 1 to n, and n is the total element number of grey level histogram while representing by one-dimension array;
3) index of similarity when two consecutive frames is less than threshold value, represents that occurrence scene switches, and enters step 4); Otherwise present frame type is set and is set to P-frame, after extraction next frame data, return to step 1);
4) in statistics present image group GOP, whether the P-frame with coding reaches frame per second cycle numerical value, in this way, enters step 5), otherwise present frame type is set, is set to P-frame, after extraction next frame data, returns to step 1);
5) present frame type is set and is set to I-frame, start a new GOP, after extraction next frame data, return to step 1).
8. low delayed video coding variable bit rate bit rate control method as claimed in claim 7, is characterized in that, introduces linearly dependent coefficient, comes together to characterize index of similarity with cosine similarity;
r t - 1 , t = &Sigma; i = 1 n ( H t - 1 [ i ] - H &OverBar; t - 1 ) ( H t [ i ] - H &OverBar; t ) &Sigma; i = 1 n ( H t - 1 [ i ] - H &OverBar; t - 1 ) 2 &Sigma; i = 1 n ( H t [ i ] - H &OverBar; t ) 2
H &OverBar; t = 1 n &Sigma; i = 1 n H t [ i ]
Wherein, r t-1, tbe the histogrammic linearly dependent coefficients of crossing of two consecutive frames,
Figure FDA0000443395020000033
for the video frame image grey scale pixel value average at coding moment t,
Figure FDA0000443395020000034
for, in the video frame image grey scale pixel value average of coding moment t-1.
9. low delayed video coding variable bit rate bit rate control method as claimed in claim 8, is characterized in that, index of similarity is the product of cosine similarity and linearly dependent coefficient, or be linearly dependent coefficient square with the product of cosine similarity.
CN201310711663.XA 2013-12-20 2013-12-20 Low latency Video coding variable bit rate bit rate control method Active CN103686172B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310711663.XA CN103686172B (en) 2013-12-20 2013-12-20 Low latency Video coding variable bit rate bit rate control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310711663.XA CN103686172B (en) 2013-12-20 2013-12-20 Low latency Video coding variable bit rate bit rate control method

Publications (2)

Publication Number Publication Date
CN103686172A true CN103686172A (en) 2014-03-26
CN103686172B CN103686172B (en) 2016-08-17

Family

ID=50322261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310711663.XA Active CN103686172B (en) 2013-12-20 2013-12-20 Low latency Video coding variable bit rate bit rate control method

Country Status (1)

Country Link
CN (1) CN103686172B (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106303650A (en) * 2016-08-31 2017-01-04 成都炫境科技有限公司 Audio video synchronization display packing
CN106658006A (en) * 2017-01-12 2017-05-10 武汉轻工大学 Code rate control method for near lossless compression of JPEG-LS (Joint Photographic Experts Group-Lossless) image with near optimal rate distortion performance
CN107040781A (en) * 2016-01-19 2017-08-11 谷歌公司 The Real-Time Video Encoder speed control switched using dynamic resolution
CN107426570A (en) * 2016-10-28 2017-12-01 福州大学 A kind of adaptive Qp Cascading Methods of low latency Video coding
CN108093257A (en) * 2017-12-05 2018-05-29 北京小米移动软件有限公司 Bit rate control method, electronic equipment and the storage medium of Video coding
CN105578185B (en) * 2015-12-14 2018-08-21 华中科技大学 A kind of non-reference picture quality On-line Estimation method of network video stream
CN105516719B (en) * 2014-09-26 2018-09-28 浙江大华技术股份有限公司 A kind of method for video coding and device
CN108737826A (en) * 2017-04-18 2018-11-02 中兴通讯股份有限公司 A kind of method and apparatus of Video coding
CN109413427A (en) * 2017-08-17 2019-03-01 腾讯科技(深圳)有限公司 A kind of video frame coding method and terminal
CN110113610A (en) * 2019-04-23 2019-08-09 西安万像电子科技有限公司 Data transmission method and device
CN110248195A (en) * 2019-07-17 2019-09-17 北京百度网讯科技有限公司 Method and apparatus for output information
CN111787323A (en) * 2020-05-23 2020-10-16 清华大学 Variable bit rate generation type compression method based on counterstudy
CN112351277A (en) * 2020-11-04 2021-02-09 北京金山云网络技术有限公司 Video encoding method and device and video decoding method and device
CN113473136A (en) * 2020-03-30 2021-10-01 炬芯科技股份有限公司 Video encoder and code rate control device thereof
CN114095729A (en) * 2022-01-19 2022-02-25 杭州微帧信息科技有限公司 Low-delay video coding rate control method
CN116708933A (en) * 2023-05-16 2023-09-05 深圳东方凤鸣科技有限公司 Video coding method and device
CN116744006A (en) * 2023-08-14 2023-09-12 光谷技术有限公司 Video monitoring data storage method based on block chain
CN117596425A (en) * 2023-10-24 2024-02-23 书行科技(北京)有限公司 Method and device for determining coding frame rate, electronic equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103702119B (en) * 2013-12-20 2017-05-10 电子科技大学 Code rate control method based on variable frame rate in low delay video coding

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090067495A1 (en) * 2007-09-11 2009-03-12 The Hong Kong University Of Science And Technology Rate distortion optimization for inter mode generation for error resilient video coding
CN102355584A (en) * 2011-10-31 2012-02-15 电子科技大学 Code rate control method based on intra-frame predictive coding modes
CN102625102A (en) * 2011-12-22 2012-08-01 北京航空航天大学 H.264/scalable video coding medius-grain scalability (SVC MGS) coding-oriented rate distortion mode selection method
CN102938840A (en) * 2012-11-26 2013-02-20 南京邮电大学 Key frame quantization parameter selecting method applied to multi-viewpoint video coding system
US20130308698A1 (en) * 2012-05-18 2013-11-21 Industrial Technology Research Institute Rate and distortion estimation methods and apparatus for coarse grain scalability in scalable video coding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090067495A1 (en) * 2007-09-11 2009-03-12 The Hong Kong University Of Science And Technology Rate distortion optimization for inter mode generation for error resilient video coding
CN102355584A (en) * 2011-10-31 2012-02-15 电子科技大学 Code rate control method based on intra-frame predictive coding modes
CN102625102A (en) * 2011-12-22 2012-08-01 北京航空航天大学 H.264/scalable video coding medius-grain scalability (SVC MGS) coding-oriented rate distortion mode selection method
US20130308698A1 (en) * 2012-05-18 2013-11-21 Industrial Technology Research Institute Rate and distortion estimation methods and apparatus for coarse grain scalability in scalable video coding
CN102938840A (en) * 2012-11-26 2013-02-20 南京邮电大学 Key frame quantization parameter selecting method applied to multi-viewpoint video coding system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
田玲,周益民,孙世新: "基于指数率失真模型的增量式码率控制算法", 《电子测量与仪器学报》, vol. 24, no. 9, 30 September 2010 (2010-09-30) *
田玲: "视频编码率失真特性及帧编码复杂度模型研究", 《中国博士学位论文全文数据库信息科技辑》, no. 7, 15 July 2011 (2011-07-15) *

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516719B (en) * 2014-09-26 2018-09-28 浙江大华技术股份有限公司 A kind of method for video coding and device
CN105578185B (en) * 2015-12-14 2018-08-21 华中科技大学 A kind of non-reference picture quality On-line Estimation method of network video stream
CN107040781A (en) * 2016-01-19 2017-08-11 谷歌公司 The Real-Time Video Encoder speed control switched using dynamic resolution
CN107040781B (en) * 2016-01-19 2020-11-03 谷歌有限责任公司 System, method and apparatus for controlling real-time video encoder rate
CN106303650A (en) * 2016-08-31 2017-01-04 成都炫境科技有限公司 Audio video synchronization display packing
CN107426570A (en) * 2016-10-28 2017-12-01 福州大学 A kind of adaptive Qp Cascading Methods of low latency Video coding
CN107426570B (en) * 2016-10-28 2020-11-03 福州大学 Self-adaptive Qp cascade method for low-delay video coding
CN106658006B (en) * 2017-01-12 2019-08-13 武汉轻工大学 A kind of bit rate control method of the JPEG-LS image near lossless compression of distortion performance near-optimization
CN106658006A (en) * 2017-01-12 2017-05-10 武汉轻工大学 Code rate control method for near lossless compression of JPEG-LS (Joint Photographic Experts Group-Lossless) image with near optimal rate distortion performance
CN108737826A (en) * 2017-04-18 2018-11-02 中兴通讯股份有限公司 A kind of method and apparatus of Video coding
CN108737826B (en) * 2017-04-18 2023-06-30 中兴通讯股份有限公司 Video coding method and device
CN109413427A (en) * 2017-08-17 2019-03-01 腾讯科技(深圳)有限公司 A kind of video frame coding method and terminal
CN108093257A (en) * 2017-12-05 2018-05-29 北京小米移动软件有限公司 Bit rate control method, electronic equipment and the storage medium of Video coding
CN110113610A (en) * 2019-04-23 2019-08-09 西安万像电子科技有限公司 Data transmission method and device
CN110248195A (en) * 2019-07-17 2019-09-17 北京百度网讯科技有限公司 Method and apparatus for output information
CN113473136A (en) * 2020-03-30 2021-10-01 炬芯科技股份有限公司 Video encoder and code rate control device thereof
CN113473136B (en) * 2020-03-30 2024-02-09 炬芯科技股份有限公司 Video encoder and code rate control device thereof
US11153566B1 (en) 2020-05-23 2021-10-19 Tsinghua University Variable bit rate generative compression method based on adversarial learning
CN111787323B (en) * 2020-05-23 2021-09-03 清华大学 Variable bit rate generation type compression method based on counterstudy
CN111787323A (en) * 2020-05-23 2020-10-16 清华大学 Variable bit rate generation type compression method based on counterstudy
CN112351277A (en) * 2020-11-04 2021-02-09 北京金山云网络技术有限公司 Video encoding method and device and video decoding method and device
CN112351277B (en) * 2020-11-04 2024-04-05 北京金山云网络技术有限公司 Video encoding method and device and video decoding method and device
CN114095729A (en) * 2022-01-19 2022-02-25 杭州微帧信息科技有限公司 Low-delay video coding rate control method
CN114095729B (en) * 2022-01-19 2022-05-10 杭州微帧信息科技有限公司 Low-delay video coding rate control method
CN116708933A (en) * 2023-05-16 2023-09-05 深圳东方凤鸣科技有限公司 Video coding method and device
CN116708933B (en) * 2023-05-16 2024-04-16 深圳东方凤鸣科技有限公司 Video coding method and device
CN116744006A (en) * 2023-08-14 2023-09-12 光谷技术有限公司 Video monitoring data storage method based on block chain
CN116744006B (en) * 2023-08-14 2023-10-27 光谷技术有限公司 Video monitoring data storage method based on block chain
CN117596425A (en) * 2023-10-24 2024-02-23 书行科技(北京)有限公司 Method and device for determining coding frame rate, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN103686172B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN103686172A (en) Code rate control method based on variable bit rate in low latency video coding
CN103826121A (en) Scene switching detection based code rate control method in low-delay video coding
CN103702119A (en) Code rate control method based on variable frame rate in low delay video coding
KR100953152B1 (en) Method and Apparatus for selecting macroblock quantization parameters in a video encoder
CN104885455B (en) A kind of computer implemented method and device for Video coding
US8687702B2 (en) Remote transmission and display of video data using standard H.264-based video codecs
CN102461169B (en) Motion based dynamic resolution multiple bit rate video encoding
CN1726709B (en) Method and device for encoding image of uncompressed digital video frequency sequence
CN100512432C (en) Video data transmission system
CN108574843B (en) Determine the method and encoder system of the GOP length for Video coding
EP1869895B1 (en) Scene-by-scene digital video processing
CN103636188B (en) Encoder-supervised imaging for video cameras
CN101466035A (en) Method for distributing video image set bit based on H.264
CN113438501B (en) Video compression method, apparatus, computer device and storage medium
CN1898965B (en) Moving image encoding method and apparatus
CN101335891B (en) Video rate control method and video rate controller
CN105519117A (en) Video encoding device, video transcoding device, video encoding method, video transcoding method and video stream transmission system
KR20030009669A (en) multi channel image encoding apparatus and encording method thereof
CN108289223B (en) Image compression method and device for liquid crystal screen overdrive device
KR100390115B1 (en) Image processing method, image processing apparatus and data storage media
CN102027745A (en) Video recording apparatus
CN101926168A (en) Multi-screen display
CN1224979A (en) Method and apparatus for coding and for decoding picture sequence
JP3956010B2 (en) Video transmission system and video transmission control method
JP4192149B2 (en) Data processing apparatus and data processing method

Legal Events

Date Code Title Description
PB01 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