The application is based on application number: 03800055.5, and the applying date: on January 8th, 2003, denomination of invention: the PCT application for a patent for invention of " motion vector coding method and motion vector decoding method " and dividing an application of proposing.
Embodiment
Following with reference to accompanying drawing, describe the moving picture encoding device in the 1st execution mode of the present invention in detail.
Fig. 6 is the block diagram of the moving picture encoding device 100 in the present invention's the 1st execution mode.
This moving picture encoding device 100 is by improving the predictive ability of motion vector prediction value, improve the device of code efficiency, it has: frame memory 101, calculus of differences portion 102, coded prediction error portion 103, code sequence generating unit 104, predicated error lsb decoder 105, addition operation division 106, frame memory 107, motion-vector test section 108, mode selection portion 109, coding control part 110, switch 111~115, motion-vector storage part 116 and motion vector coding portion 117.
Frame memory 101 is video memories of preserving input picture with image as unit, and the input picture that will obtain in chronological order with image as unit changes according to coded sequence and to arrange laggard line output.Changing arrangement is to be controlled by coding control part 110.
(a) expression of Fig. 7 is input to the situation of the image in the frame memory 101.
In this Fig. 7 (a), the ordinate presentation video, in the symbol shown in the lower right corner of each image, the letter representation image type of the 1st literal (I, P or B), the 2nd the chronological picture numbers of the numeral that literal is later.Be input to each image in the frame memory 101, change arrangement by coded sequence.Arrange by the change that coded sequence carries out, carry out according to the reference relation in the inter prediction encoding, what change arrangement is to carry out to be used as the mode of encoding earlier than the image that this image is used as the reference image with reference to the image of image use.For example, the reference relation of each image of frame P7~P13 is shown in the arrow of Fig. 7 (a).In Fig. 7 (a), the starting point of arrow is represented the image that is referenced, and the terminal point of arrow represents to carry out the image of reference.In the case, the image to Fig. 7 (a) changes the result of arrangement shown in Fig. 7 (b).
The image of Fig. 7 (b) expression input shown in (a) has been changed the situation of arrangement.Changing each image of arrangement like this in frame memory 101, is that the unit is read out with the macro block.At this, macro block is the size of level 16 * vertical 16 pixels.
Calculus of differences portion 102 by switch 111, is that unit obtains view data from frame memory 101 with the macro block, and, from mode selection portion 109, obtain the motion compensation image.In addition, calculus of differences portion 102 calculates the view data of macro block unit and the difference of motion compensation image, and exports after the generation forecast error image.
Coded prediction error portion 103, to view data that from frame memory 101, obtains by switch 112 or the prediction error image of trying to achieve by calculus of differences portion 102, carry out encoding process such as conversion of discrete cosine transform equifrequent and quantization, make coded data thus.For example, frequency translation and quantized processing are to be that unit carries out with level 8 * vertical 8 pixels.In addition, coded prediction error portion 103 outputs to code sequence generating unit 104 and coded prediction error portion 105 to coded data.
Code sequence generating unit 104, to coded data from coded prediction error portion 103, carry out Variable Length Code, be transformed into the coding stream form of output usefulness, affix generates code sequence thus from the information of the motion-vector of motion vector coding portion 117 input, from the information of the coded system of mode selection portion 109 inputs and other heading messages etc. again.
Predicated error lsb decoder 105, to coded data from coded prediction error portion 103, carry out anti-quantization after, carry out anti-frequency translations such as inverse discrete cosine transformation, decoding becomes prediction error image.
Addition operation division 106 is added to above-mentioned motion compensation image on the prediction error image as decoded result, as the view data of having passed through Code And Decode, and the decoded picture of output expression 1 two field picture.
Frame memory 107 is a kind of video memories, and it is that unit preserves image with the image, and stored image is: from the decoded picture of addition operation division 106 outputs, be used as the image that uses with reference to image when other image encodings.
Motion-vector test section 108 uses the decoded picture that is stored in the frame memory 107 as the reference image, each piece in the macro block of coded object is carried out the detection of motion-vector.The motion-vector that is detected outputs in the mode selection portion 109.
Mode selection portion 109 is utilized by motion-vector test section 108 detected motion-vectors, decision macroblock encoding mode.At this, coded system represents how macro block is encoded.For example, mode selection portion 109 is under the situation of P frame at the coded object image, (carry out predictive coding from intraframe coding, the inter prediction encoding that adopts motion-vector and jumping mode by utilizing the motion-vector of obtaining according to the motion-vector of other pieces, motion-vector is not encoded, and the result of coded prediction error, coefficient value all becomes 0, not the inter prediction encoding that coefficient value is encoded) in selected a certain as coded system.In addition, generally measure the coded system that decides encoding error to become minimum with the position of regulation.
And mode selection portion 109 outputs to determined coded system in the code sequence generating unit 104, the motion-vector that uses in this coded system, outputs in the motion vector coding portion 117.Moreover mode selection portion 109 is when determined coded system is when adopting the inter prediction encoding of motion-vector, motion-vector that uses in this inter prediction encoding and coded system, to store in the motion-vector storage part 116.
And, mode selection portion 109 according to determined coded system and by motion-vector test section 108 detected motion-vectors, moves and is repaid, generate the motion compensation image, and this motion compensation image is outputed in calculus of differences portion 102 and the addition operation division 106.But, under the situation of having selected intraframe coding, do not export the motion compensation image.Moreover, selecting by mode selection portion 109 under the situation of intraframe coding, control two switches 111,112 by mode selection portion 109, switch 111 is connected with terminal a, switch 112 is connected with terminal c; Under the situation of having selected inter prediction encoding, two switches 111,112 are controlled, switch 111 is connected with terminal b, switch 112 is connected with terminal d.In addition, above-mentioned motion compensation is that unit (being set at the size of 8 * 8 pixels at this) carries out with the piece.
110 decisions of coding control part are encoded to the image of having imported with the image (I, P or B frame) of what type, control each switch 113,114,115 according to this image type.At this, during the decision image type, the method that for example general employing periodically distributes image type.
Motion-vector storage part 116 is obtained the motion-vector and the coded system that adopt in inter prediction encoding from mode selection portion 109, and it is stored.
Motion vector coding portion 117 when having been selected by mode selection portion 109 to adopt the inter prediction encoding of motion-vector, utilizes the method with reference to Fig. 3 and Fig. 4 explanation, and the motion-vector of coded object piece is encoded.That is to say, motion vector coding portion 117 selected coded object piece 3 the peripheral pieces on every side that are positioned at, motion-vector according to these peripheral pieces decides predicted value, to the difference value of this predicted value with the motion-vector of the present piece that becomes coded object, encodes.
And, the encoding section 117 of the motion-vector in the present embodiment, when the motion-vector of coded object piece is encoded, the periphery piece utilizes under the situation that the motion-vector of jumping mode or direct mode etc. and other pieces encodes, motion-vector that should the periphery piece is made as 0 like that with conventional example, but the motion-vector that will obtain according to the motion-vector of above-mentioned other pieces when this periphery block encoding is handled as the motion-vector of this periphery piece.
Fig. 8 is the flow chart of the general action of the motion vector coding portion 117 among expression the present invention.
At first, motion vector coding portion 117, selected 3 the peripheral pieces (S100 step) of having encoded that are positioned at the periphery of coded object piece.
Then, motion vector coding portion 117, to selected this each peripheral piece utilize the motion-vector of other pieces carried out coding peripheral piece Ba, or judge (S102 step) without the peripheral piece Bb that the motion-vector of other pieces has carried out coding.
Its result, motion vector coding portion 117 judge in 3 selected peripheral pieces whether comprise peripheral piece Ba (S104 step).
When judge ("Yes" of S104 step) when comprising peripheral piece Ba in the S104 step, motion vector coding portion 117, to be the motion-vector that peripheral piece Ba is encoded and obtains according to the motion-vector of other pieces, motion-vector as this periphery piece Ba is handled, and derives predicted value (S106 step) according to the motion-vector of 3 peripheral pieces as stated above.
On the other hand, when be judged as ("No" of S104 step) when not comprising peripheral piece Ba in the S104 step, motion vector coding portion 117 according to the mobile detection separately of 3 peripheral piece Bb and the motion-vector of mode selection result, derives predicted value (S108 step).
And, motion vector coding portion 117, the difference of the predicted value of deriving to the motion-vector of coded object piece with in S106, S108 step, encode (S110 step).And motion vector coding portion 117 outputs to the motion-vector of encoding like this in the code sequence generating unit 104.
At this,, specify the encoding process of above-mentioned moving picture encoding device 100 with the example that is encoded to of frame P13 shown in Figure 7 and frame B11.
[encoding process of frame P13]
Because frame P13 is the P frame, so moving picture encoding device 100 when frame P13 is carried out encoding process, carries out the inter prediction encoding that another image is used as the reference image.At this moment become frame P10 with reference to image.P10 further finishes coding to this frame, and the decoded picture of this frame P10 is stored in the frame memory 107.
Coding control part 110 is controlled each switch in the coding of P frame, and switch 113,114,115 is connected.So the macro block of the frame P13 that reads from frame memory 101 can be obtained by motion-vector test section 108, mode selection portion 109 and calculus of differences portion 102.
Motion-vector test section 108 uses the decoded picture that is stored in the frame P10 in the frame memory 107 as the reference image, each piece in the macro block is carried out the detection of motion-vector, and the motion-vector that is detected is outputed to mode selection portion 109.
Mode selection portion 109 is used in motion-vector test section 108 detected motion-vectors, the macroblock encoding mode of decision frame P13.That is to say, because frame P13 is the P frame, so, mode selection portion 109 as mentioned above, (is carried out motion compensation by utilizing the motion-vector of obtaining according to the motion-vector of other pieces from intraframe coding, the inter prediction encoding that adopts motion-vector and jumping mode, motion-vector is not encoded, and the result of coded prediction error, all coefficient values become 0, not the inter prediction encoding that coefficient value is encoded) in selected a certain coded system.
And, motion vector coding portion 117 in the present embodiment, as mentioned above, when having selected by mode selection portion 109 to adopt the inter prediction encoding of motion-vector, the method that utilization is illustrated with reference to Fig. 3, motion-vector to the coded object piece of frame P13 is encoded, but under the situation that the peripheral piece that is positioned at this coded object piece periphery has been encoded with jumping mode, the motion-vector of this periphery piece is not made as 0, but will be for this periphery piece being encoded and, handling as the motion-vector of this periphery piece according to the motion-vector that other pieces are obtained.
Coding method to motion-vector under the situation of having carried out coding at this peripheral piece with jumping mode, its coded object piece is described as follows.
Fig. 9 is the key diagram that is used to illustrate the situation that peripheral piece C encodes with jumping mode.
As shown in Figure 9, when the peripheral piece C of frame P13 encodes with jumping mode, obtain: the intermediate value that is positioned at the motion-vector MVg of the motion-vector MVf of motion-vector Mve, piece F around this periphery piece C, piece E and piece G, with the motion-vector MVcm that represents this intermediate value, peripheral piece C is encoded.At this, the intermediate value of motion-vector for example can obtain by horizontal composition and vertical composition are obtained intermediate value respectively.
Motion vector coding portion 117, when the motion-vector of coded object piece A shown in Figure 9 is encoded, selected 3 peripheral piece B, C, the D (the position relation of piece B, C, D is referring to Fig. 3, Fig. 4) that is positioned at around the coded object piece A judges each peripheral piece B, C, D and whether is the piece that the motion-vector that utilizes other pieces has carried out coding.Its result, motion vector coding portion 117 has only peripheral piece C to encode with jumping mode if be judged as, promptly utilize other pieces to encode, then will be as mentioned above intermediate value (motion-vector MVcm) for peripheral piece C being encoded obtaining according to as the motion-vector of piece E, the F of other pieces, G, motion-vector as peripheral piece C is handled, obtain the intermediate value of each motion-vector of this motion-vector MVcm and peripheral piece B, D, the predicted value of this intermediate value as the motion-vector of coded object piece A.Then, motion vector coding portion 117 encodes to the difference value of the motion-vector of this predicted value and coded object piece A.
And, the coded system of the piece that 116 storages of motion-vector storage part have been encoded, according to the coded system that this motion-vector storage part 116 is stored, motion vector coding portion 117 judges whether each peripheral piece B, C, D are the pieces that has carried out coding with the motion-vector of other pieces.Moreover motion-vector storage part 116 for the motion-vector that does not use other pieces, and uses from the reference image detected self motion-vector to carry out the piece of coding, stores the motion-vector of this piece.That is to say, motion-vector storage part 116 memory block E, each motion-vector MVe, MVf of F, G, MVg, when the motion-vector of coded object piece A is encoded, these motion-vectors that motion vector coding portion 117 usefulness motion-vector storage parts 116 are stored are obtained above-mentioned motion-vector MVcm to peripheral piece C.Moreover motion-vector storage part 116 has carried out the piece of coding for the motion-vector with other pieces, also can be stored as in advance this piece is encoded and got the motion-vector that intermediate value is obtained.In this case, motion-vector storage part 116 is because stored motion-vector MVcm in advance, so, when the motion-vector of the 117 pairs of coded object pieces A of motion vector coding portion is encoded, do not need peripheral piece C is obtained motion-vector MVcm, can directly utilize motion-vector MVcm that motion-vector storage part 116 stores in advance to use as the motion-vector of peripheral piece C.
On the other hand, the prediction error image of the macro block of the coded object of expression frame P13 and the difference of motion compensation image, encode in coded prediction error portion 103 and code sequence generating unit 104, generate coded data, the information of the motion-vector that is encoded as mentioned above appends on this coded data in code sequence generating unit 104.But for the macro block that has carried out coding by jumping mode, the difference of macro block and motion compensation image is 0, and the information of motion-vector does not append on the coded data yet.
Then, utilize same processing method, all the other macro blocks of frame P13 are carried out encoding process.And, all macro blocks of frame P13 are handled one finish, then carry out the encoding process of frame B11.
[encoding process of frame B11]
Because frame B11 is the B frame, so moving picture encoding device 100 carries out the inter prediction encoding that other 2 images are used as the reference image when frame B11 is carried out encoding process.At this moment with reference to image, as shown in Figure 7, be the frame P13 that is positioned at the frame P10 in frame B11 the place ahead and is positioned at frame B11 rear.To these frames P10, P13, the coding that has been through with, the decoded picture of this frame P10, P13 is stored in the frame memory 107.
Coding control part 110 in the coding of B frame, is controlled each switch, and switch 113 is connected, and switch 114,115 is cut off.So the macro block of the frame B11 that reads from frame memory 101 can be by obtaining in motion-vector test section 108, mode selection portion 109 and the calculus of differences portion 102.
Motion-vector test section 108 uses as the place ahead the decoded picture that is stored in the frame P10 in the frame memory 107 with reference to image; The decoded picture of frame P13 is used with reference to image as the rear, like this,, the place ahead motion-vector and rear motion-vector are detected, detected the place ahead motion-vector and rear motion-vector are outputed in the mode selection portion 109 for each piece in the macro block.
Mode selection portion 109, use by motion-vector test section 108 detected the place ahead motion-vectors and rear motion-vector, the macroblock encoding mode of decision frame B11, that is to say, because frame B11 is the B frame, so, mode selection portion 109, for example from intraframe coding, adopt the inter prediction encoding of the place ahead motion-vector, adopt the inter prediction encoding of rear motion-vector, adopt the inter prediction encoding of two-way motion-vector, and direct mode (is utilized the motion-vector of obtaining from the motion-vector of other pieces, carry out motion compensation, not the inter prediction encoding that motion-vector is encoded) middle selected encoding mode.
Then, motion vector coding portion 117 in the present embodiment, as mentioned above, when in mode selection portion 109, having selected to adopt the inter prediction encoding of motion-vector, utilization is with reference to the method that Fig. 3 is illustrated, and comes the motion-vector of the coded object piece of frame B13 is encoded.
Specifically, when having selected to adopt the inter prediction encoding of two-way motion-vector in mode selection portion 109, motion vector coding portion 117 following motion-vectors to the coded object piece are encoded.
Figure 10 is the key diagram that is used to illustrate the inter prediction encoding that adopts two-way motion-vector.
Motion vector coding portion 117 when the motion-vector of coded object piece A is encoded, encodes to the place ahead motion-vector MVF and rear motion-vector MVB.
That is to say that motion vector coding portion 117 each the place ahead motion-vector MVF1 of peripheral piece B, C, D, the intermediate value of MVF2, MVF3, as the predicted value of the place ahead motion-vector MVF, and encodes to the difference value of the place ahead motion-vector MVF and its predicted value.Then,,, and the difference value of rear motion-vector MVB and its predicted value encoded each rear motion-vector MVB1 of peripheral piece B, C, D, the intermediate value of MVB2, MVB3 by motion vector coding portion 117 as the predicted value of rear motion-vector MVB.At this, the intermediate value of motion-vector is for example each horizontal composition, vertical composition to be got intermediate value and try to achieve.
Here, the motion vector coding portion 117 of present embodiment, when the motion-vector of the coded object piece of B frame is encoded, carried out with direct mode at this periphery piece under the situation of coding, the motion-vector of this periphery piece is not made as 0, and the motion-vector that will obtain according to other pieces for this periphery piece is encoded, as the motion-vector of this periphery piece.In addition, two kinds of intersexuality direct mode and spatiality direct modes sometimes in the direct mode.
At first, the coding method of the motion-vector of coded object piece is described under the situation that peripheral piece encodes with the timeliness direct mode.
Figure 11 is the key diagram that is used to illustrate the situation that peripheral piece C encodes with the timeliness direct mode.
As shown in Figure 11, when the peripheral piece C of frame B11 encodes with direct mode, utilize the rear nearby carried out coding with reference to image, promptly among the frame P13, be positioned at and peripheral piece C same position on the motion-vector MVp of piece X.Motion-vector MVp is an employed motion-vector when piece X has been encoded, and it is stored in the motion-vector storage part 116.This motion-vector MVp reference frame P10.For the coding of peripheral piece C, utilize the motion-vector that parallels with motion-vector MVp, be that frame P10 and frame P13 carry out bi-directional predicted according to the reference image.In the case, used motion-vector when peripheral piece C is encoded is motion-vector MVFc for frame P10, is motion-vector MVBc for frame P13.
At this, is mvf if establish as the place ahead to the size of the motion-vector MVFc of motion-vector, is mvb as the rear to the size of the motion-vector MVBc of motion-vector, the size of motion-vector MVp is mvp, the rear of the image of coded object (frame B11) is with reference to image (frame P13), with its rear be TRD with reference to the timeliness of the image (frame P10) of the piece institute reference of image distance, image of coded object (frame B11) and rear are TRB with reference to the timeliness distance of the image (frame P10) of the piece institute reference of image, so, mvf, mvb is obtained by (formula 1) shown below and (formula 2) respectively.
Mvf=mvp * TRB/TRD ... (formula 1)
Mvb=(TRB-TRD) * mvp/TRD ... (formula 2)
In the formula, mvf, mvb represent the horizontal composition and vertical composition of motion-vector respectively.And, use on the occasion of the direction of representing motion-vector MVp, represent the direction opposite with negative value with motion-vector MVp.
Periphery piece C encodes with the motion-vector MVFc, the MVBc that obtain like this.
Motion vector coding portion 117, to the motion-vector MVF of coded object piece A shown in Figure 10, when MVB encodes, selected 3 peripheral piece B, C, the D that is positioned at around the coded object piece A, the motion-vector of piece of judging each peripheral piece B, C, D and whether being with other has carried out the piece of encoding.Its result, motion vector coding portion 117 encodes with the direct mode of timeliness if judge only peripheral piece C, promptly utilize the motion-vector of other pieces to encode, then as shown in figure 11, by motion-vector MVFc, the MVBc that will be for peripheral piece C is encoded obtains according to motion-vector MVp as the piece X of other pieces, motion-vector as peripheral piece C is handled, obtain the intermediate value of each motion-vector of these motion-vectors MVFc, MVBc and peripheral piece B, D, derive the predicted value of the motion-vector of coded object piece A thus.And the derivation of this predicted value is to be divided into the place ahead to always carrying out with the rear.And motion vector coding portion 117 to this predicted value and the motion-vector MVF of coded object piece A, the difference value of MVB, encodes.
And, the coded system of the piece that 116 storages of motion-vector storage part have been encoded, according to the coded system that this motion-vector storage part 116 is stored, motion vector coding portion 117 judges peripheral piece B, whether C, D are to utilize the motion-vector of other pieces to carry out the piece of encoding.Moreover motion-vector storage part 116 uses from the reference image detected self motion-vector to carry out the piece of coding for the motion-vector that does not use other pieces, stored the motion-vector of this piece.That is to say, motion vector coding portion 117 is when encoding to the motion-vector of coded object piece A, to peripheral piece B, D, directly utilize motion-vector by 116 storages of motion-vector storage part, but to peripheral piece C, then read out in the motion-vector MVp of the piece X that has stored in the motion-vector storage part 116, obtain motion-vector MVFc, MVBc.And motion-vector storage part 116 has carried out the piece of coding for the motion-vector with other pieces, also can be stored as in advance this piece is encoded and obtained the motion-vector that comes according to the motion-vector of other pieces.In the case, motion-vector storage part 116 is stored motion-vector MVFc, MVBc in advance, so, motion vector coding portion 117 is when encoding to the motion-vector of coded object piece A, need after reading the motion-vector MVp of piece X, not utilize (formula 1) and (formula 2) to obtain motion-vector MVFc, MVBc to peripheral piece C, motion-vector MVFc, the MVBc that can directly utilize motion-vector storage part 116 to be stored be as the motion-vector of peripheral piece C.
Below, the coding method of motion-vector under the situation that peripheral piece has been carried out with spatial direct mode encodes, the coded object piece is described.
Figure 12 is used to illustrate that peripheral piece has been carried out the key diagram of the situation of coding with spatial direct mode.
As shown in Figure 12, when utilizing spatial direct mode to come peripheral piece C to frame B11 to encode, utilize motion-vector MVFc, MVBc to encode, this motion-vector MVFc, MVBc are according to motion-vector MVFe, the MVBe and motion-vector MVFf, the MVBf of piece F and motion-vector MVFg, the MVBg of piece G that are positioned at peripheral piece C piece E on every side, respectively after fore-and-aft direction is divided, get intermediate value and obtain.
Motion vector coding portion 117, when to the motion-vector MVF of coded object piece A shown in Figure 10, when MVB encodes, selected 3 peripheral piece B, C, the D that is positioned at around the coded object piece A judges each peripheral piece B, C, D and whether is the piece that the motion-vector that utilizes other pieces has carried out coding.Its result, motion vector coding portion 117 encodes with spatial direct mode if be judged as only peripheral piece C, promptly utilize the motion-vector of other pieces to encode, then as shown in figure 12, by will be for peripheral piece C be encoded be motion-vector MVFc, the MVBc that the motion-vector of piece E, F, C is obtained according to other pieces, motion-vector as peripheral piece C uses, obtain the intermediate value of each motion-vector of these motion-vectors and peripheral piece B, D, derive the predicted value of the motion-vector of coded object piece A thus.In addition, motion vector coding portion 117 to this predicted value and the motion-vector MVF of coded object piece A, the difference value of MVB, encodes.
And, motion-vector storage part 116 for utilize from the reference image detected oneself motion-vector to carry out the piece of coding without the motion-vector of other pieces, is stored the motion-vector of this piece, so, each piece E, F, G are stored 2 motion-vectors of fore-and-aft direction respectively; Motion vector coding portion 117 when the motion-vector of coded object piece A is encoded, uses these motion-vectors of being stored by motion-vector storage part 116, and peripheral piece C is obtained motion-vector MVFc, MVBc.And motion-vector storage part 116 has carried out the piece of coding for the motion-vector with other pieces, also can be stored as in advance this piece is encoded and got 2 motion-vectors of the fore-and-aft direction that intermediate value obtains.In the case, motion-vector storage part 116 is stored motion-vector MVFc, MVBc in advance, so, motion vector coding portion 117, when the motion-vector of coded object piece A is encoded, do not need peripheral piece C is obtained motion-vector MVFc, MVBc, and motion-vector MVFc, the MVBc that can directly use motion-vector storage part 116 to be stored, as the motion-vector of peripheral piece C.
Like this, when the direct mode of utilizing above-mentioned timeliness comes that peripheral piece C carried out coding, must be the motion-vector of the rear of coded object image with reference to image (being frame P13 in above-mentioned example), store in the motion-vector storage part 116, but when peripheral piece C having been carried out coding, can omit this storage with spatial direct mode.
At this moment, moving picture encoding device 100 when the motion-vector of coded object piece is encoded, is not to handle with above-mentioned inter prediction encoding being positioned at its peripheral piece on every side, but under the situation of having carried out handling with intraframe coding, the processing that makes an exception.
For example, have in 3 peripheral pieces under the situation of a piece that has carried out encoding with intraframe coding, the motion vector coding portion 117 of moving picture encoding device 100 is made as 0 to the motion-vector of this piece and handles.And under the situation that 2 peripheral pieces that carried out encoding with intraframe coding are arranged, motion vector coding portion 117 the motion-vector of remaining 1 peripheral piece, is used as the predicted value of the motion-vector of coded object piece.Moreover, all having carried out at 3 peripheral pieces under the situation of coding with intraframe coding, motion vector coding portion 117 is made as 0 with the predicted value of the motion-vector of coded object piece, carries out the encoding process of this motion-vector.
On the other hand, the prediction error image of the macro block of the coded object of expression frame B11 and the difference of motion compensation image, utilize coded prediction error portion 103 and code sequence generating unit 104 to encode, the generating code data, the motion-vector information of having encoded as stated above appends in code sequence generating unit 104 on this coded data.But for the macro block of having encoded with direct mode, its motion-vector information do not append on the coded data.
Below, by same processing, come the remaining macro block of frame B11 is carried out encoding process.And,, then then carry out the encoding process of frame B12 to whole macro blocks one end process of frame B11.
As mentioned above, motion vector coding method of the present invention, when the motion-vector of each piece is encoded, from the motion-vector of the peripheral piece of having encoded, derive predicted value, come this motion-vector is encoded with the motion-vector of this predicted value and coded object piece.And, as peripheral piece as jumping mode and direct mode, using the motion-vector of obtaining according to the motion-vector of other pieces, under the situation of encoding, the motion-vector that to when this periphery piece is encoded, obtain according to the motion-vector of above-mentioned other pieces, as the motion-vector of this periphery piece, derive predicted value.
Thus, when using the predicted value of deriving according to the motion-vector of peripheral piece, when coming the motion-vector of coded object piece encoded, utilize under the situation that the motion-vector of other pieces encodes at this periphery piece, unlike conventional example, the motion-vector of this periphery piece is made as 0, but is made as the motion-vector of obtaining according to the motion-vector of above-mentioned other pieces, so can improve the predictive ability of above-mentioned predicted value, its result can improve the code efficiency of motion-vector.
And, in the present embodiment, illustrated that macro block is a unit with level 16 * vertical 16 pixels, motion compensation is a unit with the piece of level 8 * vertical 8 pixels, the coding of piece prediction error image is the situation that unit handles with level 8 * vertical 8 pixels, but these units also can be other pixel counts.
And, in the present embodiment, illustrated and to have obtained next intermediate value according to the motion-vector of 3 peripheral pieces of having encoded, the situation of the predicted value use during as motion vector coding, but should periphery piece number also can be other numbers beyond 3, the determining method of predicted value also can be an additive method.For example, also can be the method that the motion-vector of the adjacent piece in a left side is used as predicted value, also can be not use intermediate value and the method etc. of using mean value.
And, in the present embodiment, utilize Fig. 3, Fig. 4, the position of the peripheral piece in the motion vector coding has been described, but this also can be other positions.
And, in the present embodiment, be example with the direct mode and the spatial direct mode of jumping mode and timeliness, illustrated that the motion-vector with other pieces comes the coded object piece is carried out Methods for Coding, but also can be additive method.
Moreover, in the present embodiment, the difference of the predicted value that the motion-vector by obtaining the coded object piece has been described and has obtained according to the motion-vector of peripheral piece is carried out the situation of motion vector coding, but it also can utilize the method beyond the difference to carry out motion vector coding.
And, in the present embodiment, illustrated under the situation of coming peripheral piece is encoded with spatial direct mode, try to achieve the intermediate value of the motion-vector that is positioned at this periphery piece 3 pieces of having encoded on every side, the situation of this intermediate value as the motion-vector use of peripheral piece, but this piece number also can be other numbers beyond 3, and the determining method of motion-vector also can be an additive method.For example, also can be the motion-vector of the adjacent piece in a left side as the method that the motion-vector of peripheral piece uses, also can be not use intermediate value and the method for using mean value.
And, in the present embodiment, when coming with spatial direct mode the piece of B frame encoded, this piece has been obtained 2 motion-vectors of fore-and-aft direction, but also can obtain the place ahead to or the rear to 2 motion-vectors of a direction.In the case, the B frame is positioned at 2 images on the direction at the place ahead or rear with reference to relative this image.
Moreover, in the present embodiment, illustrated in the coding of P frame, with reference to an image (for example reference frame P10 in the coding of frame P13) of predesignating; 2 images (for example reference frame P10 and P13 in the coding of frame B11) that reference is predesignated in the coding of B frame, the situation of encoding.But, also can from a plurality of images, select to encode by the image of macro block and each piece reference.In this case, in order to generate the predicted value of motion-vector, can carry out according to shown in Figure 13.
Figure 13 is the flow chart of expression following actions, and promptly under situation about each piece being selected with reference to image, motion vector coding portion 117 derives the predicted value of the motion-vector of coded object piece, and its motion-vector is encoded.
At first, motion vector coding portion 117 selected coded object piece 3 the peripheral pieces (S300 step) of having encoded on every side that are positioned at.
Then, motion vector coding portion 117 judges that this chosen peripheral piece is respectively the peripheral piece Ba that has carried out coding with the motion-vector of other pieces, has still carried out the peripheral piece Bb (S302 step) of coding without the motion-vector of other pieces.
At this, motion vector coding portion 117 to peripheral piece Ba, obtains the motion-vector that uses and represents this periphery piece Ba with reference to which information with reference to image in its coding, the motion-vector of the motion-vector that uses in this coding as peripheral piece Ba used; To peripheral piece Bb, obtain the motion-vector of this periphery piece Bb and represent this periphery piece Bb is with reference to which information (S304 step) with reference to image.
Then, motion vector coding portion 117 according to the information that obtains in the S304 step, selectes the peripheral piece (S306 step) with reference to the image identical with the coded object piece in 3 peripheral pieces, judge the quantity (S308) of the peripheral piece that this is chosen.
And, if motion vector coding portion 117, if the quantity of the peripheral piece of judging in the S308 step is 1, so, motion-vector, as the predicted value (S310 step) of the motion-vector MV of coded object piece with reference to this peripheral piece of identical image.
Moreover, if beyond the quantity of the peripheral piece that the S308 step is judged is 1, so, motion vector coding portion 117, the motion-vector of the peripheral piece of the image different of reference in 3 peripheral pieces with the coded object piece, be made as 0 (S312 step), the intermediate value of the motion-vector of 3 peripheral pieces, as the predicted value (S314 step) of the motion-vector MV of coded object piece.
Motion vector coding portion 117 as mentioned above, is used in the predicted value of deriving in S310 step or the S314 step, obtains the difference value of the motion-vector MV of this predicted value and coded object piece, to this difference value encode (S316 step).
And, as present embodiment, the motion-vector of adjacent piece is as predicted value on the space, under the situation that motion-vector is encoded,, motion-vector is kept at the quantity of the motion-vector in the motion-vector storage part 116 for being encoded, in motion-vector storage part 116, preserve under the situation of the motion-vector that is actually used in motion compensation with jumping mode and direct mode, can preserve the motion-vector of piece of the amount of 1 macro-block line (highly being 1 macro block, the horizontal wide horizontal wide zone of picture that equals).This be because, in motion-vector storage part 116, preserve under the situation of the motion-vector that is actually used in motion compensation with jumping mode and direct mode, use occasion in the present embodiment with the peripheral piece of Fig. 3 and Fig. 4 explanation, the piece that is referenced as peripheral piece when motion vector coding is the amount of a past slice of macroblocks for being starting point with present macro block.
[the 2nd execution mode]
Following with reference to accompanying drawing, describe the dynamic image decoding device 700 in the present invention's the 2nd execution mode in detail.
Figure 14 is the block diagram of the dynamic image decoding device 700 in the present invention's the 2nd execution mode.
Dynamic image decoding device 700 shown in this Figure 14 is devices that dynamic image is decoded, this dynamic image is the dynamic image image that has carried out coding with the moving picture encoding device 100 of the 1st execution mode, and this dynamic image decoding device 700 has: code sequence analysis unit 701, predicated error lsb decoder 702, mode lsb decoder 703, motion compensation lsb decoder 705, motion-vector storage part 706, frame memory 707, addition operation division 708, switch 709,710 and motion vector decoding portion 711.
Code sequence analysis unit 701 is extracted various data out from the code sequence that is transfused to.Here said various data are meant the information of coded system and the information of relevant motion-vector etc.The information of the coded system that is drawn out of outputs in the mode lsb decoder 703.And the information of the motion-vector that is drawn out of is output in the motion vector decoding portion 711.And the coded prediction error data that are drawn out of are output in the predicated error lsb decoder 702.
The coded prediction error data that 702 pairs of predicated error lsb decoders are transfused to are decoded, the generation forecast error image.The prediction error image that generates outputs in the switch 709.Then, when switch 709 was connected on the terminal b, prediction error image outputed in the addition operation division 708.
Mode lsb decoder 703 is controlled switch 709 and switch 710 with reference to the information of the coded system of extracting out from code sequence.In coded system is under the situation of intraframe coding, controls this switch 709 and is connected on the terminal a, and switch 710 is connected on the terminal c; In coded system is under the situation of inter-picture coding, will control this switch 709 and be connected on the terminal b, and switch 710 is connected on the terminal d.In addition, mode lsb decoder 703 outputs to motion vector decoding portion 711 to coded system information.
Motion vector decoding portion 711 to the motion-vector information from 701 outputs of code sequence analysis unit, carries out decoding processing.
That is to say, motion vector decoding portion 711 adopts in the coded system information representation under the situation of inter prediction encoding of motion-vector, and utilizes the same of Fig. 3, Fig. 4 explanation, to the decoder object piece, use the motion-vector of decoded peripheral piece to derive predicted value.For example, as shown in Figure 3, the 711 pairs of decoder object pieces A of motion vector decoding portion according to the motion-vector MVc of the motion-vector MVb of peripheral piece B, peripheral piece C and the motion-vector MVd of peripheral piece D, derives predicted value.At this, trying to achieve predicted value is the horizontal composition to 3 motion-vector MVb, the MVc that encoded, MVd, vertical composition, gets its intermediate value (median) respectively and obtains.And, motion vector decoding portion 711, the difference value as motion-vector information to from 701 outputs of code sequence analysis unit adds its predicted value, the motion-vector MV of decision decoder object piece A.And motion vector decoding portion 711 is under the direct mode or a certain situation in the spatial direct mode of for example above-mentioned jumping mode or timeliness in coded system information, only utilizes the motion-vector of the peripheral piece of having encoded to decide motion-vector.
Figure 15 is the flow chart of the general action of the motion vector decoding portion 711 in the expression present embodiment.
At first, motion vector decoding portion 711 selectes out 3 the peripheral pieces (S200 step) of having encoded that are positioned at around the decoder object piece.
And, motion vector decoding portion 711, judging this each chosen peripheral piece is the peripheral piece Ba that utilizes other motion-vectors to encode, the peripheral piece Bb (S202 step) that does not still utilize other motion-vectors to encode.
Its result, motion vector decoding portion 711 judge whether comprise peripheral piece Ba (S204 step) in 3 chosen peripheral pieces.
When be judged as (S204 step be) when comprising peripheral piece Ba in the S204 step, motion vector decoding portion 711, the motion-vector that to obtain according to the motion-vector of other pieces for peripheral piece Ba is decoded, motion-vector as this periphery piece Bb uses, and derives predicted value (S206 step) according to the motion-vector of 3 peripheral pieces as mentioned above.
On the other hand, when be judged as ("No" of S204 step) when not comprising peripheral piece Ba in the S206 step, motion vector decoding portion 711 derives predicted value (S208 step) according to the motion-vector based on each testing result of 3 peripheral piece Bb.
Then, motion vector decoding portion 711 by from the motion-vector information gap score value of code sequence analysis unit 701 outputs, adds the predicted value of being derived by S206, S208 step, thus, to being encoded of decoder object piece motion-vector decode (S210 step).And motion vector decoding portion 711 outputs to the motion-vector of decoding like this in the motion compensation lsb decoder 705.
Motion-vector storage part 706 will be stored by the motion-vector of motion vector decoding portion 711 decodings and the coded system that is obtained by mode lsb decoder 703.
Motion compensation lsb decoder 705 according to the motion-vector by 711 decodings of motion vector decoding portion, is obtained the motion compensation image to each macro block from frame memory 707.Then, motion compensation lsb decoder 705 outputs to this motion compensation image in the addition operation division 708.
708 pairs of prediction error images that are transfused to of addition operation division and motion compensation image carry out add operation, generate decoded picture, and the decoded picture of this generation is outputed in the frame memory 707.
And 707 pairs of each frames by the decoded picture of addition operation division 708 generations of frame memory are preserved.
About the action of this dynamic image decoding device 700, at first begin to describe from general summary action.
Figure 16 is the key diagram that is used to illustrate the input/output relation of dynamic image decoding device 700.
Dynamic image decoding device 700 is obtained the code sequence of the output from moving picture encoding device 100 of the 1st execution mode successively by its output order shown in this Figure 16 (a), the image that is included in this code sequence is decoded successively.Then, dynamic image decoding device 700 shown in (b) among Figure 16, is changed arrangement by DISPLAY ORDER successively to decoded image and is exported.
At this,, specify the decoding processing of above-mentioned dynamic image decoding device 700 with the example that is decoded as of frame P13 shown in Figure 16 and frame B11.
[decoding processing of frame P13]
At first, the code sequence analysis unit 701 of dynamic image decoding device 700 obtains the code sequence of frame P13, and from this code sequence, the extraction mode is selected information and motion-vector information and coded prediction error data afterwards.
Mode lsb decoder 703 is selected information with reference to the mode of extracting out from the code sequence of frame P13, switch 709 and 710 is controlled.
Following explanation mode is selected the situation of information representation inter prediction encoding.
Information is selected according to the mode from the expression inter prediction encoding of mode lsb decoder 703 by motion vector decoding portion 711, to the motion-vector information of extracting out from the code sequence of frame P13, its each piece is carried out above-mentioned decoding processing.
At this, motion vector decoding portion 711, when the motion-vector of the decoder object piece of frame P13 is decoded, select out and be positioned at this decoder object piece decoded 3 peripheral pieces on every side, whether judge these peripheral pieces encodes with the motion-vector of other pieces, its result, if some peripheral pieces are the pieces that has carried out coding with other motion-vectors, promptly carried out the piece of coding with jumping mode, in this case, then the same with the motion vector coding portion 117 of the 1st execution mode, as will to obtain according to the motion-vector of other pieces for this periphery piece is decoded motion-vector is as the motion-vector use of this periphery piece.That is to say that motion vector decoding portion 711 obtains intermediate value according to the motion-vector that is positioned at 3 pieces of having decoded around this periphery piece, and its motion-vector as this periphery piece is used.
In addition, 706 storages of motion-vector storage part are selected information from the mode of mode lsb decoder 703, select information according to the mode that this motion-vector storage part 706 is stored, motion vector decoding portion 711 judges whether each peripheral piece is the piece that has carried out coding with the motion-vector of other pieces.Moreover motion-vector storage part 706 is stored the motion-vector of other pieces of the decoding that is used for peripheral piece.Also promptly, 706 pairs of motion-vector storage parts motion-vector separately that encoded with jumping mode, that be positioned at 3 pieces around the peripheral piece is stored; Motion vector decoding portion 711, when the motion-vector of decoder object piece was decoded, to this periphery piece, the motion-vector of above-mentioned 3 pieces of being stored according to motion-vector storage part 706 was obtained intermediate value.And motion-vector storage part 706 has carried out the piece of encoding to the motion-vector with other pieces, will get intermediate value for this piece is decoded and obtain next motion-vector, stores also passable in advance.In the case, motion vector decoding portion 711, when the motion-vector of decoder object piece is decoded, the peripheral piece of having encoded with jumping mode is not needed to obtain motion-vector, the motion-vector that can directly motion-vector storage part 706 be stored is as the motion-vector use of this periphery piece.
On the other hand, coded prediction error data corresponding to the macro block of the decoder object of frame P13, decoded at predicated error lsb decoder 702, the generation forecast error image, switch 709,710 is connected with addition operation division 708, therefore, and according to the motion compensation image that generates at motion vector decoding portion 711 decoded motion-vectors, after being added on this prediction error image, output in the frame memory 707.
And motion vector decoding portion 711 for image and piece to the back are decoded, stores into the motion-vector storage part 706 this motion-vector with from the coded system that mode lsb decoder 703 obtains when the P frame is carried out motion vector decoding.
After, utilizing same processing, the residue macro block of frame P13 is decoded successively.Afterwards, in case the macro block of frame P13 is all decoded, then carry out the decoding of frame B11.
[decoding processing of frame B11]
At first, the code sequence analysis unit 701 of dynamic image decoding device 700 obtains the code sequence of frame B11, and the extraction mode is selected information and motion-vector information and coded prediction error data from this code sequence.
Mode lsb decoder 703 is selected information with reference to the mode of extracting out from the code sequence of frame B11, switch 709 and 710 is controlled.
Below, the explanation mode is selected the situation of information representation inter prediction encoding.
Information is selected according to the mode from the expression inter prediction encoding of mode lsb decoder 703 by motion vector decoding portion 711, to the information of the motion-vector extracted out from the code sequence of frame B11, its each piece is carried out above-mentioned decoding processing.
At this, motion vector decoding portion 711, when the motion-vector of the decoder object piece of frame B11 is decoded, select out and be positioned at this decoder object piece decoded 3 peripheral pieces on every side, whether judge these peripheral pieces encodes with the motion-vector of other pieces, its result, if a certain peripheral piece is the piece that has carried out coding with the motion-vector of other pieces, be the piece that has carried out coding with the direct mode or the spatial direct mode of timeliness, so, the same with the motion vector coding portion 117 of the 1st execution mode, the motion-vector that to obtain with the motion-vector of other pieces for this periphery piece is decoded is as the motion-vector use of this periphery piece.
Specifically, motion vector decoding portion 711, carried out with the direct mode of timeliness at peripheral piece under the situation of coding, decoded before from motion-vector storage part 706, reading out in reference in the image (frame P13), be positioned at and the locational identical motion-vector of peripheral piece of having encoded with direct mode.For example shown in Figure 11, suppose that peripheral piece C encodes with the direct mode of timeliness, the decoded motion-vector of the piece X of frame P13 is read by motion vector decoding portion 711 from motion-vector storage part 706 so.And, with (formula 1) and (formula 2), obtain and be used for the place ahead motion-vector MVFc and rear motion-vector MVBc that peripheral piece C is encoded, this motion-vector MVFc, MVBc are used as the motion-vector of peripheral piece C.
And, in these cases, motion-vector MVp the frame P13, that be positioned at the locational piece X identical with the peripheral piece C that has encoded with direct mode reads from motion-vector storage part 706 in motion vector decoding portion 711, but also with by motion-vector storage part 706, motion-vector with other pieces is carried out the piece of encoding, stored the motion-vector of obtaining according to the motion-vector of other pieces for this piece is decoded in advance.In the case, motion-vector storage part 706 is stored motion-vector MVFc, MVBc in advance, so, motion vector decoding portion 711 is when encoding to the motion-vector of coded object piece A, needn't read the motion-vector MVp of piece X to peripheral piece C, obtain motion-vector MVFc, MVBc with (formula 1) and (formula 2), MVFc, the MVBc of the motion-vector that can directly motion-vector storage part 706 be stored uses as the motion-vector of peripheral piece C.
On the other hand, carried out with spatial direct mode at peripheral piece under the situation of coding, motion vector decoding portion 711 is obtaining next motion-vector with the motion-vector that is positioned at this periphery piece other pieces on every side, as the motion-vector use of this piece.For example, under situation shown in Figure 12, motion vector decoding portion 711, to carried out the peripheral piece C of coding with spatial direct mode, according to be positioned at 3 piece E, the F having encoded around it, the motion-vector of G is obtained intermediate value, this intermediate value represented the place ahead motion-vector MVFc and rear motion-vector MVBc, as the motion-vector use of this periphery piece C.
And, motion-vector storage part 706, motion-vector without other pieces has been carried out the piece of coding, be stored in employed motion-vector in the decoding of this piece, so, under situation shown in Figure 12,3 piece E, F around the peripheral piece C that storage has been encoded with spatial direct mode, each motion-vector of G; Motion vector decoding portion 711 is when decoding to the motion-vector of decoder object piece A, and to this periphery piece C, above-mentioned 3 piece E, the F that stored according to motion-vector storage part 706, the motion-vector of G are obtained motion-vector MVFc, MVBc.And, also can be by motion-vector storage part 706, for the motion vector coding that uses other pieces piece, will get intermediate value for this piece is decoded and obtain the motion-vector that comes, store in advance.In the case, under situation shown in Figure 12, motion-vector storage part 706 is stored motion-vector MVFc, MVBc in advance; Motion vector decoding portion 711, when the motion-vector of coded object piece A is decoded, to the peripheral piece C that has encoded with spatial direct mode, needn't obtain motion-vector, and motion-vector MVFc, the MVBc that can directly motion-vector storage part 706 be stored, as the motion-vector use of this periphery piece C.
At this, dynamic image decoding device 700, when the motion-vector of decoder object piece was decoded, the peripheral piece of having decoded that is positioned at around it was not to handle with above-mentioned inter prediction encoding, but under the situation of having carried out handling with intraframe coding, the processing that makes an exception.
For example, have in 3 peripheral pieces under the situation of 1 peripheral piece that has carried out coding with intraframe coding, the motion vector decoding portion 711 of dynamic image decoding device 700 is made as 0 with the motion-vector of this periphery piece and handles.And under the situation that 2 peripheral pieces that carried out coding with inner frame coding method are arranged, motion vector decoding portion 711 is the motion-vector of a remaining peripheral piece, as the predicted value use of the motion-vector of decoder object piece.Moreover, all be to have carried out with intraframe coding under the situation of coding at 3 peripheral pieces, motion vector decoding portion 711 is made as 0 to the predicted value of the motion-vector of coded object piece, and this motion-vector is carried out decoding processing.
On the other hand, the pairing coded prediction error data of the macro block of the decoder object of frame B11 are decoded at predicated error lsb decoder 702, the generation forecast error image, switch 709,710 is connected on the addition operation division 708, so, according at the decoded motion compensation image that motion-vector generated of motion vector decoding portion 711, be added on this prediction error image after, output in the frame memory 707.
Afterwards, by same processing, the residue macro block of frame B11 is carried out decoding successively.And,, then carry out the decoding of frame B12 in case the macro block of frame B11 is whole decoded.
As mentioned above, motion vector decoding method of the present invention when the motion-vector of each piece is decoded, is derived predicted value according to the motion-vector of decoded peripheral piece, and by using this predicted value and difference value, motion-vector is decoded.And, the periphery piece utilizes under the situation that the motion-vector of other pieces encodes the motion-vector that will obtain according to the motion-vector of other pieces for this periphery piece is decoded as jumping mode and direct mode, motion-vector as this periphery piece uses, and derives predicted value.
Like this, can correctly decode to carried out the motion-vector of coding with the method for the 1st execution mode.
And, in the present embodiment, illustrated and to have obtained next intermediate value according to the motion-vector of decoded 3 peripheral pieces, the situation of the predicted value use during as motion vector decoding, but should periphery piece number also can be other numbers beyond 3, the determining method of predicted value also can be an additive method.For example, also can be the motion-vector of left adjacent piece as the method for predicted value, also can be with the method for mean value etc. without intermediate value.
And, in the present embodiment, utilize Fig. 3, Fig. 4 that the position of the peripheral piece in the motion vector decoding has been described, but this also can be other positions.
Moreover, in embodiment of the present invention, be example with the direct mode and the spatial direct mode of jumping mode or timeliness, illustrated that the motion-vector that utilizes other pieces carries out Methods for Coding to piece, but this also can be an additive method.
And, illustrated in the present embodiment by carrying out add operation to the predicted value that obtains according to the motion-vector of peripheral piece with by the difference value that code sequence is represented, the situation that motion-vector is decoded, but also can utilize the method beyond the addition that motion-vector is decoded.
Moreover, in the present embodiment, illustrated under the situation of peripheral piece having been carried out coding with spatial direct mode, obtained the intermediate value of the motion-vector that is positioned at this periphery piece decoded 3 pieces on every side, the situation of this intermediate value as the motion-vector use of peripheral piece.But this piece number also can be other numbers beyond 3, and the determining method of motion-vector also can be an additive method.For example, also can be the motion-vector of left adjacent piece as the method that the motion-vector of peripheral piece uses, also can be with the method for mean value etc. without intermediate value.
Moreover, in the present embodiment, under situation with the peripheral piece that has carried out coding with spatial direct mode, this periphery piece has been obtained 2 motion-vectors of fore-and-aft direction, but also can obtain the place ahead to or the rear to 2 motion-vectors of a direction.In the case, the B frame of decoder object is with reference to respect to this image forwardly or 2 images on the direction at rear.
And, in the present embodiment, following situation has been described: when the decoding of P frame, with reference to a predetermined image (for example in the decoding of frame P13, reference frame P10), in the decoding of B frame, with reference to 2 predetermined images (for example reference frame P10 and P13 in frame B11 decoding), decode.But also can from a plurality of images, select the image of macro block or the reference of each piece institute, decode.In this case, for generating the predicted value of motion-vector, can be undertaken by method shown in Figure 17.
Figure 17 is an action flow chart, and it is illustrated under the situation of each piece selection with reference to image, by motion vector decoding portion 711, derives the motion vector prediction value of decoder object piece, and the action that utilizes this predicted value to decode.
At first, motion vector decoding portion 711 selected be positioned at around the decoder object piece, decoded 3 peripheral pieces (S400 step).
And motion vector decoding portion 711 judges that this each chosen peripheral piece is the peripheral piece Ba that has carried out coding with the motion-vector of other pieces, has still carried out the peripheral piece Bb (S402 step) of coding without the motion-vector of other pieces.
At this, 711 couples of peripheral piece Ba of motion vector decoding portion, obtain in this decoding the motion-vector that uses and represent this periphery piece Ba with reference to which with reference to the information of image, the motion-vector use of employed motion-vector in this decoding as peripheral piece Ba; To peripheral piece Bb, obtain the motion-vector of this periphery piece Bb and represent this periphery piece Bb with reference to which with reference to the information (S404 step) of image.
Then, motion vector decoding portion 711 selectes in 3 peripheral pieces and the peripheral piece (S406 step) of decoder object piece with reference to identical image according to the information that obtains in the S404 step, judges the quantity (S408 step) of the peripheral piece that this is chosen.
And motion vector decoding portion 711 is if the number of the peripheral piece of judging in the S408 step is 1, so the motion-vector with reference to this peripheral piece of identical image, as the predicted value (S410 step) of the motion-vector of decoder object piece.
Moreover, if beyond the quantity of the peripheral piece that the S408 step is judged is 1, so, motion vector decoding portion 711, the motion-vector of the peripheral piece of the image that reference in 3 peripheral pieces is different with the decoder object piece, be made as 0 (S412 step), with the intermediate value of the motion-vector of 3 peripheral pieces, as the predicted value (S414 step) of the motion-vector of decoder object piece.
Like this, utilize the predicted value of deriving in S410 step or S414 step, on this predicted value, add difference value, be decoded into the motion-vector (S416 step) of decoder object piece.
And, shown in present embodiment, the motion-vector of piece adjacent from the space is being used as predicted value, under the situation that motion-vector is decoded, the amount of the motion-vector of in motion-vector storage part 706, preserving for motion-vector is decoded, in motion-vector storage part 706, preserve under the situation of the actual motion-vector that in motion compensation, has utilized by jumping mode or direct mode, can preserve the piece motion-vector of the amount of 1 macro-block line (highly being a macro block, horizontal wide and the wide zone that equates of picture horizontal stroke).This be because, in motion-vector storage part 706, preserve by jumping mode or direct mode under the situation of the actual motion-vector that in motion compensation, has utilized, use the occasion of the peripheral piece that has illustrated with Fig. 3 and Fig. 4 in the present embodiment, the piece that is referenced as peripheral piece during to motion vector decoding is, with current macro block is starting point, is the amount of past 1 slice of macroblocks.
[the 3rd execution mode]
Moreover, by being used to realize the program of motion vector coding method shown in the respective embodiments described above or motion vector decoding method, record on the recording mediums such as floppy disk, can independently be implemented in the processing shown in the respective embodiments described above simply in the computer system.
Figure 18 is the key diagram of relevant stored program recording medium, this program is used for by computer system, realizes motion vector coding method and motion vector decoding method that the moving picture encoding device 100 of the 1st execution mode and the 2nd execution mode and dynamic image decoding device 200 are performed.
Outward appearance, section structure and disc main body FD1 that (b) expression among Figure 18 is seen from the front of floppy disk FD, (a) expression among Figure 18 is as the physical format example of the disc main body FD1 of recording medium main body.
Disk body FD1 is installed in the shell F, on the surface of disk body FD1, has formed a plurality of track Tr with concentric circles from inside week of periphery, and each track is divided into 16 sector Se on angle direction.So on the floppy disk FD of storage said procedure, write down motion vector coding method and motion vector decoding method in the zone of on above-mentioned disk body FD1, cutting apart as said procedure.
And (c) among Figure 18 expression is used for the structure of record and playback said procedure on floppy disk FD.
Under the situation of record said procedure on the floppy disk FD, computer system Cs writes motion vector coding method or motion vector decoding method as said procedure by floppy disk FDD.And, constructing under the situation of above-mentioned motion vector coding method and motion vector decoding method in computer system Cs according to the program in the floppy disk FD, utilize floppy disk FDD read routine from floppy disk FD, and send it in the computer system Cs.
And in the above description, FD is illustrated as recording medium with floppy disk, but equally also can use CD.And recording medium is not limited in this, IC-card, ROM card etc. so long as medium that can logging program can implement equally.
[the 4th execution mode]
Moreover, in motion vector coding method and the application examples of motion vector decoding method and the system that uses described method shown in this explanation in the above-described embodiment.
Figure 19 is that expression realizes that content sends the integrally-built block diagram of the content provider system ex100 of service.The zoning that provides of communication service is divided into required size, in each unit, is provided with base station ex107~ex110 respectively as fixed radio station.
This content provider system ex100, for example in the Internet ex101, by Internet Service Provider ex102 and telephone network ex104 and base station ex107~ex110, connected: the various machines such as mobile phone ex115 of computer cx111, PDA (personal digital assistant) ex112, video camera ex113, mobile phone ex114, band video camera.
But content provider system ex100 is not limited to the such combination of Figure 19, also can be the form of arbitrary device of being connected.And, also can on telephone network ex104, directly connect various machines not by base station ex107~ex110 as fixed radio station.
Video camera ex113 is the machine that digital code camera etc. can shooting motion.And, mobile phone can be the portable telephone set or PHS (the Personal HandyphoneSystem of PDC (personal Digital Communications) mode, CDMA (CodeDivision Multiple Access) mode, W-CDMA (Wideband-Code DivisionMultiple Access) mode or GSM (Global System for MobileCommunications) mode, Personal Handy Phone System) etc., any all can more than.
Moreover streaming server ex103 connects by base station ex109, telephone network 104 from video camera ex113, can utilize video camera ex113 realizes sending according to the user, the scene transmission carried out of the data of encoding process etc.The encoding process of photographed data both can be carried out with video camera ex113, also can carry out with carrying out server that data transmission handles etc.And the animation data with video camera 116 is taken also can be sent in the streaming server ex103 by computer ex111.Video camera ex116 is the machine that can take still frame, animation of camcorder etc.In the case, the coding of animation data both can carry out with camera ex116, also can carry out with computer ex111.And encoding process is handled in the LSIex117 that computer ex111 or video camera ex116 are had.And, also the software of image encoding, decoding usefulness can be assembled in any medium (CD-ROM, floppy disk and hard disk etc.) of the recording medium that reads as general-purpose computers ex111 etc.And, also can utilize the mobile phone ex115 that has video camera to send animation data.At this moment animation data is the data that LSI that mobile phone ex115 is had carries out encoding process.
In this content provider system ex100, utilize the same encoding process of carrying out of content (for example taking the image at music scene etc.) of shootings such as video camera ex113, video camera ex116 with above-mentioned execution mode by the user, send to streaming server ex103, on the other hand, streaming server ex103 carries out the streaming distribution to the foregoing data to the client computer that request is arranged.Have as client computer: can decode to the data of above-mentioned encoding process, computer ex111, PDAex112, video camera ex113, mobile phone ex114 etc.So, the content provider system ex100 coded data that can on client computer, receive and reset, and be a kind of can be by in client computer, receiving in real time, decode, and reset, thereby can realize the system of personal broadcaster.
Constitute coding, the decoding of each machine of this system, can adopt moving picture encoding device shown in the respective embodiments described above or dynamic image decoding device.
Mobile phone is described as an example.
Figure 20 is the figure that the mobile phone ex115 of the motion vector coding method that illustrates in the above-mentioned execution mode and motion vector decoding method is used in expression.Mobile phone ex115 has: be used for and base station ex110 between the transmitting-receiving electric wave antenna ex201, energy such as CCD camera filmed image, the video camera ex203 of rest image, image by the ex203 of video camera portion shooting, the display part ex202 such as LCD that data to the image that received by antenna ex201 etc. after decoded show, the main part that constitutes by operation keys ex204 group, the audio output units such as loud speaker 208 that are used for voice output, the sound input part ex205 such as microphone that are used for the sound input, the animation of taking or the data of quiet picture, the data of the mail that receives are used for the data that animation data or Still image data etc. has been encoded or recording medium ex207 that the data of having decoded are preserved, and be used for and be installed to notch ex206 on the mobile phone ex115 to recording medium ex207.Recording medium ex207 is a kind of non-volatility memorizer that can electrically rewrite or eliminate in plastic casings such as SD card, promptly as a kind of flash memory component of EEPROM (Electrically Erasable and Prigrammable Read Only Memory).
Moreover, with Figure 21 mobile phone ex115 is described.Mobile phone ex115, constituting and can the each several part of main part with display part ex202 and operation keys ex204 carried out on the master control part ex311 of Comprehensive Control, power circuit part ex310, operation input control part ex304, the ex312 of image encoding portion, video camera interface portion ex303, LCD (Liquid Crystal Display) control part ex302, the ex309 of picture decoding portion, multiple separated part ex308, the ex307 of record reproducing portion, the ex306 of modulation-demodulation circuit portion and sound handling part ex305, ex313 is connected to each other by synchronous bus.
Power circuit part ex310, in case the words of the operation by the user eventually and power key when becoming on-state, then from battery pack to the each several part supply capability, thus, making the digital mobile phone ex115 starting that has video camera is workable state.
Mobile phone ex115, control according to the master control part ex311 that constitutes by CPU, ROM and RAM etc., utilize the ex305 of acoustic processing portion that the voice signal of being collected by sound input part ex205 when the sound talking mode is transformed into digital audio data, and utilize the ex306 of modulation-demodulation circuit portion that it is carried out frequency spectrum diffusion and handle, utilizing the ex301 of transmission circuit portion to carry out digitaltoanalogconversion handles and frequency conversion process, then, send by antenna ex201.And, mobile phone ex115, when the sound talking mode, the received signal that is received by antenna ex201 is amplified, carrying out frequency conversion process and analog-to-digital conversion handles, utilizing the ex306 of modulation-demodulation circuit portion to carry out the frequency spectrum back-diffusion handles, utilize the ex305 of acoustic processing portion to be transformed into analoging sound signal, then, ex208 exports it by audio output unit.
Moreover, when data communication mode, under the situation of send Email, the text data of the Email of the operation of the operation keys ex204 by main part input, ex304 sends in the master control part ex311 by operation input control part.Master control part ex311 carries out frequency spectrum diffusion at the ex306 of modulation-demodulation circuit portion to text data and handles, and carries out digital to analog conversion processing and frequency conversion process at the ex301 of transmission circuit portion, afterwards, sends to base station ex110 by antenna ex201.
When data communication mode, send under the situation of view data,, supply in the ex312 of image encoding portion by video camera interface portion ex303 the view data of taking pictures by the ex203 of video camera portion.And, under the situation that does not send view data, also can directly be presented on the display part ex202 passing through ex303 of camera interface portion and LCD control part ex303 by the ex203 of video camera portion shot image data.
The ex312 of image encoding portion is the structure with picture coding device of the present invention's explanation, to the view data of supplying with from the ex203 of video camera portion, carry out compressed encoding by employed coding method in the picture coding device shown in the utilization in the above-described embodiment, be transformed into coded image data, and send it in the multiple separated part ex308.And at this moment, mobile phone ex115 will be sent among the multiple separated part ex308 as digital audio data by the ex305 of acoustic processing portion by the ex203 of video camera portion sound with sound input part ex205 collection when taking simultaneously.
Multiple separated part ex308 is in set mode, to carry out multipleization from the coded image data of the ex312 of image encoding portion supply with from the voice data that the ex305 of acoustic processing portion supplies with, to the resulting multipleization data of its result, utilizing the ex306 of modulation-demodulation circuit portion to carry out frequency spectrum diffusion handles, and after the ex301 of transmission circuit portion implemented digital to analog conversion processing and frequency conversion process, ex201 sent by antenna.
Under the animation file data conditions that receive when data communication mode and homepage etc. is linked, utilize the ex306 of modulation-demodulation circuit portion, come that the received signal that receives from base station ex110 by antenna ex201 is carried out the frequency spectrum back-diffusion and handle, and the multipleization data that its result is obtained send in the multiple separated part ex308.
And, for the multipleization data that receive by antenna ex201 are decoded, multiple separated part ex308 is by separating multipleization data, be divided into the coding stream of view data and the coding stream of voice data, by synchronous bus ex313 this coded image data is supplied in the ex309 of picture decoding portion, simultaneously, this voice data is supplied in the ex305 of acoustic processing portion.
Then, the ex309 of picture decoding portion is the structure with the picture decoding apparatus that illustrates among the present invention, utilize with at the corresponding coding/decoding method of the shown coding method of above-mentioned execution mode, coding stream to view data is decoded, generate the playback dynamic image data, it is supplied with in the display part ex202 by LCD control part ex302, like this, for example demonstrate animation data included in the dynamic image file that links with homepage.Simultaneously, the ex305 of acoustic processing portion supplies to it in audio output unit ex208 after voice data is transformed into analoging sound signal, thus, and the voice data that is comprised in the dynamic image file that is linked with homepage of for example resetting.
And, be not limited to the example of said system, recently, digital broadcasting according to satellite, surface wave has become topic, as shown in figure 22, with in the system, also can make up some in the picture coding device at least of above-mentioned execution mode or the picture decoding apparatus in digital broadcasting.Specifically, in the ex406 of broadcasting station, the coding stream of image information is transferred on communication or the broadcasting satellite ex410 by electric wave.To its broadcasting satellite ex410 that receives emission broadcasting electric wave, the antenna ex406 that utilization has the family of satellite broadcasting receiving equipment receives this electric wave, utilize devices such as TV (receiver) ex401 or set-top box (STB) ex407 that coding stream is decoded, it is reset.And, on the replay device ex403 that the coding stream that writes down on to medium ex402 such as recording medium CD or DVD reads, decodes, also can be installed in the picture decoding apparatus shown in the above-mentioned execution mode.In the case, the signal of video signal of being reset is presented on the monitor ex404.And, also can adopt such structure, promptly in the set-top box ex407 that on the antenna ex406 of cable ex405 that cable TV is used or the broadcasting of satellite/terrestrial ripple, is connected, picture decoding apparatus is installed, with the monitor ex408 of the TV above-mentioned picture signal of resetting.At this moment, also can be assembled into picture decoding apparatus in the television set rather than in the set-top box.And, also can utilize car ex412 with antenna ex411, from satellite 410 or from received signals such as base station ex107, also can be shown to animation on the display unit of automobile guiding device ex413 that car ex412 has etc.
Moreover, also can utilize the picture coding device shown in the above-mentioned execution mode that picture signal is encoded, and it is recorded on the recording medium.Object lesson has: the DVD register of recording image signal and the register ex420 such as hdd recorder that write down on hard disk on DVD CD ex421.In addition, also can record on the SD card ex422.If register ex420 has the picture decoding apparatus shown in the above-mentioned execution mode, so, can playback of DVD CD ex421 and SD card ex422 on the picture signal that write down, and on monitor ex408, show.
And the structure of automobile navigation apparatus ex413 can be for example in structure shown in Figure 21, removes the structure of the ex203 of video camera portion, video camera interface portion ex303, the ex312 of image encoding portion.Also can adopt this structure to computer ex111 and television receiver ex401 etc.
And the terminal of above-mentioned mobile phone ex114 etc. has 3 kinds of installation forms, promptly except having encoder, both transceiver type terminals of decoder, the transmission terminal of encoder and the receiving terminal that decoder is only arranged is only arranged in addition.
As above, motion vector coding method or the motion vector decoding method shown in the above-mentioned execution mode above-mentioned any machine, system can be used for, thus, effect illustrated in the above-mentioned execution mode can be obtained.
Relate to motion vector coding method of the present invention and motion vector decoding method, dynamic image decoding device that is applicable to moving picture encoding device that dynamic image is encoded and the dynamic image that has been encoded is decoded and the system with these devices for example are used to supply with the content provider system and the digital broadcasting system of contents such as copyright.