Image Encoding Apparatus and Image Encoding Method, and Image Decoding Apparatus and Image Decoding Method
By constructing and selecting merge candidates using a merge candidate construction unit, the proposed technique addresses the high processing load issue in existing image encoding and decoding methods, achieving efficient and low-load image processing.
Patent Information
- Application Number
- JP2024140637
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-03-08
- Filing Date
- 2024-08-22
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2040-03-06
AI Technical Summary
The existing image encoding and decoding techniques, particularly those involving affine transformations, face a significant challenge with extremely high processing loads, which hinders efficient encoding and decoding.
The proposed solution involves a merge candidate construction unit that creates a list of merge candidates, including spatial and normal merge candidates, as well as triangular merge candidates. These candidates are selected based on specific indices to optimize the encoding process, thereby reducing the processing load.
This approach enables highly efficient image encoding and decoding with reduced processing load, improving overall performance and efficiency.
Smart Images

Figure 0007692177000001 
Figure 0007692177000002 
Figure 0007692177000003
Abstract
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, which are sets of a predetermined number of pixels, and processing is performed in units of blocks. By dividing into appropriate blocks and appropriately setting intra prediction (in-frame prediction) and inter prediction (inter-frame prediction), the encoding efficiency is improved.
[0003] In video encoding and decoding, the encoding efficiency is improved by inter prediction that predicts from encoded and decoded pictures. Patent Document 1 describes a technique of applying an affine transformation during inter prediction. In video, 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 of 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 And a triangular merge candidate selection unit that selects a second triangular merge candidate that is single prediction based on a second triangular merge index, wherein the first maximum triangular merge candidate number related to the first triangular merge index is the same as the maximum number of merge candidates.
Effect 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 block of the processing target (corresponding to the encoding target in the encoding process and the decoding target in the decoding process) is switched in raster scan order, that is, in the order from left to right and from top to bottom. The inside of each tree block can be further recursively divided. The block to be encoded / decoded after recursively dividing the tree block 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 processing target encoding block, 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 discriminating between 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 a 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 a plurality of reference pictures, two types of reference lists, L0 (reference list 0) and L1 (reference list 1), are defined, and reference pictures are specified using respective reference indexes. 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 a reference picture managed by L0, and L1 prediction (Pred_L1) is an inter prediction that refers to a reference picture managed by L1. Bi-prediction (Pred_BI) is an inter prediction in which L0 prediction and L1 prediction are both 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 subscript LX attached to the output in subsequent processing, it is assumed that processing is performed for each of L0 and L1.
[0013] <Predicted 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 block to be processed. The predictive motion vector is derived from a predictive motion vector candidate derived from 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 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 block to be processed from the 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 among blocks belonging to the processed image, without transmitting a differential motion vector and a reference index.
[0015] A processed block adjacent to the block to be processed and the inter prediction information of the processed block are defined as a spatial merge candidate. A block located at the same position or in the vicinity (neighborhood) of the block to be processed among blocks belonging to the processed image and the inter prediction information derived from the inter prediction information of the block are defined as a temporal merge candidate. Each merge candidate is registered in a merge candidate list, and a merge candidate used for prediction of the block to be processed 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 block to be processed. T0 is a block belonging to the processed image and located at the same position or in the vicinity (neighborhood) of the block to be processed in the image to be processed.
[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, determines a motion vector for each divided sub-block individually, and performs motion compensation. The motion vector of each sub-block is derived based on one or more control points derived from the 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 (nearby) of the block to be processed and belonging to the processed image. In this embodiment, the size of the sub-block is 4x4 pixels, but the size of the sub-block is not limited to this, and the 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 of a horizontal direction component and a 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 of a horizontal direction component and a 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 transformation motion compensation can be used in either the predictive motion vector mode or the merge mode. The mode in which affine transformation 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 transformation 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_pred_mode of intra prediction information 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), the inter_affine_flag, a 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 the one hand, in the case of the merge mode (merge_flag = 1), send merge_subblock_flag in Fig. 12B. merge_subblock_flag is a flag indicating whether to apply the sub-block merge mode. In the case of the sub-block merge mode (merge_subblock_flag = 1), send the merge index merge_subblock_idx. On the other hand, when it is not in the sub-block merge mode (merge_subblock_flag = 0), send a flag merge_triangle_flag indicating whether to apply the triangle merge mode. When applying the triangle merge mode (merge_triangle_flag = 1), send the direction merge_triangle_split_dir for dividing the block, and the merge triangle indices merge_triangle_idx0 and merge_triangle_idx1 for each of the two partitions after division. On the other hand, when not applying the triangle merge mode (merge_triangle_flag = 0), send the 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 one 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 device 100 and the image decoding device 200 according to the first embodiment of the present invention will be described.
[0025] FIG. 1 is a block diagram of the image encoding device 100 according to the first embodiment. The image encoding device 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. In addition, 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 plurality of derived 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 the 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 the 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 the 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 the 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 in 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 evaluates each of the intra prediction and the inter prediction by 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., and determines the optimal prediction mode. 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 indices 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 according to the prediction method determined by the prediction method determination unit 105 for each encoding block, in addition to information at the sequence, picture, slice, and encoding block levels. 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 encodes a flag for determining whether it is a merge mode, a sub-block merge flag, a merge index in the case of the merge mode, an inter prediction mode in the case of not the merge mode, a prediction motion vector index, information regarding the differential motion vector, a sub-block prediction motion vector flag, and other encoding information (inter prediction information) according to a prescribed syntax (syntactic rules of the bit sequence) to generate a first bit sequence. When the prediction mode is intra prediction (MODE_INTRA), the bit sequence encoding unit 108 encodes encoding information such as the intra prediction mode according to a prescribed syntax (syntactic rules 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 a prescribed 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 a prescribed 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 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 for reducing distortion such as block distortion due to encoding on the decoded image and then store it in the decoded image memory 104.
[0036] The symbolized information storage memory 111 stores the symbolized 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 symbolized information stored in the symbolized information storage memory 111 includes the determined motion vector, the reference indexes of the reference lists L0 and L1, the historical prediction motion vector candidate list, and other inter prediction information. In the case of the merge mode of inter prediction, the symbolized information stored in the symbolized information storage memory 111 includes, in addition to the above-mentioned various information, the merge index, the information indicating whether it is a sub-block merge mode (sub-block merge flag), and other inter prediction information. In the case of the prediction motion vector mode of inter prediction, the symbolized information stored in the symbolized information storage memory 111 includes, in addition to the above-mentioned various information, the inter prediction mode, the prediction motion vector index, the differential motion vector, the information indicating whether it is a sub-block prediction motion vector mode (sub-block prediction motion vector flag), and other inter prediction information. In the case of intra prediction, the symbolized information stored in the symbolized information storage memory 111 includes the 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 symbolized information storage memory 205, an inverse quantization / inverse orthogonal transformation unit 206, a decoded image signal superposition unit 207, and a decoded image memory 208.
[0038] Since the decoding process of the image decoding apparatus in FIG. 2 corresponds to the decoding process provided inside the image encoding apparatus in FIG. 1, each configuration of the symbolized information storage memory 205, the inverse quantization / inverse orthogonal transformation unit 206, the decoded image signal superposition unit 207, and the decoded image memory 208 in FIG. 2 has functions corresponding to those of the symbolized information storage memory 111, the inverse quantization / inverse orthogonal transformation unit 109, the decoded image signal superposition unit 110, and the decoded image memory 104 of the image encoding apparatus in FIG. 1, respectively.
[0039] The bit stream supplied to the bit string decoding unit 201 is separated according to the rules of a prescribed syntax. The bit string decoding unit 201 decodes the separated first bit string to obtain information on a sequence, a picture, a slice, an encoded block unit, and encoded information of the encoded block unit. Specifically, the bit string decoding unit 201 decodes a prediction mode PredMode for determining whether it is an inter prediction (MODE_INTER) or an intra prediction (MODE_INTRA) in units of encoded block units. When the prediction mode is an inter prediction (MODE_INTER), the bit string decoding unit 201 decodes encoded information (inter prediction information) regarding a flag for determining 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 encoded information (inter prediction information) to the encoded 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), the bit string decoding unit 201 decodes encoded information (intra prediction information) such as an intra prediction mode according to the prescribed syntax, and supplies the encoded information (intra prediction information) to the encoded information storage memory 205 via the inter prediction unit 203 or the intra prediction unit 204 and the block division unit 202. The bit string decoding unit 201 decodes the separated second bit string to calculate a residual subjected to orthogonal transformation and quantization, and supplies the residual subjected to orthogonal transformation and quantization 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 the 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 sequence 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 sequence 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 in 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 symbolic 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], predFlagL1[xP][yP] indicating whether to use the L0 prediction and L1 prediction of the selected merge candidate, the reference indexes refIdxL0[xP][yP], refIdxL1[xP][yP] of L0 and L1, and the inter prediction information such as the motion vectors mvL0[xP][yP], 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 that has been inverse orthogonally transformed and inverse quantized by the inverse quantization and inverse orthogonal transformation unit 206 to decode the decoded image signal, and stores 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 and 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, scanning is performed 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 or not 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 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 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 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 block 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. 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. 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 block to be processed, scan from left to right and from top to bottom in 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 is not transmitted 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 the block division of the first embodiment is shown in FIG. 9. coding_quadtree() represents the syntax related to the 4-division process of a block. multi_type_tree() represents the syntax related to the 2-division or 3-division process of a block. qt_split is a flag indicating whether to divide a block into 4 parts. When dividing a block into 4 parts, qt_split = 1; when not dividing into 4 parts, qt_split = 0. In the case of dividing into 4 parts (qt_split = 1), for each of the 4-divided blocks, the 4-division process is recursively performed (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). In the case of not dividing into 4 parts (qt_split = 0), subsequent division is determined according to multi_type_tree(). mtt_split is a flag indicating whether to further divide. When further dividing (mtt_split = 1), mtt_split_vertical, which is a flag indicating whether to divide vertically or horizontally, and mtt_split_binary, which is a flag for determining whether to divide into 2 parts or 3 parts, are transmitted. mtt_split_vertical = 1 indicates dividing vertically, and mtt_split_vertical = 0 indicates dividing horizontally. mtt_split_binary = 1 indicates dividing into 2 parts, and mtt_split_binary = 0 indicates dividing into 3 parts. In the case of dividing into 2 parts (mtt_split_binary = 1), for each of the 2-divided blocks, the division process is recursively performed (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). In the case of dividing into 3 parts (mtt_split_binary = 0), for each of the 3-divided blocks, the division process is recursively performed (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 apparatus in FIG. 1 and the inter prediction unit 203 of the image decoding apparatus 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 apparatus 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 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 serve as 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] Based on the inter prediction information supplied from the normal prediction motion vector mode derivation unit 301, normal merge mode derivation unit 302, sub-block prediction motion vector mode derivation unit 303, and sub-block merge mode derivation unit 304, the inter prediction mode determination unit 305 determines the inter prediction information. 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] Based on the determined inter prediction information, the motion compensation prediction unit 306 performs inter prediction on the reference image signal stored in the decoded image memory 104. 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] Normally, the predicted motion vector mode derivation unit 401 derives a plurality of normal predicted motion vector candidates, selects a predicted motion vector, and calculates an addition value of the selected predicted 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 predicted 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 predicted 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 predicted motion vector mode derivation unit 403, a plurality of sub-block predicted motion vector candidates are derived, a sub-block predicted motion vector is selected, and an addition value of the selected sub-block predicted 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 predicted 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> The normal prediction motion vector mode derivation processing procedure on the encoding side will be described with reference to FIG. 19. 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 vector mvdL1 of the motion vector mvL1 for L1 is calculated respectively.
[0078] For each of L0 and L1, the differential motion vector calculation process is performed, but the processes for both 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 in LX is 0, and in the process of calculating the differential motion vector for L1, X in 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). In the normal predicted motion vector mode derivation unit 301, 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 derive candidates for a plurality of predicted motion vectors to construct a predicted motion vector candidate list mvpListLX. 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 candidate 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 encoding these difference motion vectors 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 number of the index i 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 to calculate the differential motion vector mvdLX of LX (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 supplementation 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 both 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 LX being calculated 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 supplementation 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 using the flowchart of FIG. 20.
[0085] Subsequently, the predicted motion vector candidate selection unit 426 selects the candidate mvpListLX[mvpIdxLX] of the predicted motion vector corresponding to the index mvpIdxLX of the predicted motion vector decoded and supplied by the bit sequence decoding unit 201 from the predicted motion vector candidate list mvpListLX as the selected predicted 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 and supplied by the bit sequence decoding unit 201 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 a normal prediction motion vector mode derivation process 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 the 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, a variable numCurrMvpCand indicating the number of prediction motion vector candidates registered in the prediction motion vector candidate list mvpListLX is set to 0.
[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, the prediction motion vector mvLXA is derived, and the derived mvLXA is added to the prediction motion vector candidate list mvpListLX (step S301 in FIG. 20). Here, 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, the prediction motion vector mvLXB is derived, and 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, the motion vector mvLXN, and the 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, the motion vector mvLXCol, the reference index refIdxCol, and the 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). The details of the registration processing procedure in this step S304 will be described later using the flowchart of FIG. 29.
[0093] Subsequently, the prediction motion vector candidate supplementing 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 supplementing 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 supplementing 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). Therefore, the processes 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, as elements, a merge index indicating the location inside the merge candidate list and a merge candidate corresponding to the index. 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 processes, the merge candidate with 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, a 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 in the order of B1, A1, B0, A0, B2 from the encoding information stored in the encoding information storage memory 111 of the image encoding device or the encoding 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, spatial merge candidates using the inter prediction information of the blocks included in the encoding block to be processed are not 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 is performed for the temporal merge candidate, 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 in 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 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 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 units 346 and 446, when the number of merge candidates numCurrMergeCand registered in the 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 the merge candidate list mergeCandList, and are registered in the 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 units 347 and 447, merge candidates are selected from the merge candidates registered in the 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 the motion compensation prediction unit 306 via the 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 the motion compensation prediction unit 406.
[0106] <Update of the 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 encoded information storage memory 111 and the encoded 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, the history prediction motion vector candidate list HmvpCandList is updated when the prediction method determination unit 105 selects the normal prediction motion vector mode or the normal merge mode. On the decoding side, the history prediction motion vector candidate list HmvpCandList is updated 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.
[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 refIdxL0 of L0 and the reference index refIdxL1 of L1, the L0 prediction flag predFlagL0 indicating whether L0 prediction is performed or not, the L1 prediction flag predFlagL1 indicating whether L1 prediction is performed or not, 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 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, delete that element 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, delete the first element of the history prediction motion vector candidate list HmvpCandList, and add the inter-prediction information candidate hMvpCand 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 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, initialize the history prediction motion vector candidate list HmvpCandList in units of slices (step S2101 in FIG. 26). At the start of the slice, empty all elements of the history prediction motion vector candidate list HmvpCandList, and set 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 to 0.
[0113] Note that 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, for each encoded block within the slice, repeatedly perform the following update process for the history prediction motion vector candidate list HmvpCandList (steps S2102 to S2107 in FIG. 26).
[0115] First, perform initial settings in units of encoding blocks. Set a FALSE (false) value to the flag identicalCandExist indicating whether there is an identical candidate, 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 sequence 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 sequence 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 of FIG. 27), the processing 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 value TRUE (true) is set to the flag identicalCandExist indicating whether there is an identical candidate, the value of the current history prediction motion vector index hMvpIdx is set to the deletion target index removeIdx indicating the position of the element to be deleted, and this identical element confirmation processing 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 processing after step S2123 is performed.
[0118] Returning again to the flowchart of FIG. 26, the elements of the history prediction motion vector candidate list HmvpCandList are shifted and added (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, it is determined 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, the flag identicalCandExist indicating whether the same candidate exists is compared with 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), a new element is added after removing the elements stored in the history prediction motion vector candidate list HmvpCandList. The initial value of the index i is set to the value of removeIdx + 1. From this initial value to NumHmvpCand, the element shift processing in step S2143 is repeated. (Steps S2142 to S2144 in FIG. 28). The elements are shifted forward by copying the element of HmvpCandList[i] to HmvpCandList[i - 1] (step S2143 in FIG. 28), and i is incremented by 1 (steps S2142 to S2144 in FIG. 28). Subsequently, the inter-prediction information candidate hMvpCand is added to HmvpCandList[NumHmvpCand - 1], which corresponds to the last of the history prediction motion vector candidate list, counted from 0 (step S2145 in FIG. 28), and the element shift / addition processing of the present history prediction motion vector candidate list HmvpCandList is terminated.On the other hand, if the flag identicalCandExist indicating whether the same candidate exists is not TRUE (true) and neither condition of NumHmvpCand being 6 is satisfied (step S2141: NO in FIG. 28), the candidate hMvpCand of the inter-prediction information is added to the end of the list of candidate history prediction motion vectors HmvpCandList without removing the elements stored in the list of candidate history prediction motion vectors HmvpCandList (step S2146 in FIG. 28). Here, the end of the list of candidate history prediction motion vectors refers to HmvpCandList[NumHmvpCand] counted from 0. Also, NumHmvpCand is incremented by 1 to end the element shift and addition process for the list of candidate history prediction motion vectors HmvpCandList.
[0119] FIG. 31 is a diagram for explaining an example of the update process of the list of candidate history prediction motion vectors. When adding a new element to the list of candidate history prediction motion vectors HmvpCandList with six registered elements (inter-prediction information), the new element is compared with the elements in the list of candidate history prediction motion vectors HmvpCandList in order from the front element (FIG. 31A). If the new element has the same value as the third element HMVP2 from the head of the list of candidate history prediction motion vectors HmvpCandList, the element HMVP2 is deleted from the list of candidate history prediction motion vectors HmvpCandList, and the subsequent elements HMVP3 to HMVP5 are shifted (copied) forward by one position each. Then, the new element is added to the end of the list of candidate history prediction motion vectors HmvpCandList (FIG. 31B), and the update of the list of candidate history prediction motion vectors HmvpCandList is completed (FIG. 31C).
[0120] <Candidate History Prediction Motion Vector Derivation Process> Next, a method for deriving a history prediction motion vector candidate from a history prediction motion vector candidate list HmvpCandList, which is the 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 of current prediction motion vector candidates numCurrMvpCand is greater than or equal to the maximum number of elements in the prediction motion vector candidate list mvpListLX (here, it is set to 2), or if the number of history prediction motion vector candidates NumHmvpCand has a value of 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 of current prediction motion vector candidates numCurrMvpCand is less than 2, which is the maximum number of elements in the prediction motion vector candidate list mvpListLX, and the value of the number of history prediction motion vector candidates NumHmvpCand 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 of history prediction motion vector candidates numCheckedHMVPCand (steps S2202 to S2209 in FIG. 29). If the number of current prediction motion vector candidates numCurrMvpCand is greater than or equal to 2, which is the maximum number of elements in 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 of current prediction motion vector candidates numCurrMvpCand is less than 2, which is the maximum number of elements in 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 respectively 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 this historical predicted motion vector candidate derivation processing procedure ends. 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 historical predicted motion vector candidate list HmvpCandList, when the element has the same reference index as the reference index refIdxLX of the motion vector to be encoded / decoded 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 historical 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 historical predicted motion vector candidate list HmvpCandList that has the same reference index as the reference index refIdxLX of the motion vector to be encoded / decoded 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 processing from step 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. If the index i is less than or equal to the smaller value of 4 and the number of history prediction motion vector candidates NumHmvpCand, perform the processing after step S2203 again (steps S2202 to S2209 in FIG. 29).
[0126] <History Merge Candidate Derivation Processing> 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 of elements numCurrMergeCand 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 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, end this history merge candidate derivation process (NO in step S2303 of FIG. 30). If the number numCurrMergeCand of elements registered in the current merge candidate list is less than (the maximum number of merge candidates MaxNumMergeCand - 1), perform the processing after step S2304. Set FALSE (false) to sameMotion (step S2304 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) of the merge candidate 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 iterative 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 element HmvpCandList[NumHmvpCand - hMvpIdx] at the (NumHmvpCand - hMvpIdx)-th position counted from 0 in the history predicted motion vector candidate list does not exist in the merge candidate list, the element HmvpCandList[NumHmvpCand - hMvpIdx] at the (NumHmvpCand - hMvpIdx)-th position counted from 0 in the history predicted motion vector candidate list is added to the mergeCandList at the numCurrMergeCand-th position of 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 iterative process of steps S2302 to S2311 of FIG. 30 is performed. When the confirmation of all elements in the history predicted motion vector candidate list is completed, or when merge candidates are added to all elements in the merge candidate list, the derivation process of this 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). When 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 mergeCandList[i] and mergeCandList[j] are not both 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 derivation process of 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. A reference index and a motion vector are derived from the acquired inter prediction information, and after acquiring an image signal at a position obtained by moving the reference picture specified by the reference index in the decoded image memory 104 by the amount of the motion vector from the same position as the image signal of the block that is the target of the prediction process, 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 weighted average of the prediction signals obtained 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 of the dual prediction is 1:1, but other ratios may be used for the weighted average. For example, the ratio of the weighting may be increased as the picture interval between the picture to be predicted and the reference picture is closer. Also, the calculation of the weighting ratio may be performed using a correspondence table between the combination of picture intervals and the weighting ratio.
[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 superposition 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. FIG. 34 shows a 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. FIG. 35 shows a 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. FIG. 36 shows a 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 in the past direction and L1 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 made 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 made 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 bit stream together with the differential motion vector.
[0145] <Motion compensation processing based on the normal prediction motion vector mode> 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 as shown in the inter-prediction unit 102 on the encoding side of FIG. 16, the motion compensation prediction unit 306 obtains 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, when the switch 408 is connected to the normal prediction motion vector mode derivation unit 401 during decoding as shown in the inter-prediction unit 203 on the decoding side of FIG. 22, the motion compensation prediction unit 406 obtains 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> When the inter-prediction information by the normal merge mode derivation unit 302 is selected in the inter-prediction mode determination unit 305 as shown in the inter-prediction unit 102 on the encoding side of FIG. 16, the motion compensation prediction unit 306 obtains 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 the decoding process, 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 the 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 the decoding process, 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 the sub-block merge mode> The motion compensation prediction unit 306, as also shown by the inter prediction unit 102 on the encoding side in 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, 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, the motion compensation prediction unit 406, as also shown by the inter prediction unit 203 on the decoding side in FIG. 22, when the switch 408 is connected to the sub-block merge mode derivation unit 404 during the decoding process, 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 performed 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 six-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 six-parameter affine model is not performed. 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 six-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, motion compensation using a 6-parameter affine model is used to generate the motion compensation prediction signal for the current CU being processed. If cu_affine_type_flag is 0, motion compensation using a 4-parameter affine model is used to generate the motion compensation prediction signal for the current CU being processed.
[0158] In motion compensation using an affine model, since the reference index and motion vector are derived in units of sub-blocks, a motion compensation prediction signal is generated using the reference index and motion vector being processed in units of sub-blocks.
[0159] The 4-parameter affine model is a mode in which the motion vector of a sub-block is derived from four parameters, namely the horizontal and vertical components of the motion vectors of two control points, and motion compensation is performed in units of sub-blocks.
[0160] <Triangle Merge Mode> The triangle merge mode is a type of merge mode and is a mode in which motion compensation prediction is performed by dividing the inside of the encoding / decoding block into diagonal partitions. The triangle merge mode is a type of geometric partitioning merge mode that divides the encoding / decoding block into a block with a non-rectangular shape, and in the geometric partitioning merge mode, it corresponds to the mode of dividing the encoding / decoding block into two right triangles by a diagonal line. The geometric division merge mode is represented by a combination of two parameters, for example, an index (angleIdx) indicating the division 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 division merge mode and are coded with a fixed length. Among the 64 patterns, two modes in which the index indicating the division angle forms an angle of the diagonal line 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 division boundary passes through the center of the coded block) indicate that the coded block is divided by the diagonal line 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 a 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: a single prediction partition 0 (UNI0), a single prediction partition 1 (UNI1), and a bi-prediction partition 2 (BI). Here, the sub-blocks above the diagonal line are assigned to partition 0, the sub-blocks below the diagonal line are assigned to partition 1, and the sub-blocks on the diagonal line 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 double 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 double 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 double 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, giving priority to 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, giving priority to 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 in the motion information list L0 (step S3601). 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 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 in the motion information list L1 (step S3603). If candidate M has the motion information in the motion information list L1, the motion information in the motion information list L1 of candidate M is set as the 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 in the motion information list L1 (step S3701). If candidate M has the motion information in the motion information list L1, the motion information in the motion information list L1 of candidate M is set as the 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 in the motion information list L0 (step S3703). 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 S3704). For candidates M (M = numMergeCand - 1, …, 1, 0), steps S3703 and S3704 are performed in descending order 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 in 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 in the motion information list L0 is MV0_L0, and the motion information in 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 in the motion information list L0 is MV1_L0, and it has no motion information in 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 in the motion information list L0, and the motion information in 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 in the motion information list L0 is MV3_L0, and the motion information in 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 in the motion information list L0 is MV4_L0, and it has no motion information in 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 becomes 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] Thus, it is a feature of the present invention to change the priority order of motion information in merge triangle partition 0 and merge triangle partition 1, reuse the merge candidate list, suppress the possibility of overlap of motion information between merge triangle partition 0 and merge triangle partition 1, and derive triangular merge candidates with high coding efficiency. The single-prediction motion information of merge triangle partition 0 may be derived with priority given to motion information list L1, and the single-prediction motion information of merge triangle partition 1 may be derived with priority given to motion information list L0.
[0181] (Modification 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, it is assumed that the maximum number of triangular merge candidates for merge triangle index 1 is one less than the maximum number of triangular merge candidates for merge triangle index 0. At this time, the merge candidate selected with merge triangle index 0 is excluded 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 one 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 one 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 duplication 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, since 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, 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 the motion information list L0 of candidate M is set as the triangular merge candidate (step S3802). For candidate 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 the motion information list L1 of candidate M is set as the triangular merge candidate (step S3804). For candidate 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 the motion information list L1 of candidate M is set as the triangular merge candidate (step S3902). For candidate 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 in 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, it is a feature of the present invention to derive a triangular merge candidate with high coding efficiency. The single-prediction motion information of the merge triangle partition 0 may be derived by prioritizing the motion information list L1, and the single-prediction motion information of the merge triangle partition 1 may be derived by prioritizing 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 triangular 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 triangular merge candidates for merge triangle index 1 is one less than the maximum number of triangular merge candidates for merge triangle index 0. At this time, the merge candidate selected with merge triangle index 0 is excluded as a 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 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 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.
[0198] 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 a 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 then transmitted. In that case, a transmitting 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 receiving 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 transmitting device includes a memory that buffers the bitstream output by the image encoding device, a packet processing unit that packetizes the bitstream, and a transmitting unit that transmits the packetized encoded data via the network. The receiving device includes a receiving 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 into 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 embodiment 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 apparatus 9000 to execute an operation desired by the user based on a 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 an image decoding process 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 or 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. Also, when the user desires to play back an image recorded in the memory 9004, an image decoding process 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 an image encoding process 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 the image encoding unit 9007 or the image decoding unit 9008, respectively.
[0208] Of course, the above-described processing related to encoding and decoding may be realized as a transmission, storage, and reception device using hardware, or may also be realized by firmware stored in a ROM (Read Only Memory), a flash memory, or the like, or software such as a computer. The firmware program and the 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 described based on the embodiments. The embodiments are illustrative, and it is understood by those skilled in the art that various modifications are possible in the combination of each component 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 / Quantization Unit, 108 Bit-Stream Encoding Unit, 109 Inverse Quantization / 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 / Inverse Orthogonal Transformation Unit, 207 Decoded Image Signal Superposition Unit, 208 Decoded Image Memory.< / poc>
Claims
1. An image encoding device that encodes a moving image by using inter prediction based on inter prediction information on a block-by-block basis to generate a bit stream, comprising: a spatial merge candidate derivation unit that derives spatial merge candidates from inter prediction information of blocks spatially adjacent to the current block; a temporal merge candidate derivation unit that derives different temporal merge candidates from a block located at the same position as the target block or a block located in a vicinity of the target block, the block being included in a picture different from the target picture; a normal merge candidate list constructor 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 to be uni-predictive or bi-predictive from the normal merge candidate list based on a merge index; a triangle merge candidate selection unit that selects a first triangle merge candidate that is uni-predictive from the normal merge candidate list based on a first triangle merge index, and selects a second triangle merge candidate that is uni-predictive from the normal merge candidate list based on a second triangle merge index; Equipped with The image coding device, characterized in that the first triangle merge index and the second triangle merge index select the first triangle merge candidate and the second triangle merge candidate from the normal merge candidate list, respectively, in different priority orders.
2. 1. An image coding method for coding a moving image on a block-by-block basis using inter prediction based on inter prediction information to generate a bit stream, comprising: a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to the current block; a temporal merge candidate derivation step of deriving different temporal merge candidates from a block located at the same position as the current block or a block located in a vicinity of the current block, the block being included in a picture different from the current picture; 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 to be uni-predictive or bi-predictive from the normal merge candidate list based on a merge index; a triangle merge candidate selection step of selecting a first triangle merge candidate that is uni-predictive from the normal merge candidate list based on a first triangle merge index, and selecting a second triangle merge candidate that is uni-predictive from the normal merge candidate list based on a second triangle merge index; Equipped with the first triangle merge index and the second triangle merge index select the first triangle merge candidate and the second triangle merge candidate from the normal merge candidate list, respectively, in different priorities.
3. An image decoding device that decodes a bit stream in which a moving image is coded using inter prediction on a block-by-block basis, comprising: a spatial merge candidate derivation unit that derives spatial merge candidates from inter prediction information of blocks spatially adjacent to the current block; a temporal merge candidate derivation unit that derives different temporal merge candidates from a block located at the same position as the target block or a block located in a vicinity of the target block, the block being included in a picture different from the target picture; a normal merge candidate list constructor 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 to be uni-predictive or bi-predictive from the normal merge candidate list based on a merge index; a triangle merge candidate selection unit that selects a first triangle merge candidate that is uni-predictive from the normal merge candidate list based on a first triangle merge index, and selects a second triangle merge candidate that is uni-predictive from the normal merge candidate list based on a second triangle merge index; Equipped with The image decoding device, characterized in that the first triangle merge index and the second triangle merge index select the first triangle merge candidate and the second triangle merge candidate from the normal merge candidate list, respectively, in different priorities.
4. 1. An image decoding method for decoding a bit stream in which a moving image is coded using inter prediction on a block-by-block basis, the method comprising: a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to the current block; a temporal merge candidate derivation step of deriving different temporal merge candidates from a block located at the same position as the current block or a block located in a vicinity of the current block, the block being included in a picture different from the current picture; 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 to be uni-predictive or bi-predictive from the normal merge candidate list based on a merge index; a triangle merge candidate selection step of selecting a first triangle merge candidate that is uni-predictive from the normal merge candidate list based on a first triangle merge index, and selecting a second triangle merge candidate that is uni-predictive from the normal merge candidate list based on a second triangle merge index; Equipped with the first triangle merge index and the second triangle merge index select the first triangle merge candidate and the second triangle merge candidate from the normal merge candidate list, respectively, in different priorities.
5. A method for storing a bit stream generated according to the image coding method according to claim 2 on a recording medium.
6. A transmission method for transmitting a bit stream generated according to the image coding method according to claim 2.
Citation Information
Patent Citations
Moving image coding / decoding device using moving compensation inter-frame prediction system employing affine transformation
JP1997172644A
Apparatuses and methods for inter prediction of a triangle partition of a coding block
WO2020073896A1