Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, provide a kind of reasonable in design, subjective visual quality is high and can remove more perception redundancies based on the HEVC rate-distortion optimization algorithm just can examining perceived quality decision rule.
The present invention solves existing technical problem and takes following technical scheme to realize:
Based on the HEVC rate-distortion optimization algorithm just can examining perceived quality decision rule, comprise the following steps:
Step 1, before the coding side of efficient video codec carries out mode adjudging, analyze the motor pattern of each macro block in each frame and static textural characteristics, obtain the perceived quality type of current macro, and obtain salient region of image according to different motion states;
Step 2, to calculate view-based access control model salient region according to specific image region just can examine distortion threshold;
Step 3, according to view-based access control model salient region just can examine distortion threshold calculate based on the perceived quality just can examining distortion model;
Step 4, basis carry out rate-distortion optimization based on the perceived quality just can examining distortion model.
And described step 1 perceived quality type adopts following Mathematical Modeling to obtain:
In formula,
for the perceived quality type of current macro, Normal Pattern is normal perceived quality type, and Aliased Pattern is distortion-aware quality type, and Hysteresis Pattern is delayed perceived quality type, and Background is static perceived quality type,
with
be respectively the probability of normal condition, distortion status, inactive state appearance,
for
with
vector form,
for status attribute descriptor, SS represents inactive state.
And described salient region of image is the region that the macro block of Normal Pattern type and the macro block of Hysteresis Pattern type combine formation.
And the distortion threshold of just can examining of described step 2 view-based access control model salient region calculates according to the following equation:
In above-mentioned formula, FJND be view-based access control model salient region just can examine distortion threshold, T
basic(k, n, i, j), F
lum, F
contrast, F
temporaland F
foveabasic threshold value, intensity modifier value, contrast correction value, time-domain correction value and marking area correction value respectively.
And described step 3 is obtained by PSNR-HA and PSNR-HMA two kinds of distortion criterion weightings based on the perceived quality just can examining distortion model, and its computational methods are as follows:
(1) for given reference block A and distortion block B, the difference of both calculating
with
the mean value of reference block A and distortion block B coefficient respectively;
(2) correction matrix C=B+Delt is obtained;
(3) correction factor is calculated
(4) revised macro block D=C × ρ is calculated;
(5) calculating just can examine the revised distortion value MSE of distortion model
hVS, computational methods are as follows:
Wherein coeff
o(i, j) and coeff
d(i, j) represents the pixel value of reference block and reconstructed block correspondence position respectively, and what jnd (i, j) then represented second correspondence position calculated just can examine distortion threshold;
(6) if M
1> M
2then
Finally obtain
MSE
HVS=M
1+Delt
2×coef3
In above formula, coef1, coef2, coef3 represent the modifying factor to perceptual error, get 0.002,0.25 and 0.04 respectively according to experiment experience;
(7) PSNR-HA is obtained according to the above-mentioned perceived quality distortion calculated:
For coloured image, M is Y, Cr, Cb luminance component, the average distortion that the perceptual distortion weighting of two color components obtains, as shown in the formula calculating:
M=(M
Y+M
Cb×coef4+M
Cr×coef4)/(1+2×coef4)
M
y, M
cb, M
cra luminance component Y respectively, the perceptual distortion of two color components Cb, Cr, weight coefficient coef4 is 0.5;
The correction of PSNR-HMA is at calculating MSE
hVStime do corresponding correction with distortion model just can be examined.
And the method that described step 4 carries out rate-distortion optimization is: just will can examine perceived quality based on salient region of image and melt and be combined on R-λ model, and obtain as drag:
In above formula, J is cost function, then λ=dQ/dR, for each macro block, and calculation cost function:
j
1=q
1(QP
1)-λ·r
1(QP
1)for?coding?block#1
j
2=q
2(QP
2)-λ·r
2(QP
2)for?coding?block#2
……
j
N=q
N(QP
N)-λ·r
N(QP
N)for?coding?block#N
In above formula, QP is quantization step, compares by search the coding mode obtaining making max{J} minimum.
Advantage of the present invention and good effect are:
The present invention is reasonable in design, it adopts and carries out HEVC rate-distortion optimization based on just examining perceived quality decision rule, mean square error MSE can be overcome as the deficiency weighing video distortion evaluation criterion, final encoding efficiency is made more to meet the subjective perceptual quality of human eye, meanwhile, more noise can be tolerated under the prerequisite that the video after coding does not reduce at subjective quality, remove unnecessary perception redundancy, thus improve compression efficiency, reduce the code check of the rear file of coding.
Embodiment
Below in conjunction with accompanying drawing, the embodiment of the present invention is further described.
Based on the HEVC rate-distortion optimization algorithm just can examining perceived quality decision rule, as shown in Figure 1, comprise the following steps:
Step 1, before the coding side of efficient video codec carries out mode adjudging, analyze the motor pattern of each macro block in each frame and static textural characteristics, draw the perceived quality type of current macro, and obtain salient region of image according to different motion states.
In this step, for each coding unit CU of each frame, and its each divided block, first set up the status attribute descriptor of complete set
(representing the state of the kth macro block in a frame of t), as follows:
Wherein
In formula, NS, AS, SS represent normal condition, distortion status, inactive state respectively,
represent motion vector,
the ratio representing current block residual energy and texture energy ratio,
represent the kth macro block in a frame of t, the size of q to be corresponding quantization parameter N × N be macro block.
With vector
form represent status attribute descriptor
as follows:
Wherein
three values corresponding three kinds of states situation about not occurring respectively, namely 0 represents and does not occur, and 1 represents and occurs.
At a time,
represent the weight of the probability that NS, AS and SS occur respectively, three uses vector form
represent;
with
represent the probability that in three, state occurs, be expressed as vector form
as follows:
Wherein
η is a constant being greater than 1, represents iterative rate;
Draw each macro block probability vector according to above-mentioned parameter, judge the perceived quality type belonging to it according to following criterion
as follows:
Background in formula represents that picture still is motionless, is background parts;
Think in this method and only belong to Normal Pattern and Hysteresis Pattern two kinds of situations both attracting attentivenesss, the details differentiating picture can be divided again.The region that the macro block belonging to these two kinds of patterns is combined and salient region.Fig. 2 gives a video interception, and Fig. 3 is the remarkable figure obtained by this step.
Step 2, to calculate view-based access control model salient region according to specific image region just can examine distortion threshold.
This method can attract the attentiveness of beholder for moving region in video content, and the visual sensitivity of human eye outwards declines gradually along with vision central fovea, saliency region and tradition combine so just can be examined distortion model, further excavation video-aware redundancy, improves compression efficiency under the prerequisite ensureing viewing quality.
The distortion threshold FJND that just can examine of view-based access control model salient region calculates according to the following equation:
In above-mentioned formula, T
basic(k, n, i, j), F
lum, F
contrast, F
temporaland F
foveabe basic threshold value, intensity modifier value, contrast correction value, time-domain correction value and marking area correction value respectively, wherein former three is for the threshold value of still image and modifying factor, after two modifying factors for video.The calculating of each factor is respectively:
(1) basic threshold value T
basic(k, n, i, j):
In formula, (n, i, j) represents (i, the j) of n-th piece individual position, and s illustrates that space adds up the parameter of effect, gets 0.25 by empirical value; A, b, c, r are that constant equals 1.33,0.11,0.18 and 0.6 respectively.φ
iand φ
jit is the normalization factor of dct transform
ω
ijit is frequency
(2) intensity modifier value F
lumfor:
In formula,
represent the mean flow rate of this macro block.
(3) contrast correction value F
contrastfor:
For the macro block F that plane, edge also have texture tri-kinds dissimilar
contrastaccording to above-mentioned formulae discovery.First, candy operator is used to find out marginal points all in image; Then, edge calculation dot density function ρ
edge=Σ edge/N
2; Then according to the value of two formulae discovery ψ below:
So just can obtain the contrast correction factor.
(4) time-domain correction value F
temporalfor:
F in above formula
ttemporal frequency, f
sit is spatial frequency.
(5) marking area correction value F
foveafor:
In above formula, κ (bg (k, i, j)) is background luminance function, and this background luminance function is as follows:
f
m(v,e)=min(f
c(e),f
d(v))
F
cdetermined by contrast sensitivity function, be set to maximum 1.0 herein; f
dbe display cut-off frequency, be set to the half of monitor resolution.Parameter e represents the distance of the saliency regional center that this position obtains to Part I.
Step 3, according to view-based access control model salient region just can examine distortion threshold calculate based on the perceived quality just can examining distortion model.
The present invention uses the calculating replacing distortion in original coding framework based on the perceived quality evaluation BMMF that just can examine distortion model, and this perceived quality evaluation BMMF is calculated as follows and obtains:
Wherein x is the index of judgement matrix, namely belongs to which macro block; Y represents the type belonging to this macro block, and Class1 represents smooth, and type 2 represents edge, and type 3 represents texture,
with
represent reference macroblock respectively and rebuild macro block; Q
xyrepresent the value of x macro block under y type evaluation criterion;
Q in above-mentioned formula is based on the perceived quality just can examining distortion model (perceived quality decision rule), and this perceived quality is obtained by PSNR-HA and PSNR-HMA two kinds of distortion criterion weightings;
then represent that distortion evaluation of estimate obtains weighted average, w
xyit is weight.For PSNR-HA and PSNR-HMA, this method has done following correction on the existing basis just can examining distortion model, and concrete modification method comprises following process:
(1) for given reference block A and distortion block B, the difference of both calculating
with
the mean value of reference block A and distortion block B coefficient respectively;
(2) correction matrix C=B+Delt is obtained;
(3) correction factor is calculated
(4) revised macro block D=C × ρ is calculated;
(5) calculating just can examine the revised distortion value MSE of distortion model
hVS, as follows:
Wherein coeff
o(i, j) and coeff
d(i, j) represents the pixel value of reference block and reconstructed block correspondence position respectively.What jnd (i, j) then represented second correspondence position calculated just can examine distortion threshold, and the distortion being greater than this thresholding is that human eye can be examined, and the distortion being less than this thresholding to be human eye imperceptible, at utmost can excavate perception redundancy like this;
(6) if M
1> M
2then
Finally obtain
MSE
HVS=M
1+Delt
2×coef3
In above-mentioned two formula, coef1, coef2, coef3 represent the modifying factor to perceptual error, get 0.002,0.25 and 0.04 respectively according to experiment experience;
(7) PSNR-HA can be obtained according to the above-mentioned perceived quality distortion calculated, as follows:
For coloured image, M is Y, Cr, Cb luminance component, the average distortion that the perceptual distortion weighting of two color components obtains, as shown in the formula calculating:
M=(M
Y+M
Cb×coef4+M
Cr×coef4)/(1+2×coef4)
M
y, M
cb, M
crbe a luminance component Y respectively, the perceptual distortion of two color components Cb, Cr, weight coefficient coef4 is 0.5.
Correction and the PSNR-HA of PSNR-HMA are similar, are all at calculating MSE
hVStime do corresponding correction with distortion model just can be examined, do not repeating at this.
Step 4, basis carry out rate-distortion optimization based on the perceived quality just can examining distortion model, find best coding mode.
Traditional rate-distortion optimization model is based on R-D model, and in HEVC, have employed R-λ model, and it is more accurate than R-D model.Just can examine perceived quality based on salient region of image incorporate wherein by what obtain in step 3 on the basis of R-λ model below, more be met the model of subjective quality, as follows:
In above formula, J is cost function, then λ=dQ/dR.For each macro block, calculation cost function:
j
1=q
1(QP
1)-λ·r
1(QP
1)for?coding?block#1
j
2=q
2(QP
2)-λ·r
2(QP
2)for?coding?block#2
……
j
N=q
N(QP
N)-λ·r
N(QP
N)for?coding?block#N
In above formula, QP is quantization step, and the target of optimization compares by searching for seemingly the coding mode obtaining making max{J} minimum.
Do a test according to method of the present invention below, experiment effect of the present invention is described.
Test environment: Visual Studio2010;
Cycle tests: select the video test sequence of three kinds of sizes as follows from HEVC official cycle tests:
832x480:BQMall,Basketball-Drill
1280x720:Johnny,FourPeople
1920x1080:Basketball-Drive,BQterrace
Test result is as follows:
Table one Y-PSNR (dB)
Table two code check (kbps)
Table three subjective testing standard
Table four subjective test results
Experiment conclusion
This experimental result chooses six HEVC standard cycle testss.Can to find out compared with HEVC reference software HM10.0 under the identical quantization parameter of same sequence (QP) value that Y-PSNR (PSNR) will low 1.13dB ~ 4.12dB according to table one, this can tolerate more noise under prerequisite that this technology remains unchanged at Subjective video quality is described.Under can obtaining identical QP value according to table two, compare original HEVC and use the present invention can obtain less bit rate, improve compression ratio.
In subjective test, original HM10.0 compressed video is placed on left side, compressed video of the present invention is put in right side, asks 30 observers to test according to the standard of table three, obtains the result of table four after statistical average.Can find out that compressed video of the present invention is generally better than HEVC primitive technology, especially under the condition of larger QP value qualitatively supervisor; And when little QP value because the distortion after primitive technology compression is very little, so the two subjective difference can be ignored substantially.
Through objective and subjective experiment, test result all shows compared with original HEVC coding techniques, the present invention can overcome mean square error MSE as the deficiency weighing video distortion evaluation criterion, more noise is tolerated under the prerequisite that subjective quality does not reduce, remove unnecessary perception redundancy, thus raising compression efficiency, reduce the code check of the rear file of coding.
It is emphasized that; embodiment of the present invention is illustrative; instead of it is determinate; therefore the present invention includes the embodiment be not limited to described in embodiment; every other execution modes drawn by those skilled in the art's technical scheme according to the present invention, belong to the scope of protection of the invention equally.