Video encoding method and video encoding apparatus
The method improves video encoding error tolerance by determining a fixed maximum number of candidate motion vectors and encoding an index, ensuring accurate decoding even with lost reference information, enhancing coding efficiency and flexibility.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- SUN PATENT TRUST
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-26
AI Technical Summary
Conventional video encoding techniques lack sufficient error tolerance during interpretation, leading to potential mismatches in the number of predicted motion vector candidates between encoding and decoding devices due to lost reference picture information.
A video encoding method that determines a maximum number of candidate predicted motion vectors, derives first and second candidates as needed, and encodes an index for these candidates, allowing decoding without relying on actual candidate counts, thus improving error tolerance and coding efficiency.
Enhances the ability to decode video data accurately even with lost reference picture information, increasing the number of selectable motion vector types and improving coding efficiency by allowing parallel processing of candidate derivation and index decoding.
Smart Images

Figure 2026086611000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a moving image encoding method and a moving image encoding apparatus.
Background Art
[0002] In moving image encoding processing, generally, compression of the amount of information is performed by utilizing the redundancy in the spatial and temporal directions of the moving image. 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, an inter-picture prediction (hereinafter referred to as "inter prediction") encoding process is used. In the inter prediction encoding process, when encoding a certain picture, an encoded picture that is ahead or behind in the display time order with respect to the picture to be encoded is used as a reference picture. Then, a motion vector is derived by performing motion detection of the picture to be encoded with respect to the reference picture. Then, by calculating the difference between the predicted image data obtained by performing motion compensation based on the derived motion vector and the image data of the picture to be encoded, the redundancy in the temporal direction is removed (see, for example, Non-Patent Document 1). Here, in motion detection, a difference value between the encoding target block in the encoded picture and the block in the reference picture is calculated, and the block in the reference picture with the smallest difference value is determined as the reference block. Then, a motion vector is detected using the encoding target block and the reference block.
Prior Art Documents
Non-Patent Documents
[0003]
Non-Patent Document 1
Non-Patent Document 2
[0004] However, with the conventional techniques described above, there is a need to improve the error tolerance of video encoding and decoding using interpretation.
[0005] Therefore, the object of the present invention is to provide a video encoding method and a video encoding apparatus that can improve the error tolerance of video encoding and decoding using interpretation. [Means for solving the problem]
[0006] A video encoding method according to one aspect of the present invention is a video encoding method for encoding a block to be encoded, comprising: deriving a first candidate having a first predicted motion vector based on a first motion vector used to encode a first block; determining whether the number of one or more candidates including the first candidate is less than the maximum number of candidates; if the number of one or more candidates including the first candidate is less than the maximum number of candidates, deriving a second candidate having a second predicted motion vector; encoding an index corresponding to the candidate having the predicted motion vector, wherein the candidate is one of a plurality of candidates including the first candidate and the second candidate, and the maximum number of candidates is the same for all blocks included in the slice.
[0007] These general or specific embodiments may be implemented using systems, devices, integrated circuits, computer programs, or recording media such as computer-readable CD-ROMs (Compact Disc Read Only Memory), or any combination of systems, devices, methods, integrated circuits, computer programs, and recording media. [Effects of the Invention]
[0008] According to one aspect of the present invention, it becomes possible to improve the error tolerance of video encoding and decoding using interpretation. [Brief explanation of the drawing]
[0009] [Figure 1A] Figure 1A is a diagram illustrating an example of a reference picture list in Picture B. [Figure 1B] Figure 1B shows an example of a reference picture list for prediction direction 0 in picture B. [Figure 1C] Figure 1C shows an example of a reference picture list for prediction direction 1 in picture B. [Figure 2] Figure 2 is a diagram illustrating the motion vector in the time-predicted motion vector mode. [Figure 3] Figure 3 shows an example of the motion vectors of adjacent blocks used in the predictive motion vector specification mode. [Figure 4] Figure 4 illustrates an example of a list of candidate predicted motion vectors for prediction direction 0. [Figure 5] Figure 5 illustrates an example of a list of candidate predicted motion vectors for prediction direction 1. [Figure 6] Figure 6 shows an example of assigning a bit string to a predicted motion vector index. [Figure 7] Figure 7 is a flowchart showing an example of the encoding process when using the predictive motion vector specification mode. [Figure 8A] Figure 8A shows an example of calculating a predicted motion vector. [Figure 8B] Figure 8B shows an example of calculating a predicted motion vector. [Figure 9] Figure 9 is a block diagram showing an example of the configuration of a video encoding device that encodes video using a predictive motion vector specification mode. [Figure 10]FIG. 10 is a flowchart showing an example of decoding processing when using the predicted motion vector designation mode. [Figure 11] FIG. 11 is a block diagram showing an example of the configuration of a moving image decoding apparatus for decoding a moving image encoded using the predicted motion vector designation mode. [Figure 12] FIG. 12 is a diagram showing the syntax when adding a predicted motion vector index to a bit stream. [Figure 13] FIG. 13 is a block diagram showing the configuration of a moving image encoding apparatus according to Embodiment 1. [Figure 14] FIG. 14 is a flowchart showing the processing operation of the moving image encoding apparatus according to Embodiment 1. [Figure 15] FIG. 15 is a diagram showing an example of a predicted motion vector candidate list in prediction direction 0 in Embodiment 1. [Figure 16] FIG. 16 is a diagram showing an example of a predicted motion vector candidate list in prediction direction 1 in Embodiment 1. [Figure 17] FIG. 17 is a flowchart showing the calculation process of a predicted motion vector candidate and a predicted motion vector candidate list size in Embodiment 1. [Figure 18] FIG. 18 is a flowchart showing the update process of the number of predictable candidates in Embodiment 1. [Figure 19] FIG. 19 is a flowchart showing the addition process of a new candidate in Embodiment 1. [Figure 20] FIG. 20 is a flowchart showing the process related to the selection of a predicted motion vector candidate in Embodiment 1. [Figure 21] FIG. 21 is a block diagram showing the configuration of a moving image encoding apparatus according to Embodiment 2. [Figure 22] FIG. 22 is a flowchart showing the processing operation of the moving image encoding apparatus according to Embodiment 2. [Figure 23] FIG. 23 is a block diagram showing the configuration of a moving image decoding apparatus according to Embodiment 3. [Figure 24]Figure 24 is a flowchart showing the processing operation of the video decoding device according to Embodiment 3. [Figure 25] Figure 25 is a flowchart showing the process for calculating the number of predictable candidates in Embodiment 3. [Figure 26] Figure 26 is a flowchart showing the calculation process for predicted motion vector candidates in Embodiment 3. [Figure 27] Figure 27 shows an example of syntax for adding a predicted motion vector index to a bitstream. [Figure 28] Figure 28 shows an example of syntax when the size of the predicted motion vector candidate list is fixed to the maximum number of predicted motion vector candidates. [Figure 29] Figure 29 is a block diagram showing the configuration of the video decoding device according to Embodiment 4. [Figure 30] Figure 30 is a flowchart showing the processing operation of the video decoding device according to Embodiment 4. [Figure 31] Figure 31 is an overall diagram of the content supply system that realizes the content distribution service. [Figure 32] Figure 32 is an overall diagram of the digital broadcasting system. [Figure 33] Figure 33 is a block diagram showing an example of a television configuration. [Figure 34] Figure 34 is a block diagram showing an example configuration of an information playback / recording unit that reads and writes information to a recording medium, which is an optical disc. [Figure 35] Figure 35 shows an example of the structure of a recording medium, which is an optical disc. [Figure 36A] Figure 36A shows an example of a mobile phone. [Figure 36B] Figure 36B is a block diagram showing an example of a mobile phone configuration. [Figure 37] Figure 37 shows the structure of the multiplexed data. [Figure 38]Figure 38 schematically shows how each stream is multiplexed in the multiplexed data. [Figure 39] Figure 39 shows in more detail how the video stream is stored in the PES packet sequence. [Figure 40] Figure 40 shows the structure of TS packets and source packets in multiplexed data. [Figure 41] Figure 41 shows the data structure of PMT. [Figure 42] Figure 42 shows the internal structure of the multiplexed data information. [Figure 43] Figure 43 shows the internal structure of stream attribute information. [Figure 44] Figure 44 shows the steps for identifying video data. [Figure 45] Figure 45 is a block diagram showing an example of the configuration of an integrated circuit that implements the video encoding method and video decoding method of each embodiment. [Figure 46] Figure 46 shows a configuration for switching the drive frequency. [Figure 47] Figure 47 shows the steps for identifying video data and switching the drive frequency. [Figure 48] Figure 48 shows an example of a lookup table that associates video data specifications with drive frequencies. [Figure 49A] Figure 49A shows an example of a configuration in which the signal processing module is shared. [Figure 49B] Figure 49B shows another example of a configuration in which the signal processing module is shared. [Modes for carrying out the invention]
[0010] (Knowledge that formed the basis of this invention) The already standardized video encoding scheme called H.264 uses three types of picture—I-picture, P-picture, and B-picture—to compress the amount of information.
[0011] I-pictures are not encoded using interpredictive coding. That is, I-pictures are encoded using intra-picture predictive coding (hereinafter referred to as "intra-predictive" coding). P-pictures are interpredictive coded by referencing one already coded picture that is either before or after the picture to be coded in display time order. B-pictures are interpredictive coded by referencing two already coded pictures that are either before or after the picture to be coded in display time order.
[0012] In interpredictive coding, a reference picture list is generated to identify the reference picture. The reference picture list is a list in which reference picture indices are assigned to the coded reference pictures that are referenced in interpredictive coding. For example, in B-picture coding, coding can be performed by referencing two pictures, so two reference picture lists (L0 and L1) are generated.
[0013] Figure 1A is a diagram illustrating an example of a reference picture list in picture B. Figure 1B shows an example of reference picture list 0 (L0) for prediction direction 0 in bidirectional prediction. Here, in reference picture list 0, the value 0 for reference picture index 0 is assigned to reference picture 0, which is displayed in order 2. Also, the value 1 for reference picture index 0 is assigned to reference picture 1, which is displayed in order 1. Also, the value 2 for reference picture index 0 is assigned to reference picture 2, which is displayed in order 0. In other words, reference pictures that are temporally closer to the picture to be encoded in terms of display order are assigned reference picture indices with smaller values.
[0014] On the other hand, Figure 1C shows an example of the reference picture list 1 (L1) for prediction direction 1 in bidirectional prediction. Here, in reference picture list 1, the value 0 of reference picture index 1 is assigned to reference picture 1, which is displayed in order 1. Also, the value 1 of reference picture index 1 is assigned to reference picture 0, which is displayed in order 2. Furthermore, the value 2 of reference picture index 2 is assigned to reference picture 2, which is displayed in order 0.
[0015] Thus, it is possible to assign different reference picture index values to each reference picture for each prediction direction (reference pictures 0 and 1 in Figure 1A), or to assign the same reference picture index value to each reference picture (reference picture 2 in Figure 1A).
[0016] Furthermore, in the H.264 motion image encoding scheme (Non-Patent Literature 1), motion vector detection mode is used as the encoding mode for interpretation of each target block to be encoded in a B-picture. In motion vector detection mode, the difference between the predicted image data and the image data of the target block, and the motion vector used to generate the predicted image data are encoded. In motion vector detection mode, it is also possible to select between bidirectional prediction and unidirectional prediction as the prediction direction. In bidirectional prediction, the predicted image is generated by referencing two already encoded pictures located in front of or behind the target picture. In unidirectional prediction, the predicted image is generated by referencing one already encoded picture located in front of or behind it.
[0017] Furthermore, in the H.264 video encoding scheme, when encoding B-pictures, it is possible to select an encoding mode called time-predicted motion vector mode when deriving the motion vector. The inter-predictive encoding method in time-predicted motion vector mode will be explained using Figure 2.
[0018] Figure 2 is a diagram illustrating the motion vector in time-predicted motion vector mode. Specifically, Figure 2 shows the case where block a of picture B2 is encoded in time-predicted motion vector mode.
[0019] Here, the motion vector vb used to encode block b (hereinafter referred to as the "co-located block"), which is located in the same position as block a within picture P3, a reference picture located after picture B2, is used. Motion vector vb is the motion vector used when block b was encoded by referencing picture P1.
[0020] Using a motion vector parallel to the motion vector vb, two reference blocks for block a are obtained from picture P1, which is a forward reference picture, and picture P3, which is a backward reference picture. Then, block a is encoded by performing a two-directional prediction based on the two obtained reference blocks. That is, the motion vectors used when encoding block a are motion vector va1 for picture P1 and motion vector va2 for picture P3.
[0021] Furthermore, a predicted motion vector specification mode has been considered as a method for encoding the motion vectors of each block to be encoded in a B-picture or P-picture (Non-Patent Literature 2). In the predicted motion vector specification mode, candidate predicted motion vectors are generated from the motion vectors used when encoding adjacent blocks to the block to be encoded. Then, a predicted motion vector is selected from the candidate predicted motion vectors, and the motion vector of the block to be encoded is encoded. At this time, the index of the selected predicted motion vector is added to the bitstream. This makes it possible to select the same predicted motion vector used during encoding when decoding. A specific example will be explained with reference to Figure 3.
[0022] Figure 3 shows an example of the motion vectors of adjacent blocks used in the predicted motion vector specification mode. In Figure 3, adjacent block A is the encoded block to the left of the block to be encoded. Adjacent block B is the encoded block above the block to be encoded. Adjacent block C is the encoded block to the upper right of the block to be encoded. Adjacent block D is the encoded block to the lower left of the block to be encoded.
[0023] Furthermore, in Figure 3, the encoded block is a block encoded by bidirectional prediction, having a motion vector MvL0 for the reference picture indicated by the reference picture index RefL0 for prediction direction 0, and a motion vector MvL1 for the reference picture indicated by the reference picture index RefL1 for prediction direction 1, as a result of motion detection, etc. Here, MvL0 is a motion vector that refers to the reference picture identified by reference picture list 0 (L0). Also, MvL1 is a motion vector that refers to the reference picture identified by reference picture list 1 (L1).
[0024] Furthermore, adjacent block A is a block encoded with one-way prediction in prediction direction 0. Adjacent block A has the motion vector MvL0_A for the reference picture indicated by the reference picture index RefL0_A in prediction direction 0. Adjacent block B is a block encoded with one-way prediction in prediction direction 1. Adjacent block B has the motion vector MvL1_B for the reference picture indicated by the reference picture index RefL1_B in prediction direction 1. Adjacent block C is a block encoded with intra-prediction. Adjacent block D is a block encoded with one-way prediction in prediction direction 0. Adjacent block D has the motion vector MvL0_D for the reference picture indicated by the reference picture index RefL0_D in prediction direction 0.
[0025] In such cases, the predicted motion vector for the block to be encoded is selected from among the candidates for predicted motion vectors generated from, for example, the motion vectors of adjacent blocks A, B, C, and D, and the motion vectors obtained using the time-predicted motion vector mode obtained using co-located blocks. The predicted motion vector index representing the selected predicted motion vector is then added to the bitstream. For example, when encoding the predicted direction 0 motion vector MvL0 of the block to be encoded, if the predicted direction 0 motion vector MvL0_A of adjacent block A is selected as the predicted motion vector, as shown in Figure 4, only the predicted motion vector index value "0", indicating that the candidate for predicted motion vector generated from adjacent block A was used, is attached to the bitstream. This reduces the amount of information in the predicted direction 0 motion vector MvL0 of the block to be encoded.
[0026] Here, Figure 4 shows an example of a list of predicted motion vector candidates for prediction direction 0. Also, as shown in Figure 4, in the predicted motion vector specification mode, candidates for which it is impossible to generate a predicted motion vector (hereinafter referred to as "unpredictable candidates") or candidates whose values match those of other predicted motion vector candidates (hereinafter referred to as "duplicate candidates") are removed from the predicted motion vector candidates. By reducing the number of predicted motion vector candidates in this way, the amount of code allocated to the predicted motion vector index is reduced. Here, the impossibility of generating a predicted motion vector means that the adjacent block is (1) a block encoded by intra-prediction, (2) a block outside the slice or picture boundary containing the block to be encoded, or (3) a block that has not yet been encoded, etc.
[0027] In the example in Figure 4, adjacent block C is encoded using intraprediction. Therefore, prediction candidates with a prediction motion vector index value of "3" are unpredictable candidates and are removed from the prediction motion vector candidate list. Also, since the prediction motion vector for prediction direction 0 generated from adjacent block D matches the prediction motion vector for prediction direction 0 generated from adjacent block A, prediction candidates with a prediction motion vector index value of "4" are removed from the prediction motion vector candidate list. As a result, the final number of prediction motion vector candidates for prediction direction 0 is 3, and the list size of the prediction motion vector candidate list for prediction direction 0 is set to 3.
[0028] Figure 5 shows an example of a list of predicted motion vector candidates for prediction direction 1. In the example shown in Figure 5, by removing unpredictable and duplicate candidates, the final number of predicted motion vector candidates for prediction direction 1 becomes 2, and the list size of the list of predicted motion vector candidates for prediction direction 1 is set to 2.
[0029] The predicted motion vector index is assigned a bit sequence according to the size of the predicted motion vector candidate list, as shown in Figure 6, and is then variable-length encoded. Furthermore, if the size of the predicted motion vector candidate list is 1, the predicted motion vector index is not attached to the bitstream, and the decoding side estimates its value to be 0. In this way, the predicted motion vector specification mode reduces the amount of coding by varying the bit sequence assigned to the predicted motion vector index according to the size of the predicted motion vector candidate list.
[0030] Figure 7 is a flowchart showing an example of the encoding process when using the predictive motion vector specification mode.
[0031] In step S1001, a candidate predicted motion vector for the predicted direction X is calculated from adjacent blocks and co-located blocks (hereinafter referred to as "predicted block candidates"). Here, X takes the value of "0" or "1", representing predicted direction 0 or predicted direction 1, respectively. The candidate predicted motion vector sMvLX for the predicted direction X is calculated using the motion vector MvLX_N of the predicted block candidate, the reference picture index RefLX_N, and the reference picture index RefLX of the block to be encoded, using the following formula.
[0032] sMvLX= MvLX_N×(POC(RefLX)-curPOC) / (POC(RefLX_N)-curPOC) …(Formula 1)
[0033] Here, POC(RefLX) represents the display order of the reference picture indicated by the reference picture index RefLX, POC(RefLX_N) represents the display order of the reference picture indicated by the reference picture index RefLX_N, and curPOC represents the display order of the picture to be encoded. If the predicted block candidate does not have a motion vector MvLX_N in the predicted direction X, the predicted motion vector sMvLX is calculated using the motion vector MvL(1-X)_N in the predicted direction (1-X) and the reference picture index RefL(1-X)_N according to Equation 2.
[0034] sMvLX= MvL(1-X)_N×(POC(RefLX)-curPOC) / (POC(RefL(1-X)_N)-curPOC) …(Formula 2)
[0035] Figures 8A and 8B show examples of calculating predicted motion vectors using equations 1 and 2. Note that, as shown in equations 1 and 2, scaling can be omitted when the values of POC(RefLX) and POC(RefLX_N) are the same, i.e., when referring to the same picture.
[0036] In step S1002, duplicate and unpredictable candidates are removed from the predicted motion vector candidates for the predicted direction X. In step S1003, the number of predicted motion vector candidates after the removal process is set to the predicted motion vector candidate list size. In step S1004, the predicted motion vector index to be used for motion vector coding of the block to be coded for the predicted direction X is determined. In step S1005, the determined predicted motion vector index is variable-length coded using the bit sequence determined by the predicted motion vector candidate list size.
[0037] Figure 9 is a block diagram showing an example of the configuration of a video encoding device 1000 that encodes video using a predictive motion vector specification mode.
[0038] As shown in Figure 9, the video encoding device 1000 includes a subtraction unit 1001, an orthogonal transformation unit 1002, a quantization unit 1003, an inverse quantization unit 1004, an inverse orthogonal transformation unit 1005, an addition unit 1006, a block memory 1007, a frame memory 1008, an intra prediction unit 1009, an inter prediction unit 1010, an inter prediction control unit 1011, a picture type determination unit 1012, a switch 1013, a predicted motion vector candidate calculation unit 1014, a colPic memory 1015, and a variable length encoding unit 1016.
[0039] In Figure 9, the predicted motion vector candidate calculation unit 1014 calculates predicted motion vector candidates. The predicted motion vector candidate calculation unit 1014 then transmits the calculated number of predicted motion vector candidates to the variable-length coding unit 1016. The variable-length coding unit 1016 sets the number of predicted motion vector candidates to the predicted motion vector candidate list size, which is an encoding parameter. The variable-length coding unit 1016 then performs variable-length coding by assigning a bit sequence corresponding to the predicted motion vector candidate list size to the predicted motion vector index used for coding.
[0040] Figure 10 is a flowchart showing an example of the decoding process when using the predicted motion vector specification mode.
[0041] In step S2001, predicted motion vector candidates for the prediction direction X are calculated from adjacent blocks and co-located blocks (predicted block candidates). In step S2002, duplicate candidates and unpredictable candidates are removed from the predicted motion vector candidates. In step S2003, the number of predicted motion vector candidates after the removal process is set to the predicted motion vector candidate list size. In step S2004, the predicted motion vector index used for decoding the block to be decoded is decoded from the bitstream using the predicted motion vector candidate list size. In step S2005, the difference motion vector is added to the predicted motion vector candidate indicated by the decoded predicted motion vector index to calculate the motion vector, and the predicted image is generated and decoded using the calculated motion vector.
[0042] Figure 11 is a block diagram showing an example of the configuration of a video decoding device that decodes video encoded using predictive motion vector specification mode.
[0043] As shown in Figure 11, the motion image decoding device 2000 includes a variable-length decoding unit 2001, an inverse quantization unit 2002, an inverse orthogonal transformation unit 2003, an addition unit 2004, a block memory 2005, a frame memory 2006, an intra prediction unit 2007, an inter prediction unit 2008, an inter prediction control unit 2009, a switch 2010, a predicted motion vector candidate calculation unit 2011, and a colPic memory 2012.
[0044] In Figure 11, the predicted motion vector candidate calculation unit 2011 calculates predicted motion vector candidates. The predicted motion vector candidate calculation unit 2011 then transmits the calculated number of predicted motion vector candidates to the variable-length decoding unit 2001. The variable-length decoding unit 2001 sets the number of predicted motion vector candidates to the predicted motion vector candidate list size, which is a decoding parameter. The variable-length decoding unit 2001 then decodes the predicted motion vector indices contained in the bitstream using the predicted motion vector candidate list size.
[0045] Figure 12 shows the syntax for adding the predicted motion vector index to the bitstream. In Figure 12, inter_pred_flag represents the prediction direction flag for interpretation. mvp_idx represents the predicted motion vector index. NumMVPCand represents the size of the predicted motion vector candidate list. This NumMVPCand is set to the number of predicted motion vector candidates after removing unpredictable and duplicate candidates from the predicted motion vector candidates.
[0046] As described above, video is encoded or decoded using the predictive motion vector specification mode. However, in the above predictive motion vector specification mode, the number of predicted motion vector candidates is set in the size of the predicted motion vector candidate list used when encoding or decoding the predicted motion vector index. This number of predicted motion vector candidates is obtained after deleting unpredictable or duplicate candidates using reference picture information, including co-located blocks, etc. Therefore, if there is a mismatch in the number of predicted motion vector candidates between the video encoding device and the video decoding device, a mismatch will occur in the bit sequence to be assigned to the predicted motion vector index between the video encoding device and the video decoding device. As a result, the video decoding device may not be able to correctly decode the bitstream.
[0047] For example, if information about a reference picture that was referenced as a co-located block is lost due to packet loss in the transmission path, the motion vector or reference picture index of the co-located block becomes unknown. As a result, the information of the predicted motion vector candidates generated from the co-located block becomes unknown. In such cases, it becomes impossible to correctly remove unpredictable candidates or duplicate candidates from the predicted motion vector candidates during decoding. Consequently, the video decoding device cannot correctly determine the size of the predicted motion vector candidate list and is unable to properly decode the predicted motion vector index.
[0048] Therefore, the present invention aims to provide a video encoding method that improves error tolerance by calculating the size of the predicted motion vector candidate list used when encoding or decoding the predicted motion vector index in a manner that does not depend on reference picture information including co-located blocks.
[0049] Therefore, a video encoding method according to one aspect of the present invention is a video encoding method that generates a bitstream by encoding a block to be encoded, and calculating a predicted motion vector to be used when encoding the motion vector of the block to be encoded, and comprising: a determination step of determining the maximum number of candidate predicted motion vectors that are candidates for the predicted motion vector; a first derivation step of deriving a first candidate predicted motion vector; a determination step of determining whether the number of the first candidate predicted motion vectors is less than the maximum number; a second derivation step of deriving a second candidate predicted motion vector if it is determined that the number of the first candidate predicted motion vectors is less than the maximum number; a selection step of selecting the predicted motion vector to be used for encoding the motion vector of the block to be encoded from the first candidate predicted motion vector and the second candidate predicted motion vector; and an encoding step of encoding an index for identifying the selected predicted motion vector using the determined maximum number, and adding the encoded index to the bitstream.
[0050] According to this method, the index for identifying predicted motion vector candidates can be encoded using a determined maximum number. In other words, the index can be encoded regardless of the actual number of predicted motion vector candidates derived. Therefore, even if information necessary for deriving the predicted motion vector candidates (e.g., information such as co-located blocks) is lost, the decoding side can decode the index, thereby improving error tolerance. Furthermore, the decoding side can decode the index regardless of the actual number of predicted motion vector candidates derived. In other words, the decoding side can decode the index without waiting for the derivation process of the predicted motion vector candidates. That is, it is possible to generate a bitstream in which the derivation process of predicted motion vector candidates and the decoding process of the index can be performed in parallel.
[0051] Furthermore, according to this method, if the number of first predicted motion vector candidates is determined to be less than the maximum number, a second predicted motion vector candidate can be derived. Therefore, the number of predicted motion vector candidates can be increased within a range that does not exceed the maximum number, thereby improving coding efficiency.
[0052] For example, in the first derivation step, a candidate for the first predicted motion vector that does not overlap with a candidate for the first predicted motion vector that has already been derived may be derived as the candidate for the first predicted motion vector.
[0053] This allows us to remove duplicate first-predicted motion vector candidates. As a result, we can increase the number of second-predicted motion vector candidates and increase the number of selectable motion vector types. Therefore, it becomes possible to further improve coding efficiency.
[0054] For example, in the first derivation step, the first predicted motion vector candidate may be derived based on the motion vector used to encode blocks that are spatially or temporally adjacent to the block to be encoded.
[0055] According to this method, a first predicted motion vector candidate can be derived based on the motion vectors used to encode blocks that are spatially or temporally adjacent to the block to be encoded.
[0056] For example, in the first derivation step, the motion vectors used to encode blocks that are spatially adjacent to the block to be encoded, excluding blocks encoded by intra-prediction, blocks located outside the slice or picture boundary containing the block to be encoded, and blocks that have not yet been encoded, may be derived as the first predicted motion vector candidates.
[0057] According to this, a first predicted motion vector candidate can be derived from an appropriate block to obtain a predicted motion vector candidate.
[0058] For example, in the second derivation step, a candidate for predicted motion vector whose motion vector is different from the candidate for the first predicted motion vector may be derived as the candidate for the second predicted motion vector.
[0059] According to this method, a second predicted motion vector candidate can be derived whose motion vector differs from that of the first predicted motion vector candidate. Therefore, the number of predicted motion vector candidates with different motion vectors can be increased, further improving coding efficiency.
[0060] For example, the encoding step may further include adding information to the bitstream indicating the determined maximum number.
[0061] According to this method, information indicating the determined maximum number can be added to the bitstream. Therefore, the maximum number can be switched in appropriate units, making it possible to improve encoding efficiency.
[0062] For example, the video encoding method further includes a switching step of switching the encoding process to a first encoding process conforming to a first standard or a second encoding process conforming to a second standard, and an addition step of adding identification information to the bitstream that indicates the first standard or the second standard to which the switched encoding process conforms, and when the encoding process is switched to the first encoding process, the determination step, the first derivation step, the judgment step, the second derivation step, the selection step, and the encoding step may be performed as the first encoding process.
[0063] According to this, it becomes possible to switch between a first encoding process that conforms to the first standard and a second encoding process that conforms to the second standard.
[0064] Furthermore, a motion image decoding method according to one aspect of the present invention is a motion image decoding method that calculates a predicted motion vector to be used when decoding the motion vector of a block to be decoded contained in a bitstream, and decodes the block to be decoded, comprising: a determination step of determining the maximum number of predicted motion vector candidates that are candidates for the predicted motion vector; a first derivation step of deriving first predicted motion vector candidates; a determination step of determining whether the number of the first predicted motion vector candidates is less than the maximum number; a second derivation step of deriving second predicted motion vector candidates if it is determined that the number of the first predicted motion vector candidates is less than the maximum number; a decoding step of decoding an encoded index attached to the bitstream for identifying the predicted motion vector using the determined maximum number; and a selection step of selecting a predicted motion vector to be used for decoding the block to be decoded from the first predicted motion vector candidates and the second predicted motion vector candidates based on the decoded index.
[0065] According to this method, the index used to identify the predicted motion vector candidates can be decoded using the determined maximum number. In other words, the index can be decoded regardless of the actual number of predicted motion vector candidates derived. Therefore, even if information necessary for deriving the predicted motion vector candidates (e.g., information such as co-located blocks) is lost, the index can still be decoded, improving error tolerance. Furthermore, the index can be decoded without waiting for the predicted motion vector candidate derivation process to be completed, and the predicted motion vector candidate derivation process and the index decodement process can be performed in parallel.
[0066] Furthermore, according to this method, if it is determined that the number of first predicted motion vector candidates is less than the maximum number, a second predicted motion vector candidate can be derived. Therefore, the number of predicted motion vector candidates can be increased within a range that does not exceed the maximum number, making it possible to decode encoded images with improved encoding efficiency.
[0067] For example, in the first derivation step, a candidate for the first predicted motion vector that does not overlap with a candidate for the first predicted motion vector that has already been derived may be derived as the candidate for the first predicted motion vector.
[0068] This allows for the removal of duplicate first-predicted motion vector candidates. As a result, the number of second-predicted motion vector candidates can be increased, and the number of selectable motion vector types can be increased. Therefore, it becomes possible to decode encoded images with further improved encoding efficiency.
[0069] For example, in the first derivation step, the first predicted motion vector candidate may be derived based on the motion vectors used to decode blocks that are spatially or temporally adjacent to the block to be decoded.
[0070] According to this method, a first predicted motion vector candidate can be derived based on the motion vectors used to decode blocks that are spatially or temporally adjacent to the block to be decoded.
[0071] For example, in the first derivation step, the motion vectors used to decode blocks that are spatially adjacent to the block to be decoded, excluding blocks decoded by intra-prediction, blocks located outside the slice or picture boundary containing the block to be decoded, and blocks that have not yet been decoded, may be derived as the first predicted motion vector candidates.
[0072] According to this, a first predicted motion vector candidate can be derived from an appropriate block to obtain a predicted motion vector candidate.
[0073] For example, in the second derivation step, a candidate for predicted motion vector whose motion vector is different from the candidate for the first predicted motion vector may be derived as the candidate for the second predicted motion vector.
[0074] According to this method, a second predicted motion vector candidate can be derived whose motion vector differs from that of the first predicted motion vector candidate. Therefore, the number of predicted motion vector candidates with different motion vectors can be increased, making it possible to decode an encoded image with improved encoding efficiency.
[0075] For example, in the determination step, the maximum number may be determined based on information indicating the maximum number of elements added to the bitstream.
[0076] According to this, the maximum number can be determined based on the information added to the bitstream. Therefore, it becomes possible to decode the encoded image by switching the maximum number in appropriate units.
[0077] For example, the video decoding method further includes a switching step to switch the decoding process to a first decoding process conforming to the first standard or a second decoding process conforming to the second standard, depending on identification information indicating a first standard or a second standard added to the bitstream, and when the decoding process is switched to the first decoding process, the determination step, the first derivation step, the judgment step, the second derivation step, the decoding step, and the selection step may be performed as the first decoding process.
[0078] This makes it possible to switch between a first decoding process that conforms to the first standard and a second decoding process that conforms to the second standard.
[0079] These general or specific embodiments may be implemented as a system, method, integrated circuit, computer program, or recording medium such as a computer-readable CD-ROM, or as any combination of a system, method, integrated circuit, computer program, or recording medium.
[0080] Hereinafter, a video encoding device and a video decoding device according to one aspect of the present invention will be specifically described with reference to the drawings.
[0081] The embodiments described below are all specific examples of the present invention. The numerical values, shapes, materials, components, arrangement and connection configurations of the components, steps, and the order of steps shown in the following embodiments are examples only and are not intended to limit the present invention. Furthermore, among the components in the following embodiments, those components that are not described in the independent claim representing the highest-level concept will be described as optional components.
[0082] (Embodiment 1) Figure 13 is a block diagram showing the configuration of the video encoding device 100 according to Embodiment 1.
[0083] As shown in Figure 13, the video encoding device 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, an inter prediction control unit 111, a picture type determination unit 112, a switch 113, a predicted motion vector candidate calculation unit 114, a colPic memory 115, and a variable length encoding unit 116.
[0084] The subtraction unit 101 generates prediction error data by subtracting the predicted image data from the input image data contained in the input image sequence for each block. The orthogonal transformation unit 102 performs a conversion of the generated prediction error data from the image domain to the frequency domain. The quantization unit 103 performs a quantization process on the prediction error data converted to the frequency domain.
[0085] The inverse quantization unit 104 performs inverse quantization on the prediction error data that has been quantized by the quantization unit 103. The inverse orthogonal transformation unit 105 performs a conversion from the frequency domain to the image domain on the prediction error data that has been inversely quantized.
[0086] The summing unit 106 generates reconstructed image data for each block to be encoded by adding the predicted image data and the prediction error data that has been inversely quantized by the inverse orthogonal transform unit 105. The reconstructed image data is stored in block units in the block memory 107. The reconstructed image data is stored in frame units in the frame memory 108.
[0087] The picture type determination unit 112 determines whether to encode the input image data as an I-picture, B-picture, or P-picture. The picture type determination unit 112 then generates picture type information. The intra-prediction unit 109 generates intra-predicted image data for the block to be encoded by performing intra-prediction using the reconstructed image data at the block level stored in the block memory 107. The inter-prediction unit 110 generates inter-predicted image data for the block to be encoded by performing inter-prediction using the reconstructed image data at the frame level stored in the frame memory 108 and motion vectors derived from motion detection, etc.
[0088] When the block to be encoded is subjected to intra-predictive encoding, switch 113 outputs the intra-predictive image data generated by the intra-prediction unit 109 to the subtraction unit 101 and the addition unit 106 as the predicted image data for the block to be encoded. On the other hand, when the block to be encoded is subjected to inter-predictive encoding, switch 113 outputs the inter-predictive image data generated by the inter-prediction unit 110 to the subtraction unit 101 and the addition unit 106 as the predicted image data for the block to be encoded.
[0089] The predicted motion vector candidate calculation unit 114 derives predicted motion vector candidates for the predicted motion vector specification mode using colPic information such as the motion vectors of adjacent blocks to the encoding target block and the motion vectors of co-located blocks stored in the colPic memory 115. The predicted motion vector candidate calculation unit 114 then calculates the number of predictable candidates using a method described later. The predicted motion vector candidate calculation unit 114 also assigns a predicted motion vector index value to the derived predicted motion vector candidates. The predicted motion vector candidate calculation unit 114 then sends the predicted motion vector candidates and the predicted motion vector index to the inter-prediction control unit 111. The predicted motion vector candidate calculation unit 114 also transmits the calculated number of predictable candidates to the variable-length encoding unit 116.
[0090] The interprediction control unit 111 controls the interprediction unit 110 to perform interprediction coding using the interprediction image generated using the motion vector derived from motion detection. The interprediction control unit 111 also selects the optimal predicted motion vector candidate for coding the motion vector used in interprediction coding using a method described later. The interprediction control unit 111 then sends the predicted motion vector index corresponding to the selected predicted motion vector candidate and the prediction error information (difference motion vector) to the variable-length coding unit 116. Furthermore, the interprediction control unit 111 transfers colPic information, including the motion vector of the block to be coded, to the colPic memory 115.
[0091] The variable-length coding unit 116 generates a bitstream by performing variable-length coding on the quantized prediction error data, prediction direction flag, picture type information, and differential motion vector. The variable-length coding unit 116 also sets the number of predictable candidates to the size of the prediction motion vector candidate list. Then, the variable-length coding unit 116 performs variable-length coding by assigning a bit sequence corresponding to the size of the prediction motion vector candidate list to the prediction motion vector index used for motion vector coding.
[0092] Figure 14 is a flowchart showing the processing operation of the video encoding device 100 according to Embodiment 1.
[0093] In step S101, the interpretation control unit 111 determines the prediction direction, reference picture index, and motion vector of the block to be encoded by motion detection. Here, in motion detection, for example, the difference value between the block to be encoded in the encoded picture and the block in the reference picture is calculated, and the block in the reference picture with the smallest difference value is determined as the reference block. Then, the motion vector is determined using a method such as determining the motion vector from the position of the block to be encoded and the position of the reference block. The interpretation control unit 111 also performs motion detection on the reference pictures for prediction direction 0 and prediction direction 1, respectively, and calculates whether to select prediction direction 0, prediction direction 1, or bidirectional prediction using, for example, the following formula of the RD optimization model.
[0094] Cost=D+λ×R…(Formula 3)
[0095] In Equation 3, D represents the coding distortion, and is used as the sum of the absolute differences between the pixel values obtained by coding and decoding the target block using a predicted image generated with a certain motion vector, and the original pixel values of the target block. R represents the generated code quantity, and is used as the code quantity required to code the motion vector used to generate the predicted image. λ is the Lagrange multiplier.
[0096] In step S102, the predicted motion vector candidate calculation unit 114 derives predicted motion vector candidates from adjacent blocks and co-located blocks of the block to be encoded. The predicted motion vector candidate calculation unit 114 also calculates the size of the predicted motion vector candidate list using a method described later.
[0097] For example, in the case shown in Figure 3, the predicted motion vector candidate calculation unit 114 selects, for example, the motion vectors of adjacent blocks A, B, C, and D as predicted motion vector candidates for the block to be encoded. Furthermore, the predicted motion vector candidate calculation unit 114 calculates motion vectors calculated by time prediction mode from the motion vectors of co-located blocks as predicted motion vector candidates.
[0098] The predicted motion vector candidate calculation unit 114 assigns predicted motion vector indices to the predicted motion vector candidates for prediction direction 0 and prediction direction 1, as shown in Figures 15(a) and 16(a). Then, the predicted motion vector candidate calculation unit 114 calculates the predicted motion vector candidate list and the predicted motion vector candidate list size, as shown in Figures 15(b) and 16(b), by deleting unpredictable candidates and duplicate candidates and adding new candidates using a method described later.
[0099] A smaller predicted motion vector index (PMO) value assigns a shorter code. In other words, a smaller PMO value requires less information to be encoded. Conversely, a larger PMO value requires more information. Therefore, assigning a smaller PMO index to a PMO candidate that is more likely to result in a more accurate PMO results in higher encoding efficiency.
[0100] Therefore, the predicted motion vector candidate calculation unit 114 may, for example, measure the number of times each predicted motion vector candidate has been selected as a predicted motion vector, and assign a smaller predicted motion vector index to the predicted motion vector candidate that has been selected many times. Specifically, it is conceivable to identify the predicted motion vector selected in an adjacent block and, when encoding the target block, reduce the value of the predicted motion vector index for the identified predicted motion vector candidate.
[0101] Furthermore, if an adjacent block does not contain information such as motion vectors (for example, if it is a block encoded by intra-prediction, a block located outside the boundaries of a picture or slice, or a block that has not yet been encoded), it cannot be used as a candidate for predicted motion vectors.
[0102] In this embodiment, a candidate that cannot be used as a predicted motion vector is called an unpredictable candidate. A candidate that can be used as a predicted motion vector is called a predictable candidate. Furthermore, among multiple predicted motion vector candidates, a candidate whose value matches that of any other predicted motion vector is called a duplicate candidate.
[0103] In the case of Figure 3, adjacent block C is a block encoded by intra-prediction, so it is considered an unpredictable candidate. Also, the predicted motion vector sMvL0_D for prediction direction 0 generated from adjacent block D has the same value as the predicted motion vector MvL0_A for prediction direction 0 generated from adjacent block A, so it is considered a duplicate candidate.
[0104] In step S103, the interpretation control unit 111 determines the value of the predicted motion vector index used for motion vector coding in the prediction direction X using a method described later.
[0105] In step S104, the variable-length coding unit 116 assigns a bit sequence corresponding to the size of the predicted motion vector candidate list, as shown in Figure 6, to the predicted motion vector index of the predicted motion vector candidate used for coding the motion vector in the predicted direction X, and performs variable-length coding.
[0106] In this embodiment, as shown in Figures 15(a) and 16(a), the predicted motion vector index value corresponding to adjacent block A is assigned "0". The predicted motion vector index value corresponding to adjacent block B is assigned "1". The predicted motion vector index value corresponding to the co-located block is assigned "2". The predicted motion vector index value corresponding to adjacent block C is assigned "3". The predicted motion vector index value corresponding to adjacent block D is assigned "4".
[0107] Note that the method of assigning values to the predicted motion vector index is not necessarily limited to this example. For example, if a new candidate is added using the method described later, the variable-length coding unit 116 may assign a smaller value to the original predicted motion vector candidate and a larger value to the new candidate. In other words, the variable-length coding unit 116 may assign a smaller predicted motion vector index value in priority to the original predicted motion vector candidate.
[0108] Furthermore, the predicted motion vector candidates are not necessarily limited to the positions of adjacent blocks A, B, C, and D. For example, an adjacent block located above the lower left adjacent block D may be used as a predicted motion vector candidate. Also, not all adjacent blocks are necessarily required to be used as predicted motion vector candidates. For example, only adjacent blocks A and B may be used as predicted motion vector candidates. Alternatively, if adjacent block D is an unpredictable candidate, adjacent block A may be used, and so on, scanning adjacent blocks in order.
[0109] Furthermore, in this embodiment, in step S104 of Figure 14, the variable-length coding unit 116 added the predicted motion vector index to the bitstream, but it is not always necessary to add the predicted motion vector index to the bitstream. For example, if the size of the predicted motion vector candidate list is 1, the variable-length coding unit 116 does not need to add the predicted motion vector index to the bitstream. This reduces the amount of information in the predicted motion vector index.
[0110] Figure 17 is a flowchart detailing the process of step S102 in Figure 14. Specifically, Figure 17 shows how to calculate the predicted motion vector candidates and the size of the predicted motion vector candidate list. Figure 17 will be explained below.
[0111] In step S111, the predicted motion vector candidate calculation unit 114 determines whether the predicted block candidate [N] is a predictable candidate using a method described later. Then, the predicted motion vector candidate calculation unit 114 updates the number of predictable candidates according to the determination result.
[0112] Here, N is an index value representing each predicted block candidate. In this embodiment, N takes values from 0 to 4. Specifically, predicted block candidate [0] is assigned adjacent block A in Figure 3. Also, predicted block candidate [1] is assigned adjacent block B in Figure 3. Also, predicted block candidate [2] is assigned the co-located block. Also, predicted block candidate [3] is assigned adjacent block C in Figure 3. Also, predicted block candidate [4] is assigned adjacent block D in Figure 3.
[0113] In step S112, the predicted motion vector candidate calculation unit 114 calculates a predicted motion vector candidate in the predicted direction X from the predicted block candidate [N] using the above equations 1 and 2, and adds it to the predicted motion vector candidate list.
[0114] In step S113, the predicted motion vector candidate calculation unit 114 searches for unpredictable candidates and duplicate candidates from the predicted motion vector candidate list and deletes them, as shown in Figures 15 and 16.
[0115] In step S114, the predicted motion vector candidate calculation unit 114 adds a new candidate to the predicted motion vector candidate list using a method described later. When adding a new candidate, the predicted motion vector candidate calculation unit 114 may reallocate the predicted motion vector index values so that a smaller predicted motion vector index is assigned to it, prioritizing it over existing predicted motion vector candidates. In other words, the predicted motion vector candidate calculation unit 114 may reallocate the predicted motion vector index values so that a larger predicted motion vector index is assigned to the new candidate. This reduces the sign amount of the predicted motion vector index.
[0116] In step S115, the predictive motion vector candidate calculation unit 114 sets the number of predictable candidates calculated in step S111 to the predictive motion vector candidate list size. In the examples of Figures 15 and 16, the number of predictable candidates for prediction direction 0 is calculated to be "4" by the method described later, and the predictive motion vector candidate list size for prediction direction 0 is set to "4". Also, the number of predictable candidates for prediction direction 1 is calculated to be "4", and the predictive motion vector candidate list size for prediction direction 1 is set to "4".
[0117] In step S114, the new candidate is a candidate that is added to the predicted motion vector candidates when the number of predicted motion vector candidates does not reach the number of predictable candidates, as described later. For example, the new candidate may be a predicted motion vector generated from an adjacent block located above the lower left adjacent block D in Figure 3. Alternatively, the new candidate may be a predicted motion vector generated from blocks corresponding to adjacent blocks A, B, C, and D of a co-located block. Furthermore, the new candidate may be a predicted motion vector calculated from statistics of motion vectors for the entire screen or a certain area of the reference picture. In this way, when the number of predicted motion vector candidates does not reach the number of predictable candidates, the predicted motion vector candidate calculation unit 114 can improve encoding efficiency by adding a new predicted motion vector as a new candidate.
[0118] Figure 18 is a flowchart detailing the process in step S111 of Figure 17. Specifically, Figure 18 shows how to determine whether a predicted block candidate [N] is a predictable candidate and how to update the number of predictable candidates. Figure 18 will be explained below.
[0119] In step S121, the predicted motion vector candidate calculation unit 114 determines whether the predicted block candidate [N] is (1) a block encoded by intra prediction, (2) a block located outside the slice or picture boundary containing the block to be encoded, or (3) a block that has not yet been encoded.
[0120] Here, if the result of the determination in step S121 is true (Yes in S121), in step S122, the predicted motion vector candidate calculation unit 114 sets the predicted block candidate [N] to an unpredictable candidate. On the other hand, if the result of the determination in step S121 is false (No in S121), in step S123, the predicted motion vector candidate calculation unit 114 sets the predicted block candidate [N] to a predictable candidate.
[0121] In step S124, the predicted motion vector candidate calculation unit 114 determines whether the predicted block candidate [N] is a predictable candidate or a co-located block candidate. If the determination result in step S124 is true (Yes in S124), in step S5, the predicted motion vector candidate calculation unit 114 updates the number of predicted motion vector candidates by adding 1 to the number of predictable candidates. On the other hand, if the determination result in step S124 is false (No in S124), the predicted motion vector candidate calculation unit 114 does not update the number of predictable candidates.
[0122] Thus, if the predicted block candidate is a co-located block, the predicted motion vector candidate calculation unit 114 adds 1 to the number of predictable candidates, regardless of whether the co-located block is a predictable or unpredictable candidate. This prevents discrepancies in the number of predictable candidates between the video encoding device and the video decoding device, even if information about the co-located block is lost due to packet loss or the like.
[0123] This number of predictable candidates is set to the predicted motion vector candidate list size in step S115 of Figure 17. Furthermore, in S104 of Figure 14, the predicted motion vector candidate list size is used for variable-length coding of the predicted motion vector index. This makes it possible for the video encoding device 100 to generate a bitstream that can successfully decode the predicted motion vector index even if reference picture information including co-located blocks is lost.
[0124] Figure 19 is a flowchart detailing the process of step S114 in Figure 17. Specifically, Figure 19 shows how to add a new candidate. Figure 19 will be explained below.
[0125] In step S131, the predicted motion vector candidate calculation unit 114 determines whether the number of predicted motion vector candidates is less than the number of predictable candidates. In other words, the predicted motion vector candidate calculation unit 114 determines whether the number of predicted motion vector candidates has not reached the number of predictable candidates.
[0126] If the result of step S131 is true (Yes in S131), then in step S132, the predicted motion vector candidate calculation unit 114 determines whether there is a new candidate that can be added to the predicted motion vector candidate list as a predicted motion vector candidate. If the result of step S132 is true (Yes in S132), then in step S133, the predicted motion vector candidate calculation unit 114 assigns a predicted motion vector index value to the new candidate and adds the new candidate to the predicted motion vector candidate list. Furthermore, in step S134, the predicted motion vector candidate calculation unit 114 adds 1 to the number of predicted motion vector candidates.
[0127] On the other hand, if the result of step S131 or step S132 is false (No. of S131 or S132), the process of adding new candidates is terminated. In other words, if the number of predicted motion vector candidates has reached the number of predictable candidates, or if there are no new candidates, the process of adding new candidates is terminated.
[0128] Figure 20 is a flowchart detailing the process of step S103 in Figure 14. Specifically, Figure 20 shows the process related to the selection of candidate predicted motion vectors. Figure 20 will be explained below.
[0129] In step S141, the interpretation control unit 111 initializes the prediction motion vector candidate index mvp_idx to 0 and sets the minimum difference motion vector to the maximum value.
[0130] In step S142, the inter-prediction control unit 111 determines whether the value of the predicted motion vector candidate index mvp_idx is less than the number of predicted motion vector candidates. That is, the inter-prediction control unit 111 determines whether it has calculated the difference motion vectors for all predicted motion vector candidates.
[0131] If there are still candidate predicted motion vectors remaining (Yes in S142), then in step S143, the interprediction control unit 111 calculates the difference motion vector by subtracting the candidate predicted motion vectors from the motion vector obtained by motion detection (motion detection result vector).
[0132] In step S144, the interpretation control unit 111 determines whether the difference motion vector obtained in step S143 is smaller than the minimum difference motion vector.
[0133] If the determination result in step S144 is true (Yes in S144), then in step S145, the inter-prediction control unit 111 updates the values of the minimum difference motion vector and the predicted motion vector index. On the other hand, if the determination result in step S144 is false (No in S144), the inter-prediction control unit 111 does not update the values of the minimum difference motion vector and the predicted motion vector index.
[0134] In step S146, the interpretation control unit 111 updates the predicted motion vector candidate index by +1 and returns to step S142 to determine whether the next predicted motion vector candidate exists.
[0135] On the other hand, if in step S2 it is determined that the difference motion vector has been calculated for all predicted motion vector candidates (No. in S142), then in step S147 the inter-prediction control unit 111 determines the final set minimum difference motion vector and predicted motion vector index.
[0136] Thus, according to the video encoding device 100 of this embodiment, the size of the predicted motion vector candidate list used when encoding or decoding the predicted motion vector index can be calculated in a manner that does not depend on reference picture information including co-located blocks. This makes it possible to improve the error tolerance of the video encoding device 100.
[0137] More specifically, the video encoding device 100 according to this embodiment always adds 1 to the number of predictable candidates if the predicted block candidate is a co-located block, regardless of whether the co-located block is a predictable candidate or not. Then, the video encoding device 100 uses the number of predictable candidates calculated in this way to determine the bit sequence to be assigned to the predicted motion vector index. As a result, the video encoding device 100 can generate a bitstream that can successfully decode the predicted motion vector index even if the reference picture information including the co-located block is lost.
[0138] Furthermore, the video encoding device 100 according to this embodiment can improve encoding efficiency by adding new candidates with new predicted motion vectors as predicted motion vector candidates if the number of predicted motion vector candidates does not reach the number of predictable candidates.
[0139] In this embodiment, the video encoding device 100 adds a new candidate with a new predicted motion vector as a predicted motion vector candidate when the number of predicted motion vector candidates does not reach the number of predictable candidates, but it is not limited to this. For example, when the video encoding device 100 creates a list of predicted motion vector candidates, it may set a new candidate with a new predicted motion vector as the initial value for all predicted motion vector candidates on the list. In this case, when the video encoding device 100 calculates a predicted motion vector candidate and adds it to the list of predicted motion vector candidates, it will overwrite the initial new candidate. The video encoding device 100 then determines whether the calculated predicted motion vector candidate is an unpredictable candidate or a duplicate candidate before adding it to the list of predicted motion vector candidates. If there is an unpredictable candidate or a duplicate candidate, the initial new candidate remains in the list of predicted motion vector candidates. It is also possible to add a new candidate as a predicted motion vector candidate in this way.
[0140] Furthermore, this embodiment shows an example using a predicted motion vector specification mode in which predicted motion vector candidates are generated from adjacent blocks of the block to be encoded, and the motion vector of the block to be encoded is encoded. However, it is not limited to this. For example, direct mode or skip mode may be used. In direct mode or skip merge mode, as shown in Figures 15(b) and 16(b), a predicted motion vector is selected from the created predicted motion vector candidates, and the predicted image is generated directly using the selected predicted motion vector as the motion vector, so it is not necessary to add the motion vector difference to the bitstream.
[0141] (Embodiment 2) In the above embodiment 1, the video encoding device determined the bit sequence to be assigned to the predicted motion vector index using the number of predictable candidates, calculated by always adding 1 if the predicted block candidate is a co-located block, regardless of whether the co-located block is a predictable candidate or not. However, it is not limited to this. For example, in step S124 of Figure 18, the video encoding device may determine the bit sequence to be assigned to the predicted motion vector index using the number of predictable candidates, calculated by always adding 1 to the number of predictable candidates for predicted block candidates other than co-located blocks. In other words, the video encoding device may assign the bit sequence to the predicted motion vector index using a predicted motion vector candidate list size fixed to the maximum value N of the number of predicted motion vector candidates. That is, the video encoding device may consider all predicted block candidates as predictable candidates and encode the predicted motion vector index by fixing the predicted motion vector candidate list size to the maximum value N of the number of predicted motion vector candidates.
[0142] For example, in the above embodiment 1, since the maximum number of predicted motion vector candidates N is 5 (adjacent block A, adjacent block B, co-located block, adjacent block C, adjacent block D), the video encoding device may always set the predicted motion vector candidate list size to 5 and encode the predicted motion vector index. Alternatively, for example, if the maximum number of predicted motion vector candidates N is 4 (adjacent block A, adjacent block B, adjacent block C, adjacent block D), the video encoding device may always set the predicted motion vector candidate list size to 4 and encode the predicted motion vector index.
[0143] Thus, the video encoding device may determine the size of the predicted motion vector candidate list according to the maximum number of predicted motion vector candidates. This makes it possible for the variable-length decoding unit of the video decoding device to generate a bitstream in which the predicted motion vector index in the bitstream can be decoded without referring to information from adjacent blocks or co-located blocks, thereby reducing the processing load of the variable-length decoding unit.
[0144] The characteristic configuration of such a video encoding device will be specifically described below as a video encoding device according to Embodiment 2.
[0145] Figure 21 is a block diagram showing the configuration of a video encoding device 200 according to Embodiment 2. This video encoding device 200 generates a bitstream by encoding the image block by block. The video encoding device 200 includes a predicted motion vector candidate derivation unit 210, a prediction control unit 220, and an encoding unit 230.
[0146] The predicted motion vector candidate derivation unit 210 corresponds to the predicted motion vector candidate calculation unit 114 in the above embodiment 1. The predicted motion vector candidate derivation unit 210 derives predicted motion vector candidates. The predicted motion vector candidate derivation unit 210 then generates a list of predicted motion vector candidates, for example, by associating each derived predicted motion vector candidate with an index for identifying that predicted motion vector candidate (hereinafter referred to as the "predicted motion vector index").
[0147] A candidate predicted motion vector is a motion vector that is a candidate for the predicted motion vector used to encode the block to be encoded.
[0148] As shown in Figure 21, the predicted motion vector candidate derivation unit 210 comprises a determination unit 211, a first derivation unit 212, a specification unit 213, a determination unit 214, and a second derivation unit 215.
[0149] The decision unit 211 determines the maximum number of predicted motion vector candidates. In other words, the decision unit 211 determines the maximum number N of predicted block candidates.
[0150] For example, the determination unit 211 determines the maximum number of predicted motion vector candidates based on the characteristics of the input image sequence (sequence, picture, slice, or block, etc.). Alternatively, the determination unit 211 may determine a predetermined number as the maximum number of predicted motion vector candidates.
[0151] The first derivation unit 212 derives first predicted motion vector candidates. Specifically, the first derivation unit 212 derives first predicted motion vector candidates such that the number of first predicted motion vector candidates does not exceed the maximum number. More specifically, the first derivation unit 212 derives first predicted motion vector candidates based, for example, on motion vectors used to encode blocks that are spatially or temporally adjacent to the block to be encoded. Then, the first derivation unit 212 registers the first predicted motion vector candidates thus derived in the predicted motion vector index in the predicted motion vector candidate list.
[0152] Spatially adjacent blocks are blocks within a picture that contain the block to be encoded and are adjacent to the block to be encoded. Specifically, spatially adjacent blocks are, for example, adjacent blocks A to D shown in Figure 3.
[0153] A temporally adjacent block is a block contained in a different picture from the one containing the block to be encoded, and which corresponds to the block to be encoded. Specifically, temporally adjacent blocks are, for example, co-located blocks.
[0154] Note that temporally adjacent blocks do not necessarily have to be blocks located at the same position as the block to be encoded (co-located blocks). For example, temporally adjacent blocks may be blocks adjacent to a co-located block.
[0155] The first derivation unit 212 may, for example, derive as a first predicted motion vector candidate the motion vector used to encode blocks that are spatially adjacent to the block to be encoded, excluding blocks that are candidates for unpredictability. Blocks that are candidates for unpredictability are blocks encoded by intra-prediction, blocks located outside the slice or picture boundary containing the block to be encoded, or blocks that have not yet been encoded. This makes it possible to derive a first predicted motion vector candidate from an appropriate block in order to obtain a predicted motion vector candidate.
[0156] When multiple first predicted motion vector candidates are derived, the identification unit 213 identifies first predicted motion vector candidates whose motion vectors overlap with other first predicted motion vector candidates (overlap candidates). The identification unit 213 then removes the identified overlap candidates from the list of predicted motion vector candidates.
[0157] The determination unit 214 determines whether the number of first predicted motion vector candidates is less than the determined maximum number. Here, the determination unit 214 determines whether the number of first predicted motion vector candidates, excluding the identified duplicate first predicted motion vector candidates, is less than the determined maximum number.
[0158] The second derivation unit 215 derives a second predicted motion vector candidate if it is determined that the number of first predicted motion vector candidates is less than the determined maximum number. Specifically, the second derivation unit 215 derives the second predicted motion vector candidate such that the sum of the number of first predicted motion vector candidates and the number of second predicted motion vector candidates does not exceed the maximum number. Here, the second derivation unit 215 derives the second predicted motion vector candidate such that the sum of the number of first predicted motion vector candidates (excluding duplicate candidates) and the number of second predicted motion vector candidates does not exceed the maximum number.
[0159] This second predicted motion vector candidate corresponds to the novel candidate in Embodiment 1. Therefore, the second derivation unit 215 may derive the second predicted motion vector candidate based, for example, on a motion vector used to encode an adjacent block different from the first predicted motion vector candidate.
[0160] For example, the second derivation unit 215 may derive a second predicted motion vector candidate whose motion vector differs from that of the first predicted motion vector candidate. This increases the number of predicted motion vector candidates with different motion vectors, thereby further improving coding efficiency.
[0161] Furthermore, the second derivation unit 215 does not necessarily need to derive a second predicted motion vector candidate that does not overlap with the first predicted motion vector candidate. In other words, the second derivation unit 215 may, as a result, derive a second predicted motion vector candidate that overlaps with the first predicted motion vector candidate.
[0162] The second derivation unit 215 then registers the second predicted motion vector candidate derived in this way in the predicted motion vector candidate list, associating it with a predicted motion vector index. At this time, the second derivation unit 215 may register the second predicted motion vector candidate in the predicted motion vector candidate list such that the first predicted motion vector candidate is assigned a predicted motion vector index smaller than that of the second predicted motion vector candidate, similar to the first embodiment. This allows the video encoding device 200 to reduce the amount of code and improve encoding efficiency when the first predicted motion vector candidate is more likely to be selected as the predicted motion vector candidate used for encoding than the second predicted motion vector candidate.
[0163] Furthermore, the second derivation unit 215 does not necessarily need to derive the second predicted motion vector candidates in such a way that the sum of the number of first predicted motion vector candidates and the number of second predicted motion vector candidates matches the determined maximum number. If the sum of the number of first predicted motion vector candidates and the number of second predicted motion vector candidates is smaller than the determined maximum number, for example, there may be predicted motion vector index values that are not associated with any predicted motion vector candidates.
[0164] The prediction control unit 220 selects a prediction motion vector to be used for encoding the block to be encoded from among the first and second prediction motion vector candidates. In other words, the prediction control unit 220 selects a prediction motion vector to be used for encoding the block to be encoded from the list of prediction motion vector candidates.
[0165] The encoding unit 230 encodes an index (predicted motion vector index) for identifying the selected predicted motion vector candidate using the determined maximum number. Specifically, as shown in Figure 6, the encoding unit 230 performs variable-length encoding of the bit sequence assigned to the index value of the selected predicted motion vector candidate. Furthermore, the encoding unit 230 appends the encoded index to the bitstream.
[0166] Here, the encoding unit 230 may further add information indicating the maximum number determined by the determination unit 211 to the bitstream. Specifically, the encoding unit 230 may write the information indicating the maximum number to, for example, a slice header. This makes it possible to switch the maximum number in appropriate units and improve encoding efficiency.
[0167] The encoding unit 230 does not necessarily need to add information indicating the maximum number to the bitstream. For example, if the maximum number is predetermined by the standard, or if the maximum number is the same as the default value, the encoding unit 230 does not need to add information indicating the maximum number to the bitstream.
[0168] Next, we will explain the various operations of the video encoding device 200 configured as described above.
[0169] Figure 22 is a flowchart showing the processing operation of the video encoding device 200 according to Embodiment 2.
[0170] First, the determination unit 211 determines the maximum number of predicted motion vector candidates (S201). The first derivation unit 212 derives a first predicted motion vector candidate (S202). If multiple first predicted motion vector candidates are derived, the identification unit 213 identifies the first predicted motion vector candidate whose motion vector overlaps with other first predicted motion vector candidates (S203).
[0171] The determination unit 214 determines whether the number of first predicted motion vector candidates, excluding duplicate candidates, is less than the determined maximum number (S204). If it is determined that the number of first predicted motion vector candidates, excluding duplicate candidates, is less than the determined maximum number (Yes in S204), the second derivation unit 215 derives a second predicted motion vector candidate (S205). On the other hand, if it is not determined that the number of first predicted motion vector candidates, excluding duplicate candidates, is less than the determined maximum number (No in S204), the second derivation unit 215 does not derive a second predicted motion vector candidate. These steps S204 and S205 correspond to step S114 in Embodiment 1.
[0172] The prediction control unit 220 selects a prediction motion vector to be used for encoding the block to be encoded from among the first and second prediction motion vector candidates (S206). For example, similar to Embodiment 1, the prediction control unit 220 selects the prediction motion vector with the smallest difference motion vector from the list of prediction motion vector candidates.
[0173] The encoding unit 230 encodes an index for identifying the selected predicted motion vector candidate using the determined maximum number (S207). Furthermore, the encoding unit 230 appends the encoded index to the bitstream.
[0174] As described above, the video encoding device 200 according to this embodiment can encode an index for identifying predicted motion vector candidates using a determined maximum number. In other words, the index can be encoded regardless of the actual number of predicted motion vector candidates derived. Therefore, even if information necessary for deriving predicted motion vector candidates (for example, information such as co-located blocks) is lost, the decoding side can decode the index, thereby improving error tolerance. Furthermore, the decoding side can decode the index regardless of the actual number of predicted motion vector candidates derived. In other words, the decoding side can perform the index decoding process without waiting for the predicted motion vector candidate derivation process. That is, it is possible to generate a bitstream in which the predicted motion vector candidate derivation process and the index decoding process can be performed in parallel.
[0175] Furthermore, according to the video encoding device 200 of this embodiment, if it is determined that the number of first predicted motion vector candidates is less than the maximum number, a second predicted motion vector candidate can be derived. Therefore, the number of predicted motion vector candidates can be increased within a range that does not exceed the maximum number, thereby improving encoding efficiency.
[0176] Furthermore, according to the video encoding device 200 of this embodiment, a second predicted motion vector candidate can be derived according to the number of first predicted motion vector candidates excluding duplicate first predicted motion vector candidates. As a result, the number of second predicted motion vector candidates can be increased, and the number of selectable motion vector types can be increased. Therefore, it becomes possible to further improve encoding efficiency.
[0177] In this embodiment, the video encoding device 200 was equipped with a specific unit 213, but it is not necessarily required to be equipped with a specific unit 213. In other words, the flowchart shown in Figure 22 does not necessarily need to include step S203. Even in such a case, the video encoding device 200 can encode the index for identifying the predicted motion vector candidate using the determined maximum number, thereby improving error tolerance.
[0178] Furthermore, in this embodiment, as shown in Figure 22, the first derivation unit 212 derived a first predicted motion vector candidate, and then the identification unit 213 identified duplicate candidates. However, the processing does not necessarily have to be done in this order. For example, the first derivation unit 212 may identify duplicate candidates in the process of deriving the first predicted motion vector candidate and derive the first predicted motion vector candidate in such a way that the identified duplicate candidates are not included in the first predicted motion vector candidate. In other words, the first derivation unit 212 may derive a predicted motion vector candidate as the first predicted motion vector candidate whose motion vector does not overlap with the first predicted motion vector candidate from which the motion vector has already been derived. More specifically, for example, if a predicted motion vector candidate based on the left adjacent block has already been derived as the first predicted motion vector candidate, and the predicted motion vector candidate based on the upper adjacent block does not overlap with the predicted motion vector candidate based on the left adjacent block, the first derivation unit 212 may derive the predicted motion vector candidate based on the upper adjacent block as the first predicted motion vector candidate.
[0179] (Embodiment 3) Figure 23 is a block diagram showing the configuration of the video decoding device 300 according to Embodiment 3.
[0180] As shown in Figure 23, the motion image decoding device 300 includes a variable-length decoding unit 301, an inverse quantization unit 302, an inverse orthogonal transformation unit 303, an adder unit 304, a block memory 305, a frame memory 306, an intra prediction unit 307, an inter prediction unit 308, an inter prediction control unit 309, a switch 310, a predicted motion vector candidate calculation unit 311, and a colPic memory 312.
[0181] The variable-length decoding unit 301 performs variable-length decoding on the input bitstream to generate picture type information, a prediction direction flag, quantization coefficients, and a differential motion vector. The variable-length decoding unit 301 also performs variable-length decoding on the predicted motion vector index using the number of predictable candidates, which will be described later.
[0182] The inverse quantization unit 302 performs inverse quantization on the quantization coefficients obtained by the variable-length decoding process. The inverse orthogonal transformation unit 303 generates prediction error data by converting the orthogonal transformation coefficients obtained by the inverse quantization process from the frequency domain to the image domain. The block memory 305 stores the decoded image data, which is generated by adding the prediction error data and the predicted image data, in block units. The frame memory 306 stores the decoded image data in frame units.
[0183] The intra prediction unit 307 generates predicted image data for the block to be decoded by performing intra prediction using the decoded image data in block units stored in the block memory 305. The inter prediction unit 308 generates predicted image data for the block to be decoded by performing inter prediction using the decoded image data in frame units stored in the frame memory 306.
[0184] When the block to be decoded is subjected to intra-predictive decoding, switch 310 outputs the intra-predictive image data generated by the intra-prediction unit 307 to the adder 304 as the predicted image data for the block to be decoded. On the other hand, when the block to be decoded is subjected to inter-predictive decoding, switch 310 outputs the inter-predictive image data generated by the inter-prediction unit 308 to the adder 304 as the predicted image data for the block to be decoded.
[0185] The predicted motion vector candidate calculation unit 311 uses colPic information, such as the motion vectors of adjacent blocks to the decoded block and the motion vectors of co-located blocks stored in the colPic memory 312, to derive predicted motion vector candidates for the predicted motion vector specification mode in a method described later. The predicted motion vector candidate calculation unit 311 also assigns a predicted motion vector index value to each of the derived predicted motion vector candidates. The predicted motion vector candidate calculation unit 311 then sends the predicted motion vector candidates and the predicted motion vector index to the inter-prediction control unit 309.
[0186] The interpretation control unit 309 selects a predicted motion vector to be used for interpretation from the predicted motion vector candidates based on the decoded predicted motion vector index. The interpretation control unit 309 then calculates the motion vector of the block to be decoded from the predicted motion vector and the difference motion vector. The interpretation control unit 309 then uses the calculated motion vector to cause the interpretation unit 308 to generate an interpretation image. The interpretation control unit 309 also transfers colPic information, including the motion vector of the block to be decoded, to the colPic memory 312.
[0187] Finally, the addition unit 304 generates decoded image data by adding the predicted image data and the prediction error data.
[0188] Figure 24 is a flowchart showing the processing operation of the video decoding device 300 according to Embodiment 3.
[0189] In step S301, the variable-length decoding unit 301 decodes the prediction direction flag and the reference picture index. Then, the value of the prediction direction X is determined according to the decoded prediction direction flag, and the following steps S302 to S305 are performed.
[0190] In step S302, the predicted motion vector candidate calculation unit 311 calculates the number of predictable candidates using a method described later. The predicted motion vector candidate calculation unit 311 then sets the calculated number of predictable candidates as the predicted motion vector candidate list size.
[0191] In step S303, the variable-length decoding unit 301 decodes the predicted motion vector index in the bitstream using the calculated predicted motion vector candidate list size. In step S304, the predicted motion vector candidate calculation unit 311 generates predicted motion vector candidates from adjacent blocks and co-located blocks of the block to be decoded using a method described later. In step S305, the inter-prediction control unit 309 calculates a motion vector by adding the decoded difference motion vector to the predicted motion vector candidate indicated by the decoded predicted motion vector index. Then, the inter-prediction control unit 309 causes the inter-prediction unit 308 to generate an inter-predicted image using the calculated motion vector.
[0192] If the predicted motion vector candidate list size calculated in step S302 is "1", the predicted motion vector index may be estimated as 0 without being decoded.
[0193] Figure 25 is a flowchart showing the detailed processing of step S302 in Figure 24. Specifically, Figure 25 shows a method for determining whether a predicted block candidate [N] is a predictable candidate and for calculating the number of predictable candidates. Figure 25 will be explained below.
[0194] In step S311, the predicted motion vector candidate calculation unit 311 determines whether the predicted block candidate [N] is (1) a block that has been decoded in intra prediction, (2) a block located outside the slice or picture boundary containing the block to be decoded, or (3) a block that has not yet been decoded.
[0195] Here, if the result of the determination in step S311 is true (Yes in S311), in step S312, the predicted motion vector candidate calculation unit 311 sets the predicted block candidate [N] to an unpredictable candidate. On the other hand, if the result of the determination in step S311 is false (No in S311), in step S313, the predicted motion vector candidate calculation unit 311 sets the predicted block candidate [N] to a predictable candidate.
[0196] In step S314, the predicted motion vector candidate calculation unit 311 determines whether the predicted block candidate [N] is a predictable candidate or a co-located block candidate. If the determination result in step S314 is true (Yes in S314), in step S5, the predicted motion vector candidate calculation unit 311 updates the number of predictable candidates by adding 1. On the other hand, if step S314 is false (No in S314), the predicted motion vector candidate calculation unit 311 does not update the number of predictable candidates.
[0197] Thus, if the predicted block candidate is a co-located block, the predicted motion vector candidate calculation unit 311 adds 1 to the number of predictable candidates, regardless of whether the co-located block is a predictable or unpredictable candidate. This prevents discrepancies in the number of predictable candidates between the video encoding device and the video decoding device, even if information about the co-located block is lost due to packet loss or the like.
[0198] This number of predictable candidates is set to the predicted motion vector candidate list size in step S302 of Figure 24. Furthermore, in S303 of Figure 24, the predicted motion vector candidate list size is used for variable-length decoding of the predicted motion vector index. This enables the video decoding device 300 to successfully decode the predicted motion vector index even if reference picture information, including co-located blocks, is lost.
[0199] Figure 26 is a flowchart showing the detailed processing of step S304 in Figure 24. Specifically, Figure 26 illustrates the method for calculating the predicted motion vector candidates. Figure 26 will be explained below.
[0200] In step S321, the predicted motion vector candidate calculation unit 311 calculates a predicted motion vector candidate in the predicted direction X from the predicted block candidate [N] using the above equations 1 and 2, and adds it to the predicted motion vector candidate list.
[0201] In step S322, the predicted motion vector candidate calculation unit 311 searches for unpredictable candidates and duplicate candidates from the predicted motion vector candidate list, as shown in Figures 15 and 16, and deletes them.
[0202] In step S323, the predicted motion vector candidate calculation unit 311 adds a new candidate to the predicted motion vector candidate list in the same manner as in Figure 19.
[0203] Figure 27 shows an example of the syntax for adding the predicted motion vector index to the bitstream. In Figure 27, inter_pred_flag represents the prediction direction flag, and mvp_idx represents the predicted motion vector index. NumMVPCand represents the size of the predicted motion vector candidate list, and in this embodiment, the number of predictable candidates calculated in the processing flow of Figure 25 is set.
[0204] Thus, according to the video decoding device 300 of this embodiment, the size of the predicted motion vector candidate list used when encoding or decoding the predicted motion vector index can be calculated in a manner that does not depend on reference picture information including co-located blocks. As a result, the video decoding device 300 can appropriately decode a bitstream with improved error tolerance.
[0205] More specifically, the video decoding device 300 according to this embodiment always adds 1 to the number of predictable candidates if the predicted block candidate is a co-located block, regardless of whether the co-located block is a predictable candidate or not. The video decoding device 300 then uses the number of predictable candidates calculated in this way to determine the bit sequence to be assigned to the predicted motion vector index. As a result, the video decoding device 300 can successfully decode the predicted motion vector index even if reference picture information including co-located blocks is lost.
[0206] Furthermore, the video decoding device 300 according to this embodiment can appropriately decode a bitstream with improved coding efficiency by adding new candidates with new predicted motion vectors as predicted motion vector candidates when the number of predicted motion vector candidates does not reach the number of predictable candidates.
[0207] In this embodiment, the video decoding device 300 adds a new candidate with a new predicted motion vector as a predicted motion vector candidate when the number of predicted motion vector candidates does not reach the number of predictable candidates, but it is not limited to this. For example, similar to Embodiment 1 above, when the video decoding device 300 creates the predicted motion vector candidate list, it may set a new candidate with a new predicted motion vector as the initial value for all predicted motion vector candidates on the predicted motion vector candidate list.
[0208] (Embodiment 4) In the above embodiment 3, the video decoding device determined the bit sequence to be assigned to the predicted motion vector index using the number of predictable candidates, calculated by always adding 1 if the predicted block candidate is a co-located block, regardless of whether the co-located block is a predictable candidate or not. However, it is not limited to this. For example, in step S314 of Figure 25, the video decoding device may determine the bit sequence to be assigned to the predicted motion vector index using the number of predictable candidates, calculated by always adding 1 to the number of predictable block candidates other than co-located blocks. In other words, the video decoding device may assign the bit sequence to the predicted motion vector index using a predicted motion vector candidate list size fixed to the maximum value N of the number of predicted motion vector candidates. That is, the video decoding device may consider all predicted block candidates as predictable candidates and decode the predicted motion vector index by fixing the predicted motion vector candidate list size to the maximum value N of the number of predicted motion vector candidates.
[0209] For example, in the above embodiment 3, since the maximum number of predicted motion vector candidates N is 5 (adjacent block A, adjacent block B, co-located block, adjacent block C, adjacent block D), the video decoding device may always set the predicted motion vector candidate list size to 5 and decode the predicted motion vector index. This makes it possible for the variable-length decoding unit of the video decoding device to decode the predicted motion vector index in the bitstream without referring to information from adjacent blocks or co-located blocks. As a result, for example, the processing in steps S314 and S315 in Figure 25 can be omitted, and the processing load of the variable-length decoding unit can be reduced.
[0210] Figure 28 shows an example of syntax when the size of the predicted motion vector candidate list is fixed to the maximum number of predicted motion vector candidates. As shown in Figure 28, when the size of the predicted motion vector candidate list is fixed to the maximum number of predicted motion vector candidates, NumMVPCand can be removed from the syntax.
[0211] The characteristic configuration of such a video decoding device will be specifically described below as the video decoding device according to Embodiment 4.
[0212] Figure 29 is a block diagram showing the configuration of a video decoding device 400 according to Embodiment 4. This video decoding device 400 decodes the encoded images contained in the bitstream block by block. Specifically, the video decoding device 400 decodes the encoded images contained in the bitstream generated by the video encoding device 200 according to Embodiment 2 block by block. The video decoding device 400 comprises a predicted motion vector candidate derivation unit 410, a decoding unit 420, and a prediction control unit 430.
[0213] The predicted motion vector candidate derivation unit 410 corresponds to the predicted motion vector candidate calculation unit 311 in the above embodiment 3. The predicted motion vector candidate derivation unit 410 derives predicted motion vector candidates. The predicted motion vector candidate derivation unit 410 then generates a list of predicted motion vector candidates, for example, by associating each derived predicted motion vector candidate with an index (predicted motion vector index) for identifying that predicted motion vector candidate.
[0214] As shown in Figure 29, the predicted motion vector candidate derivation unit 410 comprises a determination unit 411, a first derivation unit 412, a specification unit 413, a judgment unit 414, and a second derivation unit 415.
[0215] The decision unit 411 determines the maximum number of predicted motion vector candidates. In other words, the decision unit 211 determines the maximum number N of predicted block candidates.
[0216] For example, the determination unit 411 determines the maximum number of predicted motion vector candidates in the same manner as the determination unit 211 in Embodiment 2. Alternatively, the determination unit 411 may determine the maximum number based on information indicating the maximum number attached to the bitstream.
[0217] In this example, the determination unit 411 is provided in the predicted motion vector candidate derivation unit 410, but it may also be provided in the decoding unit 420.
[0218] The first derivation unit 412 derives first predicted motion vector candidates. Specifically, the first derivation unit 412 derives first predicted motion vector candidates in the same manner as the first derivation unit 212 in Embodiment 2. For example, the first derivation unit 412 derives first predicted motion vector candidates such that the number of first predicted motion vector candidates does not exceed the maximum number. More specifically, the first derivation unit 412 derives first predicted motion vector candidates based, for example, on motion vectors used in decoding blocks spatially or temporally adjacent to the block to be decoded. Then, the first derivation unit 412 registers the first predicted motion vector candidates thus derived in the predicted motion vector index in the predicted motion vector candidate list.
[0219] Furthermore, the first derivation unit 412 may, for example, derive the motion vectors used in decoding blocks that are spatially adjacent to the block to be decoded, excluding blocks that are candidates for unpredictability, as first predicted motion vector candidates. This makes it possible to derive the first predicted motion vector candidate from an appropriate block in order to obtain a predicted motion vector candidate.
[0220] When multiple first predicted motion vector candidates are derived, the identification unit 413 identifies first predicted motion vector candidates whose motion vectors overlap with other first predicted motion vector candidates (overlap candidates). The identification unit 413 then removes the identified overlap candidates from the list of predicted motion vector candidates.
[0221] The determination unit 414 determines whether the number of first predicted motion vector candidates is less than the determined maximum number. Here, the determination unit 414 determines whether the number of first predicted motion vector candidates, excluding the identified duplicate first predicted motion vector candidates, is less than the determined maximum number.
[0222] The second derivation unit 415 derives a second predicted motion vector candidate when it is determined that the number of first predicted motion vector candidates is smaller than the determined maximum number. Specifically, the second derivation unit 415 derives a second predicted motion vector candidate in the same manner as the second derivation unit 215 in Embodiment 2.
[0223] For example, the second derivation unit 415 may derive a second predicted motion vector candidate whose motion vector differs from that of the first predicted motion vector candidate. This increases the number of predicted motion vector candidates with different motion vectors, and makes it possible to decode an encoded image with improved encoding efficiency.
[0224] Then, the second derivation unit 415, for example, similar to the second derivation unit 215 in Embodiment 2, registers the second predicted motion vector candidate derived in this way in the predicted motion vector index in the predicted motion vector candidate list.
[0225] The decoding unit 420 decodes the encoded index attached to the bitstream, which is an index for identifying a candidate for the predicted motion vector, using the determined maximum number.
[0226] The prediction control unit 430 selects a prediction motion vector to be used for decoding the target block from among the first and second prediction motion vector candidates based on the decoded index. In other words, the prediction control unit 430 selects a prediction motion vector to be used for decoding the target block from the list of prediction motion vector candidates.
[0227] Next, we will explain the various operations of the video decoding device 400 configured as described above.
[0228] Figure 30 is a flowchart showing the processing operation of the video decoding device 400 according to Embodiment 4.
[0229] First, the determination unit 411 determines the maximum number of predicted motion vector candidates (S401). The first derivation unit 412 derives a first predicted motion vector candidate (S402). If multiple first predicted motion vector candidates are derived, the identification unit 413 identifies the first predicted motion vector candidate whose motion vector overlaps with other first predicted motion vector candidates (S403).
[0230] The determination unit 414 determines whether the number of first predicted motion vector candidates, excluding duplicate candidates, is less than the determined maximum number (S404). If it is determined that the number of first predicted motion vector candidates, excluding duplicate candidates, is less than the determined maximum number (Yes in S404), the second derivation unit 415 derives a second predicted motion vector candidate (S405). On the other hand, if it is not determined that the number of first predicted motion vector candidates, excluding duplicate candidates, is less than the determined maximum number (No in S404), the second derivation unit 415 does not derive a second predicted motion vector candidate.
[0231] The decoding unit 420 decodes the encoded index attached to the bitstream, which is an index for identifying a candidate for the predicted motion vector, using the determined maximum number (S406).
[0232] The prediction control unit 430 selects a prediction motion vector to be used for decoding the block to be decoded from among the first and second prediction motion vector candidates based on the decoded index (S407).
[0233] In this example, the index decoding process (S406) was performed after the predicted motion vector candidates were derived, but this order is not necessarily required. For example, the predicted motion vector candidate derivation process (S402-S405) may be performed after the index decoding process (S406). Furthermore, the index decoding process (S406) and the predicted motion vector candidate derivation process (S402-S405) may be performed in parallel. This can improve the decoding processing speed.
[0234] As described above, the video decoding device 400 according to this embodiment can decode an index for identifying predicted motion vector candidates using a determined maximum number. In other words, the index can be decoded regardless of the actual number of predicted motion vector candidates derived. Therefore, even if information necessary for deriving predicted motion vector candidates (for example, information such as co-located blocks) is lost, the index can be decoded, thereby improving error tolerance. Furthermore, the index decoding process can be performed without waiting for the predicted motion vector candidate derivation process, and the predicted motion vector candidate derivation process and the index decoding process can be performed in parallel.
[0235] Furthermore, according to the video decoding device 400 of this embodiment, if it is determined that the number of first predicted motion vector candidates is less than the maximum number, a second predicted motion vector candidate can be derived. Therefore, the number of predicted motion vector candidates can be increased within a range that does not exceed the maximum number, making it possible to decode encoded images with improved encoding efficiency.
[0236] Furthermore, according to the video decoding device 400 of this embodiment, a second predicted motion vector candidate can be derived according to the number of first predicted motion vector candidates excluding duplicate first predicted motion vector candidates. As a result, the number of second predicted motion vector candidates can be increased, and the number of selectable combinations of prediction direction, motion vector, and reference picture index can be increased. Therefore, it becomes possible to decode encoded images with further improved encoding efficiency.
[0237] In this embodiment, the video decoding device 400 was equipped with a specific unit 413, but as in Embodiment 2, it is not necessary to include a specific unit 413. In other words, the flowchart shown in Figure 30 does not necessarily need to include step S403. Even in such a case, the video decoding device 400 can decode the index for identifying the predicted motion vector candidate using the determined maximum number, thereby improving error tolerance.
[0238] Furthermore, in this embodiment, as shown in Figure 30, the first derivation unit 412 derived a first predicted motion vector candidate, and then the identification unit 413 identified duplicate candidates. However, it is not necessarily required that the processes be carried out in this order. For example, the first derivation unit 412 may derive a predicted motion vector candidate as the first predicted motion vector candidate whose motion vector does not overlap with a first predicted motion vector candidate whose motion vector has already been derived.
[0239] Although the video encoding device and video decoding device according to one or more embodiments of the present invention have been described above based on embodiments, the present invention is not limited to these embodiments. Without departing from the spirit of the present invention, various modifications that a person skilled in the art can conceive of may be applied to these embodiments, and forms constructed by combining components from different embodiments may also be included within the scope of one or more embodiments of the present invention.
[0240] In each of the above embodiments, each component may be implemented by dedicated hardware or by executing a software program suitable for each component. Each component may also be implemented by a program execution unit such as a CPU or processor reading and executing a software program recorded on a recording medium such as a hard disk or semiconductor memory. Here, the software that implements the video encoding device or video decoding device, etc. in each of the above embodiments is the following program.
[0241] In other words, this program causes a computer to execute a video encoding method that generates a bitstream by encoding a block to be encoded, which involves calculating a predicted motion vector to be used when encoding the motion vector of the block to be encoded, and encoding the block to be encoded, the method comprising: a determination step of determining the maximum number of candidate predicted motion vectors that are candidates for the predicted motion vector; a first derivation step of deriving a first candidate predicted motion vector; a determination step of determining whether the number of the first candidate predicted motion vectors is less than the maximum number; a second derivation step of deriving a second candidate predicted motion vector if it is determined that the number of the first candidate predicted motion vectors is less than the maximum number; a selection step of selecting the predicted motion vector to be used for encoding the motion vector of the block to be encoded from the first candidate predicted motion vector and the second candidate predicted motion vector; and an encoding step of encoding an index for identifying the selected predicted motion vector using the determined maximum number, and adding the encoded index to the bitstream.
[0242] Alternatively, this program causes a computer to execute a video decoding method for decoding a block to be decoded, which involves calculating a predicted motion vector to be used when decoding the motion vector of a block to be decoded contained in a bitstream, and decoding the block to be decoded, the method comprising: a determination step of determining the maximum number of candidate predicted motion vectors that are candidates for the predicted motion vector; a first derivation step of deriving a first candidate predicted motion vector; a determination step of determining whether the number of the first candidate predicted motion vectors is less than the maximum number; a second derivation step of deriving a second candidate predicted motion vector if it is determined that the number of the first candidate predicted motion vectors is less than the maximum number; a decoding step of decoding an encoded index attached to the bitstream for identifying the predicted motion vector using the determined maximum number; and a selection step of selecting a predicted motion vector to be used for decoding the block to be decoded from among the first candidate predicted motion vector and the second candidate predicted motion vector based on the decoded index.
[0243] (Embodiment 5) By recording a program for realizing the configuration of the video encoding method (image encoding method) or video decoding method (image decoding method) shown in each of the above embodiments onto a storage medium, the processes shown in each of the above embodiments can be easily performed on an independent computer system. The storage medium can be anything that can record a program, such as a magnetic disk, optical disk, magneto-optical disk, IC card, or semiconductor memory.
[0244] Furthermore, here we will describe application examples of the video encoding method (image encoding method) and video decoding method (image decoding method) shown in each of the embodiments described above, and a system using them. The system is characterized by having an image encoding and decoding device consisting of an image encoding device using the image encoding method and an image decoding device using the image decoding method. Other configurations in the system can be appropriately modified as needed.
[0245] Figure 31 shows the overall configuration of the content supply system ex100 that realizes the content distribution service. The communication service area is divided into desired sizes, and fixed radio stations, base stations ex106, ex107, ex108, ex109, and ex110, are installed in each cell.
[0246] This content supply system ex100 connects various devices such as computers ex111, PDAs (Personal Digital Assistants) ex112, cameras ex113, mobile phones ex114, and game consoles ex115 to the internet ex101, via the internet service provider ex102 and telephone network ex104, and base stations ex106 via ex110.
[0247] However, the content supply system ex100 is not limited to the configuration shown in Figure 31, and any combination of elements may be used for connection. Furthermore, each device may be directly connected to the telephone network ex104 without going through ex110 from the base station ex106, which is a fixed radio station. Also, each device may be directly connected to one another via short-range radio or the like.
[0248] Camera ex113 is a device capable of recording video, such as a digital video camera, and Camera ex116 is a device capable of taking still images and recording video, such as a digital camera. Furthermore, Mobile phone ex114 can be a mobile phone using GSM (Registered Trademark) (Global System for Mobile Communications), CDMA (Code Division Multiple Access), W-CDMA (Wideband-Code Division Multiple Access), LTE (Long Term Evolution), HSPA (High Speed Packet Access), or PHS (Personal Handyphone System), and any of these is acceptable.
[0249] In the content supply system ex100, cameras ex113 and other devices are connected to the streaming server ex103 via the base station ex109 and the telephone network ex104, enabling live streaming and other functions. In live streaming, content captured by the user using the camera ex113 (for example, video of a music concert) is encoded as described in each of the embodiments above (i.e., it functions as an image encoding device according to one aspect of the present invention) and transmitted to the streaming server ex103. Meanwhile, the streaming server ex103 streams the transmitted content data to the requesting client. Clients include computers ex111, PDAs ex112, cameras ex113, mobile phones ex114, game consoles ex115, etc., that are capable of decoding the encoded data. Each device that receives the distributed data decodes and plays back the received data (i.e., it functions as an image decoding device according to one aspect of the present invention).
[0250] The encoding process for the captured data may be performed by the camera ex113, the streaming server ex103 which handles data transmission, or the tasks may be shared between them. Similarly, the decoding process for the transmitted data may be performed by the client, the streaming server ex103, or the tasks may be shared between them. In addition, still images and / or video data captured by camera ex116 may be transmitted to the streaming server ex103 via computer ex111, not limited to camera ex113. In this case, the encoding process may be performed by camera ex116, computer ex111, or streaming server ex103, or the tasks may be shared among them.
[0251] 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, a flexible disk, a 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.
[0252] Also, the streaming server ex103 may be a plurality of servers or a plurality of computers, which may distribute, record, and deliver data in a distributed manner.
[0253] 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.
[0254] Note that, not limited to the example of the content supply system ex100, as shown in FIG. 32, at least either the moving image encoding device (image encoding device) or the moving image decoding device (image decoding device) of each of the above embodiments can also be incorporated into the digital broadcast system ex200. 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 a 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 an 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).
[0255] 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 further multiplexes and writes it with a music signal in some cases. 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, a moving image decoding device may be incorporated into the television.
[0256] Figure 33 shows a television (receiver) ex300 using the video decoding method and video encoding method described in each of the above embodiments. The television ex300 includes a tuner ex301 that acquires or outputs multiplexed data in which audio data is multiplexed with video data via an antenna ex204 or cable ex203, etc. that receives the above broadcast, a modulation / demodulation unit ex302 that demodulates the received multiplexed data or modulates it into multiplexed data to be transmitted externally, and a multiplexing / separation unit ex303 that separates the demodulated multiplexed data into video data and audio data, or multiplexes the video data and audio data encoded by the signal processing unit ex306.
[0257] Furthermore, the TV ex300 includes a signal processing unit ex306 having an audio signal processing unit ex304 that decodes audio data and video data, respectively, or encodes the information of each, and a video signal processing unit ex305 (which functions as an image encoding device or image decoding device according to one aspect of the present invention), 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 shows the decoded video signal. Furthermore, the TV ex300 has an interface unit ex317 having an operation input unit ex312 that receives user input, etc. Furthermore, the TV 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 include, in addition to the operation input unit ex312, a bridge ex313 for connecting to external devices such as a reader / recorder ex218, a slot unit ex314 for inserting recording media such as an SD card ex216, a driver ex315 for connecting to external recording media such as a hard disk, and a modem ex316 for connecting to a telephone network. The recording media ex216 enables the electrical recording of information using non-volatile / volatile semiconductor memory elements that it stores. The various parts of the television ex300 are connected to each other via a synchronization bus.
[0258] First, we will describe a configuration in which the TV ex300 decodes and plays back multiplexed data acquired from an external source, such as the antenna ex204. The TV ex300 receives user input from a remote controller ex220 or the like, and based on the control of the control unit ex310, which has a CPU, the multiplexed data demodulated by the modulation / demodulation unit ex302 is separated by the multiplexing / separation unit ex303. Furthermore, the TV ex300 decodes the separated audio data with the audio signal processing unit ex304, and decodes the separated video data with the 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 to the outside from the output unit ex309, respectively. When outputting, it is advisable to temporarily store these signals in buffers ex318, ex319, etc., so that the audio signal and video signal are played back in sync. In addition, the TV ex300 may read multiplexed data from recording media such as magnetic / optical disks or SD cards ex215, ex216, rather than from broadcasts, etc. Next, a configuration in which the TV ex300 encodes audio and video signals and transmits them externally or writes them to a recording medium will be described. The TV ex300 receives user operations from a remote controller ex220 or the like, and based on the control of the control unit ex310, encodes audio signals in the audio signal processing unit ex304 and encodes video signals in the video signal processing unit ex305 using the encoding method described in each of the embodiments above. The encoded audio and video signals are multiplexed in the multiplexing / decompression unit ex303 and output externally. When multiplexing, it is advisable to temporarily store these signals in buffers ex320, ex321, etc., so that the audio and video signals are synchronized. Note that there may be multiple buffers ex318, ex319, ex320, and ex321 as shown in the figure, or one or more buffers may be shared. Furthermore, in addition to what is shown in the figure, data may also be stored in buffers as a buffer to avoid system overflow and underflow, for example, between the modulation / demodulation unit ex302 and the multiplexing / decompression unit ex303.
[0259] Furthermore, in addition to acquiring audio and video data from broadcasts and recording media, the TV ex300 may also be configured to accept AV inputs from microphones and cameras, and may perform encoding processing on the data acquired from them. While the TV ex300 is described here as having the above-mentioned encoding processing, multiplexing, and external output capabilities, it may also be configured to only perform the above-mentioned reception, decoding, and external output functions, without being able to perform these processes.
[0260] Furthermore, when the reader / recorder ex218 reads or writes multiplexed data from the recording medium, the above decoding or encoding process may be performed by either the television ex300 or the reader / recorder ex218, or the television ex300 and the reader / recorder ex218 may share the task.
[0261] As an example, Figure 34 shows the configuration of the information playback / recording unit ex400 when reading or writing data from an optical disc. The information playback / recording unit ex400 comprises the elements ex401, ex402, ex403, ex404, ex405, ex406, and ex407, which are described below. The optical head ex401 writes information by irradiating the recording surface of the recording medium ex215, which is an optical disc, with a laser spot, and reads the information by detecting the reflected light from the recording surface of the recording medium ex215. The modulation recording unit ex402 electrically drives the semiconductor laser built into the optical head ex401 and modulates the laser light according to the recorded data. The playback / demodulation unit ex403 amplifies the playback signal electrically detected by a photodetector built into the optical head ex401 that detects the reflected light from the recording surface, separates and demodulates the signal components recorded on the recording medium ex215, and plays back the necessary information. The buffer ex404 temporarily holds information to be recorded on the recording medium ex215 and information played back from the recording medium ex215. The disk motor ex405 rotates the recording medium ex215. The servo control unit ex406 controls the rotational drive of the disk motor ex405, moves the optical head ex401 to a predetermined information track, and performs laser spot tracking. The system control unit ex407 controls the entire information playback / 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 needed, and performing information recording and playback through the optical head ex401 while coordinating the operation of the modulation recording unit ex402, the playback / demodulation unit ex403, and the servo control unit ex406. The system control unit ex407 is composed of, for example, a microprocessor and executes these processes by running read / write programs.
[0262] In the above explanation, the optical head ex401 was described as emitting a laser spot, but a configuration using near-field light for higher-density recording is also possible.
[0263] Figure 35 shows a schematic diagram of the recording medium ex215, which is an optical disc. Guide grooves are formed in a spiral shape on the recording surface of the recording medium ex215, and address information indicating the absolute position on the disc is recorded in advance on the information track ex230 by changes in the shape of the grooves. This address information includes information for identifying the position of the recording block ex231, which is the unit in which data is recorded, and the recording block can be identified by playing back the information track ex230 and reading the address information in a recording or playback device. The recording medium ex215 also includes a data recording area ex233, an inner circumference area ex232, and an outer circumference area ex234. The data recording area ex233 is the area used to record user data, and the inner circumference area ex232 and outer circumference area ex234, which are located inward or outward from the data recording area ex233, are used for specific purposes other than recording user data. The information playback / recording unit ex400 reads and writes encoded audio data, video data, or multiplexed data obtained by multiplexing these data to the data recording area ex233 of the recording medium ex215.
[0264] The above explanation used single-layer optical discs such as DVDs and Blu-ray discs as examples, but it is not limited to these; it may also be a multi-layer optical disc that can record on surfaces other than the surface. Furthermore, it may be an optical disc with a multi-dimensional recording / playback structure, such as recording information using light of various different wavelengths of color in the same location on the disc, or recording different layers of information from various angles.
[0265] Furthermore, in the digital broadcasting system ex200, it is possible to receive data from satellite ex202, etc., using a vehicle ex210 equipped with antenna ex205, and to play video on a display device such as the car navigation system ex211 located in the vehicle ex210. The configuration of the car navigation system ex211 could be, for example, one of the configurations shown in Figure 33 with the addition of a GPS receiver, and similar configurations could be considered for the computer ex111, mobile phone ex114, etc.
[0266] Figure 36A shows a mobile phone ex114 using the video decoding method and video encoding method described in the above embodiment. The mobile phone ex114 includes an antenna ex350 for transmitting and receiving radio waves with a base station ex110, a camera unit ex365 capable of taking video and still images, and a display unit ex358 such as a liquid crystal display that displays decoded data such as video captured by the camera unit ex365 and video received by the antenna ex350. The mobile phone ex114 further includes a main unit having an operation key unit ex366, an audio output unit ex357 such as a speaker for outputting sound, an audio input unit ex356 such as a microphone for inputting sound, a memory unit ex367 for storing encoded or decoded data such as captured video, still images, recorded audio, or received video, still images, and emails, or a slot unit ex364 which is an interface unit with a recording medium for storing data.
[0267] Furthermore, an example of the configuration of the mobile phone ex114 will be explained using Figure 36B. In the mobile phone ex114, the main control unit ex360 comprehensively controls each part of the main body, which includes the display unit ex358 and the operation key unit ex366. The power supply circuit unit ex361, operation input control unit ex362, video signal processing unit ex355, camera interface unit ex363, LCD (Liquid Crystal Display) control unit ex359, modulation / demodulation unit ex352, multiplexing / decompression unit ex353, audio signal processing unit ex354, slot unit ex364, and memory unit ex367 are all connected to each other via the bus ex370.
[0268] When the user performs an action such as ending a call or turning on the power key, the power supply circuit unit ex361 supplies power from the battery pack to each component, thereby starting up the mobile phone ex114 into an operational state.
[0269] The mobile phone ex114, based on the control of the main control unit ex360 which has a CPU, ROM, RAM, etc., converts the audio signal picked up by the audio input unit ex356 into a digital audio signal in the audio signal processing unit ex354 during voice call mode, performs spread spectrum processing on this in the modulation / demodulation unit ex352, performs digital-to-analog conversion processing and frequency conversion processing in the transmission / reception unit ex351, and then transmits it via the antenna ex350. Also, during voice call mode, the mobile phone ex114 amplifies the received data received via the antenna ex350, performs frequency conversion processing and analog-to-digital conversion processing on it, performs despread spectrum processing in the modulation / demodulation unit ex352, converts it into an analog audio signal in the audio signal processing unit ex354, and then outputs it from the audio output unit ex357.
[0270] Furthermore, when sending an email in data communication mode, the text data of the email entered by operating the operation keys ex366 on the main unit is sent to the main control unit ex360 via the operation input control unit ex362. The main control unit ex360 performs spread spectrum processing on the text data in the modulation / demodulation unit ex352, and after digital-to-analog conversion and frequency conversion processing in the transmission / reception unit ex351, it is transmitted to the base station ex110 via the antenna ex350. When receiving an email, the received data is processed in almost the reverse order and output to the display unit ex358.
[0271] When transmitting video, still images, or video and audio in data communication mode, the video signal processing unit ex355 compresses and encodes the video signal supplied from the camera unit ex365 using the video encoding method shown in each of the above embodiments (i.e., it functions as an image encoding device according to one aspect of the present invention), and sends the encoded video data to the multiplexing / separation unit ex353. The audio signal processing unit ex354 encodes the audio signal picked up by the audio input unit ex356 while the camera unit ex365 is capturing video, still images, etc., and sends the encoded audio data to the multiplexing / separation unit ex353.
[0272] The multiplexing / decompression unit ex353 multiplexes encoded video data supplied from the video signal processing unit ex355 and encoded audio data supplied from the audio signal processing unit ex354 in a predetermined manner. The resulting multiplexed data is then subjected to spread spectrum processing in the modulation / demodulation unit (modulation / demodulation circuit unit) ex352, and after digital-to-analog conversion and frequency conversion processing in the transmission / reception unit ex351, it is transmitted via the antenna ex350.
[0273] When receiving video data linked to a homepage or the like in data communication mode, or when receiving an email with attached video and / or audio, the multiplexing / decomposition unit ex353 separates the multiplexed data received via antenna ex350 into a video data bitstream and an audio data bitstream, and supplies the encoded video data to the video signal processing unit ex355 and the encoded audio data to the audio signal processing unit ex354 via the synchronization bus ex370. The video signal processing unit ex355 decodes the video signal by decoding it using a video decoding method corresponding to the video encoding method shown in each of the above embodiments (i.e., it functions as an image decoding device according to one aspect of the present invention), and the video and still images contained in the video file linked to a homepage are displayed on the display unit ex358 via the LCD control unit ex359. The audio signal processing unit ex354 decodes the audio signal, and the audio is output from the audio output unit ex357.
[0274] Furthermore, terminals such as the mobile phone ex114 mentioned above, like the television ex300, can be implemented in three ways: a transceiver-type terminal with both an encoder and a decoder, a transmitting terminal with only an encoder, and a receiving terminal with only a decoder. In addition, while the digital broadcasting system ex200 was described as receiving and transmitting multiplexed data in which music data etc. is multiplexed with video data, it may also be data in which text data related to the video is multiplexed in addition to audio data, or it may be video data itself instead of multiplexed data.
[0275] Thus, the moving image encoding method or the moving image decoding method shown in each of the above embodiments can be used 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.
[0276] Furthermore, 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.
[0277] (Embodiment 6) 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, VC-1, etc.
[0278] 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.
[0279] 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.
[0280] Figure 37 shows the structure of the multiplexed data. As shown in Figure 37, the multiplexed data is obtained by multiplexing one or more of the following: a video stream, an audio stream, a presentation graphics stream (PG), and an interactive graphics stream. The video stream represents the main and secondary video of a film, the audio stream (IG) represents the main audio portion of a film and the secondary audio mixed with the main audio, and the presentation graphics stream represents the subtitles of a film. Here, the main video refers to the normal video displayed on the screen, and the secondary video refers to the video displayed on a smaller screen within the main video. The interactive graphics stream represents an interactive screen created by placing GUI components on the screen. The video stream is encoded by the video encoding method or apparatus shown in each of the embodiments described above, or by a video encoding method or apparatus compliant with conventional standards such as MPEG-2, MPEG4-AVC, and VC-1. The audio stream is encoded using methods such as Dolby AC-3, Dolby Digital Plus, MLP, DTS, DTS-HD, or Linear PCM.
[0281] Each stream included in the multiplexed data is identified by a PID. For example, the video stream used for movie footage is assigned 0x1011, audio streams are assigned 0x1100 to 0x111F, presentation graphics are assigned 0x1200 to 0x121F, interactive graphics streams are assigned 0x1400 to 0x141F, video streams used for secondary footage in movies are assigned 0x1B00 to 0x1B1F, and audio streams used for secondary audio mixed with the main audio are assigned 0x1A00 to 0x1A1F.
[0282] Figure 38 schematically illustrates how multiplexed data is multiplexed. First, the video stream ex235, consisting of multiple video frames, and the audio stream ex238, consisting of multiple audio frames, are converted into PES packet sequences ex236 and ex239, respectively, and then into TS packets ex237 and ex240. Similarly, the data from the presentation graphics stream ex241 and the interactive graphics stream ex244 are converted into PES packet sequences ex242 and ex245, respectively, and then further into TS packets ex243 and ex246. The multiplexed data ex247 is constructed by multiplexing these TS packets into a single stream.
[0283] Figure 39 shows in more detail how a video stream is stored in a sequence of PES packets. The first row in Figure 39 shows a sequence of video frames in the video stream. The second row shows a sequence of PES packets. As indicated by the arrows yy1, yy2, yy3, and yy4 in Figure 39, the multiple Video Presentation Units in the video stream, namely I-pictures, B-pictures, and P-pictures, are separated picture by picture and stored in the payload of a PES packet. Each PES packet has a PES header, which contains the Presentation Time-Stamp (PTS), which is the time the picture was displayed, and the Decoding Time-Stamp (DTS), which is the time the picture was decoded.
[0284] Figure 40 shows the format of the TS packet that is ultimately written to the multiplexed data. The TS packet is a fixed-length 188-byte packet consisting of a 4-byte TS header containing information such as the PID that identifies the stream, and a 184-byte TS payload that stores the data. The PES packet is split and stored in the TS payload. In the case of BD-ROM, a 4-byte TP_Extra_Header is attached to the TS packet, forming a 192-byte source packet that is written to the multiplexed data. The TP_Extra_Header contains information such as the ATS (Arrival_Time_Stamp). The ATS indicates the start time of forwarding the TS packet to the PID filter of the decoder. As shown in the lower part of Figure 40, the source packets are arranged in the multiplexed data, and the number that increments from the beginning of the multiplexed data is called the SPN (Source Packet Number).
[0285] Furthermore, the TS packets included in the multiplexed data contain not only individual streams such as video, audio, and subtitles, but also PAT (Program Association Table), PMT (Program Map Table), and PCR (Program Clock Reference). The PAT indicates the PID of the PMT used in the multiplexed data, and the PAT itself is registered with a PID of 0. The PMT contains the PIDs of each stream such as video, audio, and subtitles included in the multiplexed data, as well as attribute information of the stream corresponding to each PID, and also contains various descriptors related to the multiplexed data. These descriptors include copy control information that instructs whether to allow or deny copying of the multiplexed data. The PCR contains information about the STC time corresponding to the ATS to which the PCR packet is forwarded to the decoder, in order to synchronize the ATC (Arrival Time Clock), which is the time axis of the ATS, with the STC (System Time Clock), which is the time axis of the PTS / DTS.
[0286] Figure 41 is a diagram illustrating the data structure of a PMT in detail. At the beginning of a PMT is a PMT header that indicates the length of the data contained in the PMT. Following this are multiple descriptors related to the multiplexed data. The copy control information mentioned above is written as a descriptor. After the descriptors are multiple stream information entries for each stream contained in the multiplexed data. The stream information consists of stream descriptors that describe the stream type, the stream's PID, and the stream's attribute information (frame rate, aspect ratio, etc.) to identify the compression codec of the stream. There are as many stream descriptors as there are streams in the multiplexed data.
[0287] When recording to a recording medium, the above-mentioned multiplexed data is recorded together with the multiplexed data information file.
[0288] As shown in Figure 42, the multiplexed data information file is management information for the multiplexed data, has a one-to-one correspondence with the multiplexed data, and consists of multiplexed data information, stream attribute information, and an entry map.
[0289] As shown in Figure 42, the multiplexed data information consists of the system rate, playback start time, and playback end time. The system rate indicates the maximum transfer rate of the multiplexed data to the PID filter of the system target decoder, which will be described later. The interval of the ATS included in the multiplexed data is set to be less than or equal to the system rate. The playback start time is the PTS of the first video frame of the multiplexed data, and the playback end time is set by adding the playback interval of one frame to the PTS of the last video frame of the multiplexed data.
[0290] As shown in Figure 43, attribute information for each stream included in the multiplexed data is registered for each PID. Attribute information differs for video streams, audio streams, presentation graphics streams, and interactive graphics streams. Video stream attribute information includes details such as the compression codec used to compress the video stream, the resolution of each individual picture data constituting the video stream, the aspect ratio, and the frame rate. Audio stream attribute information includes details such as the compression codec used to compress the audio stream, the number of channels included in the audio stream, the languages supported, and the sampling frequency. This information is used for initializing the decoder before playback by the player.
[0291] In this embodiment, the stream type included in the PMT is used from the multiplexed data. Furthermore, if 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 video encoding method or apparatus shown in each embodiment, a step or means is provided to set unique information indicating that the video data was generated by the video encoding method or apparatus shown in each embodiment, for the stream type included in the PMT or the video stream attribute information. This configuration makes it possible to distinguish between video data generated by the video encoding method or apparatus shown in each embodiment and video data conforming to other standards.
[0292] Furthermore, the steps of the video decoding method in this embodiment are shown in Figure 44. In step exS100, the stream type included in the PMT or the video stream attribute information included in the multiplexed data information is obtained from the multiplexed data. Next, in step exS101, it is determined whether the stream type or video stream attribute information indicates that the multiplexed data was generated by the video encoding method or device shown in each of the embodiments described above. If it is determined that the stream type or video stream attribute information was generated by the video encoding method or device shown in each of the embodiments described above, decoding is performed in step exS102 using the video decoding method shown in each of the embodiments described above. If the stream type or video stream attribute information indicates that it conforms to conventional standards such as MPEG-2, MPEG4-AVC, or VC-1, decoding is performed in step exS103 using a video decoding method conforming to the conventional standard.
[0293] In this way, by setting new unique values for the stream type or video stream attribute information, it is possible to determine whether the video can be decoded using the video decoding method or apparatus described in each of the embodiments described above. Therefore, even when multiplexed data conforming to different standards is input, an appropriate decoding method or apparatus can be selected, making it possible to decode without errors. Furthermore, the video encoding method or apparatus, or video decoding method or apparatus, described in this embodiment can be used with any of the devices or systems described above.
[0294] (Embodiment 7) The video encoding method and apparatus, and video decoding method and apparatus described in each of the above embodiments are typically implemented as an integrated circuit (LSI). As an example, Figure 45 shows the configuration of a single-chip LSIex500. The LSIex500 comprises elements ex501, ex502, ex503, ex504, ex505, ex506, ex507, ex508, and ex509, which are described below, and each element is connected via a bus ex510. The power supply circuit ex505 starts up to an operational state by supplying power to each part when the power supply is turned on.
[0295] For example, when performing encoding processing, the LSIex500 receives AV signals from a microphone ex117, camera ex113, etc., via AV I / O ex509, based on the control of the control unit ex501, which has a CPU ex502, memory controller ex503, stream controller ex504, drive frequency control unit ex512, etc. The input AV signals are temporarily stored in an external memory ex511 such as SDRAM. Based on the control of the control unit ex501, the stored data is divided into multiple parts as appropriate depending on the amount of processing and processing speed, and sent to the signal processing unit ex507, where the audio signal encoding and / or video signal encoding are performed. Here, the video signal encoding process is the encoding process described in each of the embodiments above. The signal processing unit ex507 further performs processing such as multiplexing the encoded audio data and encoded video data, and outputs it externally from the stream I / O ex506. This output multiplexed data is transmitted to the base station ex107 or written to the recording medium ex215. When multiplexing, it is recommended to temporarily store the data in buffer ex508 to ensure synchronization.
[0296] Although the memory ex511 was described above as an external component of the LSIex500, it may also be an internal component of the LSIex500. Similarly, the buffer ex508 is not limited to one, but may have multiple buffers. Furthermore, the LSIex500 may be implemented on a single chip or across multiple chips.
[0297] Furthermore, while the above assumes that the control unit ex501 includes a CPU ex502, a memory controller ex503, a stream controller ex504, a drive frequency control unit ex512, etc., the configuration of the control unit ex501 is not limited to this configuration. For example, the signal processing unit ex507 may also have a CPU. By providing a CPU inside the signal processing unit ex507, it becomes possible to further improve the processing speed. Another example is that the CPU ex502 may include the signal processing unit ex507, or a part of the signal processing unit ex507, such as an audio signal processing unit. In such a case, the control unit ex501 will have a configuration that includes the signal processing unit ex507, or a CPU ex502 having a part of it.
[0298] Although we have used the term LSI here, depending on the degree of integration, they may also be called IC, system LSI, super LSI, or ultra LSI.
[0299] Furthermore, the method of integrated circuit implementation is not limited to LSIs; it may also be implemented using dedicated circuits or general-purpose processors. After LSI manufacturing, FPGAs (Field Programmable Gate Arrays) that can be programmed, or reconfigurable processors that allow for the reconfiguration of the connections and settings of circuit cells inside the LSI, may also be used.
[0300] Furthermore, if advancements in semiconductor technology or derivative technologies lead to the emergence of integrated circuit technologies that replace LSIs, then naturally, these technologies can be used to integrate functional blocks. The application of biotechnology, for example, is a possible possibility.
[0301] (Embodiment 8) When decoding video data generated by the video encoding methods or devices described in the above embodiments, the processing load is likely to increase compared to decoding video data conforming to conventional standards such as MPEG-2, MPEG4-AVC, and VC-1. Therefore, in the LSIex500, it is necessary to set the drive frequency of the CPUex502 to a higher frequency than when decoding video data conforming to conventional standards. However, increasing the drive frequency leads to the problem of increased power consumption.
[0302] To solve this problem, video decoding devices such as the TV ex300 and LSI ex500 are configured to identify which standard the video data conforms to and to switch the drive frequency according to the standard. Figure 46 shows the configuration ex800 in this embodiment. The drive frequency switching unit ex803 sets a high drive frequency when the video data is generated by the video encoding method or device shown in each of the above embodiments. It then instructs the decoding processing unit ex801, which executes the video 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 conforming to a conventional standard, the drive frequency is set lower than when the video data is generated by the video encoding method or device shown in each of the above embodiments. It then instructs the decoding processing unit ex802, which conforms to a conventional standard, to decode the video data.
[0303] More specifically, the drive frequency switching unit ex803 consists of the CPU ex502 and the drive frequency control unit ex512 shown in Figure 45. The decoding processing unit ex801, which executes the video decoding method described in each of the above embodiments, and the decoding processing unit ex802, which conforms to conventional standards, correspond to the signal processing unit ex507 in Figure 45. The CPU ex502 identifies which standard the video data conforms to. Based on the signal from the CPU ex502, the drive frequency control unit ex512 sets the drive frequency. The signal processing unit ex507 also decodes the video data based on the signal from the CPU ex502. Here, for example, the identification information described in Embodiment 6 can be used to identify the video data. The identification information is not limited to that described in Embodiment 6; any information that can identify which standard the video data conforms to is acceptable. For example, if 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 on a disc, then such an external signal may be used for identification. Furthermore, the selection of the drive frequency in CPUex502 can be performed based on a lookup table that associates the video data standard with the drive frequency, as shown in Figure 48. The lookup table can be stored in buffer ex508 or the internal memory of the LSI, and CPUex502 can select the drive frequency by referring to this lookup table.
[0304] Figure 47 shows the steps for implementing the method of this embodiment. First, in step exS200, the signal processing unit ex507 obtains identification information from the multiplexed data. Next, in step exS201, the CPU ex502 identifies, based on the identification information, whether or not the video data was generated by the encoding method or device shown in each of the embodiments described above. If the video data was generated by the encoding method or device shown in each of the embodiments described above, in step exS202, the CPU ex502 sends a signal to the drive frequency control unit ex512 to set a higher drive frequency. The drive frequency control unit ex512 then sets the drive frequency to a higher value. On the other hand, if the video data is compliant with conventional standards such as MPEG-2, MPEG4-AVC, or VC-1, in step exS203, the CPU ex502 sends a signal to the drive frequency control unit ex512 to set a lower drive frequency. The drive frequency control unit ex512 then sets the drive frequency to a lower value than when the video data was generated by the encoding method or device shown in each of the embodiments described above.
[0305] Furthermore, by changing the voltage supplied to the LSIex500 or the device containing the LSIex500 in conjunction with the switching of the drive frequency, it is possible to further enhance the power saving effect. For example, when setting a lower drive frequency, it is conceivable to set the voltage supplied to the LSIex500 or the device containing the LSIex500 to a lower value compared to when the drive frequency is set to a higher value.
[0306] Furthermore, the method for setting the drive frequency is not limited to the above-described method; a higher drive frequency is set when the processing load during decoding is large, and a lower drive frequency is set when the processing load during decoding is small. For example, if the processing load for decoding video data compliant with the MPEG4-AVC standard is greater than the processing load for decoding video data generated by the video encoding method or device shown in each of the above embodiments, the drive frequency can be set in the opposite way to the above-described method.
[0307] Furthermore, the method for setting the drive frequency is not limited to a configuration that lowers the drive frequency. For example, if the identification information indicates that the video data was generated by the video encoding method or device shown in each of the above embodiments, the voltage supplied to the LSIex500 or the device including the LSIex500 can be set high. If the identification information indicates that the video data conforms to conventional standards such as MPEG-2, MPEG4-AVC, or VC-1, the voltage supplied to the LSIex500 or the device including the LSIex500 can be set low. Another example is that if the identification information indicates that the video data was generated by the video encoding method or device shown in each of the above embodiments, the CPUex502 can be driven without stopping. If the identification information indicates that the video data conforms to conventional standards such as MPEG-2, MPEG4-AVC, or VC-1, there is processing capacity, so the CPUex502 can be temporarily driven. Even if the identification information indicates that the video data was generated by the video encoding method or device shown in each of the above embodiments, if there is processing capacity, the CPUex502 can be temporarily driven. In this case, it is possible to set a shorter stop time compared to when indicating that the video data conforms to conventional standards such as MPEG-2, MPEG4-AVC, and VC-1.
[0308] In this way, power saving can be achieved by switching the drive frequency according to the standard to which the video data conforms. Furthermore, if the LSIex500 or a device containing the LSIex500 is powered by batteries, the battery life can be extended as a result of the power saving.
[0309] (Embodiment 9) Televisions, mobile phones, and other devices and systems mentioned above may receive multiple video data streams conforming to different standards. To enable decoding of these streams, the LSIex500's signal processing unit, ex507, needs to support multiple standards. However, using separate ex507 signal processing units for each standard would increase the circuit size and cost of the LSIex500.
[0310] To solve this problem, the decoding processing unit for executing the video decoding method shown in each of the above embodiments is partially shared with the decoding processing unit conforming to conventional standards such as MPEG-2, MPEG4-AVC, and VC-1. An example of this configuration is shown in ex900 of Figure 49A. For example, the video decoding method shown in each of the above embodiments and the video decoding method conforming to the MPEG4-AVC standard have some common processing content in processes such as entropy coding, inverse quantization, deblocking filter, and motion compensation. For common processing content, a decoding processing unit ex902 corresponding to the MPEG4-AVC standard is shared, and for other processing content specific to one aspect of the present invention that does not correspond 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 motion compensation, for example, a dedicated decoding processing unit ex901 is used for motion compensation, and the decoding processing unit is shared for any or all of the other processes such as entropy coding, deblocking filter, and inverse quantization. Regarding the sharing of the decoding processing unit, a configuration may be used in which the decoding processing unit for executing the video decoding method shown in each of the above embodiments is shared for common processing content, and a dedicated decoding processing unit is used for processing content specific to the MPEG4-AVC standard.
[0311] Furthermore, another example of partially sharing processing is shown in ex1000 of Figure 49B. In this example, a dedicated decoding processing unit ex1001 corresponding to processing content specific to one aspect of the present invention, a dedicated decoding processing unit ex1002 corresponding to processing content specific to other conventional standards, and a shared decoding processing unit ex1003 corresponding to processing content common to the video decoding method according to one aspect of the present invention and the video decoding method of other conventional standards are used. Here, the dedicated decoding processing units ex1001 and ex1002 are not necessarily specialized for processing content specific to one aspect of the present invention or other conventional standards, but may be capable of executing other general-purpose processing. It is also possible to implement the configuration of this embodiment using LSIex500.
[0312] Thus, by sharing the decoding processing unit for common processing content between the video decoding method according to one aspect of the present invention and the conventional video decoding method, it is possible to reduce the circuit size of the LSI and lower costs. [Industrial applicability]
[0313] The video encoding and decoding methods according to the present invention can be applied to any multimedia data, improve error tolerance in video encoding and decoding, and are useful as video encoding and decoding methods in storage, transmission, and communication using, for example, mobile phones, DVD players, and personal computers. [Explanation of Symbols]
[0314] 100, 200 video encoding device 101 Subtraction Unit 102 Orthogonal Transformation Unit 103 Quantization section 104, 302 Inverse quantization section 105, 303 Inverse orthogonal transformation section 106, 304 Addition section 107, 305 block memory 108,306 frame memory 109, 307 Intra Prediction Unit 110, 308 Interpretation Unit 111, 309 Interpretation Control Unit 112 Picture Type Determination Section 113, 310 switches 114, 311 Predicted motion vector candidate calculation unit 115,312 colPic memory 116 Variable-length coding unit 210, 410 Predicted motion vector candidate derivation unit 211, 411 Decision Section 212, 412 1st derivation part 213, 413 Specific part 214, 414 Judgment section 215, 415 2nd derivation 220, 430 Prediction Control Unit 230 Encoding section 300, 400 video decoding devices 301 Variable-length decoding unit 420 Decoding Unit
Claims
1. A video encoding method for encoding a block to be encoded, Based on the first motion vector used to encode the first block, a first candidate having the first predicted motion vector is derived. Determine whether the number of candidates, including the first candidate, is less than the maximum number of candidates. If the number of candidates, including the first candidate, is less than the maximum number of candidates, a second candidate having a second predicted motion vector is derived. Encode the index corresponding to the candidate with the predicted motion vector, The aforementioned candidate is one of a plurality of candidates, including the first candidate and the second candidate. The aforementioned maximum number of candidates is the same for all blocks included in the slice. Video encoding method.
2. The maximum number of candidates is 5. The video encoding method according to claim 1.
3. The index is encoded using the maximum number of candidates. The video encoding method according to claim 1.
4. The derivation of the first candidate includes deriving multiple first candidates, The video encoding method further includes removing redundant candidates from the plurality of first candidates before the determination. The video encoding method according to claim 1.
5. The derivation of the first candidate includes deriving multiple first candidates, The video encoding method further includes removing unavailable candidates from the plurality of first candidates before the determination. The video encoding method according to claim 1.
6. A video encoding device for encoding blocks to be encoded, A first derivator that derives a first candidate having a first predicted motion vector based on a first motion vector used to encode the first block, A determination device that determines whether the number of one or more candidates, including the first candidate, is less than the maximum number of candidates, A second derivator that derives a second candidate having a second predicted motion vector when the number of one or more candidates, including the first candidate, is smaller than the maximum number of candidates, The system comprises an encoder that encodes an index corresponding to a candidate having a predicted motion vector, wherein the candidate is one of a plurality of candidates, including the first candidate and the second candidate. The aforementioned maximum number of candidates is the same for all blocks included in the slice. Video encoding device.