CN102752596B - Rate distortion optimization method - Google Patents

Rate distortion optimization method Download PDF

Info

Publication number
CN102752596B
CN102752596B CN201210231549.2A CN201210231549A CN102752596B CN 102752596 B CN102752596 B CN 102752596B CN 201210231549 A CN201210231549 A CN 201210231549A CN 102752596 B CN102752596 B CN 102752596B
Authority
CN
China
Prior art keywords
distortion
code check
cost
check value
rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210231549.2A
Other languages
Chinese (zh)
Other versions
CN102752596A (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 CN201210231549.2A priority Critical patent/CN102752596B/en
Publication of CN102752596A publication Critical patent/CN102752596A/en
Application granted granted Critical
Publication of CN102752596B publication Critical patent/CN102752596B/en
Active 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: A. performing rate distortion calculation by using a first calculation index to obtain a first group of distortion/code rate values; B. performing rate distortion calculation by using a second calculation index to obtain a second group of distortion/code rate values; C. acquiring a distortion/code rate value corresponding to the minimum coding cost in a first group of distortion/code rate values by adopting a first rate-distortion optimization mode; D. obtaining a plurality of candidate code rate values and corresponding coding costs according to the distortion/code rate value of the minimum coding cost; E. obtaining a second group of distortion/code rate value compensation costs corresponding to the candidate code rate values by adopting a second rate distortion optimization mode; F. and determining the minimum value of the comprehensive cost according to the coding cost and the compensation cost, and further acquiring the optimal coding mode. The rate distortion optimization method of the invention enables the rate distortion optimization result to be optimal by integrating two rate distortion optimization indexes.

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) (1)
Wherein D is distortion value, and R is code check value, s and c represents former figure respectively and build the corresponding basic coding unit of image again by encoding and decoding process, and mode represents the coding mode selected of basic coding unit, and QP is quantization parameter, λ modebe 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, λ modedetermine namely have by quantization parameter QP
λ mode=0.85×2 (QP-12)/3 (2)
Above-mentioned rate-distortion optimization is at appointment λ modewhen determine optimum coding mode mode.But, above-mentioned λ modedetermination mode just with MSE(mean squared error, mean square error) statistical approximation result when measuring distortion.And MSE correctly can express distortion, can often occur on the contrary feeling inconsistent situation with the distortion of human eye.Such as the distorted image that some MSE values are close, the distortion sensation of human eye may have a great difference.So measure the method for distortion with MSE and perfect not, the result that therefore can cause above-mentioned rate-distortion optimization also and non-optimal.
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, for the expression distortion that Rate-distortion optimization method of the prior art can not be correct, cause the defect of the result badly of rate-distortion optimization, there is provided a kind of by comprehensive two kinds of rate-distortion optimization indexs, make the Rate-distortion optimization method of rate-distortion optimization result the best.
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:
A, adopt the first parameter to carry out rate distortion calculating, obtain first group of distortion/code check value;
B, adopt the second parameter to carry out rate distortion calculating, obtain second group of distortion/code check value;
C, adopt the first rate-distortion optimization mode, obtain the distortion/code check value of corresponding minimum code cost in described first group of distortion/code check value;
D, distortion/code check value according to described minimum code cost, obtain multiple candidate code check value and corresponding Coding cost;
E, adopt the second rate-distortion optimization mode, obtain the compensation cost of the second group distortion/code check value corresponding with described candidate code check value;
F, according to described Coding cost and described compensation cost, determine the minimum value of integrate-cost, and then obtain forced coding pattern.
In Rate-distortion optimization method of the present invention, described first parameter is the squared difference and the index that correspond to mean square error, is specially:
SSD = Σ ( x , y ) ∈ A ( s ( x , y ) - c ( x , y ) ) 2 ,
Wherein SSD is squared difference and index, s represents the basic coding unit of former figure, c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and x, y represent the location of pixels in described basic coding unit, and A represents the pixel coverage of described basic coding unit.
In Rate-distortion optimization method of the present invention, described second parameter is structure similarity index, is specially:
SSIM(s,c)=L(s,c)·G(s.c)·H(s,c),
L ( s , c ) = 2 μ s μ c + C 1 μ s 2 + μ c 2 + C 1 ,
G ( s , c ) = 2 σ s σ c + C 2 σ s 2 + σ c 2 + C 2 ,
H ( s , c ) = σ sc + C 3 σ s σ c + C 3 ,
Wherein SSIM is structure similarity index, and s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and L represents brightness similarity, and G represents contrast similarity, and H represents structural similarity; μ sfor the mean value of pixel in s, μ cfor the mean value of pixel in c, for the variance yields of pixel in s, for the variance yields of pixel in c, σ scfor the covariance value of respective pixel in pixel in s and c, C 1, C 2, C 3for constant.
In Rate-distortion optimization method of the present invention, described step C is specially: obtain Coding cost J corresponding in described first group of distortion/code check value by following formula i 1, then according to described Coding cost J i 1determine the distortion/code check value of corresponding minimum code cost,
J i 1(s,c,mode|QP)=D i 1(s,c,mode|QP)+λ 1R i(s,c,mode|QP),
Wherein J i 1for described Coding cost, D i 1for described first group of distortion value, R ifor described code check value, s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and mode represents the coding mode selected of described basic coding unit, and QP is quantization parameter, λ 1be used to the LaGrange parameter of compromise described first group of distortion value and described code check value, i is positive integer; Wherein
λ 1=0.85×2 (QP-12)/3
In Rate-distortion optimization method of the present invention, in described step D, by the code check value of described minimum code cost, and at least two the code check values adjacent with the code check value of described minimum code cost are as described candidate code check value.
In Rate-distortion optimization method of the present invention, described step e is specially: the compensation cost being obtained the second group distortion/code check value corresponding with described candidate code check value by following formula,
J i 2 = D i 2 + k i · R i ,
Wherein for described second group of distortion value, R ifor described code check value, for described compensation cost, k ithe curve formed for described second group of distortion/code check value is at the slope of respective points, and i is positive integer.
In Rate-distortion optimization method of the present invention, described step F is specially: obtain described integrate-cost J by following formula i, and according to described integrate-cost J iminimum value determine described forced coding pattern,
J i = w 1 · J i 1 + w 2 · J i 2 ,
Wherein for described Coding cost, for described compensation cost, w 1, w 2for weight coefficient, i is positive integer.
In Rate-distortion optimization method of the present invention, during as estimated the motion vector of inter prediction, described step C is specially: obtain Coding cost J corresponding in described first group of distortion/code check value by following formula i 1, then according to described Coding cost J i 1determine the distortion/code check value of corresponding minimum code cost,
J i 1(s,c,mv|QP)=D i 1(s,c,mv|QP)+λ motionR i(s,c,mv|QP),
Wherein for described Coding cost, D i 1for described first group of distortion value, R ifor described code check value, s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and mv represents motion vector during inter prediction, and QP is quantization parameter, λ motionbe LaGrange parameter when asking motion vector, i is positive integer; Wherein
λ motion=0.85 × 2 (QP-12)/3or λ motion = 0.85 × 2 ( QP - 12 ) / 3 .
In Rate-distortion optimization method of the present invention, described Rate-distortion optimization method also comprises step: according to the minimum value of described integrate-cost, obtain best LaGrange parameter, according to described best LaGrange parameter, obtain the LaGrange parameter when motion vector of inter prediction is estimated.
In Rate-distortion optimization method of the present invention, obtain described best LaGrange parameter according to following formula,
λ * mode=(J-D)/R,
Wherein J is minimum integrate-cost, and D is the distortion value of described forced coding pattern, and R is the code check value of described forced coding pattern, λ * modefor described best LaGrange parameter,
LaGrange parameter when the described motion vector to inter prediction is estimated is obtained by following formula,
λ * motion* modeor λ * motion = λ * mode ,
Wherein λ * motionfor LaGrange parameter when the described motion vector to inter prediction is estimated.
Implement Rate-distortion optimization method of the present invention, there is following beneficial effect: by comprehensive two kinds of rate-distortion optimization indexs, make rate-distortion optimization result best.The Rate-distortion optimization method avoiding prior art can not be correct expression distortion, cause the technical problem of the result badly of rate-distortion optimization.
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 obtaining candidate's code check value 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, adopts the first parameter to carry out rate distortion calculating, obtains first group of distortion/code check value;
Step 102, adopts the second parameter to carry out rate distortion calculating, obtains second group of distortion/code check value;
Step 103, adopts the first rate-distortion optimization mode, obtains the distortion/code check value of corresponding minimum code cost in first group of distortion/code check value,
Step 104, according to the distortion/code check value of minimum code cost, obtains multiple candidate code check value and corresponding Coding cost;
Step 105, adopts the second rate-distortion optimization mode, obtains the compensation cost of the second group distortion/code check value corresponding with candidate code check value;
Step 106, according to described Coding cost and described compensation cost, determines the minimum value of integrate-cost, and then obtains forced coding pattern.
Please refer to 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 the first Rate-distortion optimization method of the present invention.
First, before step 101, input coding elementary cell is to code device, then all coding modes of this coding elementary cell are selected one by one, for each coding mode, complete corresponding Code And Decode process, obtain encode elementary cell 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, adopt the first parameter to the basic coding unit of former figure and build the corresponding basic coding unit of image again by encoding and decoding process, carrying out rate distortion calculating, obtain first group of distortion/code check value.In the present embodiment, the first parameter is corresponding MSE(mean square error, mean squared error) SSD(squared difference and, sum of squared difference) index.This rate distortion calculates and is specially:
SSD = Σ ( x , y ) ∈ A ( s ( x , y ) - c ( x , y ) ) 2 ,
Wherein SSD is squared difference and index, s represents the basic coding unit of former figure, c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and x, y represent the position of each pixel in described basic coding unit, and A represents the pixel coverage of basic coding unit.
By the calculating of above formula, s and c corresponding according to each coding mode, obtains corresponding code check value R iwith the distortion value D expressed by SSD index i 1, first group of distortion/code check value can be obtained like this, be designated as (D i 1, R i), wherein i is positive integer, and the maximum of i is to should the number of coding mode of basic coding unit.
Come step 102 subsequently, in a step 102, adopt the second parameter to the basic coding unit of former figure and build the corresponding basic coding unit of image again by encoding and decoding process, carrying out rate distortion calculating, obtain second group of distortion/code check value.In the present embodiment, the second parameter is SSIM(structural similarity, structural similarity) index.This rate distortion calculates and is specially:
SSIM(s,c)=L(s,c)·G(s.c)·H(s,c),
L ( s , c ) = 2 μ s μ c + C 1 μ s 2 + μ c 2 + C 1 ,
G ( s , c ) = 2 σ s σ c + C 2 σ s 2 + σ c 2 + C 2 ,
H ( s , c ) = σ sc + C 3 σ s σ c + C 3 ,
Wherein SSIM is structure similarity index, and s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and L represents brightness similarity, and G represents contrast similarity, and H represents structural similarity; μ sfor the mean value of pixel in s, μ cfor the mean value of pixel in c, for the variance yields of pixel in s, for the variance yields of pixel in c, σ scfor the covariance value of respective pixel in pixel in s and c, C 1, C 2, C 3for constant, C 1, C 2, C 3value can obtain by experiment.
By the calculating of above formula, s and c corresponding according to each coding mode, can obtain corresponding code check value R iwith the distortion value of expressing by SSIM index second group of distortion/code check value can be obtained like this, be designated as wherein i is positive integer, and the maximum of i is to should the number of coding mode of basic coding unit.
Because employing SSD index calculate and SSIM index calculate are the different calculation methods of distortion value, and to code check value R ithere is no impact, so first group of distortion/code check value (D i 1, R i) and second group of distortion/code check value in code check value R iidentical.
Come step 103 subsequently, in step 103, adopt the first rate-distortion optimization mode, obtain the distortion/code check value of corresponding minimum code cost in first group of distortion/code check value.Be specially, obtain Coding cost J corresponding in first group of distortion/code check value by following formula i 1, then according to Coding cost J i 1determine the distortion/code check value of corresponding minimum code cost,
J i 1(s,c,mode|QP)=D i 1(s,c,mode|QP)+λ 1R i(s,c,mode|QP),
Wherein J i 1for Coding cost, D i 1be first group of distortion value, R ifor code check value, s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and mode represents the coding mode selected of described basic coding unit, and QP is quantization parameter, λ 1be used to the LaGrange parameter (i.e. first method parameter) of compromise described first group of distortion value and described code check value, i is positive integer; Wherein
λ 1=0.85×2 (QP-12)/3
Come step 104 subsequently, at step 104, according to the distortion/code check value of minimum code cost, obtain multiple candidate code check value and corresponding Coding cost.Specifically as shown in Figure 3, Fig. 3 is the schematic diagram obtaining candidate's code check value in Rate-distortion optimization method of the present invention.In Fig. 3, abscissa is code check value R i, ordinate is distortion value D i, comprising first group of distortion/code check value (D i 1, R i) matched curve and second group of distortion/code check value matched curve.According to first group of distortion/code check value (D i 1, R i) the code check value of minimum code cost that obtains, and at least two the code check values adjacent with the code check value of this minimum code cost are as candidate code check value.As in Fig. 3 coding cost minimum, then by code check value R 3, and with code check value R 3adjacent code check value R 2with code check value R 4alternatively code check value, candidate's code check value R 2corresponding Coding cost is J 2 1, candidate's code check value R 3corresponding Coding cost is J 3 1, candidate's code check value R 4corresponding Coding cost is J 4 1.Certainly also can select more candidate's code check value here, as will with code check value R 34 adjacent code check value R 1, code check value R 2, code check value R 4and code check value R 5all alternatively code check value.On the other hand, if R 3the left side or the right when corresponding to the adjacent code check value of coding mode, then only select R 3with corresponding monolateral adjacent code check value alternatively code check value.
Come step 105 subsequently, in step 105, adopt the second rate-distortion optimization mode, obtain the compensation cost of the second group distortion/code check value corresponding with candidate code check value.
For the data point in Fig. 3, code check value sorts from small to large and is followed successively by R 1, R 2, R 3, R 4and R 5, the curve that such second group of distortion/code check value is formed is at candidate's code check value R 2corresponding point (D 2 2, R 2) slope be:
k 2 = - D 3 2 - D 1 2 R 3 - R 1 ;
The curve that second group of distortion/code check value is formed is at candidate's code check value R 3corresponding point (D 3 2, R 3) slope be:
k 3 = - D 4 2 - D 2 2 R 4 - R 2 ;
The curve that second group of distortion/code check value is formed is at candidate's code check value R 4corresponding point (D 4 2, R 4) slope be:
k 4 = - D 5 2 - D 3 2 R 5 - R 3 ;
The compensation cost of the second group distortion/code check value corresponding with candidate code check value is obtained again by following formula,
J i 2 = D i 2 + k i · R i ,
Wherein be second group of distortion value, R ifor code check value, for compensating cost, k ithe curve formed for described second group of distortion/code check value is at the slope (above try to achieve) of respective points, and i is positive integer.Candidate's code check value R can be calculated respectively like this 2compensation cost candidate's code check value R 3compensation cost and candidate's code check value R 4compensation cost in this step, the curve that second group of distortion/code check value is formed also can obtain by other modes at the slope of respective points, as first asked for the matched curve of R ~ D, recycles this matched curve slope calculations.Therefore the curve that second group of distortion/code check value is formed does not limit the scope of the invention at the concrete obtain manner of the slope of respective points.
Come step 106 subsequently, according to Coding cost J i 1and compensation cost determine integrate-cost J iminimum value, and then obtain forced coding pattern.
Integrate-cost J is obtained by following formula i:
J i = w 1 · J i 1 + w 2 · J i 2 ,
Wherein for Coding cost, for compensating cost, w 1, w 2for weight coefficient, can get fixed value or be set by the user, i is positive integer.Last according to integrate-cost J iminimum value determination forced coding pattern export.
As the second preferred embodiment of Rate-distortion optimization method of the present invention, rate distortion when Rate-distortion optimization method of the present invention also can be estimated the motion vector of inter prediction is optimized.Be with the difference of the first preferred embodiment,
Coding cost J corresponding in first group of distortion/code check value is obtained by following formula i 1, then according to Coding cost J i 1determine the distortion/code check value of corresponding minimum code cost,
J i 1(s,c,mv|PQ)=D i 1(s,c,mv|PQ)+λ motionR i(s,c,mv|PQ),
Wherein for Coding cost, D i 1be first group of distortion value, R ifor code check value, s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and mv represents motion vector during inter prediction, and QP is quantization parameter, λ motionbe the LaGrange parameter (first method parameter) when asking motion vector, i is positive integer; Wherein
λ motion=0.85 × 2 (QP-12)/3or λ motion = 0.85 × 2 ( QP - 12 / 3 ) .
Other steps and the first preferred embodiment same or similar, specifically refer to the first preferred embodiment of the present invention.
As the 3rd preferred embodiment of Rate-distortion optimization method of the present invention, Rate-distortion optimization method of the present invention also can according to the minimum value of the integrate-cost in the first preferred embodiment, obtain LaGrange parameter when estimating the motion vector of inter prediction, rate distortion during to estimate the motion vector of inter prediction is better optimized.
First according to the minimum value of the integrate-cost in the first preferred embodiment, obtain best LaGrange parameter, be specially:
λ * mode=(J-D)/R,
Wherein J is minimum integrate-cost, and D is the distortion value of forced coding pattern, and R is the code check value of forced coding pattern, λ * modefor best LaGrange parameter.
Then according to best LaGrange parameter, obtain the LaGrange parameter when motion vector of inter prediction is estimated, be specially
λ * motion* modeor λ * motion = λ * mode ,
Wherein λ * motionlaGrange parameter during for estimating the motion vector of inter prediction.
In sum, Rate-distortion optimization method of the present invention, by comprehensive two kinds of rate-distortion optimization indexs, makes rate-distortion optimization result best.Employ the combination of SSD index and SSIM index in an embodiment of the present invention, complex optimum can certainly be carried out by other index, such as: SSD can use SAD(absolute difference sum, Sum of Absolute Differences) or SATD(Hadamard conversion after again absolute value summation, Sum of Absolute Transformed Differences) etc. replacement, SSIM can use the multiple dimensioned SSIM of MS-SSIM(, Multi-Scale SSIM) or the replacement such as VIF (visual information fidelity, Visual Information Fidelity); Rate-distortion optimization method of the present invention can look for forced coding pattern from all coding modes of coding elementary cell simultaneously, also can look for forced coding pattern from a part of coding mode of specifying; Rate-distortion optimization can realize according to the type (i.e. I frame, P frame or B frame) of frame coding is independent separately in addition; Rate-distortion optimization method of the present invention avoids the expression distortion that the Rate-distortion optimization method of prior art can not be correct well, causes the technical problem of the result badly of rate-distortion optimization.
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:
A, adopt the first parameter to carry out rate distortion calculating, obtain first group of distortion/code check value;
B, adopt the second parameter to carry out rate distortion calculating, obtain second group of distortion/code check value;
C, adopt the first rate-distortion optimization mode, obtain the distortion/code check value of corresponding minimum code cost in described first group of distortion/code check value;
D, distortion/code check value according to described minimum code cost, obtain the multiple candidate code check value in described first group of distortion/code check value and corresponding Coding cost;
E, adopt the second rate-distortion optimization mode, obtain the compensation cost of the second group distortion/code check value corresponding with described candidate code check value;
F, according to described Coding cost and described compensation cost, determine the minimum value of integrate-cost, and then obtain forced coding pattern;
Wherein, in described step D, by the code check value of described minimum code cost, and at least two the code check values adjacent with the code check value of described minimum code cost are as described candidate code check value;
Described step e is specially: the compensation cost being obtained the second group distortion/code check value corresponding with described candidate code check value by following formula,
J i 2 = D i 2 + k i · R i ,
Wherein for described second group of distortion value, R ifor described code check value, for described compensation cost, k ithe curve formed for described second group of distortion/code check value is at the slope of respective points, and i is positive integer;
Described step F is specially: obtain described integrate-cost J by following formula i, and according to described integrate-cost J iminimum value determine described forced coding pattern,
J i = w 1 · J i 1 + w 2 · J i 2 ,
Wherein for described Coding cost, for described compensation cost, w 1, w 2for weight coefficient, i is positive integer.
2. Rate-distortion optimization method according to claim 1, is characterized in that, described first parameter is the squared difference and the index that correspond to mean square error, is specially:
SSD = Σ ( x , y ) ∈ A ( s ( x , y ) - c ( x , y ) ) 2 ,
Wherein SSD is squared difference and index, s represents the basic coding unit of former figure, c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and x, y represent the location of pixels in described basic coding unit, and A represents the pixel coverage of described basic coding unit.
3. Rate-distortion optimization method according to claim 1, is characterized in that, described second parameter is structure similarity index, is specially:
SSIM(s,c)=L(s,c)·G(s.c)·H(s,c),
L ( s , c ) = 2 μ s μ c + C 1 μ s 2 + μ c 2 + C 1 ,
G ( s , c ) = 2 σ s σ c + C 2 σ s 2 + σ c 2 + C 2 ,
H ( s , c ) = σ sc + C 3 σ s σ c + C 3 ,
Wherein SSIM is structure similarity index, and s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and L represents brightness similarity, and G represents contrast similarity, and H represents structural similarity; μ sfor the mean value of pixel in s, μ cfor the mean value of pixel in c, for the variance yields of pixel in s, for the variance yields of pixel in c, σ scfor the covariance value of respective pixel in pixel in s and c, C 1, C 2, C 3for constant.
4. Rate-distortion optimization method according to claim 1, is characterized in that, described step C is specially: obtain Coding cost J corresponding in described first group of distortion/code check value by following formula i 1, then according to described Coding cost J i 1determine the distortion/code check value of corresponding minimum code cost,
J i 1(s,c,mod e|QP)=D i 1(s,c,mod e|QP)+λ 1R i(s,c,mod e|QP),
Wherein J i 1for described Coding cost, D i 1for described first group of distortion value, R ifor described code check value, s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and mode represents the coding mode selected of described basic coding unit, and QP is quantization parameter, λ 1be used to the LaGrange parameter of compromise described first group of distortion value and described code check value, i is positive integer; Wherein
λ 1=0.85×2 (QP-12)/3
5. Rate-distortion optimization method according to claim 1, is characterized in that, during as estimated the motion vector of inter prediction, described step C is specially: obtain Coding cost J corresponding in described first group of distortion/code check value by following formula i 1, then according to described Coding cost J i 1determine the distortion/code check value of corresponding minimum code cost,
J i 1(s,c,mv|QP)=D i 1(s,c,mv|QP)+λ motion R i(s,c,mv|QP),
Wherein for described Coding cost, D i 1for described first group of distortion value, R ifor described code check value, s represents the basic coding unit of former figure, and c represents and builds the corresponding basic coding unit of image again by encoding and decoding process, and mv represents motion vector during inter prediction, and QP is quantization parameter, λ motionbe LaGrange parameter when asking motion vector, i is positive integer; Wherein
λ motion=0.85 × 2 (QP-12)/3or λ motion = 0.85 × 2 ( QP - 12 ) / 3 .
6. Rate-distortion optimization method according to claim 5, it is characterized in that, described Rate-distortion optimization method also comprises step: according to the minimum value of described integrate-cost, obtain best LaGrange parameter, according to described best LaGrange parameter, obtain the LaGrange parameter when motion vector of inter prediction is estimated.
7. Rate-distortion optimization method according to claim 6, is characterized in that, obtains described best LaGrange parameter according to following formula,
λ * mod e=(J-D)/R,
Wherein J is minimum integrate-cost, and D is the distortion value of described forced coding pattern, and R is the code check value of described forced coding pattern, λ * mod efor described best LaGrange parameter,
LaGrange parameter when the described motion vector to inter prediction is estimated is obtained by following formula,
λ * motion* mod eor λ * motion = λ * mode ,
Wherein λ * motionfor LaGrange parameter when the described motion vector to inter prediction is estimated.
CN201210231549.2A 2012-07-05 2012-07-05 Rate distortion optimization method Active CN102752596B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210231549.2A CN102752596B (en) 2012-07-05 2012-07-05 Rate distortion optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210231549.2A CN102752596B (en) 2012-07-05 2012-07-05 Rate distortion optimization method

Publications (2)

Publication Number Publication Date
CN102752596A CN102752596A (en) 2012-10-24
CN102752596B true CN102752596B (en) 2014-12-17

Family

ID=47032471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210231549.2A Active CN102752596B (en) 2012-07-05 2012-07-05 Rate distortion optimization method

Country Status (1)

Country Link
CN (1) CN102752596B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104093022B (en) * 2014-06-25 2017-08-18 华为技术有限公司 A kind of Rate-distortion optimization method and device
CN104349167B (en) * 2014-11-17 2018-01-19 电子科技大学 A kind of method of adjustment of Video coding rate-distortion optimization
CN106331706B (en) * 2016-05-03 2019-04-30 上海兆芯集成电路有限公司 Rate-distortion optimization method based on curve matching and the device using this method
CN108696750A (en) * 2017-04-05 2018-10-23 深圳市中兴微电子技术有限公司 A kind of decision method and device of prediction mode
CN108696749A (en) * 2017-04-11 2018-10-23 北京君正集成电路股份有限公司 A kind of mode selecting method and device improving image coding quality
CN107040782B (en) * 2017-04-21 2019-10-01 上海电力学院 Video coding overall situation Rate-distortion optimization method based on Lagrangian method
CN109688411B (en) * 2017-10-18 2022-05-10 深圳市中兴微电子技术有限公司 Video coding rate distortion cost estimation method and device
CN107623858B (en) * 2017-10-19 2020-08-28 北京工业大学 3D video fast coding method based on adaptive segmentation skipping rule
CN108989804B (en) * 2018-08-23 2021-04-27 杭州雄迈集成电路技术股份有限公司 Image coding method and device
CN109561315B (en) * 2018-10-31 2020-10-02 北京金山云网络技术有限公司 Motion estimation method and device, electronic equipment and storage medium
CN112040232B (en) * 2020-11-04 2021-06-22 北京金山云网络技术有限公司 Real-time communication transmission method and device and real-time communication processing method and device

Also Published As

Publication number Publication date
CN102752596A (en) 2012-10-24

Similar Documents

Publication Publication Date Title
CN102752596B (en) Rate distortion optimization method
CN101965734B (en) Method And Apparatus For Image Intra Prediction
CN1926875B (en) Motion compensation method
JP5128443B2 (en) Video encoding and decoding method and apparatus
CN102932642B (en) Interframe coding quick mode selection method
CN102334337A (en) Apparatus and method for coding/decoding image selectivly using descrete cosine/sine transtorm
KR20100004037A (en) Method and apparatus for encoding video, and method and apparatus for decoding video
US9338463B2 (en) Visual quality measure for real-time video processing
CN107846593B (en) Rate distortion optimization method and device
CN107113438A (en) Intra-frame encoding mode
CN102651816B (en) Method and device for scanning transformation coefficient block
CN101552924A (en) Spatial prediction method for video coding
CN102447896B (en) Method, device and system for processing image residual block
CN104796705A (en) SSIM (structural similarity) based HEVC (high efficiency video coding) video coding rate distortion optimizing and rate control algorithms
TW201301900A (en) Method for decoding video encoded as bit stream in video decoder
CN104902276B (en) Converter unit partitioning method and device
CN101938654B (en) Method and device for optimizing and quantifying conversion coefficients
CN101313581B (en) Method and device for coding a video image
CN104333761A (en) HEVC basic unit level code rate allocation method
WO2021134635A1 (en) Transform method, encoder, decoder, and storage medium
CN102780886B (en) Rate distortion optimization method
CN102196270B (en) Intra-frame prediction method, device, coding and decoding methods and devices
CN103096076A (en) Video encoding method
CN102780884B (en) Rate distortion optimization method
CN107155108B (en) A kind of intra-frame prediction method based on brightness change

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

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.