CN102780884B - Rate distortion optimization method - Google Patents

Rate distortion optimization method Download PDF

Info

Publication number
CN102780884B
CN102780884B CN201210255897.3A CN201210255897A CN102780884B CN 102780884 B CN102780884 B CN 102780884B CN 201210255897 A CN201210255897 A CN 201210255897A CN 102780884 B CN102780884 B CN 102780884B
Authority
CN
China
Prior art keywords
frame
coding unit
distortion
basic coding
sigma
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
CN201210255897.3A
Other languages
Chinese (zh)
Other versions
CN102780884A (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.)
Guangdong Guangsheng Research And Development Institute Co ltd
Original Assignee
SHENZHEN GUANGSHENG XINYUAN TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN GUANGSHENG XINYUAN TECHNOLOGY Co Ltd filed Critical SHENZHEN GUANGSHENG XINYUAN TECHNOLOGY Co Ltd
Priority to CN201210255897.3A priority Critical patent/CN102780884B/en
Publication of CN102780884A publication Critical patent/CN102780884A/en
Application granted granted Critical
Publication of CN102780884B publication Critical patent/CN102780884B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to a rate distortion optimization method. The rate distortion optimization method comprises the steps as follows: obtaining a block layer Lagrange parameter of each basic coding unit in a current frame and a frame layer Lagrange parameter of the current frame; according to the block layer Lagrange parameter and the frame layer Lagrange parameter, obtaining a final Lagrange parameter of the each basic coding unit in the current frame; according to the final Lagrange parameter, performing rate distortion optimization coding on the each basic coding unit in the current frame to obtain a code rate value and a distortion value of the each basic coding unit in the current frame so as to obtain the code rate value and the distortion value of the current frame; and according to the code rate values and the distortion values of the at least two basic coding units in the current frame, creating a frame layer rate distortion model, and according to the frame layer rate distortion model and the code rate value and the distortion value of the current frame, estimating the frame layer Lagrange parameter of next frame. According to the rate distortion optimization method, optimal rate distortion optimization can be carried out on video content through rate distortion optimization of a comprehensive frame layer and a basic coding unit layer.

Description

A kind of Rate-distortion optimization method
Technical field
The present invention relates to image/video codec domain, more particularly, relate to a kind of Rate-distortion optimization method.
Background technology
With international standard H264 for reference, when basic coding unit is encoded, different coding modes can be selected.The selection of coding mode comprises infra-frame prediction mode or inter prediction way choice, also partitioning scheme (the routine INTRA-4x4 to basic coding unit can be comprised, INTRA-8x8, INTRA-16x16, SKIP, DIRECT, INTER-16x16, INTER-16x8, INTER-8x16, INTER-8x8, INTER-8x8 can be further divided into INTER-8x8, INTER-8x4, INTER-4x8, INTER-4x4) selection, can also comprise prediction block position (routine Intra_4x4_Vertical, Intra_4x4_Horizontal, Intra_4x4_Diagonal_Down_Left, Intra_4x4_Diagonal_Down_Right, Intra_4x4_Vertical_Right, Intra_4x4_Horizontal_Down, Intra_4x4_Vertical_Left, Intra_4x4_Horizontal_Up, Intra_4x4_DC) selection.The determination of coding mode is that percent of pass aberration optimizing realizes, and wherein rate-distortion optimization is the process of minimizing to following cost function J,
J(s,c,mode|QP)=D(s,c,mode|QP)+λ modeR(s,c,mode|QP),
Wherein D is distortion value, R is code check value, s and c represents former figure and the corresponding basic coding unit building image again by encoding and decoding process respectively, mode represents the coding mode selected of basic coding unit, QP is quantization parameter, and λ mode is used to the LaGrange parameter of compromise distortion value and code check value.
Rate-distortion optimization is under the condition that quantization parameter QP is fixed, determines the mode that above-mentioned cost function J can be made minimum.In H264 standard, λ mode determines namely have by quantization parameter QP
λ mode=0.85×2 (QP-12)/3
Above-mentioned rate-distortion optimization mode is a statistical approximation result, lacks the adaptive ability to video content, does not consider the continuity of interframe content, to the rate distortion relation between successive frame without any restriction.Therefore likely cause the rate distortion between successive frame uneven, cause the distortion between successive frame or code check to rise and fall excessive.
Therefore, be necessary to provide a kind of Rate-distortion optimization method, to solve the problem existing for prior art.
Summary of the invention
The technical problem to be solved in the present invention is, the defect of adaptive optimization can not be carried out to video content for Rate-distortion optimization method of the prior art, the rate-distortion optimization of a kind of rate-distortion optimization by comprehensive frame-layer and basic coding elementary layer is provided, realizes the Rate-distortion optimization method of the optimal ratio aberration optimizing to video content.
The technical solution adopted for the present invention to solve the technical problems is: the present invention relates to a kind of Rate-distortion optimization method, it comprises step:
The block layer LaGrange parameter of each basic coding unit and the frame-layer LaGrange parameter of present frame in A, acquisition present frame;
B, according to the block layer LaGrange parameter of described basic coding unit and the frame-layer LaGrange parameter of described present frame, obtain the final LaGrange parameter of each basic coding unit in described present frame;
C, according to described final LaGrange parameter, rate-distortion optimal coding is carried out to basic coding unit each in described present frame, obtain code check value that in described present frame, each basic coding unit is corresponding and distortion value, and then obtain code check value corresponding to present frame and distortion value;
D, according to code check value corresponding at least two basic coding unit in described present frame and distortion value, set up frame-layer rate-distortion model, according to described frame-layer rate-distortion model and code check value corresponding to described present frame and distortion value, the frame-layer LaGrange parameter of estimation next frame;
Wherein, described step B is specially: obtain described final LaGrange parameter by following formula,
λ mode=w 1λ B+w 2λ F
Wherein λ modefor the final LaGrange parameter of described basic coding unit, λ ffor the frame-layer LaGrange parameter of the present frame at described basic coding unit place, λ bfor the block layer LaGrange parameter of described basic coding unit, w 1, w 2for corresponding weight coefficient, described weight coefficient w 1, w 2obtained by following formula:
x n=λ B',n
y n=λ mode',n
p = N Σ n = 1 N ( x n y n ) - Σ n = 1 N x n Σ n = 1 N y n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
q = Σ n = 1 N x n 2 Σ n = 1 N y n - Σ n = 1 N ( x n y n ) Σ n = 1 N x n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
w 1=p,
w 2 = q λ F ′ ,
Wherein, N is the basic coding unit number selected from previous frame, λ b', nbe the block layer LaGrange parameter of n-th (n=1 ~ N) basic coding unit, λ mode', nbe the final LaGrange parameter of the n-th basic coding unit, λ f'for the frame-layer LaGrange parameter of previous frame;
Wherein, described step D comprises: according to code check value and the distortion value of at least two described basic coding unit of described present frame, adopts following formula to set up described frame-layer rate-distortion model,
R=aln(b/D),
Wherein R is code check value, and D is corresponding distortion value, and a, b are model parameter.
In Rate-distortion optimization method of the present invention, the block layer LaGrange parameter of each basic coding unit described in described steps A is:
λ B=0.85×2 (QP-12)/3
Wherein λ bfor the block layer LaGrange parameter of described each basic coding unit, QP is the quantization parameter of described basic coding unit.
In Rate-distortion optimization method of the present invention, described step C comprises: the minimum code cost being obtained the rate-distortion optimization of the described basic coding unit of described present frame by following formula,
J(s,c,mode|QP)=min[D(s,c,mode|QP)+λ modeR(s,c,mode|QP)],
Wherein J is minimum code cost, D is distortion value, R is code check value, s represents the basic coding unit of former figure, c represents the corresponding basic coding unit building image again by encoding and decoding process, mode represents the coding mode selected of described basic coding unit, and QP is the quantization parameter of described basic coding unit, λ modefor corresponding final LaGrange parameter;
According to described minimum code cost, obtain corresponding forced coding pattern, rate-distortion optimal coding is carried out to the described basic coding unit of described present frame.
In Rate-distortion optimization method of the present invention, when the code check value of the described basic coding unit of use two and distortion value in described step D, when setting up described frame-layer rate-distortion model, model parameter is obtained by following formula,
a = R 1 - R 2 ln D 2 - ln D 1 ,
b = e R 1 ln D 2 - R 2 ln D 1 R 1 - R 2 ,
Wherein R 1and R 2for the code check value of described two basic coding unit, D 1and D 2for corresponding distortion value.
In Rate-distortion optimization method of the present invention, when the code check value and the distortion value that use N number of described basic coding unit in described step D, when setting up described frame-layer rate-distortion model, described model parameter is obtained by following formula,
a=-p,
b=e -q/p,
p = N Σ n = 1 N ( x n y n ) - Σ n = 1 N x n Σ n = 1 N y n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
q = Σ n = 1 N x n 2 Σ n = 1 N y n - Σ n = 1 N ( x n y n ) Σ n = 1 N x n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
x n=ln D n,y n=R n
N>2,
Wherein R nfor the code check value of basic coding unit described in described n-th, D nfor corresponding distortion value.
In Rate-distortion optimization method of the present invention, described step D also comprises: by the frame-layer LaGrange parameter of following formula estimation next frame,
λ F=-(D(A 1)-D(A 2))/(R(A 1)-R(A 2)),
Wherein R (A 1) be the code check value of the first intersection point, R (A 2) be the code check value of the second intersection point, D (A 1) be the distortion value of the first intersection point, D (A 2) be the distortion value of the second intersection point, described first intersection point is R=R in R ~ D plane awith described rate-distortion model determine the intersection point of curve, described second intersection point is D=D awith described rate-distortion model determine the intersection point of curve, R afor frame-layer code check value, D afor frame-layer distortion value.
In Rate-distortion optimization method of the present invention, described frame-layer code check value R afor the code check value sum of basic coding unit all in described frame, described frame-layer distortion value D aby asking mean square error to obtain to the former figure of described frame and the image of building again of described frame.
Implement Rate-distortion optimization method of the present invention, there is following beneficial effect: by the rate-distortion optimization of comprehensive frame-layer and the rate-distortion optimization of basic coding elementary layer, realize the optimal ratio aberration optimizing to video content.The Rate-distortion optimization method avoiding prior art can not carry out the technical problem of adaptive optimization to video content.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Fig. 1 is the flow chart of the first preferred embodiment of Rate-distortion optimization method of the present invention;
Fig. 2 is the idiographic flow block diagram of the first preferred embodiment of Rate-distortion optimization method of the present invention;
Fig. 3 is the schematic diagram of the frame-layer LaGrange parameter obtaining next frame in Rate-distortion optimization method of the present invention.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Please refer to Fig. 1, Fig. 1 is the flow chart of the first preferred embodiment of Rate-distortion optimization method of the present invention.This Rate-distortion optimization method starts from:
Step 101, obtains the block layer LaGrange parameter of each basic coding unit and the frame-layer LaGrange parameter of present frame in present frame;
Step 102, according to the block layer LaGrange parameter of described basic coding unit and the frame-layer LaGrange parameter of described present frame, obtains the final LaGrange parameter of each basic coding unit in described present frame;
Step 103, according to described final LaGrange parameter, rate-distortion optimal coding is carried out to described basic coding unit each in described present frame, obtains code check value corresponding to each basic coding unit and distortion value, and then obtain code check value corresponding to present frame and distortion value;
Step 104, the code check value corresponding according at least two basic coding unit in present frame and distortion value, set up frame-layer rate-distortion model, the code check value corresponding according to described present frame and distortion value, and the frame-layer rate-distortion model of present frame, the frame-layer LaGrange parameter of estimation next frame, and weight coefficient used when calculating the final LaGrange parameter of next frame.
Please refer to Fig. 1 and Fig. 2, Fig. 2 is the idiographic flow block diagram of the first preferred embodiment of Rate-distortion optimization method of the present invention.Below by the specific implementation process of Fig. 2 detailed description Rate-distortion optimization method of the present invention.
First, before step 101, input an absolute coding part of video to be encoded, such as GOP (picture group, Group of Pictures) in a frame to code device, wherein in GOP, each frame can have different coded systems, and according to existing video encoding standard, coded system can be divided into I frame mode, P frame mode and B frame mode.Rate-distortion optimization method of the present invention can be applicable to I frame, P frame and B frame respectively, in order to the simplicity illustrated no longer distinguishes I frame, P frame and B frame here, but uses unified mode to be described.
After image frame is input to code device, by basic coding unit acquiring unit, this image frame is divided into basic coding unit, frame can be divided into the macro block of 16x16 pixel size simply, using each macro block as a basic coding unit.Here the dividing method adopting other is not got rid of, as adopted band as basic coding unit.Then all coding modes of selecting of basic coding unit are selected one by one, coding mode can be selected for each, complete corresponding Code And Decode process, obtain basic coding unit corresponding build image again, the processing method of Code And Decode can be carried out according to various video encoding standard.Such as, coded treatment can perform following steps successively: determine prediction block, residual computations, dct transform (discrete cosine transform, Discrete Cosine Transform), quantification, entropy code.Decoding process is then the reverse operating to above steps.The concrete grammar of Rate-distortion optimization method of the present invention to this Code And Decode process does not limit.
Come step 101 subsequently, in a step 101, obtain the block layer LaGrange parameter λ of each basic coding unit in present frame band the frame-layer LaGrange parameter λ of present frame f.Wherein the block layer LaGrange parameter of basic coding unit is:
λ B=0.85×2 (QP-12)/3
Wherein λ bfor the block layer LaGrange parameter of described basic coding unit, QP is the quantization parameter of described basic coding unit.It is pointed out that each basic coding unit can have different λ bwith QP value, but in order to interest of clarity, use λ with not making any distinction between here bblock layer LaGrange parameter and the quantization parameter of a basic coding unit is represented with QP.The frame-layer LaGrange parameter λ of present frame fdetermine by the coding result of previous frame, concrete grammar hereafter elaborates.If present frame is the initial frame of a coded system (i.e. I frame, P frame or B frame mode), then desirable λ fbe a designation number, such as 0.
Come step 102 subsequently, in a step 102, according to the block layer LaGrange parameter λ of each basic coding unit bwith the frame-layer LaGrange parameter λ of each basic coding unit place present frame f, obtain the final LaGrange parameter λ of each described basic coding unit mode.The final LaGrange parameter of each basic coding unit is obtained specifically by following formula,
λ mode=w 1λ B+w 2λ F
Wherein λ modebe the final LaGrange parameter of a basic coding unit, λ ffor the frame-layer LaGrange parameter of the present frame at described basic coding unit place, λ bfor the block layer LaGrange parameter of described basic coding unit, w 1, w 2for corresponding weight coefficient, this weight coefficient w 1, w 2by obtaining the coding result calculating of previous frame, concrete grammar elaborates below.If present frame is initial frame, then can be taken as designation number, such as w 1be 1, w 2be 0.As previously mentioned, the λ of each basic coding unit mode, λ bdesirable different value, is just interest of clarity here, have employed unified mark.And the λ of all basic coding unit in same frame f, w 1, w 2value identical.
This weight coefficient w 1, w 2obtained by following formula:
x n=λ B',n
y n=λ mode',n
p = N Σ n = 1 N ( x n y n ) - Σ n = 1 N x n Σ n = 1 N y n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
q = Σ n = 1 N x n 2 Σ n = 1 N y n - Σ n = 1 N ( x n y n ) Σ n = 1 N x n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
w 1=p,
w 2 = q λ F ′ ,
Wherein, N is the basic coding unit number selected from previous frame, λ b', nbe the block layer LaGrange parameter of n-th (n=1 ~ N) basic coding unit, λ mode', nbe the final LaGrange parameter of the n-th basic coding unit, λ f'for the frame-layer LaGrange parameter of previous frame.
Come step 103 subsequently, in step 103, according to each basic coding unit final LaGrange parameter separately, rate-distortion optimal coding is carried out to basic coding unit each in present frame, obtain corresponding code check value and distortion value, and obtain code check value corresponding to present frame and distortion value further, set up the frame-layer rate-distortion model of present frame simultaneously.Specifically comprise:
The minimum code cost of the rate-distortion optimization of a basic coding unit in described present frame is obtained by following formula,
J(s,c,mode|QP)=min[D(s,c,mode|QP)+λ modeR(s,c,mode|QP)],
Wherein J is minimum code cost, D is distortion value, R is code check value, s represents the basic coding unit of former figure, c represents the corresponding basic coding unit building image again by encoding and decoding process, mode represents the coding mode selected of described basic coding unit, and QP is the quantization parameter of described basic coding unit, λ modefor corresponding final LaGrange parameter;
Found the minimum code cost of rate-distortion optimization by above formula, the forced coding pattern of each basic coding unit can be found like this from optional coding mode, then adopt this forced coding pattern to encode to this basic coding unit.When all basic coding unit in a frame all complete above-mentioned coding, then the coding of this frame completes.
Meanwhile, adopt above-mentioned forced coding pattern to basic coding cell encoding, code check value corresponding to this basic coding unit and distortion value can be obtained.
The distortion value of above-mentioned basic coding unit obtains by the MSE (mean square error, Mean Squared Error) between the corresponding basic coding unit that calculates former figure and build image again.
Subsequently, according to the above-mentioned coding to basic coding unit each in present frame, code check value corresponding to present frame and distortion value can be obtained.Wherein, code check value is the code check value sum of all basic coding unit in present frame, and distortion value is by the former figure of whole frame with build image again and ask MSE to obtain.
Come step 104 subsequently, at step 104, according to code check value R and the distortion value D of at least two basic coding unit in present frame, adopt following formula to set up the frame-layer rate-distortion model describing frame-layer rate distortion relation,
R=aln(b/D),
Wherein R represents code check value, and D represents distortion value.A, b are model parameter.
Be specially, when the code check value of use two basic coding unit and distortion value set up frame-layer rate-distortion model, available following formula obtains the model parameter of frame-layer rate-distortion model
a = R 1 - R 2 ln D 2 - ln D 1 ,
b = e R 1 ln D 2 - R 2 ln D 1 R 1 - R 2 ,
Wherein R 1and R 2for the code check value that described two basic coding unit are corresponding, D 1and D 2for the distortion value that described two basic coding unit are corresponding.
When the code check value and distortion value that use N number of basic coding unit set up frame-layer rate-distortion model, available following formula obtains the model parameter of frame-layer rate-distortion model
a=-p,
b=e -q/p,
p = N Σ n = 1 N ( x n y n ) - Σ n = 1 N x n Σ n = 1 N y n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
q = Σ n = 1 N x n 2 Σ n = 1 N y n - Σ n = 1 N ( x n y n ) Σ n = 1 N x n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
x n=ln D n,y n=R n
N>2,
Wherein R nbe the code check value that n-th (n=1 ~ N) individual basic coding unit is corresponding, D nfor the distortion value that this basic coding unit is corresponding.
According to the frame-layer rate-distortion model of present frame, and code check value corresponding to present frame and distortion value, the frame-layer LaGrange parameter of estimation next frame and weight coefficient w corresponding to next frame 1 ", w 2 ".
As shown in Figure 3, Fig. 3 is the schematic diagram of the frame-layer LaGrange parameter obtaining next frame in Rate-distortion optimization method of the present invention.Curve in Fig. 3 is the determined curve of described frame-layer rate-distortion model, and wherein the coordinate of A point is the code check value R that present frame is corresponding awith distortion value D acoordinate in the coordinate system, as previously mentioned, code check value R afor the code check value sum of basic coding unit all in present frame, distortion value D aby to the former figure of whole frame with build image again and ask mean square error to obtain.Supposed that the longitudinal direction of A point and horizontal straight line were A1 point and A2 point with the intersection point of curve respectively, wherein the coordinate of A1 point is (R (A 1), D (A 1)), the coordinate of A2 point is (R (A 2), D (A 2)), the straight slope that A1 point and A2 point are formed just can be used as the frame-layer LaGrange parameter λ of next frame f ".Here also can to the nearest point of A point on calculated curve, namely curve can be used as the frame-layer LaGrange parameter λ of next frame at the slope of this point f ".
Particularly, by the frame-layer LaGrange parameter of following formula estimation next frame,
λ F″=-(D(A 1)-D(A 2))/(R(A 1)-R(A 2)),
Wherein R (A 1) be the code check value of the first intersection point, R (A 2) be the code check value of the second intersection point, D (A 1) be the distortion value of the first intersection point, D (A 2) be the distortion value of the second intersection point, the first intersection point is R=R in R ~ D plane awith the frame-layer rate-distortion model of above-mentioned present frame determine the intersection point of curve, the second intersection point is D=D awith above-mentioned rate-distortion model determine the intersection point of curve, R afor the code check value that above-mentioned present frame is corresponding, D afor the distortion value that above-mentioned present frame is corresponding.
The weight coefficient w of next frame 1 ", w 2 "computational methods as follows,
x n=λ B,n
y n=λ mode,n
p = N Σ n = 1 N ( x n y n ) - Σ n = 1 N x n Σ n = 1 N y n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
q = Σ n = 1 N x n 2 Σ n = 1 N y n - Σ n = 1 N ( x n y n ) Σ n = 1 N x n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
w 1″=p,
w 2 ′ ′ = q λ F ,
Wherein, N is the basic coding unit number selected from present frame, λ b,nbe the block layer LaGrange parameter of n-th (n=1 ~ N) basic coding unit, λ mode, nbe the final LaGrange parameter of the n-th basic coding unit, λ ffor the frame-layer LaGrange parameter of present frame.
The weight coefficient will used when can obtain by above formula the final LaGrange parameter calculating each basic coding unit of next frame like this.
In sum, the rate-distortion optimization of Rate-distortion optimization method of the present invention by comprehensive frame-layer and the rate-distortion optimization of basic coding elementary layer, ensure that the continuity of the rate-distortion characteristic between successive frame, realizes the optimal ratio aberration optimizing to video content.Simultaneity factor aberration optimizing can realize according to the type (i.e. I frame, P frame or B frame) of frame coding is independent separately; The Rate-distortion optimization method that Rate-distortion optimization method of the present invention well avoids prior art can not carry out the technical problem of adaptive optimization to video content.
The foregoing is only embodiments of the invention; not thereby the scope of the claims of the present invention is limited; every equivalent structure transformation utilizing specification of the present invention and accompanying drawing content to do, or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.

Claims (7)

1. a Rate-distortion optimization method, is characterized in that, comprises step:
The block layer LaGrange parameter of each basic coding unit and the frame-layer LaGrange parameter of present frame in A, acquisition present frame;
B, according to the block layer LaGrange parameter of described basic coding unit and the frame-layer LaGrange parameter of described present frame, obtain the final LaGrange parameter of each basic coding unit in described present frame;
C, according to described final LaGrange parameter, rate-distortion optimal coding is carried out to basic coding unit each in described present frame, obtain code check value that in described present frame, each basic coding unit is corresponding and distortion value, and then obtain code check value corresponding to present frame and distortion value;
D, according to code check value corresponding at least two basic coding unit in described present frame and distortion value, set up frame-layer rate-distortion model, according to described frame-layer rate-distortion model and code check value corresponding to described present frame and distortion value, the frame-layer LaGrange parameter of estimation next frame;
Wherein, described step B is specially: obtain described final LaGrange parameter by following formula,
λ mod e=w 1λ B+w 2λ F
Wherein λ mod efor the final LaGrange parameter of described basic coding unit, λ ffor the frame-layer LaGrange parameter of the present frame at described basic coding unit place, λ bfor the block layer LaGrange parameter of described basic coding unit, w 1, w 2for corresponding weight coefficient, described weight coefficient w 1, w 2obtained by following formula:
x n=λ B',n
y n=λ mod e',n
p = N Σ n = 1 N ( x n y n ) - Σ n = 1 N x n Σ n = 1 N y n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
q = Σ n = 1 N x n 2 Σ n = 1 N y n - Σ n = 1 N ( x n y n ) Σ n = 1 N x n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
w 1=p,
w 2 = q λ F ′ ,
Wherein, N is the basic coding unit number selected from previous frame, λ b', nbe the block layer LaGrange parameter of the n-th basic coding unit, λ mod e', nbe the final LaGrange parameter of the n-th basic coding unit, wherein n=1 ~ N, λ f'for the frame-layer LaGrange parameter of previous frame;
Wherein, described step D comprises: according to code check value and the distortion value of at least two described basic coding unit of described present frame, adopts following formula to set up described frame-layer rate-distortion model,
R=a ln(b/D),
Wherein R is code check value, and D is corresponding distortion value, and a, b are model parameter.
2. Rate-distortion optimization method according to claim 1, is characterized in that, the block layer LaGrange parameter of each basic coding unit described in described steps A is:
λ B=0.85×2 (QP-12)/3
Wherein λ bfor the block layer LaGrange parameter of described each basic coding unit, QP is the quantization parameter of described basic coding unit.
3. Rate-distortion optimization method according to claim 1, is characterized in that, described step C comprises: the minimum code cost being obtained the rate-distortion optimization of the described basic coding unit of described present frame by following formula,
J(s,c,mod e|QP)=min[D(s,c,mod e|QP)+λ mod eR(s,c,mod e|QP)],
Wherein J is minimum code cost, D is distortion value, R is code check value, s represents the basic coding unit of former figure, c represents the corresponding basic coding unit building image again by encoding and decoding process, mode represents the coding mode selected of described basic coding unit, and QP is the quantization parameter of described basic coding unit, λ mod efor corresponding final LaGrange parameter;
According to described minimum code cost, obtain corresponding forced coding pattern, rate-distortion optimal coding is carried out to the described basic coding unit of described present frame.
4. Rate-distortion optimization method according to claim 1, is characterized in that, when the code check value of the described basic coding unit of use two and distortion value in described step D, when setting up described frame-layer rate-distortion model, described model parameter is obtained by following formula,
a = R 1 - R 2 ln D 2 - ln D 1 ,
b = e R 1 ln D 2 - R 2 ln D 1 R 1 - R 2 ,
Wherein R 1and R 2for the code check value of described two basic coding unit, D 1and D 2for corresponding distortion value.
5. Rate-distortion optimization method according to claim 1, is characterized in that, when the code check value and the distortion value that use N number of described basic coding unit in described step D, when setting up described frame-layer rate-distortion model, described model parameter is obtained by following formula,
a=-p,
b=e -q/p,
p = N Σ n = 1 N ( x n y n ) - Σ n = 1 N x n Σ n = 1 N y n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
q = Σ n = 1 N x n 2 Σ n = 1 N y n - Σ n = 1 N ( x n y n ) Σ n = 1 N x n N Σ n = 1 N x n 2 - ( Σ n = 1 N x n ) 2 ,
x n=ln D n,y n=R n
N>2,
Wherein R nfor the code check value of described n-th basic coding unit, D nfor corresponding distortion value.
6. Rate-distortion optimization method according to claim 1, is characterized in that, described step D also comprises: by the frame-layer LaGrange parameter of following formula estimation next frame,
λ F″=-(D(A 1)-D(A 2))/(R(A 1)-R(A 2)),
Wherein R (A 1) be the code check value of the first intersection point, R (A 2) be the code check value of the second intersection point, D (A 1) be the distortion value of the first intersection point, D (A 2) be the distortion value of the second intersection point, described first intersection point is R=R in R ~ D plane awith described rate-distortion model determine the intersection point of curve, described second intersection point is D=D awith described rate-distortion model determine the intersection point of curve, R afor frame-layer code check value, D afor frame-layer distortion value.
7. Rate-distortion optimization method according to claim 6, is characterized in that, described frame-layer code check value R afor the code check value sum of basic coding unit all in described frame, described frame-layer distortion value D aby asking mean square error to obtain to the former figure of described frame and the image of building again of described frame.
CN201210255897.3A 2012-07-23 2012-07-23 Rate distortion optimization method Active CN102780884B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210255897.3A CN102780884B (en) 2012-07-23 2012-07-23 Rate distortion optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210255897.3A CN102780884B (en) 2012-07-23 2012-07-23 Rate distortion optimization method

Publications (2)

Publication Number Publication Date
CN102780884A CN102780884A (en) 2012-11-14
CN102780884B true CN102780884B (en) 2015-05-06

Family

ID=47125627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210255897.3A Active CN102780884B (en) 2012-07-23 2012-07-23 Rate distortion optimization method

Country Status (1)

Country Link
CN (1) CN102780884B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104301724B (en) 2014-10-17 2017-12-01 华为技术有限公司 Method for processing video frequency, encoding device and decoding device
CN112970254B (en) * 2019-02-27 2023-06-02 Oppo广东移动通信有限公司 Rate distortion optimization method and device, and computer readable storage medium
WO2022021422A1 (en) * 2020-07-31 2022-02-03 Oppo广东移动通信有限公司 Video coding method and system, coder, and computer storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340593A (en) * 2008-08-13 2009-01-07 武汉大学 Rate distortion optimizing method in error tolerant video code conversion
CN102148973A (en) * 2010-02-04 2011-08-10 成都市世嘉电子实业有限公司 Three-layer rate control method based on Lagrange's multiplier factors

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8238444B2 (en) * 2009-12-15 2012-08-07 National Taiwan University Perceptual-based video coding method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340593A (en) * 2008-08-13 2009-01-07 武汉大学 Rate distortion optimizing method in error tolerant video code conversion
CN102148973A (en) * 2010-02-04 2011-08-10 成都市世嘉电子实业有限公司 Three-layer rate control method based on Lagrange's multiplier factors

Also Published As

Publication number Publication date
CN102780884A (en) 2012-11-14

Similar Documents

Publication Publication Date Title
CN102611892B (en) Method and device for realizing adaptive quantization in coding process
TWI696380B (en) Method for inversely quantizing a quantized block
CN102752596B (en) Rate distortion optimization method
CN102196256B (en) Video encoding method and device
EP2202986A1 (en) An adaptive predicting device and method
CN101729892B (en) Coding method of asymmetric stereoscopic video
CN107566846B (en) Video coding skipping mode decision method, device, equipment and storage medium
CN103581647A (en) Depth map sequence fractal coding method based on motion vectors of color video
CN101835042A (en) Wyner-Ziv video coding system controlled on the basis of non feedback speed rate and method
WO2011047542A1 (en) Video and image encoding/decoding system based on spatial domain prediction
CN104902276B (en) Converter unit partitioning method and device
CN103581670A (en) H.264 self-adaptation intra-frame mode selection code rate estimated rate-distortion optimization method and device thereof
CN104378636A (en) Video image coding method and device
CN102780886B (en) Rate distortion optimization method
CN102780884B (en) Rate distortion optimization method
CN105611301A (en) Distributed video coding and decoding method based on wavelet domain residual errors
CN105791865A (en) Intra-frame prediction and deblocking filtering method
CN102780885B (en) Rate distortion optimization method
CN102196270B (en) Intra-frame prediction method, device, coding and decoding methods and devices
CN108259918B (en) Coding unit mode decision method and device
CN110913232B (en) Selection method and device of TU division mode and readable storage medium
CN105791868B (en) The method and apparatus of Video coding
CN102821280B (en) Rate distortion optimization method
CN104053009A (en) Encoding method of monitoring video and device
CN102088608A (en) Partial reconstruction-based quality optimization method for scalable video coding

Legal Events

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

Effective date of registration: 20220601

Address after: 510530 No. 10, Nanxiang 2nd Road, Science City, Luogang District, Guangzhou, Guangdong

Patentee after: Guangdong Guangsheng research and Development Institute Co.,Ltd.

Address before: 518057 6th floor, software building, No. 9, Gaoxin Zhongyi Road, high tech Zone, Nanshan District, Shenzhen, Guangdong Province

Patentee before: SHENZHEN RISING SOURCE TECHNOLOGY Co.,Ltd.