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 being further elaborated, for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.Should be appreciated that the specific embodiment that this place is described, only for explaining the present invention, not in order to limit the present invention.
The invention provides a kind of based on image generation monochrome information gradual change when, for a kind of novel coding strategy that illumination gradual change film source occurs.
The prerequisite of the method is: suppose that all images are the n bitmaps with identical resolution.
Conveniently represent, the n bitmap in full refers to that each pixel of image n bit unsigned integer represents.Suppose that current encoded frame and the first reference picture, the second reference picture are all n bitmaps, the brightness value of its all pixel forms the monochrome information of respective image, the U chromatic value of all pixels forms the U chrominance information of respective image, and the V chromatic value of all pixels forms the V chrominance information of respective image; Remember that line number, the columns of its monochrome information are respectively: height
y, width
y; Remember that line number, the columns of its U chrominance information are respectively: height
u, width
u; Remember that line number, the columns of its V chrominance information are respectively: height
v, width
v.
Embodiment 1, the invention provides a kind of method for video coding, and see Fig. 1, the method can be:
Step 101: obtain current encoded frame, and carry out initialization operation and note
t=0.
In the present invention, note
tfor current sign variable; When encoding, t is the coding sequence number of current encoded frame; When decoding, t then represents the Decoding Order Number of current decoded frame.
Step 102: judge whether current encoded frame is I frame or scene switch frame, if perform step 103; Then perform step 104 if not.
In the present invention, frame
tfor current encoded image; The decision method of this step Scene switch frame, belongs to prior art, is not repeated at this.
Step 103: utilize the second coding method (i.e. conventional I frame coding techniques) to frame
tencode, then perform step 105; Conventional I frame coding techniques described in this step refers to intra-frame coding techniques, does not have the concept of reference frame, does not carry out inter prediction, only carry out infra-frame prediction.
Step 104: utilize the first coding method to frame
tencode, then perform step 105.
Step 105: find next image to be encoded by coded sequence, judge whether next image to be encoded exists, then performs step 106 if not; If then, image to be encoded for the next one is set to current encoded image frame
t, re-execute step 101.
Step 106: process ends.
See Fig. 2, in said method, step 104 " utilizes the first coding method to frame
tencode " method can be:
Step 1041: initialization operation, namely arranges m=0, and m represents through the reference frame number of light gradient judgement.
Step 1042: judge frame
trelative to picture
ref1, picture
ref2whether there is monochrome information gradual change, if there is monochrome information gradual change, then perform step 1043; If there is not monochrome information gradual change, then perform step 1045.
Step 1043: make note
t=1;
In the present invention, picture
ref1be the first reference picture, picture
ref2it is the second reference picture.
Step 1044: arranging m is the first numerical value;
In step 1044, to arrange m be the method for the first numerical value can be:
Step 10441 judges whether picture
ref1coding sequence number and picture
ref2coding sequence number be all less than the coding sequence number of current encoded frame and picture
ref1, picture
ref2all encoded, if so, then perform step 10442; If not, then step 10443 is performed.
Step 10442: first make m=m+2, then performs step 1046.
Step 10443: judge whether picture
ref1coding sequence number and picture
ref2coding sequence number be all less than the coding sequence number of current encoded frame and picture
ref1, picture
ref2all uncoded, if so, then perform step 10444; If not, then step 10445 is performed.
Step 10444: first arrange m=m+2, then by picture
ref1, picture
ref2replace with the coding reconstructed image of its correspondence respectively, then perform step 1046.
Step 10445: first arrange m=m+1, is then less than the reference picture of current encoded frame coding sequence number, replaces with the coding reconstructed image of its correspondence by coding sequence number, another reference image setting is empty, then performs step 1046.
Step 1045: first arranging m is second value,
Namely to arrange m be the method for second value can be: m=m+sign (picture
ref1)+sign (picture
ref2), then perform step 1048
Wherein,
Sign (picture
ref1) represent picture
ref1be reference frame or be not reference frame time corresponding value;
Sign (picture
ref2) represent picture
ref2be reference frame or be not reference frame time corresponding value;
Step 1046: to the picture of non-NULL
ref1, non-NULL picture
ref2carry out the correction in the same way of monochrome information, obtain the correction parameter collection of the first reference picture, the second reference picture.
Step 1047: utilize the first reference picture of corrected in the same way non-NULL and the second reference picture of non-NULL to replace reference frame corresponding in reference listing.
Step 1048: judge that whether all reference frames of current encoded frame are all through the judgement of light gradient, namely determine whether
M>number
list0+ number
list1and frame
tfor B frame) or (m>number
list0and frame
tfor P frame), if so, then perform step 1049; If not, then execution step 1042 is reentered;
Wherein number
list0represent reference frame sum in forward direction reference listing; Number
list1represent reference frame sum in backward reference listing.
Step 1049: to frame
tin each macro block carry out conventional coded treatment flow process: carry out inter prediction, infra-frame prediction, rate-distortion optimization (RDO) model selection obtain optimum prediction mode, conversion, quantification and entropy code etc., finally complete frame
tcoding.
Conventional coded treatment flow process (refer to inter-frame coding techniques, have the concept of reference frame, predictive mode can be considered in interframe and frame) described in this step all belongs to the content of prior art, is not repeated at this.
Step 1050: judge whether " note
t=1 and optimum prediction mode is inter-frame forecast mode ", if then perform step 1051; As no execution step 105;
Step 1051: the first reference picture that in the optimum prediction mode confirmed in the conventional code processing method described in decoding end transmission step 1049, optimum reference frame is corresponding or the correction parameter collection of the second reference picture; Perform step 105;
Wherein, described " transmitting the correction parameter collection of the first reference picture corresponding to optimum reference frame in described optimum prediction mode or the second reference picture "; If the reference frame that namely the first reference picture is corresponding is optimum reference frame, then only transmit the correction parameter collection corresponding with the first reference picture, that is:
if carried out U, V chrominance information in the method further to correct in the same way, so correction parameter collection has comprised further
now decoding end
Wherein,
it is the first reference picture monochrome information adjustment factor;
represent picture
ref1minimum luminance value;
represent frame
tminimum luminance value;
it is the first reference picture U chrominance information adjustment factor;
represent picture
ref1minimum U chromatic value;
represent frame
tminimum U chromatic value;
it is the first reference picture V chrominance information degree adjustment factor;
represent frame
tminimum V chromatic value;
represent picture
ref1minimum V chromatic value;
be respectively the monochrome information adjustment factor of the corresponding reference frame of the current decoded frame that passes over from coding side, the minimum luminance value of the corresponding reference frame of current decoded frame, the minimum luminance value of original coding frame that current decoded frame is corresponding.
" frame is judged in step 1042
trelative to picture
ref1, picture
ref2whether there is monochrome information gradual change " method can be:
Step 10421: obtain the first reference picture and the second reference picture;
In this step, the method choosing the first reference picture and the second reference picture can be:
(1) choose satisfied sequence number of playing and be less than the image of current encoded frame broadcasting sequence number as the first reference picture;
(2) choose satisfied sequence number of playing and be greater than the image of current encoded frame broadcasting sequence number as the second reference picture.
(3) same current encoded frame frame
t, the first corresponding reference picture and the second reference picture can not be used to " judge frame simultaneously
trelative to picture
ref1, picture
ref2whether there is monochrome information gradual change " judgement.That is, for same current encoded frame, carry out " judging frame
trelative to picture
ref1, picture
ref2whether there is monochrome information gradual change " time, the first reference picture and the second reference picture can not simultaneously " being selected ".
Step 10422: whether the first reference picture described in judgement and the second reference picture meet reference picture standard; Then re-execute step 10421 if not; If then perform step 10423;
Above-mentioned determination methods can be:
Judge whether the first reference picture and the second reference picture meet following condition simultaneously:
(1) first reference picture has identical encoding state with the second reference picture, i.e. the first reference picture and the second reference picture or all encoded, or does not all encode;
The coding sequence number of (2) first reference pictures and the coding sequence number of the second reference picture can not be greater than the coding sequence number of current encoded frame simultaneously.
Step 10423: obtain current encoded frame frame
tthe probability distribution of monochrome information:
The probability distribution method of described acquisition current encoded frame monochrome information can be:
Wherein,
Wherein, y represents monochrome information;
represent current encoded frame frame
tmonochrome information;
represent the pixel value of the image luminance information being positioned at current encoded frame i-th row jth row;
represent
corresponding value when equaling k and be not equal to k; Sum (variable | condition) represent all variable summations satisfied condition;
represent frame
tthe pixel value of middle monochrome information equals the pixel number of k;
for
probability distribution; The present invention supposes that all images are the n bitmaps with identical resolution.The monochrome information of the brightness value composing images of all pixels of image, line number, the columns of note image luminance information are respectively: height
y, width
y.N bitmap in the present invention refers to that each pixel of image n bit unsigned integer represents.
Step 10424: the probability distribution obtaining the first reference picture monochrome information, and the probability distribution of the second reference picture monochrome information.
In this step, the probability distribution method obtaining the first reference picture monochrome information can be:
Wherein,
Wherein, y represents monochrome information;
represent the first reference picture picture
ref1monochrome information;
represent the pixel value of the image luminance information being positioned at the first reference picture i-th row jth row;
represent
corresponding value when equaling k and be not equal to k; Sum (variable | condition) represent all variable summations satisfied condition;
represent picture
ref1the pixel value of middle monochrome information equals the pixel number of k;
for
probability distribution; The present invention supposes that all images are the n bitmaps with identical resolution.The monochrome information of the brightness value composing images of all pixels of image, line number, the columns of note image luminance information are respectively: height
y, width
y.N bitmap in the present invention refers to that each pixel of image n bit unsigned integer represents.
In this step, the probability distribution method obtaining the second reference picture monochrome information can be:
Wherein,
Wherein, y represents monochrome information;
represent the second reference picture picture
ref2monochrome information;
represent the pixel value of the image luminance information being positioned at the second reference picture i-th row jth row;
represent
corresponding value when equaling k and be not equal to k; Sum (variable | condition) represent all variable summations satisfied condition;
represent picture
ref2the pixel value of middle monochrome information equals the pixel number of k;
for
probability distribution; The present invention supposes that all images are the n bitmaps with identical resolution.The monochrome information of the brightness value composing images of all pixels of image, line number, the columns of note image luminance information are respectively: height
y, width
y.N bitmap in the present invention refers to that each pixel of image n bit unsigned integer represents.
Step 10425: whether the probability distribution determination current encoded frame according to the monochrome information of the current encoded frame obtained, the first reference picture, the second reference picture monochrome information gradual change occurs.
In this step, determine that the method whether current encoded frame monochrome information gradual change occurs can be:
Judge whether
Or
If so, then frame
trelative to picture
ref1, picture
ref2there is monochrome information gradual change;
If not, then frame
trelative to picture
ref1, picture
ref2there is not monochrome information gradual change.;
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized; Y represents monochrome information;
represent the second reference picture picture
ref2monochrome information;
for
probability distribution;
represent the first reference picture picture
ref1monochrome information;
for
probability distribution.
" to the picture of non-NULL in above-mentioned steps 1046
ref1, non-NULL picture
ref2carry out monochrome information, correction in the same way, obtain the correction parameter collection of the first reference picture, the second reference picture " method can be:
Step 10461: the first reference picture picture carrying out non-NULL
ref1, non-NULL the second reference picture picture
ref2monochrome information corrects in the same way, and bearing calibration is carried out as follows:
Step 104611: first, calculates current encoded frame frame
tmonochrome information be worth most:
In full,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent frame
tmaximum brightness value;
represent frame
tminimum luminance value;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
Represent frame
tmaximum brightness value;
represent frame
tminimum luminance value;
Step 104612: then, calculates the first reference picture picture of non-NULL
ref1and the second reference picture picture of non-NULL
ref2monochrome information be worth most:
In full,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent picture
ref1maximum brightness value;
represent picture
ref1minimum luminance value;
represent picture
ref2maximum brightness value;
represent picture
ref2minimum luminance value;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum given,
in other words
0≤k≤2
nmake in-1
reach the k value of maximum, namely
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
represent picture
ref1maximum brightness value;
represent picture
ref1minimum luminance value;
represent picture
ref2maximum brightness value;
represent picture
ref2minimum luminance value.
Step 104613: monochrome information is carried out to the brightness value of the first reference picture of non-NULL and each pixel of the second reference picture of non-NULL and corrects in the same way:
Wherein,
The span of i, j is: 1≤i≤height
yaMP.AMp.Amp & 1≤j≤width
y;
it is the first reference picture monochrome information adjustment factor;
it is the second reference picture monochrome information adjustment factor; T1, T2 represent the coding sequence number of the corresponding reference frame of the first reference picture, the coding sequence number of the corresponding reference frame of the second reference picture respectively; Correction parameter collection is:
After carrying out above-mentioned several step, the correction parameter collection of the first reference picture, the second reference picture can be obtained.
In full,
be respectively the monochrome information of the first reference picture, pixel value that the monochrome information of the second reference picture arranges in the i-th row jth;
be respectively the pixel value that monochrome information corrects the rear monochrome information of the first reference picture in the same way, the monochrome information of the second reference picture arranges in the i-th row jth.
In step 1046, in order to better realize the correction in the same way of reference picture, the first reference picture picture of non-NULL can also be carried out further
ref1, non-NULL the second reference picture picture
ref2u chrominance information correct in the same way and correct in the same way with V chrominance information; Correction parameter collection increases the correction parameter collection of U, V chrominance information accordingly.
Step 10462: carry out U chrominance information and correct in the same way, bearing calibration is carried out as follows:
Utilize the monochrome information bearing calibration in the same way of step step 10461 above, carry out U chrominance information and correct in the same way, only with the correlated variables correlated variables of all brightness being replaced to U colourity.
Step 104621: first, calculates current encoded frame frame
tu chrominance information be worth most:
In full,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent frame
tmaximum U chromatic value;
represent frame
tminimum U chromatic value;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
represent frame
tmaximum U chromatic value;
represent frame
tminimum U chromatic value;
Step 104622: then, calculates the first reference picture picture of non-NULL
ref1and the second reference picture picture of non-NULL
ref2u chrominance information be worth most:
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent picture
ref1maximum U chromatic value;
represent picture
ref1minimum U chromatic value;
represent picture
ref2maximum U chromatic value;
represent picture
ref2minimum U chromatic value;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach the k value of maximum, namely
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
represent picture
ref1maximum U chromatic value;
represent picture
ref1minimum U chromatic value;
represent picture
ref2maximum U chromatic value;
represent picture
ref2minimum U chromatic value;
Step 104623: U chrominance information is carried out to the U chrominance information of the first reference picture of non-NULL and each pixel of the second reference picture of non-NULL and corrects in the same way:
Wherein,
Wherein, the span of i, j is: 1≤i≤height
uaMP.AMp.Amp & 1≤j≤width
u;
it is the first reference picture U chrominance information adjustment factor;
it is the second reference picture U chrominance information adjustment factor; T1, T2 represent the coding sequence number of the corresponding reference frame of the first reference picture, the coding sequence number of the corresponding reference frame of the second reference picture respectively; Accordingly, described " correction parameter collection " comprises the correction parameter collection of U chrominance information further
In full,
be respectively the U chrominance information of the first reference picture, pixel value that the U chrominance information of the second reference picture arranges in the i-th row jth;
be respectively the pixel value that U chrominance information corrects the rear U chrominance information of the first reference picture in the same way, the U chrominance information of the second reference picture arranges in the i-th row jth.
Step 10463: then, carry out V chrominance information and correct in the same way, bearing calibration is carried out as follows:
Utilize the monochrome information bearing calibration in the same way of step 10461 above, carry out V chrominance information and correct in the same way, only with the correlated variables correlated variables of all brightness being replaced to V colourity.
Step 104631: first, calculates current encoded frame frame
tv chrominance information:
In full,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent frame
tmaximum V chromatic value;
represent frame
tminimum V chromatic value;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
represent frame
tmaximum V chromatic value;
represent frame
tminimum V chromatic value.
Step 104632: then, calculates the first reference picture picture of non-NULL
ref1and the second reference picture picture of non-NULL
ref2v chrominance information be worth most:
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent picture
ref1maximum V chromatic value;
represent picture
ref1minimum V chromatic value;
represent picture
ref2maximum V chromatic value;
represent picture
ref2minimum V chromatic value;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach the k value of maximum, namely
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
represent picture
ref1maximum V chromatic value;
represent picture
ref1minimum V chromatic value;
represent picture
ref2maximum V chromatic value; Represent picture
ref2minimum V chromatic value;
Step 104633: V chrominance information is carried out to the V chrominance information of the first reference picture of non-NULL and each pixel of the second reference picture of non-NULL and corrects in the same way:
Wherein,
The span of i, j is: 1≤i≤height
vaMP.AMp.Amp & 1≤j≤width
v;
it is the first reference picture V chrominance information degree adjustment factor;
it is the second reference picture V chrominance information degree adjustment factor; T1, T2 represent the coding sequence number of the corresponding reference frame of the first reference picture, the coding sequence number of the corresponding reference frame of the second reference picture respectively; Accordingly, described correction parameter collection " comprise further: the correction parameter collection of V chrominance information
represent frame
tmaximum V chromatic value;
represent frame
tminimum V chromatic value.
be respectively the V chrominance information of the first reference picture, pixel value that the monochrome information of the second reference picture arranges in the i-th row jth;
be respectively the pixel value that V chrominance information corrects the rear V chrominance information of the first reference picture in the same way, the V chrominance information of the second reference picture arranges in the i-th row jth.
Embodiment 2, corresponding to above-mentioned method for video coding, the present invention also provides a kind of video encoding/decoding method, and see Fig. 3, the method is:
Step 201: the correction parameter collection obtaining current decoded frame and the first reference picture or the second reference picture;
Step 202: judge whether that described current sign variable is 0, if not, then performs step 204; If then perform step 203;
Step 203: carry out regular decode, then performs step 206;
Step 204: the correction in the same way being carried out monochrome information by the reference frame of the correction parameter set pair current decoded frame of the first described reference picture or the second reference picture;
Step 205: utilize the reference frame of corrected in the same way current decoded frame to carry out regular decode to current decoded frame;
Step 206: whether the current decoded frame described in judgement is last frame to be decoded of current video sequence, is then set to current decoded frame if not and performs step 201 by frame to be decoded for the next one; If then perform step 207;
Step 207: process ends.
Pass through the correction parameter collection of the first described reference picture or the second reference picture in step 204, the method corrected in the same way of the reference frame of current decoded frame being carried out to monochrome information can be:
Wherein, the span of i, j is: 1≤i≤height
yaMP.AMp.Amp & 1≤j≤width
y;
for the pixel value that the monochrome information of the reference frame of current decoded frame arranges in the i-th row jth;
the pixel value that the monochrome information correcting the reference frame of rear current decoded frame in the same way for monochrome information arranges in the i-th row jth;
be respectively the monochrome information adjustment factor of the corresponding reference frame of the current decoded frame that passes over from coding side, the minimum luminance value of the corresponding reference frame of current decoded frame, the minimum luminance value of original coding frame that current decoded frame is corresponding.
When having carried out U, V chrominance information timing in the same way in coding method, coding/decoding method adaptive increase should carry out to the reference frame of current decoded frame the process that U, V chrominance information corrects in the same way:
(1) reference frame to current decoded frame described in carries out the method that U chrominance information corrects in the same way and is specially:
Wherein, the span of i, j is: 1≤i≤height
uaMP.AMp.Amp & 1≤j≤width
u;
for the pixel value that the U chrominance information of the reference frame of current decoded frame arranges in the i-th row jth;
the pixel value that the U chrominance information correcting the reference frame of rear current decoded frame in the same way for U chrominance information arranges in the i-th row jth;
be respectively the U chrominance information degree adjustment factor of the corresponding reference frame of the current decoded frame that passes over from coding side, the minimum U chromatic value of the corresponding reference frame of current decoded frame, the minimum U chromatic value of original coding frame that current decoded frame is corresponding.
(2) described in " V chrominance information carried out to the reference frame of current decoded frame correct in the same way " method be specially:
Wherein, the span of i, j is: 1≤i≤height
vaMP.AMp.Amp & 1≤j≤width
v;
for the pixel value that the V chrominance information of the reference frame of current decoded frame arranges in the i-th row jth;
the pixel value that the V chrominance information correcting the reference frame of rear current decoded frame in the same way for V chrominance information arranges in the i-th row jth;
be respectively the V chrominance information degree adjustment factor of the corresponding reference frame of the current decoded frame that passes over from coding side, the minimum V chromatic value of the corresponding reference frame of current decoded frame, the minimum V chromatic value of original coding frame that current decoded frame is corresponding.
Embodiment 3, see Fig. 4; Corresponding to embodiment 1, the present invention also provides a kind of video decoder, and this device comprises: the first acquiring unit, the first processing unit, the second processing unit;
First acquiring unit, for obtaining frame
t(current encoded frame), and note is set
t=0, note
tfor current sign variable;
First processing unit, comprises the first judging unit and the 3rd processing unit and the 11 processing unit;
Described first judging unit, for judging whether current encoded frame is I frame or scene switch frame;
Described 3rd processing unit, for when the first judging unit judged result is no, then utilizes the first coding method to frame
tencode;
11 processing unit, for when the judged result of the first judging unit is for being, utilizes the second coding method to frame
tencode;
Second processing unit, finding next image to be encoded for pressing coded sequence, if next image to be encoded exists, then image to be encoded for the next one being set to frame
t, notice execution first acquiring unit, if next image to be encoded does not exist, then process ends process.
(1) see Fig. 5, the 3rd described processing unit comprises the first setting unit, fourth processing unit, correcting unit, replacement unit, the 5th processing unit;
Described first setting unit, arrange m=0, m represents relative to frame
tthrough the reference frame number of light gradient judgement;
Described fourth processing unit, comprises the second judging unit and the second setting unit;
Described second judging unit, for judging frame
trelative to picture
ref1(the first reference picture), picture
ref2whether (the second reference picture) there is monochrome information gradual change;
Described second setting unit, for making note when the second judging unit judged result for the gradual change of generation monochrome information is then arranged
t=1; Arranging m is the first numerical value;
Correcting unit, for the picture to non-NULL
ref1, non-NULL picture
ref2carry out the correction in the same way of monochrome information, obtain the correction parameter collection of a reference picture, the second reference picture;
Replacement unit, for utilizing the picture of corrected in the same way non-NULL
ref1and the picture of non-NULL
ref2replace reference frame corresponding in reference listing;
5th processing unit, comprises the 3rd judging unit, the 6th processing unit,
Described 3rd judging unit, for judging that whether all reference frames of current encoded frame are all through the judgement of light gradient, perform the second judging unit if not, if perform the 6th processing unit;
Described 6th processing unit, to frame
tin each macro block carry out conventional coded treatment; Judge whether " note
t=1 and optimum prediction mode is inter-frame forecast mode ", then perform the second processing unit if not; If so, the first reference picture that in the optimum prediction mode confirmed in " conventional coded treatment " described in then transmitting to video decoder, optimum reference frame is corresponding or the correction parameter collection of the second reference picture, perform the second processing unit;
If so, then to frame
tin each macro block carry out conventional coded treatment; Judge whether " note
t=1 and optimum prediction mode is inter-frame forecast mode ", then notify if not the second processing unit " by coded sequence find next image to be encoded "; If so, the correction parameter collection of the first reference picture that in the optimum prediction mode confirmed in described " conventional coded treatment ", optimum reference frame is corresponding or the second reference picture is then transmitted.
(2) described second judging unit comprises second acquisition unit, the 4th judging unit, the 7th processing unit, the first determining unit:
Second acquisition unit, for obtaining picture
ref1with picture
ref2;
4th judging unit, for judging described picture
ref1and picture
ref2whether meet reference picture standard;
7th processing unit comprises the 8th processing unit, the 9th processing unit;
8th processing unit is no for the judged result when the 4th judging unit, then notice performs second acquisition unit;
9th processing unit, is yes for the judged result when the 4th judging unit, then obtains frame
tthe probability distribution of monochrome information; Obtain picture
ref1the probability distribution of monochrome information, and picture
ref2the probability distribution of monochrome information;
First determining unit, whether the probability distribution determination current encoded frame for the monochrome information according to the current encoded frame obtained, the first reference picture, the second reference picture there is monochrome information gradual change.
(3) described second acquisition unit comprises: first chooses unit, second chooses unit, the 3rd and choose unit, the second determining unit;
First chooses unit, is less than the image of current encoded frame broadcasting sequence number as the first reference picture for choosing satisfied sequence number of playing;
Second chooses unit, is greater than the image of current encoded frame broadcasting sequence number as the second reference picture for choosing satisfied sequence number of playing.
3rd chooses unit, for same current encoded frame frame
t, the first corresponding reference picture and the second reference picture can not be used to " judge frame simultaneously
trelative to picture
ref1, picture
ref2whether there is monochrome information gradual change " judgement.
(4) described fourth processing unit comprises the 5th judging unit, the 6th judging unit, the 7th judging unit;
5th judging unit, for judging picture
ref1and picture
ref2whether meet the condition of the 6th judging unit and the 7th judging unit simultaneously:
6th judging unit, for determining picture
ref1with picture
ref2there is identical encoding state, i.e. the first reference picture and the second reference picture or all encoded, or all do not encode;
7th judging unit, for determining picture
ref1coding sequence number and picture
ref2coding sequence number can not be greater than frame simultaneously
tcoding sequence number.
(5) the 9th processing unit described in comprises the 3rd acquiring unit, the 4th acquiring unit, the 5th acquiring unit;
3rd acquiring unit, for " obtaining frame
tthe probability distribution of monochrome information " be:
Wherein,
Y represents monochrome information;
represent current encoded frame frame
tmonochrome information;
represent the pixel value of the image luminance information being positioned at current encoded frame i-th row jth row;
represent
corresponding value when equaling k and be not equal to k; Sum (variable | condition) represent all variable summations satisfied condition;
represent frame
tthe pixel value of middle monochrome information equals the pixel number of k;
for
probability distribution; The monochrome information of the brightness value composing images of all pixels of image, line number, the columns of note image luminance information are respectively: height
y, width
y;
4th acquiring unit, for " obtaining the probability distribution of the first reference picture monochrome information ":
Wherein,
Y represents monochrome information;
represent the first reference picture picture
ref1monochrome information;
represent the pixel value of the image luminance information being positioned at the first reference picture i-th row jth row;
represent
corresponding value when equaling k and be not equal to k; Sum (variable | condition) represent all variable summations satisfied condition;
represent picture
ref1the pixel value of middle monochrome information equals the pixel number of k;
for
probability distribution; The monochrome information of the brightness value composing images of all pixels of image, line number, the columns of note image luminance information are respectively: height
y, width
y.N bitmap in the present invention refers to that each pixel of image n bit unsigned integer represents;
5th acquiring unit, for " obtaining the probability distribution of the second reference picture monochrome information ":
Wherein,
Wherein, y represents monochrome information;
represent the second reference picture picture
ref2monochrome information;
represent the pixel value of the image luminance information being positioned at the second reference picture i-th row jth row;
represent
corresponding value when equaling k and be not equal to k; Sum (variable | condition) represent all variable summations satisfied condition;
represent picture
ref2the pixel value of middle monochrome information equals the pixel number of k;
for
probability distribution; The monochrome information of the brightness value composing images of all pixels of image, line number, the columns of note image luminance information are respectively: height
y, width
y.
(7) the first determining unit described in comprises the 8th judging unit, the second determining unit:
8th judging unit, for judging whether
Or
Second determining unit is yes for working as the 8th judging unit judged result, then frame
trelative to picture
ref1, picture
ref2there is monochrome information gradual change; Ruo Dang eight judging unit judged result is no, then frame
trelative to picture
ref1, picture
ref2there is not monochrome information gradual change;
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized; Y represents monochrome information;
represent the second reference picture picture
ref2monochrome information;
for
probability distribution;
represent the first reference picture picture
ref1monochrome information;
for
probability distribution.
(8) correcting unit described in comprises monochrome information correcting unit, and wherein monochrome information correcting unit comprises: the first computing unit, the second computing unit, the 3rd computing unit;
First computing unit, for calculating current encoded frame frame
tmonochrome information be worth most;
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
represent frame
tmaximum brightness value;
represent frame
tminimum luminance value;
Second computing unit, for calculating the first reference picture picture of non-NULL
ref1and the second reference picture picture of non-NULL
ref2monochrome information be worth most;
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
represent picture
ref1maximum brightness value;
represent picture
ref1minimum luminance value;
represent picture
ref2maximum brightness value;
represent picture
ref2minimum luminance value;
3rd computing unit, for calculating the first reference picture picture of non-NULL
ref1and the second reference picture picture of non-NULL
ref2monochrome information be worth most, obtain the correction parameter collection of a reference diagram or the second reference picture;
Wherein,
The span of i, j is: 1≤i≤height
yaMP.AMp.Amp & 1≤j≤width
y;
it is the first reference picture monochrome information adjustment factor;
it is the second reference picture monochrome information adjustment factor; T1, T2 represent the coding sequence number of the corresponding reference frame of the first reference picture, the coding sequence number of the corresponding reference frame of the second reference picture respectively; Correction parameter collection is:
max (variable | condition) represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
be respectively the monochrome information of the first reference picture, pixel value that the monochrome information of the second reference picture arranges in the i-th row jth;
be respectively the pixel value that monochrome information corrects the rear monochrome information of the first reference picture in the same way, the monochrome information of the second reference picture arranges in the i-th row jth.
(9), described correcting unit comprises U chrominance information correcting unit and V chrominance information correcting unit further;
U chrominance information correcting unit, for the picture to non-NULL
ref1, non-NULL picture
ref2carry out U chrominance information to correct in the same way
V chrominance information correcting unit, for the picture to non-NULL
ref1, non-NULL picture
ref2carry out V chrominance information to correct in the same way.
Described U chrominance information correcting unit comprises the 4th computing unit, the 5th computing unit, the 6th computing unit;
4th computing unit, for calculating frame
tu chrominance information be worth most:
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
represent frame
tmaximum U chromatic value;
represent frame
tminimum U chromatic value;
5th computing unit, for calculating the picture of non-NULL
ref1and the picture of non-NULL
ref2u chrominance information be worth most:
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach the k value of maximum, namely
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
represent picture
ref1maximum U chromatic value;
represent picture
ref1minimum U chromatic value;
represent picture
ref2maximum U chromatic value;
represent picture
ref2minimum U chromatic value;
6th computing unit, for the picture to non-NULL
ref1and the picture of non-NULL
ref2the U chrominance information of each pixel is carried out U chrominance information and is corrected in the same way:
Wherein,
The span of i, j is: 1≤i≤height
uaMP.AMp.Amp & 1≤j≤width
u;
it is the first reference picture U chrominance information adjustment factor;
it is the second reference picture U chrominance information adjustment factor; T1, T2 represent the coding sequence number of the corresponding reference frame of the first reference picture, the coding sequence number of the corresponding reference frame of the second reference picture respectively; Described correction parameter collection comprises further: the correction parameter collection of U chrominance information
be respectively the U chrominance information of the first reference picture, pixel value that the U chrominance information of the second reference picture arranges in the i-th row jth;
be respectively the pixel value that U chrominance information corrects the rear U chrominance information of the first reference picture in the same way, the U chrominance information of the second reference picture arranges in the i-th row jth).
(10) V chrominance information correcting unit comprises the 7th computing unit, the 8th computing unit, the 9th computing unit;
7th computing unit, for calculating frame
tv chrominance information:
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent and first meet all
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
represent frame
tmaximum V chromatic value;
represent frame
tminimum V chromatic value;
8th computing unit, for calculating the picture of non-NULL
ref1and the picture of non-NULL
ref2v chrominance information be worth most:
Wherein,
represent all variable maximizings satisfied condition; Min (variable | condition) represent and all variablees satisfied condition are minimized;
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach the k value of maximum, namely
represent and first meet 0≤k≤2 to all
n-1
ask for maximum, then k assignment corresponding for maximum is given
in other words
0≤k≤2
nmake in-1
reach maximum k value, namely
represent picture
ref1maximum V chromatic value;
represent picture
ref1minimum V chromatic value;
represent picture
ref2maximum V chromatic value; Represent picture
ref2minimum V chromatic value;
9th computing unit, for the picture to non-NULL
ref1and the picture of non-NULL
ref2the V chrominance information of each pixel is carried out V chrominance information and is corrected in the same way:
Wherein,
The span of i, j is: 1≤i≤height
vaMP.AMp.Amp & 1≤j≤width
v;
it is the first reference picture V chrominance information degree adjustment factor;
it is the second reference picture V chrominance information degree adjustment factor; T1, T2 represent the coding sequence number of the corresponding reference frame of the first reference picture, the coding sequence number of the corresponding reference frame of the second reference picture respectively; Described correction parameter collection comprises further: the correction parameter collection of V chrominance information
be respectively the V chrominance information of the first reference picture, pixel value that the monochrome information of the second reference picture arranges in the i-th row jth;
be respectively the pixel value that V chrominance information corrects the rear V chrominance information of the first reference picture in the same way, the V chrominance information of the second reference picture arranges in the i-th row jth.
(11) the first setting unit described in comprises: the 9th judging unit, the tenth processing unit;
9th judging unit, for judging whether picture
ref1coding sequence number and picture
ref2coding sequence number be all less than the coding sequence number of current encoded frame and picture
ref1, picture
ref2all encoded;
First tenth processing unit, for being yes when the 9th judging unit judged result, then make m=m+2, then notifies that monochrome information correcting unit continues " to the picture of non-NULL
ref1, non-NULL picture
ref2carry out the correction in the same way of monochrome information ";
When the 9th judging unit judged result is no, then judge whether picture
ref1coding sequence number and picture
ref2coding sequence number be all less than the coding sequence number of current encoded frame and picture
ref1, picture
ref2all uncoded, if so, then first m=m+2 is set, then by picture
ref1, picture
ref2replace with the coding reconstructed image of its correspondence respectively, then continue " to the picture of non-NULL
ref1, non-NULL picture
ref2carry out the correction in the same way of monochrome information "; If not, then m=m+1 is set, then coding sequence number is less than the first or second reference picture of current encoded frame coding sequence number, replace with the coding reconstructed image of its correspondence, another first or second reference image setting is empty, then notifies that monochrome information correcting unit continues " to the picture of non-NULL
ref1, non-NULL picture
ref2carry out the correction in the same way of monochrome information ".
(12), described fourth processing unit comprises the 3rd setting unit further;
3rd setting unit comprises the 4th setting unit and the first notification unit;
4th setting unit, for when the second judging unit judged result is not for monochrome information gradual change occurs, then arranging m is second value;
m=m+sign(picture
ref1)+sign(picture
ref2),
Wherein,
Wherein, m represents relative to frame
tthrough the reference frame number of light gradient judgement; Sign (picture
ref1) represent picture
ref1be reference frame or be not reference frame time corresponding value; Sign (picture
ref2, k) represent picture
ref2be reference frame or be not reference frame time corresponding value;
First notification unit, for arranging after m is second value, notifies that the second judging unit continues " judging that whether all reference frames of current encoded frame are all through the judgement of light gradient ".
(13), the 3rd described judging unit, " judging that whether all reference frames of current encoded frame are all through the judgement of light gradient " is specially;
M>number
list0+ number
list1and frame
tfor B frame) or (m>number
list0and frame
tfor P frame);
Wherein, m represents relative to frame
tthrough the reference frame number of light gradient judgement; Number
list0represent reference frame sum in forward direction reference listing; Number
list1represent reference frame sum in backward reference listing.
Corresponding to embodiment 4, see Fig. 6, the present invention also provides a kind of video decoder, and described device comprises: decoding acquiring unit, the first codec processing unit, the second codec processing unit, the 3rd codec processing unit;
Decoding acquiring unit, for obtaining the correction parameter collection of current decoded frame and the first reference picture or the second reference picture;
First codec processing unit, comprises the first decoding judgement unit, decoded luminance information correction unit, regular decode unit;
The first described decoding judgement unit, for judging whether that current sign variable is 0;
Described decoded luminance information correction unit, for when the judged result of the first decoding judgement unit is no, the correction in the same way of monochrome information is carried out, notice execution second codec processing unit by the reference frame of the correction parameter set pair current decoded frame of the first described reference picture or the second reference picture;
Regular decode unit, for when the judged result of the first decoding judgement unit is for being, carries out regular decode process to described current decoded frame; Notice execution the 3rd codec processing unit;
Second codec processing unit, for utilizing the reference frame of corrected in the same way current decoded frame to carry out regular decode to current decoded frame, notice execution the 3rd codec processing unit;
3rd codec processing unit, finding next image to be decoded for pressing decoding order, if next image to be decoded exists, then image to be decoded for the next one being set to current decoded frame, notice decoding acquiring unit;
Wherein, described decoded luminance information correction unit " carries out the correction in the same way of monochrome information " method by the reference frame of the correction parameter set pair current decoded frame of the first described reference picture or the second reference picture is:
Wherein, the span of i, j is: 1≤i≤height
yaMP.AMp.Amp & 1≤j≤width
y;
for the pixel value that the monochrome information of the reference frame of current decoded frame arranges in the i-th row jth;
the pixel value that the monochrome information correcting the reference frame of rear current decoded frame in the same way for monochrome information arranges in the i-th row jth;
be respectively the monochrome information adjustment factor of the corresponding reference frame of the current decoded frame that passes over from coding side, the monochrome information of the original coding frame that monochrome information is worth most, current decoded frame is corresponding of the corresponding reference frame of current decoded frame is worth most.
When video decoder includes U chrominance information correcting unit and V chrominance information correcting unit, the first codec processing unit of this video decoder comprises decoding U chrominance information correcting unit, V chrominance information correcting unit further;
U chrominance information correcting unit, after the monochrome information for having carried out the reference frame of current decoded frame when decoded luminance information correction unit corrects, continues to carry out U chrominance information to the reference frame of current decoded frame and corrects in the same way:
Wherein, the span of i, j is: 1≤i≤height
uaMP.AMp.Amp & 1≤j≤width
u;
for the pixel value that the U chrominance information of the reference frame of current decoded frame arranges in the i-th row jth;
the pixel value that the U chrominance information correcting the reference frame of rear current decoded frame in the same way for U chrominance information arranges in the i-th row jth;
be respectively the U chrominance information degree adjustment factor of the corresponding reference frame of the current decoded frame that passes over from coding side, the U chrominance information of the original coding frame that U chrominance information is worth most, current decoded frame is corresponding of the corresponding reference frame of current decoded frame is worth most;
Decoding V chrominance information correcting unit, after the monochrome information for having carried out the reference frame of current decoded frame when decoded luminance information correction unit corrects, continues to carry out U chrominance information to the reference frame of current decoded frame and corrects in the same way:
Wherein, the span of i, j is: 1≤i≤height
vaMP.AMp.Amp & 1≤j≤width
v;
for the pixel value that the V chrominance information of the reference frame of current decoded frame arranges in the i-th row jth;
the pixel value that the V chrominance information correcting the reference frame of rear current decoded frame in the same way for V chrominance information arranges in the i-th row jth;
be respectively the V chrominance information degree adjustment factor of the corresponding reference frame of the current decoded frame that passes over from coding side, the V chrominance information of the original coding frame that V chrominance information is worth most, current decoded frame is corresponding of the corresponding reference frame of current decoded frame is worth most.
In sum, the present invention is directed to the film source that illumination variation occurs, propose a kind of novel decoding method.The method method carries out correction process in the same way by the monochrome information to reference frame, chrominance information, thus the correlation strengthened between reference frame and coded frame, finally reach, reduce the number of intra prediction mode of MB of prediction frame, reduce code check consumption, promote the performance of encoder on inter-frame information redundancy is eliminated.
Those having ordinary skill in the art will appreciate that, the all or part of step realized in above-described embodiment method can have been come by program command related hardware, described program can be stored in a computer read/write memory medium, and described storage medium can be ROM, RAM, disk, CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.