Image encoding device and image encoding method, and image decoding device and image decoding method

By implementing a merge candidate construction and selection mechanism, the technique addresses high processing loads in image encoding, achieving efficient and low-load image encoding and decoding with improved handling of deformations.

JP2025113380AActive Publication Date: 2025-08-01GODO KAISHA IP BRIDGE 1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2025084649
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-03-08
Filing Date
2025-05-21
Publication Date
2025-08-01
Estimated Expiration
2040-03-06

AI Technical Summary

Technical Problem

Existing image encoding techniques, such as those described in Patent Document 1, suffer from high processing loads due to image conversion, which hinders efficient encoding and decoding of images with deformations like enlargement, reduction, and rotation.

Method used

The proposed technique introduces a merge candidate construction unit, normal and triangular merge candidate selection units, and a first triangular merge candidate selection unit to optimize image encoding by reducing processing load while maintaining high efficiency, utilizing spatial and temporal merge candidates within a merge candidate list.

Benefits of technology

This approach enables highly efficient image encoding and decoding with reduced processing load, allowing for effective handling of image deformations through optimized block division and prediction modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025113380000001_ABST
    Figure 2025113380000001_ABST
Patent Text Reader

Abstract

To provide a low-load and efficient encoding technique.SOLUTION: An image encoding device according to the present invention is provided with a merge candidate construction unit that constructs a merge candidate list including a maximum number of merge candidates including spatial merge candidates, a normal merge candidate selection unit that selects a normal merge candidate that is uni-predictive or bi-predictive from the merge candidate list on the basis of a merge index, and a triangular merge candidate selection unit that selects a first triangular merge candidate that is uni-predictive from the merge candidate list on the basis of a first triangular merge index and selects a second triangular merge candidate that is uni-predictive on the basis of a second triangular merge index, and the first maximum number of triangle merge candidates for the first triangle merge index is equal to the maximum number of merge candidates.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an image encoding and decoding technique for dividing an image into blocks and performing prediction.

Background Art

[0002] In image encoding and decoding, the image to be processed is divided into blocks that are sets of a predetermined number of pixels, and processing is performed in units of blocks. By appropriately dividing into blocks and appropriately setting intra-prediction (intra-frame prediction) and inter-prediction (inter-frame prediction), the encoding efficiency is improved.

[0003] In the encoding and decoding of moving images, the encoding efficiency is improved by inter-prediction that predicts from the encoded and decoded pictures. Patent Document 1 describes a technique of applying an affine transformation during inter-prediction. In moving images, it is not uncommon for an object to undergo deformations such as enlargement, reduction, and rotation. By applying the technique of Patent Document 1, efficient encoding becomes possible.

Prior Art Documents

Patent Documents

[0004]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0005] However, since the technique of Patent Document 1 involves image conversion, there is a problem that the processing load is extremely large. In view of the above problems, the present invention provides an encoding technique with low load and high efficiency.

Means for Solving the Problems

[0006] In one aspect of the present invention for solving the above problems, a merge candidate construction unit that constructs a merge candidate list including merge candidates with the maximum number of merge candidates including spatial merge candidates, a normal merge candidate selection unit that selects normal merge candidates that are single prediction or double prediction from the merge candidate list based on a merge index, and a first triangular merge candidate that is single prediction from the merge candidate list based on a first triangular merge index A triangular merge candidate selection unit that selects a candidate and selects a second triangular merge candidate that is single prediction based on a second triangular merge index, wherein a first maximum triangular merge candidate number related to the first triangular merge index is the same as the maximum number of merge candidates.

Advantages of the Invention

[0007] According to the present invention, highly efficient image encoding / decoding processing can be realized with a low load.

Brief Description of the Drawings

[0008]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6A

Figure 6B

Figure 6C

Figure 6D

Figure 6E

Figure 7

Figure 8

Figure 9

Figure 10A

Figure 10B

Figure 11

Figure 12A

Figure 12B

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Figure 18

Figure 19

Figure 20

Figure 21

Figure 22

Figure 23

Figure 24

Figure 25

Figure 26

Figure 27

Figure 28

Figure 29

Figure 30

Figure 31A

Figure 31B

Figure 31C

Figure 32

Figure 33

Figure 34

Figure 35

Figure 36

Figure 37

Figure 38A

Figure 38B

Figure 39

Figure 40

Figure 41

Figure 42

Figure 43A

Figure 43B

Figure 44

Figure 45

Figure 46A

Figure 46B

[0009] Define the technologies and technical terms used in this embodiment.

[0010] <Tree block> In the embodiment, the image to be encoded / decoded is evenly divided into units of a predetermined size. This unit is defined as a tree block. In FIG. 4, the size of the tree block is 128×128 pixels, but the size of the tree block is not limited to this, and any size may be set. The tree blocks to be processed (corresponding to the blocks to be encoded in the encoding process and the blocks to be decoded in the decoding process) are switched in raster scan order, that is, from left to right and from top to bottom. The inside of each tree block can be further recursively divided. After recursively dividing the tree block, the block to be encoded / decoded is defined as an encoding block. Also, the tree block and the encoding block are collectively defined as a block. By performing appropriate block division, efficient encoding becomes possible. The size of the tree block can be a fixed value determined in advance by the encoding device and the decoding device, or a configuration can be adopted in which the size of the tree block determined by the encoding device is transmitted to the decoding device. Here, the maximum size of the tree block is 128×128 pixels, and the minimum size of the tree block is 16×16 pixels. Also, the maximum size of the encoding block is 64×64 pixels, and the minimum size of the encoding block is 4×4 pixels.

[0011] <Prediction mode> Switch between intra prediction (MODE_INTRA) that performs prediction from the processed image signal of the image to be processed in units of the encoding block to be processed, and inter prediction (MODE_INTER) that performs prediction from the image signal of the processed image. The processed image is used for an image obtained by decoding a signal for which encoding has been completed, an image signal, a tree block, a block, an encoded block, etc. in the encoding process, and for an image, an image signal, a tree block, a block, an encoded block, etc. for which decoding has been completed in the decoding process. A mode for identifying this intra prediction (MODE_INTRA) and inter prediction (MODE_INTER) is defined as a prediction mode (PredMode). The prediction mode (PredMode) has intra prediction (MODE_INTRA) or inter prediction (MODE_INTER) as its value.

[0012] <Inter prediction> In inter prediction that performs prediction from the image signal of the processed image, a plurality of processed images can be used as reference pictures. To manage the plurality of reference pictures, two types of reference lists, L0 (reference list 0) and L1 (reference list 1), are defined, and the reference pictures are specified using respective reference indices. In a P slice, L0 prediction (Pred_L0) is available. In a B slice, L0 prediction (Pred_L0), L1 prediction (Pred_L1), and bi-prediction (Pred_BI) are available. L0 prediction (Pred_L0) is an inter prediction that refers to the reference picture managed by L0, and L1 prediction (Pred_L1) is an inter prediction that refers to the reference picture managed by L1. Bi-prediction (Pred_BI) is an inter prediction in which both L0 prediction and L1 prediction are performed, and refers to one reference picture managed by each of L0 and L1. Information for specifying L0 prediction, L1 prediction, and bi-prediction is defined as an inter prediction mode. For constants and variables with a subscript LX attached to the output in the subsequent processing, it is assumed that the processing is performed for each of L0 and L1.

[0013] <Prediction motion vector mode> The predictive motion vector mode is a mode that transmits an index for specifying a predictive motion vector, a differential motion vector, an inter prediction mode, and a reference index, and determines the inter prediction information of a processing target block. The predictive motion vector is derived from a predictive motion vector candidate derived from a processed block adjacent to the processing target block or a block located at the same position or in the vicinity (neighborhood) of the processing target block among blocks belonging to the processed image, and an index for specifying the predictive motion vector.

[0014] <Merge mode> The merge mode is a mode that derives the inter prediction information of a processing target block from the inter prediction information of a processed block adjacent to the processing target block or a block located at the same position or in the vicinity (neighborhood) of the processing target block among blocks belonging to the processed image, without transmitting a differential motion vector and a reference index.

[0015] A processed block adjacent to the processing target block and the inter prediction information of the processed block are defined as spatial merge candidates. A block located at the same position or in the vicinity (neighborhood) of the processing target block among blocks belonging to the processed image and the inter prediction information derived from the inter prediction information of the block are defined as temporal merge candidates. Each merge candidate is registered in a merge candidate list, and a merge candidate used for prediction of the processing target block is specified by a merge index.

[0016] <Adjacent block> FIG. 11 is a diagram for explaining reference blocks referred to for deriving inter prediction information in the predictive motion vector mode and the merge mode. A0, A1, A2, B0, B1, B2, B3 are processed blocks adjacent to the processing target block. T0 is a block belonging to the processed image and located at the same position or in the vicinity (neighborhood) of the processing target block in the processing target image.

[0017] A1 and A2 are blocks located on the left side of the encoding block to be processed and adjacent to the encoding block to be processed. B1 and B3 are blocks located above the encoding block to be processed and adjacent to the encoding block to be processed. A0, B0, and B2 are blocks located at the lower left, upper right, and upper left of the encoding block to be processed, respectively.

[0018] Details on how to handle adjacent blocks in the predictive motion vector mode and merge mode will be described later.

[0019] <Affine Transform Motion Compensation> Affine transform motion compensation divides an encoding block into sub-blocks of a predetermined unit, and determines a motion vector for each divided sub-block to perform motion compensation. The motion vector of each sub-block is derived based on one or more control points derived from inter-prediction information of a processed block adjacent to the block to be processed or a block located at the same position or in the vicinity (neighborhood) of the block to be processed and belonging to the processed image. In the present embodiment, the size of the sub-block is 4x4 pixels, but the size of the sub-block is not limited to this, and a motion vector may be derived in pixel units.

[0020] FIG. 14 shows an example of affine transform motion compensation when there are two control points. In this case, the two control points have two parameters for the horizontal direction component and the vertical direction component. Therefore, the affine transform when there are two control points is called a four-parameter affine transform. CP1 and CP2 in FIG. 14 are control points. FIG. 15 shows an example of affine transform motion compensation when there are three control points. In this case, the three control points have two parameters for the horizontal direction component and the vertical direction component. Therefore, the affine transform when there are three control points is called a six-parameter affine transform. CP1, CP2, and CP3 in FIG. 15 are control points.

[0021] Affine transform motion compensation can be used in either the predictive motion vector mode or the merge mode. The mode in which affine transform motion compensation is applied in the predictive motion vector mode is defined as the sub-block predictive motion vector mode, and the mode in which affine transform motion compensation is applied in the merge mode is defined as the sub-block merge mode.

[0022] <Syntax of Encoded Block> Using FIGS. 12A, 12B, and 13, the syntax for expressing the prediction mode of an encoded block will be described. The pred_mode_flag in FIG. 12A is a flag indicating whether it is inter prediction or not. If pred_mode_flag is 0, it is inter prediction, and if pred_mode_flag is 1, it is intra prediction. In the case of intra prediction, the intra prediction information intra_pred_mode is sent, and in the case of inter prediction, the merge_flag is sent. The merge_flag is a flag indicating whether to use the merge mode or the predictive motion vector mode. In the case of the predictive motion vector mode (merge_flag = 0), a flag inter_affine_flag indicating whether to apply the sub-block predictive motion vector mode is sent. When applying the sub-block predictive motion vector mode (inter_affine_flag = 1), the cu_affine_type_flag is sent. The cu_affine_type_flag is a flag for determining the number of control points in the sub-block predictive motion vector mode. On one hand, in the case of merge mode (merge_flag = 1), send merge_subblock_flag in Fig. 12B. merge_subblock_flag is a flag indicating whether to apply sub-block merge mode. In the case of sub-block merge mode (merge_subblock_flag = 1), send merge index merge_subblock_idx. On the other hand, in the case where the sub-block merge mode is not applicable (merge_subblock_flag = 0), send a flag merge_triangle_flag indicating whether to apply triangle merge mode. In the case of applying triangle merge mode (merge_triangle_flag = 1), send the direction merge_triangle_split_dir to divide the block, and merge triangle indices merge_triangle_idx0, merge_triangle_idx1 for each of the two partitions after division. On the other hand, in the case of not applying triangle merge mode (merge_triangle_flag = 0), send merge index merge_idx. Fig. 13 shows the values of each syntax element and the corresponding prediction mode. merge_flag = 0, inter_affine_flag = 0 corresponds to the normal prediction motion vector mode (Inter Pred Mode). merge_flag = 0, inter_affine_flag = 1 corresponds to the sub-block prediction motion vector mode (Inter Affine Mode). merge_flag = 1, merge_subblock_flag = 0, merge_trianlge_flag = 0 corresponds to the normal merge mode (Merge Mode). merge_flag = 1, merge_subblock_flag = 0, merge_trianlge_flag = 1 corresponds to the triangle merge mode (Triangle Merge Mode). merge_flag = 1, merge_subblock_flag = 1 corresponds to the sub-block merge mode (Affine Merge Mode).

[0023] <poc> POC (Picture Order Count) is a variable associated with the picture to be encoded, and a value that increases by 1 according to the output order of the picture is set. By the value of POC, it is possible to determine whether it is the same picture, determine the order relationship between pictures in the output order, and derive the distance between pictures. For example, when the POCs of two pictures have the same value, it can be determined that they are the same picture. When the POCs of two pictures have different values, it can be determined that the picture with the smaller POC value is the picture that is output first, and the difference between the POCs of the two pictures indicates the distance between the pictures in the time axis direction.

[0024] (First Embodiment) The image encoding apparatus 100 and the image decoding apparatus 200 according to the first embodiment of the present invention will be described.

[0025] FIG. 1 is a block diagram of the image encoding apparatus 100 according to the first embodiment. The image encoding apparatus 100 of the embodiment includes a block division unit 101, an inter prediction unit 102, an intra prediction unit 103, a decoded image memory 104, a prediction method determination unit 105, a residual generation unit 106, an orthogonal transformation / quantization unit 107, a bit string encoding unit 108, an inverse quantization / inverse orthogonal transformation unit 109, a decoded image signal superposition unit 110, and an encoded information storage memory 111.

[0026] The block division unit 101 recursively divides the input image to generate encoded blocks. The block division unit 101 includes a four-division unit that divides the block to be divided in the horizontal and vertical directions respectively, and a 2-3 division unit that divides the block to be divided in either the horizontal or vertical direction. The block division unit 101 uses the generated encoded block as a processing target encoded block, and supplies the image signal of the processing target encoded block to the inter prediction unit 102, the intra prediction unit 103, and the residual generation unit 106. Further, the block division unit 101 supplies information indicating the determined recursive division structure to the bit string encoding unit 108. The detailed operation of the block division unit 101 will be described later.

[0027] The inter prediction unit 102 performs inter prediction on the coding block to be processed. The inter prediction unit 102 derives a plurality of candidate inter prediction information from the inter prediction information stored in the coding information storage memory 111 and the decoded image signal stored in the decoded image memory 104, selects a suitable inter prediction mode from among the derived plurality of candidates, and supplies the selected inter prediction mode and the prediction image signal corresponding to the selected inter prediction mode to the prediction method determination unit 105. The detailed configuration and operation of the inter prediction unit 102 will be described later.

[0028] The intra prediction unit 103 performs intra prediction on the coding block to be processed. The intra prediction unit 103 refers to the decoded image signal stored in the decoded image memory 104 as a reference pixel, and generates a prediction image signal by intra prediction based on coding information such as the intra prediction mode stored in the coding information storage memory 111. In intra prediction, the intra prediction unit 103 selects a suitable intra prediction mode from among a plurality of intra prediction modes, and supplies the selected intra prediction mode and the prediction image signal corresponding to the selected intra prediction mode to the prediction method determination unit 105. Examples of intra prediction are shown in FIGS. 10A and 10B. FIG. 10A shows the correspondence between the prediction direction of intra prediction and the intra prediction mode number. For example, in intra prediction mode 50, an intra prediction image is generated by copying reference pixels in the vertical direction. Intra prediction mode 1 is the DC mode, in which the pixel values of all the blocks to be processed are set to the average value of the reference pixels. Intra prediction mode 0 is the Planar mode, in which a two-dimensional intra prediction image is created from reference pixels in the vertical and horizontal directions. FIG. 10B is an example of generating an intra prediction image in the case of intra prediction mode 40. The intra prediction unit 103 copies the value of the reference pixel in the direction indicated by the intra prediction mode for each pixel of the block to be processed. When the reference pixel of the intra prediction mode is not at an integer position, the intra prediction unit 103 determines the reference pixel value by interpolation from the reference pixel values at the surrounding integer positions.

[0029] The decoded image memory 104 stores the decoded image generated by the decoded image signal superposition unit 110. The decoded image memory 104 supplies the stored decoded image to the inter prediction unit 102 and the intra prediction unit 103.

[0030] The prediction method determination unit 105 determines the optimal prediction mode by evaluating each of the intra prediction and the inter prediction using the encoded information, the coded amount of the residual, the distortion amount between the predicted image signal and the image signal to be processed, etc. In the case of intra prediction, the prediction method determination unit 105 supplies intra prediction information such as the intra prediction mode as encoded information to the bit sequence encoding unit 108. In the case of the merge mode of inter prediction, the prediction method determination unit 105 supplies inter prediction information such as the merge index and the information indicating whether it is a sub-block merge mode (sub-block merge flag) as encoded information to the bit sequence encoding unit 108. In the case of the predicted motion vector mode of inter prediction, the prediction method determination unit 105 supplies inter prediction information such as the inter prediction mode, the predicted motion vector index, the reference indexes of L0 and L1, the differential motion vector, and the information indicating whether it is a sub-block predicted motion vector mode (sub-block predicted motion vector flag) as encoded information to the bit sequence encoding unit 108. Further, the prediction method determination unit 105 supplies the determined encoded information to the encoded information storage memory 111. The prediction method determination unit 105 supplies the residual generation unit 106 and the predicted image signal to the decoded image signal superposition unit 110.

[0031] The residual generation unit 106 generates a residual by subtracting the predicted image signal from the image signal to be processed, and supplies it to the orthogonal transform / quantization unit 107.

[0032] The orthogonal transform / quantization unit 107 performs orthogonal transform and quantization on the residual according to the quantization parameter to generate an orthogonally transformed / quantized residual, and supplies the generated residual to the bit sequence encoding unit 108 and the inverse quantization / inverse orthogonal transform unit 109.

[0033] The bit sequence encoding unit 108 encodes encoding information corresponding to the prediction method determined by the prediction method determination unit 105 for each encoding block, in addition to information in units of sequence, picture, slice, and encoding block. Specifically, the bit sequence encoding unit 108 encodes the prediction mode PredMode for each encoding block. When the prediction mode is inter prediction (MODE_INTER), the bit sequence encoding unit 108 discriminates whether it is the merge mode or not, a sub-block merge flag, the merge index in the case of the merge mode, the inter prediction mode in the case of not the merge mode, the prediction motion vector index, information regarding the differential motion vector, the sub-block prediction motion vector flag, etc. (inter prediction information) according to the specified syntax (the syntax rule of the bit sequence) to generate a first bit sequence. When the prediction mode is intra prediction (MODE_INTRA), it encodes encoding information such as the intra prediction mode (intra prediction information) according to the specified syntax (the syntax rule of the bit sequence) to generate a first bit sequence. Also, the bit sequence encoding unit 108 entropy-encodes the orthogonally transformed and quantized residuals according to the specified syntax to generate a second bit sequence. The bit sequence encoding unit 108 multiplexes the first bit sequence and the second bit sequence according to the specified syntax and outputs a bit stream.

[0034] The inverse quantization and inverse orthogonal transformation unit 109 inverse quantizes and inverse orthogonally transforms the orthogonally transformed and quantized residuals supplied from the orthogonal transformation and quantization unit 107 to calculate the residuals, and supplies the calculated residuals to the decoded image signal superposition unit 110.

[0035] The decoded image signal superposition unit 110 superimposes the predicted image signal according to the determination by the prediction method determination unit 105 and the residuals inverse quantized and inverse orthogonally transformed by the inverse quantization and inverse orthogonal transformation unit 109 to generate a decoded image, and stores it in the decoded image memory 104. Note that the decoded image signal superposition unit 110 may perform filtering processing to reduce distortion such as block distortion due to encoding on the decoded image and then store it in the decoded image memory 104.

[0036] The coded information storage memory 111 stores coded information such as the prediction mode (inter prediction or intra prediction) determined by the prediction method determination unit 105. In the case of inter prediction, the coded information stored in the coded information storage memory 111 includes inter prediction information such as the determined motion vector, the reference indexes of the reference lists L0 and L1, and the historical prediction motion vector candidate list. In the case of the merge mode of inter prediction, the coded information stored in the coded information storage memory 111 includes, in addition to the above-mentioned respective information, inter prediction information such as the merge index and information indicating whether it is a sub-block merge mode (sub-block merge flag). In the case of the predicted motion vector mode of inter prediction, the coded information stored in the coded information storage memory 111 includes, in addition to the above-mentioned respective information, inter prediction information such as the inter prediction mode, the predicted motion vector index, the differential motion vector, and information indicating whether it is a sub-block predicted motion vector mode (sub-block predicted motion vector flag). In the case of intra prediction, the coded information stored in the coded information storage memory 111 includes intra prediction information such as the determined intra prediction mode.

[0037] FIG. 2 is a block diagram showing the configuration of an image decoding apparatus according to an embodiment of the present invention corresponding to the image encoding apparatus of FIG. 1. The image decoding apparatus of the embodiment includes a bit string decoding unit 201, a block division unit 202, an inter prediction unit 203, an intra prediction unit 204, a coded information storage memory 205, an inverse quantization / inverse orthogonal transformation unit 206, a decoded image signal superimposing unit 207, and a decoded image memory 208.

[0038] Since the decoding process of the image decoding apparatus of FIG. 2 corresponds to the decoding process provided inside the image encoding apparatus of FIG. 1, each configuration of the coded information storage memory 205, the inverse quantization / inverse orthogonal transformation unit 206, the decoded image signal superimposing unit 207, and the decoded image memory 208 in FIG. 2 has functions corresponding to the respective configurations of the coded information storage memory 111, the inverse quantization / inverse orthogonal transformation unit 109, the decoded image signal superimposing unit 110, and the decoded image memory 104 of the image encoding apparatus of FIG. 1.

[0039] The bit stream supplied to the bit sequence decoding unit 201 is separated according to the rules of a prescribed syntax. The bit sequence decoding unit 201 decodes the separated first bit sequence to obtain information on sequences, pictures, slices, coding block units, and coding information of coding block units. Specifically, the bit sequence decoding unit 201 decodes a prediction mode PredMode that determines whether it is an inter prediction (MODE_INTER) or an intra prediction (MODE_INTRA) in coding block units. When the prediction mode is an inter prediction (MODE_INTER), the bit sequence decoding unit 201 decodes coding information (inter prediction information) regarding a flag that determines whether it is a merge mode, a merge index in the case of the merge mode, a sub-block merge flag, an inter prediction mode in the case of a prediction motion vector mode, a prediction motion vector index, a differential motion vector, a sub-block prediction motion vector flag, etc., according to the prescribed syntax, and supplies the coding information (inter prediction information) to the coding information storage memory 205 via the inter prediction unit 203 and the block division unit 202. When the prediction mode is an intra prediction (MODE_INTRA), it decodes coding information (intra prediction information) such as the intra prediction mode according to the prescribed syntax, and supplies the coding information (intra prediction information) to the coding information storage memory 205 via the inter prediction unit 203 or the intra prediction unit 204 and the block division unit 202. The bit sequence decoding unit 201 decodes the separated second bit sequence to calculate an orthogonally transformed and quantized residual, and supplies the orthogonally transformed and quantized residual to the inverse quantization and inverse orthogonal transformation unit 206.

[0040] When the prediction mode PredMode of the encoding block to be processed is the inter prediction (MODE_INTER) and the prediction motion vector mode, the inter prediction unit 203 uses the encoding information of the already decoded image signal stored in the encoding information storage memory 205 to derive a plurality of candidate prediction motion vectors, and registers the derived plurality of candidate prediction motion vectors in a prediction motion vector candidate list described later. The inter prediction unit 203 selects a prediction motion vector corresponding to the prediction motion vector index decoded and supplied by the bit string decoding unit 201 from among the plurality of candidate prediction motion vectors registered in the prediction motion vector candidate list, calculates a motion vector from the differential motion vector decoded by the bit string decoding unit 201 and the selected prediction motion vector, and stores the calculated motion vector in the encoding information storage memory 205 together with other encoding information. Here, the encoding information of the encoding block to be supplied and stored includes flags predFlagL0[xP][yP], predFlagL1[xP][yP] indicating whether to use L0 prediction and L1 prediction, reference indexes refIdxL0[xP][yP], refIdxL1[xP][yP] of L0 and L1, motion vectors mvL0[xP][yP], mvL1[xP][yP] of L0 and L1, etc. Here, xP and yP are indexes indicating the position of the upper left pixel of the encoding block within the picture. When the prediction mode PredMode is inter prediction (MODE_INTER) and the inter prediction mode is L0 prediction (Pred_L0), the flag predFlagL0 indicating whether to use L0 prediction is 1, and the flag predFlagL1 indicating whether to use L1 prediction is 0. When the inter prediction mode is L1 prediction (Pred_L1), the flag predFlagL0 indicating whether to use L0 prediction is 0, and the flag predFlagL1 indicating whether to use L1 prediction is 1. When the inter prediction mode is bi-prediction (Pred_BI), both the flag predFlagL0 indicating whether to use L0 prediction and the flag predFlagL1 indicating whether to use L1 prediction are 1. Further, when the prediction mode PredMode of the encoding block to be processed is inter prediction (MODE_INTER) and in the merge mode, merge candidates are derived.Using the encoded information of the already decoded encoded blocks stored in the symbolized information storage memory 205, a plurality of merge candidates are derived and registered in a merge candidate list described later. A merge candidate corresponding to the merge index decoded and supplied by the bit string decoding unit 201 is selected from among the plurality of merge candidates registered in the merge candidate list, and the flags predFlagL0[xP][yP] and predFlagL1[xP][yP] indicating whether to use the L0 prediction and L1 prediction of the selected merge candidate, the reference indexes refIdxL0[xP][yP] and refIdxL1[xP][yP] of L0 and L1, and the inter prediction information such as the motion vectors mvL0[xP][yP] and mvL1[xP][yP] of L0 and L1 are stored in the encoded information storage memory 205. Here, xP and yP are indexes indicating the position of the upper left pixel of the encoded block within the picture. The detailed configuration and operation of the inter prediction unit 203 will be described later.

[0041] The intra prediction unit 204 performs intra prediction when the prediction mode PredMode of the encoded block to be processed is intra prediction (MODE_INTRA). The encoded information decoded by the bit string decoding unit 201 includes the intra prediction mode. The intra prediction unit 204 generates a predicted image signal by intra prediction from the decoded image signal stored in the decoded image memory 208 according to the intra prediction mode included in the encoded information decoded by the bit string decoding unit 201, and supplies the generated predicted image signal to the decoded image signal superposition unit 207. Since the intra prediction unit 204 corresponds to the intra prediction unit 103 of the image encoding apparatus 100, it performs the same processing as the intra prediction unit 103.

[0042] The inverse quantization and inverse orthogonal transformation unit 206 performs inverse orthogonal transformation and inverse quantization on the orthogonal transformation and quantized residuals decoded by the bit string decoding unit 201 to obtain the inverse orthogonal transformation and inverse quantized residuals.

[0043] The decoded image signal superposition unit 207 superimposes the predicted image signal predicted by the inter prediction unit 203 or the predicted image signal predicted by the intra prediction unit 204, and the residual obtained by inverse orthogonal transformation and inverse quantization by the inverse quantization and inverse orthogonal transformation unit 206, thereby decoding the decoded image signal and storing the decoded decoded image signal in the decoded image memory 208. When storing in the decoded image memory 208, the decoded image signal superposition unit 207 may perform filtering processing to reduce block distortion or the like due to encoding on the decoded image, and then store it in the decoded image memory 208.

[0044] Next, the operation of the block division unit 101 in the image encoding apparatus 100 will be described. FIG. 3 is a flowchart showing an operation of dividing an image into tree blocks and further dividing each tree block. First, the input image is divided into tree blocks of a predetermined size (step S1001). For each tree block, it is scanned in a predetermined order, that is, in raster scan order (step S1002), and the inside of the tree block to be processed is divided (step S1003).

[0045] FIG. 7 is a flowchart showing the detailed operation of the division process in step S1003. First, it is determined whether to divide the block to be processed into four (step S1101).

[0046] If it is determined to divide the block to be processed into four, the block to be processed is divided into four (step S1102). For each block obtained by dividing the block to be processed, scanning is performed in the Z scan order, that is, in the order of upper left, upper right, lower left, and lower right (step S1103). FIG. 5 is an example of the Z scan order, and 601 in FIG. 6A is an example of dividing the block to be processed into four. The numbers 0 to 3 in 601 of FIG. 6A indicate the order of processing. Then, for each block divided in step S1101, the division process of FIG. 7 is recursively executed (step S1104).

[0047] If it is determined not to divide the block to be processed into four, 2-3 division is performed (step S1105).

[0048] Figure 8 is a flowchart showing the detailed operation of the 2-3 splitting process in step S1105. First, it is determined whether to perform 2-3 splitting on the block to be processed, that is, whether to perform either 2-way splitting or 3-way splitting (step S1201).

[0049] If it is determined not to perform 2-3 splitting on the block to be processed, that is, if it is determined not to split, the splitting is terminated (step S1211). That is, no further recursive splitting process is performed on the blocks split by the recursive splitting process.

[0050] If it is determined to perform 2-3 splitting on the block to be processed, it is further determined whether to perform 2-way splitting on the block to be processed (step S1202).

[0051] If it is determined to perform 2-way splitting on the block to be processed, it is determined whether to split the block to be processed vertically (step S1203). Based on the result, the block to be processed is split vertically into two parts (step S1204) or horizontally into two parts (step S1205). As a result of step S1204, the block to be processed is split vertically into two parts as shown in 602 of FIG. 6B, and as a result of step S1205, the block to be processed is split horizontally into two parts as shown in 604 of FIG. 6D.

[0052] In step S1202, if it is not determined to perform 2-way splitting on the block to be processed, that is, if it is determined to perform 3-way splitting, it is determined whether to split the block to be processed into upper, middle, and lower parts vertically (step S1206). Based on the result, the block to be processed is split into upper, middle, and lower parts vertically (step S1207) or into left, middle, and right parts horizontally (step S1208). As a result of step S1207, the block to be processed is split into upper, middle, and lower parts vertically as shown in 603 of FIG. 6C, and as a result of step S1208, the block to be processed is split into left, middle, and right parts horizontally as shown in 605 of FIG. 6E.

[0053] After executing any one of step S1204, step S1205, step S1207, and step S1208, for each block obtained by dividing the processing target block, scan from left to right and from top to bottom in this order (step S1209). The numbers 0 to 2 of 602 to 605 in FIGS. 6B to 6E indicate the order of processing. For each divided block, recursively execute the 2-3 division process of FIG. 8 (step S1210).

[0054] The recursive block division described here may limit the necessity of division according to the number of divisions, the size of the block to be processed, etc. The information for limiting the necessity of division may be realized in a configuration where information transmission is not performed by making a prior agreement between the encoding device and the decoding device, or may be realized in a configuration where the encoding device determines the information for limiting the necessity of division and records it in a bit string and transmits it to the decoding device.

[0055] When a certain block is divided, the block before division is called the parent block, and each block after division is called a child block.

[0056] Next, the operation of the block division unit 202 in the image decoding device 200 will be described. The block division unit 202 divides the tree block by the same processing procedure as the block division unit 101 of the image encoding device 100. However, in the block division unit 101 of the image encoding device 100, optimization methods such as estimation of the optimal shape by image recognition and distortion rate optimization are applied to determine the optimal block division shape, while the block division unit 202 in the image decoding device 200 determines the block division shape by decoding the block division information recorded in the bit string, which is different.

[0057] The syntax (syntactic rules of bit sequences) regarding block splitting in the first embodiment is shown in FIG. 9. coding_quadtree() represents the syntax for the 4-way splitting process of a block. multi_type_tree() represents the syntax for the 2-way or 3-way splitting process of a block. qt_split is a flag indicating whether to split a block into 4 parts. When splitting a block into 4 parts, qt_split = 1; when not splitting into 4 parts, qt_split = 0. When splitting into 4 parts (qt_split = 1), for each of the 4 split blocks, perform the 4-way splitting process recursively (coding_quadtree(0), coding_quadtree(1), coding_quadtree(2), coding_quadtree(3), where the arguments 0 to 3 correspond to the numbers in 601 of FIG. 6A). When not splitting into 4 parts (qt_split = 0), determine the subsequent splitting according to multi_type_tree(). mtt_split is a flag indicating whether to perform further splitting. When performing further splitting (mtt_split = 1), transmit mtt_split_vertical, which is a flag indicating whether to split vertically or horizontally, and mtt_split_binary, which is a flag for determining whether to split into 2 parts or 3 parts. mtt_split_vertical = 1 indicates splitting vertically, and mtt_split_vertical = 0 indicates splitting horizontally. mtt_split_binary = 1 indicates splitting into 2 parts, and mtt_split_binary = 0 indicates splitting into 3 parts. When splitting into 2 parts (mtt_split_binary = 1), for each of the 2 split blocks, perform the splitting process recursively (multi_type_tree(0), multi_type_tree(1), where the arguments 0 to 1 correspond to the numbers in 602 or 604 of FIGS. 6B to D). When splitting into 3 parts (mtt_split_binary = 0), for each of the 3 split blocks, perform the splitting process recursively (multi_type_tree(0), multi_type_tree(1), multi_type_tree(2), where 0 to 2 correspond to the numbers in 603 of FIG. 6B or 605 of FIG. 6E).Hierarchical block division is performed by recursively calling multi_type_tree until mtt_split = 0.

[0058] <Inter prediction> The inter prediction method according to the embodiment is implemented in the inter prediction unit 102 of the image encoding device in FIG. 1 and the inter prediction unit 203 of the image decoding device in FIG. 2.

[0059] The inter prediction method according to the embodiment will be described with reference to the drawings. The inter prediction method is implemented in either the encoding or decoding process in units of encoding blocks.

[0060] <Explanation of the inter prediction unit 102 on the encoding side> FIG. 16 is a diagram showing the detailed configuration of the inter prediction unit 102 of the image encoding device in FIG. 1. The normal prediction motion vector mode derivation unit 301 derives a plurality of normal prediction motion vector candidates, selects a prediction motion vector, and calculates a differential motion vector between the selected prediction motion vector and the detected motion vector. The detected inter prediction mode, reference index, motion vector, and the calculated differential motion vector become the inter prediction information in the normal prediction motion vector mode. This inter prediction information is supplied to the inter prediction mode determination unit 305. The detailed configuration and processing of the normal prediction motion vector mode derivation unit 301 will be described later.

[0061] The normal merge mode derivation unit 302 derives a plurality of normal merge candidates, selects a normal merge candidate, and obtains the inter prediction information in the normal merge mode. This inter prediction information is supplied to the inter prediction mode determination unit 305. The detailed configuration and processing of the normal merge mode derivation unit 302 will be described later.

[0062] In the sub-block prediction motion vector mode derivation unit 303, a plurality of sub-block prediction motion vector candidates are derived, a sub-block prediction motion vector is selected, and a differential motion vector between the selected sub-block prediction motion vector and the detected motion vector is calculated. The detected inter-prediction mode, reference index, motion vector, and the calculated differential motion vector become the inter-prediction information of the sub-block prediction motion vector mode. This inter-prediction information is supplied to the inter-prediction mode determination unit 305.

[0063] In the sub-block merge mode derivation unit 304, a plurality of sub-block merge candidates are derived, a sub-block merge candidate is selected, and inter-prediction information of the sub-block merge mode is obtained. This inter-prediction information is supplied to the inter-prediction mode determination unit 305.

[0064] In the inter-prediction mode determination unit 305, the inter-prediction information is determined based on the inter-prediction information supplied from the normal prediction motion vector mode derivation unit 301, the normal merge mode derivation unit 302, the sub-block prediction motion vector mode derivation unit 303, and the sub-block merge mode derivation unit 304. The inter-prediction information corresponding to the determination result is supplied from the inter-prediction mode determination unit 305 to the motion compensation prediction unit 306.

[0065] In the motion compensation prediction unit 306, inter-prediction is performed on the reference image signal stored in the decoded image memory 104 based on the determined inter-prediction information. The detailed configuration and processing of the motion compensation prediction unit 306 will be described later.

[0066] <Explanation of the inter-prediction unit 203 on the decoding side> FIG. 22 is a diagram showing the detailed configuration of the inter-prediction unit 203 of the image decoding apparatus in FIG. 2.

[0067] Generally, the normal prediction motion vector mode derivation unit 401 derives a plurality of normal prediction motion vector candidates, selects a prediction motion vector, and calculates the addition value of the selected prediction motion vector and the decoded differential motion vector as the motion vector. The decoded inter prediction mode, reference index, and motion vector become the inter prediction information of the normal prediction motion vector mode. This inter prediction information is supplied to the motion compensation prediction unit 406 via the switch 408. The detailed configuration and processing of the normal prediction motion vector mode derivation unit 401 will be described later.

[0068] In the normal merge mode derivation unit 402, a plurality of normal merge candidates are derived, a normal merge candidate is selected, and the inter prediction information of the normal merge mode is obtained. This inter prediction information is supplied to the motion compensation prediction unit 406 via the switch 408. The detailed configuration and processing of the normal merge mode derivation unit 402 will be described later.

[0069] In the sub-block prediction motion vector mode derivation unit 403, a plurality of sub-block prediction motion vector candidates are derived, a sub-block prediction motion vector is selected, and the addition value of the selected sub-block prediction motion vector and the decoded differential motion vector is calculated as the motion vector. The decoded inter prediction mode, reference index, and motion vector become the inter prediction information of the sub-block prediction motion vector mode. This inter prediction information is supplied to the motion compensation prediction unit 406 via the switch 408.

[0070] In the sub-block merge mode derivation unit 404, a plurality of sub-block merge candidates are derived, a sub-block merge candidate is selected, and the inter prediction information of the sub-block merge mode is obtained. This inter prediction information is supplied to the motion compensation prediction unit 406 via the switch 408.

[0071] Based on the determined inter prediction information, the motion compensation prediction unit 406 performs inter prediction on the reference image signal stored in the decoded image memory 208. The detailed configuration and processing of the motion compensation prediction unit 406 are the same as those of the motion compensation prediction unit 306 on the encoding side.

[0072] <Normal Prediction Motion Vector Mode Derivation Unit (Normal AMVP)> The normal prediction motion vector mode derivation unit 301 in FIG. 17 includes a spatial prediction motion vector candidate derivation unit 321, a temporal prediction motion vector candidate derivation unit 322, a history prediction motion vector candidate derivation unit 323, a prediction motion vector candidate supplement unit 325, a normal motion vector detection unit 326, a prediction motion vector candidate selection unit 327, and a motion vector subtraction unit 328.

[0073] The normal prediction motion vector mode derivation unit 401 in FIG. 23 includes a spatial prediction motion vector candidate derivation unit 421, a temporal prediction motion vector candidate derivation unit 422, a history prediction motion vector candidate derivation unit 423, a prediction motion vector candidate supplement unit 425, a prediction motion vector candidate selection unit 426, and a motion vector addition unit 427.

[0074] The processing procedures of the normal prediction motion vector mode derivation unit 301 on the encoding side and the normal prediction motion vector mode derivation unit 401 on the decoding side will be described using the flowcharts in FIGS. 19 and 25, respectively. FIG. 19 is a flowchart showing the normal prediction motion vector mode derivation processing procedure by the normal motion vector mode derivation unit 301 on the encoding side, and FIG. 25 is a flowchart showing the normal prediction motion vector mode derivation processing procedure by the normal motion vector mode derivation unit 401 on the decoding side.

[0075] <Normal Prediction Motion Vector Mode Derivation Unit (Normal AMVP): Explanation on the Encoding Side> Referring to FIG. 19, the normal prediction motion vector mode derivation processing procedure on the encoding side will be described. In the description of the processing procedure in FIG. 19, the word "normal" shown in FIG. 19 may be omitted.

[0076] First, the normal motion vector detection unit 326 detects the normal motion vector for each inter prediction mode and reference index (step S100 in FIG. 19).

[0077] Subsequently, the spatial prediction motion vector candidate derivation unit 321, the temporal prediction motion vector candidate derivation unit 322, the history prediction motion vector candidate derivation unit 323, the prediction motion vector candidate supplementation unit 325, the prediction motion vector candidate selection unit 327, and the motion vector subtraction unit 328 calculate the differential motion vectors of the motion vectors used in the inter prediction in the normal prediction motion vector mode for each of L0 and L1 (steps S101 to S106 in FIG. 19). Specifically, when the prediction mode PredMode of the processing target block is inter prediction (MODE_INTER) and the inter prediction mode is L0 prediction (Pred_L0), the prediction motion vector candidate list mvpListL0 for L0 is calculated, the prediction motion vector mvpL0 is selected, and the differential motion vector mvdL0 of the motion vector mvL0 for L0 is calculated. When the inter prediction mode of the processing target block is L1 prediction (Pred_L1), the prediction motion vector candidate list mvpListL1 for L1 is calculated, the prediction motion vector mvpL1 is selected, and the differential motion vector mvdL1 of the motion vector mvL1 for L1 is calculated. When the inter prediction mode of the processing target block is bi-prediction (Pred_BI), both L0 prediction and L1 prediction are performed. The prediction motion vector candidate list mvpListL0 for L0 is calculated, the prediction motion vector mvpL0 for L0 is selected, and the differential motion vector mvdL0 of the motion vector mvL0 for L0 is calculated. At the same time, the prediction motion vector candidate list mvpListL1 for L1 is calculated, the prediction motion vector mvpL1 for L1 is calculated, and the differential motion vectors mvdL1 of the motion vectors mvL1 for L1 are calculated respectively.

[0078] For each of L0 and L1, the differential motion vector calculation process is performed, and the processes for L0 and L1 are common. Therefore, in the following description, L0 and L1 are represented as a common LX. In the process of calculating the differential motion vector for L0, X of LX is 0, and in the process of calculating the differential motion vector for L1, X of LX is 1. Also, when referring to the information of the other list instead of LX during the process of calculating the differential motion vector for LX, the other list is represented as LY.

[0079] When using the motion vector mvLX of LX (step S102 in FIG. 19: YES), candidates for the predicted motion vector of LX are calculated to construct a predicted motion vector candidate list mvpListLX for LX (step S103 in FIG. 19). A plurality of candidates for the predicted motion vector are derived by the spatial predicted motion vector candidate derivation unit 321, the temporal predicted motion vector candidate derivation unit 322, the history predicted motion vector candidate derivation unit 323, and the predicted motion vector candidate supplement unit 325 in the normal predicted motion vector mode derivation unit 301 to construct the predicted motion vector candidate list mvpListLX for LX. The detailed processing procedure of step S103 in FIG. 19 will be described later with reference to the flowchart of FIG. 20.

[0080] Subsequently, the predicted motion vector selection unit 327 selects the predicted motion vector mvpLX of LX from the predicted motion vector candidate list mvpListLX of LX (step S104 in FIG. 19). Here, in the predicted motion vector candidate list mvpListLX, one element (the i-th element counted from 0) is represented as mvpListLX[i]. Each difference motion vector, which is the difference between the motion vector mvLX and each predicted motion vector candidate mvpListLX[i] stored in the predicted motion vector candidate list mvpListLX, is calculated. The amount of code when these difference motion vectors are coded is calculated for each element (predicted motion vector candidate) of the predicted motion vector candidate list mvpListLX. Then, among the elements registered in the predicted motion vector candidate list mvpListLX, the predicted motion vector candidate mvpListLX[i] with the minimum amount of code for each predicted motion vector candidate is selected as the predicted motion vector mvpLX, and its index i is obtained. When there are multiple predicted motion vector candidates with the minimum occurring code amount in the predicted motion vector candidate list mvpListLX, the predicted motion vector candidate mvpListLX[i] represented by the smaller index number in the predicted motion vector candidate list mvpListLX is selected as the optimal predicted motion vector mvpLX, and its index i is obtained.

[0081] Subsequently, in the motion vector subtraction unit 328, the predicted motion vector mvpLX of LX selected from the motion vector mvLX of LX is subtracted, mvdLX = mvLX - mvpLX and the differential motion vector mvdLX of LX is calculated as (step S105 in FIG. 19).

[0082] <Normal predicted motion vector mode derivation unit (normal AMVP): Explanation on the decoding side> Next, with reference to FIG. 25, the normal predicted motion vector mode processing procedure on the decoding side will be described. On the decoding side, in the spatial predicted motion vector candidate derivation unit 421, the temporal predicted motion vector candidate derivation unit 422, the history predicted motion vector candidate derivation unit 423, and the predicted motion vector candidate supplement unit 425, the motion vectors used in the inter prediction of the normal predicted motion vector mode are calculated for each of L0 and L1 (steps S201 to S206 in FIG. 25). Specifically, when the prediction mode PredMode of the processing target block is inter prediction (MODE_INTER) and the inter prediction mode of the processing target block is L0 prediction (Pred_L0), the predicted motion vector candidate list mvpListL0 of L0 is calculated, the predicted motion vector mvpL0 is selected, and the motion vector mvL0 of L0 is calculated. When the inter prediction mode of the processing target block is L1 prediction (Pred_L1), the predicted motion vector candidate list mvpListL1 of L1 is calculated, the predicted motion vector mvpL1 is selected, and the motion vector mvL1 of L1 is calculated. When the inter prediction mode of the processing target block is bi-prediction (Pred_BI), both L0 prediction and L1 prediction are performed. The predicted motion vector candidate list mvpListL0 of L0 is calculated, the predicted motion vector mvpL0 of L0 is selected, and the motion vector mvL0 of L0 is calculated. At the same time, the predicted motion vector candidate list mvpListL1 of L1 is calculated, the predicted motion vector mvpL1 of L1 is calculated, and the motion vector mvL1 of L1 is calculated respectively.

[0083] Similar to the encoding side, on the decoding side, for each of L0 and L1, motion vector calculation processing is performed, and the processing for L0 and L1 is common. Therefore, in the following description, L0 and L1 are represented as a common LX. LX represents the inter prediction mode used for inter prediction of the encoding block to be processed. In the process of calculating the motion vector of L0, X is 0, and in the process of calculating the motion vector of L1, X is 1. Also, when referring to the information of the other reference list instead of the same reference list as the LX for which calculation is to be performed during the process of calculating the motion vector of LX, the other reference list is represented as LY.

[0084] When using the motion vector mvLX of LX (step S202 in FIG. 25: YES), candidates for the predicted motion vector of LX are calculated to construct a predicted motion vector candidate list mvpListLX of LX (step S203 in FIG. 25). A plurality of candidates for the predicted motion vector are calculated by the spatial predicted motion vector candidate derivation unit 421, the temporal predicted motion vector candidate derivation unit 422, the history predicted motion vector candidate derivation unit 423, and the predicted motion vector candidate supplement unit 425 in the normal predicted motion vector mode derivation unit 401, and the predicted motion vector candidate list mvpListLX is constructed. The detailed processing procedure of step S203 in FIG. 25 will be described later with reference to the flowchart of FIG. 20.

[0085] Subsequently, the prediction motion vector candidate selection unit 426 selects the candidate mvpListLX[mvpIdxLX] of the prediction motion vector corresponding to the index mvpIdxLX of the prediction motion vector decoded by the bit sequence decoder 201 and supplied from the prediction motion vector candidate list mvpListLX as the selected prediction motion vector mvpLX (step S204 in FIG. 25).

[0086] Subsequently, the motion vector addition unit 427 adds the differential motion vector mvdLX of LX decoded by the bit sequence decoder 201 and supplied and the predicted motion vector mvpLX of LX, mvLX = mvpLX + mvdLX to calculate the motion vector mvLX of LX (step S205 in FIG. 25).

[0087] <Normal prediction motion vector mode derivation unit (Normal AMVP): Motion vector prediction method> FIG. 20 is a flowchart showing a processing procedure of normal prediction motion vector mode derivation processing having functions common to the normal prediction motion vector mode derivation unit 301 of the image encoding apparatus and the normal prediction motion vector mode derivation unit 401 of the image decoding apparatus according to an embodiment of the present invention.

[0088] The normal prediction motion vector mode derivation unit 301 and the normal prediction motion vector mode derivation unit 401 are provided with a prediction motion vector candidate list mvpListLX. The prediction motion vector candidate list mvpListLX has a list structure, and a storage area is provided that stores, as elements, a prediction motion vector index indicating the location inside the prediction motion vector candidate list and a prediction motion vector candidate corresponding to the index. The numbers of the prediction motion vector indexes start from 0, and the prediction motion vector candidates are stored in the storage area of the prediction motion vector candidate list mvpListLX. In the present embodiment, it is assumed that the prediction motion vector candidate list mvpListLX can register at least two prediction motion vector candidates (inter prediction information). Further, 0 is set to a variable numCurrMvpCand indicating the number of prediction motion vector candidates registered in the prediction motion vector candidate list mvpListLX.

[0089] The spatial prediction motion vector candidate derivation units 321 and 421 derive candidate prediction motion vectors from the blocks adjacent on the left side. In this process, the inter - prediction information of the blocks adjacent on the left side (A0 or A1 in FIG. 11), that is, a flag indicating whether the candidate prediction motion vector can be used, and the motion vector, reference index, etc. are referred to derive the prediction motion vector mvLXA, and the derived mvLXA is added to the prediction motion vector candidate list mvpListLX (step S301 in FIG. 20). Note that X is 0 for L0 prediction and X is 1 for L1 prediction (the same applies hereinafter). Subsequently, the spatial prediction motion vector candidate derivation units 321 and 421 derive candidate prediction motion vectors from the blocks adjacent on the upper side. In this process, the inter - prediction information of the blocks adjacent on the upper side (B0, B1, or B2 in FIG. 11), that is, a flag indicating whether the candidate prediction motion vector can be used, and the motion vector, reference index, etc. are referred to derive the prediction motion vector mvLXB. If the derived mvLXA and mvLXB are not equal, mvLXB is added to the prediction motion vector candidate list mvpListLX (step S302 in FIG. 20). The processes of steps S301 and S302 in FIG. 20 are common except that the positions and numbers of the adjacent blocks to be referred to are different, and a flag availableFlagLXN indicating whether the prediction motion vector candidate of the coded block can be used, and the motion vector mvLXN, reference index refIdxN (N indicates A or B, the same applies hereinafter) are derived.

[0090] Subsequently, the temporal prediction motion vector candidate derivation units 322 and 422 derive candidate prediction motion vectors from the blocks in pictures that are temporally different from the current picture being processed. In this process, a flag availableFlagLXCol indicating whether the candidate prediction motion vector of the coded block in a picture at a different time can be used, and the motion vector mvLXCol, reference index refIdxCol, reference list listCol are derived, and mvLXCol is added to the prediction motion vector candidate list mvpListLX (step S303 in FIG. 20).

[0091] Note that the processing of the temporal prediction motion vector candidate derivation units 322 and 422 may be omitted in units of sequence (SPS), picture (PPS), or slice.

[0092] Subsequently, the history prediction motion vector candidate derivation units 323 and 423 add the history prediction motion vector candidates registered in the history prediction motion vector candidate list HmvpCandList to the prediction motion vector candidate list mvpListLX. (Step S304 in FIG. 20). Details of the registration processing procedure in this step S304 will be described later with reference to the flowchart in FIG. 29.

[0093] Subsequently, the prediction motion vector candidate supplementation units 325 and 425 add prediction motion vector candidates with a predetermined value such as (0, 0) until the prediction motion vector candidate list mvpListLX is filled (S305 in FIG. 20).

[0094] <Normal merge mode derivation unit (normal merge)> The normal merge mode derivation unit 302 in FIG. 18 includes a spatial merge candidate derivation unit 341, a temporal merge candidate derivation unit 342, an average merge candidate derivation unit 344, a history merge candidate derivation unit 345, a merge candidate supplementation unit 346, and a merge candidate selection unit 347.

[0095] The normal merge mode derivation unit 402 in FIG. 24 includes a spatial merge candidate derivation unit 441, a temporal merge candidate derivation unit 442, an average merge candidate derivation unit 444, a history merge candidate derivation unit 445, a merge candidate supplementation unit 446, and a merge candidate selection unit 447.

[0096] FIG. 21 is a flowchart for explaining the procedure of the normal merge mode derivation process having functions common to the normal merge mode derivation unit 302 of the image encoding apparatus and the normal merge mode derivation unit 402 of the image decoding apparatus according to the embodiment of the present invention.

[0097] The following describes the processes in sequence. In the following description, unless otherwise specified, the case where the slice type slice_type is a B slice will be described, but it is also applicable to the case of a P slice. However, when the slice type slice_type is a P slice, there is only L0 prediction (Pred_L0) as the inter prediction mode, and there is no L1 prediction (Pred_L1) or bi-prediction (Pred_BI), so the processing related to L1 can be omitted.

[0098] The normal merge mode derivation unit 302 and the normal merge mode derivation unit 402 are provided with a merge candidate list mergeCandList. The merge candidate list mergeCandList has a list structure, and is provided with a storage area that stores a merge index indicating the location inside the merge candidate list and a merge candidate corresponding to the index as elements. The numbers of the merge indexes start from 0, and the merge candidates are stored in the storage area of the merge candidate list mergeCandList. In the subsequent processing, the merge candidate at the merge index i registered in the merge candidate list mergeCandList will be represented as mergeCandList[i]. In the present embodiment, it is assumed that the merge candidate list mergeCandList can register at least six merge candidates (inter prediction information). Further, the variable numCurrMergeCand indicating the number of merge candidates registered in the merge candidate list mergeCandList is set to 0.

[0099] In the spatial merge candidate derivation unit 341 and the spatial merge candidate derivation unit 441, spatial merge candidates from each block (B1, A1, B0, A0, B2 in FIG. 11) adjacent to the processing target block are derived from the encoded information stored in the encoded information storage memory 111 of the image encoding device or the encoded information storage memory 205 of the image decoding device, and the derived spatial merge candidates are registered in the merge candidate list mergeCandList (step S401 in FIG. 21). Here, N is defined to indicate any one of B1, A1, B0, A0, B2 or the temporal merge candidate Col. A flag availableFlagN indicating whether the inter prediction information of block N can be used as a spatial merge candidate, a reference index refIdxL0N of L0 of the spatial merge candidate N and a reference index refIdxL1N of L1, an L0 prediction flag predFlagL0N indicating whether L0 prediction is performed, and an L1 prediction flag predFlagL1N indicating whether L1 prediction is performed, a motion vector mvL0N of L0, and a motion vector mvL1N of L1 are derived. However, in the present embodiment, since the merge candidates are derived without referring to the inter prediction information of the blocks included in the encoding block to be processed, no spatial merge candidates using the inter prediction information of the blocks included in the encoding block to be processed are derived.

[0100] Subsequently, in the temporal merge candidate derivation unit 342 and the temporal merge candidate derivation unit 442, temporal merge candidates from pictures at different times are derived, and the derived temporal merge candidates are registered in the merge candidate list mergeCandList (step S402 in FIG. 21). A flag availableFlagCol indicating whether the temporal merge candidate can be used, an L0 prediction flag predFlagL0Col indicating whether L0 prediction of the temporal merge candidate is performed, an L1 prediction flag predFlagL1Col indicating whether L1 prediction is performed, and a motion vector mvL0Col of L0 and a motion vector mvL1Col of L1 are derived.

[0101] It is assumed that the processing of the temporal merge candidate derivation units 342 and 442 can be omitted in units of sequence (SPS), picture (PPS), or slice.

[0102] Subsequently, the history merge candidate derivation units 345 and 445 register the history prediction motion vector candidates registered in the history prediction motion vector candidate list HmvpCandList into the merge candidate list mergeCandList (step S403 in FIG. 21). Note that when the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList is smaller than the maximum number of merge candidates MaxNumMergeCand, the history merge candidates are derived with the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList capped at the maximum number of merge candidates MaxNumMergeCand, and are registered in the merge candidate list mergeCandList.

[0103] Subsequently, the average merge candidate derivation units 344 and 444 derive average merge candidates from the merge candidate list mergeCandList, and add the derived average merge candidates to the merge candidate list mergeCandList (step S404 in FIG. 21). Note that when the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList is smaller than the maximum number of merge candidates MaxNumMergeCand, the average merge candidates are derived with the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList capped at the maximum number of merge candidates MaxNumMergeCand, and are registered in the merge candidate list mergeCandList. Here, the average merge candidate is a new merge candidate having a motion vector obtained by averaging the motion vectors of the first merge candidate and the second merge candidate registered in the merge candidate list mergeCandList for each of the L0 prediction and the L1 prediction.

[0104] Subsequently, in merge candidate replenishment unit 346 and merge candidate replenishment unit 446, when the number of merge candidates numCurrMergeCand registered in merge candidate list mergeCandList is smaller than the maximum number of merge candidates MaxNumMergeCand, additional merge candidates are derived with the maximum number of merge candidates MaxNumMergeCand as the upper limit based on the number of merge candidates numCurrMergeCand registered in merge candidate list mergeCandList, and are registered in merge candidate list mergeCandList (step S405 in FIG. 21). With the maximum number of merge candidates MaxNumMergeCand as the upper limit, in the P slice, a merge candidate with a prediction mode where the motion vector has a value of (0, 0) and is L0 prediction (Pred_L0) is added. In the B slice, a merge candidate with a prediction mode where the motion vector has a value of (0, 0) and is bi-prediction (Pred_BI) is added. The reference index when adding a merge candidate is different from the reference index already added.

[0105] Subsequently, in merge candidate selection unit 347 and merge candidate selection unit 447, merge candidates are selected from the merge candidates registered in merge candidate list mergeCandList. The merge candidate selection unit 347 on the encoding side selects a merge candidate by calculating the coding amount and the distortion amount, and supplies the merge index indicating the selected merge candidate and the inter prediction information of the merge candidate to motion compensation prediction unit 306 via inter prediction mode determination unit 305. On the other hand, the merge candidate selection unit 447 on the decoding side selects a merge candidate based on the decoded merge index, and supplies the selected merge candidate to motion compensation prediction unit 406.

[0106] <Update of historical prediction motion vector candidate list> Next, the initialization method and update method of the historical prediction motion vector candidate list HmvpCandList provided in the encoding information storage memory 111 on the encoding side and the encoding information storage memory 205 on the decoding side will be described in detail. FIG. 26 is a flowchart for explaining the initialization / update processing procedure of the historical prediction motion vector candidate list.

[0107] In this embodiment, it is assumed that the update of the history prediction motion vector candidate list HmvpCandList is performed in the encoding information storage memory 111 and the encoding information storage memory 205. A history prediction motion vector candidate list update unit may be provided in the inter prediction unit 102 and the inter prediction unit 203 to update the history prediction motion vector candidate list HmvpCandList.

[0108] The history prediction motion vector candidate list HmvpCandList is initially set at the start of the slice. On the encoding side, when the prediction method determination unit 105 selects the normal prediction motion vector mode or the normal merge mode, the history prediction motion vector candidate list HmvpCandList is updated. On the decoding side, when the prediction information decoded by the bit string decoding unit 201 is in the normal prediction motion vector mode or the normal merge mode, the history prediction motion vector candidate list HmvpCandList is updated.

[0109] The inter prediction information used when performing inter prediction in the normal prediction motion vector mode or the normal merge mode is registered in the history prediction motion vector candidate list HmvpCandList as the inter prediction information candidate hMvpCand. The inter prediction information candidate hMvpCand includes the reference index refIdxL of L0 and the reference index refIdxL1 of L1, the L0 prediction flag predFlagL0 indicating whether L0 prediction is performed, the L1 prediction flag predFlagL1 indicating whether L1 prediction is performed, the motion vector mvL0 of L0, and the motion vector mvL1 of L1.

[0110] If there is an element (i.e., inter-prediction information) registered in the history prediction motion vector candidate list HmvpCandList provided in the encoding information storage memory 111 on the encoding side and the encoding information storage memory 205 on the decoding side that has the same value as the inter-prediction information candidate hMvpCand, that element is deleted from the history prediction motion vector candidate list HmvpCandList. On the other hand, if there is no inter-prediction information with the same value as the inter-prediction information candidate hMvpCand, the element at the head of the history prediction motion vector candidate list HmvpCandList is deleted, and the inter-prediction information candidate hMvpCand is added to the end of the history prediction motion vector candidate list HmvpCandList.

[0111] The number of elements in the history prediction motion vector candidate list HmvpCandList provided in the encoding information storage memory 111 on the encoding side and the encoding information storage memory 205 on the decoding side of the present invention is set to 6.

[0112] First, the history prediction motion vector candidate list HmvpCandList is initialized in units of slices (step S2101 in FIG. 26). At the start of the slice, all elements of the history prediction motion vector candidate list HmvpCandList are emptied, and the value of the number of history prediction motion vector candidates (current number of candidates) NumHmvpCand registered in the history prediction motion vector candidate list HmvpCandList is set to 0.

[0113] Although the initialization of the history prediction motion vector candidate list HmvpCandList is performed in units of slices (the first encoded block of the slice), it may also be performed in units of pictures, tiles, or tree block rows.

[0114] Subsequently, the following update process of the history prediction motion vector candidate list HmvpCandList is repeatedly performed for each encoded block within the slice (steps S2102 to S2107 in FIG. 26).

[0115] First, perform initial settings in units of encoding blocks. Set the flag identicalCandExist indicating whether there is an identical candidate to FALSE (false), and set 0 to the deletion target index removeIdx indicating the candidate to be deleted (step S2103 in FIG. 26).

[0116] Determine whether there is an inter-prediction information candidate hMvpCand to be registered (step S2104 in FIG. 26). When it is determined as the normal prediction motion vector mode or the normal merge mode by the prediction method determination unit 105 on the encoding side, or when it is decoded as the normal prediction motion vector mode or the normal merge mode by the bit string decoding unit 201 on the decoding side, the inter-prediction information is set as the inter-prediction information candidate hMvpCand to be registered. When it is determined as the intra-prediction mode, the sub-block prediction motion vector mode, or the sub-block merge mode by the prediction method determination unit 105 on the encoding side, or when it is decoded as the intra-prediction mode, the sub-block prediction motion vector mode, or the sub-block merge mode by the bit string decoding unit 201 on the decoding side, the update process of the history prediction motion vector candidate list HmvpCandList is not performed, and there is no inter-prediction information candidate hMvpCand to be registered. If there is no inter-prediction information candidate hMvpCand to be registered, skip steps S2105 to S2106 (step S2104 in FIG. 26: NO). If there is an inter-prediction information candidate hMvpCand to be registered, perform the processing from step S2105 onwards (step S2104 in FIG. 26: YES).

[0117] Next, it is determined whether there is an element (inter-prediction information) with the same value as the inter-prediction information candidate hMvpCand to be registered among the elements of the history prediction motion vector candidate list HmvpCandList, that is, whether there is an identical element (step S2105 in FIG. 26). FIG. 27 is a flowchart of this identical element confirmation processing procedure. When the value of the number of history prediction motion vector candidates NumHmvpCand is 0 (step S2121 in FIG. 27: NO), the history prediction motion vector candidate list HmvpCandList is empty and there is no identical candidate, so steps S2122 to S2125 in FIG. 27 are skipped and this identical element confirmation processing procedure is terminated. When the value of the number of history prediction motion vector candidates NumHmvpCand is greater than 0 (YES in step S2121 in FIG. 27), the process of step S2123 is repeated from the history prediction motion vector index hMvpIdx = 0 to NumHmvpCand - 1 (steps S2122 to S2125 in FIG. 27). First, it is compared whether the element HmvpCandList[hMvpIdx] at the hMvpIdx-th position counted from 0 in the history prediction motion vector candidate list is identical to the inter-prediction information candidate hMvpCand (step S2123 in FIG. 27). If they are identical (step S2123 in FIG. 27: YES), the flag identicalCandExist indicating whether there is an identical candidate is set to the value TRUE (true), the deletion target index removeIdx indicating the position of the element to be deleted is set to the value of the current history prediction motion vector index hMvpIdx, and this identical element confirmation process is terminated. If they are not identical (step S2123 in FIG. 27: NO), hMvpIdx is incremented by 1, and if the history prediction motion vector index hMvpIdx is less than or equal to NumHmvpCand - 1, the processes after step S2123 are performed.

[0118] Returning again to the flowchart of FIG. 26, perform the shift and addition processing of the elements of the history prediction motion vector candidate list HmvpCandList (step S2106 in FIG. 26). FIG. 28 is a flowchart of the element shift / addition processing procedure of the history prediction motion vector candidate list HmvpCandList in step S2106 of FIG. 26. First, determine whether to add a new element after removing the elements stored in the history prediction motion vector candidate list HmvpCandList or to add a new element without removing the elements. Specifically, compare whether the flag identicalCandExist indicating whether the same candidate exists is TRUE (true) or whether NumHmvpCand is 6 (step S2141 in FIG. 28). When either the condition that the flag identicalCandExist indicating whether the same candidate exists is TRUE (true) or the current number of candidates NumHmvpCand is 6 is satisfied (step S2141 in FIG. 28: YES), add a new element after removing the elements stored in the history prediction motion vector candidate list HmvpCandList. Set the initial value of the index i to the value of removeIdx + 1. From this initial value to NumHmvpCand, repeat the element shift processing of step S2143. (Steps S2142 to S2144 in FIG. 28). Shift the elements forward by copying the elements of HmvpCandList[i] to HmvpCandList[i - 1] (step S2143 in FIG. 28), and increment i by 1 (steps S2142 to S2144 in FIG. 28). Subsequently, add the inter-prediction information candidate hMvpCand to HmvpCandList[NumHmvpCand - 1], which corresponds to the last of the history prediction motion vector candidate list, counting from 0 (step S2145 in FIG. 28), and end the element shift / addition processing of the present history prediction motion vector candidate list HmvpCandList.On the other hand, when neither the flag identicalCandExist indicating whether the same candidate exists is TRUE (true) nor NumHmvpCand satisfies the condition of 6 (step S2141: NO in FIG. 28), the candidate for inter prediction information hMvpCand is added to the end of the list of history predicted motion vector candidates HmvpCandList without removing the elements stored in the list of history predicted motion vector candidates HmvpCandList (step S2146 in FIG. 28). Here, the end of the list of history predicted motion vector candidates means HmvpCandList[NumHmvpCand] counted from 0. Also, NumHmvpCand is incremented by 1, and the element shift and addition process for the list of history predicted motion vector candidates HmvpCandList is terminated.

[0119] FIG. 31 is a diagram for explaining an example of the update process of the list of history predicted motion vector candidates. When adding a new element to the list of history predicted motion vector candidates HmvpCandList in which six elements (inter prediction information) have already been registered, the new element is compared with the elements in the list of history predicted motion vector candidates HmvpCandList in order from the front element (FIG. 31A). If the new element has the same value as the third element HMVP2 from the top of the list of history predicted motion vector candidates HmvpCandList, the element HMVP2 is deleted from the list of history predicted motion vector candidates HmvpCandList, and the subsequent elements HMVP3 to HMVP5 are shifted (copied) forward one by one. Then, the new element is added to the end of the list of history predicted motion vector candidates HmvpCandList (FIG. 31B), and the update of the list of history predicted motion vector candidates HmvpCandList is completed (FIG. 31C).

[0120] <History Predicted Motion Vector Candidate Derivation Process> Next, a method for deriving a history prediction motion vector candidate from a history prediction motion vector candidate list HmvpCandList, which is a processing procedure of step S304 in FIG. 20 and is a common process in the history prediction motion vector candidate derivation unit 323 of the normal prediction motion vector mode derivation unit 301 on the encoding side and the history prediction motion vector candidate derivation unit 423 of the normal prediction motion vector mode derivation unit 401 on the decoding side, will be described in detail. FIG. 29 is a flowchart for explaining the history prediction motion vector candidate derivation processing procedure.

[0121] If the number numCurrMvpCand of current prediction motion vector candidates is greater than or equal to the maximum number of elements (assumed to be 2 here) of the prediction motion vector candidate list mvpListLX or the number of history prediction motion vector candidates is such that the value of NumHmvpCand is 0 (NO in step S2201 of FIG. 29), the processing from steps S2202 to S2209 in FIG. 29 is omitted, and the history prediction motion vector candidate derivation processing procedure ends. If the number numCurrMvpCand of current prediction motion vector candidates is less than 2, which is the maximum number of elements of the prediction motion vector candidate list mvpListLX, and the value of the number NumHmvpCand of history prediction motion vector candidates is greater than 0 (YES in step S2201 of FIG. 29), the processing from steps S2202 to S2209 in FIG. 29 is performed.

[0122] Subsequently, the processing from steps S2203 to S2208 in FIG. 29 is repeated with the index i ranging from 1 to a value smaller than either 4 or the number numCheckedHMVPCand of history prediction motion vector candidates (steps S2202 to S2209 in FIG. 29). If the number numCurrMvpCand of current prediction motion vector candidates is greater than or equal to 2, which is the maximum number of elements of the prediction motion vector candidate list mvpListLX (NO in step S2203 of FIG. 29), the processing from steps S2204 to S2209 in FIG. 29 is omitted, and this history prediction motion vector candidate derivation processing procedure ends. If the number numCurrMvpCand of current prediction motion vector candidates is less than 2, which is the maximum number of elements of the prediction motion vector candidate list mvpListLX (YES in step S2203 of FIG. 29), the processing after step S2204 in FIG. 29 is performed.

[0123] Subsequently, the processes from step S2205 to S2207 are each performed for Y being 0 and 1 (L0 and L1) (steps S2204 to S2208 in FIG. 29). When the number numCurrMvpCand of current predicted motion vector candidates is 2 or more, which is the maximum number of elements in the predicted motion vector candidate list mvpListLX (step S2205 in FIG. 29: NO), the processes from step S2206 to S2209 in FIG. 29 are omitted, and the present history predicted motion vector candidate derivation processing procedure is terminated. When the number numCurrMvpCand of current predicted motion vector candidates is less than 2, which is the maximum number of elements in the predicted motion vector candidate list mvpListLX (step S2205 in FIG. 29: YES), the processes after step S2206 in FIG. 29 are performed.

[0124] Subsequently, in the history predicted motion vector candidate list HmvpCandList, when the element has the same reference index as the reference index refIdxLX of the encoding / decoding target motion vector and is different from any element in the predicted motion vector list mvpListLX (step S2206 in FIG. 29: YES), the motion vector of LY of the history predicted motion vector candidate HmvpCandList[NumHmvpCand - i] is added to the element mvpListLX[numCurrMvpCand] at the numCurrMvpCand-th position counted from 0 in the predicted motion vector candidate list (step S2207 in FIG. 29), and the number numCurrMvpCand of current predicted motion vector candidates is incremented by 1. When there is no element in the history predicted motion vector candidate list HmvpCandList that has the same reference index as the reference index refIdxLX of the encoding / decoding target motion vector and is different from any element in the predicted motion vector list mvpListLX (step S2206 in FIG. 29: NO), the addition process in step S2207 is skipped.

[0125] Perform the processes of steps S2205 to S2207 in FIG. 29 above for both L0 and L1 (steps S2204 to S2208 in FIG. 29). Increment the index i by 1, and if the index i is less than or equal to the smaller value of 4 and the number NumHmvpCand of history prediction motion vector candidates, perform the processes after step S2203 again (steps S2202 to S2209 in FIG. 29).

[0126] <History merge candidate derivation process> Next, a method for deriving a history merge candidate from a history merge candidate list HmvpCandList, which is the processing procedure of step S404 in FIG. 21 and is a common process in the history merge candidate derivation unit 345 of the normal merge mode derivation unit 302 on the encoding side and the history merge candidate derivation unit 445 of the normal merge mode derivation unit 402 on the decoding side, will be described in detail. FIG. 30 is a flowchart for explaining the history merge candidate derivation processing procedure.

[0127] First, perform initialization processing (step S2301 in FIG. 30). Set the value of FALSE to each of the elements from the 0th to (numCurrMergeCand - 1)th of isPruned[i], and set the variable numOrigMergeCand to the number numCurrMergeCand of elements registered in the current merge candidate list.

[0128] Subsequently, set the initial value of the index hMvpIdx to 1, and repeat the additional processing from step S2303 to step S2310 in FIG. 30 from this initial value up to NumHmvpCand (steps S2302 to S2311 in FIG. 30). If the number of elements numCurrMergeCand registered in the current merge candidate list is not less than (the maximum number of merge candidates MaxNumMergeCand - 1), since merge candidates have been added to all elements of the merge candidate list, end this history merge candidate derivation process (NO in step S2303 of FIG. 30). If the number of elements numCurrMergeCand registered in the current merge candidate list is less than or equal to (the maximum number of merge candidates MaxNumMergeCand - 1), perform the processing after step S2304. Set FALSE (false) to sameMotion (step S230 in FIG. 30). Subsequently, set the initial value of the index i to 0, and perform the processing of steps S2306 and S2307 in FIG. 30 from this initial value up to numOrigMergeCand - 1 (S2305 to S2308 in FIG. 30). Compare whether the element HmvpCandList[NumHmvpCand - hMvpIdx] at the (NumHmvpCand - hMvpIdx)-th position counted from 0 in the history motion vector prediction candidate list is the same as the element mergeCandList[i] at the i-th position counted from 0 in the merge candidate list (step S2306 in FIG. 30).

[0129] The same value of the merge candidate means that the merge candidate has the same value when the values of all components (inter-prediction mode, reference index, motion vector) that the merge candidate has are the same. When the merge candidate has the same value and isPruned[i] is FALSE (YES in step S2306 of FIG. 30), both sameMotion and isPruned[i] are set to TRUE (true) (step S2307 of FIG. 30). If they are not the same value (NO in step S2306 of FIG. 30), the process of step S2307 is skipped. After the repetitive process from step S2305 to step S2308 of FIG. 30 is completed, it is compared whether sameMotion is FALSE (false) (step S2309 of FIG. 30). If sameMotion is FALSE (false) (YES in step S2309 of FIG. 30), that is, the (NumHmvpCand - hMvpIdx)-th element HmvpCandList[NumHmvpCand - hMvpIdx] counted from 0 in the history prediction motion vector candidate list does not exist in the merge candidate list, the (NumHmvpCand - hMvpIdx)-th element HmvpCandList[NumHmvpCand - hMvpIdx] counted from 0 in the history prediction motion vector candidate list is added to the numCurrMergeCand-th mergeCandList[numCurrMergeCand] in the merge candidate list, and numCurrMergeCand is incremented by 1 (step S2310 of FIG. 30). The index hMvpIdx is incremented by 1 (step S2302 of FIG. 30), and the repetitive process of steps S2302 to S2311 of FIG. 30 is performed. When the confirmation of all elements in the history prediction motion vector candidate list is completed, or when merge candidates are added to all elements in the merge candidate list, the derivation process of the present history merge candidate is completed.

[0130] <Average Merge Candidate Derivation Process> Next, a method for deriving an average merge candidate, which is a process common to the average merge candidate derivation unit 344 of the normal merge mode derivation unit 302 on the encoding side and the average merge candidate derivation unit 444 of the normal merge mode derivation unit 402 on the decoding side, will be described in detail. FIG. 39 is a flowchart for explaining the average merge candidate derivation processing procedure.

[0131] First, an initialization process is performed (step S1301 in FIG. 39). The variable numOrigMergeCand is set to the number numCurrMergeCand of elements registered in the current merge candidate list.

[0132] Subsequently, scanning is performed in order from the head of the merge candidate list to determine two motion information. Let the index i indicating the first motion information be 0, and the index j indicating the second motion information be 1. (Steps S1302 to S1303 in FIG. 39). If the number numCurrMergeCand of elements registered in the current merge candidate list is not less than (the maximum number of merge candidates MaxNumMergeCand - 1), since merge candidates have been added to all elements of the merge candidate list, this history merge candidate derivation process is terminated (step S1304 in FIG. 39). If the number numCurrMergeCand of elements registered in the current merge candidate list is less than (the maximum number of merge candidates MaxNumMergeCand - 1), the processes after step S1305 are performed.

[0133] It is determined whether both the motion information mergeCandList[i] at the i-th position and the motion information mergeCandList[j] at the j-th position in the merge candidate list are invalid (step S1305 in FIG. 39). If both are invalid, the average merge candidate of mergeCandList[i] and mergeCandList[j] is not derived, and the process moves to the next element. If both mergeCandList[i] and mergeCandList[j] are not invalid, the following process is repeated with X being 0 and 1 (steps S1306 to S1314 in FIG. 39).

[0134] Determine whether the LX prediction of mergeCandList[i] is valid (step S1307 in FIG. 39). If the LX prediction of mergeCandList[i] is valid, determine whether the LX prediction of mergeCandList[j] is valid (step S1308 in FIG. 39). If the LX prediction of mergeCandList[j] is valid, that is, if both the LX prediction of mergeCandList[i] and the LX prediction of mergeCandList[j] are valid, derive an average merge candidate of the LX prediction having the motion vector of the LX prediction of mergeCandList[i] averaged with the motion vector of the LX prediction of mergeCandList[j] and the reference index of the LX prediction of mergeCandList[i], set it to the LX prediction of averageCand, and make the LX prediction of averageCand valid (step S1309 in FIG. 39). In step S1308 of FIG. 39, if the LX prediction of mergeCandList[j] is not valid, that is, if the LX prediction of mergeCandList[i] is valid and the LX prediction of mergeCandList[j] is not valid, derive an average merge candidate of the LX prediction having the motion vector and the reference index of the LX prediction of mergeCandList[i], set it to the LX prediction of averageCand, and make the LX prediction of averageCand valid (step S1310 in FIG. 39). In step S1307 of FIG. 39, if the LX prediction of mergeCandList[i] is not valid, determine whether the LX prediction of mergeCandList[j] is valid (step S1311 in FIG. 39). If the LX prediction of mergeCandList[j] is valid, that is, if the LX prediction of mergeCandList[i] is not valid and the LX prediction of mergeCandList[j] is valid, derive an average merge candidate of the LX prediction having the motion vector and the reference index of the LX prediction of mergeCandList[j], set it to the LX prediction of averageCand, and make the LX prediction of averageCand valid (step S1312 in FIG. 39).In step S1311 of FIG. 39, when the LX prediction of mergeCandList[j] is not valid, that is, when both the LX prediction of mergeCandList[i] and the LX prediction of mergeCandList[j] are invalid, the LX prediction of averageCand is made invalid (step S1312 of FIG. 39).

[0135] The average merge candidate averageCand of the L0 prediction, L1 prediction, or BI prediction generated as described above is added to mergeCandList[numCurrMergeCand] at the numCurrMergeCand-th position in the merge candidate list, and numCurrMergeCand is incremented by 1 (step S1315 of FIG. 39). Thus, the process of deriving the average merge candidate is completed.

[0136] Note that the average merge candidate is averaged for each of the horizontal component and the vertical component of the motion vector.

[0137] <Motion Compensation Prediction Process> The motion compensation prediction unit 306 acquires the position and size of the block that is the target of the current prediction process in encoding. Also, the motion compensation prediction unit 306 acquires the inter prediction information from the inter prediction mode determination unit 305. The reference index and the motion vector are derived from the acquired inter prediction information, and after obtaining the image signal at the position where the reference picture specified by the reference index in the decoded image memory 104 is moved from the same position as the image signal of the block that is the target of the prediction process by the amount of the motion vector, a prediction signal is generated.

[0138] In the case of inter prediction where the inter prediction mode is prediction from a single reference picture such as L0 prediction or L1 prediction, the prediction signal obtained from one reference picture is used as the motion compensation prediction signal. When the inter prediction mode is prediction from two reference pictures such as BI prediction, the prediction signal obtained by weighted averaging of the prediction signals from the two reference pictures is used as the motion compensation prediction signal, and the motion compensation prediction signal is supplied to the prediction method determination unit 105. Here, the ratio of the weighted average for dual prediction is 1:1, but weighted averaging may be performed using other ratios. For example, the weighting ratio may be increased as the picture interval between the picture to be predicted and the reference picture becomes closer. Also, the calculation of the weighting ratio may be performed using a correspondence table between combinations of picture intervals and weighting ratios.

[0139] The motion compensation prediction unit 406 has the same function as the motion compensation prediction unit 306 on the encoding side. The motion compensation prediction unit 406 acquires inter prediction information from the normal prediction motion vector mode derivation unit 401, the normal merge mode derivation unit 402, the sub-block prediction motion vector mode derivation unit 403, and the sub-block merge mode derivation unit 404 via the switch 408. The motion compensation prediction unit 406 supplies the obtained motion compensation prediction signal to the decoded image signal superimposing unit 207.

[0140] <Regarding the inter prediction mode> The process of performing prediction from a single reference picture is defined as single prediction. In the case of single prediction, prediction is performed using either one of the two reference pictures registered in the reference lists L0 and L1, namely L0 prediction or L1 prediction.

[0141] FIG. 32 shows a case where it is single prediction and the reference picture (RefL0Pic) of L0 is at a time earlier than the picture to be processed (CurPic). FIG. 33 shows a case where it is single prediction and the reference picture of L0 prediction is at a time later than the picture to be processed. Similarly, single prediction can also be performed by replacing the reference picture of L0 prediction in FIGS. 32 and 33 with the reference picture (RefL1Pic) of L1 prediction.

[0142] The process of making predictions from two reference pictures is defined as dual prediction. In the case of dual prediction, it is expressed as BI prediction using both L0 prediction and L1 prediction. Figure 34 shows the case of dual prediction where the reference picture for L0 prediction is at a time earlier than the picture to be processed, and the reference picture for L1 prediction is at a time later than the picture to be processed. Figure 35 shows the case of dual prediction where the reference pictures for both L0 prediction and L1 prediction are at a time earlier than the picture to be processed. Figure 36 shows the case of dual prediction where the reference pictures for both L0 prediction and L1 prediction are at a time later than the picture to be processed.

[0143] Thus, the relationship between the prediction types of L0 / L1 and time can be used without being limited to L0 being in the past direction and L1 being in the future direction. Also, in the case of dual prediction, L0 prediction and L1 prediction may each be performed using the same reference picture. Note that the determination of whether to perform motion compensation prediction using single prediction or dual prediction is determined based on information (e.g., a flag) indicating whether to use L0 prediction and whether to use L1 prediction.

[0144] <Regarding the reference index> In the embodiments of the present invention, in order to improve the accuracy of motion compensation prediction, it is possible to select an optimal reference picture from among a plurality of reference pictures in motion compensation prediction. Therefore, the reference picture used in motion compensation prediction is used as a reference index, and the reference index is encoded in the bitstream together with the differential motion vector.

[0145] <Motion compensation processing based on the normal prediction motion vector mode> As shown in the inter prediction unit 102 on the encoding side of FIG. 16, when the inter prediction information by the normal prediction motion vector mode derivation unit 301 is selected in the inter prediction mode determination unit 305, the motion compensation prediction unit 306 acquires this inter prediction information from the inter prediction mode determination unit 305, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the prediction method determination unit 105.

[0146] Similarly, as shown in the inter prediction unit 203 on the decoding side of FIG. 22, when the switch 408 is connected to the normal prediction motion vector mode derivation unit 401 during decoding, the motion compensation prediction unit 406 acquires the inter prediction information by the normal prediction motion vector mode derivation unit 401, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the decoded image signal superimposing unit 207.

[0147] <Motion Compensation Processing Based on Normal Merge Mode> As shown in the inter prediction unit 102 on the encoding side of FIG. 16, when the inter prediction information by the normal merge mode derivation unit 302 is selected in the inter prediction mode determination unit 305, the motion compensation prediction unit 306 acquires this inter prediction information from the inter prediction mode determination unit 305, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the prediction method determination unit 105.

[0148] Similarly, as shown in the inter prediction unit 203 on the decoding side of FIG. 22, when the switch 408 is connected to the normal merge mode derivation unit 402 during decoding, the motion compensation prediction unit 406 acquires the inter prediction information by the normal merge mode derivation unit 402, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the decoded image signal superposition unit 207.

[0149] <Motion compensation processing based on sub-block prediction motion vector mode> As shown in the inter prediction unit 102 on the encoding side of FIG. 16, when the inter prediction information by the sub-block prediction motion vector mode derivation unit 303 is selected in the inter prediction mode determination unit 305, the motion compensation prediction unit 306 acquires this inter prediction information from the inter prediction mode determination unit 305, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the prediction method determination unit 105.

[0150] Similarly, as shown in the inter prediction unit 203 on the decoding side of FIG. 22, when the switch 408 is connected to the sub-block prediction motion vector mode derivation unit 403 during decoding, the motion compensation prediction unit 406 acquires the inter prediction information by the sub-block prediction motion vector mode derivation unit 403, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the decoded image signal superposition unit 207.

[0151] <Motion compensation processing based on sub-block merge mode> As shown in the inter prediction unit 102 on the encoding side of FIG. 16, when the inter prediction information by the sub-block merge mode derivation unit 304 is selected in the inter prediction mode determination unit 305, the motion compensation prediction unit 306 acquires this inter prediction information from the inter prediction mode determination unit 305, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the prediction method determination unit 105.

[0152] Similarly, as shown in the inter prediction unit 203 on the decoding side of FIG. 22, when the switch 408 is connected to the sub-block merge mode derivation unit 404 during the decoding process, the motion compensation prediction unit 406 acquires the inter prediction information by the sub-block merge mode derivation unit 404, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the decoded image signal superimposing unit 207.

[0153] <Motion Compensation Processing Based on Affine Transformation Prediction> In the normal prediction motion vector mode and the normal merge mode, motion compensation by an affine model can be used based on the following flags. The following flags are reflected in the following flags based on the conditions of inter prediction determined by the inter prediction mode determination unit 305 in the encoding process and are encoded in the bitstream. In the decoding process, it is specified whether to perform motion compensation by an affine model based on the following flags in the bitstream.

[0154] The sps_affine_enabled_flag indicates whether motion compensation using an affine model can be used in inter prediction. If the sps_affine_enabled_flag is 0, it is suppressed so that motion compensation using an affine model is not used at the sequence level. Also, the inter_affine_flag and cu_affine_type_flag are not transmitted in the CU (coded block) syntax of the coded video sequence. If the sps_affine_enabled_flag is 1, motion compensation using an affine model can be used in the coded video sequence.

[0155] The sps_affine_type_flag indicates whether motion compensation using a 6-parameter affine model can be used in inter prediction. If the sps_affine_type_flag is 0, it is suppressed so that motion compensation using a 6-parameter affine model is not used. Also, the cu_affine_type_flag is not transmitted in the CU syntax of the coded video sequence. If the sps_affine_type_flag is 1, motion compensation using a 6-parameter affine model can be used in the coded video sequence. If the sps_affine_type_flag does not exist, it is assumed to be 0.

[0156] When decoding a P or B slice, in the currently processed CU, if the inter_affine_flag is 1, motion compensation using an affine model is used to generate the motion compensation prediction signal for the currently processed CU. If the inter_affine_flag is 0, the affine model is not used for the currently processed CU. If the inter_affine_flag does not exist, it is assumed to be 0.

[0157] When decoding a P or B slice, in the current CU being processed, if cu_affine_type_flag is 1, for generating the motion compensation prediction signal of the current CU being processed, motion compensation using a 6-parameter affine model is used. If cu_affine_type_flag is 0, for generating the motion compensation prediction signal of the current CU being processed, motion compensation using a 4-parameter affine model is used.

[0158] In motion compensation using an affine model, since reference indexes and motion vectors are derived in sub-block units, a motion compensation prediction signal is generated using the reference indexes and motion vectors being processed in sub-block units.

[0159] The 4-parameter affine model is a mode that derives the motion vector of a sub-block from four parameters of the horizontal and vertical components of the motion vectors of two control points respectively and performs motion compensation in sub-block units.

[0160] <Triangle Merge Mode> The triangle merge mode is a type of merge mode and is a mode that divides the inside of an encoding / decoding block into diagonal partitions for motion compensation prediction. The triangle merge mode is a type of geometric partitioning merge mode that divides an encoding / decoding block into a block with a non-rectangular shape, and in the geometric partitioning merge mode, it corresponds to a mode that divides an encoding / decoding block into two right triangles by a diagonal line. The geometric segmentation merge mode is represented by a combination of two parameters, for example, an index (angleIdx) indicating the segmentation angle and an index (distanceIdx) indicating the distance from the center of the coded block. In one example, 64 patterns are defined as the geometric segmentation merge mode and are coded with a fixed length. Among the 64 patterns, two modes in which the index indicating the segmentation angle forms an angle with the diagonal of the coded block (for example, 45 degrees (in a configuration where 360 degrees is represented by 32 divisions, angleIdx = 4) or 135 degrees (in a configuration where 360 degrees is represented by 32 divisions, angleIdx = 12)) and the index indicating the distance from the center of the coded block is the minimum (distanceIdx = 0, indicating that the segmentation boundary passes through the center of the coded block) indicate that the coded block is divided by the diagonal and correspond to the triangular merge mode.

[0161] The triangular merge mode will be described with reference to FIGS. 38A and 38B. FIGS. 38A and 38B show an example of prediction of an encoding / decoding block in the 16x16 triangular merge mode. The encoding / decoding block in the triangular merge mode is divided into 4x4 sub-blocks, and each sub-block is assigned to one of three partitions: single prediction partition 0 (UNI0), single prediction partition 1 (UNI1), and dual prediction partition 2 (BI). Here, the sub-blocks above the diagonal are assigned to partition 0, the sub-blocks below the diagonal are assigned to partition 1, and the sub-blocks on the diagonal are assigned to partition 2. If merge_triangle_split_dir is 0, the partitions are assigned as shown in FIG. 38A, and if merge_triangle_split_dir is 1, the partitions are assigned as shown in FIG. 38B.

[0162] For the motion compensation prediction of partition 0, the single prediction motion information specified by merge triangle index 0 is used. For the motion compensation prediction of partition 1, the single prediction motion information specified by merge triangle index 1 is used. For the motion compensation prediction of partition 2, the dual prediction motion information obtained by combining the single prediction motion information specified by merge triangle index 0 and the single prediction motion information specified by merge triangle index 1 is used.

[0163] Here, the single prediction motion information is a pair of a motion vector and a reference index, and the dual prediction motion information is composed of two pairs of a motion vector and a reference index. Also, the motion information refers to the single prediction motion information or the dual prediction motion information.

[0164] The merge candidate selection units 347 and 447 use the derived merge candidate list mergeCandList as the triangular merge candidate list triangleMergeCandList.

[0165] The flowchart of FIG. 40 regarding the derivation of triangular merge candidates will be described.

[0166] First, the merge candidate list mergeCandList is used as the triangular merge candidate list triangleMergeCandList (step S3501).

[0167] Next, preferentially for the merge candidates having the motion information list L0, the single prediction motion information of the merge triangle partition 0 is derived (step S3502).

[0168] Subsequently, preferentially for the merge candidates having the motion information list L1, the single prediction motion information of the merge triangle partition 1 is derived (step S3503).

[0169] Note that steps S3502 and S3503 can be derived in any order and can also be processed in parallel.

[0170] FIG. 41 is a flowchart for explaining the derivation of single prediction motion information of the merge triangular partition 0 of the first embodiment.

[0171] First, for the M-th candidate in the derived merge candidate list mergeCandList, it is determined whether candidate M has the motion information of the motion information list L0 (step S3601). If candidate M has the motion information of the motion information list L0, the motion information of the motion information list L0 of candidate M is set as a triangular merge candidate (step S3602). For candidate M (M = 0, 1, …, numMergeCand−1), steps S3601 and S3602 are performed in ascending order to additionally derive triangular merge candidates.

[0172] Subsequently, for the M-th candidate in the derived merge candidate list mergeCandList, it is determined whether candidate M has the motion information of the motion information list L1 (step S3603). If candidate M has the motion information of the motion information list L1, the motion information of the motion information list L1 of candidate M is set as a triangular merge candidate (step S3604). For candidate M (M = numMergeCand−1, …, 1, 0), steps S3603 and S3604 are performed in descending order to additionally derive triangular merge candidates.

[0173] FIG. 42 is a flowchart for explaining the derivation of single prediction motion information of the merge triangular partition 1 of the first embodiment.

[0174] First, for the M-th candidate in the derived merge candidate list mergeCandList, it is determined whether candidate M has the motion information of the motion information list L1 (step S3701). If candidate M has the motion information of the motion information list L1, the motion information of the motion information list L1 of candidate M is set as a triangular merge candidate (step S3702). For candidate M (M = 0, 1, …, numMergeCand−1), steps S3701 and S3702 are performed in ascending order to additionally derive triangular merge candidates.

[0175] Next, for the M-th candidate in the derived merge candidate list mergeCandList, it is determined whether candidate M has the motion information of the motion information list L0 (step S3703). If candidate M has the motion information of the motion information list L0, the motion information of the motion information list L0 of candidate M is used as the triangular merge candidate (step S3704). Steps S3703 and S3704 are performed in descending order for candidates M (M = numMergeCand - 1, …, 1, 0) to additionally derive triangular merge candidates.

[0176] FIG. 43A and FIG. 43B are diagrams for explaining examples of the motion information of the triangular merge candidates of the first embodiment.

[0177] FIG. 43A shows an example of a merge candidate list. For the merge candidate with merge index 0, the inter prediction mode is bi-prediction (Pred - BI), the motion information of the motion information list L0 is MV0_L0, and the motion information of the motion information list L1 is MV0_L1. For the merge candidate with merge index 1, the inter prediction mode is uni-prediction (Pred - L0), the motion information of the motion information list L0 is MV1_L0, and it has no motion information of the motion information list L1. For the merge candidate with merge index 2, the inter prediction mode is uni-prediction (Pred - L1), it has no motion information of the motion information list L0, and the motion information of the motion information list L1 is MV2_L1. For the merge candidate with merge index 3, the inter prediction mode is bi-prediction (Pred - BI), the motion information of the motion information list L0 is MV3_L0, and the motion information of the motion information list L1 is MV3_L1. For the merge candidate with merge index 4, the inter prediction mode is uni-prediction (Pred - L0), the motion information of the motion information list L0 is MV4_L0, and it has no motion information of the motion information list L1.

[0178] FIG. 43B is a diagram showing how the motion information of merge triangle partition 0 and merge triangle partition 1 is in the case of the example of the merge candidate list in FIG. 43A. The single-prediction motion information candidates of merge triangle partition 0 are composed of motion information in the order of MV0_L0, MV1_L0, MV3_L0, MV4_L0, MV3_L1, and the single-prediction motion information candidates of merge triangle partition 1 are composed of motion information in the order of MV0_L1, MV2_L1, MV3_L1, MV4_L0, MV3_L0.

[0179] Here, the maximum values of merge triangle index 0 (merge_triangle_idx0) and merge triangle index 1 (merge_triangle_idx1) are the same as the merge index (merge_idx) respectively. That is, the maximum number of triangular merge candidates for each of merge triangle partition 0 and merge triangle partition 1 is equal to the maximum number of merge candidates MaxNumMergeCand. Thereby, the contexts of CABAC (Context-based Adaptive Binary Arithmetic Coding) for the merge index, merge triangle index 0, and merge triangle index 1 can be shared, and it becomes possible to simplify and save memory for the parse and context table. Note that the maximum value (maximum number of merge candidates) of the merge index is encoded (decoded) in the SPS (Sequence Parameter Set). Also, the maximum values (maximum number of triangular merge candidates) of merge triangle index 0 and merge triangle index 1 are also encoded (decoded) in the SPS.

[0180] In this way, while changing the priority order of motion information in merge triangle partition 0 and merge triangle partition 1 and reusing the merge candidate list, suppressing the possibility of overlap of motion information between merge triangle partition 0 and merge triangle partition 1, and deriving triangular merge candidates with high coding efficiency is a feature of the present invention. It is also possible to derive the single-prediction motion information of merge triangle partition 0 by prioritizing the motion information list L1, and derive the single-prediction motion information of merge triangle partition 1 by prioritizing the motion information list L0.

[0181] (Modification Example 1) In Modification 1, the merge triangle index is different from that in the first embodiment, and the maximum number of triangular merge candidates for merge triangle index 0 and merge triangle index 1 are different from each other. Here, assume that the maximum number of triangular merge candidates for merge triangle index 1 is 1 less than that for merge triangle index 0. At this time, exclude the merge candidate selected by merge triangle index 0 as the single prediction motion information candidate for merge triangle index 1. That is, the maximum number of triangular merge candidates for merge triangle index 0 is the same as the maximum number of merge candidates for the merge index, and the maximum number of triangular merge candidates for merge triangle index 1 is 1 less than the maximum number of merge candidates for the merge index.

[0182] As described above, by making the maximum number of merge triangle index 1 1 less than that of merge triangle index 0, the coding efficiency is improved in a code sequence such as Truncated Unary where the coding efficiency improves according to the number of candidates. Also, the coding efficiency is improved by excluding the overlap with merge candidates.

[0183] Here, in the coding of general video, the utilization rate of the triangular merge mode is lower than that of the normal merge mode. Therefore, the maximum number of triangular merge candidates for merge triangle index 0 may be made smaller than the maximum number of merge candidates for the merge index. Also, in the merge candidate list, the candidates closer to the head are more effective candidates with a higher selection rate, and the candidates farther from the head are less effective candidates with a lower selection rate. Therefore, the selection rate of candidates far from the head in the triangular merge mode, that is, large candidates for merge triangle index 0 and merge triangle index 1, is low, so the processing efficiency can be improved while suppressing the decrease in coding efficiency.

[0184] (Second Embodiment) In the second embodiment, in merge triangle partition 0 and merge triangle partition 1, the order of candidate search in reference list L1 is different from that in the first embodiment. Other configurations are the same as those in the first embodiment.

[0185] FIG. 44 is a flowchart for explaining the derivation of single prediction motion information of the merge triangle partition 0 of the second embodiment.

[0186] First, for the M-th candidate in the derived merge candidate list mergeCandList, it is determined whether candidate M has the motion information of the motion information list L0 (step S3801). If candidate M has the motion information of the motion information list L0, the motion information of candidate M in the motion information list L0 is set as a triangular merge candidate (step S3802). For candidates M (M = 0, 1, …, numMergeCand−1), steps S3601 and S3802 are performed in ascending order to additionally derive triangular merge candidates.

[0187] Subsequently, for the M-th candidate in the derived merge candidate list mergeCandList, it is determined whether candidate M has the motion information of the motion information list L1 (step S3803). If candidate M has the motion information of the motion information list L1, the motion information of candidate M in the motion information list L1 is set as a triangular merge candidate (step S3804). For candidates M (M = 0, 1, …, numMergeCand−1), steps S3803 and S3804 are performed in ascending order to additionally derive triangular merge candidates.

[0188] FIG. 45 is a flowchart for explaining the derivation of single prediction motion information of the merge triangle partition 1 of the second embodiment.

[0189] First, for the M-th candidate in the derived merge candidate list mergeCandList, it is determined whether candidate M has the motion information of the motion information list L1 (step S3901). If candidate M has the motion information of the motion information list L1, the motion information of candidate M in the motion information list L1 is set as a triangular merge candidate (step S3902). For candidates M (M = numMergeCand−1, …, 1, 0), steps S3901 and S3902 are performed in descending order to additionally derive triangular merge candidates.

[0190] Next, for the M-th candidate in the derived merge candidate list mergeCandList, it is determined whether candidate M has the motion information in the motion information list L0 (step S3903). If candidate M has the motion information in the motion information list L0, the motion information in the motion information list L0 of candidate M is set as the triangular merge candidate (step S3904). Steps S3903 and S3904 are performed in descending order for candidates M (M = numMergeCand - 1, …, 1, 0) to additionally derive triangular merge candidates.

[0191] FIGS. 46A and 46B are diagrams for explaining examples of the motion information of the triangular merge candidates according to the second embodiment. FIG. 46A shows an example of the merge candidate list, which is the same as FIG. 43A.

[0192] FIG. 46B is a diagram showing what the single-prediction motion information candidates of merge triangular partition 0 and the single-prediction motion information of merge triangular partition 1 will be in the case of the example of the merge candidate list in FIG. 46A.

[0193] The single-prediction motion information candidates of merge triangular partition 0 are composed of motion information in the order of MV0_L0, MV1_L0, MV3_L0, MV4_L0, MV0_L1, and the single-prediction motion information candidates of merge triangular partition 1 are composed of motion information in the order of MV3_L1, MV2_L1, MV0_L1, MV4_L0, MV3_L0.

[0194] Here, the maximum values of the merge triangle index 0 (merge_triangle_idx0) and the merge triangle index 1 (merge_triangle_idx1) are the same as the merge index (merge_idx), respectively. That is, the maximum number of triangular merge candidates for each of the merge triangle partition 0 and the merge triangle partition 1 is equal to the maximum number of merge candidates MaxNumMergeCand. As a result, the contexts of CABAC (Context-based Adaptive Binary Arithmetic Coding) for the merge index, the merge triangle index 0, and the merge triangle index 1 can be shared, and the parsing and context tables can be simplified and memory-saving. Note that the maximum value (maximum number of merge candidates) of the merge index is encoded (decoded) in the SPS (Sequence Parameter Set). Also, the maximum values (maximum number of triangular merge candidates) of the merge triangle index 0 and the merge triangle index 1 are also encoded (decoded) in the SPS.

[0195] In this way, by changing the priority order of the motion information in the merge triangle partition 0 and the merge triangle partition 1 and reusing the merge candidate list, while suppressing the possibility of overlap of the motion information in the merge triangle partition 0 and the merge triangle partition 1, and deriving a triangular merge candidate with high coding efficiency, is a feature of the present invention. The single prediction motion information of the merge triangle partition 0 may be derived with priority given to the motion information list L1, and the single prediction motion information of the merge triangle partition 1 may be derived with priority given to the motion information list L0.

[0196] (Modification Example 1) In Modification 1, the merge triangle index is different from that in the second embodiment, and the maximum number of triangle merge candidates for merge triangle index 0 and merge triangle index 1 are different from each other. Here, it is assumed that the maximum number of triangle merge candidates for merge triangle index 1 is one less than the maximum number of triangle merge candidates for merge triangle index 0. At this time, the merge candidate selected by merge triangle index 0 is excluded as the single prediction motion information candidate for merge triangle index 1. That is, the maximum number of triangle merge candidates for merge triangle index 0 is the same as the maximum number of merge candidates for the merge index, and the maximum number of triangle merge candidates for merge triangle index 1 is one less than the maximum number of merge candidates for the merge index.

[0197] As described above, by making the maximum number of merge triangle index 1 one less than merge triangle index 0, the coding efficiency is improved in a code sequence such as Truncated Unary where the coding efficiency improves according to the number of candidates. Also, the coding efficiency is improved by excluding the overlap with merge candidates.

[0198] Here, in the coding of general video, the utilization rate of the triangle merge mode is lower than that of the normal merge mode. Therefore, the maximum number of triangle merge candidates for merge triangle index 0 may be made smaller than the maximum number of merge candidates for the merge index. Also, in the merge candidate list, the candidates closer to the head are more effective candidates with a higher selection rate, and the candidates farther from the head are less effective candidates with a lower selection rate. Therefore, the selection rate of candidates far from the head in the triangle merge mode, that is, large candidates for merge triangle index 0 and merge triangle index 1, is low, so the processing efficiency can be improved while suppressing the decrease in coding efficiency.

[0199] In all the embodiments described above, the bitstream output by the image coding device has a specific data format so that it can be decoded according to the coding method used in the embodiment. Also, the image decoding device corresponding to this image coding device can decode the bitstream of this specific data format.

[0200] When a wired or wireless network is used to exchange bitstreams between an image encoding device and an image decoding device, the bitstream may be converted into a data format suitable for the transmission mode of the communication path and transmitted. In that case, a transmission device that converts the bitstream output by the image encoding device into encoded data in a data format suitable for the transmission mode of the communication path and transmits it to the network, and a reception device that receives the encoded data from the network, restores it to a bitstream, and supplies it to the image decoding device are provided. The transmission device includes a memory that buffers the bitstream output by the image encoding device, a packet processing unit that packetizes the bitstream, and a transmission unit that transmits the packetized encoded data via the network. The reception device includes a reception unit that receives the packetized encoded data via the network, a memory that buffers the received encoded data, and a packet processing unit that packet-processes the encoded data to generate a bitstream and provides it to the image decoding device.

[0201] Further, by adding a display unit that displays the image decoded by the image decoding device to the configuration, it can also be used as a display device. In that case, the display unit reads out the decoded image signal generated by the decoded image signal superimposing unit 207 and stored in the decoded image memory 208 and displays it on the screen.

[0202] Further, by adding an imaging unit to the configuration and inputting the captured image to the image encoding device, it can also be used as an imaging device. In that case, the imaging unit inputs the captured image signal to the block dividing unit 101.

[0203] FIG. 37 shows an example of the hardware configuration of the encoding / decoding device according to the present embodiment. The encoding / decoding device includes the configurations of the image encoding device and the image decoding device according to the embodiments of the present invention. Such an encoding / decoding device 9000 has a CPU 9001, a codec IC 9002, an I / O interface 9003, a memory 9004, an optical disk drive 9005, a network interface 9006, and a video interface 9009, and each unit is connected by a bus 9010.

[0204] The image encoding unit 9007 and the image decoding unit 9008 are typically implemented as a codec IC 9002. The image encoding process of the image encoding apparatus according to the embodiment of the present invention is executed by the image encoding unit 9007, and the image decoding process in the image decoding apparatus according to the embodiment of the present invention is executed by the image decoding unit 9008. The I / O interface 9003 is realized by, for example, a USB interface and is connected to an external keyboard 9104, mouse 9105, etc. The CPU 9001 controls the encoding / decoding device 9000 to execute the operation desired by the user based on the user operation input via the I / O interface 9003. Examples of user operations using the keyboard 9104, mouse 9105, etc. include selection of which function of encoding or decoding to execute, setting of encoding quality, input / output destination of the bit stream, input / output destination of the image, etc.

[0205] When the user desires to perform an operation to play back an image recorded on the disk recording medium 9100, the optical disk drive 9005 reads out a bit stream from the inserted disk recording medium 9100, and sends the read bit stream to the image decoding unit 9008 of the codec IC 9002 via the bus 9010. The image decoding unit 9008 executes image decoding processing in the image decoding apparatus according to the embodiment of the present invention on the input bit stream, and sends the decoded image to an external monitor 9103 via the video interface 9009. Further, the encoding / decoding apparatus 9000 has a network interface 9006 and can be connected to an external distribution server 9106 and a mobile terminal 9107 via the network 9101. When the user desires to play back an image recorded on the distribution server 9106 or the mobile terminal 9107 instead of the image recorded on the disk recording medium 9100, the network interface 9006 obtains a bit stream from the network 9101 instead of reading out a bit stream from the input disk recording medium 9100. Further, when the user desires to play back an image recorded in the memory 9004, image decoding processing in the image decoding apparatus according to the embodiment of the present invention is executed on the bit stream recorded in the memory 9004.

[0206] When the user desires to perform an operation to encode an image captured by an external camera 9102 and record it in the memory 9004, the video interface 9009 inputs the image from the camera 9102 and sends it to the image encoding unit 9007 of the codec IC 9002 via the bus 9010. The image encoding unit 9007 executes image encoding processing in the image encoding apparatus according to the embodiment of the present invention on the image input via the video interface 9009, and creates a bit stream. Then, the bit stream is sent to the memory 9004 via the bus 9010. When the user desires to record the bit stream on the disk recording medium 9100 instead of the memory 9004, the optical disk drive 9005 writes out the bit stream to the inserted disk recording medium 9100.

[0207] It is also possible to implement a hardware configuration that has an image encoding device but no image decoding device, or a hardware configuration that has an image decoding device but no image encoding device. Such a hardware configuration is realized, for example, by replacing the codec IC 9002 with an image encoding unit 9007 or an image decoding unit 9008, respectively.

[0208] Of course, the above processing related to encoding and decoding may be realized as a transmission, storage, and reception device using hardware, or may be realized by firmware stored in a ROM (Read Only Memory), flash memory, etc., or software such as a computer. The firmware program and software program may be recorded on a computer-readable recording medium and provided, or may be provided from a server through a wired or wireless network, or may be provided as data broadcasting of terrestrial or satellite digital broadcasting.

[0209] As described above, the present invention has been explained based on the embodiments. The embodiments are examples, and it is understood by those skilled in the art that various modifications are possible for each combination of these components and each processing process, and such modifications are also within the scope of the present invention.

Industrial Applicability

[0210] The present invention can be used in image encoding and decoding technologies that divide an image into blocks and perform prediction.

Explanation of Signs

[0211] 100 Image Encoding Device, 101 Block Division Unit, 102 Inter-Prediction Unit, 103 Intra-Prediction Unit, 104 Decoded Image Memory, 105 Prediction Method Determination Unit, 106 Residual Generation Unit, 107 Orthogonal Transformation and Quantization Unit, 108 Bit-Stream Encoding Unit, 109 Inverse Quantization and Inverse Orthogonal Transformation Unit, 110 Decoded Image Signal Superposition Unit, 111 Encoded Information Storage Memory, 200 Image Decoding Device, 201 Bit-Stream Decoding Unit, 202 Block Division Unit, 203 Inter-Prediction Unit 204 Intra-Prediction Unit, 205 Encoded Information Storage Memory 206 Inverse Quantization and Inverse Orthogonal Transformation Unit, 207 Decoded Image Signal Superposition Unit, 208 Decoded Image Memory.< / poc>

Claims

1. An image encoding apparatus that encodes a moving image in block units using inter prediction based on inter prediction information to generate a bitstream, comprising: a spatial merge candidate derivation unit that derives spatial merge candidates from inter prediction information of blocks spatially adjacent to a block to be processed; a temporal merge candidate derivation unit that derives different temporal merge candidates from blocks located at the same position or in the vicinity thereof as the block to be processed included in a picture different from the picture to be processed; a normal merge candidate list construction unit that constructs a normal merge candidate list including the spatial merge candidates and the temporal merge candidates; a normal merge candidate selection unit that selects a normal merge candidate that becomes single prediction or dual prediction from the normal merge candidate list based on a merge index; a triangular merge candidate selection unit that selects a first triangular merge candidate that becomes single prediction from the normal merge candidate list based on a first triangular merge index, and selects a second triangular merge candidate that becomes single prediction from the normal merge candidate list based on a second triangular merge index; an encoding unit that encodes the merge index, or the first triangular merge index and the second triangular merge index; and comprising wherein the first triangular merge index and the second triangular merge index select the first triangular merge candidate and the second triangular merge candidate from the normal merge candidate list in different priorities. An image encoding apparatus.

2. An image encoding method that encodes a moving image in block units using inter prediction based on inter prediction information to generate a bitstream, comprising: a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to a block to be processed; a temporal merge candidate derivation step of deriving different temporal merge candidates from blocks located at the same position or in the vicinity thereof as the block to be processed included in a picture different from the picture to be processed; a normal merge candidate list construction step of constructing a normal merge candidate list including the spatial merge candidates and the temporal merge candidates; a normal merge candidate selection step of selecting a normal merge candidate that becomes single prediction or dual prediction from the normal merge candidate list based on a merge index; A triangular merge candidate selection step of selecting a first triangular merge candidate that is a single prediction from the normal merge candidate list based on the first triangular merge index, and selecting a second triangular merge candidate that is a single prediction from the normal merge candidate list based on the second triangular merge index; An encoding step of encoding the merge index, or the first triangular merge index and the second triangular merge index; comprising: An image encoding method, wherein the first triangular merge index and the second triangular merge index select the first triangular merge candidate and the second triangular merge candidate from the normal merge candidate list in different priorities.

3. An image decoding apparatus for decoding a bit stream encoded by using inter prediction in block units of a moving image, A decoding unit that decodes a merge index, or a first triangular merge index and a second triangular merge index; A spatial merge candidate derivation unit that derives spatial merge candidates from inter prediction information of blocks spatially adjacent to a block to be processed; A temporal merge candidate derivation unit that derives different temporal merge candidates from blocks located at the same position or in the vicinity thereof as the block to be processed and included in a picture different from the picture to be processed; A normal merge candidate list construction unit that constructs a normal merge candidate list including the spatial merge candidates and the temporal merge candidates; A normal merge candidate selection unit that selects a normal merge candidate that is a single prediction or a dual prediction from the normal merge candidate list based on the merge index; A triangular merge candidate selection unit that selects a first triangular merge candidate that is a single prediction from the normal merge candidate list based on the first triangular merge index, and selects a second triangular merge candidate that is a single prediction from the normal merge candidate list based on the second triangular merge index; comprising: An image decoding apparatus, wherein the first triangular merge index and the second triangular merge index select the first triangular merge candidate and the second triangular merge candidate from the normal merge candidate list in different priorities.

4. An image decoding method for decoding a bit stream encoded by using inter prediction in block units of a moving image, a decoding step of decoding a merge index, or a first triangular merge index and a second triangular merge index; a spatial merge candidate derivation step of deriving a spatial merge candidate from inter-prediction information of a block spatially adjacent to a block to be processed; a temporal merge candidate derivation step of deriving different temporal merge candidates from blocks located at the same position or in the vicinity thereof as the block to be processed and included in a picture different from the picture to be processed; a normal merge candidate list construction step of constructing a normal merge candidate list including the spatial merge candidate and the temporal merge candidate; a normal merge candidate selection step of selecting a normal merge candidate for single prediction or dual prediction from the normal merge candidate list based on the merge index; a triangular merge candidate selection step of selecting a first triangular merge candidate for single prediction from the normal merge candidate list based on the first triangular merge index, and selecting a second triangular merge candidate for single prediction from the normal merge candidate list based on the second triangular merge index; comprising an image decoding method, wherein the first triangular merge index and the second triangular merge index respectively select the first triangular merge candidate and the second triangular merge candidate from the normal merge candidate list in different priorities.

5. A storage method for storing a bitstream generated according to the image encoding method described in Claim 2 in a recording medium.

6. A transmission method for transmitting a bitstream generated according to the image encoding method described in Claim 2.

Citation Information

Patent Citations

  • Moving image decoder, moving image decoding method, moving image decoding program, receiving device, receiving method, and receiving program

    JP2013118627A

  • Image encoding device, image encoding method, image encoding program, image decoding device, image decoding method, and image decoding program

    JP7554986B2

  • Apparatuses and methods for inter prediction of a triangle partition of a coding block

    WO2020073896A1

  • An encoder, a decoder and corresponding methods for inter prediction

    WO2020106190A1

  • Triangle motion information for video coding

    WO2020118064A1