Summary of the invention the objective of the invention is for overcoming the weak point of prior art, proposes in a kind of vision signal the predictive coding method stage by stage based on macro block group (Macroblock Group) structure.The present invention utilizes the characteristics of macro block group data structure, and two stages of adopting are carried out predictive coding.Emphasis definition forecast coding structure of the present invention, this forecast coding structure can effectively improve compression efficiency of video signal in conjunction with other various coding techniquess.
The present invention proposes to predict base unit in a kind of video signal coding, it is characterized in that, said prediction base unit is the macro block group that the square of 32 pixels * 32 pixels constitutes, and comprises the original macro group and derives from the macro block group; Wherein, the original macro group is the square of continuous 32 pixels * 32 pixels; Derive from the macro block group for the original macro group being carried out the square that level or vertical 1/2 is sampled and rearranged 32 pixels * 32 pixels that obtain.
The present invention also proposes in a kind of vision signal to it is characterized in that based on the predictive coding method stage by stage of macro block group structure, comprises cataloged procedure and decode procedure;
Said cataloged procedure specifically may further comprise the steps:
1) the macro block group that the square of 32 pixels * 32 pixels is constituted is as the prediction base unit, and this macro block group comprises that original macro group and NS, HS, VS, VHS derive from the macro block group for four kinds; Derive from the macro block group with described four kinds and carry out six kinds of macro block group coding types of assembly coding formation in twos: NS-HS macro block group coding type, VS-VHS macro block group coding type, NS-VS macro block group coding type, HS-VHS macro block group coding type, NS-VHS macro block group coding type and HS-VS macro block group coding type; Form three kinds of coding structure: NS-HS-VS-VHS, NS-VS-HS-VHS and NS-VHS-HS-VS coding structure by above-mentioned six kinds of type of codings by the version of first kind of macro block group coding type and second kind of macro block group coding type, adopt that any one carries out encoding and decoding in above-mentioned three kinds of coding structures; Determine macroblock encoding stage attribute in the macro block group according to deriving from the macro block stack features, that is: in deriving from the macro block group, if one macro block can coded macroblocks be by interpolation acquisition reconstruction macro block by other, then this macro block is stayed the second stage coding, otherwise encodes in the phase I;
2) carry out the phase I coding, comprise the following steps:
(1) obtain an original macro group from original picture, as the current coding macro block group, the original macro group is not carried out any sampling obtain continuous macro block group, this macro block group is made up of NS1, NS2, NS3 and NS4; The original macro group is carried out level 1/2 sampling obtain horizontal sampling macro block group, this macro block group is made up of HS1, HS2, HS3 and HS4; The original macro group is carried out vertical 1/2 sampling obtain vertical sampling macro block group, this macro block group is made up of VS1, VS2, VS3 and VS4; And the original macro group is carried out vertical 1/2 sampling carry out level 1/2 sampling again and obtain vertical-horizontal sampling macro block group, this macro block group is made up of VHS1, VHS2, VHS3 and VHS4, obtains described four kinds of derivation macro block groups thus;
(2) first kind of macro block group coding type of chosen coding structure encoded:
At first consider first kind of two macro block of upper strata/lower floor that derive from the macro block group in first kind of macro block group coding type, according to its macroblock encoding stage attribute, if encode in the phase I, then to this macroblock coding and calculate its coding cost, if, then estimate this macroblock encoding cost at the second stage coding; And then consider in first kind of macro block group coding type second kind two macro blocks of upper strata/lower floor that derive from the macro block group, according to its macroblock encoding stage attribute, if encode in the phase I, then to this macroblock coding and calculate its coding cost, if, then estimate this macroblock encoding cost at the second stage coding; At last first kind of cost value sum and second kind of cost value sum that derives from two macro blocks of macro block group upper strata/lower floor that derives from two macro blocks of macro block group upper strata/lower floor compared, two the macroblock encoding results of upper strata/lower floor that select the little derivation macro block set type of cost value sum are as first kind of macro block group coding type upper strata/macroblock encoding result of lower floor, and its cost value sum is as the cost value of first kind of macro block group coding type upper strata/lower floor's macro block;
Carry out two macroblock encoding in lower floor/upper strata in first kind of macro block group coding type equally, and obtain the cost value of first kind of macro block group coding type lower floor/upper strata macroblock encoding result and lower floor/upper strata macro block;
With the cost value sum of upper and lower layer macro block cost value as first kind of macro block group coding type;
(3) according to identical processing procedure of (2) step of phase I second kind of macro block group coding type of chosen coding structure encoded, obtain the cost value of second kind of macro block group coding type;
(4) encoding code stream of current coding macro block group output:
The cost value of second kind of macro block group coding type during relatively first kind of macro block group coding type goes on foot with (3) in (2) step, which kind of type of coding is decision current coding macro block group adopt: if the cost value of first kind of macro block group coding type is little, the type of coding of current coding macro block group just is first kind of macro block group coding type, again according to (2) result who goes on foot, which kind of the upper and lower layer of decision current coding macro block group adopts derive from the macro block set type, according to deriving from macroblock encoding stage attribute in the macro block group, export the code stream of coded macroblocks; If the cost value of second kind of macro block group coding type is little, the type of coding of current coding macro block group just is second kind of macro block group coding type, again according to (3) result who goes on foot, which kind of the upper and lower layer of decision current coding macro block group adopts derive from the macro block set type, according to deriving from macroblock encoding stage attribute in the macro block group, export the code stream of coded macroblocks;
(5) macro block that does not have coding in the current coding macro block group is carried out interpolation and to rebuild macro block, and constituted the reconstruction macro block group of current coding macro block group with the reconstruction macro block that obtains by coding;
(6) repeat the phase I (1) to (5) step, original macro groups all in original picture are finished coding, and then the phase I encodes and finishes; All reconstruction macro block groups have constituted the reconstruction frames image, the reference frame when encoding as second stage in the phase I coding;
3) carry out the second stage coding, comprise the following steps:
(1) obtain one from original picture and go on foot identical original macro group with the phase I (1), promptly the current coding macro block group is carried out sample process according to the original macro group and is obtained four types macro block group, i.e. NS, HS, VS, VHS macro block group;
(2) do not have the macro block of coding to encode to the phase I in the current coding macro block group, the reference frame when resulting reconstruction frames image is encoded as second stage in encoding with the phase I is encoded to the macro block of needs coding, and obtains its reconstruction macro block;
The reconstruction macro block that obtains by interpolation when (3) the alternative phase I of reconstruction macro block that obtains with coding encodes, and output encoder code stream;
(4) (3) step is arrived in (1) of repeating in the second stage coding, and all original macro groups are finished the second stage coding in original picture, and then the second stage coding is finished;
Said decode procedure specifically may further comprise the steps:
1) phase I decoding
(1) at first judges the macro block group coding type that to decode according to encoding code stream;
(2) according to macro block group coding type decoding: the type of judging two macro blocks in upper strata and two macro blocks of lower floor according to encoding code stream, simultaneously according to this macroblock encoding stage attribute, whether decision decodes: if this macro block is encoded this macro block direct decoding and obtain the decoding and rebuilding macro block then in the phase I; If this macro block is encoded in second stage, then this macro block is stayed the second stage decoding;
(3) according to the macro block of having decoded the macro block that not have decoding in (2) step of the phase I decoding macro block group is carried out interpolation and obtains to rebuild macro block, and with (2) step of phase I decoding in complete reconstruction macro block group of reconstruction macro block formation of obtaining of decoding;
(4) step of repetition phase I decoding (1) to (3), all decoded up to all macro block groups, then the phase I decoding is finished, and all reconstruction macro block groups have constituted the reconstruction frames image in the phase I decoding, as the reference frame image of second stage decoding;
2) second stage decoding:
(1) not have the macro block of decoding to decode to phase I decoding in the macro block group of decoding, the decoding and rebuilding frame image that obtains with the phase I decoding is decoded to these macro blocks of not decoding, and is obtained the reconstruction macro block of decoded macroblock as the reference frame of decoding;
The reconstruction macro block that obtains by interpolation when (2) substituting the phase I decoding with the reconstruction macro block of the decoded macroblock in (1) step of second stage decoding obtains final decoding and rebuilding frame like this, and with this decoding reference frame as the decoding next frame.
Principle of the present invention:
When video coding, the height of the quality decision code efficiency of prediction, therefore for an images, if consider that coding is wherein a part of earlier, but this part can be satisfied reconstruction view picture image, with the reference picture of this image reconstruction, can effectively improve the code efficiency of those remainder images like this, predictive coding thought stage by stage of the present invention that Here it is then as remainder when coding prediction in this images.In the macro block group structure that the present invention proposes, some macro block was encoded in the phase I, and some stays the second stage coding, had so just well realized predictive coding thought stage by stage.
Effect of the present invention:
Main feature of the present invention is to have defined forecast coding structure, and this forecast coding structure can effectively improve compression efficiency of video signal in conjunction with other various coding techniquess.At up-to-date JVT reference software JM61e, under identical experimental condition, do experiment show this programme code efficiency apparently higher than JVT result.
Based on the predictive coding method stage by stage of macro block group structure, reach embodiment in conjunction with the accompanying drawings and be described in detail as follows in a kind of vision signal that embodiment the present invention proposes:
The square that the present invention defines 32 pixels * 32 pixels is macro block group (Macroblock Group), and the square that defines 32 continuous pixels * 32 pixels is the original macro group.
Original macro group production method of the present invention is: for the original picture of lining by line scan, the square of 32 continuous pixels * 32 pixels just constitutes an original macro group; For interleaved original picture, to go up adjacent strange and even earlier earlier the time, or idol and strange field pattern resemble by the place position and be combined into frame image, and the square of 32 continuous pixels * 32 pixels just constitutes an original macro group in the frame image that is combined into then, as shown in Figure 1.
The original macro group is carried out level or vertical 1/2 sampling, just obtain four types derivation macro block group, as shown in Figure 2.
A is continuous macro block group (Non-sampling Macroblock Group-NS) among Fig. 2: the original macro group is not carried out any sampling just obtain this type of mb group, this derives from the macro block group is made up of NS1, NS2, NS3 and NS4, wherein NS1 and NS2 are two macro blocks in upper strata, and NS3 and NS4 are two macro blocks of lower floor.Specifically be defined as:
NS1(x,y)=MBG(x,y),
NS2(x,y)=MBG(x+16,y),
NS3(x,y)=MBG(x,y+16),
NS4(x,y)=MBG(x+16,y+16),x,y=1,…,16,
Wherein, MBG (x, y) be in the original macro group (x, pixel value y), x here, y=1 ..., 32.
B is horizontal sampling macro block group (Horiztonal-sampling Macroblock Group-HS) among Fig. 2: the original macro group is carried out level 1/2 sampling just obtain this type of mb group, this derives from the macro block group is made up of HS1, HS2, HS3 and HS4, wherein HS1 and HS2 are two macro blocks in upper strata, and HS3 and HS4 are two macro blocks of lower floor.Specifically be defined as:
HS1(x,y)=MBG(2x,y),
HS2(x,y)=MBG(2x+1,y),
HS3(x,y)=MBG(2x,y+16),
HS4(x,y)=MBG(2x+1,y+16),x,y=1,…,16,
Wherein, MBG (x, y) be in the original macro group (x, pixel value y), x here, y=1 ..., 32.
C is vertical sampling macro block group (Vertical-sampling Macroblock Group-VS) among Fig. 2: the original macro group is carried out vertical 1/2 sampling just obtain this type of mb group, this derives from the macro block group is made up of VS1, VS2, VS3 and VS4, wherein VS1 and VS2 are two macro blocks in upper strata, and VS3 and VS4 are two macro blocks of lower floor.Specifically be defined as:
VS1(x,y)=MBG(x,2y),
VS2(x,y)=MBG(x+16,2y),
VS3(x,y)=MBG(x,2y+1),
VS4(x,y)=MBG(x+16,2y+1),x,y=1,…,16,
Wherein, MBG (x, y) be in the original macro group (x, pixel value y), x here, y=1 ..., 32.
D is a vertical-horizontal sampling macro block group (Vertical-Horiztonal-sampling Macroblock Group-VHS) among Fig. 2: the original macro group is carried out vertical 1/2 level 1/2 sampling of sampling again just obtain this type of mb group, this derives from the macro block group is made up of VHS1, VHS2, VHS3 and VHS4, wherein VHS1 and VHS2 are two macro blocks in upper strata, and VHS3 and VHS4 are two macro blocks of lower floor.Specifically be defined as:
VHS1(x,y)=MBG(2x,2y),
VHS2(x,y)=MBG(2x+1,2y),
VHS3(x,y)=MBG(2x,2y+1),
VHS4(x,y)=MBG(2x+1,2y+1),x,y=1,…,16,
Wherein, MBG (x, y) be in the original macro group (x, pixel value y), x here, y=1 ..., 32.
The present invention is derived from the macro block group with above-mentioned four kinds and is made up the six kinds of macro block group coding types of formation of encoding in twos:
1. NS macro block group and HS macro block group are encoded and be defined as NS-HS macro block group coding;
2. VS macro block group and VHS macro block group are encoded and be defined as VS-VHS macro block group coding;
3. NS macro block group and VS macro block group are encoded and be defined as NS-VS macro block group coding;
4. HS macro block group and VHS macro block group are encoded and be defined as HS-VHS macro block group coding;
5. NS macro block group and VHS macro block group are encoded and be defined as NS-VHS macro block group coding;
6. HS macro block group and VS macro block group are encoded and be defined as HS-VS macro block group coding.
Again above-mentioned six kinds of macro block group coding types are formed following three kinds of coding structures by the version of first kind of macro block group coding type and second kind of macro block group coding type:
The 1st kind of macro block group coding type (NS-HS macro block group coding type) and the 2nd kind of macro block group coding type (VS-VHS macro block group coding type) combination are constituted the NS-HS-VS-VHS coding structure;
The 3rd kind of macro block group coding type (NS-VS macro block group coding type) and the 4th kind of macro block group coding type (HS-VHS macro block group coding type) combination are constituted the NS-VS-HS-VHS coding structure;
The 5th kind of type of coding (NS-VHS macro block group coding type) and the 6th kind of macro block group coding type (HS-VS macro block group coding type) combination are constituted the NS-VHS-HS-VS coding structure.
The present invention can adopt that any one carries out encoding and decoding (adopting the NS-HS-VS-VHS coding structure in the present embodiment) in above-mentioned three kinds of coding structures.
The present invention will determine wherein macroblock encoding stage attribute (be about to some macro block and determine that some macro block is encoded in second stage at the phase I coding) according to deriving from the macro block stack features:
Some macro block was encoded in the phase I in dissimilar derivation macro block groups, and some is encoded in second stage.The principle of distinguishing macroblock coding stage attribute is: in deriving from the macro block group, if this macro block can be obtained satisfied reconstruction macro block by other coded macroblocks by interpolation, then this macro block is stayed the second stage coding, otherwise encodes in the phase I.
For example: for NS macro block group, each macro block must be encoded and could be obtained satisfied reconstruction macro block, so each macro block all must be encoded in the phase I in this macro block group.
For HS macro block group, HS2 can obtain its satisfied reconstruction macro block by the HS1 interpolation; Same HS4 can obtain its satisfied reconstruction macro block by the HS3 interpolation.Therefore in this type of mb group, HS1 and HS3 encoded in the phase I, and HS2 and HS4 encode in second stage.
For VS macro block group, VS3 can obtain its satisfied reconstruction macro block by the VS1 interpolation, and VS4 can obtain its satisfied reconstruction macro block by the VS2 interpolation.Therefore in this type of mb group, VS1 and VS2 encoded in the phase I, and VS3 and VS4 encode in second stage.
For VHS macro block group, VHS2 can obtain its satisfied reconstruction macro block by the VHS1 interpolation; Same VHS3 can obtain its satisfied reconstruction macro block by the VHS1 interpolation, and VHS4 can obtain its satisfied reconstruction macro block by VHS2 and VHS3 interpolation.Therefore in this type of mb group, VHS1 is placed on the phase I coding, and VHS2, VHS3 and VHS4 are placed on the second stage coding.
Above-mentioned division to the macroblock encoding stage is an example (being used in the present embodiment), and the present invention can adopt other zoned format, for example:
For HS macro block group, HS2 and HS4 are placed on the phase I coding, HS1 and HS3 encode in second stage; Perhaps HS2 and HS3 are placed on the phase I coding, HS1 and HS4 are placed on the second stage coding; Perhaps HS1 and HS4 are placed on the phase I coding, HS2 and HS3 are placed on the second stage coding; Perhaps any three macro blocks in HS1, HS2, HS3 and four macro blocks of HS4 are placed on the phase I coding, remaining macro block is placed on the second stage coding.
For VS macro block group, VS3 and VS4 are placed on the phase I coding, VS1 and VS2 are placed on the second stage coding; Perhaps any three macro blocks in VS1, VS2, VS3 and four macro blocks of VS4 are placed on the phase I coding, remaining macro block is placed on the second stage coding.
For VHS macro block group, VHS1 and VHS3 are placed on the phase I coding, VHS2 and VHS4 are placed on the second stage coding; Perhaps VHS2 and VHS4 are placed on the phase I coding, VHS1 and VHS3 are placed on the second stage coding; Perhaps VHS1 and VHS4 are placed on the phase I coding, VHS2 and VHS3 are placed on the second stage coding; Perhaps VHS2 and VHS3 are placed on the phase I coding, VHS1 and VHS4 are placed on the second stage coding; Perhaps any one macro block in VHS1, VHS2, VHS3 and four macro blocks of VHS4 is placed on the phase I coding, remaining macro block is placed on the second stage coding; Perhaps any three macro blocks in VHS1, VHS2, VHS3 and four macro blocks of VHS4 are placed on the phase I coding, remaining macro block is placed on the second stage coding.
Based on the embodiment of the predictive coding method stage by stage of macro block group structure, comprise cataloged procedure and decode procedure in a kind of vision signal that the present invention proposes;
Said cataloged procedure specifically may further comprise the steps:
The phase I coding
1) from original picture, obtains an original macro group, be the current coding macro block group, carry out sample process according to the original macro group and obtain four types derivation macro block group, be i.e. NS, HS, VS, VHS macro block group.
2) to NS macro block group and HS macro block group encode (NS-HS macro block group coding):
At first two macro block NS1 in upper strata of NS macro block group and NS2 are encoded and calculate its coding cost, then the left side, the upper strata macro block HS1 of HS is encoded and calculate its coding cost, the coding cost of upper estimate the right macro block HS2 again, last cost value sum according to two macro blocks of NS and HS macro block group upper strata, the coding result of two macro blocks in upper strata (NS1 and NS2 or HS1 and HS2) of the macro block set type that the selection cost value is little is as NS-HS macro block group upper strata macroblock encoding result, and its cost value is as the cost value of NS-HS macro block group upper strata macro block.
Equally, to the lower floor two macro blocks (NS3 and NS4) of NS macro block group encode and calculate its coding cost, then the left side macro block HS3 of lower floor of HS is encoded and calculate its coding cost, estimate the coding cost of the right macro block HS4 of lower floor again, last cost value sum according to two macro blocks of NS and HS macro block group lower floor, the coding result of two macro blocks of lower floor (NS3 and NS4 or HS3 and HS4) of the macro block set type that the selection cost value is little is as the NS-HS macro block group macroblock encoding result of lower floor, and its cost value is as the cost value of NS-HS macro block group lower floor macro block.
With the cost value sum of upper and lower layer macro block cost value as NS-HS macro block group.
In the above-mentioned steps, the priority coded sequence of the upper and lower can be put upside down, and the left and right sides coded sequence of two macro blocks in the upper and lower can be put upside down.
3) to VS macro block group and VHS macro block group encode (VS-VHS macro block group coding):
At first encoded in the upper strata two macro blocks (VS1 and VS2) of VS macro block group and calculate its coding cost, then the left side, the upper strata macro block VHS1 of VHS is encoded and calculate its coding cost, the coding cost of the right macro block VHS2 of upper estimate again, last cost value sum according to two macro blocks of VS and VHS macro block group upper strata, the coding result of two macro blocks in upper strata (VS1 and VS2 or VHS1 and VHS2) of the macro block set type that the selection cost value is little is as VS-VHS macro block group upper strata macroblock encoding result, and its cost value is as the cost value of VS-VHS macro block group upper strata macro block.
Estimate two macroblock encoding costs of lower floor of VS macro block group and VHS, the cost value sum that compares these two types of macro block group lower floor macro blocks, select the little macro block set type of cost value two macro blocks of lower floor (VS3 and VS4 or VHS3 and VHS4) coding result as the VS-VHS macro block group macroblock encoding result of lower floor, its cost value is as the cost value of VS-VHS macro block group lower floor macro block.
With the cost value sum of upper and lower layer macro block cost value as VS-VHS macro block group.
In the above-mentioned steps, the priority coded sequence of the upper and lower can be put upside down, and the left and right sides coded sequence of two macro blocks in the upper and lower can be put upside down.
4) encoding code stream of current coding macro block group output:
Comparison step 2) cost value of VS-VHS macro block group in NS-HS macro block group and the step 3) in, which kind of type of coding is decision current coding macro block group adopt: if the cost value of NS-HS macro block group is little, the type of coding of current coding macro block group is a NS-HS macro block set type just; Again according to the 2nd) result in step, the derivation macro block set type of the upper and lower layer of decision current coding macro block group:, then export NS1 and NS2 macroblock encoding code stream if two macro blocks in the upper strata of NS-HS macro block group are NS macro block groups; If two macro blocks in the upper strata of NS-HS macro block group are HS macro block groups, then only export HS1 macroblock encoding code stream; If two macro blocks of the lower floor of NS-HS macro block group are NS macro block groups, then export NS3 and NS4 macroblock encoding code stream; If two macro blocks of the lower floor of NS-HS macro block group are HS macro block groups, then only export HS3 macroblock encoding code stream; On the contrary, if the cost value of VS-VHS macro block group is little, the type of coding of current coding macro block group is a VS-VHS macro block set type just.Simultaneously according to the 3rd) result in step, also determined the derivation macro block set type of the upper and lower layer of current coding macro block group:, then export VS1 and VS2 macroblock encoding code stream if two macro blocks in the upper strata of VS-VHS macro block group are VS macro block groups; If two macro blocks in the upper strata of VS-VHS macro block group are VHS macro block groups, then only export VHS1 macroblock encoding code stream.
5) macro block that does not have coding in the current coding macro block group is carried out interpolation and obtains to rebuild macro block:
Through the 4th) step, the output of may some macro block in the current coding macro block group having encoded, some macro block is coding not; Because encoded macro block can access the macro block of reconstruction, and do not have the macro block macro block that can not obtain rebuilding of coding, can only obtain the reconstruction macro block that these do not have coded macroblocks by interpolation; So just obtained the whole reconstruction macro block group of current coding macro block group; According to the 4th) step, need the macro block of interpolation to be: if the type of coding of current coding macro block group is a NS-HS macro block set type, when two macro blocks in its upper strata were HS macro block group, then the HS2 macro block needed interpolation; When two macro blocks of its lower floor were HS macro block group, then the HS4 macro block needed interpolation; If the type of coding of current coding macro block group is a VS-VHS macro block set type, two macro blocks are VHS macro block groups when its upper strata, and then the VHS2 macro block needs interpolation; Two macro blocks of its lower floor are no matter belong to the derivation macro block group of what type, and two macro blocks all need interpolation; The interpolation of macro block can adopt various existing interpolation techniques to realize.
6) repeat 1) to 5) step, original macro groups all in original picture are finished coding, and then the phase I encodes and finishes.All reconstruction macro block groups have constituted the reconstruction frames image, the reference frame when encoding as second stage in the phase I coding.
The second stage coding:
1) from original picture, obtain one with the phase I 1) go on foot identical original macro group, promptly the current coding macro block group is carried out sample process according to the original macro group and is obtained four types macro block group, i.e. NS, HS, VS, VHS macro block group.
2) do not have the macro block of coding to encode to the phase I in the current coding macro block group:
Phase I coding determined the type of coding and the encoded macro block of current coding macro block group and not have the macro block of coding, so the macro block that need encode of this step is exactly not have the macro block of encoding the phase I.Concrete deterministic process is as follows: if the type of coding of current coding macro block group is a NS-HS macro block set type, and two macro blocks in the upper strata of NS-HS macro block group are HS macro block groups, and then the HS2 macro block needs coding; If two macro blocks of the lower floor of NS-HS macro block group are HS macro block groups, then the HS4 macro block needs coding; If the type of coding of current coding macro block group is a VS-VHS macro block set type, and two macro blocks in the upper strata of VS-VHS macro block group are VHS macro block groups, and then the VHS2 macro block needs coding; If two macro blocks of the lower floor of VS-VHS macro block group are VS macro block groups, then VS3 and VS4 macro block need coding, if two macro blocks of the lower floor of VS-VHS macro block group are VHS macro block groups, then VHS3 and VHS4 macro block need coding.Reference frame when the reference frame that uses during macroblock coding with resulting reconstruction frames image in the phase I coding and phase I is encoded as second stage together, also can only use the reference frame when resulting reconstruction frames image is encoded as second stage in the phase I coding, macro block to the needs coding is encoded, and obtains rebuilding macro block.
3) macro block is rebuild in output of the code stream of coded macroblocks and renewal:
The code stream of output encoder macro block is with second stage the 2nd) the coding and rebuilding macro block that obtains of step substitutes the reconstruction macro block that the phase I obtains by interpolation during coding.
4) repeat second stage 1) to 3) step, all original macro groups are finished the second stage coding in original picture, and then the second stage coding is finished.
In above-mentioned cataloged procedure, macroblock coding can adopt existing various coding techniques to realize.Behind the macroblock coding, the coding cost of computing macro block also is to adopt existing coding cost value computing technique.Estimation macroblock encoding cost is meant does not carry out this macroblock coding, and just according to encoded macro block around it, estimate this macroblock encoding cost, for example macroblock encoding cost can be estimated as in macro block encoded around it coding cost value with its similar macro blocks.
In the macroblock coding prediction of second stage cataloged procedure, when the image reconstruction that obtains with the phase I coding was reference picture, after the coding estimation, the most similar match block that obtains can be again through becoming the prediction piece of encoding block after the Filtering Processing.Filtering Processing can adopt conventional multiple means of filtering, as adopting block elimination effect filter, makes prediction arrive better precision, thereby improves code efficiency; Also can adopt simple Filtering Processing, for example odd number in the piece be become even number or even number is become odd number and make data parityization, to reach other coding purpose.
Said decode procedure specifically may further comprise the steps:
The phase I decoding
1) judge the macro block set type of decoding:
At first judge the macro block set type that to decode according to encoding code stream.If NS-HS macro block set type then carried out for the 2nd step, if VS-VHS macro block set type then carried out for the 3rd step.
2) NS-HS macro block group decoding:
According to the type of two macro blocks in encoding code stream judgement upper strata, if two macro blocks in upper strata are NS types, direct decoding this two macro block NS1 and NS2; If two macro blocks in upper strata are HS types, the macro block HS1 on the left side in these two macro blocks of direct decoding, the macro block HS2 on the right stay the second stage decoding.
Then, according to the type of two macro blocks of code stream judgement lower floor, if two macro blocks of lower floor are NS types, direct decoding this two macro block NS3 and NS4; If two macro blocks of lower floor are HS types, the macro block HS3 on the left side in these two macro blocks of direct decoding, the macro block HS4 on the right stay the second stage decoding.
3) VS-VHS macro block group decoding:
Judge two macro block (mb) types in upper strata according to code stream, if two macro blocks in upper strata are VS types, direct decoding this two macro block VS1 and VS2; If two macro blocks in upper strata are VHS types, the macro block VHS1 on the left side in these two macro blocks of direct decoding, the macro block VHS2 on the right stay the second stage decoding.
Then, two macro blocks of lower floor are stayed the second stage decoding.
4) to the decoding phase I the 2nd) step or the 3rd) not have in the macro block group in step the macro block of decoding to carry out interpolation to obtain the reconstruction macro block:
According to the macro block of having decoded the macro block that does not have decoding is carried out interpolation, so just obtained a complete reconstruction macro block group.Fig. 3 has represented the interpolation situation of 3 types derivation macro block group, and wherein, a is a HS macro block group, and b is a VS macro block group, and c is a VHS macro block group.White expression decoded macroblock in every kind of macro block group, grey colour specification needs the macro block of interpolation.Here the interpolation of macro block adopt with cataloged procedure in identical interpolation technique during macroblock interpolation.
5) the repeat decoding phase I the 1st) to the 4th) step, all decoded up to all macro block groups, then phase I decoding is finished.All reconstruction macro block groups have constituted the reconstruction frames image in the phase I decoding, as the reference picture of second stage decoding.
The second stage decoding:
1) do not have the macro block of decoding to decode to the phase I in the macro block group of decoding:
Through the phase I decoding, in the macro block group, may also have the not decoding of some macro blocks.Reference frame when the decoding reference frame that uses of decoding and rebuilding frame image that obtains with the phase I and phase I is decoded as second stage, also can only use the reference frame when resulting reconstruction frames image is decoded as second stage in the phase I decoding, again these macro blocks of not decoding are decoded, obtain it and rebuild macro block.
2) upgrade the decoding and rebuilding frame:
With decoding second stage the 1st) the decoding and rebuilding macro block in step substitutes the phase I and obtains rebuilding macro block by interpolation, obtains final decoding and rebuilding frame like this, and with this decoding reference frame as the decoding next frame.
In above-mentioned decode procedure, macro block is decoded and can be adopted and encode corresponding existing various decoding techniques realizations.But in the macro block decoding moving compensation of second stage decode procedure, when the image reconstruction that obtains with the phase I decoding is reference picture, through after the decoding moving compensation, the most similar match block that obtains can be again through one with Filtering Processing identical in the coding method step after become the decoding compensation block.