Summary of the invention
In order to solve the problem of prior art, the embodiment of the present invention provides a kind of method and apparatus that regulates coding parameter.Described technical scheme is as follows:
First aspect, provides a kind of method that regulates coding parameter, and described method comprises:
Collect each two field picture of output in Preset Time section;
The mean value of peak noise ratio and the mean value of structural similarity index of all images of output in the described Preset Time section that calculating is collected;
According to the mean value of the mean value of described peak noise ratio and described structural similarity index, current coding parameter is regulated.
In conjunction with first aspect, in the possible implementation of the first of first aspect, described coding parameter comprises resolution;
The described mean value according to the mean value of described peak noise ratio and described structural similarity index regulates current coding parameter, comprising:
The mean value of described peak noise ratio and the first reference field are compared, and the mean value of described structural similarity index and the second reference field are compared;
According to comparative result, the resolution in current coding parameter is regulated.
In conjunction with first aspect, in the possible implementation of the second of first aspect, describedly according to comparative result, the resolution in current coding parameter is regulated, comprising:
If the mean value of described peak noise ratio is greater than the upper limit of described the first reference field, and the mean value of structural similarity index is greater than the upper limit of described the second reference field, judges whether the resolution in current coding parameter is less than the first default resolution;
If the resolution in described current coding parameter is less than the first default resolution, improve the resolution in described current coding parameter according to the first default step-length.
In conjunction with first aspect, in the third possible implementation of first aspect, described coding parameter also comprises frame per second;
Described according to after the resolution in the described current coding parameter of default step-length raising, also comprise:
Judge whether the frame per second in current coding parameter is less than the upper limit of the 3rd reference field;
If the frame per second in described current coding parameter is less than the upper limit of described the 3rd reference field, improve the frame per second in described present encoding parameter according to the second default step-length.
In conjunction with first aspect, in the 4th kind of possible implementation of first aspect, describedly according to comparative result, the resolution in current coding parameter is regulated, comprising:
If the mean value of described peak noise ratio is less than the lower limit of described the first reference field, and the mean value of structural similarity index is less than the lower limit of described the second reference field, judges whether the resolution in current coding parameter is greater than the second default resolution;
If the resolution in described current coding parameter is greater than the described second default resolution, reduce the resolution in described current coding parameter according to the first default step-length;
Wherein, the described first default resolution is greater than the described second default resolution.
In conjunction with first aspect, in the 5th kind of possible implementation of first aspect, described coding parameter also comprises frame per second;
Described according to after the resolution in the described current coding parameter of default step-length reduction, also comprise:
Judge whether the frame per second in current coding parameter is greater than the lower limit of the 3rd reference field;
If the frame per second in described current coding parameter is greater than the lower limit of described the 3rd reference field, reduce the frame per second in described current coding parameter according to the second default step-length.
Second aspect, provides a kind of device that regulates coding parameter, and described device comprises:
Collection module, for collecting each two field picture of exporting in Preset Time section;
Computing module, for calculating the mean value of peak noise ratio and the mean value of structural similarity index of all images of exporting in the described Preset Time section of collecting;
The first adjustment module, for regulating current coding parameter according to the mean value of the mean value of described peak noise ratio and described structural similarity index.
In conjunction with second aspect, in the possible implementation of the first of second aspect, described the first adjustment module, comprising:
The first comparing unit, for the mean value of described peak noise ratio and the first reference field are compared, and compares the mean value of described structural similarity index and the second reference field;
The first regulon, for regulating the resolution of current coding parameter according to comparative result.
In conjunction with second aspect, in the possible implementation of the second of second aspect, described the first regulon, comprising:
The first judgment sub-unit, for be greater than when the mean value of described peak noise ratio that the upper limit of described the first reference field and the mean value of structural similarity index is greater than described the second reference field upper in limited time, judge whether the resolution in current coding parameter is less than the first default resolution;
First regulates subelement, when be less than the first default resolution when the resolution of described current coding parameter, according to the resolution in the described current coding parameter of the first default step-length raising.
In conjunction with second aspect, in the third possible implementation of second aspect, described device, also comprises:
The second adjustment module, for judging whether the frame per second of current coding parameter is less than the upper limit of the 3rd reference field; Prescribe a time limit when the frame per second in described current coding parameter is less than the upper of described the 3rd reference field, improve the frame per second in described present encoding parameter according to the second default step-length.
In conjunction with second aspect, in the 4th kind of possible implementation of second aspect, described the first regulon, comprising:
The second judgment sub-unit, for be less than the lower limit of described the first reference field when the mean value of described peak noise ratio, and the mean value of structural similarity index is less than the lower of described the second reference field prescribes a time limit, judge whether the resolution in current coding parameter is greater than the second default resolution;
Second regulates subelement, when be greater than the described second default resolution when the resolution of described current coding parameter, according to the resolution in the described current coding parameter of the first default step-length reduction;
Wherein, the described first default resolution is greater than the described second default resolution.
In conjunction with second aspect, in the 5th kind of possible implementation of second aspect, described device, also comprises:
The 3rd adjustment module, for judging whether the frame per second of current coding parameter is greater than the lower limit of the 3rd reference field; Prescribe a time limit when the frame per second in described current coding parameter is greater than the lower of described the 3rd reference field, reduce the frame per second in described current coding parameter according to the second default step-length.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
Due to peak noise than and structural similarity index can reflect exactly current image quality, therefore, the mean value of peak noise ratio of all images of exporting in the Preset Time section of collecting by calculating and the mean value of structural similarity index, and then according to the mean value of the mean value of peak noise ratio and structural similarity index, current coding parameter is regulated, make regulate after current coding parameter coded go out image quality quality better.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment mono-
The embodiment of the present invention provides a kind of method that regulates coding parameter, and referring to Fig. 1, the method flow that the embodiment of the present invention provides comprises:
101: each two field picture of collecting output in Preset Time section.
102: the mean value of peak noise ratio and the mean value of structural similarity index that calculate all images of output in the Preset Time section of collecting.
103: according to the mean value of the mean value of peak noise ratio and structural similarity index, current coding parameter is regulated.
As a kind of preferred embodiment, coding parameter comprises resolution;
According to the mean value of the mean value of peak noise ratio and structural similarity index, current coding parameter is regulated, comprising:
The mean value of peak noise ratio and the first reference field are compared, and the mean value of structural similarity index and the second reference field are compared;
According to comparative result, the resolution in current coding parameter is regulated.
As a kind of preferred embodiment, according to comparative result, the resolution in current coding parameter is regulated, comprising:
If the mean value of peak noise ratio is greater than the upper limit of the first reference field, and the mean value of structural similarity index is greater than the upper limit of the second reference field, judges whether the resolution in current coding parameter is less than the first default resolution;
If the resolution in current coding parameter is less than the first default resolution, improve the resolution in current coding parameter according to the first default step-length.
As a kind of preferred embodiment, coding parameter also comprises frame per second;
After improving the resolution in current coding parameter according to default step-length, also comprise:
Judge whether the frame per second in current coding parameter is less than the upper limit of the 3rd reference field;
If the frame per second in current coding parameter is less than the upper limit of the 3rd reference field, improve the frame per second in present encoding parameter according to the second default step-length.
As a kind of preferred embodiment, according to comparative result, the resolution in current coding parameter is regulated, comprising:
If the mean value of peak noise ratio is less than the lower limit of the first reference field, and the mean value of structural similarity index is less than the lower limit of the second reference field, judges whether the resolution in current coding parameter is greater than the second default resolution;
If the resolution in current coding parameter is greater than the second default resolution, reduce the resolution in current coding parameter according to the first default step-length;
Wherein, the first default resolution is greater than the second default resolution.
As a kind of preferred embodiment, coding parameter also comprises frame per second;
After reducing the resolution in current coding parameter according to default step-length, also comprise:
Judge whether the frame per second in current coding parameter is greater than the lower limit of the 3rd reference field;
If the frame per second in current coding parameter is greater than the lower limit of the 3rd reference field, reduce the frame per second in current coding parameter according to the second default step-length.
Due to peak noise than and structural similarity index can reflect exactly current image quality, therefore, the method that the embodiment of the present invention provides, the mean value of peak noise ratio of all images of exporting in the Preset Time section of collecting by calculating and the mean value of structural similarity index, and then according to the mean value of the mean value of peak noise ratio and structural similarity index, current coding parameter is regulated, make current coding parameter after regulating coded go out the quality of image quality better.
Embodiment bis-
Along with the development of computer technology, internet video live broadcasting enters into people's life gradually.In the time of internet video live broadcasting, because user under different video scene is different to the demand of image quality, and different coding parameters is determining different image quality, therefore, in order to promote user's visual experience, the embodiment of the present invention provides a kind of method that regulates coding parameter.For the ease of understanding, now comprise that take coding parameter resolution is as example in conjunction with the content of above-described embodiment one, the method for the adjusting coding parameter that the embodiment of the present invention is provided is at length explained.Referring to Fig. 2, the method flow that the embodiment of the present invention provides comprises:
201: each two field picture of collecting output in Preset Time section.
Because each two field picture of exporting in Preset Time section is the basis of subsequent adjustment coding parameter, therefore, in order to make can to regulate coding parameter in subsequent step, the method that the present embodiment provides need to be collected each two field picture of output in Preset Time section.
Wherein, Preset Time section can be 1 minute, 2 minutes, 5 minutes etc., and the embodiment of the present invention is not done concrete restriction to Preset Time section.About the mode of collecting each two field picture of exporting in Preset Time section, include but not limited to collect by gathering-device each two field picture of exporting in Preset Time section, and each two field picture that gathering-device is collected in Preset Time section each two field picture in the Preset Time section of collecting.
Due to each two field picture of exporting in the Preset Time section of collecting in this step, use follow-up will continuation when coding parameter is regulated, therefore, the method that the present embodiment provides, after collecting each two field picture of exporting in Preset Time section, also comprises the step that each two field picture of exporting in the Preset Time section of collecting is stored.About the mode of each two field picture of exporting in storage Preset Time section, the present embodiment is not done concrete restriction, includes but not limited to each two field picture of exporting in the Preset Time section of collecting to store in a queue.
202: the mean value of peak noise ratio and the mean value of structural similarity index that calculate all images of output in the Preset Time section of collecting.
Wherein, peak noise is than being the ratio that represents a signal maximum possible power and affect the destructive noise power of its expression precision.After process image compression; conventionally the image of output to a certain extent all can be different with original image, therefore, and in order to weigh the image quality of output; conventionally can calculate the peak noise ratio of the image of output, and then weigh the image quality of output according to the peak noise ratio obtaining.When concrete measurement, the value of peak noise ratio is larger, represents that distortion is fewer, and the image of output more approaches original image.Structural similarity index is the New Set of a kind of measurement two width image similarities.In being commonly used in image processing, in image denoising is processed, its value is larger, represents that the similarity of two width images is higher especially.
Although the peak noise of each two field picture ratio and structural similarity index can reflect the image quality of each two field picture, but in order to react more accurately current image quality, the method that the present embodiment provides need to be calculated the mean value of peak noise ratio and the mean value of structural similarity index of all images of output in the Preset Time section of collecting, so that subsequent step can regulate current coding parameter according to the mean value of peak noise ratio and the mean value of structural similarity index of all images of exporting in the Preset Time section of collecting of calculating.
The mean value of the peak noise ratio of all images of exporting in the Preset Time section of collecting about calculating, includes but not limited to following steps:
First, calculate the value of the peak noise ratio of each two field picture of output in the Preset Time section of collecting;
Secondly, by the peak noise of all images of collecting in Preset Time section than summation, obtain all images of collecting in Preset Time section peak noise ratio and;
Again, by the peak noise ratio of all images of collecting in the Preset Time section obtaining and with Preset Time section in the picture number collected make ratio, thereby can obtain the mean value of the peak noise ratio of all images of output in Preset Time section.
Particularly, when the value of the peak noise ratio of each two field picture of exporting in the Preset Time section of collecting in calculating, can adopt following formula to calculate.
Wherein, PSNR represents peak noise ratio, and MSE represents mean square deviation, and Framesize represents current resolution, I
nrepresent original image, I
nin n represent n pixel of original image, P
nrepresent the image of output, P
nin n represent the n pixel of image of output.
Take Framesize as 320 × 240 as example.When concrete calculating, first calculate between original image and the image of output from the difference of 320 × 240 pixels of the 1st pixel to the and, then by between the original image obtaining and the image of output from the difference of 320 × 240 pixels of the 1st pixel to the and do to compare with current resolution, obtain the mean square deviation MSE of the image of original image and output, and then the MSE obtaining is updated to peak noise than in the computing formula of PSNR, finally obtain the peak noise ratio of the image of output.
Further, when image coding due to employing coded system, the image of original image and output all will be broken down into Y, U and tri-components of V.Wherein, Y represents luminance signal, and U and V represent two carrier chrominance signals.Therefore, the peak noise that adopts the computing formula of above-mentioned peak noise ratio to calculate each two field picture than time, need to be by the peak noise of Y, U and these three components of V than calculating separately.
When the concrete peak noise that calculates Y, U and these three components of V compares, can set the peak noise of Y component than being Y_PSNR, the peak noise of U component is than being U_PSNR, the peak noise of V component is than being V_PSNR, then adopt the computing formula of above-mentioned peak noise ratio to calculate, difference be the peak noise that calculates Y, U and V component than time, the resolution difference of use.
Below still take Framesize as 320 × 240 as example.For Y_PSNR when concrete the calculating, Framesize is 320 × 240, for U_PSNR when concrete the calculating, Framesize is (320 × 240)/4, for V_PSNR, in the time specifically calculating, Framesize is (320 × 240)/4, after having determined Framesize, the computational process of the peak noise ratio of Y, U and V component, with the computational process of above-mentioned peak noise ratio, repeats no more herein.
After having calculated the peak noise ratio of the Y of each two field picture, U and V component, can adopt following formula to calculate for the peak noise ratio of each two field picture:
F_PSNR=(Y_PSNR*4+U_PSNR+V_PSNR)/6
Particularly, be that 20, U_PSNR is that 20, V_PSNR is 20 if calculate the Y_PSNR of a two field picture, according to above-mentioned formula, F_PSNR=(Y_PSNR*4+U_PSNR+V_PSNR)/6=(20*4+20+20)/6=20.
Further, after calculating the peak noise ratio of each two field picture, when the value of the peak noise ratio of all images of exporting in the Preset Time section of collecting in calculating, can adopt the method for the mean value of the peak noise ratio of all images of output in above-mentioned calculating Preset Time section to calculate.For example, if the image of collecting in Preset Time section has 4 frames, the value of the peak noise ratio of this 4 two field picture is respectively 20,30,25,25, and in Preset Time section, the mean value of the peak noise ratio of all images of output is (20+30+25+25)/4=25.
When the mean value of the structural likeness in form index of all images of exporting in the Preset Time section of collecting in calculating, because structure similarity index is defined as image to be independent of brightness from the angle of image composition, the attribute of object structures in contrast and reflection scene, be brightness by distortion modeling, the combination of contrast and three different factors of structure, and the estimation as brightness by average, the estimation that standard deviation is spent as a comparison, covariance is as the tolerance of structural similarity degree, therefore, when the mean value of the structural similarity index of all images of exporting in the Preset Time section of collecting in calculating, can directly calculate the mean value of the structural similarity index of all images.
In the time of structural similar index, can adopt following formula to calculate:
SSIM(x,y)=[l(x,y)]
α[c(x,y)]
β[s(x,y)]
γ
Wherein, x is original image signal, and y is the picture signal of output, SSIM (x, y) be the structural similarity index of x and y, l (x, y) is the relatively brightness of x and y, C (x, y) compares the contrast of x and y, σ (x, y) for comparing the structure of x and y, α >0, β >0, γ >0, for adjusting l (x, y), C (x, y), the parameter of σ (x, y) relative importance, μ
xand μ
y, σ
xand σ
ybe respectively mean value and the standard deviation of the pixel of x and y, σ
xyfor the co-variation heteromerism of the pixel of x and y, C
1, C
2, C
3be all constant, in order to maintain the stable of l (x, y), C (x, y), σ (x, y).
203: the mean value of peak noise ratio and the first reference field are compared, and the mean value of structural similarity index and the second reference field are compared.
Wherein, the first reference field is the scope that judges whether the pre-set peak value noise ratio that need to regulate resolution, and it has upper and lower bound.The size of the first reference field can be (28.5,36), can be also (38,40), and the present embodiment does not limit the size of the first reference field.The second reference field is the scope that judges whether the preset structure similarity indices that need to regulate resolution, and it has upper and lower bound equally.The size of the second reference field can be (0.1,0.5), can be also (0.6,0.89), and the present embodiment is not done concrete restriction to the size of the second reference field.
Because the mean value of peak noise ratio and the mean value of structural similarity index can react current image quality, therefore, the method that the present embodiment provides is by comparing the mean value of peak noise ratio and the first reference field, the mean value of structural similarity index and the second reference field are compared, so that can regulate current resolution according to the comparative result of this step in subsequent step.
The mean value of peak noise ratio and the first reference field are compared, the mean value of structural similarity index and the second reference field are compared, comparative result includes but not limited to following several situation:
The first situation: the mean value of peak noise ratio is greater than the upper limit of the first reference field, and the mean value of structural similar index is greater than the upper limit of the second reference field;
The second situation: the mean value of peak noise ratio is less than the lower limit of the first reference field, and the mean value of structural similarity index is less than the lower limit of the second reference field;
The third situation: the mean value of peak noise ratio is greater than the upper limit of the first reference field, and the mean value of structural similarity index is less than the lower limit of the second reference field;
The 4th kind of situation: the mean value of peak noise ratio is less than the lower limit of the first reference field, and the mean value of structural similarity index is greater than the upper limit of the second reference field.
204: according to comparative result, the resolution in current coding parameter is regulated.
Owing to the mean value of peak noise ratio and the first reference field being compared in above-mentioned steps 203, the mean value of structural similarity index and the second reference field are compared, therefore, this step will regulate the resolution in current coding parameter according to comparative result on the basis of above-mentioned steps 203.
The first situation: the mean value of peak noise ratio is greater than the upper limit of the first reference field, and the mean value of structural similarity index is greater than the upper limit of the second reference field;
For the first situation, be greater than the upper limit of the first reference field at the mean value of judging peak noise ratio, and when the mean value of structural similarity index is greater than the second reference field, in order to judge whether further to regulate current resolution, the method that the present embodiment provides also will judge whether the resolution in current coding parameter is less than the first default resolution, and then judges whether to regulate the resolution of current reality according to judged result.Wherein, the first default resolution can be 320 × 240,360 × 480 etc., and the present embodiment does not limit the size of the first default resolution.
While judging whether to regulate the resolution of current reality according to judged result, include but not limited to following two kinds of results:
The first result: if the resolution in current coding parameter is less than the first default resolution, improve the resolution in current coding parameter according to the first default step-length;
For the first result, when resolution in current coding parameter is less than the first default resolution, the image quality now showing according to current resolution is poor, in order to improve the image quality of demonstration, need to improve current resolution according to the first default step-length.But owing to limited by current business, every kind of business all has the upper limit resolution of permission, therefore, and in the time improving current resolution according to the first default step-length, be not the unlimited current resolution of raising, but till current resolution is brought up to upper limit resolution.
Wherein, the first default step-length can be 10 pixels, 20 pixels, 30 pixels etc., and the present embodiment is not done concrete restriction to the size of the first default step-length.
The second result: if the resolution in current coding parameter is greater than the first default resolution, no longer regulate current resolution.
For the second result, because the image quality now showing according to current resolution is better, therefore, without regulating current resolution.
For said process, will at length explain with a concrete example below for the ease of understanding.
For example, the first reference field is (10,35), and the second reference field is (0.3,0.8), and the first default resolution is 1024 × 960.If calculating the mean value of the peak noise ratio of all images of output in the Preset Time section of collecting is 38, the mean value of structural similar index is 0.9.The mean value of peak noise ratio and the first reference field are compared, when the mean value of structural similar index and the second reference field are compared, because the mean value 38 of peak noise ratio is greater than the upper limit 35 of the first reference field, the mean value 0.9 of structural similar index is greater than the upper limit 0.8 of the second reference field, in order to determine whether further to regulate current resolution, now need to judge whether the resolution in current coding parameter is less than the first default resolution.If the resolution in current coding parameter is 320 × 240, be less than 1024 × 960 due to 320 × 240, improve resolution in present encoding parameter to upper limit resolution according to the first default step-length; If the resolution in current coding parameter is 1024 × 1024, be greater than 1024 × 960 due to 1024 × 1024, now without the resolution regulating in present encoding parameter.
The second situation: the mean value of peak noise ratio is less than the lower limit of the first reference field, and the mean value of structural similarity index is less than the lower limit of the second reference field;
For the second situation, be less than the lower limit of the first reference field at the mean value of judging peak noise ratio, and when the mean value of structural similarity index is less than the second reference field, in order to judge whether further to regulate current resolution, the method that the present embodiment provides also will judge whether the resolution in current coding parameter is greater than the second default resolution, and then judges whether to regulate the resolution of current reality according to judged result.Wherein, the second default resolution can be 120 × 240,360 × 480 etc., but no matter the value of the second default resolution be how many, and second presets resolution is always less than first and presets resolution.
While judging whether to regulate the resolution of current reality according to judged result, include but not limited to following two kinds of results:
The first result: if the resolution in current coding parameter is greater than the second default resolution, reduce the resolution in current coding parameter according to the first default step-length;
For the first result, when resolution in current coding parameter is greater than the second default resolution, the image quality now showing according to current resolution is poor, in order to improve the image quality of demonstration, need to reduce current resolution according to the first default step-length.But owing to limited by current business, every kind of business has the lower limit resolution of permission, therefore, and in the time reducing current resolution according to the first default step-length, be not the unlimited current resolution of reduction, but by current decrease resolution till upper limit resolution.
The second result: if the resolution in current coding parameter is less than the second default resolution, the image quality now showing according to current resolution is better, without regulating current resolution.
For said process, will at length explain with a concrete example below for the ease of understanding.
For example, the first reference field is (23,35), and the second reference field is (0.5,0.9), and the second default resolution is 480 × 560.If calculating the mean value of the peak noise ratio of all images of output in the Preset Time section of collecting is 20, the mean value of structural similar index is 0.4, the mean value of peak noise ratio and the first reference field are compared, when the mean value of structural similar index and the second reference field are compared, because the mean value 20 of peak noise ratio is less than the upper limit 23 of the first reference field, the mean value 0.4 of structural similar index is less than the upper limit 0.5 of the second reference field, in order to determine whether further to regulate current resolution, now need to judge whether the resolution in current coding parameter is greater than the second default resolution.If the resolution in current coding parameter is 480 × 960, be greater than 480 × 560 due to 480 × 960, reduce resolution in present encoding parameter to lower limit resolution according to the first default step-length; If the resolution in current coding parameter is 320 × 240, be less than 480 × 560 due to 320 × 240, now without the resolution regulating in present encoding parameter.
The third situation: the mean value of peak noise ratio is less than the lower limit of the first reference field, and the mean value of structural similarity index is less than the lower limit of the second reference field;
For the third situation, owing to being less than the lower limit of the first reference field when the mean value of peak noise ratio, and the mean value of structural similarity index is less than the lower of the second reference field and prescribes a time limit, the image quality showing according to current resolution is better, therefore, for the third situation without regulating current resolution.
The 4th kind of situation: the mean value of peak noise ratio is less than the lower limit of the first reference field, and the mean value of structural similarity index is greater than the upper limit of the second reference field.
For the 4th kind of situation: owing to being less than the lower limit of the first reference field when the mean value of peak noise ratio, and the mean value of structural similarity index is greater than the upper of the second reference field and prescribes a time limit, the image quality showing according to current resolution is better, therefore, for the 4th kind of situation without regulating current resolution.
Said process is only to regulate resolution in coding parameter to be introduced as example, for the image quality that makes to show better, below by the basis of the resolution in above-mentioned adjusting coding parameter, to regulate frame per second in coding parameter to be introduced as example.Regulate the frame per second in parameter, include but not limited to following two kinds of situations:
The first situation: improving on the basis of the resolution in current coding parameter according to default step-length, regulate the frame per second in coding parameter, include but not limited to following mode:
Judge whether the frame per second in current coding parameter is less than the upper limit of the 3rd reference field;
If the frame per second in current coding parameter is less than the upper limit of the 3rd reference field, improve the frame per second in present encoding parameter according to the second default step-length.
Wherein, the 3rd reference field is the scope that judges whether the default frame per second that need to regulate frame per second, and it has upper and lower bound.The size of the 3rd reference field can be (10,20), can be also (50,70), and the present embodiment does not limit the size of the 3rd reference field.The second default step-length is 2,3,5 etc., and the present embodiment does not limit the size of the second default step-length.
It should be noted that, judge whether frame per second in current coding parameter be less than the 3rd reference field upper in limited time, if judge the upper limit that frame per second in current coding parameter is greater than the 3rd reference field, now, due to according to the image quality that shows of current frame per second better, therefore, without the frame per second regulating in coding parameter.
For said process, for the ease of understanding, will at length explain with a concrete example below.
For example, the 3rd reference field is (10,20).If the frame per second in current coding parameter is 16, be less than 20 due to 16, the frame per second in current coding parameter is less than the upper limit of the 3rd reference field, therefore, will improve the frame per second in present encoding parameter according to the second default step-length.
The second situation: reducing on the basis of the resolution in current coding parameter according to default step-length, regulate the frame per second in coding parameter, include but not limited to following mode:
Judge whether the frame per second in current coding parameter is greater than the lower limit of the 3rd reference field;
If the frame per second in current coding parameter is greater than the lower limit of the 3rd reference field, reduce the frame per second in current coding parameter according to the second default step-length.
It should be noted that, judge whether frame per second in current coding parameter be greater than the 3rd reference field lower in limited time, if the frame per second of judging in current coding parameter is less than the upper limit to three reference field, now, due to according to the image quality that shows of current frame per second better, therefore, without the frame per second regulating in coding parameter.
For said process, for the ease of understanding, will at length explain with a concrete example below.
For example, the 3rd reference field is (12,21).If the frame per second in current coding parameter is 15, be greater than 12 due to 15, the frame per second in current coding parameter is greater than the lower limit of the 3rd reference field, therefore, now will reduce the frame per second in present encoding parameter according to the second default step-length.
Due to peak noise than and structural similarity index can reflect exactly current image quality, therefore, the method that the embodiment of the present invention provides, the mean value of peak noise ratio of all images of exporting in the Preset Time section of collecting by calculating and the mean value of structural similarity index, and then according to the mean value of the mean value of peak noise ratio and structural similarity index, current coding parameter is regulated, make current coding parameter after regulating coded go out the quality of image quality better.
Embodiment tri-
The embodiment of the present invention provides a kind of device that regulates coding parameter, and this device is for the method for the adjusting coding parameter carrying out above-described embodiment one or embodiment bis-and provide.Referring to Fig. 3, this device comprises:
Collection module 301, for collecting each two field picture of exporting in Preset Time section;
Computing module 302, for calculating the mean value of peak noise ratio and the mean value of structural similarity index of all images of exporting in the Preset Time section of collecting;
The first adjustment module 303, for regulating current coding parameter according to the mean value of the mean value of peak noise ratio and structural similarity index.
Referring to Fig. 4, the first adjustment module 303, comprising:
The first comparing unit 3031, for the mean value of peak noise ratio and the first reference field are compared, and compares the mean value of structural similarity index and the second reference field;
The first regulon 3032, for regulating the resolution of current coding parameter according to comparative result.
Referring to Fig. 5, the first regulon 3032, comprising:
The first judgment sub-unit 30321, for be greater than when the mean value of peak noise ratio that the upper limit of the first reference field and the mean value of structural similarity index is greater than the second reference field upper in limited time, judge whether the resolution in current coding parameter is less than the first default resolution;
First regulates subelement 30322, while being less than the first default resolution, improves the resolution in current coding parameter according to the first default step-length for the resolution of current coding parameter.
Referring to Fig. 6, this device, also comprises:
The second adjustment module 304, for judging whether the frame per second of current coding parameter is less than the upper limit of the 3rd reference field; Prescribe a time limit when the frame per second in current coding parameter is less than the upper of the 3rd reference field, improve the frame per second in present encoding parameter according to the second default step-length.
Referring to Fig. 7, the first regulon 3032, comprising:
The second judgment sub-unit 30323, for be less than the lower limit of the first reference field when the mean value of peak noise ratio, and the mean value of structural similarity index is less than the lower of the second reference field prescribes a time limit, judge whether the resolution in current coding parameter is greater than the second default resolution;
Second regulates subelement 30324, when be greater than the second default resolution when the resolution of current coding parameter, preset step-length reduce the resolution in current coding parameter according to first.
Referring to Fig. 8, this device, also comprises:
The 3rd adjustment module 305, for judging whether the frame per second of current coding parameter is greater than the lower limit of the 3rd reference field; Prescribe a time limit when the frame per second in current coding parameter is greater than the lower of the 3rd reference field, reduce the frame per second in current coding parameter according to the second default step-length.
In sum, due to peak noise than and structural similarity index can reflect exactly current image quality, therefore, the device that the embodiment of the present invention provides, the mean value of peak noise ratio of all images of exporting in the Preset Time section of collecting by calculating and the mean value of structural similarity index, and then according to the mean value of the mean value of peak noise ratio and structural similarity index, current coding parameter is regulated, make current coding parameter after regulating coded go out the quality of image quality better.
It should be noted that: the device of the adjusting coding parameter that above-described embodiment provides is in the time regulating coding parameter, only be illustrated with the division of above-mentioned each functional module, in practical application, can above-mentioned functions be distributed and completed by different functional modules as required, the internal structure that is about to the device that regulates coding parameter is divided into different functional modules, to complete all or part of function described above.In addition, the device of the adjusting coding parameter that above-described embodiment provides belongs to same design with the embodiment of the method that regulates coding parameter, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can carry out the hardware that instruction is relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.