Program

The proposed method improves moving image encoding efficiency by strategically encoding and decoding flags and parameters related to temporal motion vector prediction, addressing errors and enhancing decoding processes.

JP7696110B2Active Publication Date: 2025-06-20SUN PATENT TRUST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024106197
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2012-03-06
Filing Date
2024-07-01
Publication Date
2025-06-20
Estimated Expiration
2033-02-28

AI Technical Summary

Technical Problem

Existing moving image encoding and decoding methods face challenges in improving encoding efficiency, particularly in inter-predictive encoding where temporal motion vector prediction can lead to errors due to lost reference picture information.

Method used

A method that includes encoding a flag indicating whether temporal motion vector prediction is used, encoding a parameter for calculating the temporal prediction motion vector when prediction is used, and deriving prediction motion vector candidates with or without the temporal prediction motion vector based on the flag.

Benefits of technology

This approach enhances encoding efficiency by avoiding unnecessary parameter encoding when temporal motion vector prediction is not used, thereby preventing error propagation and improving decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007696110000004
    Figure 0007696110000004
  • Figure 0007696110000005
    Figure 0007696110000005
  • Figure 0007696110000006
    Figure 0007696110000006
Patent Text Reader

Abstract

To improve coding efficiency.SOLUTION: A program causes a computer to execute a video image decoding method, the video image decoding method including: decoding a temporal predictive restriction flag indicating whether temporal motion vector prediction is used or not (S211); decoding a first parameter for specifying a prediction direction for calculating a temporal predictive motion vector (S213) when the temporal predictive restriction flag indicates that the temporal motion vector prediction is used (Yes in S212); deriving a plurality of first predictive motion vector candidates including the temporal predictive motion vector on the basis of the prediction direction specified by the first parameter (S214); and deriving a plurality of second predictive motion vector candidates not including the temporal predictive motion vector (S217) when the temporal predictive restriction flag indicates that the temporal motion vector prediction is not used (No in S212).SELECTED DRAWING: Figure 21
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a moving image encoding method and a moving image decoding method.

Background Art

[0002] In moving image encoding processing, generally, compression of the amount of information is performed by utilizing the redundancy in the spatial direction and the temporal direction that a moving image has. Here, generally, as a method of utilizing the redundancy in the spatial direction, conversion into the frequency domain is used. Further, as a method of utilizing the redundancy in the temporal direction, inter-picture prediction (hereinafter referred to as inter prediction) encoding processing is used (see, for example, Non-Patent Document 1).

Prior Art Documents

Non-Patent Documents

[0003]

Non-Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] In such a moving image encoding method and a moving image decoding method, it is desired to improve the encoding efficiency.

[0005] Therefore, an object of the present invention is to provide a moving image encoding method and a moving image decoding method capable of improving the encoding efficiency.

Means for Solving the Problems

[0006] In order to achieve the above object, a program according to an aspect of the present invention is a program for causing a computer to execute a moving image decoding method for inter-predictive decoding a decoding target block included in a decoding target picture using a motion vector, wherein the moving image decoding method decodes a temporal prediction restriction flag indicating whether temporal motion vector prediction using a temporal prediction motion vector, which is a motion vector of a block included in a decoded picture different from the decoding target picture, is used, and when the temporal prediction restriction flag indicates that the temporal motion vector prediction is used, decodes a first parameter for specifying a prediction direction in order to calculate the temporal prediction motion vector, derives a plurality of first prediction motion vector candidates including the temporal prediction motion vector based on the prediction direction specified by the first parameter, decodes a motion vector used for inter-predictive decoding of the decoding target block using one of the plurality of first prediction motion vector candidates, when the temporal prediction restriction flag indicates that the temporal motion vector prediction is not used, derives a plurality of second prediction motion vector candidates not including the temporal prediction motion vector, decodes a motion vector used for inter-predictive decoding of the decoding target block using one of the plurality of second prediction motion vector candidates, and when the temporal prediction restriction flag indicates that the temporal motion vector prediction is not used, does not decode the first parameter.

[0007] Note that these general or specific aspects may be realized by a system, a method, an integrated circuit, a computer program, or a recording medium such as a computer-readable CD-ROM, or may be realized by any combination of a system, a method, an integrated circuit, a computer program, and a recording medium.

Advantages of the Invention

[0008] The present invention can provide a moving image encoding method and a moving image decoding method capable of improving the encoding efficiency.

Brief Description of the Drawings

[0009]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8A

Figure 8B

Figure 9

Figure 10

Figure 11A

Figure 11B

Figure 12A

Figure 12B

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Figure 18

Figure 19A

Figure 19B

Figure 20

Figure 21

Figure 22

Figure 23

Figure 24

Figure 25

Figure 26

Figure 27

Figure 28

Figure 29

Figure 30

Figure 31A

Figure 31B

Figure 32

Figure 33

Figure 34

Figure 35

Figure 36

Figure 37

Figure 38

Figure 39

Figure 40

Figure 41

Figure 42

Figure 43

Figure 44A

Figure 44B

[0010] (Knowledge Underlying the Present Invention) The inventor of the present invention has found that the following problems occur in the conventional technology.

[0011] In inter prediction encoding processing, when an moving image encoding apparatus encodes a certain picture, an encoded picture that is ahead or behind the picture to be encoded in the display order (display time order) is used as a reference picture for the picture to be encoded. Then, the moving image encoding apparatus derives a motion vector by detecting the motion of the picture to be encoded with respect to the reference picture, and calculates the difference between the predicted image data obtained by performing motion compensation based on the motion vector and the image data of the picture to be encoded. Thereby, redundancy in the time direction is removed. Here, in motion detection, the moving image encoding apparatus calculates a difference value between an encoding target block in the picture to be encoded and a block in the reference picture, and selects the block in the reference picture with the smallest difference value as the reference block. Then, the moving image encoding apparatus detects a motion vector using the encoding target block and the reference block.

[0012] In the already standardized video encoding method called H.264, three types of picture types, namely I picture, P picture, and B picture, are used for information volume compression. An I picture is a picture in which inter-prediction encoding processing is not performed, that is, only intra-prediction (hereinafter referred to as intra-prediction) encoding processing is performed. A P picture is a picture in which inter-prediction encoding is performed by referring to only one already encoded picture that is in front of or behind the picture to be encoded in the display order. A B picture is a picture in which inter-prediction encoding is performed by referring to two already encoded pictures that are in front of or behind the picture to be encoded in the display order.

[0013] Also, in the video encoding method called H.264, as an inter-prediction encoding mode for each encoding target block in a B picture, a motion vector detection mode that encodes the difference value of the image data between the predicted image data and the encoding target block and the motion vector used for generating the predicted image data is used. In the motion vector detection mode, the video encoding device can select either bidirectional prediction that generates a predicted image by referring to two already encoded pictures that are in front of or behind the picture to be encoded as the prediction direction or unidirectional prediction that generates a predicted image by referring to one already encoded picture that is in front of or behind.

[0014] Also, in the video encoding method called H.264, in the encoding of a B picture, the video encoding device can select an encoding mode called temporal motion vector prediction (temporal prediction motion vector mode or temporal direct mode) when deriving a motion vector. Also, the predicted motion vector (predicted motion vector candidate) generated by temporal motion vector prediction is called a temporal prediction motion vector.

[0015] The inter-prediction encoding method in temporal motion vector prediction will be described with reference to FIG. 1. FIG. 1 is an explanatory diagram showing the motion vector in temporal motion vector prediction, and shows the case of encoding the block a of picture B2 by temporal motion vector prediction.

[0016] In this case, the motion vector vb of block b located at the same position as block a in picture P3, which is a reference picture behind picture B2, is used. The motion vector vb is the motion vector used when block b was encoded and refers to picture P1. Then, the moving image encoding device uses a motion vector parallel to the motion vector vb to obtain reference blocks from picture P1, which is a forward reference picture, and picture P3, which is a backward reference picture, and encodes block a by performing two-way prediction. That is, the motion vector used when encoding block a is motion vector va1 with respect to picture P1 and motion vector va2 with respect to picture P3.

[0017] However, in such temporal motion vector prediction, when information on the reference picture having information such as the motion vector used in calculating the temporal predicted motion vector is lost due to, for example, packet loss in streaming distribution or the like, it becomes impossible to calculate the correct temporal predicted motion vector, resulting in degradation of the decoded image. Furthermore, since the error propagates to the picture referring to the decoded image, as a result, the decoding process may stop in some cases. For example, when the information on reference picture P3 in FIG. 1 is lost, it becomes impossible to calculate the temporal predicted motion vector of picture B2. As a result, picture B2 may not be decoded correctly, and the decoding process may stop.

[0018] Therefore, in the present embodiment, a moving image encoding method and a moving image decoding method capable of effectively preventing the propagation of errors in the decoding process will be described.

[0019] Also, in such a moving image encoding method and a moving image decoding method, it is desired to improve the encoding efficiency.

[0020] Therefore, in the present embodiment, a moving image encoding method and a moving image decoding method capable of improving the encoding efficiency will be described.

[0021] A moving image encoding method according to an aspect of the present invention is a moving image encoding method for inter-predictive encoding an encoding target block included in an encoding target picture using a motion vector, comprising: a flag encoding step of encoding a first flag indicating whether or not temporal motion vector prediction using a temporal prediction motion vector, which is a motion vector of a block included in an encoded picture different from the encoding target picture, is used; a parameter encoding step of encoding a first parameter for calculating the temporal prediction motion vector when the first flag indicates that the temporal motion vector prediction is used; a first candidate derivation step of deriving a plurality of first prediction motion vector candidates including the temporal prediction motion vector using the first parameter; a first motion vector encoding step of encoding a motion vector used for inter-predictive encoding of the encoding target block using one of the plurality of first prediction motion vector candidates; a second candidate derivation step of deriving a plurality of second prediction motion vector candidates not including the temporal prediction motion vector when the first flag indicates that the temporal motion vector prediction is not used; and a second motion vector encoding step of encoding a motion vector used for inter-predictive encoding of the encoding target block using one of the plurality of second prediction motion vector candidates, wherein when the first flag indicates that the temporal motion vector prediction is not used, the first parameter is not encoded.

[0022] According to this, when the moving image encoding method does not use the temporal motion vector prediction, it does not encode an unnecessary first parameter. Thereby, the moving image encoding method can improve the encoding efficiency.

[0023] For example, the first parameter may include a parameter for specifying the encoded picture.

[0024] For example, the first parameter may include a reference picture index for identifying the encoded picture among a plurality of pictures indicated by a reference picture list used for encoding the picture to be encoded.

[0025] For example, the first parameter may include a flag indicating which reference picture list to use for identifying the encoded picture among a plurality of reference picture lists used for encoding the picture to be encoded.

[0026] For example, in the first or second candidate derivation step, an alternative vector replacing the temporal prediction motion vector may be included in the plurality of first prediction motion vectors or the plurality of second prediction motion vectors.

[0027] According to this, the moving image encoding method can suppress a decrease in encoding efficiency.

[0028] For example, the moving image encoding method is a method for encoding pictures belonging to a base view and a dependent view included in a multi-view video, and further includes a disparity vector generation step of generating a disparity vector corresponding to a disparity between the base view and the dependent view. In the first candidate derivation step, when the picture to be encoded belongs to the dependent view and is a picture at the head of a GOP (Group Of Pictures), the disparity vector may be included as the alternative vector in the plurality of first prediction motion vectors.

[0029] According to this, the moving image encoding method can suppress a decrease in encoding efficiency.

[0030] For example, the moving image encoding method is a method for encoding pictures belonging to each of a basic view and a dependent view included in a multi-view video, and further includes a disparity vector generation step of generating a disparity vector corresponding to a disparity between the basic view and the dependent view. In the second candidate derivation step, the disparity vector may be included as the alternative vector in the plurality of second predicted motion vectors.

[0031] According to this, the moving image encoding method can suppress a decrease in encoding efficiency.

[0032] Also, a moving image decoding method according to an aspect of the present invention is a moving image decoding method for performing inter-prediction decoding of a decoding target block included in a decoding target picture using a motion vector, including a flag decoding step of decoding a first flag indicating whether or not temporal motion vector prediction using a temporal prediction motion vector, which is a motion vector of a block included in a decoded picture different from the decoding target picture, is used; a parameter decoding step of decoding a first parameter for calculating the temporal prediction motion vector when the first flag indicates that the temporal motion vector prediction is used; a first candidate derivation step of deriving a plurality of first predicted motion vector candidates including the temporal prediction motion vector using the first parameter; a first motion vector decoding step of decoding a motion vector used for inter-prediction decoding of the decoding target block using one of the plurality of first predicted motion vector candidates; a second candidate derivation step of deriving a plurality of second predicted motion vector candidates not including the temporal prediction motion vector when the first flag indicates that the temporal motion vector prediction is not used; and a second motion vector decoding step of decoding a motion vector used for inter-prediction decoding of the decoding target block using one of the plurality of second predicted motion vector candidates. When the first flag indicates that the temporal motion vector prediction is not used, the first parameter is not decoded.

[0033] According to this, when the moving image decoding method does not use temporal motion vector prediction, it does not decode the unnecessary first parameter. Thereby, the moving image decoding method can improve the encoding efficiency.

[0034] For example, the first parameter may include a parameter for specifying the decoded picture.

[0035] For example, the first parameter may include a reference picture index for specifying the decoded picture among a plurality of pictures indicated by a reference picture list used for decoding the picture to be decoded.

[0036] For example, the first parameter may include a flag indicating which reference picture list to use for specifying the encoded picture among a plurality of reference picture lists used for decoding the picture to be decoded.

[0037] For example, in the first or second candidate derivation step, an alternative vector replacing the temporal prediction motion vector may be included in the plurality of first prediction motion vectors or the plurality of second prediction motion vectors.

[0038] According to this, the moving image decoding method can suppress a decrease in encoding efficiency.

[0039] For example, the moving image decoding method is a method for decoding pictures belonging to each of a base view and a dependent view included in a multi-view video, and further includes a disparity vector generation step of generating a disparity vector corresponding to a disparity between the base view and the dependent view. In the first candidate derivation step, when the picture to be decoded belongs to the dependent view and is a picture at the head of a GOP (Group Of Pictures), the disparity vector may be included as the alternative vector in the plurality of first prediction motion vectors.

[0040] According to this, the moving image decoding method can suppress a decrease in encoding efficiency.

[0041] For example, the moving image decoding method is a method for decoding pictures belonging to each of a basic view and a dependent view included in a multi-view video, and further includes a parallax vector generation step for generating a parallax vector corresponding to a parallax between the basic view and the dependent view. In the second candidate derivation step, the parallax vector may be included as the alternative vector in the plurality of second predicted motion vectors.

[0042] According to this, the moving image decoding method can suppress a decrease in encoding efficiency.

[0043] Further, a moving image encoding apparatus according to an aspect of the present invention includes a control circuit and a storage device electrically connected to the control circuit, and is a moving image encoding apparatus that performs inter-prediction encoding of an encoding target block included in an encoding target picture using a motion vector. The control circuit includes a flag encoding step of encoding a first flag indicating whether or not temporal motion vector prediction using a temporal prediction motion vector, which is a motion vector of a block included in an encoded picture different from the encoding target picture, is used; a parameter encoding step of encoding a first parameter for calculating the temporal prediction motion vector when the first flag indicates that the temporal motion vector prediction is used; a first candidate derivation step of deriving a plurality of first prediction motion vector candidates including the temporal prediction motion vector using the first parameter; a first motion vector encoding step of encoding a motion vector used for inter-prediction encoding of the encoding target block using one of the plurality of first prediction motion vector candidates; a second candidate derivation step of deriving a plurality of second prediction motion vector candidates not including the temporal prediction motion vector when the first flag indicates that the temporal motion vector prediction is not used; and a second motion vector encoding step of encoding a motion vector used for inter-prediction encoding of the encoding target block using one of the plurality of second prediction motion vector candidates. When the first flag indicates that the temporal motion vector prediction is not used, the first parameter is not encoded.

[0044] According to this, when the moving image encoding apparatus does not use the temporal motion vector prediction, it does not decode an unnecessary first parameter. Thereby, the moving image encoding apparatus can improve the encoding efficiency.

[0045] Also, a moving image decoding apparatus according to an aspect of the present invention includes a control circuit and a storage device electrically connected to the control circuit, and is a moving image decoding apparatus that performs inter prediction decoding of a decoding target block included in a decoding target picture using a motion vector. The control circuit decodes a first flag indicating whether temporal motion vector prediction using a temporal prediction motion vector, which is a motion vector of a block included in a decoded picture different from the decoding target picture, is used; when the first flag indicates that the temporal motion vector prediction is used, a parameter decoding step of decoding a first parameter for calculating the temporal prediction motion vector; a first candidate derivation step of deriving a plurality of first prediction motion vector candidates including the temporal prediction motion vector using the first parameter; a first motion vector decoding step of decoding a motion vector used for inter prediction decoding of the decoding target block using one of the plurality of first prediction motion vector candidates; when the first flag indicates that the temporal motion vector prediction is not used, a second candidate derivation step of deriving a plurality of second prediction motion vector candidates not including the temporal prediction motion vector; and a second motion vector decoding step of decoding a motion vector used for inter prediction decoding of the decoding target block using one of the plurality of second prediction motion vector candidates. When the first flag indicates that the temporal motion vector prediction is not used, the first parameter is not decoded.

[0046] According to this, when the moving image decoding apparatus does not use the temporal motion vector prediction, it does not decode an unnecessary first parameter. As a result, the moving image decoding apparatus can improve the coding efficiency.

[0047] In addition, a moving image encoding / decoding apparatus according to an aspect of the present invention includes the moving image encoding apparatus and the moving image decoding apparatus.

[0048] Note that these general or specific aspects may be implemented in a system, method, integrated circuit, computer program, or recording medium such as a computer-readable CD-ROM, or may be implemented in any combination of a system, method, integrated circuit, computer program, and recording medium.

[0049] Hereinafter, embodiments of the present invention will be described with reference to the drawings.

[0050] Note that all of the embodiments described below are specific examples of the present invention. The numerical values, shapes, materials, components, arrangement positions and connection forms of the components, steps, order of steps, etc. shown in the following embodiments are merely examples and are not intended to limit the present invention. In addition, among the components in the following embodiments, the components not described in the independent claims indicating the highest-level concept are described as optional components.

[0051] (Embodiment 1) FIG. 2 is a block diagram showing the configuration of a moving image encoding apparatus using the moving image encoding method according to Embodiment 1.

[0052] As shown in FIG. 2, the moving image encoding apparatus 100 includes a subtraction unit 101, an orthogonal transformation unit 102, a quantization unit 103, an inverse quantization unit 104, an inverse orthogonal transformation unit 105, an addition unit 106, a block memory 107, a frame memory 108, an intra prediction unit 109, an inter prediction unit 110, a switch 111, an inter prediction control unit 112, a picture type determination unit 113, a temporal prediction motion vector calculation unit 114, a colPic memory 115, an overall vector storage unit 116, a co-located information determination unit 117, and a variable length encoding unit 118.

[0053] The subtraction unit 101 acquires an input image sequence including an encoding target block from outside the apparatus, acquires a prediction block from the switch 111, generates a residual block by subtracting the prediction block from the encoding target block, and outputs the generated residual block to the orthogonal transformation unit 102.

[0054] The orthogonal transformation unit 102 generates transform coefficients by converting the residual block obtained from the subtraction unit 101 from the image domain to the frequency domain, and outputs the generated transform coefficients to the quantization unit 103. The quantization unit 103 generates quantization coefficients by quantizing the transform coefficients obtained from the quantization unit 103, and outputs the generated quantization coefficients to the inverse quantization unit 104 and the variable length coding unit 118.

[0055] The inverse quantization unit 104 restores the transform coefficients by inverse quantizing the quantization coefficients obtained from the quantization unit 103, and outputs the restored transform coefficients to the inverse orthogonal transformation unit 105. The inverse orthogonal transformation unit 105 restores the residual block by converting the restored transform coefficients obtained from the inverse quantization unit 104 from the frequency domain to the image domain, and outputs the restored residual block to the addition unit 106.

[0056] The addition unit 106 restores the block to be encoded by adding the restored residual block obtained from the inverse orthogonal transformation unit 105 and the prediction block obtained from the switch 111, and outputs the restored block to be encoded to the block memory 107 and the frame memory 108. The block memory 107 stores the restored input image sequence in units of blocks. The frame memory 108 stores the restored input image sequence in units of frames.

[0057] The picture type determination unit 113 determines whether to encode the input image sequence in the picture type of an I picture, a B picture, or a P picture, and generates picture type information indicating the determined picture type. Then, the picture type determination unit 113 outputs the generated picture type information to the switch 111, the inter prediction control unit 112, the co-located information determination unit 117, and the variable length coding unit 118.

[0058] The intra prediction unit 109 generates a prediction block by performing intra prediction on the encoding target block using the restored input image sequence in block units stored in the block memory 107, and outputs the generated prediction block to the switch 111. The inter prediction unit 110 generates a prediction block by performing inter prediction on the encoding target block using the restored input image sequence in frame units stored in the frame memory 108 and the motion vector derived by motion detection, and outputs the generated prediction block to the switch 111.

[0059] The switch 111 outputs the prediction block generated by the intra prediction unit 109 or the prediction block generated by the inter prediction unit 110 to the subtraction unit 101 and the addition unit 106. For example, the switch 111 outputs the prediction block with the smaller encoding cost among the two prediction blocks.

[0060] The co-located information determination unit 117 determines whether to prohibit the use of the co-located block. Then, the co-located information determination unit 117 generates a co-located use prohibition flag indicating the determination result for each picture, and outputs the generated co-located use prohibition flag to the temporal prediction motion vector calculation unit 114 and the variable length encoding unit 118. This co-located use prohibition flag is included in the bit stream (typically, the picture header or the slice header). In this embodiment, by using the co-located use prohibition flag to prohibit the use of the co-located block, the calculation of the temporal prediction motion vector using the information of the co-located block is prohibited and not added to the prediction motion vector candidates. However, it is not necessarily limited to this. For example, a flag (enable_temporal_mvp_flag) indicating whether to directly permit the temporal prediction motion vector using the information of the co-located block may be prepared and included in the bit stream (typically, the picture header or the slice header).

[0061] Also, the co-located information determination unit 117 determines either a block included in a picture located in front of the picture to be encoded (hereinafter referred to as a forward reference block) or a block included in a picture located behind the picture to be encoded (hereinafter referred to as a backward reference block) in the display order as a co-located block. In other words, the forward reference block is a block included in the reference picture specified in the reference picture list L0. Also, the backward reference block is a block included in the reference picture specified in the reference picture list L1. Note that, in this embodiment, an example in which the reference picture list L0 includes a forward reference block and the reference picture list L1 includes a backward reference block is shown, but it is not necessarily limited to this. For example, the same-direction reference blocks may be included in both reference picture lists, such as the case where the reference picture list L0 includes a forward reference block and the reference picture list L1 includes a forward reference block, or the reverse-direction reference blocks may be included in the two reference picture lists.

[0062] Then, the co-located information determination unit 117 generates a co-located reference direction flag (collocated_from_l0_flag) indicating the determination result for each picture, and outputs the generated co-located reference direction flag to the temporal prediction motion vector calculation unit 114 and the variable length encoding unit 118. This co-located reference direction flag is included in a bit stream (typically, a picture header or a slice header). For example, when the value of collocated_from_l0_flag is 1, a co-located block is calculated from the reference picture list L0, and when the value of collocated_from_0_flag is 0, a co-located block is calculated from the reference picture list L1. Note that when a value indicating "prohibited" is set in the co-located use prohibition flag (for example, when the value of enable_temporal_mvp_flag is 0), the co-located reference direction flag (collocated_from_l0_flag) may be omitted. A detailed method will be described later.

[0063] Here, a co-located block is a block within a picture different from the picture to be coded that contains the block to be coded, and the position within the picture is the same as the position of the block to be coded. For example, among a plurality of pictures included in a reference picture list determined according to the value of the co-located reference direction flag, the picture whose reference picture index value is the value of the co-located reference picture index (collocated_ref_idx) is used as the co-located picture. And the block at the same position as the block to be coded within the co-located picture is used as the co-located block.

[0064] Here, the co-located reference picture index (collocated_ref_idx) is an index value that specifies the co-located picture from among a plurality of pictures included in a reference picture list determined according to the value of the co-located reference direction flag. The collocated_ref_idx is included in the bit stream (typically, the picture header or slice header).

[0065] For example, when the co-located information determination unit 117 designates the picture corresponding to the reference picture index 0 of the reference picture list L1 as the co-located picture, it sets the value 0 in the co-located reference direction flag (collocated_from_l0_flag) and sets the value 0 in the co-located reference picture index collocated_ref_idx. Note that when a value indicating "prohibited" is set in the co-located use prohibition flag (for example, when the value of enable_temporal_mvp_flag is 0), the co-located reference picture index (collocated_ref_idx) may be omitted. A detailed method will be described later. Also, the positions of the encoding target block and the co-located block within each picture do not necessarily have to exactly match. For example, the co-located information determination unit 117 may set a block (adjacent) around the block at the same position as the encoding target block within a picture different from the encoding target picture as the co-located block.

[0066] The temporal prediction motion vector calculation unit 114 derives a prediction motion vector candidate, which is a candidate for the prediction motion vector, using the colPic information such as the motion vector of the co-located block stored in the colPic memory 115 or the overall motion vector of the colPic picture stored in the overall vector storage unit according to the value of the co-located use prohibition flag obtained from the co-located information determination unit 117.

[0067] Specifically, when the co-located prohibition flag is on (prohibited), the temporal prediction motion vector calculation unit 114 adds the overall motion vector (alternate vector) read from the overall vector storage unit 116 to the prediction motion vector candidate. On the other hand, when the co-located prohibition flag is off (permitted), the temporal prediction motion vector calculation unit 114 adds the temporal prediction motion vector calculated using the colPic information read from the colPic memory 115 to the prediction motion vector candidate.

[0068] Also, the temporal prediction motion vector calculation unit 114 assigns the value of the prediction motion vector index to the prediction motion vector added as a candidate. Then, the temporal prediction motion vector calculation unit 114 outputs the prediction motion vector added as a candidate and the prediction motion vector index to the inter prediction control unit 112. On the other hand, when the co-located block does not have a motion vector, the temporal prediction motion vector calculation unit 114 stops deriving the motion vector by temporal motion vector prediction or derives a vector with a motion amount of 0 as a prediction motion vector candidate. Also, the temporal prediction motion vector calculation unit 114 outputs the overall motion vector to the variable length coding unit 118.

[0069] The inter prediction control unit 112 determines to perform coding of the motion vector using the prediction motion vector with the smallest error from among a plurality of prediction motion vector candidates with respect to the motion vector derived by motion detection. Here, the error indicates, for example, the difference value between the prediction motion vector candidate and the motion vector derived by motion detection.

[0070] Also, the inter prediction control unit 112 specifies, for each block, the prediction motion vector index corresponding to the determined prediction motion vector. Then, the inter prediction control unit 112 outputs the prediction motion vector index and the difference value between the motion vector and the prediction motion vector to the variable length coding unit 118. Also, the inter prediction control unit 112 transfers the colPic information including the motion vector of the block to be coded to the colPic memory 115. Also, the inter prediction control unit 112 transfers the motion vector of the coded block to the overall vector storage unit 116.

[0071] The colPic memory 115 stores the colPic information including the motion vector of the block to be coded for use as the prediction motion vector at the time of coding the next picture. The overall vector storage unit 116 calculates the overall motion vector from the motion vectors of a plurality of blocks to be coded included in the picture and stores it for use as the prediction motion vector at the time of coding the next picture.

[0072] The variable-length encoding unit 118 generates a bitstream by performing variable-length encoding on the quantized coefficients obtained from the quantization unit 103, the prediction motion vector index and the difference value between the motion vector and the prediction motion vector obtained from the inter-prediction control unit 112, the picture type information obtained from the picture type determination unit 113, the co-located usage prohibition flag (or enable_temporal_mvp_flag), the co-located reference direction flag (collocated_from_l0_flag), and the co-located reference picture index (collocated_ref_idx) obtained from the co-located information determination unit 117, and the overall motion vector obtained from the temporal prediction motion vector calculation unit 114.

[0073] FIG. 3 is a diagram showing an outline of the processing flow of the moving image encoding method according to Embodiment 1.

[0074] When deriving the prediction motion vector candidate by temporal motion vector prediction, the co-located information determination unit 117 determines co-located information including the co-located usage prohibition flag, the co-located reference direction flag, and the co-located reference picture index, etc. by the method described later (S11).

[0075] Next, the temporal prediction motion vector calculation unit 114 determines whether the co-located usage prohibition flag is on (prohibited) (or the value of enable_temporal_mvp_flag is 0) (S12). If the determination result is true (Yes in S12), the temporal prediction motion vector calculation unit 114 reads the overall motion vector from the overall vector storage unit 116 and attaches the read overall motion vector to the header information such as the picture header (S13).

[0076] Next, the temporal prediction motion vector calculation unit 114 adds the global motion vector as an alternative vector for the temporal prediction motion vector to the prediction motion vector candidates (S14). Also, the temporal prediction motion vector calculation unit 114 assigns a value of the prediction motion vector index to the prediction motion vector added to the candidates.

[0077] On the other hand, if the co-located usage prohibition flag is off (No in S12) (or the value of enable_temporal_mvp_flag is 1), the temporal prediction motion vector calculation unit 114 reads colPic information including the reference motion vector of the co-located block from the colPic memory according to the co-located information, calculates a temporal prediction motion vector using the reference motion vector of the co-located block, and adds the calculated temporal prediction motion vector to the prediction motion vector candidates (S17). Also, the temporal prediction motion vector calculation unit 114 assigns a value of the prediction motion vector index to the prediction motion vector added to the candidates.

[0078] Generally, when the value of the prediction motion vector index is small, the amount of information required is small. On the other hand, when the value of the prediction motion vector index is large, the amount of information required is large. Therefore, if a small prediction motion vector index is assigned to a prediction motion vector that is likely to be a more accurate motion vector, the coding efficiency will be high.

[0079] Next, the inter prediction unit 110 generates a prediction block of the block to be coded by performing inter prediction using the motion vector derived by motion detection. Then, the subtraction unit 101, the orthogonal transformation unit 102, the quantization unit 103, and the variable length coding unit 118 code the block to be coded using the prediction block generated by the inter prediction unit 110.

[0080] Further, the inter-prediction control unit 112 encodes the motion vector using the prediction motion vector that is the prediction motion vector candidate with the smallest error from the motion vector among a plurality of prediction motion vector candidates. For example, the inter-prediction control unit 112 calculates, as an error, a difference value between each of the plurality of prediction motion vector candidates and the motion vector derived by motion detection, and determines, as the prediction motion vector to be used when encoding the motion vector, the prediction motion vector candidate with the smallest error among the calculated errors.

[0081] Then, the inter-prediction control unit 112 outputs the prediction motion vector index corresponding to the selected prediction motion vector and the error information between the motion vector and the prediction motion vector to the variable-length encoding unit 118. The variable-length encoding unit 118 variably encodes the prediction motion vector index and the error information acquired from the inter-prediction control unit 112, and includes the variably encoded prediction motion vector index and error information in the bit stream (S15).

[0082] Next, the inter-prediction control unit 112 stores the colPic information including the motion vector and the like used for inter-prediction in the colPic memory 115. The colPic memory 115 stores the motion vector of the reference picture, the reference picture index value, the prediction direction, and the like for calculating the temporal prediction motion vector of the block to be encoded. Further, the inter-prediction control unit 112 stores the motion vector and the like used for inter-prediction in the overall vector storage unit 116 (S16).

[0083] Figure 4 shows an example of predicted motion vector candidates. Motion vector A (MV_A) is the motion vector of adjacent block A located to the left of the block to be encoded. Motion vector B (MV_B) is the motion vector of adjacent block B located above the block to be encoded. Motion vector C (MV_C) is the motion vector of adjacent block C located diagonally above and to the right of the block to be encoded. Also, Median(MV_A, MV_B, MV_C) represents the median value of motion vectors A, B, and C. Here, the median value is derived using, for example, the following equations 1 to 3.

[0084]

Number

Number

Number

[0085] The value of the predicted motion vector index is such that the value corresponding to Median(MV_A, MV_B, MV_C) is 0, the value corresponding to motion vector A is 1, the value corresponding to motion vector B is 2, the value corresponding to motion vector C is 3, and the value corresponding to the temporal predicted motion vector (or alternative vector) is 4. Note that the assignment method of the predicted motion vector index is not limited to this example.

[0086] Figure 5 shows an example of a code table used when variable-length encoding the predicted motion vector index. In the example of Figure 5, codes with shorter code lengths are assigned in ascending order of the values of the predicted motion vector index. In this way, by assigning a small predicted motion vector index to a predicted motion vector candidate with a high likelihood of good prediction accuracy, the encoding efficiency can be improved.

[0087] FIG. 6 is a diagram showing a flow of determining a predicted motion vector candidate in the inter prediction control unit 112. According to the flow shown in FIG. 6, the inter prediction control unit 112 determines, as a predicted motion vector to be used when encoding a motion vector, a predicted motion vector candidate having the smallest error from the motion vector derived by motion detection. Then, error information between the motion vector and the predicted motion vector and a predicted motion vector index indicating the determined predicted motion vector are variable-length encoded and included in the bit stream.

[0088] Specifically, first, the inter prediction control unit 112 initializes a predicted motion vector candidate index mvp_idx and a minimum motion vector error (S21). Next, the inter prediction control unit 112 compares the predicted motion vector candidate index mvp_idx with the number of predicted motion vector candidates (the number of records in the table shown in FIG. 4) (S22).

[0089] If mvp_idx < the number of predicted motion vector candidates (Yes in S22), the inter prediction control unit 112 calculates a motion vector error (error information) of the predicted motion vector candidate specified by the current value of mvp_idx among the plurality of predicted motion vector candidates (S23). For example, the inter prediction control unit 112 calculates the motion vector error by subtracting the predicted motion vector candidate with a predicted motion vector index = 0 in FIG. 4 from the motion vector used for encoding the block to be encoded.

[0090] Next, the inter prediction control unit 112 compares the motion vector error calculated in step S23 with the minimum motion vector error (S24). If the motion vector error < the minimum motion vector error (Yes in S24), the inter prediction control unit 112 sets (overwrites) the motion vector error calculated in step S23 as the minimum motion vector error and sets (overwrites) the current mvp_idx as the predicted motion vector index. On the other hand, if the motion vector error ≧ the minimum motion vector error (No in S24), step S25 is skipped.

[0091] Then, the inter prediction control unit 112 increments mvp_idx by 1 (S26), and repeatedly executes each of the above processes (steps S22 to S26) the number of times equal to the number of prediction motion vector candidates. Then, at the timing when mvp_idx = the number of prediction motion vector candidates (No in S22), the inter prediction control unit 112 outputs the values set in the minimum motion vector error and the prediction motion vector index to the variable length coding unit 118, and ends the process of FIG. 6 (S27).

[0092] FIG. 7 is a conceptual diagram showing the read / write processes to the colPic memory 115 and the overall vector storage unit 116 shown in FIG. 2. In FIG. 7, the motion vector mvCol1 in the prediction direction 1 and the motion vector mvCol2 in the prediction direction 2 included in the co-located block included in the co-located picture colPic are stored in the colPic memory 115 and the overall vector storage unit 116.

[0093] Here, when the block to be coded is coded, the colPic information including the motion vector etc. stored in the colPic memory 115, or the overall motion vector of the overall vector storage unit 116 is read out according to the co-located use prohibition flag and added to the prediction motion vector candidates.

[0094] The prediction motion vector candidates are used for coding the motion vector of the block to be coded. In the first embodiment, an example in which the prediction direction 1 is a forward reference and the prediction direction 2 is a backward reference is used for explanation, but the prediction direction 1 may be a backward reference and the prediction direction 2 may be a forward reference, or both the prediction direction 1 and the prediction direction 2 may be forward references or backward references. An example in the case where the prediction direction 1 uses the reference picture list L0 and the prediction direction 2 uses the reference picture list L1 is shown.

[0095] The global vector storage unit 116 stores a global motion vector calculated from the motion vectors of a plurality of encoding target blocks that make up the picture to be encoded. For example, the global motion vector is the average value for each prediction direction of the motion vectors during inter-prediction encoding of the entire picture to be encoded. Note that, in the first embodiment, an example in which the average value of the motion vectors of a plurality of encoding target blocks that make up the picture to be encoded is used as the global vector is shown, but it is not necessarily limited to this.

[0096] For example, the global motion vector may be the median value or the weighted average value of the motion vectors during inter-prediction encoding of a plurality of encoding target blocks that make up the picture to be encoded. Alternatively, the global motion vector may be the motion vector with the highest occurrence frequency among the motion vectors during inter-prediction encoding of a plurality of encoding target blocks that make up the picture to be encoded. Alternatively, the global motion vector may be the motion vector that refers to the picture closest in display order among the motion vectors during inter-prediction encoding of a plurality of encoding target blocks that make up the picture to be encoded.

[0097] FIG. 8A is a diagram showing a detailed processing flow of step S11 in FIG. 3. Hereinafter, FIG. 8A will be described.

[0098] First, the co-located information determination unit 117 determines whether to perform temporal motion vector prediction using the co-located block for the picture to be encoded (S31). Then, the co-located information determination unit 117 generates a co-located usage prohibition flag (or enable_temporal_mvp_flag) indicating whether the use of the co-located block is permitted (temporal motion vector prediction) for each picture, and outputs the generated co-located usage prohibition flag to the variable length encoding unit 118.

[0099] For example, when performing streaming distribution or the like, in order to suppress the propagation of decoding errors due to time motion vector prediction, it is conceivable to turn on the co-located usage prohibition flag at a certain interval. As an example of realizing this, a counter for counting the number of encoded pictures to be encoded is prepared. If the number of encoded pictures is less than a certain threshold, the co-located usage prohibition flag is set off. If the number of encoded pictures is equal to or greater than the threshold, the co-located usage prohibition flag is set on and the counter is reset to 0. Such a method can be considered.

[0100] Also, for example, in pictures that can be reference targets (for example, P pictures and B pictures referenced from other pictures), the co-located usage prohibition flag is set on, and in non-reference pictures that cannot be reference targets (for example, B pictures not referenced from other pictures), the co-located usage prohibition flag is set off. In this way, a method of suppressing decoding error propagation can be considered. By turning on the co-located usage prohibition flag for pictures referenced from other pictures in this manner, it becomes possible to effectively suppress the propagation of decoding errors.

[0101] Next, the co-located information determination unit 117 determines whether the forward reference block or the backward reference block is to be the co-located block (S32). For example, the co-located information determination unit 117 selects, as the co-located block, the one included in the picture closer in display order to the picture to be encoded, from among the co-located block (forward reference block) included in the forward reference picture and the co-located block (backward reference block) included in the backward reference picture. Then, the co-located information determination unit 117 generates, for each picture (or slice), a co-located reference direction flag indicating whether the co-located block is a forward reference block or a backward reference block, and a co-located reference picture index for specifying the co-located picture, and outputs the generated co-located reference direction flag and co-located reference picture index to the variable length encoding unit 118.

[0102] FIG. 8B shows an example of a B picture referred to from another picture. In the example of FIG. 8B, a reference structure having a plurality of layers is defined. The picture at the head of the stream is set as an I picture, and the pictures other than the head I picture are set as B pictures. Also, the pictures belonging to the layer with a higher level among the plurality of layers refer to the pictures belonging to the layer with the same level or the layer with a lower level than that layer.

[0103] For example, in FIG. 8B, the picture B1 belonging to layer 3 refers to the picture I0 belonging to layer 0 and the picture Br2 belonging to layer 2. Also, Bf8 belonging to the lowest layer 0 refers to the picture I0 belonging to the same layer. Here, the pictures belonging to the lowest layer 0 refer only to the pictures in front in the display order. In such a reference structure, it is conceivable to turn on the co-located use prohibition flag for the pictures belonging to layer 0 that are likely to be referred to from other pictures.

[0104] Figure 9 shows the detailed processing flow of step S17 in FIG. 3. Hereinafter, FIG. 9 will be described.

[0105] First, the temporal prediction motion vector calculation unit 114 reads colPic information including the reference motion vector in prediction direction 1, the reference motion vector in prediction direction 2, etc. from the colPic memory 115 (S41). Next, the temporal prediction motion vector calculation unit 114 determines whether the co-located block included in the colPic information has two or more motion vectors (S42). That is, the temporal prediction motion vector calculation unit 114 determines whether the co-located block has a forward reference motion vector (mvL0) and a backward reference motion vector (mvL1).

[0106] When it is determined that the co-located block has two or more motion vectors (Yes in S42), the temporal prediction motion vector calculation unit 114 determines whether the co-located block is a backward reference block (S43). That is, the temporal prediction motion vector calculation unit 114 determines whether the picture including the co-located block is located behind the picture to be coded in the display order.

[0107] Next, when it is determined that the co-located block is a backward reference block (Yes in S43), the temporal prediction motion vector calculation unit 114 uses the forward reference motion vector of the co-located block (the motion vector mvL0 for the reference picture in the reference picture list L0) to derive a temporal prediction motion vector by temporal motion vector prediction (S44). Then, the temporal prediction motion vector calculation unit 114 adds the temporal prediction motion vector calculated in step S44 to the prediction motion vector candidates (S45).

[0108] On the other hand, when it is determined that the co-located block is a forward reference block (No in S43), the temporal prediction motion vector calculation unit 114 uses the backward reference motion vector of the co-located block (the motion vector mvL1 for the reference picture in the reference picture list L1) to derive a temporal prediction motion vector by temporal motion vector prediction (S46), and adds the derived temporal prediction motion vector to the prediction motion vector candidates (S45).

[0109] On the other hand, when it is determined that the co-located block has only one of the forward reference motion vector and the backward reference motion vector (No in S42), the temporal prediction motion vector calculation unit 114 determines whether the co-located block has a forward reference motion vector (S47). When it is determined that the co-located block has a forward reference motion vector (Yes in S47), the temporal prediction motion vector calculation unit 114 uses the forward reference motion vector of the co-located block to derive the temporal prediction motion vector of the block to be encoded (S48), and adds the derived temporal prediction motion vector to the prediction motion vector candidates (S45).

[0110] On the other hand, when it is determined that the co-located block does not have a forward reference motion vector (No in S47), the temporal prediction motion vector calculation unit 114 determines whether the co-located block has a backward reference motion vector (S49). When it is determined that the co-located block has a backward reference motion vector (Yes in S49), the temporal prediction motion vector calculation unit 114 uses the backward reference motion vector to derive the temporal prediction motion vector of the block to be encoded (S50), and adds the derived temporal prediction motion vector to the prediction motion vector candidates (S45).

[0111] On the other hand, when it is determined that the co-located block does not have a backward reference motion vector (No in S49), the temporal prediction motion vector calculation unit 114 ends the process of FIG. 9 without adding the temporal prediction motion vector to the prediction motion vector candidates (S51). Alternatively, instead of the process of step S51, the temporal prediction motion vector calculation unit 114 may add a motion vector with a motion amount of 0 as the temporal prediction motion vector of the co-located block to the prediction motion vector candidates.

[0112] Note that in the process flow of FIG. 9, the temporal prediction motion vector calculation unit 114 determines whether the co-located block has a forward reference motion vector in step S47, and determines whether the co-located block has a backward reference motion vector in step S49, but this is not limited to this flow. For example, the temporal prediction motion vector calculation unit 114 may first determine whether the co-located block has a backward reference motion vector, and then determine whether the co-located block has a forward reference motion vector.

[0113] FIG. 10 is a detailed process flow of steps S13 and S14 in FIG. 3. Hereinafter, FIG. 10 will be described.

[0114] First, the temporal prediction motion vector calculation unit 114 reads at least one of the overall motion vector information including the overall motion vector in the prediction direction 1 and the overall motion vector in the prediction direction 2 from the overall vector storage unit 116 (S61). Next, the temporal prediction motion vector calculation unit 114 determines whether the overall motion vector information has two or more motion vectors (S62). That is, the temporal prediction motion vector calculation unit 114 determines whether the forward reference motion vector (mvL0) and the backward reference motion vector (mvL1) are included in the overall motion vector information.

[0115] When it is determined that the overall motion vector information has two or more motion vectors (Yes in S62), the temporal prediction motion vector calculation unit 114 determines whether the co-located reference direction is a backward reference block (S63). When it is determined that the co-located reference direction is a backward reference block (Yes in S63), the temporal prediction motion vector calculation unit 114 selects the forward reference motion vector included in the overall motion vector information (S64).

[0116] Then, the temporal prediction motion vector calculation unit 114 adds the selected overall motion vector to the header information such as the picture header (outputs it to the variable length coding unit 118), and adds it to the prediction motion vector candidates of the block to be coded (S65). Note that the temporal prediction motion vector calculation unit 114 adds information specifying the reference picture that the selected overall motion vector refers to (more specifically, the reference pictures that the plurality of motion vectors used for calculating the overall motion vector refer to) to the header information. This information is used in the scaling process described later with reference to FIGS. 11A to 12B.

[0117] On the other hand, when it is determined that the co-located reference direction is a forward reference block (No in S63), the temporal prediction motion vector calculation unit 114 selects the backward reference motion vector included in the overall motion vector information (S66). Then, the temporal prediction motion vector calculation unit 114 adds the selected overall motion vector to the header information such as the picture header, and adds it to the prediction motion vector candidates of the block to be coded (S65).

[0118] Also, when it is determined that the overall motion vector information has only one of the forward reference motion vector and the backward reference motion vector (No in S62), the temporal prediction motion vector calculation unit 114 determines whether the overall motion vector information has a forward reference motion vector (S67).

[0119] When it is determined that the overall motion vector information has a forward reference motion vector (Yes in S67), the temporal prediction motion vector calculation unit 114 selects the forward reference motion vector included in the overall motion vector information (S68). Then, the temporal prediction motion vector calculation unit 114 adds the selected overall motion vector to the header information such as the picture header and adds it to the prediction motion vector candidates of the block to be encoded (S65).

[0120] On the other hand, when it is determined that the overall motion vector information does not have a forward reference motion vector (No in S67), the temporal prediction motion vector calculation unit 114 determines whether the overall motion vector information has a backward reference motion vector (S69). When it is determined that the overall motion vector information has a backward reference motion vector (Yes in S69), the temporal prediction motion vector calculation unit 114 selects the backward reference motion vector included in the overall motion vector information (S70). Then, the temporal prediction motion vector calculation unit 114 adds the selected overall motion vector to the header information such as the picture header and adds it to the prediction motion vector candidates of the block to be encoded (S65).

[0121] On the other hand, when it is determined that the overall motion vector information does not have a backward reference motion vector (No in S69), the temporal prediction motion vector calculation unit 114 does not add the temporal prediction motion vector to the prediction motion vector candidates, or sets the overall motion vector to 0 (S71). Then, the temporal prediction motion vector calculation unit 114 adds the set overall motion vector to the header information such as the picture header and adds it to the prediction motion vector candidates of the block to be encoded (S65).

[0122] In the processing flow of FIG. 10, the time prediction motion vector calculation unit 114 determines whether the global motion vector has a forward reference motion vector in step S67, and determines whether the global motion vector has a backward reference motion vector in step S69, but this is not limited to this flow. For example, the time prediction motion vector calculation unit 114 may first determine whether the global motion vector has a backward reference motion vector, and then determine whether the global motion vector has a forward reference motion vector.

[0123] Also, in steps S63 to S66 of FIG. 10, an example in which the time prediction motion vector calculation unit 114 determines which of the global motion vectors mvL0 and mvL1 to select based on the co-located reference direction flag has been described, but it is not limited to this. For example, the time prediction motion vector calculation unit 114 may select the global motion vector mvL0 as a prediction motion vector candidate for the reference picture list L0, and select the global motion vector mvL1 as a candidate for the prediction motion vector of the reference picture list L1. As a result, when using the global motion vector, it is not necessary to add the co-located reference direction flag to the header, so the coding efficiency is further improved.

[0124] Next, the scaling method when adding the time prediction motion vector to the prediction motion vector candidates will be described in detail. The scaling method when adding the global motion vector to the prediction motion vector candidates is common except that the global motion vector is used as an input instead of the motion vector of the co-located block, so the description is omitted.

[0125] FIG. 11A shows a method of deriving a prediction motion vector candidate (time prediction motion vector) by time motion vector prediction using the forward reference motion vector when the co-located block is a backward reference block and has both a forward reference motion vector and a backward reference motion vector. Specifically, using the forward reference motion vector, a prediction motion vector candidate (TemporalMV) is derived by the following equation 4.

[0126] TemporalMV = mvL0×(B2 - B0) / (B4 - B0) ··(Equation 4)

[0127] Here, (B2 - B0) indicates the time difference information of the display times between picture B2 and picture B0. Similarly, (B4 - B0) indicates the time difference information of the display times between picture B4 and picture B0.

[0128] Figure 11B shows a method of deriving a predicted motion vector candidate (temporal predicted motion vector) by temporal motion vector prediction using a backward reference motion vector. Specifically, using the backward reference motion vector, a predicted motion vector candidate is derived by the following Equation 5.

[0129] TemporalMV = mvL1×(B2 - B0) / (B4 - B8) ··(Equation 5)

[0130] Figure 12A shows a method of deriving a predicted motion vector candidate (temporal predicted motion vector) by temporal motion vector prediction using a backward reference motion vector when the co - located block is a forward reference block and has both a forward reference motion vector and a backward reference motion vector. Specifically, using the backward reference motion vector, a predicted motion vector candidate is derived by the following Equation 6.

[0131] TemporalMV = mvL1×(B6 - B8) / (B4 - B8) ··(Equation 6)

[0132] Figure 12B shows a method of deriving a predicted motion vector candidate (temporal predicted motion vector) by temporal motion vector prediction using a forward reference motion vector. Using the backward reference motion vector, a predicted motion vector candidate is derived by the following Equation 7.

[0133] TemporalMV = mvL0×(B6 - B8) / (B4 - B0) ··(Equation 7)

[0134] As described above, in the first embodiment, the moving image encoding apparatus 100 turns off the temporal motion vector prediction using the motion vectors for each encoding processing unit of the reference picture at a certain interval. Instead, the overall motion vector of the reference picture is added to the header information, and the motion vector of the picture to be encoded is encoded using the scaled overall vector. This makes it possible to prevent the propagation of decoding errors while suppressing a decrease in encoding efficiency.

[0135] More specifically, when the co-located usage prohibition flag is on, the moving image encoding apparatus 100 adds the overall vector read from the overall vector storage unit 116 to the predicted motion vector candidates of the block to be encoded and attaches it to the header information such as the picture header. Thereby, even when the reference picture is lost during decoding, the moving image decoding apparatus can decode the bitstream without decoding errors. In this way, error propagation is suppressed.

[0136] Also, when the co-located usage prohibition flag is off, the moving image encoding apparatus 100 can select an optimal predicted motion vector for the block to be encoded according to the co-located reference direction flag, so that the compression efficiency can be improved. In particular, when the co-located block is a forward reference block, the moving image encoding apparatus 100 can reduce the prediction error by using the backward reference motion vector. The backward reference motion vector is a motion vector pointing to the reference picture in the direction of the picture including the block to be encoded from the picture including the co-located block, and has a high probability of being close to the optimal motion vector. Therefore, the prediction error is reduced.

[0137] On the other hand, the forward reference motion vector is a motion vector in the direction opposite to the direction in which the picture containing the coded block is located, from the picture containing the co-located block, and has a low probability of being close to the optimal motion vector. Therefore, the prediction error increases. Similarly, when the co-located block is a backward reference block, the forward reference motion vector has a high probability of being close to the optimal motion vector. Therefore, the prediction error decreases.

[0138] Note that in the first embodiment, when the co-located block has two or more motion vectors, the motion vector of the co-located block used for calculating the temporal prediction motion vector of the coded block is switched depending on whether the co-located block is a backward reference block or a forward reference block, but it is not limited to this.

[0139] For example, the moving image encoding apparatus 100 may calculate the temporal prediction motion vector using a motion vector (a motion vector with a short temporal distance) that refers to a reference picture temporally close to the picture including the co-located block. Here, the temporal distance is determined according to, for example, the number of pictures between the picture including the co-located block and the reference picture referred to by the co-located block in the display order.

[0140] Also, in the first embodiment, when the co-located block has two or more motion vectors, the motion vector of the co-located block used for calculating the temporal prediction motion vector of the coded block is switched depending on whether the co-located block is a backward reference block or a forward reference block, but it is not limited to this. For example, the moving image encoding apparatus 100 may calculate the temporal prediction motion vector using the motion vector with a smaller magnitude among the two motion vectors of the co-located block. Here, the magnitude of the motion vector means the absolute value of the motion vector.

[0141] Also, in Embodiment 1, when the co-located usage prohibition flag is on, the moving image encoding device 100 adds the overall vector read from the overall vector storage unit 116 as an alternative vector for the temporal prediction motion vector to the prediction motion vector candidates. However, the present invention is not limited to this. For example, the moving image encoding device 100 may always add a motion vector with a value of 0 as the overall motion vector to the prediction motion vector candidates (that is, add a motion vector with a motion amount of 0 as an alternative vector to the prediction motion vector candidates). In this case, the moving image encoding device 100 does not have to associate the overall motion vector with header information or the like. Also, when the co-located usage prohibition flag is on, the moving image encoding device 100 may not always add the temporal prediction motion vector to the prediction motion vector candidates. By not adding the temporal prediction motion vector to the prediction motion vector candidates, it becomes possible to improve the encoding efficiency.

[0142] Also, in Embodiment 1, the moving image encoding device 100 adds the co-located usage prohibition flag to all pictures, but it may be added only to specific pictures. For example, the moving image encoding device 100 adds the co-located usage prohibition flag only to pictures referenced from other pictures (P pictures, B pictures referenced from other pictures, pictures belonging to the lowest level layer in a reference structure having a plurality of layers), and does not add the co-located usage prohibition flag to pictures not referenced from other pictures. In this way, by adding the co-located usage prohibition flag only to specific pictures, the moving image encoding device 100 can improve the encoding efficiency while suppressing error propagation during decoding.

[0143] Also, in Embodiment 1, the moving image encoding device 100 adds the co-located usage prohibition flag for each picture, but it may add the co-located usage prohibition flag for each slice composed of a plurality of blocks. By adding the co-located usage prohibition flag for each slice, it becomes possible to improve the prediction accuracy of the overall vector.

[0144] Also, in the first embodiment, the moving image encoding apparatus 100 adds a co-located usage prohibition flag to all pictures. However, without adding the co-located usage prohibition flag, it may be determined not to add the temporal prediction motion vector to the prediction motion vector candidates based on the picture type. For example, the moving image encoding apparatus 100 may add the overall vector to the prediction motion vector candidates without adding the temporal prediction motion vector to the prediction motion vector candidates in pictures (P pictures, B pictures referred to from other pictures, pictures belonging to the lowest layer in a reference structure having a plurality of layers) referred to from other pictures. In this way, by determining whether to add the temporal prediction motion vector to the prediction motion vector candidates based on the picture type, the co-located usage prohibition flag can be omitted, so that the encoding efficiency can be improved.

[0145] Also, when the moving image encoding apparatus 100 does not include the temporal prediction motion vector in the prediction motion vector candidates, the encoding efficiency can be improved by not including unnecessary flags in the bitstream. A specific example will be described with reference to FIG. 13. FIG. 13 is a detailed flow of S11 in FIG. 3 and shows a modified example of the flow for determining co-located information.

[0146] First, the moving image encoding apparatus 100 determines the value of the co-located usage prohibition flag in the same manner as in FIG. 8A and encodes the co-located usage prohibition flag indicating the determined value (S101). Here, an example will be described in which a flag (enable_temporal_mvp_flag) indicating whether to permit the temporal prediction motion vector using the co-located block information is used as the co-located usage prohibition flag.

[0147] Next, the moving image encoding device 100 determines whether enable_teporal_mvp_flag is 1 (S102). When enable_teporal_mvp_flag is 1 (Yes in S102), the moving image encoding device 100 determines the values of the co-located reference direction flag and the co-located reference picture index in the same way as S32 in FIG. 8A, and encodes each of them (S103 and S104).

[0148] On the other hand, when enable_teporal_mvp_flag is 0 (No in S102), the moving image encoding device 100 does not encode the co-located reference direction flag and the co-located reference picture index. In this way, when the moving image encoding device 100 does not include the temporal prediction motion vector in the prediction motion vector candidates (when enable_teporal_mvp_flag is 0), the unnecessary co-located reference direction flag and co-located reference picture index are not added to the bit stream. Thereby, the moving image encoding device 100 can improve the encoding efficiency.

[0149] As described above, the moving image encoding device 100 according to the present embodiment performs the moving image encoding process shown in FIG. 14.

[0150] The moving image encoding device 100 performs inter prediction encoding of the encoding target block included in the encoding target picture using a motion vector.

[0151] First, the moving image encoding device 100 generates a first flag (co-located use prohibition flag) indicating whether temporal motion vector prediction using the temporal prediction motion vector, which is the motion vector of the block included in the encoded picture different from the encoding target picture, is used (whether temporal motion vector prediction is permitted or prohibited), and encodes the generated first flag (S111). Also, the moving image encoding device 100 adds the encoded first flag to the bit stream.

[0152] Next, the moving image encoding apparatus 100 determines whether the first flag indicates that temporal motion vector prediction is used (permitted) (S112).

[0153] When the first flag indicates that temporal motion vector prediction is used (permitted) (Yes in S112), the moving image encoding apparatus 100 generates a first parameter for calculating a temporal predicted motion vector, and encodes the generated first parameter (S113). Then, the moving image encoding apparatus 100 adds the encoded first parameter to the bit stream.

[0154] Specifically, this first parameter includes a parameter for specifying an encoded picture (co-located picture) that is a reference object of the motion vector. More specifically, the first parameter includes a reference picture index (collocated_ref_idx) for specifying the above-mentioned encoded picture (co-located picture) among a plurality of pictures indicated by a reference picture list used for encoding the picture to be encoded. Further, the first parameter includes a flag (collocated_from_l0_flag) indicating which reference picture list is used to specify the above-mentioned encoded picture (co-located picture) among a plurality of reference picture lists used for encoding the picture to be encoded.

[0155] Here, each reference picture list indicates a plurality of reference pictures (encoded pictures). Also, in each reference picture list, the plurality of reference pictures are indicated by a reference picture index. The moving image encoding apparatus 100 selects the reference picture list indicated by the above flag (collocated_from_l0_flag) from the plurality of reference picture lists, and specifies, as the above-mentioned encoded picture (co-located picture), the picture having the above reference picture index (collocated_ref_idx) from among the plurality of reference pictures included in the selected reference picture list.

[0156] Next, the moving image encoding apparatus 100 generates a temporal prediction motion vector using the first parameter, and derives a plurality of first prediction motion vector candidates including the generated temporal prediction motion vector (S114).

[0157] Next, the moving image encoding apparatus 100 encodes the motion vector used for the inter-prediction encoding of the block to be encoded using one of the plurality of first prediction motion vector candidates (S115). Specifically, the moving image encoding apparatus 100 selects the first prediction motion vector candidate with the smallest difference from the motion vector used for the inter-prediction encoding of the block to be encoded among the plurality of first prediction motion vector candidates, and encodes the motion vector using the selected first prediction motion vector candidate. More specifically, the moving image encoding apparatus 100 encodes the difference between the selected first prediction motion vector candidate and the motion vector.

[0158] Also, the moving image encoding apparatus 100 encodes the block to be encoded by inter-encoding using the motion vector. Then, the moving image encoding apparatus 100 adds the encoded motion vector (difference) and the encoded block to be encoded to the bit stream.

[0159] On the other hand, when the first flag indicates that temporal motion vector prediction is not used (prohibited) (No in S112), the moving image encoding apparatus 100 does not encode the first parameter (S116). That is, the moving image encoding apparatus 100 does not generate the first flag. Also, the moving image encoding apparatus 100 does not add the first flag to the bit stream.

[0160] Also, the moving image encoding apparatus 100 derives a plurality of second prediction motion vector candidates that do not include the temporal prediction motion vector (S117).

[0161] Next, the moving image encoding device 100 encodes the motion vector used for the inter-prediction encoding of the block to be encoded by using one of a plurality of second predicted motion vector candidates (S118). Note that a specific example of this process is the same as the process when a plurality of first predicted motion vector candidates are replaced with a plurality of second predicted motion vector candidates in step S115 described above.

[0162] Note that step S111 is executed by the flag encoding unit included in the moving image encoding device 100. Also, steps S113 and S116 are executed by the parameter encoding unit included in the moving image encoding device 100. Steps S114 and S117 are executed by the candidate derivation unit included in the moving image encoding device 100. Steps S115 and S118 are executed by the motion vector encoding unit included in the moving image encoding device 100.

[0163] Here, the function of the flag encoding unit is realized by, for example, the co-located information determination unit 117 and the variable length encoding unit 118 shown in FIG. 2. Also, the function of the parameter encoding unit is realized by the co-located information determination unit 117 and the variable length encoding unit 118 shown in FIG. 2. The function of the candidate derivation unit is realized by the inter-prediction control unit 112 and the temporal predicted motion vector calculation unit 114 shown in FIG. 2. The function of the motion vector encoding unit is realized by the subtraction unit 101, the inter-prediction unit 110, the inter-prediction control unit 112, and the variable length encoding unit 118 shown in FIG. 2.

[0164] Also, the first flag (co-located use prohibition flag) and the first parameters (collocated_from_l0_flag and collocated_ref_idx) are generated and encoded for each picture or slice. That is, this first flag and the first parameters are included in the picture header or slice header of the bit stream. Note that the first flag and the first parameters may be generated for different units (picture or slice). For example, the first flag may be generated for each picture, and the first parameters may be generated for each slice.

[0165] Furthermore, at least one of the first flag and the first parameter may be generated and encoded for each plurality of pictures. That is, at least one of the first flag and the first parameter may be included in the PPS (Picture Parameter Set) or SPS (Sequence Parameter Set) of the bitstream.

[0166] Furthermore, the first flag may be hierarchically included in a plurality of units among units of a slice, a picture, and a plurality of pictures (sequence). For example, the moving image encoding device 100 generates, for each picture, a first flag indicating whether temporal motion vector prediction is used for the picture. Furthermore, when the first flag indicates that temporal motion vector prediction is used, the moving image encoding device 100 further generates, for each slice included in the picture, a second flag indicating whether temporal motion vector prediction is used for the slice. On the other hand, when the first flag indicates that temporal motion vector prediction is not used, the moving image encoding device 100 does not generate the second flag for each slice. Note that the moving image encoding device 100 may generate the second flag for each slice included in the picture only when the first flag indicates that temporal motion vector prediction is not used. Also, the moving image encoding device 100 may generate the first flag for each plurality of pictures and generate the second flag for each picture or each slice.

[0167] (Embodiment 2) In this embodiment, a moving image decoding device 200 that decodes the bitstream generated by the moving image encoding device 100 will be described.

[0168] FIG. 15 is a block diagram showing a configuration of a moving image decoding device 200 using the moving image decoding method according to Embodiment 2.

[0169] In Embodiment 2, a block included in a picture located ahead of the picture to be decoded (a reference picture specified by the reference picture list L0) in the display order is called a forward reference block. Also, a block included in a picture located behind the picture to be decoded (a reference picture specified by the reference picture list L1) in the display order is called a backward reference block.

[0170] As shown in FIG. 15, the moving image decoding apparatus 200 includes a variable length decoding unit 201, an inverse quantization unit 202, an inverse orthogonal transformation unit 203, an addition unit 204, a block memory 205, a frame memory 206, an intra prediction unit 207, an inter prediction unit 208, a switch 209, an inter prediction control unit 210, a temporal prediction motion vector calculation unit 211, and a colPic memory 212.

[0171] The variable length decoding unit 201 performs variable length decoding on the input bit stream to obtain picture type information, a prediction motion vector index, a co-located use prohibition flag (or enable_temporal_mvp_flag), a co-located reference direction flag (collocated_from_l0_flag), a co-located reference picture index (collocated_ref_idx), an overall motion vector, and quantization coefficients. The variable length decoding unit 201 outputs the picture type information to the switch 209 and the inter prediction control unit 210, outputs the prediction motion vector index to the inter prediction control unit 210, outputs the co-located use prohibition flag (or enable_temporal_mvp_flag), the co-located reference direction flag (collocated_from_l0_flag), the co-located reference picture index (collocated_ref_idx), and the overall motion vector to the temporal prediction motion vector calculation unit 211, and outputs the quantization coefficients to the inverse quantization unit 202.

[0172] The inverse quantization unit 202 restores the transform coefficients by inverse quantizing the quantization coefficients obtained from the variable-length decoding unit 201, and outputs the restored transform coefficients to the inverse orthogonal transform unit 203. The inverse orthogonal transform unit 203 restores the residual block by converting the restored transform coefficients obtained from the inverse quantization unit 202 from the frequency domain to the image domain, and outputs the restored residual block to the addition unit 204.

[0173] The addition unit 204 restores the decoded block by adding the restored residual block obtained from the inverse orthogonal transform unit 203 and the prediction block obtained from the switch 209. Then, the addition unit 204 outputs the decoded image sequence including the restored decoded block to the outside of the apparatus, and stores it in the block memory 205 and the frame memory 206.

[0174] The block memory 205 stores the decoded image sequence obtained from the addition unit 204 in units of blocks. The frame memory 206 stores the decoded image sequence obtained from the addition unit 204 in units of frames.

[0175] The intra prediction unit 207 generates a prediction block of the block to be decoded by performing intra prediction using the decoded image sequence in units of blocks stored in the block memory 205, and outputs the generated prediction block to the switch 209. The inter prediction unit 208 generates a prediction block of the block to be decoded by performing inter prediction using the decoded image sequence in units of frames stored in the frame memory 206, and outputs the generated prediction block to the switch 209. The switch 209 outputs the prediction block generated by the intra prediction unit 207 or the prediction block generated by the inter prediction unit 208 to the addition unit 204.

[0176] When the co-located usage prohibition flag obtained from the variable-length decoding unit 201 is off, the temporal prediction motion vector calculation unit 211 derives a predicted motion vector candidate (temporal prediction motion vector) for temporal motion vector prediction using the colPic information such as the motion vector of the co-located block stored in the colPic memory 212. On the other hand, when the co-located usage prohibition flag is on, the temporal prediction motion vector calculation unit 211 adds the overall motion vector obtained from the variable-length decoding unit 201 to the predicted motion vector candidate.

[0177] Also, the temporal prediction motion vector calculation unit 211 assigns a prediction motion vector index to the predicted motion vector added to the candidate. Then, the temporal prediction motion vector calculation unit 211 outputs the predicted motion vector and the prediction motion vector index to the inter prediction control unit 210.

[0178] Also, when the co-located block does not have a motion vector, the temporal prediction motion vector calculation unit 211 may abort the derivation of the motion vector by temporal motion vector prediction or add a motion vector with a motion amount of 0 to the predicted motion vector candidate.

[0179] The inter prediction control unit 210 identifies the predicted motion vector corresponding to the prediction motion vector index obtained from the variable-length decoding unit 201 from among the plurality of predicted motion vector candidates. Then, the inter prediction control unit 210 calculates the motion vector used in inter prediction by adding the error information between the motion vector and the predicted motion vector to the identified predicted motion vector. Also, the inter prediction control unit 210 stores the colPic information including the motion vector of the block to be decoded in the colPic memory 212.

[0180] FIG. 16 is an overview of the processing flow of the moving image decoding method according to Embodiment 2.

[0181] First, the variable-length decoder 201 decodes the co-located usage prohibition flag on a picture-by-picture basis (S81). Next, the variable-length decoder 201 determines whether the co-located usage prohibition flag is off (S82). If the co-located usage prohibition flag is off (Yes in S82), the variable-length decoder 201 decodes the co-located reference direction flag and the co-located reference picture index (collocated_ref_idx) on a picture-by-picture basis (S83). Then, the variable-length decoder 201 outputs the decoded co-located usage prohibition flag, co-located reference direction flag, and co-located reference picture index to the temporal prediction motion vector calculation unit 211.

[0182] Next, the temporal prediction motion vector calculation unit 211 reads colPic information including the reference motion vector of the co-located block from the colPic memory 212 according to the co-located information in the same manner as in FIG. 9, generates a temporal prediction motion vector using the reference motion vector of the co-located block, and adds the generated temporal prediction motion vector to the prediction motion vector candidates (S84).

[0183] On the other hand, when the co-located usage prohibition flag is on (No in S82), the temporal prediction motion vector calculation unit 211 obtains the global motion vector stored in the header information such as the picture header from the variable-length decoder 201, and adds the obtained global motion vector to the prediction motion vector candidates (S87).

[0184] Next, the inter prediction control unit 210 selects a prediction motion vector corresponding to the decoded prediction motion vector index from among the plurality of prediction motion vector candidates (S85). Further, the inter prediction control unit 210 derives a motion vector by adding prediction error information to the selected prediction motion vector, and outputs the derived motion vector to the inter prediction unit 208. Then, the inter prediction unit 208 generates a prediction block of the block to be decoded by inter prediction using the derived motion vector.

[0185] Next, the inter-prediction control unit 210 stores the colPic information including the motion vector used for inter-prediction and the like in the colPic memory 212 (S86). In the colPic memory 212, the motion vector of the reference picture, the reference picture index value, the prediction direction, etc. are stored in order to calculate the temporal prediction motion vector of the block to be decoded.

[0186] Note that the method for selecting the reference motion vector for calculating the temporal prediction motion vector when the reference block has two or more reference motion vectors is not limited to the method based on the co-located block reference direction flag. For example, the moving image decoding apparatus 200 may calculate the temporal distance of the reference motion vectors and use the reference motion vector with the shorter temporal distance. Here, the temporal distance is calculated based on the number of pictures between the reference picture including the reference block and the picture referred to by the reference picture at the display time. Also, for example, the moving image decoding apparatus 200 may calculate the magnitude of the reference motion vectors and use the motion vector derived using the reference motion vector with the smaller magnitude as the temporal prediction motion vector.

[0187] FIG. 17 is an example of the syntax of the bitstream in the moving image decoding method according to Embodiment 2. In FIG. 17, forbid_collocated_flag represents the co-located usage prohibition flag, tmv_x represents the horizontal component of the overall motion vector, tmv_y represents the vertical component of the overall motion vector, and collocated_from_l0_flag represents the co-located reference direction flag.

[0188] As shown in FIG. 17, when the co-located usage prohibition flag (forbid_collocated_flag) is 1, the overall motion vectors (tmv_x, tmv_y) are attached to the bitstream and added to the prediction motion vector candidates.

[0189] Also, when the co-located usage prohibition flag (forbid_collocated_flag) is 0, the co-located reference direction flag (collocated_from_l0_flag) is attached to the bitstream. Then, the co-located block is determined according to the co-located reference direction flag, and the temporal prediction motion vector is calculated using the reference motion vector of the co-located block. Here, if collocated_from_l0_flag is 1, it indicates that the co-located block is a forward reference block, and if it is 0, it indicates that the co-located block is a backward reference block, but it is not necessarily limited to this.

[0190] Note that in the second embodiment, when the co-located usage prohibition flag is on, the video decoder 200 uses the overall motion vector decoded from the header information or the like. However, according to the encoding method, an overall motion vector with a constant value of 0 may always be added to the candidate prediction motion vectors. In this case, since the overall motion vector is not attached to the header information or the like, its decoding process is omitted. Also, the video decoder 200 may not always add the temporal prediction motion vector to the candidate prediction motion vectors when the co-located usage prohibition flag is on.

[0191] In this way, in the first and second embodiments, the video encoder 100 sets off the temporal motion vector prediction using the motion vectors for each encoding processing unit of the reference picture at a certain interval, and instead adds the overall motion vector of the reference picture to the header information. Then, the video encoder 100 encodes the motion vector of the picture to be encoded using this, and can generate a bitstream that prevents the propagation of decoding errors while suppressing a decrease in encoding efficiency. Also, the video decoder 200 can appropriately decode the bitstream generated in this way.

[0192] More specifically, when the co-located usage prohibition flag is on, the moving image encoding device 100 adds the overall vector read from the overall vector storage unit 116 to the predicted motion vector candidates of the block to be encoded and attaches it to the header information such as the picture header. As a result, even when the reference picture is lost during decoding, the moving image decoding device 200 can decode the bitstream without a decoding error. In this way, the moving image decoding device 200 can appropriately decode the bitstream with suppressed error propagation.

[0193] Also, when the co-located usage prohibition flag is off, the moving image decoding device 200 can appropriately decode the bitstream in which the optimal predicted motion vector is selected for the block to be encoded according to the co-located reference direction flag.

[0194] In addition, in the first and second embodiments, when the co-located usage prohibition flag is on, the moving image encoding device 100 uses the overall vector read from the overall vector storage unit 116, but it may always add the overall motion vector with a value of 0 to the predicted motion vector candidates. Further, when the co-located usage prohibition flag is on, the moving image encoding device 100 may not always add the temporal predicted motion vector to the predicted motion vector candidates. With such a configuration, it becomes possible to reduce the decoding process in the moving image decoding device 200.

[0195] In addition, in the second embodiment, the moving image decoding apparatus 200 decodes the co-located usage prohibited flags of all pictures, but it may also decode only the co-located usage prohibited flags of specific pictures. For example, the moving image decoding apparatus 200 decodes only the co-located usage prohibited flags of pictures (P pictures, B pictures referenced from other pictures, pictures belonging to the lowest level layer in a reference structure having a plurality of layers) referenced from other pictures, and does not decode the co-located usage prohibited flags of pictures not referenced from other pictures. In this way, by decoding only the co-located usage prohibited flags of specific pictures, it is possible to reduce the decoding process while suppressing the propagation of decoding errors.

[0196] In addition, in the second embodiment, the moving image decoding apparatus 200 decodes the co-located usage prohibited flag for each picture, but it may also decode the co-located usage prohibited flag for each slice composed of a plurality of blocks. By decoding the co-located usage prohibited flag for each slice, it is possible to improve the prediction accuracy of the overall vector.

[0197] In addition, in the second embodiment, the moving image decoding apparatus 200 decodes the co-located usage prohibited flags of all pictures, but it may not add the temporal prediction motion vector to the prediction motion vector candidates based on the picture type. For example, in pictures (P pictures, B pictures referenced from other pictures, pictures belonging to the lowest level layer in a reference structure having a plurality of layers) referenced from other pictures, the moving image decoding apparatus 200 may add the overall motion vector to the prediction motion vector candidates without adding the temporal prediction motion vector. In this way, by determining whether to add the temporal prediction motion vector or the overall motion vector to the prediction motion vector candidates based on the picture type, it is possible to reduce the decoding process while improving the coding efficiency.

[0198] In addition, when the moving image encoding device 100 does not include the temporal prediction motion vector in the prediction motion vector candidates, it can generate a bitstream with improved encoding efficiency by not including unnecessary flags in the bitstream. Also, the moving image decoding device 200 can appropriately decode this bitstream. A specific example will be described with reference to FIG. 18. FIG. 18 is a diagram showing a modified example of the flow for decoding co-located information.

[0199] First, the moving image decoding device 200 decodes the co-located usage prohibition flag (S201). Here, an example in the case where a flag (enable_temporal_mvp_flag) indicating whether to permit the temporal prediction motion vector using the information of the co-located block is decoded will be described.

[0200] Next, the moving image decoding device 200 determines whether enable_teporal_mvp_flag is 1 (S202). If enable_teporal_mvp_flag is 1 (Yes in S202), the moving image decoding device 200 decodes the co-located reference direction flag and the co-located reference picture index, respectively (S203 and S204).

[0201] On the other hand, if enable_teporal_mvp_flag is 0 (No in S202), the moving image decoding device 200 does not decode the co-located reference direction flag and the co-located reference picture index. In this way, when the moving image encoding device 100 does not include the temporal prediction motion vector in the prediction motion vector candidates (when enable_teporal_mvp_flag is 0), it can generate a bitstream with improved encoding efficiency by not adding the unnecessary co-located reference direction flag and co-located reference picture index to the bitstream. Also, the moving image decoding device 200 can appropriately decode this bitstream.

[0202] FIG. 19A and FIG. 19B are diagrams showing a syntax example when an enable_temporal_mvp_flag indicating whether to permit a temporal prediction motion vector using co-located block information is added to a PPS (Picture Parameter Set), and a collocated_from_l0_flag and a collocated_ref_idx are added to a slice header.

[0203] When the value of the enable_temporal_mvp_flag is 1, it is permitted to calculate a temporal prediction motion vector using co-located information. When the value of the enable_temporal_mvp_flag is 0, it is prohibited to calculate a temporal prediction motion vector using co-located information.

[0204] When the value of the collocated_from_l0_flag is 1, a co-located picture is selected from the reference picture list in prediction direction 1. When the value of the collocated_from_l0_flag is 0, a co-located picture is selected from the reference picture list in prediction direction 1.

[0205] Among a plurality of pictures included in the reference picture list determined according to the value of the collocated_from_l0_flag, the picture with the reference picture index being the collocated_ref_idx is selected as the co-located picture.

[0206] Also, FIG. 20 is a diagram showing a syntax example when an enable_temporal_mvp_flag indicating whether to permit a temporal prediction motion vector using co-located block information, a collocated_from_l0_flag, and a collocated_ref_idx are all added to a slice header.

[0207] As shown in FIGS. 19B and 20, when the value of enable_temporal_mvp_flag is 0, collocated_from_l0_flag and collocated_ref_idx are not added to the bitstream.

[0208] As described above, the moving image decoding apparatus 200 according to the present embodiment performs the moving image decoding process shown in FIG. 21.

[0209] The moving image decoding apparatus 200 performs inter prediction decoding on a decoding target block included in a decoding target picture using a motion vector.

[0210] First, the moving image decoding apparatus 200 decodes a first flag (co-located usage prohibition flag) indicating whether or not temporal motion vector prediction using a temporal prediction motion vector, which is a motion vector of a block included in a decoded picture different from the decoding target picture, is used (whether to permit or prohibit temporal motion vector prediction) (S211). That is, the moving image decoding apparatus 200 acquires the first flag encoded from the bitstream and acquires the first flag by decoding the encoded first flag.

[0211] Next, the moving image decoding apparatus 200 determines whether or not the first flag indicates that temporal motion vector prediction is used (permitted) (S212).

[0212] When the first flag indicates that temporal motion vector prediction is used (permitted) (Yes in S212), the video decoder 200 decodes the first parameter for calculating the temporal predicted motion vector (S213). Specifically, the video decoder 200 obtains the encoded first parameter from the bitstream and decodes the obtained encoded first parameter to obtain the first parameter. This first parameter includes a parameter for specifying a decoded picture (co-located picture) that is a reference object of the motion vector. More specifically, the first parameter includes a reference picture index (collocated_ref_idx) for specifying the above decoded picture (co-located picture) among a plurality of pictures indicated by the reference picture list used for decoding the picture to be decoded. Further, the first parameter includes a flag (collocated_from_l0_flag) indicating which reference picture list is used to specify the above decoded picture (co-located picture) among the plurality of reference picture lists used for decoding the picture to be decoded.

[0213] Next, the video decoder 200 determines the temporal predicted motion vector using the first parameter and derives a plurality of first predicted motion vector candidates including the determined temporal predicted motion vector (S214).

[0214] Next, the video decoder 200 decodes the motion vector used for the inter prediction decoding of the block to be decoded using one of the plurality of first predicted motion vector candidates (S215). Specifically, the video decoder 200 obtains the encoded motion vector (difference value) from the bitstream. Then, the video decoder 200 generates a difference value of the motion vector by decoding the encoded motion vector (difference value). Next, the motion vector is generated using one of the plurality of first predicted motion vector candidates and the difference value of the motion vector.

[0215] Further, the moving image decoding device 200 decodes a block to be decoded by inter-decoding using the above motion vector. Specifically, the moving image decoding device 200 acquires an encoded target block (difference value) from the bit stream. Then, the moving image decoding device 200 generates a difference value of the target block by decoding the encoded target block (difference value). Next, the moving image decoding device 200 restores the target block using this motion vector and the difference value of the target block.

[0216] On the other hand, when the first flag indicates that temporal motion vector prediction is not used (prohibited) (No in S212), the moving image decoding device 200 does not decode the first parameter (S216). That is, the moving image decoding device 200 does not acquire the first parameter from the bit stream.

[0217] Next, the moving image decoding device 200 derives a plurality of second predicted motion vector candidates that do not include the temporal predicted motion vector (S217).

[0218] Next, the moving image decoding device 200 performs inter-decoding on the block to be decoded included in the picture to be decoded using one of the plurality of second predicted motion vector candidates (S218). Note that a specific example of this process is the same as the process when the plurality of first predicted motion vector candidates are replaced with the plurality of second predicted motion vector candidates in step S215 above.

[0219] Note that step S211 is executed by a flag decoding unit included in the moving image decoding device 200. Steps S213 and S216 are executed by a parameter decoding unit included in the moving image decoding device 200. Steps S214 and S217 are executed by a candidate derivation unit included in the moving image decoding device 200. Steps S215 and S218 are executed by a motion vector decoding unit included in the moving image decoding device 200.

[0220] Here, the function of the flag decoding unit is realized by, for example, the variable length decoding unit 201 shown in FIG. 15. Also, the function of the parameter decoding unit is realized by the variable length decoding unit 201 shown in FIG. 15. The function of the candidate derivation unit is realized by the inter prediction control unit 210 and the temporal prediction motion vector calculation unit 211 shown in FIG. 15. The function of the motion vector decoding unit is realized by the variable length decoding unit 201, the inter prediction unit 208, and the inter prediction control unit 210 shown in FIG. 15.

[0221] (Modification example) Next, with reference to FIG. 22, a moving image encoding apparatus 300 according to a modification of Embodiment 1 will be described. FIG. 22 is a block diagram of the moving image encoding apparatus 300 according to the modification of Embodiment 1. Note that a detailed description of the common points with Embodiment 1 will be omitted, and the description will focus on the differences.

[0222] As shown in FIG. 22, the moving image encoding apparatus 300 includes a first encoding unit 310 that generates a basic bitstream by encoding a basic view, and a second encoding unit 320 that generates a dependent bitstream by encoding a dependent view. Note that FIG. 22 shows an example in which the moving image encoding apparatus 300 outputs the basic bitstream and the dependent bitstream as independent streams, but the present invention is not limited to this, and the moving image encoding apparatus 300 may output a single bitstream in which the basic bitstream and the dependent bitstream are combined.

[0223] The basic configurations of the first encoding unit 310 and the second encoding unit 320 are common to the moving image encoding apparatus 100 shown in FIG. 2. However, in addition to the functions of the moving image encoding apparatus 100, the second encoding unit 320 has a function of referring to the frame memory 108 of the first encoding unit 310.

[0224] Next, with reference to FIGS. 23 and 24, a moving image encoding method according to a modification of Embodiment 1 will be described. FIG. 23 is a flowchart showing the operation of the moving image encoding method according to the modification of Embodiment 1. FIG. 24 is a diagram showing an example of pictures belonging to the basic view and the dependent view.

[0225] As shown in FIG. 24, the base view includes a plurality of pictures I 11 , P 12 , P 13 , P 14 , I 15 , P 16 , P 17 . Among the pictures belonging to the base view, the pictures I 11 , I 15 at the beginning of the GOP (Group Of Pictures) are I pictures, and the other pictures P 12 , P 13 , P 14 , P 16 , P 17 are P pictures. Note that the base view is encoded and decoded by referring only to the pictures belonging to the base view (i.e., intra prediction coding or inter prediction coding).

[0226] Also, as shown in FIG. 24, the dependent view is composed of a plurality of pictures P 21 , P 22 , P 23 , P 24 , P 25 , P 26 , P 27 . Further, all the pictures P 21 , P 22 , P 23 , P 24 , P 25 , P 26 , P 27 belonging to the dependent view are P pictures. Note that the dependent view is encoded and decoded by referring to, in addition to the pictures belonging to the dependent view, the pictures corresponding to the pictures to be processed and belonging to the base view (i.e., inter-view prediction coding).

[0227] The base view and the dependent view are images of the subject seen from different viewpoints. That is, the pictures corresponding to each other in the base view and the dependent view (pictures with the same timestamp added) have a horizontal parallax. And the second encoding unit 320 can encode each picture belonging to the dependent view using, as a reference picture, an image corresponding to the picture to be processed belonging to the base view. Hereinafter, with reference to FIG. 23, the operation of the temporal prediction motion vector calculation unit 114 of the second encoding unit 320 will be described.

[0228] First, the temporal prediction motion vector calculation unit 114 determines whether a temporal prediction motion vector can be obtained during the encoding of the block to be encoded (S91). And when the temporal prediction motion vector cannot be obtained (Yes in S91), the temporal prediction motion vector calculation unit 114 includes the parallax vector described later in the prediction motion vector candidates (S92). On the other hand, when the temporal prediction motion vector can be obtained (No in S91), the temporal prediction motion vector calculation unit 114 includes the temporal prediction motion vector in the prediction motion vector candidates (S93).

[0229] Here, the case where the temporal prediction motion vector cannot be obtained is, for example, when the block to be encoded is the picture P at the head of the GOP 21 、P 25 . The pictures P at the head of the GOP 21 、P 25 cannot refer to pictures before this picture in the display order. That is, when the encoding order and the display order match, the pictures that can be referred to for P 21 、P 25 are only the corresponding pictures I 11 、I 15 in the base view.

[0230] However, for pictures I 11 、I 15Since it is an I picture, there is no motion vector information. Therefore, in such a case, the temporal prediction motion vector calculation unit 114 includes the disparity vector stored in the global vector storage unit 116 in the predicted motion vector candidates as an alternative vector for the temporal prediction motion vector, and includes the disparity vector in the header information of the dependent bitstream.

[0231] Here, the disparity vector is a vector corresponding to the disparity between the base view and the dependent view. Specifically, the inter prediction control unit 112 of the second encoding unit 320 outputs the motion vector when each block constituting the encoding target picture of the dependent view is inter prediction encoded (that is, the motion vector when encoded using the corresponding picture of the base view as a reference picture) to the global vector storage unit 116. Then, the global vector storage unit 116 stores the average value, median value, or most frequent value, etc. of the motion vectors obtained from the inter prediction control unit 112 in units of pictures as the disparity vector.

[0232] Note that in step S92 of FIG. 23, the temporal prediction motion vector calculation unit 114 uses, as the disparity vector of the picture P of the dependent view, the disparity vector calculated for the picture P at the head of the GOP immediately preceding the GOP to which the picture P belongs (the disparity vector using the picture I as the reference picture), or the disparity vector calculated for the immediately preceding encoded picture P (the disparity vector using the picture P as the reference picture). 25 of the GOP to which the picture P belongs, or the disparity vector calculated for the immediately preceding encoded picture P (the disparity vector using the picture P as the reference picture). 25 of the GOP immediately preceding the GOP to which the picture P belongs (the disparity vector using the picture I as the reference picture), or the disparity vector calculated for the immediately preceding encoded picture P (the disparity vector using the picture P as the reference picture). 21 as the disparity vector of the picture P of the dependent view, the disparity vector calculated for the picture P at the head of the GOP immediately preceding the GOP to which the picture P belongs (the disparity vector using the picture I as the reference picture), or the disparity vector calculated for the immediately preceding encoded picture P (the disparity vector using the picture P as the reference picture). 11 as the reference picture), or the disparity vector calculated for the immediately preceding encoded picture P (the disparity vector using the picture P as the reference picture). 24 as the reference picture), or the disparity vector calculated for the immediately preceding encoded picture P (the disparity vector using the picture P as the reference picture). 14 as the reference picture), or the disparity vector calculated for the immediately preceding encoded picture P (the disparity vector using the picture P as the reference picture).

[0233] In addition, in step S91 of FIG. 23, the specific example in the case where the temporal prediction motion vector cannot be obtained is not limited to the above example, and it may be the case where the co-located usage prohibition flag of the encoding target picture is on. Since the co-located usage prohibition flag is common to the description of Embodiment 1, the description will not be repeated.

[0234] As described above, the present invention can also be applied to encoding basic views and dependent views that constitute multi-view video. That is, by switching whether to include a temporal prediction motion vector or a disparity vector, which is an alternative vector to the temporal prediction motion vector, in the prediction motion vector candidates when encoding an encoding target picture belonging to a dependent view, it is possible to prevent the propagation of decoding errors while suppressing a decrease in encoding efficiency.

[0235] Next, with reference to FIG. 25, a moving image decoding apparatus 400 according to a modification of Embodiment 2 will be described. FIG. 25 is a block diagram of the moving image decoding apparatus 400 according to the modification of Embodiment 2. A detailed description of the common points with Embodiment 2 will be omitted, and the description will focus on the differences.

[0236] As shown in FIG. 25, the moving image decoding apparatus 400 includes a first decoding unit 410 that generates a basic view by decoding a basic bitstream, and a second decoding unit 420 that generates a dependent view by decoding a dependent bitstream. Note that FIG. 25 shows an example in which an independent basic bitstream and a dependent bitstream are separately input to the moving image decoding apparatus 400, but the present invention is not limited to this, and a single bitstream in which the basic bitstream and the dependent bitstream are combined may be input and divided into the basic bitstream and the dependent bitstream inside the moving image decoding apparatus 400.

[0237] The basic configurations of the first decoding unit 410 and the second decoding unit 420 are common to the moving image decoding apparatus 200 shown in FIG. 15. However, in addition to the functions of the moving image decoding apparatus 200, the second decoding unit 420 has a function of referring to the frame memory 206 and the like of the first decoding unit 410. That is, the moving image decoding apparatus 400 decodes the basic bitstream and the dependent bitstream encoded by the moving image encoding apparatus 300.

[0238] Then, the second decoding unit 420 of the moving image decoding apparatus 400 can switch whether to include the temporal prediction motion vector stored in the colPic memory 212 or the disparity vector included in the header information of the dependent bitstream in one of the candidate prediction motion vectors of the block to be decoded. Note that the operation of the temporal prediction motion vector calculation unit 211 included in the second decoding unit 420 is the same as the process of FIG. 23.

[0239] As described above, the moving image encoding apparatus and the moving image decoding apparatus according to the embodiment have been described. However, the present invention is not limited to this embodiment.

[0240] Also, each processing unit included in the moving image encoding apparatus and the moving image decoding apparatus according to the above embodiment is typically realized as an LSI which is an integrated circuit. These may be individually formed into one chip, or may be formed into one chip so as to include some or all of them.

[0241] Also, the integration is not limited to LSI, and it may be realized by a dedicated circuit or a general-purpose processor. An FPGA (Field Programmable Gate Array) which can be programmed after manufacturing the LSI, or a reconfigurable processor which can reconfigure the connection and setting of circuit cells inside the LSI may be used.

[0242] In each of the above embodiments, each component may be configured by dedicated hardware, or may be realized by executing a software program suitable for each component. Each component may be realized by a program execution unit such as a CPU or a processor reading and executing a software program recorded on a recording medium such as a hard disk or a semiconductor memory.

[0243] In other words, the moving image encoding device and the moving image decoding device include a control circuitry and a storage electrically connected to the control circuitry (accessible from the control device). The control circuitry includes at least one of dedicated hardware and a program execution unit. Further, when the control circuitry includes a program execution unit, the storage stores a software program executed by the program execution unit.

[0244] Furthermore, the present invention may be the above software program or a non-transitory computer-readable recording medium on which the above program is recorded. Needless to say, the above program can be distributed via a transmission medium such as the Internet.

[0245] Also, all the numbers used above are for illustrative purposes to specifically describe the present invention, and the present invention is not limited to the illustrated numbers.

[0246] Also, the division of the functional blocks in the block diagram is an example, and a plurality of functional blocks may be realized as one functional block, one functional block may be divided into a plurality, or some functions may be transferred to other functional blocks. Further, the functions of a plurality of functional blocks having similar functions may be processed by a single piece of hardware or software in parallel or in time division.

[0247] Also, the order in which the steps included in the above moving image encoding method or moving image decoding method are executed is for illustrative purposes to specifically describe the present invention, and may be an order other than the above. Also, some of the above steps may be executed simultaneously (in parallel) with other steps.

[0248] As described above, the moving image encoding apparatus and the moving image decoding apparatus according to one or more aspects of the present invention have been described based on the embodiments. However, the present invention is not limited to these embodiments. Without departing from the spirit of the present invention, various modifications conceived by those skilled in the art applied to these embodiments, or forms constructed by combining components in different embodiments may also be included within the scope of one or more aspects of the present invention.

[0249] (Embodiment 3) By recording a program for realizing the configuration of the moving image encoding method (image encoding method) or the moving image decoding method (image decoding method) shown in each of the above embodiments on a storage medium, the processing shown in each of the above embodiments can be easily implemented in an independent computer system. The storage medium may be any medium capable of recording a program, such as a magnetic disk, an optical disk, a magneto-optical disk, an IC card, a semiconductor memory, or the like.

[0250] Furthermore, here, application examples of the moving image encoding method (image encoding method) and the moving image decoding method (image decoding method) shown in each of the above embodiments and a system using the same will be described. The system is characterized by having an image encoding / decoding apparatus including an image encoding apparatus using the image encoding method and an image decoding apparatus using the image decoding method. Other configurations in the system can be appropriately changed as needed.

[0251] FIG. 26 is a diagram showing the overall configuration of a content supply system ex100 for realizing a content distribution service. The communication service providing area is divided into a desired size, and base stations ex106, ex107, ex108, ex109, and ex110, which are fixed radio stations, are installed in each cell.

[0252] This content supply system ex100 is connected to the Internet ex101, an Internet service provider ex102, a telephone network ex104, and base stations ex106 via ex110 to various devices such as a computer ex111, a PDA (Personal Digital Assistant) ex112, a camera ex113, a mobile phone ex114, and a game console ex115.

[0253] However, the content supply system ex100 is not limited to the configuration as shown in FIG. 26, and any elements may be combined and connected. Also, each device may be directly connected to the telephone network ex104 without passing through ex110 from the base station ex106 which is a fixed radio station. Further, each device may be directly connected to each other via short-range wireless or the like.

[0254] The camera ex113 is a device capable of shooting videos such as a digital video camera, and the camera ex116 is a device capable of shooting still images and videos such as a digital camera. Also, the mobile phone ex114 may be a mobile phone of the GSM (registered trademark) (Global System for Mobile Communications) system, CDMA (Code Division Multiple Access) system, W-CDMA (Wideband-Code Division Multiple Access) system, or LTE (Long Term Evolution) system, HSPA (High Speed Packet Access), or PHS (Personal Handyphone System), etc., and any of them is acceptable.

[0255] In the content supply system ex100, cameras ex113 etc. are connected to the streaming server ex103 through the base station ex109 and the telephone network ex104, enabling live distribution and the like. In live distribution, for the content captured by the user using the camera ex113 (for example, the video of a music live etc.), encoding processing is performed as described in each of the above embodiments (that is, it functions as an image encoding device according to one aspect of the present invention), and it is transmitted to the streaming server ex103. On the other hand, the streaming server ex103 stream-distributes the content data transmitted to the requested client. As clients, there are a computer ex111, a PDA ex112, a camera ex113, a mobile phone ex114, a game machine ex115, etc. that can decode the encoded data. In each device that has received the distributed data, the received data is decoded and reproduced (that is, it functions as an image decoding device according to one aspect of the present invention).

[0256] Note that the encoding process of the captured data may be performed by the camera ex113, may be performed by the streaming server ex103 that performs the data transmission process, or may be shared between them. Similarly, the decoding process of the distributed data may be performed by the client, may be performed by the streaming server ex103, or may be shared between them. Also, not limited to the camera ex113, still image and / or moving image data captured by the camera ex116 may be transmitted to the streaming server ex103 via the computer ex111. In this case, the encoding process may be performed by any of the camera ex116, the computer ex111, and the streaming server ex103, or may be shared between them.

[0257] Also, these encoding and decoding processes are generally processed in a computer ex111 or an LSI ex500 possessed by each device. The LSI ex500 may be a one-chip configuration or a configuration consisting of multiple chips. Note that software for moving image encoding and decoding may be incorporated into some recording medium (such as a CD-ROM, flexible disk, hard disk, etc.) readable by a computer ex111 or the like, and the encoding and decoding processes may be performed using such software. Further, when the mobile phone ex114 has a camera, moving image data acquired by the camera may be transmitted. The moving image data at this time is data encoded by the LSI ex500 possessed by the mobile phone ex114.

[0258] Also, the streaming server ex103 may be a plurality of servers or a plurality of computers, which may distribute, process, and record data.

[0259] As described above, in the content supply system ex100, the encoded data can be received and played back by the client. Thus, in the content supply system ex100, information transmitted by the user can be received, decoded, and played back in real time by the client, and even a user without special rights or facilities can realize personal broadcasting.

[0260] Note that, not limited to the example of the content supply system ex100, as shown in FIG. 27, in the digital broadcast system ex200 as well, at least one of the moving image encoding device (image encoding device) or the moving image decoding device (image decoding device) of each of the above embodiments can be incorporated. Specifically, in the broadcasting station ex201, multiplexed data in which music data and the like are multiplexed with video data is transmitted via radio waves to a communication or satellite ex202. This video data is data encoded by the moving image encoding method described in each of the above embodiments (that is, data encoded by the image encoding device according to one aspect of the present invention). The broadcast satellite ex202 that has received this transmits radio waves for broadcasting, and an antenna ex204 of a home capable of receiving satellite broadcasts receives this radio wave. The received multiplexed data is decoded and reproduced by a device such as a television (receiver) ex300 or a set-top box (STB) ex217 (that is, functions as an image decoding device according to one aspect of the present invention).

[0261] Also, it is possible to implement the moving image decoding device or the moving image encoding device shown in each of the above embodiments in a reader / recorder ex218 that reads and decodes multiplexed data recorded on a recording medium ex215 such as a DVD or a BD, or encodes a video signal onto the recording medium ex215 and, in some cases, multiplexes and writes it with a music signal. In this case, the reproduced video signal is displayed on a monitor ex219, and the video signal can be reproduced by other devices and systems using the recording medium ex215 on which the multiplexed data is recorded. Further, a moving image decoding device may be implemented in a set-top box ex217 connected to a cable ex203 for cable television or an antenna ex204 for satellite / terrestrial wave broadcast, and this may be displayed on a monitor ex219 of a television. At this time, instead of the set-top box, the moving image decoding device may be incorporated in the television.

[0262] FIG. 28 is a diagram showing a television (receiver) ex300 using the moving image decoding method and the moving image encoding method described in each of the above embodiments. The television ex300 acquires or outputs multiplexed data in which audio data is multiplexed with video data via an antenna ex204 or a cable ex203 or the like that receives the above broadcast, a tuner ex301, a modulation / demodulation unit ex302 that demodulates the received multiplexed data or modulates the multiplexed data to be transmitted externally, and a multiplexing / demultiplexing unit ex303 that separates the demodulated multiplexed data into video data and audio data, or multiplexes the video data and audio data encoded by a signal processing unit ex306.

[0263] Further, the television ex300 has a signal processing unit ex306 having an audio signal processing unit ex304 and a video signal processing unit ex305 (functioning as an image encoding device or an image decoding device according to an aspect of the present invention) that decode audio data and video data respectively or encode respective information, and an output unit ex309 having a speaker ex307 that outputs the decoded audio signal and a display unit ex308 such as a display that displays the decoded video signal. Further, the television ex300 has an interface unit ex317 having an operation input unit ex312 or the like that receives input of user operations. Further, the television ex300 has a control unit ex310 that comprehensively controls each unit and a power supply circuit unit ex311 that supplies power to each unit. The interface unit ex317 may have, in addition to the operation input unit ex312, a bridge ex313 connected to an external device such as a reader / recorder ex218, a slot unit ex314 for enabling attachment of a recording medium ex216 such as an SD card, a driver ex315 for connecting to an external recording medium such as a hard disk, a modem ex316 for connecting to a telephone network, and the like. Note that the recording medium ex216 enables electrical recording by a non-volatile / volatile semiconductor memory element for storing. Each unit of the television ex300 is connected to each other via a synchronization bus.

[0264] First, a configuration in which the TV ex300 decodes and plays multiplexed data acquired from the outside by an antenna ex204 or the like will be described. The TV ex300 receives a user operation from a remote controller ex220 or the like, and based on the control of a control unit ex310 having a CPU or the like, separates the multiplexed data demodulated by a modulation / demodulation unit ex302 in a multiplexing / demultiplexing unit ex303. Further, the TV ex300 decodes the separated audio data in an audio signal processing unit ex304, and decodes the separated video data in a video signal processing unit ex305 using the decoding method described in each of the above embodiments. The decoded audio signal and video signal are output from an output unit ex309 to the outside. When outputting, these signals may be temporarily stored in buffers ex318, ex319, etc. so that the audio signal and the video signal are played back synchronously. Also, the TV ex300 may read multiplexed data from recording media ex215, ex216 such as a magnetic / optical disk or an SD card, instead of from a broadcast or the like. Next, a configuration in which the TV ex300 encodes an audio signal or a video signal and transmits it to the outside or writes it to a recording medium or the like will be described. The TV ex300 receives a user operation from a remote controller ex220 or the like, and based on the control of the control unit ex310, encodes the audio signal in the audio signal processing unit ex304, and encodes the video signal in the video signal processing unit ex305 using the encoding method described in each of the above embodiments. The encoded audio signal and video signal are multiplexed in the multiplexing / demultiplexing unit ex303 and output to the outside. When multiplexing, these signals may be temporarily stored in buffers ex320, ex321, etc. so that the audio signal and the video signal are synchronized. Note that a plurality of buffers ex318, ex319, ex320, ex321 may be provided as shown in the figure, or a configuration in which one or more buffers are shared may be used. Further, in addition to what is shown in the figure, for example, data may be stored in a buffer as a buffer material for avoiding system overflow or underflow between the modulation / demodulation unit ex302 and the multiplexing / demultiplexing unit ex303 or the like.

[0265] In addition to acquiring audio data and video data from broadcasts, recording media, etc., the TV ex300 is configured to accept AV inputs from microphones and cameras, and may perform encoding processing on the data acquired therefrom. Here, the TV ex300 has been described as being configured to perform the above encoding processing, multiplexing, and external output, but it may be configured such that these processes cannot be performed and only the above reception, decoding processing, and external output are possible.

[0266] Also, when reading or writing multiplexed data from a recording medium with the reader / writer ex218, the above decoding processing or encoding processing may be performed by either the TV ex300 or the reader / writer ex218, or the TV ex300 and the reader / writer ex218 may share the processing with each other.

[0267] As an example, Fig. 29 shows the configuration of the information reproduction / recording unit ex400 when reading or writing data from / to an optical disc. The information reproduction / recording unit ex400 includes elements ex401, ex402, ex403, ex404, ex405, ex406, and ex407 described below. The optical head ex401 irradiates a laser spot on the recording surface of the recording medium ex215, which is an optical disc, to write information, and detects the reflected light from the recording surface of the recording medium ex215 to read information. The modulation recording unit ex402 electrically drives the semiconductor laser built in the optical head ex401 and modulates the laser light according to the recording data. The reproduction demodulation unit ex403 amplifies the reproduction signal obtained by electrically detecting the reflected light from the recording surface by the photodetector built in the optical head ex401, separates and demodulates the signal components recorded on the recording medium ex215, and reproduces the necessary information. The buffer ex404 temporarily holds the information to be recorded on the recording medium ex215 and the information reproduced from the recording medium ex215. The disc motor ex405 rotates the recording medium ex215. The servo control unit ex406 moves the optical head ex401 to a predetermined information track while controlling the rotational drive of the disc motor ex405, and performs tracking processing of the laser spot. The system control unit ex407 controls the entire information reproduction / recording unit ex400. The above reading and writing processes are realized by the system control unit ex407 using various information held in the buffer ex404, generating and adding new information as necessary, and causing the modulation recording unit ex402, the reproduction demodulation unit ex403, and the servo control unit ex406 to cooperate while performing information recording and reproduction through the optical head ex401. The system control unit ex407 is composed of, for example, a microprocessor, and executes those processes by executing a reading and writing program.

[0268] In the above, the optical head ex401 has been described as irradiating a laser spot, but a configuration using near-field light for higher-density recording may also be used.

[0269] Fig. 30 shows a schematic diagram of a recording medium ex215 which is an optical disc. On the recording surface of the recording medium ex215, guide grooves are formed in a spiral shape, and on the information track ex230, address information indicating the absolute position on the disc is recorded in advance by a change in the shape of the grooves. This address information includes information for specifying the position of a recording block ex231 which is a unit for recording data, and in a device for performing recording or playback, the recording block can be specified by reproducing the information track ex230 and reading the address information. Further, the recording medium ex215 includes a data recording area ex233, an inner peripheral area ex232, and an outer peripheral area ex234. The area used for recording user data is the data recording area ex233, and the inner peripheral area ex232 and the outer peripheral area ex234 arranged inside or outside the data recording area ex233 are used for specific purposes other than recording user data. The information reproduction / recording unit ex400 reads and writes encoded audio data, video data, or multiplexed data obtained by multiplexing these data with respect to the data recording area ex233 of such a recording medium ex215.

[0270] In the above, an optical disc such as a single-layer DVD or BD has been described as an example, but it is not limited to these, and an optical disc having a multi-layer structure and capable of recording not only on the surface but also on other surfaces may be used. Further, an optical disc having a structure for performing multi-dimensional recording / playback, such as recording information using lights of different colors with different wavelengths at the same location on the disc or recording layers of different information from different angles, may be used.

[0271] Also, in the digital broadcast system ex200, it is also possible to receive data from a satellite ex202 or the like by a vehicle ex210 having an antenna ex205 and reproduce a moving image on a display device such as a car navigation ex211 included in the vehicle ex210. Note that, as for the configuration of the car navigation ex211, for example, a configuration obtained by adding a GPS receiving unit to the configuration shown in Fig. 28 can be considered, and the same applies to a computer ex111, a mobile phone ex114, or the like.

[0272] FIG. 31A is a diagram showing a mobile phone ex114 using the moving image decoding method and the moving image encoding method described in the above embodiment. The mobile phone ex114 includes an antenna ex350 for transmitting and receiving radio waves to and from a base station ex110, a camera unit ex365 capable of capturing video and still images, and a display unit ex358 such as a liquid crystal display for displaying data obtained by decoding video captured by the camera unit ex365, video received by the antenna ex350, and the like. The mobile phone ex114 further includes a main body unit having an operation key unit ex366, an audio output unit ex357 such as a speaker for outputting audio, an audio input unit ex356 such as a microphone for inputting audio, a memory unit ex367 for storing encoded or decoded data such as captured video, still images, recorded audio, or received video, still images, and mails, or a slot unit ex364 which is an interface unit with a recording medium for storing data in the same manner.

[0273] Furthermore, a configuration example of the mobile phone ex114 will be described with reference to FIG. 31B. In the mobile phone ex114, a power supply circuit unit ex361, an operation input control unit ex362, a video signal processing unit ex355, a camera interface unit ex363, an LCD (Liquid Crystal Display) control unit ex359, a modulation / demodulation unit ex352, a multiplexing / demultiplexing unit ex353, an audio signal processing unit ex354, a slot unit ex364, and a memory unit ex367 are connected to each other via a bus ex370 with respect to a main control unit ex360 that comprehensively controls each unit of the main body unit including the display unit ex358 and the operation key unit ex366.

[0274] When the end call and the power key are turned on by the user's operation, the power supply circuit unit ex361 supplies power to each unit from a battery pack to activate the mobile phone ex114 to an operable state.

[0275] When the mobile phone ex114 is in the voice call mode, based on the control of the main control unit ex360 having a CPU, ROM, RAM, etc., the voice signal picked up by the voice input unit ex356 is converted into a digital voice signal by the voice signal processing unit ex354, spectrally spread by the modulation / demodulation unit ex352, and after performing digital-to-analog conversion processing and frequency conversion processing by the transmission / reception unit ex351, it is transmitted via the antenna ex350. Also, when the mobile phone ex114 is in the voice call mode, the received data received via the antenna ex350 is amplified, frequency conversion processing and analog-to-digital conversion processing are performed, spectral inverse spreading processing is performed by the modulation / demodulation unit ex352, and after being converted into an analog voice signal by the voice signal processing unit ex354, it is output from the voice output unit ex357.

[0276] Furthermore, when sending an email in the data communication mode, the text data of the email input by operating the operation key unit ex366 of the main body unit etc. is sent to the main control unit ex360 via the operation input control unit ex362. The main control unit ex360 performs spectral spreading processing on the text data by the modulation / demodulation unit ex352, and after performing digital-to-analog conversion processing and frequency conversion processing by the transmission / reception unit ex351, it is transmitted to the base station ex110 via the antenna ex350. When receiving an email, almost the reverse process is performed on the received data, and it is output to the display unit ex358.

[0277] When transmitting video, still images, or video and audio in the data communication mode, the video signal processing unit ex355 compresses and encodes the video signal supplied from the camera unit ex365 by the moving image encoding method shown in each of the above embodiments (i.e., functions as an image encoding device according to an aspect of the present invention), and sends the encoded video data to the multiplexing / demultiplexing unit ex353. Also, the voice signal processing unit ex354 encodes the voice signal picked up by the voice input unit ex356 while the camera unit ex365 is imaging video, still images, etc., and sends the encoded voice data to the multiplexing / demultiplexing unit ex353.

[0278] The multiplexing / demultiplexing unit ex353 multiplexes the encoded video data supplied from the video signal processing unit ex355 and the encoded audio data supplied from the audio signal processing unit ex354 in a predetermined manner, and the resulting multiplexed data is subjected to spread spectrum processing by the modulation / demodulation unit (modulation / demodulation circuit unit) ex352, and after performing digital-to-analog conversion processing and frequency conversion processing by the transmission / reception unit ex351, it is transmitted via the antenna ex350.

[0279] When receiving the data of a moving image file linked to a homepage or the like in the data communication mode, or when receiving an e-mail with video and / or audio attached, in order to decode the multiplexed data received via the antenna ex350, the multiplexing / demultiplexing unit ex353 separates the multiplexed data into a bit stream of video data and a bit stream of audio data, supplies the encoded video data to the video signal processing unit ex355 via the synchronization bus ex370, and supplies the encoded audio data to the audio signal processing unit ex354. The video signal processing unit ex355 decodes the video signal by decoding according to a moving image decoding method corresponding to the moving image encoding method shown in each of the above embodiments (i.e., functions as an image decoding device according to an aspect of the present invention), and for example, video and still images included in a moving image file linked to a homepage are displayed from the display unit ex358 via the LCD control unit ex359. Also, the audio signal processing unit ex354 decodes the audio signal, and audio is output from the audio output unit ex357.

[0280] Also, terminals such as the mobile phone ex114 can be implemented in three forms: a transmission / reception type terminal having both an encoder and a decoder, a transmission terminal having only an encoder, and a reception terminal having only a decoder, similar to the TV ex300. Furthermore, in the digital broadcast system ex200, although it has been described as receiving and transmitting multiplexed data in which music data and the like are multiplexed with video data, data in which character data related to video and the like are multiplexed in addition to audio data may be used, or the video data itself instead of the multiplexed data may be used.

[0281] Thus, it is possible to use the moving image encoding method or the moving image decoding method shown in each of the above embodiments in any of the devices and systems described above, and by doing so, the effects described in each of the above embodiments can be obtained.

[0282] Further, the present invention is not limited to the above-described embodiments, and various modifications or corrections can be made without departing from the scope of the present invention.

[0283] (Embodiment 4) It is also possible to generate video data by appropriately switching, as necessary, between the moving image encoding method or apparatus shown in each of the above embodiments and a moving image encoding method or apparatus compliant with different standards such as MPEG-2, MPEG4-AVC, and VC-1.

[0284] Here, when generating a plurality of video data compliant with different standards respectively, it is necessary to select a decoding method corresponding to each standard when decoding. However, since it is impossible to identify which standard the video data to be decoded complies with, there arises a problem that an appropriate decoding method cannot be selected.

[0285] To solve this problem, the multiplexed data obtained by multiplexing audio data or the like with the video data has a configuration including identification information indicating which standard the video data complies with. A specific configuration of the multiplexed data including the video data generated by the moving image encoding method or apparatus shown in each of the above embodiments will be described below. The multiplexed data is a digital stream in the form of an MPEG-2 transport stream.

[0286] FIG. 32 is a diagram showing the configuration of multiplexed data. As shown in FIG. 32, the multiplexed data is obtained by multiplexing one or more of a video stream, an audio stream, a presentation graphics stream (PG), and an interactive graphics stream. The video stream shows the main video and sub-video of a movie, the audio stream (IG) shows the main audio part of the movie and the sub-audio mixed with the main audio, and the presentation graphics stream shows the subtitles of the movie. Here, the main video refers to the normal video displayed on the screen, and the sub-video refers to the video displayed in a small screen within the main video. Also, the interactive graphics stream shows an interactive screen created by arranging GUI components on the screen. The video stream is encoded by the moving image encoding method or apparatus shown in each of the above embodiments, or a moving image encoding method or apparatus compliant with conventional standards such as MPEG-2, MPEG4-AVC, and VC-1. The audio stream is encoded in a format such as Dolby AC-3, Dolby Digital Plus, MLP, DTS, DTS-HD, or linear PCM.

[0287] Each stream included in the multiplexed data is identified by a PID. For example, 0x1011 is assigned to the video stream used for the video of the movie, 0x1100 to 0x111F are assigned to the audio stream, 0x1200 to 0x121F are assigned to the presentation graphics, 0x1400 to 0x141F are assigned to the interactive graphics stream, 0x1B00 to 0x1B1F are assigned to the video stream used for the sub-video of the movie, and 0x1A00 to 0x1A1F are assigned to the audio stream used for the sub-audio mixed with the main audio, respectively.

[0288] FIG. 33 is a diagram schematically showing how multiplexed data is multiplexed. First, a video stream ex235 composed of a plurality of video frames and an audio stream ex238 composed of a plurality of audio frames are respectively converted into PES packet sequences ex236 and ex239, and then converted into TS packets ex237 and ex240. Similarly, the data of the presentation graphics stream ex241 and the interactive graphics ex244 are respectively converted into PES packet sequences ex242 and ex245, and further converted into TS packets ex243 and ex246. The multiplexed data ex247 is constituted by multiplexing these TS packets into one stream.

[0289] FIG. 34 shows in more detail how a video stream is stored in a PES packet sequence. The first stage in FIG. 34 shows the video frame sequence of the video stream. The second stage shows the PES packet sequence. As shown by the arrows yy1, yy2, yy3, yy4 in FIG. 34, a plurality of Video Presentation Units in the video stream, namely I pictures, B pictures, and P pictures, are divided for each picture and stored in the payload of the PES packet. Each PES packet has a PES header, and the PES header stores a PTS (Presentation Time-Stamp), which is the display time of the picture, and a DTS (Decoding Time-Stamp), which is the decoding time of the picture.

[0290] Figure 35 shows the format of the TS packet that is finally written to the multiplexed data. The TS packet is a 188-byte fixed-length packet composed of a 4-byte TS header that holds information such as the PID for identifying the stream and a 184-byte TS payload for storing data. The above PES packet is split and stored in the TS payload. In the case of a BD-ROM, a 4-byte TP_Extra_Header is added to the TS packet to form a 192-byte source packet, which is written to the multiplexed data. Information such as ATS (Arrival_Time_Stamp) is described in the TP_Extra_Header. ATS indicates the transfer start time to the PID filter of the decoder for the TS packet. As shown in the lower part of Figure 35, source packets are arranged in the multiplexed data, and the number incremented from the head of the multiplexed data is called SPN (Source Packet Number).

[0291] Also, in the TS packets included in the multiplexed data, in addition to each stream such as video, audio, and subtitles, there are PAT (Program Association Table), PMT (Program Map Table), PCR (Program Clock Reference), etc. PAT indicates what the PID of the PMT used in the multiplexed data is, and the PID of PAT itself is registered as 0. PMT has the PID of each stream such as video, audio, and subtitles included in the multiplexed data and the attribute information of the stream corresponding to each PID, and also has various descriptors related to the multiplexed data. The descriptor includes copy control information for instructing permission / non-permission of copying the multiplexed data. PCR has the information of the STC time corresponding to the ATS at which the PCR packet is transferred to the decoder in order to synchronize the ATC (Arrival Time Clock), which is the time axis of ATS, and the STC (System Time Clock), which is the time axis of PTS and DTS.

[0292] FIG. 36 is a diagram for explaining in detail the data structure of a PMT. At the head of the PMT, a PMT header that describes the length of the data included in the PMT and the like is arranged. After that, a plurality of descriptors related to the multiplexed data are arranged. The above copy control information and the like are described as descriptors. After the descriptors, a plurality of stream information related to each stream included in the multiplexed data are arranged. The stream information is composed of a stream descriptor that describes a stream type, a PID of the stream, and attribute information of the stream (frame rate, aspect ratio, etc.) in order to identify the compression codec of the stream. The stream descriptors exist in the same number as the number of streams existing in the multiplexed data.

[0293] When recording on a recording medium or the like, the above multiplexed data is recorded together with a multiplexed data information file.

[0294] As shown in FIG. 37, the multiplexed data information file is management information of the multiplexed data, corresponds one-to-one with the multiplexed data, and is composed of multiplexed data information, stream attribute information, and an entry map.

[0295] As shown in FIG. 37, the multiplexed data information is composed of a system rate, a reproduction start time, and a reproduction end time. The system rate indicates the maximum transfer rate of the multiplexed data to the PID filter of a system target decoder described later. The interval of the ATS included in the multiplexed data is set to be equal to or less than the system rate. The reproduction start time is the PTS of the video frame at the head of the multiplexed data, and the reproduction end time is set to be the PTS of the video frame at the end of the multiplexed data plus the reproduction interval for one frame.

[0296] As shown in FIG. 38, for each stream included in the multiplexed data, stream attribute information is registered for each PID. The attribute information has different information for each of the video stream, audio stream, presentation graphics stream, and interactive graphics stream. The video stream attribute information includes information such as what compression codec the video stream is compressed with, what the resolution of the individual picture data constituting the video stream is, what the aspect ratio is, and what the frame rate is. The audio stream attribute information includes information such as what compression codec the audio stream is compressed with, how many channels are included in the audio stream, what language it corresponds to, and what the sampling frequency is. These information are used for initialization of the decoder before playback by the player and the like.

[0297] In the present embodiment, among the above multiplexed data, the stream type included in the PMT is used. Also, when the multiplexed data is recorded on the recording medium, the video stream attribute information included in the multiplexed data information is used. Specifically, in the moving image encoding method or apparatus shown in each of the above embodiments, a step or means for setting unique information indicating that it is video data generated by the moving image encoding method or apparatus shown in each of the above embodiments with respect to the stream type included in the PMT or the video stream attribute information is provided. With this configuration, it becomes possible to distinguish the video data generated by the moving image encoding method or apparatus shown in each of the above embodiments from the video data conforming to other standards.

[0298] Also, the steps of the moving image decoding method in the present embodiment are shown in FIG. 39. In step exS100, the stream type included in the PMT from the multiplexed data or the video stream attribute information included in the multiplexed data information is acquired. Next, in step exS101, it is determined whether the stream type or the video stream attribute information indicates that the multiplexed data is generated by the moving image encoding method or apparatus shown in each of the above embodiments. And when it is determined that the stream type or the video stream attribute information is generated by the moving image encoding method or apparatus shown in each of the above embodiments, in step exS102, the reference picture and the motion vector are selected from the candidates by the moving image decoding method shown in each of the above embodiments for decoding. Also, when the stream type or the video stream attribute information indicates that it conforms to a conventional standard such as MPEG-2, MPEG4-AVC, VC-1, etc., in step exS103, decoding is performed by a moving image decoding method conforming to the conventional standard. For example, if the attribute information indicates that it conforms to the MPEG4-AVC standard, instead of selecting from a plurality of candidates, decoding is performed using the motion vector calculated from the motion vectors of the surrounding blocks adjacent spatially or temporally.

[0299] In this way, by setting a new unique value for the stream type or the video stream attribute information, it is possible to determine whether decoding can be performed by the moving image decoding method or apparatus shown in each of the above embodiments when decoding. Therefore, even when multiplexed data conforming to different standards is input, an appropriate decoding method or apparatus can be selected, so that decoding can be performed without causing an error. Also, the moving image encoding method or apparatus, or the moving image decoding method or apparatus shown in the present embodiment can be used in any of the devices and systems described above.

[0300] (Embodiment 5) The moving image encoding method, apparatus, moving image decoding method, and apparatus shown in each of the above embodiments are typically realized by an LSI which is an integrated circuit. As an example, FIG. 40 shows the configuration of an LSIex500 integrated into one chip. The LSIex500 includes elements ex501, ex502, ex503, ex504, ex505, ex506, ex507, ex508, ex509 described below, and each element is connected via a bus ex510. The power supply circuit section ex505 starts up in an operable state by supplying power to each section when the power is on.

[0301] For example, when performing encoding processing, the LSIex500 inputs an AV signal from a microphone ex117, a camera ex113, etc. through an AV I / O ex509 based on the control of a control section ex501 having a CPU ex502, a memory controller ex503, a stream controller ex504, a drive frequency control section ex512, etc. The input AV signal is temporarily stored in an external memory ex511 such as an SDRAM. Based on the control of the control section ex501, the stored data is appropriately divided into a plurality of times according to the processing amount and processing speed and sent to a signal processing section ex507, where encoding of the audio signal and / or encoding of the video signal is performed. Here, the encoding process of the video signal is the encoding process described in each of the above embodiments. The signal processing section ex507 further performs processes such as multiplexing the possibly encoded audio data and the encoded video data, and outputs it to the outside through a stream I / O ex506. This output multiplexed data is transmitted toward a base station ex107 or written to a recording medium ex215. Note that when multiplexing, it is advisable to temporarily store the data in a buffer ex508 so as to be synchronized.

[0302] Note that in the above, the memory ex511 was described as an external configuration of the LSIex500, but it may be a configuration included inside the LSIex500. The buffer ex508 is not limited to one, and a plurality of buffers may be provided. Also, the LSIex500 may be integrated into one chip or may be integrated into a plurality of chips.

[0303] Also, in the above description, the control unit ex501 is described as having the CPU ex502, memory controller ex503, stream controller ex504, drive frequency control unit ex512, etc., but the configuration of the control unit ex501 is not limited to this configuration. For example, the signal processing unit ex507 may further include a CPU. By providing a CPU inside the signal processing unit ex507 as well, it becomes possible to further improve the processing speed. Also, as another example, the CPU ex502 may include the signal processing unit ex507, or a part of the signal processing unit ex507, for example, an audio signal processing unit. In such a case, the control unit ex501 has a configuration including the signal processing unit ex507 or the CPU ex502 having a part thereof.

[0304] Here, it is described as an LSI, but depending on the integration level, it may also be referred to as an IC, system LSI, super LSI, or ultra LSI.

[0305] Also, the method of integrating into an integrated circuit is not limited to LSI, and it may be realized by a dedicated circuit or a general-purpose processor. After manufacturing the LSI, an FPGA (Field Programmable Gate Array) that can be programmed, or a reconfigurable processor that can reconfigure the connections and settings of circuit cells inside the LSI may be used. Such programmable logic devices can typically execute the moving image encoding method or the moving image decoding method shown in each of the above embodiments by loading a program constituting software or firmware or reading it from a memory or the like.

[0306] Furthermore, if an integrated circuit technology that replaces the LSI appears due to the progress of semiconductor technology or other derived technologies, naturally, the integration of functional blocks may be performed using that technology. The application of biotechnology or the like is a possibility.

[0307] (Embodiment 6) When decoding video data generated by the moving image encoding method or apparatus shown in each of the above embodiments, the processing amount is considered to increase compared to the case of decoding video data compliant with conventional standards such as MPEG-2, MPEG4-AVC, and VC-1. Therefore, in the LSIex500, it is necessary to set the driving frequency higher than the driving frequency of the CPUex502 when decoding video data compliant with conventional standards. However, when the driving frequency is increased, there arises a problem that the power consumption becomes high.

[0308] To solve this problem, moving image decoding apparatuses such as the TVex300 and the LSIex500 are configured to identify which standard the video data conforms to and switch the driving frequency according to the standard. FIG. 41 shows the configuration ex800 in this embodiment. When the video data is generated by the moving image encoding method or apparatus shown in each of the above embodiments, the driving frequency switching unit ex803 sets the driving frequency high. Then, it instructs the decoding processing unit ex801 that executes the moving image decoding method shown in each of the above embodiments to decode the video data. On the other hand, when the video data is video data compliant with a conventional standard, the driving frequency is set lower than when the video data is generated by the moving image encoding method or apparatus shown in each of the above embodiments. Then, it instructs the decoding processing unit ex802 compliant with the conventional standard to decode the video data.

[0309] More specifically, the drive frequency switching unit ex803 is composed of the CPU ex502 and the drive frequency control unit ex512 in FIG. 40. Also, the decoding processing unit ex801 that executes the moving image decoding method shown in each of the above embodiments, and the decoding processing unit ex802 that conforms to the conventional standard correspond to the signal processing unit ex507 in FIG. 40. The CPU ex502 identifies which standard the video data conforms to. Then, based on the signal from the CPU ex502, the drive frequency control unit ex512 sets the drive frequency. Also, based on the signal from the CPU ex502, the signal processing unit ex507 decodes the video data. Here, for the identification of the video data, for example, it is conceivable to use the identification information described in Embodiment 4. The identification information is not limited to that described in Embodiment 4, and any information that can identify which standard the video data conforms to may be used. For example, when it is possible to identify which standard the video data conforms to based on an external signal that identifies whether the video data is for use on a television or for use on a disk, etc., the identification may be made based on such an external signal. Also, the selection of the drive frequency in the CPU ex502 can be considered to be performed based on, for example, a look-up table that associates the standard of the video data as shown in FIG. 43 with the drive frequency. The look-up table can be stored in the buffer ex508 or the internal memory of the LSI, and the CPU ex502 can select the drive frequency by referring to this look-up table.

[0310] Figure 42 shows the steps of implementing the method of this embodiment. First, in step exS200, the signal processing unit ex507 acquires identification information from the multiplexed data. Next, in step exS201, the CPU ex502 identifies whether the video data is generated by the encoding method or apparatus shown in each of the above embodiments based on the identification information. If the video data is generated by the encoding method or apparatus shown in each of the above embodiments, then in step exS202, the CPU ex502 sends a signal for setting a high driving frequency to the driving frequency control unit ex512. Then, the driving frequency control unit ex512 sets a high driving frequency. On the other hand, if it is shown that the video data conforms to conventional standards such as MPEG-2, MPEG4-AVC, VC-1, etc., then in step exS203, the CPU ex502 sends a signal for setting a low driving frequency to the driving frequency control unit ex512. Then, the driving frequency control unit ex512 sets a lower driving frequency compared to the case where the video data is generated by the encoding method or apparatus shown in each of the above embodiments.

[0311] Furthermore, in conjunction with the switching of the driving frequency, by changing the voltage supplied to the LSI ex500 or the apparatus including the LSI ex500, it is possible to further enhance the power saving effect. For example, when setting the driving frequency low, it is conceivable to set the voltage supplied to the LSI ex500 or the apparatus including the LSI ex500 lower compared to the case of setting the driving frequency high.

[0312] Also, the method of setting the driving frequency may be to set the driving frequency high when the processing amount during decoding is large, and set the driving frequency low when the processing amount during decoding is small, and is not limited to the above-described setting method. For example, if the processing amount for decoding video data conforming to the MPEG4-AVC standard is larger than the processing amount for decoding video data generated by the moving image encoding method or apparatus shown in each of the above embodiments, it is conceivable to reverse the setting of the driving frequency compared to the above-described case.

[0313] Furthermore, the method of setting the drive frequency is not limited to a configuration that lowers the drive frequency. For example, when the identification information indicates that the video data is generated by the moving image encoding method or apparatus shown in each of the above embodiments, the voltage applied to the LSIex500 or the apparatus including the LSIex500 is set high, and when it indicates that the video data conforms to conventional standards such as MPEG-2, MPEG4-AVC, and VC-1, it is also conceivable to set the voltage applied to the LSIex500 or the apparatus including the LSIex500 low. As another example, when the identification information indicates that the video data is generated by the moving image encoding method or apparatus shown in each of the above embodiments, the driving of the CPUex502 is not stopped, and when it indicates that the video data conforms to conventional standards such as MPEG-2, MPEG4-AVC, and VC-1, since there is a margin in processing, it is also conceivable to temporarily stop the driving of the CPUex502. Even when the identification information indicates that the video data is generated by the moving image encoding method or apparatus shown in each of the above embodiments, if there is a margin in processing, it is also conceivable to temporarily stop the driving of the CPUex502. In this case, it is conceivable to set the stop time shorter than when it indicates that the video data conforms to conventional standards such as MPEG-2, MPEG4-AVC, and VC-1.

[0314] In this way, by switching the drive frequency according to the standard to which the video data conforms, it becomes possible to achieve power saving. Also, when driving an apparatus including the LSIex500 or the LSIex500 using a battery, it is possible to extend the life of the battery with the power saving.

[0315] (Embodiment 7) In devices and systems such as televisions and mobile phones, multiple video data conforming to different standards may be input. In order to enable decoding even when multiple video data conforming to different standards are input, the signal processing unit ex507 of LSIex500 needs to support multiple standards. However, if the signal processing unit ex507 corresponding to each standard is used individually, there will be problems such as an increase in the circuit scale of LSIex500 and an increase in cost.

[0316] To solve this problem, a configuration is adopted in which a decoding processing unit for executing the moving image decoding method shown in each of the above embodiments and a decoding processing unit conforming to conventional standards such as MPEG-2, MPEG4-AVC, and VC-1 are partially shared. This configuration example is shown in ex900 of FIG. 44A. For example, the moving image decoding method shown in each of the above embodiments and the moving image decoding method conforming to the MPEG4-AVC standard have some common processing contents in processes such as entropy encoding, inverse quantization, deblocking filter, and motion compensation. Regarding the common processing contents, a decoding processing unit ex902 corresponding to the MPEG4-AVC standard is shared, and for other processing contents specific to one aspect of the present invention that do not conform to the MPEG4-AVC standard, a dedicated decoding processing unit ex901 is used. In particular, since one aspect of the present invention is characterized by inter prediction, for example, a dedicated decoding processing unit ex901 is used for inter prediction, and for any one or all of the other processes of entropy decoding, inverse quantization, deblocking filter, and motion compensation, it is conceivable to share the decoding processing unit. Regarding the sharing of the decoding processing unit, for the common processing contents, the decoding processing unit for executing the moving image decoding method shown in each of the above embodiments is shared, and for the processing contents specific to the MPEG4-AVC standard, a configuration using a dedicated decoding processing unit may also be adopted.

[0317] Another example of sharing part of the processing is shown as ex1000 in FIG. 44B. In this example, a dedicated decoding processing unit ex1001 corresponding to the processing content specific to one aspect of the present invention, a dedicated decoding processing unit ex1002 corresponding to the processing content specific to other conventional standards, and a shared decoding processing unit ex1003 corresponding to the processing content common to the moving image decoding method according to one aspect of the present invention and the moving image decoding methods of other conventional standards are used. Here, the dedicated decoding processing units ex1001 and ex1002 are not necessarily specialized for the processing content specific to one aspect of the present invention or other conventional standards, and may be capable of executing other general-purpose processing. Also, the configuration of the present embodiment can be implemented by the LSI ex500.

[0318] As described above, by sharing the decoding processing unit for the processing content common to the moving image decoding method according to one aspect of the present invention and the moving image decoding methods of conventional standards, it is possible to reduce the circuit scale of the LSI and reduce the cost.

Industrial Applicability

[0319] The present invention is used in a moving image encoding device and a moving image decoding device. For example, the present invention can be used in information display devices and imaging devices such as televisions, digital video recorders, car navigation systems, mobile phones, digital still cameras, and digital video cameras.

Explanation of Signs

[0320] 100, 300 Moving image encoding device 101 Subtraction unit 102 Orthogonal transformation unit 103 Quantization unit 104, 202 Inverse quantization unit 105, 203 Inverse orthogonal transformation unit 106, 204 Addition unit 107, 205 Block memory 108, 206 Frame memory 109, 207 Intra prediction unit 110, 208 Inter prediction unit 111, 209 Switch 112, 210 Inter-prediction control unit 113 Picture type determination unit 114, 211 Temporal prediction motion vector calculation unit 115, 212 colPic memory 116 Global vector storage unit 117 Co-located information determination unit 118 Variable length encoding unit 200, 400 Video decoder 201 Variable length decoding unit 310 First encoding unit 320 Second encoding unit 410 First decoding unit 420 Second decoding unit

Claims

1. A program for causing a computer to execute a video decoding method for performing inter-prediction decoding using a motion vector on a current block included in a current picture, the program comprising: The video decoding method includes: Decoding a temporal prediction restriction flag indicating whether or not a temporal motion vector prediction using a temporal predicted motion vector, which is a motion vector of a block included in a decoded picture other than the current picture to be decoded, is used; If the temporal prediction restriction flag indicates that the temporal motion vector prediction is used, Decoding a first parameter for identifying a prediction direction to calculate the temporal motion vector predictor; deriving a plurality of first motion vector predictor candidates including the temporal motion vector predictor based on a prediction direction specified by the first parameter; Decoding a motion vector used in inter prediction decoding of the current block by using one of the plurality of first motion vector predictor candidates; if the temporal prediction restriction flag indicates that the temporal motion vector prediction is not used, deriving a plurality of second motion vector predictor candidates not including the temporal motion vector predictor; Decoding a motion vector used in inter prediction decoding of the current block by using one of the plurality of second motion vector predictor candidates; if the temporal prediction restriction flag indicates that the temporal motion vector prediction is not used, then not decoding the first parameter. program.

2. A program for causing a computer to execute a video coding method for performing inter-prediction coding using a motion vector on a current block included in a current picture, the program comprising: The video encoding method includes: encoding a temporal prediction restriction flag indicating whether or not a temporal motion vector prediction using a temporal predicted motion vector, which is a motion vector of a block included in a coded picture other than the coding target picture, is used; If the temporal prediction restriction flag indicates that the temporal motion vector prediction is used, Encoding a first parameter for specifying a prediction direction for calculating the temporal motion vector predictor; deriving a plurality of first motion vector predictor candidates including the temporal motion vector predictor based on a prediction direction specified by the first parameter; encoding a motion vector used in inter prediction coding of the current block by using one of the plurality of first motion vector predictor candidates; if the temporal prediction restriction flag indicates that the temporal motion vector prediction is not used, deriving a plurality of second motion vector predictor candidates not including the temporal motion vector predictor; encoding a motion vector used in inter prediction coding of the current block by using one of the plurality of second motion vector predictor candidates; if the temporal prediction restriction flag indicates that the temporal motion vector prediction is not used, then not encoding the first parameter; program.