CN102780885B - Rate distortion optimization method - Google Patents

Rate distortion optimization method Download PDF

Info

Publication number
CN102780885B
CN102780885B CN201210255944.4A CN201210255944A CN102780885B CN 102780885 B CN102780885 B CN 102780885B CN 201210255944 A CN201210255944 A CN 201210255944A CN 102780885 B CN102780885 B CN 102780885B
Authority
CN
China
Prior art keywords
frame
sigma
coding unit
distortion
basic coding
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.)
Expired - Fee Related
Application number
CN201210255944.4A
Other languages
Chinese (zh)
Other versions
CN102780885A (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 Rising Source 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 Rising Source Technology Co ltd filed Critical Shenzhen Rising Source Technology Co ltd
Priority to CN201210255944.4A priority Critical patent/CN102780885B/en
Publication of CN102780885A publication Critical patent/CN102780885A/en
Application granted granted Critical
Publication of CN102780885B publication Critical patent/CN102780885B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to a rate distortion optimization method, which comprises the following steps: 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; acquiring a final Lagrange parameter of each basic coding unit in the current frame according to the Lagrange parameter of the block layer and the Lagrange parameter of the frame layer; according to the final Lagrange parameter, rate distortion optimization coding is carried out on each basic coding unit in the current frame to obtain a code rate value and a distortion value of each basic coding unit in the current frame, and then the code rate value and the distortion value of the current frame are obtained; and establishing a frame layer rate-distortion model according to the code rate values and the distortion values of at least two basic coding units in the current frame, and estimating the frame layer Lagrange parameters of the next frame according to the frame layer rate-distortion model and the code rate values and the distortion values of the current frame. The rate distortion optimization method realizes the optimal rate distortion optimization of video contents by integrating the rate distortion optimization of a frame layer and the rate distortion optimization of 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, Intra4x4_Vertical_Right, Intra_4x4_Hori_zontal_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 said step B is specially: obtain described final LaGrange parameter by following formula,
λ mode,n=w 1λ B,n+w 2λ F,0+w 3
Wherein λ mode, nbe the final LaGrange parameter of the n-th basic coding unit, λ f, 0for the frame-layer LaGrange parameter of present frame, λ b,nbe the block layer LaGrange parameter of the n-th basic coding unit, w 1, w 2, w 3for corresponding weight coefficient, described weight coefficient w 1, w 2, w 3obtain according to the coding result of described present frame and the coding result of nearest M frame, M is positive integer.
In Rate-distortion optimization method of the present invention, obtain described weight coefficient w by following steps 1, w 2, w 3:
Store the frame-layer LaGrange parameter λ of described present frame f, 0, nearest M frame frame-layer LaGrange parameter λ f,mand intermediate parameters w 23, m, wherein w 23, mobtained by following formula:
w 23 , m = Σ 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 ,
Wherein x nbe the block layer LaGrange parameter of the n-th basic coding unit of m frame, y nbe the final LaGrange parameter of the n-th basic coding unit of m frame:
x n=λ B,n
y nmode,n
According to the block layer LaGrange parameter x of the n-th basic coding unit of described m frame nwith the final LaGrange parameter y of the n-th basic coding unit of described m frame n, calculate w 1:
w 1 = 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 ,
According to the frame-layer LaGrange parameter λ of present frame f, 0, nearest M frame frame-layer LaGrange parameter λ f,mwith described intermediate parameters w 23, m, calculate w 2and w 3,
u m=λ F,m
v m=w 23,m
w 2 = M Σ m = 0 M ( u m v m ) - Σ m = 0 M u m Σ m = 0 M v m M Σ m = 0 M u m 2 - ( Σ m = 0 M u m ) 2 ,
w 3 = Σ m = 0 M u m 2 Σ m = 0 M v m - Σ n = 0 N ( u m v m ) Σ m = 0 M u m M Σ m = 0 M u m 2 - ( Σ m = 0 M u m ) 2 ,
Wherein, m is the integer being more than or equal to 0, being less than or equal to M, and N is the number of the described basic coding unit selected.
In Rate-distortion optimization method of the present invention, the block layer LaGrange parameter of described each basic coding unit 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, 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, when code check value and the distortion value of the described basic coding unit of use two, 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.
In Rate-distortion optimization method of the present invention, when using code check value and the distortion value of N number of described basic coding unit, 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=lnD 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.
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 basic coding unit each in present frame b, nwith the frame-layer LaGrange parameter λ of present frame f, obtain the final LaGrange parameter λ of each described basic coding unit mode, n.The final LaGrange parameter of each basic coding unit is obtained specifically by following formula,
λ mode,n=w 1λ B,n+w 2λ F,0+w 3
Wherein λ mode, nbe the final LaGrange parameter of the n-th basic coding unit, λ fthe frame-layer LaGrange parameter of present frame, λ b,nbe the block layer LaGrange parameter of the n-th basic coding unit, w 1, w 2, w 3for corresponding weight coefficient, described weight coefficient w 1, w 2, w 3obtain according to the coding result of present frame and the coding result of nearest M frame, M is positive integer, and 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, w 3be 0 etc.
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 by the MSE(mean square error between the corresponding basic coding unit that calculates former figure and build image again, Mean Squared Error) obtain.
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=lnD 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, w 3.
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.
Weight coefficient w 1, w 2, w 3computational methods as follows,
First by the λ of N number of basic coding unit in present frame b, nand λ mode, nobtain w 1with intermediate variable w 23, m,
w 1 = 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 ,
w 23 , m = Σ 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=λ B,n
y nmode,n
Subsequently, then by the frame-layer LaGrange parameter λ of present frame f, 0, nearest M frame frame-layer LaGrange parameter λ f,mthe frame-layer LaGrange parameter w corresponding with every frame 23, m(m=0 ~ M), calculates w 2and w 3, specific as follows:
u m=λ F,m
v m=w 23,m
w 2 = M Σ m = 0 M ( u m v m ) - Σ m = 0 M u m Σ m = 0 M v m M Σ m = 0 M u m 2 - ( Σ m = 0 M u m ) 2 ,
w 3 = Σ m = 0 M u m 2 Σ m = 0 M v m - Σ n = 0 N ( u m v m ) Σ m = 0 M u m M Σ m = 0 M u m 2 - ( Σ m = 0 M u m ) 2 ,
In above calculating formula, λ mode, nfor the final LaGrange parameter of the n-th basic coding unit of present frame, λ f,mbe the frame-layer LaGrange parameter of m frame, λ f, 0for the frame-layer LaGrange parameter of present frame, λ b,nbe the block layer LaGrange parameter of the n-th basic coding unit in a frame, w 1, w 2, w 3for corresponding weight coefficient, N is the basic coding unit number selected from a frame, and M is the quantity of the nearest frame selected.
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 said step B is specially: obtain described final LaGrange parameter by following formula,
λ mode,n=w 1λ B,n+w 2λ F,0+w 3
Wherein λ mode, nbe the final LaGrange parameter of the n-th basic coding unit, λ f, 0for the frame-layer LaGrange parameter of present frame, λ b,nbe the block layer LaGrange parameter of the n-th basic coding unit, w 1, w 2, w 3for corresponding weight coefficient, described weight coefficient w 1, w 2, w 3obtain according to the coding result of described present frame and the coding result of nearest M frame, M is positive integer;
Wherein, described weight coefficient w is obtained by following steps 1, w 2, w 3:
Store the frame-layer LaGrange parameter λ of described present frame f, 0, nearest M frame frame-layer LaGrange parameter λ f,mand intermediate parameters w 23, m, wherein w 23, mobtained by following formula:
w 23 , m = Σ 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 ,
Wherein x nbe the block layer LaGrange parameter of the n-th basic coding unit of m frame, y nbe the final LaGrange parameter of the n-th basic coding unit of m frame:
x n=λ B,n
y n=λ mode,n
According to the block layer LaGrange parameter x of the n-th basic coding unit of described m frame nwith the final LaGrange parameter y of the n-th basic coding unit of described m frame n, calculate w 1:
w 1 = 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 ,
According to the frame-layer LaGrange parameter λ of present frame f, 0, nearest M frame frame-layer LaGrange parameter λ f,mwith described intermediate parameters w 23, m, calculate w 2and w 3,
u m=λ F,m
v m=w 23,m
w 2 = M Σ m = 0 M ( u m v m ) - Σ m = 0 M u m Σ m = 0 M v m M Σ m = 0 M u m 2 - ( Σ m = 0 M u m ) 2 ,
w 3 = Σ m = 0 M u m 2 Σ m = 0 M v m - Σ m = 0 M ( u m v m ) Σ m = 0 M u m M Σ m = 0 M u m 2 - ( Σ m = 0 M u m ) 2 ,
Wherein, m is the integer being more than or equal to 0, being less than or equal to M, and N is the number of the described basic coding unit selected;
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.
2. Rate-distortion optimization method according to claim 1, is characterized in that, the block layer LaGrange parameter of described each basic coding unit 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,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.
4. Rate-distortion optimization method according to claim 1, is characterized in that, when code check value and the distortion value of the described basic coding unit of use two, 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 using code check value and the distortion value of N number of described basic coding unit, 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=lnD 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.
CN201210255944.4A 2012-07-23 2012-07-23 Rate distortion optimization method Expired - Fee Related CN102780885B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210255944.4A CN102780885B (en) 2012-07-23 2012-07-23 Rate distortion optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210255944.4A CN102780885B (en) 2012-07-23 2012-07-23 Rate distortion optimization method

Publications (2)

Publication Number Publication Date
CN102780885A CN102780885A (en) 2012-11-14
CN102780885B true CN102780885B (en) 2014-12-31

Family

ID=47125628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210255944.4A Expired - Fee Related CN102780885B (en) 2012-07-23 2012-07-23 Rate distortion optimization method

Country Status (1)

Country Link
CN (1) CN102780885B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112601073B (en) * 2020-11-30 2023-05-05 北京金山云网络技术有限公司 Encoder evaluation method, encoder evaluation device, computer device, and storage medium
CN114915789B (en) * 2022-04-13 2023-03-14 中南大学 Method, system, device and medium for optimizing Lagrange multiplier between frames

Citations (3)

* 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
CN101389012A (en) * 2008-09-28 2009-03-18 湖北科创高新网络视频股份有限公司 Method and device for rate distortion rate control
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 (3)

* 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
CN101389012A (en) * 2008-09-28 2009-03-18 湖北科创高新网络视频股份有限公司 Method and device for rate distortion rate control
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
CN102780885A (en) 2012-11-14

Similar Documents

Publication Publication Date Title
CN102752596B (en) Rate distortion optimization method
CN101729892B (en) Coding method of asymmetric stereoscopic video
CN102196256B (en) Video coding method and device
CN103581647A (en) Depth map sequence fractal coding method based on motion vectors of color video
CN106937116B (en) Low-complexity video coding method based on random training set adaptive learning
KR20110010324A (en) Method and apparatus for image encoding, and method and apparatus for image decoding
CN101835042A (en) Wyner-Ziv video coding system controlled on the basis of non feedback speed rate and method
CN104902276B (en) Converter unit partitioning method and device
WO2011047542A1 (en) Video and image encoding/decoding system based on spatial domain prediction
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
CN104702959B (en) A kind of intra-frame prediction method and system of Video coding
CN102780886B (en) Rate distortion optimization method
CN102625104B (en) Video coding method
CN102780884B (en) Rate distortion optimization method
CN102196270B (en) Intra-frame prediction method, device, coding and decoding methods and devices
CN105791868B (en) The method and apparatus of Video coding
CN105611301A (en) Distributed video coding and decoding method based on wavelet domain residual errors
CN104053009A (en) Encoding method of monitoring video and device
CN104113761A (en) Code rate control method for video encoding and encoder
CN102780885B (en) Rate distortion optimization method
CN105791865A (en) Intra-frame prediction and deblocking filtering method
CN108259918B (en) Coding unit mode decision method and device
US10015484B2 (en) Adaptive scan device and method for scanning thereof
CN102821280B (en) Rate distortion optimization method

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: 20220511

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.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20141231