Image encoding device, image encoding method, and image encoding program
Patent Information
- Application Number
- JP2019171786
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-03-08
- Filing Date
- 2019-09-20
- Publication Date
- 2025-03-03
- Estimated Expiration
- 2039-09-20
AI Technical Summary
【0007】 本発明によれば、高効率な画像符号化·復号処理を低負荷で実現することができる。
Smart Images

Figure 0007637885000001 
Figure 0007637885000002 
Figure 0007637885000003
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 technology]
[0002] In image encoding and decoding, the image to be processed is divided into blocks, which are collections of a certain number of pixels, and processed on a block-by-block basis. By dividing the image into appropriate blocks and appropriately setting intra-frame prediction (intra-prediction) and inter-frame prediction (inter-prediction), the encoding efficiency can be improved.
[0003] In video coding and decoding, coding efficiency is improved by inter-prediction, which predicts from pictures that have already been coded and decoded. Patent Document 1 describes a technique for applying affine transformation during inter-prediction. In video, it is not uncommon for objects to undergo transformations such as enlargement, reduction, and rotation, and applying the technique of Patent Document 1 enables efficient coding. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Japanese Patent Application Publication No. 9-172644 Summary of the Invention [Problem to be solved by the invention]
[0005] However, the technique of Patent Document 1 involves image conversion, and therefore has the problem of a large processing load. In view of the above problem, the present invention provides an efficient encoding technique with a low load. [Means for solving the problem]
[0006] In order to solve the above problem, an image coding device of one embodiment of the present invention is an image coding device that codes a moving image using inter prediction on a block-by-block basis, and includes an coding information storage unit that stores inter prediction information of a coded block, a spatial inter prediction information candidate derivation unit that derives a spatial inter prediction information candidate from the inter prediction information of a block that is spatially adjacent to the block to be coded, and sets the spatial inter prediction information candidate as the inter prediction information candidate, and a historical inter prediction information candidate derivation unit that derives a historical inter prediction information candidate from the inter prediction information stored in the coding information storage unit, and sets the historical inter prediction information candidate as the inter prediction information candidate, wherein the historical inter prediction information candidate derivation unit compares a predetermined number of elements from the latest inter prediction information stored in the coding information storage unit with the spatial inter prediction information candidate, and sets the spatial inter prediction information candidate as the inter prediction information candidate if all inter prediction information is different. 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] 1 is a block diagram of an image encoding device according to an embodiment of the present invention. [Diagram 2] 1 is a block diagram of an image decoding device according to an embodiment of the present invention. [Diagram 3] 13 is a flowchart for explaining an operation of dividing a tree block. [Figure 4] FIG. 13 is a diagram showing how an input image is divided into tree blocks. [Diagram 5] FIG. 1 is a diagram illustrating a z-scan. [Figure 6] FIG. 13 is a diagram showing the divided shapes of blocks. [Figure 7] 13 is a flowchart for explaining an operation of dividing a block into four. [Figure 8] 13 is a flowchart for explaining an operation of dividing a block into two or three. [Figure 9]This is a syntax for expressing the shape of block division. [Figure 10] FIG. 1 is a diagram illustrating intra prediction. [Figure 11] FIG. 13 is a diagram for explaining reference blocks for inter prediction. [Figure 12] This is a syntax for expressing a coding block prediction mode. [Figure 13] FIG. 11 is a diagram showing the correspondence between syntax elements and modes relating to inter prediction. [Figure 14] FIG. 13 is a diagram for explaining affine transformation motion compensation of two control points. [Figure 15] FIG. 13 is a diagram for explaining affine transformation motion compensation of three control points. [Figure 16] FIG. 2 is a block diagram showing a detailed configuration of the inter prediction unit 102 in FIG. [Figure 17] 17 is a block diagram showing a detailed configuration of a normal predicted motion vector mode derivation unit 301 in FIG. 16. [Figure 18] 17 is a block diagram showing a detailed configuration of a normal merge mode derivation unit 302 in FIG. 16. [Figure 19] 17 is a flowchart for explaining a normal predicted motion vector mode derivation process of the normal predicted motion vector mode derivation unit 301 of FIG. 16. [Figure 20] 13 is a flowchart showing a processing procedure of a normal predicted motion vector mode derivation process. [Figure 21] 13 is a flowchart illustrating a procedure for a normal merge mode derivation process. [Figure 22] FIG. 3 is a block diagram showing a detailed configuration of an inter prediction unit 203 in FIG. 2. [Figure 23] 23 is a block diagram showing a detailed configuration of a normal predicted motion vector mode derivation unit 401 in FIG. 22. [Figure 24] 23 is a block diagram showing a detailed configuration of a normal merge mode derivation unit 402 in FIG. 22. [Diagram 25]23 is a flowchart for explaining a normal predicted motion vector mode derivation process of the normal predicted motion vector mode derivation unit 401 in FIG. 22. [Figure 26] 17 is a block diagram showing a detailed configuration of a sub-block predictive motion vector mode derivation unit 303 in FIG. 16. [Figure 27] 23 is a block diagram showing a detailed configuration of a sub-block predictive motion vector mode derivation unit 403 in FIG. 22. [Figure 28] 17 is a block diagram showing a detailed configuration of a sub-block merge mode derivation unit 304 in FIG. 16. [Figure 29] 23 is a block diagram showing a detailed configuration of a sub-block merge mode derivation unit 404 in FIG. 22. [Diagram 30] FIG. 13 is a diagram for explaining derivation of affine inheritance predicted motion vector candidates. [Diagram 31] FIG. 13 is a diagram for explaining derivation of affine constructed predicted motion vector candidates. [Diagram 32] FIG. 13 is a diagram for explaining affine inheritance merge candidate derivation. [Diagram 33] FIG. 13 is a diagram illustrating affine construction merge candidate derivation. [Diagram 34] 13 is a flowchart of deriving an affine inheritance predicted motion vector candidate. [Diagram 35] 13 is a flowchart of deriving an affine constructed predicted motion vector candidate. [Diagram 36] 13 is a flowchart of affine inheritance merge candidate derivation. [Figure 37] 13 is a flowchart of affine construct merge candidate derivation. [Figure 38] 13 is a flowchart illustrating a procedure of a history motion vector predictor candidate list initialization / update process. [Figure 39] 11 is a flowchart of an identical element confirmation process procedure in the history motion vector predictor candidate list initialization / update process procedure according to the first embodiment of the present invention. [Diagram 40] 13 is a flowchart of an element shifting process procedure in the history motion vector predictor candidate derivation process procedure. [Diagram 41]13 is a flowchart illustrating a procedure of a process of deriving a history predicted motion vector candidate. [Diagram 42] 11 is a flowchart illustrating a history merging candidate derivation process procedure according to the first embodiment of the present invention. [Diagram 43] 11 is a diagram illustrating an example of a history motion vector predictor candidate list update process. FIG. [Diagram 44] 13 is a flowchart for explaining the operation of the sub-block temporal merge candidate derivation unit 381. [Diagram 45] 13 is a flowchart illustrating a process of deriving adjacent motion information of a block. [Figure 46] 13 is a flowchart illustrating a process of deriving a temporal motion vector. [Figure 47] 13 is a flowchart illustrating derivation of inter prediction information. [Figure 48] 13 is a flowchart illustrating a process of deriving sub-block motion information. [Figure 49] FIG. 2 is a diagram for explaining the temporal relationship between pictures. [Figure 50] 13 is a flowchart for explaining a process of deriving a temporal motion vector predictor candidate in a normal motion vector predictor mode derivation unit 301. [Figure 51] 13 is a flowchart for explaining the derivation process of ColPic in the derivation process of a temporal motion vector predictor candidate in the normal motion vector predictor mode derivation unit 301. [Figure 52] 13 is a flowchart for explaining a process of deriving coding information of ColPic in a process of derivation of a temporal motion vector predictor candidate in the normal motion vector predictor mode derivation unit 301. [Diagram 53] 13 is a flowchart illustrating a process of deriving inter prediction information. [Figure 54] 13 is a flowchart showing the procedure of a process of deriving inter prediction information of a coding block when the inter prediction mode of the coding block colCb is bi-prediction (Pred_BI). [Figure 55]13 is a flowchart illustrating a procedure of a motion vector scaling calculation process. [Figure 56] 13 is a flowchart illustrating a process of deriving a temporal merge candidate. [Figure 57] FIG. 13 is a diagram illustrating motion compensation prediction in the case of L0 prediction in which an L0 reference picture (RefL0Pic) is located at a time earlier than a current picture (CurPic). [Figure 58] 13 is a diagram for explaining motion compensation prediction in the case where L0 prediction is performed and a reference picture for L0 prediction is located at a later time than the current picture to be processed. FIG. [Figure 59] FIG. 13 is a diagram for explaining motion compensation prediction in a case where bi-prediction is performed and a reference picture for L0 prediction is located at a time earlier than a current picture to be processed and a reference picture for L1 prediction is located at a time later than the current picture to be processed. [Figure 60] 13 is a diagram for explaining the prediction direction of motion compensation prediction in bi-prediction where the reference picture for L0 prediction and the reference picture for L1 prediction are located at a time earlier than the current picture to be processed. FIG. [Figure 61] 13 is a diagram for explaining the prediction direction of motion compensation prediction in bi-prediction where the reference picture for L0 prediction and the reference picture for L1 prediction are at a time later than the current picture. FIG. [Figure 62] 13 is a flowchart illustrating an average merging candidate derivation process; [Figure 63] 11 is a table showing information regarding merge motion vector difference. [Figure 64] FIG. 13 is a diagram illustrating the derivation of a merge differential motion vector. [Figure 65] 13 is a diagram illustrating a number of elements designated by an offset value hMvpIdxOffset from the end of the history motion vector predictor candidate list when checking the history motion vector predictor candidate list. FIG. [Figure 66] 13 is a flowchart illustrating a history merging candidate derivation process procedure according to the second embodiment of the present invention. [Figure 67]13 is a flowchart of an identical element confirmation process procedure in the history motion vector predictor candidate list initialization / update process procedure according to the third embodiment of the present invention. [Figure 68] 13 is a flowchart of an identical element confirmation process procedure in the history motion vector predictor candidate list initialization / update process procedure according to the fourth embodiment of the present invention. [Figure 69] 1 is a diagram illustrating an example of a hardware configuration of a coding / decoding device according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] The technologies and technical terms used in this embodiment will be defined below.
[0010] <Tree Block> In the embodiment, the image to be encoded / decoded is divided equally into a predetermined size. This unit is defined as a tree block. As shown in FIG. 4, in the embodiment, the size of the tree block is set to 128x128 pixels, but the size of the tree block is not limited to this and may be set to any size. The tree blocks to be processed (corresponding to the encoding target in the encoding process and the decoding target in the decoding process) are switched in raster scan order, that is, from left to right and from top to bottom. The inside of each tree block can be further divided recursively. The block to be encoded / decoded after the tree block division is defined as an encoding block. In addition, the tree block and the encoding block are collectively defined as a block. Efficient encoding is possible by performing appropriate block division. The size of the tree block can be a fixed value previously determined by the encoding device and the decoding device, or the size of the tree block determined by the encoding device can be transmitted to the decoding device.
[0011] <Prediction mode> For each coding block to be processed, switching is performed between intra prediction (MODE_INTRA), which makes predictions from surrounding image signals of the processed image to be processed (in coding processing, signals for which coding has been completed are used for decoded images, image signals, tree blocks, blocks, coding blocks, etc., and in decoding processing, signals for which decoding has been completed are used for images, image signals, tree blocks, blocks, coding blocks, etc.), and inter prediction (MODE_INTER), which makes predictions from image signals of the processed image. The mode for distinguishing between intra prediction (MODE_INTRA) and inter prediction (MODE_INTER) is defined as the prediction mode (PredMode). The prediction mode (PredMode) has the values intra prediction (MODE_INTRA) or inter prediction (MODE_INTER).
[0012] <Inter Prediction> In inter prediction, which performs prediction from an image signal of a processed image, multiple processed images can be used as reference pictures. In order to manage multiple reference pictures, two types of reference lists, L0 (reference list 0) and L1 (reference list 1), are defined, and each uses a reference index to identify a reference picture. L0 prediction (Pred_L0) is available in P slices. L0 prediction (Pred_L0), L1 prediction (Pred_L1), and bi-prediction (Pred_BI) are available in B slices. L0 prediction (Pred_L0) is inter prediction that refers to a reference picture managed in L0, and L1 prediction (Pred_L1) is inter prediction that refers to a reference picture managed in L1. Bi-prediction (Pred_BI) is inter prediction in which both L0 prediction and L1 prediction are performed, and one reference picture managed in each of L0 and L1 is referenced. Information that identifies L0 prediction, L1 prediction, and bi-prediction is defined as an inter prediction mode. In the subsequent processing, it is assumed that the constants and variables with the subscript LX in the output are processed for each L0 and L1.
[0013] <Predictive motion vector mode> The predicted motion vector mode is a mode in which an index for identifying a predicted motion vector, a differential motion vector, an inter prediction mode, and a reference index are transmitted to determine inter prediction information for a block to be processed. The predicted motion vector is derived from a predicted motion vector candidate derived from a processed block adjacent to the block to be processed, or a block belonging to a processed image that is located at the same position as the block to be processed or in the vicinity (neighborhood), and an index for identifying the predicted motion vector.
[0014] <Merge mode> Merge mode is a mode in which inter-prediction information for the block to be processed is derived from inter-prediction information for a processed block adjacent to the block to be processed, or a block belonging to a processed image that is located at the same position as the block to be processed or in its vicinity (vicinity), without transmitting differential motion vectors or reference indexes.
[0015] The spatial merge candidates are defined as processed blocks adjacent to the current block and the inter prediction information of the processed blocks. The temporal merge candidates are defined as blocks belonging to the processed image that are located at the same position as the current block or in its vicinity (neighborhood) and the inter prediction information derived from the inter prediction information of the blocks. Each merge candidate is registered in a merge candidate list, and the merge candidate to be used in predicting the current block is identified by a merge index.
[0016] <Adjacent block> 11 is a diagram for explaining reference blocks to be referenced for deriving inter prediction information in the predicted motion vector mode and merge mode. A0, A1, A2, B0, B1, B2, and B3 are processed blocks adjacent to the processing target block. T0 is a block belonging to a processed image, and is a block located at the same position as the processing target coding block of the processing target image or in the vicinity (neighborhood).
[0017] A1 and A2 are blocks located to the left of the coding block to be processed and adjacent to the coding block to be processed. B1 and B3 are blocks located above the coding block to be processed and adjacent to the coding block to be processed. A0, B0, and B2 are blocks located at the bottom left, top right, and top left of the coding block to be processed, respectively.
[0018] How adjacent blocks are handled in the predicted motion vector mode and merge mode will be described in detail later.
[0019] <Affine transformation motion compensation> Affine transformation motion compensation is a method of dividing an encoding block into subblocks of a predetermined unit, and performing motion compensation by setting a motion vector for each subblock individually. The motion vector for each subblock is derived based on one or more control points derived from inter prediction information of a processed block adjacent to the block to be processed, or a block belonging to a processed image that is located at the same position as the block to be processed or in the vicinity (neighborhood). In this embodiment, the size of the subblock is 4x4 pixels, but the size of the subblock is not limited to this, and the motion vector may be derived in units of pixels.
[0020] FIG. 14 shows an example of affine transformation motion compensation when there are two control points. In this case, the two control points have two parameters, a horizontal component and a vertical component, so the affine transformation when there are two control points is called a four-parameter affine transformation. CP1 and CP2 in FIG. 14 are the control points. FIG. 15 shows an example of affine transformation motion compensation when there are three control points. In this case, the three control points have two parameters, a horizontal component and a vertical component, so the affine transformation when there are three control points is called a six-parameter affine transformation. CP1, CP2, and CP3 in FIG. 15 are the control points.
[0021] Affine transform motion compensation can be used in both the predictive motion vector mode and the merge mode. A mode in which affine transform motion compensation is applied in the predictive motion vector mode is defined as a sub-block predictive motion vector mode, and a mode in which affine transform motion compensation is applied in the merge mode is defined as a sub-block merge mode.
[0022] <Inter prediction syntax> The syntax related to inter prediction will be described with reference to FIG. 12 and FIG. 13. merge_flag in FIG. 12 is a flag indicating whether the processing target coding block is to be in merge mode or predictive motion vector mode. merge_affine_flag is a flag indicating whether or not the sub-block merge mode is applied to the processing target coding block in merge mode. inter_affine_flag is a flag indicating whether or not the sub-block predictive motion vector mode is applied to the processing target coding block in predictive motion vector mode. cu_affine_type_flag is a flag for determining the number of control points in the sub-block predictive motion vector mode. FIG. 13 shows the values of each syntax element and the corresponding prediction method. merge_flag=1, merge_affine_flag=0 correspond to the normal merge mode, which is a merge mode that is not a sub-block merge. merge_flag=1, merge_affine_flag=1 correspond to the sub-block merge mode. merge_flag=0, inter_affine_flag=0 correspond to the normal predictive motion vector mode, which is a predictive motion vector merge that is not a sub-block predictive motion vector mode. The sub-block predicted motion vector mode corresponds to merge_flag=0, inter_affine_flag=1. When merge_flag=0, inter_affine_flag=1, cu_affine_type_flag is further transmitted to determine the number of control points.
[0023] <poc> POC (Picture Order Count) is a variable associated with a picture to be coded, and is set to a value that increases by one in the picture output order. The POC value can be used to determine whether the pictures are the same, to determine the order of pictures in the output order, and to derive the distance between pictures. For example, if two pictures have the same POC value, they can be determined to be the same picture. If two pictures have different POC values, the picture with the smaller POC value can be determined to be the picture that will be output first, and the difference between the POCs of the two pictures indicates the distance between the pictures along the time axis.
[0024] (First embodiment) An image encoding device 100 and an image decoding device 200 according to a first embodiment of the present invention will be described.
[0025] 1 is a block diagram of an image coding device 100 according to a first embodiment. The video coding device according to the embodiment includes an image coding device 100, 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 signal generation unit 106, an orthogonal transform / quantization unit 107, a bit string coding unit 108, an inverse quantization / inverse orthogonal transform unit 109, a decoded image signal superimposition unit 110, and a coding information storage memory 111.
[0026] The block division unit 101 recursively divides an input image to generate coding blocks. The block division unit 101 includes a 4-division unit that divides a block to be divided horizontally and vertically, and a 2-3 division unit that divides a block to be divided either horizontally or vertically. The block division unit 101 supplies the generated image signal of the coding block to be processed to the inter prediction unit 102, the intra prediction unit 103, and the residual signal generation unit 106. The block division unit 101 also supplies information indicating the determined recursive division structure to the bit string coding unit 108. The detailed operation of the block division unit 101 will be described later.
[0027] The inter prediction unit 102 performs inter prediction of the coding block to be processed. A plurality of candidates for inter prediction information are derived from the inter prediction information stored in the coding information storage memory and the decoded image signal stored in the decoded image memory 104, an appropriate inter prediction mode is selected from the plurality of candidates, and the selected inter prediction mode and a predicted image signal according to the selected inter prediction mode are supplied to the prediction method determination unit 105. A detailed configuration and operation of the inter prediction unit 102 will be described later.
[0028] The intra prediction unit 103 performs intra prediction of the coding block to be processed. A predicted image signal is generated by intra prediction from a decoded image signal stored in the decoded image memory 104, an appropriate intra prediction mode is selected from a plurality of intra prediction modes, and the selected intra prediction mode and a predicted image signal according to the selected intra prediction mode are supplied to the prediction method determination unit 105. FIG. 10 shows an example of intra prediction. FIG. 10(a) shows the correspondence between the prediction direction of intra prediction and the intra prediction mode number. For example, the intra prediction mode 50 generates an intra prediction image by copying pixels in the vertical direction. The intra prediction mode 1 is a DC mode, and is a mode in which all pixel values of the block to be processed are the average value of the reference pixels. The intra prediction mode 0 is a Planar mode, and is a mode in which a two-dimensional intra prediction image is created from reference pixels in the vertical and horizontal directions. FIG. 10(b) is an example of generating an intra prediction image in the case of the intra prediction mode 40. For each pixel of the block to be processed, the value of the reference pixel in the direction indicated by the intra prediction mode is copied. When the reference pixel in the intra prediction mode is not at an integer position, the reference pixel value is determined by interpolation from the reference pixel values of neighboring integer positions.
[0029] The decoded image memory 104 stores the decoded image generated by the decoded image signal superimposing unit 110. The decoded image stored in the decoded image memory is supplied to the inter prediction unit 102 and the intra prediction unit 103.
[0030] The prediction method determination unit 105 determines the optimal prediction mode (inter prediction or intra prediction) for each prediction by evaluating using the coding information and the code amount of the residual signal, the distortion amount between the predicted image signal and the image signal to be processed, etc. In the case of the merge mode of the inter prediction, the coding information of the merge index and the information indicating whether or not it is a sub-block merge mode (sub-block merge flag) is supplied to the bit string coding unit 108, and in the case of the predicted motion vector mode of the inter prediction, the coding information of the inter prediction mode, the predicted motion vector index, the reference index of L0 and L1, the difference motion vector, and the information indicating whether or not it is a sub-block mode (sub-block predicted motion vector flag) is supplied to the bit string coding unit 108. The determined coding information is supplied to the coding information storage memory 111.
[0031] The residual signal generation unit 106 generates a residual signal by subtracting the predicted image signal from the image signal to be processed, and supplies the residual signal to the orthogonal transformation and quantization unit 107 .
[0032] The orthogonal transform and quantization unit 107 performs orthogonal transform and quantization on the residual signal in accordance with the quantization parameter to generate an orthogonally transformed and quantized residual signal, and supplies the orthogonal transformed and quantized residual signal to a bit string coding unit 108 and an inverse quantization and inverse orthogonal transform unit 109 .
[0033] The bitstream coding unit 108 codes coding information according to the prediction method determined by the prediction method determining unit 105 for each coding block, in addition to information in units of sequences, pictures, slices, and coding blocks. Specifically, the coding information such as the prediction mode PredMode for each coding block, the division mode PartMode, and in the case of inter prediction (PRED_INTER), a flag for determining whether or not 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 predicted motion vector index, information on a differential motion vector, and a sub-block predicted motion vector flag is coded according to a prescribed syntax rule described later, to generate a first coded bitstream. The bitstream coding unit 108 also entropy codes the orthogonally transformed and quantized residual signal according to a prescribed syntax rule to generate a second coded bitstream. The first coded bitstream and the second coded bitstream are multiplexed according to a prescribed syntax rule, and a bitstream is output.
[0034] The inverse quantization and inverse orthogonal transform unit 109 inverse quantizes and inverse orthogonal transforms the orthogonally transformed and quantized residual signal supplied from the orthogonal transform and quantization unit 107 to calculate a residual signal, and supplies it to a decoded image signal superimposition unit 110.
[0035] The decoded image signal superimposing unit 110 superimposes the predicted image signal according to the determination by the prediction method determining unit 105 and the residual signal that has been inverse quantized and inverse orthogonal transformed by the inverse quantization and inverse orthogonal transform unit 109 to generate a decoded image, and stores the decoded image in the decoded image memory 104. Note that the decoded image may be stored in the decoded image memory 104 after being subjected to a filtering process for reducing distortion such as block distortion caused by encoding.
[0036] The coding information storage memory 111 stores coding information such as a prediction mode (inter prediction or intra prediction) determined by the prediction method determination unit 105. In the case of inter prediction, the coding information stored in the coding information storage memory 111 includes a determined motion vector, a reference list, and a reference index, in the case of a merge mode of inter prediction, coding information of a merge index and information indicating whether or not a sub-block merge mode (sub-block merge flag), in the case of a predicted motion vector mode of inter prediction, an inter prediction mode, a predicted motion vector index, reference indexes of L0 and L1, a difference motion vector, information indicating whether or not a sub-block mode (sub-block predicted motion vector flag), and in the case of intra prediction, a determined intra prediction mode. The construction of a history candidate list managed by the coding information storage memory 111 will be described later.
[0037] Fig. 2 is a block diagram showing the configuration of a video decoding device according to an embodiment of the present invention, which corresponds to the video encoding device of Fig. 1. The video decoding device according to the embodiment includes a bitstream decoding unit 201, a block dividing unit 202, an inter prediction unit 203, an intra prediction unit 204, an encoded information storage memory 205, an inverse quantization and inverse orthogonal transform unit 206, a decoded image signal superimposition unit 207, and a decoded image memory 208.
[0038] 2 corresponds to the decoding process provided inside the video encoding device of FIG. 1, and therefore each of the components of the encoding information storage memory 205, the inverse quantization and inverse orthogonal transformation unit 206, the decoded image signal superimposition unit 207, and the decoded image memory 208 of FIG. 2 has a function corresponding to each of the components of the inverse quantization and inverse orthogonal transformation unit 109, the decoded image signal superimposition unit 110, the encoding information storage memory 111, and the decoded image memory 104 of the video encoding device of FIG. 1.
[0039] The bit stream supplied to the bit stream decoding unit 201 is separated according to a prescribed syntax rule. The separated first coded bit stream is decoded to obtain information on a sequence, a picture, a slice, and a coding block unit, and coding information on a coding block unit. Specifically, coding information related to a prediction mode PredMode for determining whether inter prediction (PRED_INTER) or intra prediction (PRED_INTRA) is performed on a coding block unit basis, a partition mode PartMode, a flag for determining whether or not a merge mode is performed in the case of inter prediction (PRED_INTER), a merge index in the case of merge mode, a sub-block merge flag, an inter prediction mode in the case of a predicted motion vector mode, a predicted motion vector index, a difference motion vector, a sub-block predicted motion vector flag, and the like is decoded according to a prescribed syntax rule to be described later, and the coding information is supplied to the inter prediction unit 203 or the intra prediction unit 204, and the coding information storage memory 205. The separated second coded bit stream is decoded to calculate an orthogonally transformed and quantized residual signal, and the orthogonally transformed and quantized residual signal is supplied to the inverse quantization and inverse orthogonal transformation unit 206.
[0040] When the prediction mode PredMode of the coding block to be processed is inter prediction (PRED_INTER) and a predicted motion vector mode, the inter prediction unit 203 derives multiple predicted motion vector candidates using the coding information of the already decoded image signal stored in the coding information storage memory 205, and registers them in a predicted motion vector candidate list described below. From the multiple predicted motion vector candidates registered in the predicted motion vector candidate list, the inter prediction unit 203 selects a predicted motion vector corresponding to the predicted motion vector index decoded and supplied by the bit string decoding unit 201, calculates a motion vector from the difference vector decoded by the bit string decoding unit 201 and the selected predicted motion vector, and stores the motion vector in the coding information storage memory 205 together with other coding information. The coding information of the coding block supplied and stored here includes a prediction mode PredMode, a partition mode PartMode, flags predFlagL0[xP][yP] and predFlagL1[xP][yP] indicating whether or not to use L0 prediction and L1 prediction, reference indexes refIdxL0[xP][yP] and refIdxL1[xP][yP] of L0 and L1, motion vectors mvL0[xP][yP] and mvL1[xP][yP] of L0 and L1, etc. Here, xP and yP are indexes indicating the position of the upper left pixel of the coding block in a 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 or not to use L0 prediction is 1, and the flag predFlagL1 indicating whether or not to use L1 prediction is 0. When the inter prediction mode is L1 prediction (Pred_L1), the flag predFlagL0 indicating whether or not to use L0 prediction is 0, and the flag predFlagL1 indicating whether or not to use L1 prediction is 1. When the inter prediction mode is bi-prediction (Pred_BI), the flag predFlagL0 indicating whether or not to use L0 prediction and the flag predFlagL1 indicating whether or not to use L1 prediction are both 1. Furthermore, when the prediction mode PredMode of the coding block to be processed is inter prediction (PRED_INTER) and a merge mode, merge candidates are derived.Using the coding information of the already decoded coding block stored in the coding 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 a merge index decoded and supplied by the bitstream decoding unit 201 is selected from the plurality of merge candidates registered in the merge candidate list, and inter prediction information such as flags predFlagL0[xP][yP], predFlagL1[xP][yP] indicating whether or not to use L0 prediction and L1 prediction of the selected merge candidate, reference indexes refIdxL0[xP][yP], refIdxL1[xP][yP] of L0, L1, motion vectors mvL0[xP][yP], mvL1[xP][yP] of L0, L1, etc. are stored in the coding information storage memory 205. Here, xP and yP are indexes indicating the position of the upper left pixel of the coding block in the picture. A detailed configuration and operation of the inter prediction unit will be described later.
[0041] The intra prediction unit 204 performs intra prediction when the prediction mode PredMode of the coding block to be processed is intra prediction (PRED_INTRA). The coding information decoded by the bitstream decoding unit 201 includes an intra prediction mode, and generates a predicted image signal by intra prediction from a decoded image signal stored in a decoded image memory 208 according to the intra prediction mode, and supplies the predicted image signal to a decoded image signal superimposition unit 207. The intra prediction unit 204 corresponds to the intra prediction unit 103 of the image coding device 100, and therefore 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 orthogonally transformed and quantized residual signal decoded by the bit stream decoding unit 201, thereby obtaining an inverse orthogonally transformed and inverse quantized residual signal.
[0043] The decoded image signal superimposition unit 207 superimposes the predicted image signal inter predicted by the inter prediction unit 203 or the predicted image signal intra predicted by the intra prediction unit 204 on a residual signal inverse orthogonal transformed and inverse quantized by the inverse quantization and inverse orthogonal transformation unit 206, thereby decoding the decoded image signal and storing it in the decoded image memory 208. When storing in the decoded image memory 208, the decoded image may be subjected to a filtering process for reducing block distortion and the like caused by encoding before being stored in the decoded image memory 208.
[0044] Next, the operation of the block division unit 101 in the image encoding device 100 will be described. Fig. 3 is a flowchart showing the operation of dividing an image into tree blocks and further dividing each tree block. First, an input image is divided into tree blocks of a predetermined size (step S1001). Each tree block is scanned in a predetermined order, i.e., in raster scan order (step S1002), and the inside of the tree block to be processed is divided (step S1003).
[0045] 7 is a flowchart showing the detailed operation of the division process in step S1003. First, it is determined whether or not the block to be processed is to be divided into four (step S1101).
[0046] If it is determined that the block to be processed should be divided into four, the block to be processed is divided into four (step S1102). Each block into which the block to be processed is divided is scanned 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. 6 is an example in which the block to be processed is divided into four. Numbers 0 to 3 in 601 in FIG. 6 indicate the order of processing. Then, the flowchart in FIG. 7 is recursively called for each block divided in step S1101.
[0047] If it is determined that the processing target block should not be divided into four, it is divided into two and three (step S1105).
[0048] 8 is a flowchart showing the detailed operation of the 2-3 division process in step S1105. First, it is determined whether or not the block to be processed is to be divided into 2-3, that is, whether or not to divide into 2 or 3 (step S1201).
[0049] If it is not determined that the block to be processed should be divided into 2-3, that is, if it is determined that the block should not be divided, the division is terminated (step S1211) and the process returns to the block in the upper hierarchy.
[0050] If it is determined that the block to be processed is to be divided into 2 or 3, it is then determined whether or not the block to be processed is to be further divided into 2 (step S1202).
[0051] If it is determined that the target block is to be divided into two, it is determined whether or not to divide the target block vertically (step S1203), and based on the result, the target block is divided vertically (step S1204) or horizontally (step S1205). As a result of step S1204, the target block is divided into two vertically as shown in FIG. 602, and as a result of step S1205, the target block is divided into two horizontally as shown in FIG. 604.
[0052] In step S1202, if it is not determined that the block to be processed should be divided into two, i.e., if it is determined that the block to be processed should be divided into three, it is determined whether to divide the block to be processed vertically (step S1206), and based on the result, the block to be processed is divided vertically (step S1207) or horizontally (step S1208). As a result of step S1207, the block to be processed is divided vertically into three as shown in FIG. 603, and as a result of step S1208, the block to be processed is divided horizontally into three as shown in FIG. 605.
[0053] After executing any one of steps S1204 to S1205, each block obtained by dividing the target block is scanned from left to right and from top to bottom (step S1209). Numbers 0 to 3 of 602 to 605 in Fig. 6 indicate the order of processing. The flowchart in Fig. 8 is recursively called for each divided block.
[0054] The recursive block division described here may limit the necessity of division depending on the number of divisions, the size of the block to be processed, etc. The information limiting the necessity of division may be realized in a configuration in which no information is transmitted by making a prior arrangement between the encoding device and the decoding device, or may be realized in a configuration in which the encoding device determines information limiting the necessity of division and transmits it to the decoding device by recording it in the encoded bit string.
[0055] Here, when a block is divided, the block before the division is called a parent block, and each block after the 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 tree blocks in the same processing procedure as the block division unit 101 in the image encoding device 100. However, the difference is that the block division unit 101 in the image encoding device 100 determines the optimal block division shape by applying an optimization method such as optimal shape estimation by image recognition or distortion rate optimization, whereas the block division unit 202 in the image decoding device 200 determines the block division shape by decoding block division information recorded in the encoded bit string.
[0057] The syntax for block division in the first embodiment (syntax rules for coded bitstreams) is shown in Fig. 9. coding_quadtree() represents syntax for dividing a block into four, and multi_type_tree() represents syntax for dividing a block into two or three. qt_split is a flag indicating whether or not to divide a block into four. If the block is divided into four, qt_split=1 is set, and if not, qt_split=0 is set. If the block is divided into four (qt_split=1), each block is divided into four and divided into four recursively (coding_quadtree(0), coding_quadtree(1), coding_quadtree(2), coding_quadtree(3)). If the block is not divided into four (qt_split=0), the subsequent division is determined according to multi_type_tree(). mtt_split is a flag indicating whether or not to divide the block further. If further division is required (mtt_split=1), the mtt_split_vertical flag indicating whether to divide vertically or horizontally and the mtt_split_binary flag determining whether to divide into two or three are referenced. mtt_split_vertical=1 indicates vertical division, and mtt_split_vertical=0 indicates horizontal division. mtt_split_binary=1 indicates division into two, and mtt_split_binary=0 indicates division into three. Hierarchical block division is performed by recursively calling multi_type_tree until mtt_split=0 is reached.
[0058] <Inter Prediction> The inter prediction method according to the embodiment is implemented in the inter prediction unit 102 of the video encoding device in FIG. 1 and the inter prediction unit 203 of the video decoding device in FIG.
[0059] An inter prediction method according to an embodiment will be described with reference to the drawings. The inter prediction method is performed in both encoding and decoding processes on a coding block basis.
[0060] <Description of the inter prediction unit 102 on the encoding side> Fig. 16 is a diagram showing a detailed configuration of the inter prediction unit 102 of the video encoding device of Fig. 1. A normal prediction motion vector mode derivation unit 301 derives a plurality of normal prediction motion vector candidates, selects a predicted motion vector, and calculates a difference vector with respect to the detected motion vector. The detected inter prediction mode, reference index, motion vector, and calculated difference vector become inter prediction information of the normal prediction motion vector mode. This inter prediction information is supplied to an inter prediction mode determination unit 305. A 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 inter prediction information for the normal merge mode. This inter prediction information is supplied to the inter prediction mode determination unit 305. A detailed configuration and processing of the normal merge mode derivation unit 302 will be described later.
[0062] The sub-block predicted motion vector mode derivation unit 303 derives a plurality of sub-block predicted motion vector candidates, selects a sub-block predicted motion vector, and calculates a difference vector with the detected motion vector. The detected inter prediction mode, reference index, motion vector, and calculated difference vector become inter prediction information for the normal predicted motion vector mode. This inter prediction information is supplied to the inter prediction mode determination unit 305. The detailed configuration and processing of the sub-block predicted motion vector mode derivation unit 303 will be described later.
[0063] The subblock merging mode derivation unit 304 derives a plurality of subblock merging candidates, selects a subblock merging candidate, and obtains inter prediction information of the subblock merging mode. This inter prediction information is supplied to the inter prediction mode determination unit 305. The detailed configuration and processing of the subblock merging mode derivation unit 304 will be described later.
[0064] The inter prediction mode determination unit 305 determines inter prediction information based on the inter prediction information supplied from the normal prediction motion vector mode derivation unit 301, the normal merge mode derivation unit 302, the sub-block prediction motion vector mode derivation unit 303, and the sub-block merge mode derivation unit 304. The inter prediction mode determination unit 305 supplies inter prediction information according to the determination result to a 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 will be described later.
[0066] <Description of the Inter Prediction Unit 203 on the Decoding Side> FIG. 22 is a diagram showing a detailed configuration of the inter prediction unit 203 of the video decoding device of FIG.
[0067] The normal prediction motion vector mode derivation unit 401 derives a plurality of normal prediction motion vector candidates, selects a prediction motion vector, and calculates a difference vector with the detected motion vector. The detected inter prediction mode, reference index, motion vector, and difference vector become inter prediction information of the normal prediction motion vector mode. This inter prediction information is supplied to the motion compensation prediction unit 406 via a switch 408. The detailed configuration and processing of the normal prediction motion vector mode derivation unit 401 will be described later.
[0068] The normal merge mode derivation unit 402 derives a plurality of normal merge candidates, selects a normal merge candidate, and obtains inter prediction information for the normal merge mode. This inter prediction information is supplied to the motion compensation prediction unit 406 via a switch 408. The detailed configuration and processing of the normal merge mode derivation unit 402 will be described later.
[0069] The sub-block prediction motion vector mode derivation unit 403 derives a plurality of sub-block prediction motion vector candidates, selects a sub-block prediction motion vector, and calculates a difference vector with the detected motion vector. The detected inter prediction mode, reference index, motion vector, and calculated difference vector become inter prediction information for the normal prediction motion vector mode. This inter prediction information is supplied to the motion compensation prediction unit 406 via a switch 408. The detailed configuration and processing of the sub-block prediction motion vector mode derivation unit 403 will be described later.
[0070] The subblock merging mode derivation unit 404 derives a plurality of subblock merging candidates, selects a subblock merging candidate, and obtains inter-prediction information for the subblock merging mode. This inter-prediction information is supplied to the motion compensation prediction unit 406 via a switch 408. The detailed configuration and processing of the subblock merging mode derivation unit 404 will be described later.
[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 are the same as those on the encoding side.
[0072] <Normal predicted motion vector mode derivation part (normal AMVP)> The normal prediction motion vector mode derivation unit 301 in Figure 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 supplementation 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 predictor motion vector mode derivation unit 401 in Figure 23 includes a spatial predictor motion vector candidate derivation unit 421, a temporal predictor motion vector candidate derivation unit 422, a history predictor motion vector candidate derivation unit 423, a predictor motion vector candidate supplementation unit 425, a predictor 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 with reference to the flowcharts of Fig. 19 and Fig. 25. 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 part (normal AMVP): Explanation on the encoding side> A normal predicted motion vector mode derivation process procedure on the encoding side will be described with reference to Fig. 19. In the description of the process procedure in Fig. 19, the term motion vector in the specification corresponds to the term normal motion vector in Fig. 19.
[0076] First, the normal motion vector detection unit 326 detects a normal motion vector for each inter prediction mode and reference index (step S100 in FIG. 19).
[0077] Next, 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 difference motion vector of the motion vector used in the inter prediction of 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 of L0 is calculated, the prediction motion vector mvpL0 is selected, and the difference motion vector mvdL0 of the motion vector mvL0 of L0 is calculated. When the inter prediction mode of the block to be processed is L1 prediction (Pred_L1), the L1 predicted motion vector candidate list mvpListL1 is calculated, the predicted motion vector mvpL1 is selected, and the differential motion vector mvdL1 of the motion vector mvL1 of L1 is calculated. When the inter prediction mode of the block to be processed is bi-prediction (Pred_BI), both L0 prediction and L1 prediction are performed, the L0 predicted motion vector candidate list mvpListL0 is calculated, the L0 predicted motion vector mvpL0 is selected, and the differential motion vector mvdL0 of the motion vector mvL0 of L0 is calculated, and the L1 predicted motion vector candidate list mvpListL1 is calculated, the L1 predicted motion vector mvpL1 is calculated, and the differential motion vector mvdL1 of the motion vector mvL1 of L1 is calculated.
[0078] A differential motion vector calculation process is performed for each of L0 and L1, but the process is common to both L0 and L1. Therefore, in the following description, L0 and L1 are represented as a common LX. In the process of calculating the differential motion vector of L0, X is 0, and in the process of calculating the differential motion vector of L1, X is 1. Furthermore, when referring to information of the other list instead of LX during the process of calculating the differential motion vector of LX, the other list is represented as LY.
[0079] When the motion vector mvLX of LX is used (step S102 in FIG. 19: YES), a candidate of the predicted motion vector of LX is calculated to construct a predicted motion vector candidate list mvpListLX of LX (step S103 in FIG. 19). A spatial predicted motion vector candidate derivation unit 321, a temporal predicted motion vector candidate derivation unit 322, a history predicted motion vector candidate derivation unit 323, and a predicted motion vector candidate supplementation unit 325 in the normal predicted motion vector mode derivation unit 301 derive multiple predicted motion vector candidates to construct the 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 in FIG. 20.
[0080] Next, the motion vector predictor candidate selection unit 327 selects the motion vector predictor mvpLX of LX from the motion vector predictor candidate list mvpListLX of LX (step S104 in FIG. 19). Each difference motion vector is calculated as a difference between the motion vector mvLX and each motion vector predictor candidate mvpListLX[i] stored in the motion vector predictor candidate list mvpListLX. The amount of code when these difference motion vectors are coded is calculated for each element (motion vector predictor candidate) of the motion vector predictor candidate list mvpListLX. Then, among each element registered in the motion vector predictor candidate list mvpListLX, the motion vector predictor candidate mvpListLX[i] with the smallest amount of code for each motion vector predictor candidate is selected as the motion vector predictor mvpLX, and its index i is obtained. If there are multiple candidates for the predicted motion vector that will result in the smallest amount of generated code in the predicted motion vector candidate list mvpListLX, the candidate predicted motion vector mvpListLX[i] represented by the smallest 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] Next, the motion vector subtraction unit 328 subtracts the selected predicted motion vector mvpLX of LX from the motion vector mvLX of LX, mvdLX = mvLX - mvpLX Then, the differential motion vector mvdLX of LX is calculated as (Step S105 in FIG. 19).
[0082] <Normal predicted motion vector mode derivation part (normal AMVP): Decoding side explanation> Next, the normal predicted motion vector mode processing procedure on the decoding side will be described with reference to Fig. 25. On the decoding side, the spatial predicted motion vector candidate derivation unit 421, the temporal predicted motion vector candidate derivation unit 422, the history predicted motion vector candidate derivation unit 423, and the predicted motion vector candidate supplement unit 425 calculate the motion vectors used in inter prediction of the normal predicted motion vector mode 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 block to be processed is L1 prediction (Pred_L1), the L1 predicted motion vector candidate list mvpListL1 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 block to be processed is bi-prediction (Pred_BI), both L0 prediction and L1 prediction are performed, the L0 predicted motion vector candidate list mvpListL0 is calculated, the L0 predicted motion vector mvpL0 is selected, and the motion vector mvL0 of L0 is calculated, while the L1 predicted motion vector candidate list mvpListL1 is calculated, the L1 predicted motion vector mvpL1 is calculated, and the motion vector mvL1 of L1 is calculated.
[0083] As in the coding side, the decoding side also performs motion vector calculation processing for each of L0 and L1, but the processing is common to both L0 and L1. Therefore, in the following description, L0 and L1 are represented as a common LX. LX represents an inter-prediction mode used for inter-prediction of the coding block to be processed. In the processing to calculate the motion vector of L0, X is 0, and in the processing to calculate the motion vector of L1, X is 1. In addition, when the information of the other reference list is referred to during the processing to calculate the motion vector of LX, instead of the same reference list as the LX to be calculated, the other reference list is represented as LY.
[0084] When the motion vector mvLX of LX is used (step S202 in FIG. 25: YES), a candidate of the predicted motion vector of LX is calculated to construct a predicted motion vector candidate list mvpListLX of LX (step S203 in FIG. 25). A spatial predicted motion vector candidate derivation unit 421, a temporal predicted motion vector candidate derivation unit 422, a history predicted motion vector candidate derivation unit 423, and a predicted motion vector candidate supplementation unit 425 in the normal predicted motion vector mode derivation unit 401 calculate a plurality of predicted motion vector candidates to construct the predicted motion vector candidate list mvpListLX. A detailed processing procedure of step S203 in FIG. 25 will be described later with reference to the flowchart in FIG. 20.
[0085] Next, the predicted motion vector candidate selection unit 426 extracts the predicted motion vector candidate mvpListLX[mvpIdxLX] corresponding to the predicted motion vector index mvpIdxLX decoded and supplied by the bit string decoding unit 201 from the predicted motion vector candidate list mvpListLX as the selected predicted motion vector mvpLX (step S204 in Figure 25).
[0086] Next, the motion vector adder 427 adds the differential motion vector mvdLX of LX decoded and supplied by the bit stream decoder 201 and the predicted motion vector mvpLX of LX, mvLX = mvpLX + mvdLX Then, the motion vector mvLX of LX is calculated (step S205 in FIG. 25).
[0087] <Normal predicted motion vector mode derivation part (normal AMVP): Motion vector prediction method> Figure 20 is a flowchart showing the processing steps of a normal prediction motion vector mode derivation process having functions common to the normal prediction motion vector mode derivation unit 301 of a video encoding device and the normal prediction motion vector mode derivation unit 401 of a video decoding device according to an embodiment of the present invention.
[0088] The normal motion vector predictor mode derivation unit 301 and the normal motion vector predictor mode derivation unit 401 are provided with a motion vector predictor candidate list mvpListLX. The motion vector predictor candidate list mvpListLX has a list structure, and is provided with a storage area for storing a motion vector predictor index indicating a location in the motion vector predictor candidate list and a motion vector predictor candidate corresponding to the index as an element. The number of the motion vector predictor index starts from 0, and the motion vector predictor candidate is stored in the storage area of the motion vector predictor candidate list mvpListLX. In this embodiment, it is assumed that the motion vector predictor candidate list mvpListLX can register at least two motion vector predictor candidates (inter prediction information). Furthermore, 0 is set to a variable numCurrMvpCand indicating the number of motion vector predictor candidates registered in the motion vector predictor candidate list mvpListLX.
[0089] The spatial motion vector predictor candidate derivation units 321 and 421 derive a candidate of a motion vector predictor from a block adjacent to the left. In this process, a flag availableFlagLXA indicating whether or not a motion vector predictor candidate of a block adjacent to the left (A0 or A1) is available, a motion vector mvLXA, and a reference index refIdxA are derived, and mvLXA is added to a motion vector predictor candidate list mvpListLX (step S301 in FIG. 20). Note that X is 0 when L0, and X is 1 when L1 (similar below). Next, the spatial motion vector predictor candidate derivation units 321 and 421 derive a candidate of a motion vector predictor from a block adjacent to the upper side (B0, B1, or B2). In this process, a flag availableFlagLXB indicating whether or not a motion vector predictor candidate of an adjacent block above is available, a motion vector mvLXB, and a reference index refIdxB are derived, and if mvLXA and mvLXB are not equal, mvLXB is added to the motion vector predictor candidate list mvpListLX (step S302 in FIG. 20). The processes in steps S301 and S302 in FIG. 20 are the same except that the positions and numbers of adjacent blocks to be referenced are different, and a flag availableFlagLXN indicating whether or not a motion vector predictor candidate of a coding block is available, a motion vector mvLXN, and a reference index refIdxN (N is A or B, similarly below) are derived.
[0090] Next, the temporal motion vector predictor candidate derivation units 322 and 422 derive candidates for motion vector predictors from coding blocks in pictures that are different in time from the current picture to be processed. In this process, a flag availableFlagLXCol indicating whether a motion vector predictor candidate of a coding block in a picture that is different in time is available or not, a motion vector mvLXCol, a reference index refIdxCol, and a reference list listCol are derived, and mvLXCol is added to the motion vector predictor candidate list mvpListLX (step S303 in FIG. 20). The derivation process procedure in step S303 will be described in detail later.
[0091] It is assumed that the processing of the temporal motion vector predictor candidate derivation units 322 and 422 can be omitted in units of a sequence (SPS), a picture (PPS), or a slice.
[0092] Next, the history motion vector predictor candidate derivation units 323 and 423 add the history motion vector predictor candidates registered in the history motion vector predictor candidate list HmvpCandList to the motion vector predictor candidate list mvpListLX (step S304 in FIG. 20). The registration process procedure in step S304 will be described in detail later with reference to the flowchart in FIG. 41.
[0093] Next, the motion vector predictor candidate supplementation units 325 and 425 add motion vectors of a predetermined value, such as (0, 0), until the motion vector predictor candidate list mvpListLX is filled (step S305 in FIG. 20).
[0094] <Normal merge mode derivation part (normal merge)> The normal merge mode derivation unit 302 in FIG. 18 includes a spatial merge candidate derivation unit 341, a temporal merge candidate derivation unit 342, an average merge candidate derivation unit 344, a history merge candidate derivation unit 345, a merge candidate supplementation unit 346, and a merge candidate selection unit 347.
[0095] The normal merge mode derivation unit 402 in FIG. 24 includes a spatial merge candidate derivation unit 441, a temporal merge candidate derivation unit 442, an average merge candidate derivation unit 444, a history merge candidate derivation unit 445, a merge candidate supplementation unit 446, and a merge candidate selection unit 447.
[0096] FIG. 21 is a flowchart illustrating the steps of a normal merge mode derivation process having a function common to the normal merge mode derivation unit 302 of the video encoding device and the normal merge mode derivation unit 402 of the video decoding device according to an embodiment of the present invention.
[0097] The various processes will be described below in order. In the following description, unless otherwise specified, the slice type slice_type is a B slice, but can also be applied 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 an inter prediction mode, and there is no L1 prediction (Pred_L1) or bi-prediction (Pred_BI), so that the process related to L1 can be omitted.
[0098] The normal merge mode derivation unit 302 and the normal merge mode derivation unit 402 include a merge candidate list mergeCandList. The merge candidate list mergeCandList has a list structure and is provided with a merge index indicating a location in the merge candidate list and a storage area for storing merge candidates corresponding to the index as elements. The merge index number starts from 0, and merge candidates are stored in the storage area of the merge candidate list mergeCandList. In the following processing, the merge candidate of the merge index i registered in the merge candidate list mergeCandList is represented as mergeCandList[i]. In this embodiment, it is assumed that the merge candidate list mergeCandList can register at least six merge candidates (inter prediction information). Furthermore, 0 is set to a variable numCurrMergeCand indicating the number of merge candidates registered in the merge candidate list mergeCandList.
[0099] The spatial merge candidate derivation unit 341 and the spatial merge candidate derivation unit 441 derive spatial merge candidates A and B from adjacent blocks on the left and upper sides of the block to be processed from the coding information stored in the coding information storage memory 111 of the video coding device or the coding information storage memory 205 of the video decoding device, and register the derived spatial merge candidates in a merge candidate list mergeCandList (step S401 in FIG. 21). Here, N indicating either the spatial merge candidates A and B or the temporal merge candidate Col is defined. A flag availableFlagN indicating whether inter prediction information of the block N can be used as the spatial merge candidate N, an L0 reference index refIdxL0N and an L1 reference index refIdxL1N of the spatial merge candidate N, 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 this embodiment, merging candidates are derived without referring to other coding blocks contained in the block that includes the coding block to be processed, so spatial merging candidates contained in the block that includes the coding block to be processed are not derived.
[0100] Next, the temporal merge candidate derivation unit 342 and the temporal merge candidate derivation unit 442 derive temporal merge candidates from pictures of different times, and register the derived temporal merge candidates in a merge candidate list mergeCandList (step S402 in FIG. 21). A flag availableFlagCol indicating whether the temporal merge candidate is available, an L0 prediction flag predFlagL0Col indicating whether L0 prediction of the temporal merge candidate is performed, an L1 prediction flag predFlagL1Col indicating whether L1 prediction is performed, and a motion vector mvL0Col of L0 and a motion vector mvL1Col of L1 are derived. The detailed processing procedure of step S402 will be described in detail later with reference to FIG. 56.
[0101] It is assumed that the processing of the temporal merge candidate derivation unit 342 and the temporal merge candidate derivation unit 442 can be omitted in units of a sequence (SPS), a picture (PPS), or a slice.
[0102] Next, the history merge candidate derivation unit 345 and the history merge candidate derivation unit 445 add the history prediction motion vector candidate registered in the history prediction motion vector candidate list HmvpCandList to the merge candidate list mergeCandList (step S403 in FIG. 21). The detailed processing procedure of step S403 will be described later in detail with reference to the flowchart in FIG.
[0103] Next, the average merge candidate derivation unit 344 and the average merge candidate derivation unit 444 derive average merge candidates from the merge candidate list mergeCandList, and register the derived average merge candidates in the merge candidate list mergeCandList (step S404 in FIG. 21). The detailed process procedure of step S404 will be described later in detail with reference to the flowchart in FIG.
[0104] Next, in the merge candidate supplementation unit 346 and the merge candidate supplementation unit 446, when the number of merge candidates registered in the merge candidate list mergeCandList, numCurrMergeCand, is smaller than the maximum number of merge candidates, MaxNumMergeCand, the number of merge candidates registered in the merge candidate list mergeCandList, numCurrMergeCand is set as an upper limit of the maximum number of merge candidates, MaxNumMergeCand, and additional merge candidates are derived and registered in the merge candidate list mergeCandList (step S405 in FIG. 21). For the P slice, a merge candidate having a motion vector of (0,0) value with a different reference index and a prediction mode of L0 prediction (Pred_L0) is added, with the maximum number of merge candidates, MaxNumMergeCand, being set as an upper limit. For the B slice, a merge candidate having a motion vector of (0,0) value with a different reference index and a prediction mode of bi-prediction (Pred_BI) is added.
[0105] Next, the merge candidate selection unit 347 and the merge candidate selection unit 447 select a merge candidate from among 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 code amount and the distortion amount, and supplies a merge index indicating the selected merge candidate and inter prediction information of the merge candidate to the motion compensation prediction unit 306. 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] When the size (product of width and height) of a coding block is less than 32, the normal merge mode derivation unit 302 and the normal merge mode derivation unit 402 derive a merge candidate for the parent block of the coding block. Then, for all child blocks, the merge candidate derived for the parent block is used, but only if the size of the parent block is 32 or more and fits within the screen.
[0107] <Sub-block prediction motion vector mode derivation> Sub-block predicted motion vector mode derivation will now be described.
[0108] FIG. 26 is a block diagram of the sub-block prediction motion vector mode derivation unit 303 in the encoding device of this embodiment.
[0109] First, an affine inheritance predicted motion vector candidate is derived in the affine inheritance predicted motion vector candidate derivation unit 361. The derivation of the affine inheritance predicted motion vector candidate will be described later in detail.
[0110] Next, an affine construction motion vector predictor candidate derivation unit 362 derives an affine construction motion vector predictor candidate. The derivation of an affine construction motion vector predictor candidate will be described later in detail.
[0111] Next, an affine-common predictor motion vector candidate derivation unit 363 derives an affine-common predictor motion vector candidate. The derivation of an affine-common predictor motion vector candidate will be described later in detail.
[0112] The sub-block motion vector detection unit 366 detects a sub-block motion vector suitable for the sub-block prediction motion vector mode, and supplies the detected vector to a sub-block prediction motion vector candidate selection unit 367 and a difference calculation unit 368 .
[0113] The sub-block predictive motion vector candidate selection unit 367 selects a sub-block predictive motion vector candidate from among the sub-block predictive motion vector candidates derived in the affine inheritance predictive motion vector candidate derivation unit 361, the affine construction predictive motion vector candidate derivation unit 362, and the affine identical predictive motion vector candidate derivation unit 363 based on the motion vector supplied from the sub-block motion vector detection unit 366, and supplies information regarding the selected sub-block predictive motion vector candidate to the inter prediction mode determination unit 305 and the difference calculation unit 368.
[0114] The difference calculation unit 368 supplies the difference prediction motion vector obtained by subtracting the sub-block prediction motion vector selected by the sub-block prediction motion vector candidate selection unit 367 from the motion vector supplied from the sub-block motion vector detection unit 366 to the inter prediction mode determination unit 305.
[0115] FIG. 27 is a block diagram of the sub-block predictive motion vector mode derivation unit 403 in the decoding device according to this embodiment.
[0116] First, an affine inheritance predicted motion vector candidate is derived in the affine inheritance predicted motion vector candidate derivation unit 461. The process of the affine inheritance predicted motion vector candidate derivation unit 461 is the same as the process of the affine inheritance predicted motion vector candidate derivation unit 361 in the encoding device of this embodiment.
[0117] Next, an affine construction predicted motion vector candidate derivation unit 462 derives an affine construction predicted motion vector candidate. The process of the affine construction predicted motion vector candidate derivation unit 462 is the same as the process of the affine construction predicted motion vector candidate derivation unit 362 in the encoding device of this embodiment.
[0118] Next, an affine-coincident predictor motion vector candidate is derived in the affine-coincident predictor motion vector candidate derivation unit 463. The process of the affine-coincident predictor motion vector candidate derivation unit 463 is the same as the process of the affine-coincident predictor motion vector candidate derivation unit 363 in the encoding device of this embodiment.
[0119] The sub-block predictor motion vector candidate selection unit 466 selects a sub-block predictor motion vector candidate from among the sub-block predictor motion vector candidates derived in the affine inheritance predictor motion vector candidate derivation unit 461, the affine construction predictor motion vector candidate derivation unit 462, and the affine identical predictor motion vector candidate derivation unit 463 based on the predictor motion vector index transmitted from the encoding device and decoded, and supplies information about the selected sub-block predictor motion vector candidate to the motion compensation prediction unit 406 and the addition calculation unit 467.
[0120] The addition calculation unit 467 adds the differential motion vector transmitted from the encoding device and decoded to the sub-block predictive motion vector selected by the sub-block predictive motion vector candidate selection unit 466, and supplies the generated motion vector to the motion compensation prediction unit 406.
[0121] <Derivation of affine inheritance predicted motion vector candidates> A description will be given of the affine inheritance predictor motion vector candidate derivation unit 361. The affine inheritance predictor motion vector candidate derivation unit 461 is similar to the affine inheritance predictor motion vector candidate derivation unit 361.
[0122] The affine inheritance motion vector predictor candidate inherits the motion vector information of the control point.
[0123] FIG. 30 is a diagram for explaining derivation of affine inheritance predicted motion vector candidates.
[0124] The affine inheritance predicted motion vector candidates are obtained by searching the motion vectors of the control points of spatially adjacent encoded and decoded blocks.
[0125] Specifically, up to one affine mode is searched for from each of the blocks (A0, A1) adjacent to the left side of the block to be processed and the blocks (B0, B1, B2) adjacent to the top side of the block to be processed, and these are used as the affine inheritance predicted motion vector.
[0126] FIG. 34 is a flowchart showing the derivation of affine inheritance predicted motion vector candidates.
[0127] First, the block (A0, A1) adjacent to the left side of the block to be processed is set as the left group (step S3101), and it is determined whether the block including A0 is a block using affine transformation motion compensation (affine mode) (step S3102). If A0 is in affine mode (step S3102: YES), the affine mode used by A0 is obtained (step S3103), and the process moves to the block adjacent to the top. If A0 is not in affine mode (step S3102: NO), the target for deriving affine inheritance predicted motion vector candidates is set to A0->A1, and an attempt is made to obtain the affine mode from the block including A1.
[0128] Next, the blocks (B0, B1, B2) adjacent to the upper side of the block to be processed are set as an upper group (step S3104), and it is determined whether the block including B0 is in affine mode (step S3105). If B0 is in affine mode (step S3105: YES), the affine mode used by B0 is obtained (step S3106), and the process ends. If B0 is not in affine mode (step S3105: NO), the target of affine inheritance predicted motion vector candidate derivation is set to B0->B1, and an attempt is made to obtain the affine mode from the block including B1. Furthermore, if B1 is not in affine mode (step S3105: NO), the target of affine inheritance predicted motion vector candidate derivation is set to B1->B2, and an attempt is made to obtain the affine mode from the block including B2.
[0129] In this way, by dividing the blocks into left and top blocks, and searching for affine modes for the left blocks from the bottom left to the top left blocks, and for the left blocks from the top right to the top left blocks, it is possible to obtain two affine modes that are as different as possible, and to derive an affine predictor motion vector candidate in which one of the affine predictor motion vectors has a smaller differential motion vector.
[0130] <Derivation of affine-constructed motion vector candidates> The following describes the affine construction predicted motion vector candidate derivation unit 362. The affine construction predicted motion vector candidate derivation unit 462 is similar to the affine construction predicted motion vector candidate derivation unit 362.
[0131] The affine constructed motion vector predictor candidate constructs motion vector information of a control point from motion information of spatially adjacent blocks.
[0132] FIG. 31 is a diagram for explaining derivation of affine constructed predicted motion vector candidates.
[0133] Affine constructed motion vector predictor candidates are obtained by constructing a new affine mode by combining motion vectors of spatially adjacent encoded and decoded blocks.
[0134] Specifically, the motion vector of the upper left control point CP0 is derived from the block (B2, B3, A2) adjacent to the upper left of the block to be processed, the motion vector of the upper right control point CP1 is derived from the block (B1, B0) adjacent to the upper right of the block to be processed, and the motion vector of the lower left control point CP2 is derived from the block (A1, A0) adjacent to the lower left of the block to be processed.
[0135] FIG. 35 is a flowchart showing the derivation of affine constructed motion vector predictor candidates.
[0136] First, the upper left control point CP0, the upper right control point CP1, and the lower left control point CP2 are derived (step S3201). The upper left control point CP0 is calculated by searching for a reference block having the same reference image as the block to be processed, in the order of priority of B2, B3, A2 reference blocks. The upper right control point CP1 is calculated by searching for a reference block having the same reference image as the block to be processed, in the order of priority of B1, B0 reference blocks. The lower left control point CP2 is calculated by searching for a reference block having the same reference image as the block to be processed, in the order of priority of A1, A0 reference blocks.
[0137] When the three control points mode is selected as the affine construction predicted motion vector (step S3202: YES), it is determined whether or not all three control points (CP0, CP1, CP2) have been derived (step S3203). When all three control points (CP0, CP1, CP2) have been derived (step S3203: YES), an affine model using the three control points (CP0, CP1, CP2) is set as the affine construction predicted motion vector (step S3204). When the three control points mode is not selected but the two control points mode is selected (step S3202: NO), it is determined whether or not all two control points (CP0, CP1) have been derived (step S3205). When all two control points (CP0, CP1) have been derived (step S3205: YES), an affine model using the two control points (CP0, CP1) is set as the affine construction predicted motion vector (step S3206).
[0138] <Derivation of affine identical predictive motion vector candidates> The following describes the affine identical predictor motion vector candidate derivation unit 363. The affine identical predictor motion vector candidate derivation unit 463 is similar to the affine identical predictor motion vector candidate derivation unit 363.
[0139] The affine identical predictor motion vector candidates are obtained by deriving the same motion vector at each control point.
[0140] Specifically, similarly to the affine construction motion vector predictor candidate derivation units 362 and 462, each control point information is derived and all control points are set to the same one of CP0 to CP2, thereby obtaining the candidate prediction vector. Alternatively, similarly to the normal motion vector predictor mode, the candidate prediction vector can be obtained by setting the derived temporal motion vector to all control points.
[0141] <Sub-block merge mode derivation> Sub-block merge mode derivation will now be described.
[0142] FIG. 28 is a block diagram of the subblock merge mode derivation unit 304 in the encoding device of this embodiment. The subblock merge mode derivation unit 304 includes a subblock merge candidate list subblockMergeCandList. This has a list structure similar to the merge candidate list mergeCandList in the normal merge mode derivation unit 302, and includes a merge index indicating a location in the subblock merge candidate list and a storage area for storing subblock merge candidates corresponding to the index as elements. In this embodiment, the subblock merge candidate list subblockMergeCandList can register at least five merge candidates (inter prediction information). However, each merge candidate further has motion vector information in units of subblocks or motion vector information of a control point.
[0143] First, sub-block temporal merging candidates are derived in the sub-block temporal merging candidate derivation unit 381. The derivation of sub-block temporal merging candidates will be described later in detail.
[0144] Next, affine inheritance merge candidate derivation unit 382 derives affine inheritance merge candidates. The derivation of affine inheritance merge candidates will be described later in detail.
[0145] Next, affine construct merge candidates are derived in the affine construct merge candidate derivation unit 383. The derivation of affine construct merge candidates will be described later in detail.
[0146] Next, affine-fixed merging candidates are derived in affine-fixed merging candidate derivation unit 385. The derivation of affine-fixed merging candidates will be described later in detail.
[0147] The sub-block merging candidate selection unit 386 selects a sub-block merging candidate from among the sub-block merging candidates derived in the sub-block temporal merging candidate derivation unit 381, the affine inheritance merging candidate derivation unit 382, the affine construction merging candidate derivation unit 383, and the affine fixed merging candidate derivation unit 385, and supplies information about the selected sub-block merging candidate to the inter-prediction mode determination unit 305.
[0148] 29 is a block diagram of the sub-block merge mode derivation unit 404 in the decoding device of this embodiment. The sub-block merge mode derivation unit 404 includes a sub-block merge candidate list subblockMergeCandList. This is the same as the sub-block merge mode derivation unit 304.
[0149] First, sub-block temporal merging candidates are derived in the sub-block temporal merging candidate derivation unit 481. The process of the sub-block temporal merging candidate derivation unit 481 is the same as the process of the sub-block temporal merging candidate derivation unit 381.
[0150] Next, affine inheritance merge candidate derivation unit 482 derives affine inheritance merge candidates. The process of affine inheritance merge candidate derivation unit 482 is the same as the process of affine inheritance merge candidate derivation unit 382.
[0151] Next, affine construct merge candidates are derived in the affine construct merge candidate derivation unit 483. The process of the affine construct merge candidate derivation unit 483 is the same as the process of the affine construct merge candidate derivation unit 383.
[0152] Next, affine-fixed merge candidates are derived in affine-fixed merge candidate derivation unit 485. The process of affine-fixed merge candidate derivation unit 485 is the same as the process of affine-fixed merge candidate derivation unit 485.
[0153] The sub-block merging candidate selection unit 486 selects a sub-block merging candidate from among the sub-block merging candidates derived in the sub-block temporal merging candidate derivation unit 481, the affine inheritance merging candidate derivation unit 482, the affine construction merging candidate derivation unit 483, and the affine fixed merging candidate derivation unit 485, based on the index transmitted from the encoding device and decoded, and supplies information about the selected sub-block merging candidate to the motion compensation prediction unit 406.
[0154] When the size (product of width and height) of a coding block is less than 32, the sub-block merging mode derivation unit 304 and the sub-block merging mode derivation unit 404 derive sub-block merging candidates in the parent block of the coding block. Then, for all child blocks, the sub-block merging candidates derived in the parent block are used, but only if the size of the parent block is 32 or more and fits within the screen.
[0155] <Sub-block time merge candidate derivation> The operation of the sub-block temporal merging candidate derivation unit 381 will be described later.
[0156] <Affine inheritance merge candidate derivation> A description will now be given of the affine inheritance merge candidate derivation unit 382. The affine inheritance merge candidate derivation unit 482 is similar to the affine inheritance merge candidate derivation unit 382.
[0157] An affine inheritance merge candidate inherits the affine model of the control points from the affine models of spatially adjacent blocks.
[0158] 32 is a diagram for explaining derivation of affine inheritance merge candidates. Similar to the derivation of affine inheritance predicted motion vectors, affine inheritance merge mode candidates are derived by searching for motion vectors of control points of spatially adjacent encoded and decoded blocks.
[0159] Specifically, a maximum of one affine mode is searched for from each of the blocks (A0, A1) adjacent to the left side of the block to be processed and the blocks (B0, B1, B2) adjacent to the top side of the block to be processed, and used for the affine merge mode.
[0160] FIG. 36 is a flowchart of affine inheritance merge candidate derivation.
[0161] First, the block (A0, A1) adjacent to the left side of the block to be processed is set as the left group (step S3301), and it is determined whether the block including A0 is in affine mode (step S3302). If A0 is in affine mode (step S3102: YES), the affine model used by A0 is obtained (step S3303), and processing proceeds to the adjacent block above. If A0 is not in affine mode (step S3302: NO), the target for deriving affine inheritance merge candidates is set to A0->A1, and an attempt is made to obtain the affine mode from the block including A1.
[0162] Next, the blocks (B0, B1, B2) adjacent to the upper side of the block to be processed are set as an upper group (step S3304), and it is determined whether the block including B0 is in affine mode (step S3305). If B0 is in affine mode (step S3305: YES), the affine model used by B0 is obtained (step S3306), and the process ends. If B0 is not in affine mode (step S3305: NO), the target for affine inheritance merge candidate derivation is set to B0->B1, and an attempt is made to obtain the affine mode from the block including B1. Furthermore, if B1 is not in affine mode (step S3305: NO), the target for affine inheritance merge candidate derivation is set to B1->B2, and an attempt is made to obtain the affine mode from the block including B2.
[0163] <Affine construction merge candidate derivation> The following describes the affine construct merge candidate derivation unit 383. The affine construct merge candidate derivation unit 483 is similar to the affine construct merge candidate derivation unit 383.
[0164] 33 is a diagram for explaining derivation of affine construct merge candidates. The affine construct merge candidates construct an affine model of control points from motion information of spatially adjacent blocks and a temporal coding block.
[0165] Specifically, the motion vector of the upper left control point CP0 is derived from the block (B2, B3, A2) adjacent to the upper left of the block to be processed, the motion vector of the upper right control point CP1 is derived from the block (B1, B0) adjacent to the upper right of the block to be processed, the motion vector of the lower left control point CP2 is derived from the block (A1, A0) adjacent to the lower left of the block to be processed, and the motion vector of the lower right control point CP3 is derived from the coding block (T0) adjacent to the lower right of the block to be processed.
[0166] FIG. 37 is a flowchart of affine construct merge candidate derivation.
[0167] First, the upper left control point CP0, the upper right control point CP1, the lower left control point CP2, and the lower right control point CP3 are derived (step S3401). The upper left control point CP0 is calculated by searching for blocks having motion information in the order of priority of B2, B3, and A2 blocks. The upper right control point CP1 is calculated by searching for blocks having motion information in the order of priority of B1 and B0 blocks. The lower left control point CP2 is calculated by searching for blocks having motion information in the order of priority of A1 and A0 blocks. The lower right control point CP3 is calculated by searching for motion information of time blocks.
[0168] Next, it is determined whether an affine model can be constructed using three control points from the derived CP0, CP1, and CP2 (step S3402), and if so (step S3402: YES), the three control point affine model from CP0, CP1, and CP2 is designated as an affine merge candidate (step S3403).
[0169] Next, it is determined whether an affine model can be constructed using the three control points CP0, CP1, and CP3 derived (step S3404), and if so (step S3404: YES), the three control point affine model using CP0, CP1, and CP3 is designated as an affine merge candidate (step S3405).
[0170] Next, it is determined whether an affine model can be constructed using the three control points CP0, CP2, and CP3 derived (step S3406), and if so (step S3406: YES), the three control point affine model using CP0, CP2, and CP3 is designated as an affine merge candidate (step S3407).
[0171] Next, it is determined whether an affine model can be constructed using three control points from the derived CP1, CP2, and CP3 (step S3408), and if so (step S3408: YES), the three control point affine model from CP1, CP2, and CP3 is designated as an affine merge candidate (step S3409).
[0172] Next, it is determined whether an affine model can be constructed using two control points from the derived CP0 and CP1 (step S3410), and if so (step S3410: YES), the two-control-point affine model using CP0 and CP1 is designated as an affine merge candidate (step S3411).
[0173] Next, it is determined whether an affine model can be constructed using two control points from the derived CP0 and CP2 (step S3412), and if so (step S3412: YES), the two-control-point affine model using CP0 and CP2 is designated as an affine merge candidate (step S3413).
[0174] Here, whether or not an affine model can be constructed is based on the condition that at least the reference images for all control points are the same (affine transformation is possible). Also, for affine models other than the three-control-point affine model using CP0, CP1, and CP2 and the two-control-point affine model using CP0 and CP1, the three-control-point affine model is converted to the three-control-point affine model using CP0, CP1, and CP2, and the two-control-point affine model is converted to the two-control-point affine model using CP0 and CP1.
[0175] <Affine fixed merge candidate derivation> The following describes the affine-anchored merging candidate derivation unit 385. The affine-anchored merging candidate derivation unit 485 is similar to the affine-anchored merging candidate derivation unit 385.
[0176] The affine fixed merge candidate fixes the motion information of the control points with the fixed motion information.
[0177] Specifically, the motion vector of each control point is fixed to (0,0).
[0178] <Temporal prediction motion vector derivation> Prior to the description of the temporal motion vector predictor, the temporal relationship of pictures will be described with reference to Figure 49. Figure 49(a) shows the relationship between a coding block to be processed and a coded picture that is temporally different from the picture to be processed. A specific coded picture to be referenced in coding the picture to be processed is defined as ColPic. ColPic is specified by syntax.
[0179] Also, FIG. 49(b) shows coded blocks that are already coded and exist in the same position as the coding block to be processed and in the vicinity in ColPic. However, the coding blocks T0 and T1 shown in FIG. 49(b) are schematic, and the actual positions and sizes are not limited to these. Now, the coding block to be processed has a position (xCb, yCb), a width cbWidth, and a height cbHeight. Then, xColBr = xCb + cbWidth yColBr = yCb + cbHeight The coding block on ColPic that includes the position ((xColBr >> 3) << 3, (yColBr >> 3) << 3) is T0. xColCtr = xCb + (cbWidth >> 1) yColCtr = yCb + (cbHeight >> 1) The coding block on ColPic that includes the position ((xColCtr >> 3) << 3, (yColCtr >> 3) << 3) is T1.
[0180] The above description of the temporal relationship between pictures is for the encoding process, but the same applies to the decoding process. In other words, the above description of the decoding process can be applied in the same manner, with the encoding process replaced by the decoding process.
[0181] The operation of the temporal motion vector predictor candidate derivation unit 322 in the normal motion vector predictor mode derivation unit 301 in FIG. 17 will be described with reference to FIG.
[0182] First, ColPic is derived (step S4201). The derivation of ColPic will be described with reference to FIG.
[0183] If the slice type slice_type is a B slice and the flag collocated_from_l0_flag is 0 (step S4211: YES, step S4212: YES), the picture ColPic at a different time becomes the picture RefPicList1[0] whose reference index in the reference list L1 is 0 (step S4213). Otherwise, that is, if the slice type slice_type is a B slice and the above-mentioned flag collocated_from_l0_flag is 1 (step S4211: YES, step S4212: NO), or if the slice type slice_type is a P slice (step S4211: NO, step S4214: YES), the picture ColPic at a different time becomes the picture RefPicList0[0] whose reference index in the reference list L0 is 0 (step S4215). If slice_type is not a P slice (step S4214: NO), the process ends.
[0184] Again, refer to Fig. 50. After ColPic is derived, the coding block colCb is derived and coding information is obtained (step S4202). This process will be described with reference to Fig. 52.
[0185] First, in a picture ColPic of a different time, a coding block including the same lower right position as the coding block to be coded is set as a coding block colCb of a different time (step S4221). An example of this coding block is shown as coding block T0 in FIG.
[0186] Next, obtain the coding information of the coding block colCb of the different time (step S4222). If the PredMode of the coding block colCb of the different time is not available or the prediction mode PredMode of the coding block colCb of the different time is intra prediction (MODE_INTRA) (step S4223: NO, step S4224: YES), the coding block including the same central lower right position as the coding block to be processed in the picture ColPic of the different time is set as the coding block colCb of the different time (step S4225). An example of this coding block is shown in the coding block T1 of FIG. 49.
[0187] Referring again to FIG. 50, next, inter prediction information is derived for each reference list (steps S4203 and S4204). Here, for the coding block colCb, a motion vector mvLXCol for each reference list and a flag availableFlagLXCol indicating whether coding information is valid or not are derived. LX indicates a reference list, and LX is L0 when deriving reference list 0, and LX is L1 when deriving reference list 1. The derivation of inter prediction information will be described with reference to FIG. 53.
[0188] If the coding block colCb of a different time is not available (step S4231: NO), or if the prediction mode PredMode is intra prediction (MODE_INTRA) (step S4232: NO), the flags availableFlagLXCol and predFlagLXCol are both set to 0 (step S4233), the motion vector mvLXCol is set to (0,0) (step S4234), and the processing ends.
[0189] If the coding block colCb is available (step S4231: YES) and the prediction mode PredMode is not intra prediction (MODE_INTRA) (step S4232: YES), mvCol, refIdxCol, and availableFlagCol are calculated in the following procedure.
[0190] When the flag PredFlagL0[xPCol][yPCol] indicating whether or not the L0 prediction of the coding block colCb is used is 0 (step S4235: YES), the prediction mode of the coding block colCb is Pred_L1, so the motion vector mvCol is set to the same value as the L1 motion vector MvL1[xPCol][yPCol] of the coding block colCb (step S4236), the reference index refIdxCol is set to the same value as the L1 reference index RefIdxL1[xPCol][yPCol] (step S4237), and the reference list listCol is set to L1 (step S4238). Here, xPCol and yPCol are indexes indicating the position of the upper left pixel of the coding block colCb in the picture ColPic of a different time.
[0191] On the other hand, if the L0 prediction flag PredFlagL0[xPCol][yPCol] of the coding block colCb is not 0 (step S4235: NO), it is determined whether the L1 prediction flag PredFlagL1[xPCol][yPCol] of the coding block colCb is 0. If the L1 prediction flag PredFlagL1[xPCol][yPCol] of the coding block colCb is 0 (step S4239: YES), the motion vector mvCol is set to the same value as the L0 motion vector MvL0[xPCol][yPCol] of the coding block colCb (step S4240), the reference index refIdxCol is set to the same value as the L0 reference index RefIdxL0[xPCol][yPCol] (step S4241), and the reference list listCol is set to L0 (step S4242).
[0192] If the L0 prediction flag PredFlagL0[xPCol][yPCol] of the coding block colCb and the L1 prediction flag PredFlagL1[xPCol][yPCol] of the coding block colCb are both not 0 (steps S4235: NO and S4239: NO), the inter prediction mode of the coding block colCb is bi-prediction (Pred_BI), so one of the two motion vectors L0 and L1 is selected (step S4243).
[0193] FIG. 54 is a flowchart showing the procedure of a process for deriving inter prediction information of a coding block when the inter prediction mode of the coding block colCb is bi-prediction (Pred_BI).
[0194] First, it is determined whether the POC of all pictures registered in all reference lists is smaller than the POC of the current picture to be processed (step S4251). If the POC of all pictures registered in all reference lists, L0 and L1, of the coding block colCb is smaller than the POC of the current picture to be processed (step S4251: YES), and LX has derived a prediction vector candidate for the motion vector of L0, i.e., the L0 coding block to be processed (step S4252: YES), the inter prediction information of the L0 side of the coding block colCb is selected. If LX has derived a prediction vector candidate for the motion vector of L1, i.e., the L1 coding block to be processed (step S4252: NO), the inter prediction information of the L1 side of the coding block colCb is selected. On the other hand, if at least one of the POCs of pictures registered in all reference lists L0 and L1 of the coding block colCb is larger than the POC of the current picture to be processed (step S4251: NO) and the flag collocated_from_l0_flag is 0 (step S4253: YES), the inter-prediction information of the L0 side of the coding block colCb is selected, and if the flag collocated_from_l0_flag is 1 (step S4253: NO), the inter-prediction information of the L1 side of the coding block colCb is selected.
[0195] When selecting inter-prediction information for L0 of the coding block colCb (step S4252: YES, or step S4253: YES), the motion vector mvCol is set to the same value as MvL0[xPCol][yPCol] (step S4254), the reference index refIdxCol is set to the same value as RefIdxL0[xPCol][yPCol] (step S4255), and the list listCol is set to L0 (step S4256).
[0196] When selecting inter-prediction information for L1 of the coding block colCb (step S4252: NO or step S4253: NO), the motion vector mvCol is set to the same value as MvL1[xPCol][yPCol] (step S4257), the reference index refIdxCol is set to the same value as RefIdxL1[xPCol][yPCol] (step S4258), and the list listCol is set to L1 (step S4259).
[0197] Returning to FIG. 53, when inter prediction information is acquired from the coding block colCb, both the flag availableFlagLXCol and the flag predFlagLXCol are set to 1 (Step S4244).
[0198] Next, the motion vector mvCol is scaled to obtain a motion vector mvLXCol (step S4245). The procedure for the scaling calculation process of the motion vector mvLXCol will be described with reference to FIG.
[0199] The inter-picture distance td is calculated by subtracting the POC of the reference picture corresponding to the reference index refIdxCol referred to in the list listCol of the coding block colCb from the POC of the picture ColPic at a different time. td = [POC of picture ColPic at different time] - [POC of reference picture referenced in list listCol of coding block colCb] (Step S4261). Note that, when the POC of the reference picture referred to in the list listCol of the coding block colCb is earlier in display order than the picture ColPic of the different time, the inter-picture distance td is a positive value, and when the POC of the reference picture referred to in the list listCol of the coding block colCb is later in display order than the picture ColPic of the different time, the inter-picture distance td is a negative value.
[0200] Next, the inter-picture distance tb is calculated by subtracting the POC of the reference picture referred to by the list LX of the current picture to be processed from the POC of the current picture to be processed. tb = [POC of the current picture to be processed] - [POC of the reference picture corresponding to the reference index of the LX of the temporal merge candidate] (Step S4262). Note that if the reference picture referred to in the list LX of the picture currently to be processed is earlier in display order than the picture currently to be processed, the inter-picture distance tb has a positive value, and if the reference picture referred to in the list LX of the picture currently to be processed is later in display order, the inter-picture distance tb has a negative value.
[0201] Next, the inter-picture distances td and tb are compared (step S4263). If the inter-picture distances td and tb are equal (step S4263: YES), the motion vector mvLXCol is calculated as follows: mvLXCol = mvCol (step S4264), and this scaling calculation process ends.
[0202] On the other hand, if the inter-picture distances td and tb are not equal (step S4263: NO), the variable tx is set as follows: tx = ( 16384 + Abs( td ) >> 1 ) / td (step S4265). Next, the scaling coefficient distScaleFactor is calculated as follows: distScaleFactor = Clip3( -4096, 4095, ( tb * tx + 32 ) >> 6 ) (step S4266). Here, Clip3(x, y, z) is a function that limits the value z to a minimum value of x and a maximum value of y. Next, the motion vector mvLXCol is calculated as follows: mvLXCol = Clip3( -32768, 32767, Sign( distScaleFactor * mvLXCol ) * ((Abs( distScaleFactor * mvLXCol ) + 127 ) >> 8 ) ) (step S4267), and this scaling calculation process is terminated. Here, Sign(x) is a function that returns the sign of the value x, and Abs(x) is a function that returns the absolute value of the value x.
[0203] Referring again to FIG. 50, the motion vector mvL0Col of L0 is added as a candidate to the motion vector predictor candidate list mvpListLX in the normal motion vector predictor mode derivation unit 301 described above (step S4205). However, this addition is only made when the flag availableFlagL0Col=1 indicating whether the coding block colCb of the reference list 0 is valid or not. Also, the motion vector mvL1Col of L1 is added as a candidate to the motion vector predictor candidate list mvpListLX in the normal motion vector predictor mode derivation unit 301 described above (step S4205). However, this addition is only made when the flag availableFlagL1Col=1 indicating whether the coding block colCb of the reference list 1 is valid or not. With the above, the process of the temporal motion vector predictor candidate derivation unit 322 is terminated.
[0204] The above description of the normal prediction motion vector mode derivation unit 301 is for encoding, but the same applies to decoding. That is, the operation of the temporal prediction motion vector candidate derivation unit 422 in the normal prediction motion vector mode derivation unit 401 in Fig. 23 can be similarly described by replacing the encoding in the above description with decoding.
[0205] <Deriving Temporal Merge Candidates> The operation of the temporal merge candidate derivation unit 342 in the normal merge mode derivation unit 302 in FIG. 18 will be described with reference to FIG.
[0206] First, ColPic is derived (step S4301). Next, a coding block colCb is derived to obtain coding information (step S4302). Furthermore, inter prediction information is derived for each reference list (steps S4303 and S4304). The above processes are the same as S4201 to S4204 in the temporal motion vector predictor candidate derivation unit 322, and therefore description thereof will be omitted.
[0207] Next, a flag availableFlagCol indicating whether the coding block colCb is valid or not is calculated (step S4305). When the flag availableFlagL0Col or the flag availableFlagL1Col is 1, availableFlagCol is 1. In other cases, availableFlagCol is 0.
[0208] Then, the motion vector mvL0Col of L0 and the motion vector mvL1Col of L1 are added as candidates to the merge candidate list mergeCandList in the normal merge mode derivation unit 302 described above (step S4306). However, this addition is only made when the flag indicating whether the coding block colCb is valid or not is availableFlagCol=1. With the above, the processing of the temporal merge candidate derivation unit 342 is terminated.
[0209] The above description of the temporal merge candidate derivation unit 342 is for encoding, but the same applies to decoding. That is, the operation of the temporal merge candidate derivation unit 442 in the normal merge mode derivation unit 402 in Fig. 24 can be similarly described by replacing encoding in the above description with decoding.
[0210] <Update of historical motion vector prediction candidate list> Next, a detailed description will be given of a method for initializing and updating the historical motion vector predictor 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. Fig. 38 is a flowchart illustrating the procedure of the historical motion vector predictor candidate list initialization / update process.
[0211] In this embodiment, the history prediction motion vector candidate list HmvpCandList is updated in the coding information storage memory 111 and the coding information storage memory 205. A history 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.
[0212] The historical prediction motion vector candidate list HmvpCandList is initially set at the beginning of the slice, and on the encoding side, the historical prediction motion vector candidate list HmvpCandList is updated when the prediction method determination unit 105 selects the normal prediction vector mode or the normal merge mode, and on the decoding side, the historical prediction motion vector candidate list HmvpCandList is updated when the inter prediction information decoded by the bit string decoding unit 201 is the normal prediction vector mode or the normal merge mode.
[0213] Inter prediction information used when performing inter prediction in normal prediction vector mode or normal merge mode is registered in the history prediction motion vector candidate list HmvpCandList as an inter prediction information candidate hMvpCand. The inter prediction information candidate hMvpCand includes an L0 reference index refIdxL0 and an L1 reference index refIdxL1, an L0 prediction flag predFlagL0 indicating whether or not L0 prediction is performed, an L1 prediction flag predFlagL1 indicating whether or not L1 prediction is performed, an L0 motion vector mvL0, and an L1 motion vector mvL1. It is checked in order from the top of the history prediction motion vector candidate list HmvpCandList to the back whether there is inter prediction information with the same value as the inter prediction information candidate hMvpCand among the elements (i.e., inter prediction information) registered in the history prediction motion vector candidate list HmvpCandList provided in the coding information storage memory 111 on the coding side and the coding information storage memory 205 on the decoding side. If there is inter prediction information with the same value as the inter prediction information candidate hMvpCand, the element is deleted from the historical motion vector predictor candidate list HmvpCandList. On the other hand, if there is no inter prediction information with the same value as the inter prediction information candidate hMvpCand, the first element of the historical motion vector predictor candidate list HmvpCandList is deleted, and the inter prediction information candidate hMvpCand is added to the end of the historical motion vector predictor candidate list HmvpCandList.
[0214] The size of the maximum history motion vector predictor candidate list, which is the maximum number provided in the encoding information storage memory 111 on the encoding side and the encoding information storage memory 205 on the decoding side in the present invention, i.e., the maximum number of elements (maximum number of candidates) MaxNumHmvpCand of the history motion vector predictor candidate list HmvpCandList, is set to 6. Note that MaxNumHmvpCand may be set to the same value as the maximum number of merge candidates MaxNumMergeCand - 1, or may be set to the same value as the maximum number of merge candidates MaxNumMergeCand, or may be a predetermined fixed value such as 5 or 6.
[0215] First, the historical motion vector predictor candidate list HmvpCandList is initialized in units of slices (step S2101 in FIG. 38). All elements of the historical motion vector predictor candidate list HmvpCandList are cleared at the beginning of the slice, and the value of the number of historical motion vector predictor candidates (current number of candidates) NumHmvpCand registered in the historical motion vector predictor candidate list HmvpCandList is set to 0.
[0216] Furthermore, a predetermined value is set to the offset value hMvpIdxOffset. A value between 0 and (the size of the history motion vector predictor candidate list, MaxNumHmvpCand -1) is set as the offset value hMvpIdxOffset. The offset value hMvpIdxOffset is a predetermined value, but the offset value hMvpIdxOffset may be set by encoding / decoding in sequence units, or by encoding / decoding in slice units. The offset value hMvpIdxOffset will be described in detail later.
[0217] Note that, although the initialization of the historical motion vector predictor candidate list HmvpCandList is performed on a slice-by-slice basis (the first coding block of a slice), it may be performed on a picture-by-picture basis, a tile-by-tile basis, or a tree block row-by-tree block basis.
[0218] Next, the following update process of the historical motion vector predictor candidate list HmvpCandList is repeatedly performed for each coding block in the slice (steps S2102 to S2107 in FIG. 38).
[0219] First, initial settings are made for each coding block. A value of FALSE is set to a flag identicalCandExist indicating whether an identical candidate exists, and 0 is set to a deletion target index removeIdx indicating a candidate to be deleted (step S2103 in FIG. 38).
[0220] It is determined whether or not there is inter prediction information with the same value as the inter prediction information candidate hMvpCand to be registered in the history prediction motion vector candidate list HmvpCandList (step S2104 in FIG. 38). If the prediction method determination unit 105 on the encoding side determines that the mode is the normal prediction motion vector mode or the normal merge mode, or if the bit string decoding unit 201 on the decoding side decodes the inter prediction information as the normal prediction motion vector mode or the normal merge mode, the inter prediction information is set as the inter prediction information candidate hMvpCand to be registered. If the prediction method determination unit 105 on the encoding side determines that the mode is the intra prediction mode, the sub-block prediction motion vector mode, or the sub-block merge mode, or if the bit string decoding unit 201 on the decoding side decodes the intra prediction mode, the sub-block prediction motion vector mode, or the sub-block merge mode, the update process of the history prediction motion vector candidate list HmvpCandList is not performed, and the inter prediction information candidate hMvpCand to be registered does not exist. If there is no inter-prediction information candidate hMvpCand to be registered, steps S2105 to S2106 are skipped (step S2104 in FIG. 38: NO). If there is an inter-prediction information candidate hMvpCand to be registered, the processes in and after step S2105 are performed (step S2104 in FIG. 38: YES).
[0221] Next, it is determined whether or not inter prediction information having the same value as the inter prediction information candidate hMvpCand to be registered, that is, whether or not the same element exists in each element of the history prediction motion vector candidate list HmvpCandList (step S2105 in FIG. 38). FIG. 39 is a flowchart of the same element confirmation process procedure. If the value of the number of history prediction motion vector candidates NumHmvpCand is 0 (step S2121 in FIG. 39: NO), the history prediction motion vector candidate list HmvpCandList is empty and no identical candidate exists, so steps S2122 to S2125 in FIG. 39 are skipped and the same element confirmation process procedure ends. If the value of the number of history prediction motion vector candidates NumHmvpCand is greater than 0 (step S2121 in FIG. 39: YES), it is confirmed in order from the top of the history prediction motion vector candidate list HmvpCandList to the back whether inter prediction information having the same value as the inter prediction information candidate hMvpCand to be registered exists. The process of step S2123 is repeated for the history prediction motion vector index hMvpIdx from 0 to NumHmvpCand-1 (steps S2122 to S2125 in FIG. 39). First, a comparison is made to see whether the hMvpIdx-th element HmvpCandList[hMvpIdx] counting from 0 in the history prediction motion vector candidate list is identical to the inter prediction information candidate hMvpCand (step S2123 in FIG. 39). If they are identical (step S2123 in FIG. 39: YES), a value of TRUE is set to a flag identicalCandExist indicating whether an identical candidate exists, the value of the current history prediction motion vector index hMVpIndex is set to a deletion target index removeIdx indicating the position of the element to be deleted, and this identical element confirmation process is terminated. If they are not identical (step S2123: NO in Figure 39), the flag identicalCandExist indicating whether an identical candidate exists remains FALSE, hMvpIdx is incremented by 1, and if the historical predicted motion vector index hMvpIdx is less than or equal to NumHmvpCand-1, processing from step S2123 onwards is performed (steps S2122 to S2125 in Figure 39).
[0222] Returning to the flowchart of FIG. 38 again, a shift and addition process of elements of the history motion vector predictor candidate list HmvpCandList is performed (step S2106 of FIG. 38). FIG. 40 is a flowchart of an element shift / addition process procedure of the history motion vector predictor candidate list HmvpCandList in step S2106 of FIG. 38. First, it is determined whether to remove elements stored in the history motion vector predictor candidate list HmvpCandList and then add a new element, or to add a new element without removing elements. Specifically, it is compared whether a flag identicalCandExist indicating whether an identical candidate exists is TRUE (true) or whether the current number of candidates NumHmvpCand has reached the maximum number of candidates MaxNumHmvpCand (step S2141 of FIG. 40). If the current number of candidates NumHmvpCand is the same value as the maximum number of candidates MaxNumHmvpCand, it indicates that the maximum number of elements has been added to the history motion vector predictor candidate list HmvpCandList. When the flag identicalCandExist indicating whether or not an identical candidate exists is TRUE (true) or NumHmvpCand is the same value as MaxNumHmvpCand (step S2141 in FIG. 40: YES), the element stored in the historical motion vector predictor candidate list HmvpCandList is deleted and then a new element is added. Specifically, when the flag identicalCandExist indicating whether or not an identical candidate exists is TRUE (true), the identical candidate is deleted from the historical motion vector predictor candidate list HmvpCandList. When NumHmvpCand is the same value as MaxNumHmvpCand, the top candidate (element) is deleted from the historical motion vector predictor candidate list HmvpCandList. The initial value of index i is set to the value of removeIdx+1. removeIdx is a deletion target index indicating the candidate to be deleted. The element shift process of step S2143 is repeated for this index i from the initial value removeIdx+1 to NumHmvpCand-1. (Steps S2142 to S2144 in Figure 40).The elements of HMVPCandList[i] are copied to HMVPCandList[i - 1] to shift the elements forward (step S2143 in FIG. 40), and i is incremented by 1 (steps S2142 to S2144 in FIG. 40). When index i becomes NumHmvpCand-1 and the element shift process of step S2143 is completed, the inter prediction information candidate hMvpCand is added to the end of the historical prediction motion vector candidate list (step S2145 in FIG. 40). Here, the end of the historical prediction motion vector candidate list is the (NumHmvpCand-1)-th HMVPCandList[NumHmvpCand-1] counting from 0. This ends the element shift / addition process of the historical prediction motion vector candidate list HMVPCandList. On the other hand, when neither of the conditions that the flag identicalCandExist indicating whether or not an identical candidate exists is TRUE (true) and NumHmvpCand is the same value as MaxNumHmvpCand is satisfied (step S2141 in FIG. 40: NO), that is, when the flag identicalCandExist indicating whether or not an identical candidate exists is FALSE (false) and NumHmvpCand is smaller than MaxNumHmvpCand, the inter prediction information candidate hMvpCand is added to the position next to the last element of the history prediction motion vector candidate list without removing the elements stored in the history prediction motion vector candidate list HmvpCandList (step S2146 in FIG. 40). Here, the position next to the last element of the history prediction motion vector candidate list is the NumHmvpCand-th HMVPCandList[NumHmvpCand] counting from 0. When no element is added to the history prediction motion vector candidate list, it is the 0th position. Also, NumHmvpCand is incremented by 1, and the element shift / addition process of the historical motion vector predictor candidate list HMVPCandList ends.
[0223] Fig. 43 is a diagram for explaining an example of a process of updating a history prediction motion vector list. When six elements (inter prediction information) are registered in the history prediction motion vector candidate list HMVPCandList, in the case of adding new inter prediction information, each element of the history prediction motion vector candidate list HMVPCandList is compared with new inter prediction information from the front (Fig. 43(a)). If the new inter prediction information has the same value as the third element HMVP2 from the beginning of the history prediction motion vector candidate list HMVPCandList, the element HMVP2 is deleted from the history prediction motion vector candidate list HMVPCandList, and the rear elements HMVP3 to HMVP5 are shifted (copied) forward one by one, and the new inter prediction information is added to the end of the history prediction motion vector candidate list HMVPCandList (Fig. 43(b)), and the update of the history prediction motion vector candidate list HMVPCandList is completed (Fig. 43(c)).
[0224] <Historical Prediction Motion Vector Candidate Derivation Process> Next, a detailed description will be given of a method for deriving a historical prediction motion vector candidate from the historical prediction motion vector candidate list HMVPCandList, which is a processing procedure in step S304 in Fig. 20 and is common to the historical prediction motion vector candidate derivation unit 323 of the normal prediction motion vector mode derivation unit 301 on the encoding side and the historical prediction motion vector candidate derivation unit 423 of the normal prediction motion vector mode derivation unit 401 on the decoding side. Fig. 41 is a flowchart illustrating the historical prediction motion vector candidate derivation processing procedure.
[0225] If the number of current motion vector predictor candidates numCurrMvpCand is equal to or greater than the maximum number of elements in the motion vector predictor candidate list mvpListLX (2 here) or the number of history motion vector predictor candidates (the number of elements registered in the history motion vector predictor list) NumHmvpCand is 0 (step S2201: NO in FIG. 41), steps S2202 to S2210 in FIG. 41 are omitted and the history motion vector predictor candidate derivation procedure is terminated. If the number of current motion vector predictor candidates numCurrMvpCand is smaller than 2, which is the maximum number of elements in the motion vector predictor candidate list mvpListLX, and the number of history motion vector predictor candidates NumHmvpCand is greater than 0 (step S2201: YES in FIG. 41), steps S2202 to S2210 in FIG. 41 are performed.
[0226] Next, the process of steps S2203 to S2209 in FIG. 41 is repeated from index i 1 to the smaller value of either the predetermined upper limit value 4 or the number of historical motion vector predictor candidates NumHmvpCand (steps S2202 to S2210 in FIG. 41). If the number of current motion vector predictor candidates numCurrMvpCand is equal to or greater than 2, which is the maximum number of elements in the motion vector predictor candidate list mvpListLX (step S2203 in FIG. 41: NO), the process of steps S2204 to S2210 in FIG. 41 is omitted, and the historical motion vector predictor candidate derivation process procedure is terminated. If the number of current motion vector predictor candidates numCurrMvpCand is smaller than 2, which is the maximum number of elements in the motion vector predictor candidate list mvpListLX (step S2203 in FIG. 41: YES), the process of step S2204 and subsequent steps in FIG. 41 is performed.
[0227] Next, the processes from steps S2205 to S2208 are performed for each of the reference lists LY of each element of the historical motion vector predictor candidate list HmvpCandList (L0 and L1) (steps S2204 to S2209 in FIG. 41). It shows that the processes from steps S2205 to S2208 in FIG. 41 are performed for L0 and L1 of the historical motion vector predictor candidate list HmvpCandList. If the number of current motion vector predictor candidates numCurrMvpCand is equal to or greater than 2, which is the maximum number of elements in the motion vector predictor candidate list mvpListLX (step S2205: NO in FIG. 41), the processes from steps S2207 to S2210 in FIG. 41 are omitted, and the historical motion vector predictor candidate derivation process procedure ends. If the current number of motion vector predictor candidates numCurrMvpCand is smaller than 2 which is the maximum number of elements in the motion vector predictor candidate list mvpListLX (Step S2205 in FIG. 41: YES), the processes in and after Step S2206 in FIG. 41 are performed.
[0228] Next, the motion vector of the element of the history prediction motion vector candidate list is added to the prediction motion vector candidate list as a prediction motion vector candidate. At this time, for the number of elements specified by the offset value hMvpIdxOffset from the end of the history prediction motion vector candidate list, it is checked in descending order whether the element is not included in the prediction motion vector candidate list, and the element not included in the prediction motion vector candidate list is added to the prediction motion vector candidate list, and then the element of the history prediction motion vector candidate list is added to the prediction motion vector candidate list in descending order without checking whether the element is not included in the prediction motion vector candidate list. The reason why only the number of elements specified by the offset value hMvpIdxOffset from the end of the history prediction motion vector candidate list are compared when checking the history prediction motion vector candidate list will be explained using FIG. 65. FIG. 65 shows the relationship between three examples when a block is divided into four and the history prediction motion vector candidate list. The case where each coding block is coded in the normal prediction motion vector mode or the normal merge mode will be explained. FIG. 65(a) is a diagram when the coding block to be coded / decoded is the upper right block. In this case, the inter prediction information of the block on the left side of the coding block to be coded / decoded is likely to be the last element HMVP5 of the history prediction motion vector candidate list. Figure 65(b) is a diagram when the coding block to be coded / decoded is the bottom left block. In this case, the inter prediction information of the block on the top right of the coding block to be coded / decoded is likely to be the last element HMVP5 of the history prediction motion vector candidate list, and the inter prediction information of the block above the coding block to be coded / decoded is likely to be the penultimate element HMVP4 of the history prediction motion vector candidate list. Figure 65(c) is a diagram when the coding block to be coded / decoded is the bottom right block.In this case, the inter prediction information of the block to the left of the coding block to be coded / decoded is likely to be the last element HMVP5 of the history prediction motion vector candidate list, the inter prediction information of the block above the coding block to be coded / decoded is likely to be the penultimate element HMVP4 of the history prediction motion vector candidate list, and the inter prediction information of the block to the upper left of the coding block to be coded / decoded is likely to be the penultimate element HMVP3 of the history prediction motion vector candidate list. That is, the last element of the history prediction motion vector candidate list is most likely to be derived as a spatial prediction motion vector candidate. In order to compare only the last element HMVP5 of the history prediction motion vector candidate list that is most likely to be derived as a spatial prediction motion vector candidate as shown in FIG. 65(d), the offset value hMvpIdxOffset is set to 1. Furthermore, in order to compare the penultimate element of the history prediction motion vector candidate list that is second most likely to be derived as a spatial prediction motion vector candidate, the offset value hMvpIdxOffset can also be set to 2. Furthermore, in order to compare the third-to-last element of the historical motion vector predictor candidate list that is the third most likely to be derived as a spatial motion vector predictor candidate, the offset value hMvpIdxOffset can be set to 3. In this way, by setting the offset value hMvpIdxOffset to a value of 1 or more, the maximum number of times elements of the historical motion vector predictor candidate list are compared is reduced, and the maximum amount of processing is reduced. Note that, by setting the offset value hMvpIdxOffset to 0, the number of times elements of the historical motion vector predictor candidate list are compared is 0, and the comparison process is omitted.If the index i is not smaller than the offset value hMvpIdxOffset, that is, if it is being checked whether or not the element is not included in the motion vector predictor candidate list (step S2206: YES in FIG. 41), when the reference index of LY in the history motion vector predictor candidate list HmvpCandList[NumHmvpCand − i] is the same value as the reference index refIdxLX of the motion vector to be encoded / decoded and the LY of the element HmvpCandList[NumHmvpCand − i] of the history motion vector predictor candidate list is an element different from any element in the motion vector predictor candidate list mvpListLX (step S2207: YES in FIG. 41), the history motion vector predictor candidate HmvpCandList[NumHmvpCand − The motion vector of LY [i] is added to the motion vector predictor candidate list mvpListLX (step S2208 in FIG. 41), and the number of current motion vector predictor candidates numCurrMvpCand is incremented by 1. If there is no element in the history motion vector predictor candidate list HmvpCandList that has the same reference index as the reference index refIdxLX of the motion vector to be encoded / decoded and that is different from any element in the motion vector predictor list mvpListLX (step S2206 in FIG. 41: NO), the addition process of step S2208 is skipped.
[0229] On the other hand, if the index i is not smaller than the offset value hMvpIdxOffset, i.e., if it is not confirmed whether the element is not included in the predictor motion vector candidate list (NO in step S2206 in Figure 41), the motion vector of LY in the history predictor motion vector candidate HmvpCandList[NumHmvpCand - i] is added to the numCurrMvpCand-th element mvpListLX[numCurrMvpCand] counting from 0 in the predictor motion vector candidate list as the last element of the predictor motion vector candidate list (step S2208 in Figure 41), and the number of current predictor motion vector candidates numCurrMvpCand is incremented by 1.
[0230] The above-mentioned processing from steps S2205 to S2208 in FIG. 41 is performed for both L0 and L1 (steps S2204 to S2209 in FIG. 41).
[0231] Index i is incremented by 1 (steps S2202 and S2210 in FIG. 41). If index i is equal to or less than the smaller value of a predetermined upper limit value of 4 or the number NumHmvpCand of historical motion vector predictor candidates, processing from step S2203 onwards is performed again (steps S2202 to S2210 in FIG. 41).
[0232] <History merge candidate derivation process> Next, a detailed description will be given of a method for deriving history merge candidates from the history merge candidate list HmvpCandList, which is the processing procedure of step S404 in Fig. 21 and is common to 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. Fig. 42 is a flowchart illustrating the history merge candidate derivation processing procedure.
[0233] First, an initialization process is performed (step S2301 in FIG. 42). A value of FALSE is set for each of the 0th to (numCurrMergeCand - 1)th elements of the flag isPruned[i], and the number of elements currently registered in the merge candidate list, numCurrMergeCand, is set to the variable numOrigMergeCand.
[0234] Next, elements of the history prediction motion vector list that are not included in the merge candidate list are added to the merge candidate list. At this time, the history prediction motion vector list is checked and added in descending order from the end. The initial value of the index hMvpIdx is set to 1, and the addition process from step S2303 to step S2311 in FIG. 42 is repeated from this initial value to NumHmvpCand (steps S2302 to S2312 in FIG. 42). If the number of elements registered in the current merge candidate list, numCurrMergeCand, is not less than or equal to (maximum number of merge candidates, MaxNumMergeCand-1), that is, if the number of elements registered in the current merge candidate list, numCurrMergeCand, has reached the maximum number of merge candidates, MaxNumMergeCand, merge candidates have been added to all elements in the merge candidate list, so this history merge candidate derivation process is terminated (step S2303: NO in FIG. 42). If the number of elements registered in the current merge candidate list, numCurrMergeCand, is equal to or less than the maximum number of merge candidates, MaxNumMergeCand-1 (YES in step S2303 in FIG. 42), processing from step S2304 onwards is carried out.
[0235] A value of FALSE is set to the variable sameMotion indicating the same motion information (step S2304 in FIG. 42). Then, the inter prediction information, which is an element of the history prediction motion vector candidate list, is added to the merge candidate list as a merge candidate. At this time, for the number of elements specified by the offset value hMvpIdxOffset from the last element (the most recently added element) of the history prediction motion vector candidate list, whether or not they are elements not included in the merge candidate list is checked in descending order, and the elements not included in the merge candidate list are added to the merge candidate list, and thereafter, the elements of the history prediction motion vector candidate list are added to the merge candidate list without checking whether or not they are elements not included in the merge candidate list in descending order. The reason why only the number of elements specified by the offset value hMvpIdxOffset from the last element (the most recently added element) of the history prediction motion vector candidate list are compared when checking the history prediction motion vector candidate list will be described with reference to FIG. 65. FIG. 65 shows the relationship between three examples in which a block is divided into four and the history prediction motion vector candidate list. A case in which each coding block is coded in the normal prediction motion vector mode or the normal merge mode will be described. FIG. 65(a) is a diagram showing a case where the coding block to be coded / decoded is the upper right block. In this case, the inter prediction information of the block on the left side of the coding block to be coded / decoded is likely to be the last element HMVP5 of the history prediction motion vector candidate list. FIG. 65(b) is a diagram showing a case where the coding block to be coded / decoded is the lower left block. In this case, the inter prediction information of the block on the upper right side of the coding block to be coded / decoded is likely to be the last element HMVP5 of the history prediction motion vector candidate list, and the inter prediction information of the block above the coding block to be coded / decoded is likely to be the penultimate element HMVP4 of the history prediction motion vector candidate list. FIG. 65(c) is a diagram showing a case where the coding block to be coded / decoded is the lower right block.In this case, the inter prediction information of the block to the left of the coding block to be coded / decoded is likely to be the last element HMVP5 of the history prediction motion vector candidate list, the inter prediction information of the block above the coding block to be coded / decoded is likely to be the penultimate element HMVP4 of the history prediction motion vector candidate list, and the inter prediction information of the block to the upper left of the coding block to be coded / decoded is likely to be the penultimate element HMVP3 of the history prediction motion vector candidate list. That is, the last element of the history prediction motion vector candidate list is most likely to be derived as a spatial merge candidate. In order to compare only the last element HMVP5 of the history prediction motion vector candidate list that is most likely to be derived as a spatial merge candidate as shown in FIG. 65(d), the offset value hMvpIdxOffset is set to 1. Furthermore, in order to compare the penultimate element of the history prediction motion vector candidate list that is second most likely to be derived as a spatial merge candidate, the offset value hMvpIdxOffset can also be set to 2. Furthermore, in order to also compare the third-to-last element of the historical motion vector predictor candidate list that is third most likely to be derived as a spatial merge candidate, the offset value hMvpIdxOffset can be set to 3. In this way, by setting a value from 1 to 3 as a predetermined value for the offset value hMvpIdxOffset and comparing only the number of elements from the end of the historical motion vector predictor candidate list (the most recently added element) specified by the offset value hMvpIdxOffset with spatial merge candidates or elements stored in the merge candidate list, the maximum number of times elements of the historical motion vector predictor candidate list are compared is reduced, and therefore the maximum amount of processing is reduced.
[0236] If index hMvpIdx is equal to or less than a predetermined offset value hMvpIdxOffset, that is, to check whether the element is not included in the merge candidate list (YES in step S2305 in FIG. 42), the initial value of index i is set to 0, and steps S2307 and S2308 in FIG. 42 are performed from this initial value to numOrigMergeCand-1 (S2306 to S2309 in FIG. 42). A comparison is made to see whether the (NumHmvpCand-hMvpIdx)th element HmvpCandList[NumHmvpCand-hMvpIdx] counting from 0 in the history predictor motion vector candidate list is the same value as the i-th element mergeCandList[i] counting from 0 in the merge candidate list (step S2307 in FIG. 42). The same value of the merge candidate indicates that the values of all the components of the inter prediction information (inter prediction mode, reference indexes of L0 and L1, motion vectors of L0 and L1) of the merge candidate are the same. Therefore, in the comparison process of this step S2307, when isPruned[i] is FALSE, it is compared whether the values of all the components (inter prediction mode, reference indexes of L0 and L1, motion vectors of L0 and L1) of mergeCandList[i] and HmvpCandList[NumHmvpCand-hMvpIdx] are the same. If the values are the same (step S2307 in FIG. 39: YES), both sameMotion and isPruned[i] are set to TRUE (step S2308 in FIG. 42). Note that the flag isPruned[i] is a flag indicating that the i-th element counting from 0 of the merge candidate list is the same value as any element of the history predicted motion vector candidate list. If the values are not the same (step S2307 in FIG. 39: NO), the process of step S2308 is skipped.When the repeated processing from step S2306 to step S2309 in FIG. 42 is completed, a comparison is made to see whether sameMotion is FALSE (step S2310 in FIG. 42). If sameMotion is FALSE (step S2310 in FIG. 42: YES), that is, the (NumHmvpCand - hMvpIdx)-th element HmvpCandList[NumHmvpCand - hMvpIdx] counting from 0 in the history motion vector predictor candidate list does not exist in mergeCandList, so the (NumHmvpCand - hMvpIdx)-th element HmvpCandList[NumHmvpCand - hMvpIdx] and increment numCurrMergeCand by 1 (step S2311 in FIG. 42). On the other hand, if index hMvpIdx is not smaller than offset value hMvpIdxOffset, i.e., if it has not been confirmed whether the element is not included in the merge candidate list (NO in step S2305 in FIG. 42), the (NumHmvpCand - hMvpIdx)th element HmvpCandList[NumHmvpCand - hMvpIdx], counting from 0, of the historical predicted motion vector candidate list is added to the numCurrMergeCand-th mergeCandList[numCurrMergeCand] of the merge candidate list as the last element of the merge candidate list, and numCurrMergeCand is incremented by 1 (step S2312 in FIG. 42).
[0237] Furthermore, the index hMvpIdx is incremented by 1 (step S2302 in FIG. 42), and steps S2302 to S2312 in FIG. 42 are repeated.
[0238] When all elements in the history motion vector predictor candidate list have been checked, or when merge candidates have been added to all elements in the merge candidate list, this history merge candidate derivation process is completed.
[0239] <Average merge candidate derivation process> Next, a detailed description will be given of a method for deriving an average merge candidate, which is a processing procedure of step S403 in Fig. 21 and is 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. Fig. 62 is a flowchart illustrating the processing procedure for deriving an average merge candidate.
[0240] First, an initialization process is performed (step S1301 in FIG. 62). The number of elements currently registered in the merge candidate list, numCurrMergeCand, is set in a variable, numOrigMergeCand.
[0241] Next, the merge candidate list is scanned from the top to determine two pieces of motion information. The index i indicating the first piece of motion information is set to 0, and the index j indicating the second piece of motion information is set to 1 (steps S1302 to S1303 in FIG. 62). If the number of elements registered in the current merge candidate list, numCurrMergeCand, is not equal to or less than (the maximum number of merge candidates, MaxNumMergeCand-1), this means that merge candidates have been added to all elements in the merge candidate list, and this history merge candidate derivation process ends (step S1304 in FIG. 62). If the number of elements registered in the current merge candidate list, numCurrMergeCand, is equal to or less than (the maximum number of merge candidates, MaxNumMergeCand-1), the processes from step S1305 onwards are performed.
[0242] It is determined whether the i-th motion information mergeCandList[i] in the merge candidate list and the j-th motion information mergeCandList[j] in the merge candidate list are both invalid (step S1305 in FIG. 62). 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 invalid, the following process is repeated with X set to 0 and 1 (steps S1306 to S1314 in FIG. 62).
[0243] It is determined whether the LX prediction of mergeCandList[i] is valid (step S1307 in FIG. 62). If the LX prediction of mergeCandList[i] is valid, it is determined whether the LX prediction of mergeCandList[j] is valid (step S1308 in FIG. 62). If the LX prediction of mergeCandList[j] is valid, that is, if both the LX predictions of mergeCandList[i] and mergeCandList[j] are valid, the motion vector of the LX prediction obtained by averaging the motion vector of the LX prediction of mergeCandList[i] and the motion vector of the LX prediction of mergeCandList[j] and the average merge candidate of the LX prediction having the reference index of the LX prediction of mergeCandList[i] are derived and set as the LX prediction of averageCand, and the LX prediction of averageCand is made valid (step S1309 in FIG. 62). In step S1308 of FIG. 62, 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 invalid, the average merge candidate of the LX prediction having the motion vector and reference index of the LX prediction of mergeCandList[i] is derived and set as the LX prediction of averageCand, and the LX prediction of averageCand is made valid (step S1310 of FIG. 62). In step S1307 of FIG. 62, if the LX prediction of mergeCandList[i] is not valid, it is determined whether the LX prediction of mergeCandList[j] is valid (step S1311 of FIG. 62). If the LX prediction of mergeCandList[j] is valid, i.e., if the LX prediction of mergeCandList[i] is invalid and the LX prediction of mergeCandList[j] is valid, an average merge candidate for LX prediction having the motion vector and reference index of the LX prediction of mergeCandList[j] is derived and set as the LX prediction of averageCand, and the LX prediction of averageCand is made valid (step S1312 in FIG. 62).In step S1311 of FIG. 62, if the LX prediction of mergeCandList[j] is not valid, that is, if the LX prediction of mergeCandList[i] and the LX prediction of mergeCandList[j] are both invalid, the LX prediction of averageCand is invalidated (step S1312 of FIG. 62).
[0244] The average merge candidate averageCand of the L0 prediction, L1 prediction, or BI prediction generated as described above is added to the numCurrMergeCand-th mergeCandList[numCurrMergeCand] of the merge candidate list, and numCurrMergeCand is incremented by 1 (step S1315 in FIG. 62). This completes the process of deriving the average merge candidate.
[0245] Note that the average merge candidate is averaged over the horizontal component of the motion vector and the vertical component of the motion vector.
[0246] <Sub-block temporal merge candidate derivation> The operation of the sub-block temporal merging candidate derivation unit 381 in the sub-block merging mode derivation unit 304 in FIG. 16 will be described with reference to FIG.
[0247] First, it is determined whether the coding block is smaller than 8x8 pixels (step S4002).
[0248] If the coding block is smaller than 8x8 pixels (step S4002: YES), a flag indicating the presence of a sub-block temporal merge candidate is set to availableFlagSbCol=0 (step S4003), and the processing of the sub-block temporal merge candidate derivation unit is terminated. Here, if temporal motion vector prediction is prohibited by syntax or if sub-block temporal merging is prohibited, the same processing as when the coding block is smaller than 8x8 pixels (step S4002: YES) is performed.
[0249] On the other hand, if the coding block is 8x8 pixels or more (step S4002: NO), adjacent motion information of the coding block in the coded picture is derived (step S4004).
[0250] The process of deriving adjacent motion information of a coding block will be described with reference to FIG. 45. The process of deriving adjacent motion information is similar to the process of the spatial prediction motion vector candidate derivation unit 321 described above. However, the order of searching for adjacent blocks is A0, B0, B1, A1, and B2 is not searched. First, coding information is obtained for adjacent block n=A0 (step S4052). The coding information indicates a flag availableFlagN indicating whether the adjacent block is available, a reference index refIdxLXN for each reference list, and a motion vector mvLXN.
[0251] Next, it is determined whether adjacent block n is valid or invalid (step S4054). If a flag indicating whether the adjacent block is available or not is set to availableFlagN=1, the adjacent block is valid, otherwise it is invalid.
[0252] If adjacent block n is valid (step S4054: YES), the reference index refIdxLXN is set as the reference index refIdxLXn of adjacent block n (step S4056), and the motion vector mvLXN is set as the motion vector mvLXn of adjacent block n (step S4056), and the process of deriving adjacent motion information of blocks is terminated.
[0253] On the other hand, if adjacent block n is invalid (step S4054: NO), adjacent block n=B0 is set, coding information is acquired (step S4052), and it is determined whether adjacent block n is valid or invalid (step S4054). Thereafter, similar processing is performed, looping in the order of B1, A1. The process of deriving adjacent motion information loops until the adjacent blocks are valid, and if all adjacent blocks A0, B0, B1, A1 are invalid, the process of deriving adjacent motion information of blocks ends.
[0254] Again, refer to Figure 44. Once the adjacent motion information is derived (step S4004), a temporal motion vector is derived (step S4006).
[0255] The process of deriving a temporal motion vector will be described with reference to Fig. 46. First, a temporal motion vector is initialized as tempMv = (0, 0) (step S4062).
[0256] Next, it is determined whether the adjacent motion information is valid or invalid (step S4064). If the flag indicating whether the adjacent block is available or not is available, availableFlagN=1, the information is valid; otherwise, the information is invalid. If the adjacent motion information is invalid (step S4064: NO), the process of deriving the temporal motion vector is terminated.
[0257] On the other hand, if the adjacent motion information is valid (step S4064: YES), it is determined whether a flag predFlagL1N indicating whether L1 prediction is used in the adjacent block N is 1 (step S4066). If predFlagL1N=0 (step S4066: NO), proceed to the next process (step S4078). If predFlagL1N=1 (step S4066: YES), it is determined whether the POC of all pictures registered in all reference lists is equal to or less than the POC of the current picture to be processed (step S4068). If this determination is true (step S4068: YES), proceed to the next process (step S4070).
[0258] If the slice type slice_type is a B slice and the flag collocated_from_l0_flag is 0 (step S4070: YES, step S4072: YES), it is determined whether ColPic is the same as the reference picture RefPicList1[refIdxL1N] (picture of reference index refIdxL1N of reference list L1) (step S4074). If this determination is true (step S4074: YES), the temporal motion vector tempMv is set to mvL1N (step S4076). If this determination is false (step S4074: NO), proceed to the next process (step S4078). If the slice type slice_type is not a B slice and the flag collocated_from_l0_flag is not 0 (step S4070: NO or step S4072: NO), proceed to the next process (step S4078).
[0259] Then, it is determined whether a flag predFlagL0N indicating whether L0 prediction is used in adjacent block N is 1 (step S4078). If predFlagL0N=1 (step S4078: YES), it is determined whether ColPic is the same as the reference picture RefPicList0[refIdxL0N] (the picture at the reference index refIdxL0N in the reference list L0) (step S4080). If this determination is true (step S4080: YES), the temporal motion vector tempMv=mvL0N is set (step S4082). If this determination is false (step S4080: NO), the process of deriving the temporal motion vector is terminated.
[0260] 44 will be referred to again. Next, ColPic is derived (step S4016). This process is the same as S4201 in the temporal motion vector predictor candidate derivation unit 322, and therefore a description thereof will be omitted.
[0261] Then, a coding block colCb of a different time is set (step S4017). This is to set a coding block located at the same position as the coding block to be processed in the lower right corner of the picture ColPic of the different time as colCb. This coding block corresponds to coding block T1 in FIG.
[0262] Next, the position obtained by adding the temporal motion vector tempMv to the coding block colCb is set as a new colCb (step S4018). Now, the upper left position of the coding block colCb is set to (xColCb, yColCb), and the temporal motion vector tempMv is set to (tempMv[0], tempMv[1]) with 1 / 16 pixel accuracy. Then, xColCb = Clip3( xCtb, xCtb + CtbSizeY + 3, xColCb + ( tempMv[0] >> 4 ) ) yColCb = Clip3( yCtb, yCtb + CtbSizeY - 1, yColCb + ( tempMv[1] >> 4 ) ) Here, the position of the top left corner of the tree block is (xCtb, yCtb), and the size of the tree block is CtbSizeY. The coding block on ColPic that includes the position ((xColCb >> 3) << 3, (yColCb >> 3) << 3) becomes the new colCb. As shown in the above formula, the position after adding tempMv is corrected to within the range of about the size of the tree block so that it does not deviate significantly from the position before adding tempMv. If this position is outside the screen, it is corrected to within the screen.
[0263] Then, it is determined whether the prediction mode PredMode of this coding block colCb is inter prediction (MODE_INTER) (step S4020). If the prediction mode of colCb is not inter prediction (step S4020: NO), a flag indicating the presence of a sub-block temporal merge candidate is set to availableFlagSbCol=0 (step S4003), and the process of the sub-block temporal merge candidate derivation unit is terminated.
[0264] On the other hand, if the prediction mode of colCb is inter prediction (step S4020: YES), inter prediction information is derived for each reference list (steps S4022, S4023). Here, for colCb, a central motion vector ctrMvLX for each reference list and a flag ctrPredFlagLX indicating whether LX prediction is used or not are derived. LX indicates a reference list, and LX is L0 when deriving reference list 0, and LX is L1 when deriving reference list 1. The derivation of inter prediction information will be described with reference to FIG. 47.
[0265] If the coding block colCb of a different time is not available (step S4112: NO), or if the prediction mode PredMode is intra prediction (MODE_INTRA) (step S4114: NO), the flag availableFlagLXCol and the flag predFlagLXCol are both set to 0 (step S4116), the motion vector mvCol is set to (0,0) (step S4118), and the process of deriving the inter prediction information is terminated.
[0266] If the coding block colCb is available (Step S4112: YES) and the prediction mode PredMode is not intra prediction (MODE_INTRA) (Step S4114: YES), mvCol, refIdxCol, and availableFlagCol are calculated in the following procedure.
[0267] When the flag PredFlagLX[xPCol][yPCol] indicating whether or not the LX prediction of the coding block colCb is used is 1 (step S4120: YES), the motion vector mvCol is set to the same value as the motion vector MvLX[xPCol][yPCol] of the LX of the coding block colCb (step S4122), the reference index refIdxCol is set to the same value as the reference index RefIdxLX[xPCol][yPCol] of LX (step S4124), and the list listCol is set to LX (step S4126). Here, xPCol and yPCol are indexes indicating the position of the upper left pixel of the coding block colCb in the picture ColPic of a different time.
[0268] On the other hand, if the flag PredFlagLX[xPCol][yPCol] indicating whether or not the LX prediction of the coding block colCb is used is 0 (step S4120: NO), the following process is performed. First, it is determined whether the POC of all pictures registered in all reference lists is equal to or less than the POC of the current picture to be processed (step S4128). It is also determined whether the flag PredFlagLY[xPCol][yPCol] indicating whether or not the LY prediction of colCb is used is 1 (step S4128). Here, the LY prediction is defined as a reference list different from the LX prediction. That is, when LX=L0, LY=L1, and when LX=L1, LY=L0.
[0269] If this judgment is true (step S4128: YES), the motion vector mvCol is set to the same value as the LY motion vector MvLY[xPCol][yPCol] of the coding block colCb (step S4130), the reference index refIdxCol is set to the same value as the LY reference index RefIdxLY[xPCol][yPCol] (step S4132), and the list listCol is set to LX (step S4134).
[0270] On the other hand, if this determination is false (Step S4128: NO), the flags availableFlagLXCol and predFlagLXCol are both set to 0 (Step S4116), the motion vector mvCol is set to (0,0) (Step S4118), and the process of deriving inter prediction information ends.
[0271] When the inter prediction information is acquired from the coding block colCb, both the flag availableFlagLXCol and the flag predFlagLXCol are set to 1 (step S4136).
[0272] Next, the motion vector mvCol is scaled to obtain a motion vector mvLXCol (step S4138). This process is the same as S4245 in the temporal motion vector predictor candidate derivation unit 322, and therefore a description thereof will be omitted.
[0273] Again, refer to Figure 44. Once inter prediction information is derived for each reference list, the calculated motion vector mvLXCol is set as the central motion vector ctrMvLX, and the calculated flag predFlagLXCol is set as the flag ctrPredFlagLX (Steps S4022 and S4023).
[0274] Then, it is determined whether the central motion vector is valid or invalid (step S4024). If ctrPredFlagL0=0 and ctrPredFlagL1=0, it is invalid; otherwise, it is invalid. If the central motion vector is invalid (step S4024: NO), a flag indicating the presence of a sub-block temporal merge candidate is set to availableFlagSbCol=0 (step S4003), and the processing of the sub-block temporal merge candidate derivation unit is terminated.
[0275] On the other hand, if the central motion vector is valid (step S4024: YES), a flag indicating the presence of a sub-block temporal merge candidate is set to availableFlagSbCol=1 (step S4025), and sub-block motion information is derived (step S4026). This process will be described with reference to FIG.
[0276] First, the number of sub-blocks in the width direction, numSbX, and the number of sub-blocks in the height direction, numSbY, are calculated from the width cbWidth and height cBheight of the coding block colCb (step S4152). Also, refIdxLXSbCol=0 is set (step S4152). After this process, the process is repeated in units of the predicted sub-block colSb. This repetition is performed while changing the height direction index ySbIdx from 0 to numSbY and the width direction index xSbIdx from 0 to numSbX.
[0277] If the top left position of the coding block colCb is (xCb, yCb), the top left position of the prediction sub-block colSb is (xSb, ySb). xSb = xCb + xSbIdx * sbWidth ySb = yCb + ySbIdx * sbHeight Next, the position obtained by adding the temporal motion vector tempMv to the prediction sub-block colSb is set as new colSb (step S4154). If the position of the top left corner of the prediction sub-block colSb is (xColSb, yColSb) and the temporal motion vector tempMv is (tempMv[0], tempMv[1]) with 1 / 16 pixel accuracy, the position of the top left corner of the new colSb is xColSb = Clip3( xCtb, xCtb + CtbSizeY + 3, xSb + ( tempMv[0] >> 4 ) ) yColSb = Clip3( yCtb, yCtb + CtbSizeY - 1, ySb + ( tempMv[1] >> 4 ) ) Here, the position of the top left corner of the tree block is (xCtb, yCtb), and the size of the tree block is CtbSizeY. As shown in the above formula, the position after adding tempMv is corrected to within the range of about the size of the tree block so that it does not deviate significantly from the position before adding tempMv. If this position is outside the screen, it is corrected to within the screen.
[0278] Then, inter prediction information is derived for each reference list (steps S4156 and S4158). Here, for the prediction sub-block colSb, a motion vector mvLXSbCol for each reference list in sub-block units and a flag availableFlagLXSbCol indicating whether the prediction sub-block is valid or not are derived. LX indicates a reference list, and LX is L0 when deriving reference list 0, and LX is L1 when deriving reference list 1. The derivation of the inter prediction information is the same as S4022 and S4023 in FIG. 47, and therefore description will be omitted.
[0279] After deriving the inter prediction information (steps S4156, S4158), it is determined whether or not the prediction sub-block colSb is valid (step S4160). If availableFlagL0SbCol=0 and availableFlagL1SbCol=0, colSb is invalid; otherwise, it is determined to be valid. If colSb is invalid (step S4160: NO), the motion vector mvLXSbCol is set as the central motion vector ctrMvLX (step S4162). Furthermore, the flag predFlagLXSbCol indicating whether or not LX prediction is being used is set as the flag ctrPredFlagLX in the central motion vector (step S4162). This completes the derivation of sub-block motion information.
[0280] Referring again to Figure 44, the L0 motion vector mvL0SbCol and the L1 motion vector mvL1SbCol are added as candidates to the subblock merge candidate list subblockMergeCandList in the subblock merge mode derivation unit 304 described above (step S4028). However, this addition is only made when the flag availableSbCol = 1 indicating the presence of a subblock temporal merge candidate. With this, the processing of the temporal merge candidate derivation unit 342 is terminated.
[0281] The above description of the sub-block temporal merging candidate derivation unit 381 is for encoding, but the same is true for decoding. That is, the operation of the sub-block temporal merging candidate derivation unit 481 in the sub-block merging mode derivation unit 404 in Fig. 22 can be similarly described by replacing encoding in the above description with decoding.
[0282] <Motion compensation prediction processing> The motion compensation prediction unit 306 acquires the position and size of a block currently being subjected to prediction processing in encoding. The motion compensation prediction unit 306 also acquires 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 a reference picture specified by the reference index in the decoded image memory is acquired at a position where the reference picture is moved by the amount of the motion vector from the same position as the image signal of the prediction block, and then a prediction signal is generated.
[0283] In the case where the inter prediction mode in the inter prediction 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 a motion compensation prediction signal, and in the case where 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 a motion compensation prediction signal, and the motion compensation prediction signal is supplied to the prediction method determination unit. Here, the ratio of the weighted average of bi-prediction is set to 1:1, but the weighted average may be performed using other ratios. For example, the weighting ratio may be set to be larger as the picture interval between the picture to be predicted and the reference picture becomes closer. In addition, the weighting ratio may be calculated using a correspondence table of combinations of picture intervals and weighting ratios.
[0284] 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 obtains inter prediction information from a normal prediction motion vector mode derivation unit 401, a normal merge mode derivation unit 402, a sub-block prediction motion vector mode derivation unit 403, and a sub-block merge mode derivation unit 404 via a switch 408.
[0285] The motion compensation prediction unit 406 supplies the obtained motion compensation prediction signal to the decoded image signal superimposition unit 207 .
[0286] <Inter prediction mode> A process of making a prediction from a single reference picture is defined as uni-prediction, and in the case of uni-prediction, prediction is made using one of two reference pictures registered in reference lists L0 and L1, called L0 prediction or L1 prediction. L0 prediction and L1 prediction may be forward prediction (prediction that refers to a forward reference image) or backward prediction (prediction that refers to a backward reference image). Figures 57 to 58 are diagrams for explaining motion compensation prediction in L0 prediction (uni-prediction).
[0287] Figure 57 shows a case where the inter prediction mode is L0 prediction and the L0 reference picture (RefL0Pic) is located at a time before the current picture (CurPic). Figure 58 shows a case where the L0 prediction mode is L0 prediction and the L0 reference picture is located at a time after the current picture. Similarly, the reference picture for L0 prediction in Figures 57 and 58 can be replaced with the reference picture for L1 prediction (RefL1Pic) to perform uni-prediction.
[0288] A process of making predictions from two reference pictures is defined as bi-prediction, and in the case of bi-prediction, both L0 prediction and L1 prediction are used to express bi-prediction. Figures 59 to 61 are diagrams for explaining motion compensation prediction in bi-prediction. Figure 59 shows a case in which the reference picture for L0 prediction is at a time before the picture to be processed and the reference picture for L1 prediction is at a time after the picture to be processed in bi-prediction. Figure 60 shows a case in which the reference picture for L0 prediction and the reference picture for L1 prediction are at a time before the picture to be processed in bi-prediction. Figure 61 shows a case in which the reference picture for L0 prediction and the reference picture for L1 prediction are at a time after the picture to be processed in bi-prediction.
[0289] In this way, the relationship between the prediction type and time of L0 / L1 can be used without being limited to L0 being forward prediction (prediction that refers to a forward reference image) and L1 being backward prediction (prediction that refers to a backward reference image). In the case of bi-prediction, the same reference picture may be used to perform both L0 prediction and L1 prediction. Note that the decision as to whether to perform motion compensation prediction in uni-prediction or bi-prediction is made based on information (e.g., a flag) indicating whether to use L0 prediction and whether to use L1 prediction.
[0290] <About reference indexes> In an embodiment of the present invention, in order to improve the accuracy of motion compensation prediction, it is possible to select an optimal reference picture from among multiple reference pictures in motion compensation prediction. To this end, the reference picture used in the motion compensation prediction is used as a reference index, and the reference index is coded into the coding stream together with a coding vector.
[0291] <Motion compensation process based on normal predicted motion vector mode> 16 , when inter prediction information by the normal prediction motion vector mode derivation unit 301 is selected in the inter prediction mode determination unit 305, the motion compensation prediction unit 306 acquires this inter prediction information from the inter prediction mode determination unit 305, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the prediction method determination unit 105.
[0292] 22, when a switch 408 is connected to the normal prediction motion vector mode derivation unit 401 during the decoding process, the motion compensation prediction unit 406 obtains inter prediction information from 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 superimposition unit 207.
[0293] <Motion compensation processing based on normal merge mode> 16 , when inter prediction information by the normal merge mode derivation unit 302 is selected in the inter prediction mode determination unit 305, the motion compensation prediction unit 306 acquires this inter prediction information from the inter prediction mode determination unit 305, derives the inter prediction mode, reference index, and motion vector of the block currently being processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is supplied to the prediction method determination unit 105.
[0294] 22, when a switch 408 is connected to the normal merge mode derivation unit 402 during the decoding process, the motion compensation prediction unit 406 obtains inter prediction information from the normal merge mode derivation unit 402, derives an inter prediction mode, a reference index, and a 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 superimposition unit 207.
[0295] <Motion compensation process based on sub-block predicted motion vector mode> 16 , when inter prediction information is selected by the sub-block prediction motion vector mode derivation unit 303 in the inter prediction mode determination unit 305, the motion compensation prediction unit 306 acquires the 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.
[0296] 22, when a 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 obtains inter prediction information from 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 superimposition unit 207.
[0297] <Motion compensation processing based on sub-block merge mode> 16 , when inter prediction information is selected by the sub-block merge mode derivation unit 304 in the inter prediction mode determination unit 305, the motion compensation prediction unit 306 acquires the 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.
[0298] 22, when a switch 408 is connected to the sub-block merging mode derivation unit 404 during the decoding process, the motion compensation prediction unit 406 obtains inter prediction information from the sub-block merging 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 superimposition unit 207.
[0299] <Affine mode based motion compensation processing> In this embodiment, motion compensation based on an affine model can be used. In motion compensation based on the affine model, two to four corners of a coding block are set as control points, motion vectors of sub-blocks are derived from motion vectors of the control points, and motion compensation is performed on a sub-block basis.
[0300] In the encoding process, the following flags are reflected based on the inter prediction conditions determined by the inter prediction mode determination unit 305, and are encoded in the encoded stream. In the decoding process, whether or not to perform motion compensation using an affine model is specified based on the following flags in the encoded stream.
[0301] sps_affine_enabled_flag indicates whether or not motion compensation based on an affine model can be used in inter prediction. If sps_affine_enabled_flag is 0, motion compensation based on an affine model is suppressed on a sequence-by-sequence basis. In addition, inter_affine_flag and cu_affine_type_flag are not transmitted in the CU (coding unit) syntax of the coded video sequence. If sps_affine_enabled_flag is 1, motion compensation based on an affine model can be used in the coded video sequence.
[0302] sps_affine_type_flag indicates whether or not motion compensation using the 6-parameter affine mode can be used in inter prediction. The 6-parameter affine model is a mode in which a motion vector for a subblock is derived from six parameters for the horizontal and vertical components of each motion vector for three control points, and motion compensation is performed on a subblock basis. Although a motion vector is derived on a subblock basis, a common reference index is derived on a coding block basis.
[0303] If sps_affine_type_flag is 0, motion compensation based on the six-parameter affine model is suppressed. Also, cu_affine_type_flag is not transmitted in the CU syntax of the coded video sequence. If sps_affine_type_flag is 1, motion compensation based on the six-parameter affine model can be used in the coded video sequence.
[0304] If sps_affine_type_flag is not present, it shall be set to 0.
[0305] When decoding a P or B slice, if inter_affine_flag is 1 in the currently processed CU, motion compensation using an affine model is used to generate a motion compensation prediction signal for the currently processed CU.
[0306] If inter_affine_flag is 0, no affine model is used for the currently processed CU.
[0307] If inter_affine_flag is not present, it shall be set to 0.
[0308] When decoding a P or B slice, if cu_affine_type_flag is 1 for the currently processed CU, motion compensation using a 6-parameter affine model is used to generate a motion compensation prediction signal for the currently processed CU.
[0309] If cu_affine_type_flag is 0, motion compensation using a four-parameter affine model is used to generate a motion compensation prediction signal for the currently processed CU. The four-parameter affine model is a mode in which a motion vector for a subblock is derived from four parameters, the horizontal and vertical components of each motion vector of two control points, and motion compensation is performed on a subblock basis.
[0310] <Merged Motion Vector Difference (MMVD)> A differential motion vector can be added to the motion vectors of the top two merge candidates (the merge candidates in the merge candidate list with merge indexes 0 and 1). This differential motion vector is called the merge differential motion vector.
[0311] When the merge candidate selection unit 347 on the encoding side adds a merge differential motion vector, the motion vector to which the merge differential motion vector has been added is supplied to the motion compensation prediction unit 306 via the inter prediction mode determination unit 305. The bitstream encoding unit 108 also encodes information related to the merge differential motion vector. The information related to the merge differential motion vector is an index mmvd_distance_idx indicating the distance to be added to the motion vector, and an index mmvd_direction_idx indicating the direction in which the motion vector is added. These indexes are defined as shown in the tables in Figures 63(a) and 63(b). If the x and y components of the merge differential motion vector offset MmvdOffset are represented as MmvdOffset[0] and MmvdOffset[1], respectively, then MmvdOffset[0] = ( MmvdDistance << 2 ) * MmvdSign[0] MmvdOffset[1] = ( MmvdDistance << 2 ) * MmvdSign[1] The merge motion vector difference is derived from the merge motion vector difference offset MmvdOffset in the above equation. Details of how to derive the merge motion vector difference will be described below in the case of the decoding side.
[0312] On the decoding side, if a merge differential motion vector exists, information on the merge differential motion vector is separated from the bitstream supplied to the bitstream decoding unit 201, and a merge differential motion vector offset MmvdOffset is derived. The merge candidate selection unit 447 also derives a merge differential motion vector from the decoded merge differential motion vector offset. The merge differential motion vector is added to a motion vector, and the motion vector is then supplied to the motion compensation prediction unit 406.
[0313] The derivation of the merge motion vector difference mMvdLX in the merge candidate selection unit 447 will be described with reference to the flowchart in FIG. 64(a). First, it is determined whether the inter prediction mode of the coding block is bi-prediction (PRED_BI) (S4402). If it is not bi-prediction (S4402: No), it is determined whether it is L0 prediction (PRED_L0) (S4404). If it is L0 prediction (S4404: Yes), mMvdL0 = MmvdOffset mMvdL1 = 0 In the case of L1 prediction (S4404: No), mMvdL0 = 0 mMvdL1 = MmvdOffset This completes the process of deriving a merge differential motion vector (S4408).
[0314] On the other hand, in the case of bi-prediction (S4402: Yes), the difference between the POC of the current picture currPic and the reference picture is calculated for each reference list, and set as currPocDiffL0 and currPocDiffL1 (S4410). Here, the POC difference between picA and picB, DiffPicOrderCnt(picA, picB), is expressed as follows: DiffPicOrderCnt( picA, picB ) = [POC of picA] - [POC of picB] In addition, reference picture RefPicList0[refIdxL0] is the picture indicated by reference index refIdxL0 in reference list L0. Similarly, reference picture RefPicList1[refIdxL1] is the picture indicated by reference index refIdxL1 in reference list L1.
[0315] Next, it is determined whether -currPocDiffL0 * currPocDiffL1 >= 0 (step S4412). If this determination is true (step S4412: Yes), mMvdL0 = MmvdOffset mMvdL1 = -MmvdOffset (step S4414), and the process of deriving the merge motion vector difference is terminated. On the other hand, if this determination is false (step S4412: No), mMvdL0 = MmvdOffset mMvdL1 = MmvdOffset (step S4416). Next, it is determined whether the absolute value of the difference in POC with reference list L0 is equal to or greater than the absolute value of the difference in POC with reference list L1 (step S4418). If this determination is true (step S4418: Yes), X=0, Y=1 are set (step S4420), and the merge differential motion vector mMvdL1 of L1 is scaled (step S4424). Here, mMvdLY indicates mMvdL0 when Y=0, and mMvdL1 when Y=1. On the other hand, if this determination is false (step S4418: No), X=1, Y=0 are set (step S4422), and the merge differential motion vector mMvdL0 of L0 is scaled (step S4424). The scaling of the merge differential motion vector mMvdLY is as follows, as shown in FIG. 64(b): td = Clip3( -128, 127, currPocDiffLX ) tb = Clip3( -128, 127, currPocDiffLY ) tx = ( 16384 + Abs( td ) >> 1 ) / td distScaleFactor = Clip3( -4096, 4095, ( tb * tx + 32 ) >> 6 ) mMvdLY = Clip3( -32768, 32767, Sign( distScaleFactor * mMvdLY ) * ((Abs( distScaleFactor * mMvdLY ) + 127 ) >> 8 ) ) Here, currPocDiffLX indicates that when X=0, it is currPocDiffL0, and when X=1, it is currPocDiffL1. Similarly, currPocDiffLY indicates that when Y=0, it is currPocDiffL0, and when Y=1, it is currPocDiffL1. Also, Clip3(x, y, z) is a function that limits the minimum value of the value z to x and the maximum value to y. Sign(x) is a function that returns the sign of the value x, and Abs(x) is a function that returns the absolute value of the value x. This completes the process of deriving the merge differential motion vector.
[0316] The merge motion vector difference may be added to the top two motion vectors of the sub-block merge candidates. In this case, the index mmvd_distance_idx indicating the distance to be added to the motion vector is defined as shown in the table in FIG. 63(c). The operation of the sub-block merge candidate selection unit 386 is the same as that of the merge candidate selection unit 347, and therefore a description thereof will be omitted. Also, the operation of the sub-block merge candidate selection unit 486 is the same as that of the merge candidate selection unit 447, and therefore a description thereof will be omitted.
[0317] As described above, MmvdDistance is defined as shown in the tables in Figures 63(a) and 63(c). Since these tables are defined with quarter-pixel precision, the generated merge motion vector difference may include fractional pixel precision. However, by encoding / decoding a flag indicating that the pixel precision of these tables is 1 on a slice-by-slice basis, the generated merge motion vector difference can be changed so that it does not include fractional pixel precision.
[0318] <Adaptive Motion Vector Resolution (AMVR)> The resolution of the differential motion vector can be adaptively changed for each coding block, and this resolution is called adaptive motion vector resolution.
[0319] A case where adaptive motion vector resolution is used for the normal predicted motion vector mode will be described. In this case, the derived candidate motion vectors are rounded according to the resolution in the spatial predicted motion vector candidate derivation units 321 and 421, the temporal predicted motion vector candidate derivation units 322 and 422, and the historical predicted motion vector candidate derivation units 323 and 423. The resolution can be selected from 1 / 4, 1, or 4 pixel accuracy, and if the resolution is not changed, the resolution is 1 / 4 pixel accuracy. The rounding process is performed according to the resolution of the motion vector in the coding block to be processed. In other words, the derived candidate motion vector mvX is rightShift = leftShift = MvShift + 2 offset = 1 << ( rightShift - 1 ) mvX = ( mvX >= 0 ? ( mvX + offset ) >> rightShift : - ( ( - mvX + offset ) >> rightShift ) ) << leftShift Here, if the resolution of the motion vector in the coding block to be processed is 1 / 4 pixel accuracy, MvShift=0. Similarly, if the resolution of the motion vector is 1 pixel accuracy, MvShift=2, and if the resolution of the motion vector is 4 pixel accuracy, MvShift=4. Each of the x and y components of mvX is processed by the above formula.
[0320] The adaptive motion vector resolution can also be used for the sub-block prediction motion vector mode. In this case, only the resolution is different from the above-mentioned normal prediction motion vector mode. That is, in the affine inheritance prediction motion vector candidate derivation units 361 and 461, the affine construction prediction motion vector candidate derivation units 362 and 462, and the affine identical prediction motion vector candidate derivation units 363 and 463, the derived candidate motion vector is rounded according to the resolution. The resolution can be selected from 1 / 16, 1 / 4, and 1 pixel accuracy, and if the resolution is not changed, it will be 1 / 16 pixel accuracy. The rounding process is performed according to the resolution of the motion vector in the coding block to be processed. That is, the derived candidate motion vector mvX is rounded according to the above formula. Here, if the resolution of the motion vector in the coding block to be processed is 1 / 4 pixel accuracy, MvShift=0. Similarly, if the resolution of the motion vector is 1 pixel accuracy, MvShift=2. According to the above formula, each of the x and y components of mvX is processed. (Second embodiment) Next, an image coding device and an image decoding device according to a second embodiment will be described. The image coding device and the image decoding device according to the first embodiment have the same configuration, but are different in the processing procedure of the history merging candidate derivation units 345 and 445. The processing procedure of the history merging candidate derivation units 345 and 445 is different from that of the image coding device and the image decoding device according to the first embodiment in that the processing procedure of the history merging candidate derivation units 345 and 445 is shown in the flowchart of FIG. 66 instead of the flowchart of FIG. 42, and the differences will be described. <History Merge Candidate Deriving Process in the Second Embodiment> The history merging candidate derivation process of the image encoding device and the image decoding device according to the second embodiment will be described with reference to the flowchart of FIG.
[0321] The second embodiment differs from the first embodiment in that only the spatial merge candidate A1 derived from the block A1 adjacent to the left side of the coding block to be processed and the spatial merge candidate B1 derived from the block B1 adjacent to the right side are compared with the number of elements designated by the offset value hMvpIdxOffset from the last element (most recently added element) of the history motion vector candidate list. The flowchart of FIG. 42 showing the history motion vector candidate derivation process of the image coding device and the image decoding device according to the first embodiment is different in that steps S2306, S2307, and S2309 in FIG. 42 are changed to steps S2326, S2327, and S2329 in FIG. 66, respectively, and the other steps are the same. In the second embodiment, an initialization process is performed first (step S2301 in FIG. 66). A value of FALSE is set to each of the 0th to (numCurrMergeCand -1)th elements of isPruned[i], and the variable numOrigMergeCand is set to the number of elements currently registered in the merge candidate list, numCurrMergeCand.
[0322] Next, the initial value of index hMvpIdx is set to 1, and the addition process from step S2303 to step S2311 in FIG. 66 is repeated from this initial value to NumHmvpCand (steps S2302 to S2312 in FIG. 66). If the number of elements registered in the current merge candidate list, numCurrMergeCand, is not less than or equal to (maximum number of merge candidates, MaxNumMergeCand-1), merge candidates have been added to all elements in the merge candidate list, so this history merge candidate derivation process is terminated (step S2303 in FIG. 66: NO). If the number of elements registered in the current merge candidate list, numCurrMergeCand, is less than or equal to (maximum number of merge candidates, MaxNumMergeCand-1) (step S2303 in FIG. 66: YES), the processes from step S2304 onwards are performed.
[0323] First, set the value of sameMotion to FALSE (step S2304 in FIG. 66). Next, when the index hMvpIdx is equal to or smaller than a predetermined offset value hMvpIdxOffset, that is, when checking whether the index is not included in the merge candidate list (YES in step S2305 in FIG. 42), set the initial value of the index i to 0, and perform the processes of steps S2327 and S2308 in FIG. 66 from this initial value to the smaller value of a predetermined upper limit value of 1 or numOrigMergeCand-1 (S2326 to S2329 in FIG. 66). Here, in the second embodiment, only the spatial merge candidate A1 derived from the block A1 adjacent to the left side of the coding block to be processed and the spatial merge candidate B1 adjacent to the right side are compared with each of the elements of the history prediction motion vector candidate list (most recently added elements) in the number of elements specified by the offset value hMvpIdxOffset. The reason why the predetermined upper limit is 1 is that the spatial merge candidate A1 derived from the block A1 adjacent to the left side of the coding block to be processed or the spatial merge candidate B1 adjacent to the right side can only be stored in the 0th and 1st positions counting from 0 in the merge candidate list. The (NumHmvpCand-hMvpIdx)th element HmvpCandList[NumHmvpCand-hMvpIdx] counting from 0 in the history prediction motion vector candidate list is compared with the spatial merge candidates A1 and B1 (step S2327 in FIG. 66). It is compared whether the values of all the components (inter prediction mode, reference indexes of L0 and L1, motion vectors of L0 and L1) of the merge candidates are the same. Here, the same value of the merge candidates indicates that the values of all the components (inter prediction mode, reference indexes of L0 and L1, motion vectors of L0 and L1) of the merge candidates are the same.Therefore, in the comparison process of step S2327, when the i-th element mergeCandList[i] counting from 0 of the merge candidate list is a spatial merge candidate A1 derived from the adjacent block A1 on the left side or a spatial merge candidate B1 adjacent on the right side, and isPruned[i] is FALSE, it is compared whether the values of all the components (inter prediction mode, reference indexes of L0 and L1, motion vectors of L0 and L1) of mergeCandList[i] and HmvpCandList[NumHmvpCand-hMvpIdx] are the same. If the values are the same (step S2327: YES in FIG. 39), both sameMotion and isPruned[i] are set to TRUE (step S2308 in FIG. 66). Note that the flag isPruned[i] is a flag indicating that the i-th element counting from 0 of the merge candidate list is the same value as any element of the history predicted motion vector candidate list. If the values are not the same (step S2327 in FIG. 39: NO), the process of step S2308 is skipped. After the repeated processes of step S2326 to step S2329 in FIG. 66 are completed, a comparison is made to see whether sameMotion is FALSE (step S2310 in FIG. 66), and if sameMotion is FALSE (step S2310 in FIG. 66: YES), the (NumHmvpCand - hMvpIdx)-th element HmvpCandList[NumHmvpCand - hMvpIdx] counting from 0 of the history motion vector predictor candidate list is added to the numCurrMergeCand-th mergeCandList[numCurrMergeCand] of the merge candidate list, and numCurrMergeCand is incremented by 1 (step S2311 in FIG. 66). The index hMvpIdx is incremented by 1 (step S2302 in FIG. 66), and steps S2302 to S2312 in FIG. 66 are repeated.
[0324] When all elements in the history motion vector predictor candidate list have been checked, or when merge candidates have been added to all elements in the merge candidate list, this history merge candidate derivation process is completed.
[0325] In the second embodiment, the spatial merge candidates A1 and B1 stored in the merge candidate list are compared with elements of the historical prediction motion vector candidate list. However, the spatial merge candidates A1 and B1 may be stored in a memory other than the merge candidate list, and the spatial merge candidates A1 and B1 stored in the memory other than the merge candidate list may be compared with elements of the historical prediction motion vector candidate list. (Third embodiment) Next, an image encoding device and an image decoding device according to the third embodiment will be described. The image encoding device and the image decoding device according to the first embodiment have the same configuration, but are different in the same element confirmation processing procedure in the history prediction motion vector candidate list initialization / update processing procedure provided in the encoding side encoding information storage memory 111 and the decoding side encoding information storage memory 205. Instead of the same element confirmation processing procedure in the history prediction motion vector candidate list initialization / update processing procedure of the first embodiment shown in the flowchart of FIG. 39, the same element confirmation processing procedure in the history prediction motion vector candidate list initialization / update processing procedure of the third embodiment is a flowchart of FIG. 67, and these differences will be described. <Procedure for checking identical elements in procedure for initializing and updating a history predicted motion vector candidate list in the third embodiment> The procedure of the identical element checking process in the procedure of the historical motion vector predictor candidate list initialization / update process in the image encoding device and the image decoding device according to the third embodiment will be described with reference to the flowchart in FIG.
[0326] In the third embodiment, in the history motion vector predictor candidate list update process, when the maximum number of elements is added to the history motion vector predictor candidate list HmvpCandList, that is, when the current number of history motion vector predictor candidates NumHmvpCand reaches the maximum number of history motion vector predictor candidates MaxNumHmvpCand, the first element included in the history motion vector predictor candidate list, that is, the 0th element counting from 0 (history motion vector predictor candidate) is not compared, and only the first and subsequent elements are compared, which is different from the first embodiment. The elements included in the history motion vector predictor candidate list are composed of an inter prediction mode, a reference index, and a motion vector. By not comparing the first element included in the history motion vector predictor candidate list, the number of times elements are compared is limited to a maximum of (MaxNumHmvpCand -1), reducing the maximum amount of processing involved in comparing elements. 67. This process is the same as the flowchart in Figure 39, which shows the process of deriving a historic predicted motion vector candidate in the image encoding device and image decoding device of the first embodiment, except that steps S2122 and S2125 in Figure 39 are changed to steps S2132 and S2135 in Figure 67, respectively.
[0327] Also in the third embodiment, when the value of the number of history motion vector predictor candidates NumHmvpCand is 0 (step S2121 in FIG. 67: NO), the history motion vector predictor candidate list HmvpCandList is empty and no identical candidates exist, so steps S2132 to S2135 in FIG. 67 are skipped and the identical element confirmation process procedure is terminated. When the value of the number of history motion vector predictor candidates NumHmvpCand is greater than 0 (step S2121 in FIG. 67: YES), the process of step S2123 is repeated from 0 or 1 to NumHmvpCand-1 for the history motion vector predictor index hMvpIdx (steps S2132 to S2135 in FIG. 67). First, when the current number of history prediction motion vector candidates NumHmvpCand is less than the maximum number of history prediction motion vector candidates MaxNumHmvpCand, the first element included in the history prediction motion vector candidate list, i.e., the 0th element counting from 0 (history prediction motion vector candidate), is compared, so hMvpIdx is set to 0. On the other hand, when the current number of history prediction motion vector candidates NumHmvpCand has reached the maximum number of history prediction motion vector candidates MaxNumHmvpCand, the first element included in the history prediction motion vector candidate list, i.e., the 0th element counting from 0 (history prediction motion vector candidate), is not compared, so hMvpIdx is set to 1 (step S2132 in FIG. 67). Next, a comparison is made as to whether or not the hMvpIdx-th element HmvpCandList[hMvpIdx] counting from 0 of the history prediction motion vector candidate list is the same as the inter prediction information candidate hMvpCand to be registered (step S2123 in FIG. 67). If they are identical (step S2123 in FIG. 67: YES), a flag identicalCandExist indicating whether an identical candidate exists is set to TRUE, the deletion target index removeIdx is set to the value of hMVpIndex, and this identical element confirmation process ends. If they are not identical (step S2123 in FIG. 67: NO), hMvpIdx is incremented by 1, and if the historical predicted motion vector index hMvpIdx is equal to or less than NumHmvpCand-1, the processes from step S2123 onwards are performed (steps S2132 to S2135 in FIG. 67). (Fourth embodiment) Next, an image encoding device and an image decoding device according to a fourth embodiment will be described. The image encoding device and the image decoding device according to the fourth embodiment have the same configuration, but are different in the same element confirmation processing procedure in the history prediction motion vector candidate list initialization / update processing procedure provided in the encoding side encoding information storage memory 111 and the decoding side encoding information storage memory 205. Instead of the same element confirmation processing procedure in the history prediction motion vector candidate list initialization / update processing procedure of the first embodiment shown in the flowchart of FIG. 39, the same element confirmation processing procedure in the history prediction motion vector candidate list initialization / update processing procedure of the fourth embodiment is a flowchart of FIG. 68, and these differences will be described. <Procedure for checking identical elements in procedure for initializing and updating the history predicted motion vector candidate list in the fourth embodiment> The procedure of the identical element checking process in the procedure of the historical motion vector predictor candidate list initialization / update process in the image encoding device and the image decoding device according to the fourth embodiment will be described with reference to the flowchart of FIG.
[0328] The fourth embodiment differs from the first and third embodiments in that, in the history motion vector predictor candidate list update process, elements are compared in descending order from the last element in the history motion vector predictor candidate list. Furthermore, in the history motion vector predictor candidate list update process, when the maximum number of elements is added to the history motion vector predictor candidate list HmvpCandList, the first element included in the history motion vector predictor candidate list, that is, the 0th element counting from 0, is not compared, and only the first and subsequent elements are compared. The elements included in the history motion vector predictor candidate list are composed of an inter prediction mode, a reference index, and a motion vector. By not comparing the first element included in the history motion vector predictor candidate list, the number of times elements are compared is limited to a maximum of (MaxNumHmvpCand -1), thereby reducing the maximum amount of processing involved in comparing elements.
[0329] Also in the fourth embodiment, when the value of the number of history motion vector predictor candidates NumHmvpCand is 0 (step S2151 in FIG. 68: NO), the history motion vector predictor candidate list HmvpCandList is empty and no identical candidates exist, so steps S2152 to S2155 in FIG. 68 are skipped and the identical element confirmation process procedure is terminated. When the value of the number of history motion vector predictor candidates NumHmvpCand is greater than 0 (step S2152 in FIG. 68: YES), the process of step S2153 is repeated from 1 to the smaller value of the maximum number of history motion vector predictor candidates MaxNumHmvpCand-1 and the number of history motion vector predictor candidates NumHmvpCand (steps S2152 to S2155 in FIG. 68). First, counting from 0, the NumHmvpCand-i-th element HmvpCandList[NumHmvpCand - i] of the history motion vector predictor candidate list is compared to see if it is the same as the inter prediction information candidate hMvpCand to be registered (step S2153 in FIG. 68). If they are the same (step S2153 in FIG. 68: YES), a flag identicalCandExist indicating whether an identical candidate exists is set to TRUE, a value of hMVpIndex is set to the deletion target index removeIdx, and this identical element confirmation process is terminated. If they are not the same (step S2153 in FIG. 68: NO), i is incremented by 1, and if i is equal to or less than the smaller value of the maximum number of history motion vector predictor candidates MaxNumHmvpCand - 1 or the number of history motion vector predictor candidates NumHmvpCand, the process from step S2153 onward is performed (steps S2152 to S2155 in FIG. 68). When index i is 1, which is the initial value, the NumHmvpCand-i-th element HmvpCandList[NumHmvpCand - i] of the historical motion vector predictor candidate list, counting from 0, indicates the last element registered in the historical motion vector predictor candidate list, and the elements of the historical motion vector predictor candidate list are indicated in descending order as index i is incremented by 1. By setting index i to a maximum of (MaxNumHmvpCand - 1), the first element HMVPCandList[0] of the historical motion vector predictor candidate is not compared.
[0330] All of the above-described embodiments may be combined in multiple forms.
[0331] In all the embodiments described above, the coded bit stream 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. The coded bit stream may be provided by recording it on a computer-readable recording medium such as an HDD, SSD, flash memory, or optical disk, or may be provided from a server via a wired or wireless network. Therefore, an image decoding device corresponding to this image coding device can decode the coded bit stream in this specific data format regardless of the providing means.
[0332] When a wired or wireless network is used to exchange coded bitstreams between an image coding device and an image decoding device, the coded bitstream may be converted into a data format suitable for the transmission mode of the communication channel before being transmitted. In this case, a transmitting device is provided that converts the coded bitstream output by the image coding device into coded data in a data format suitable for the transmission mode of the communication channel and transmits the coded bitstream to the network, and a receiving device is provided that receives coded data from the network, restores the coded bitstream to the coded bitstream, and supplies the coded bitstream to the image decoding device. The transmitting device includes a memory that buffers the coded bitstream output by the image coding device, a packet processing unit that packetizes the coded bitstream, and a transmitting unit that transmits the packetized coded data via the network. The receiving device includes a receiving unit that receives the packetized coded data via the network, a memory that buffers the received coded data, and a packet processing unit that packetizes the coded data to generate a coded bitstream and provides it to the image decoding device.
[0333] When a wired or wireless network is used to exchange the coded bit stream between the image coding device and the image decoding device, in addition to the transmitting device and the receiving device, a relay device may be provided that receives the coded data transmitted by the transmitting device and supplies it to the receiving device. The relay device includes a receiving unit that receives packetized coded data transmitted by the transmitting device, a memory that buffers the received coded data, and a transmitting unit that transmits the packetized coded data to the network. The relay device may further include a receiving packet processing unit that processes the packetized coded data into packets to generate a coded bit stream, a recording medium that accumulates the coded bit stream, and a transmitting packet processing unit that packetizes the coded bit stream.
[0334] Moreover, a display unit for displaying an image decoded by the image decoding device may be added to the configuration to form a display device. In this case, the display unit reads out the decoded image signal generated by the decoded image signal superimposition unit 207 and stored in the decoded image memory 208, and displays it on a screen.
[0335] Moreover, an imaging unit may be added to the configuration and the captured image may be input to the image coding device to form an imaging device. In this case, the imaging unit inputs a captured image signal to the block division unit 101.
[0336] 69 shows an example of a hardware configuration of a coding / decoding device of the present application. The coding / decoding device includes the configurations of an image coding device and an image decoding device according to an embodiment of the present invention. The coding / decoding device 9000 includes 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.
[0337] 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 device according to the embodiment of the present invention is executed by the image encoding unit 9007, and the image decoding process of the image decoding device according to the embodiment of the present invention is executed by the image encoding unit 9007. The I / O interface 9003 is realized by, for example, a USB interface, and is connected to an external keyboard 9104, mouse 9105, etc. The CPU 9001 controls the encoding / decoding device 9000 so as to execute an operation desired by the user based on a user operation input via the I / O interface 9003. The user operation by the keyboard 9104, mouse 9105, etc. includes a selection of whether to execute an encoding or decoding function, a setting of encoding quality, an input / output destination of the encoded stream, an input / output destination of an image, etc.
[0338] When a user desires to play back an image recorded on the disc recording medium 9100, the optical disc drive 9005 reads out an encoded bit stream from the inserted disc recording medium 9100, and sends the read encoded stream to an image decoding unit 9008 of the codec IC 9002 via a bus 9010. The image decoding unit 9008 executes image decoding processing in the image decoding device according to the embodiment of the present invention on the input encoded bit stream, and sends the decoded image to an external monitor 9103 via a video interface 9009. The encoding / decoding device 9000 also has a network interface 9006, and can be connected to an external distribution server 9106 or a mobile terminal 9107 via a network 9101. When a 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 disc recording medium 9100, the network interface 9006 acquires an encoded stream from the network 9101, instead of reading out the encoded bit stream from the input disc recording medium 9100. Furthermore, when a user wishes to play back the image recorded in memory 9004, image decoding processing is performed on the encoded stream recorded in memory 9004 in an image decoding device according to an embodiment of the present invention.
[0339] When a user desires to encode an image captured by an external camera 9102 and record the encoded stream in memory 9004, the video interface 9009 inputs the image from the camera 9102 and sends the image to an image encoding unit 9007 of the codec IC 9002 via a bus 9010. The image encoding unit 9007 executes image encoding processing in the image encoding device according to the embodiment of the present invention on the image input via the video interface 9009 to generate an encoded bit stream. The encoded bit stream is then sent to the memory 9004 via the bus 9010. When a user desires to record the encoded stream in the disc recording medium 9100 instead of the memory 9004, the optical disc drive 9005 writes the encoded stream to the inserted disc recording medium 9100.
[0340] It is also possible to realize a hardware configuration having an image encoding device but not an image decoding device, or a hardware configuration having an image decoding device but not an image encoding device. Such a hardware configuration can be realized, for example, by replacing the codec IC 9002 with an image encoding unit 9007 or an image decoding unit 9008, respectively.
[0341] The above-mentioned encoding and decoding processes may be realized not only as a transmission, storage, and receiving device using hardware, but also as firmware stored in a ROM (read-only memory) or flash memory, or as software for a computer, etc. The firmware program or software program may be provided by recording it on a recording medium readable by a computer, etc., or may be provided from a server via a wired or wireless network, or may be provided as data broadcasting of terrestrial or satellite digital broadcasting.
[0342] The present invention has been described above based on the embodiments. The embodiments are merely examples, and it will be understood by those skilled in the art that various modifications are possible in the combination of each component and each treatment process, and that such modifications are also within the scope of the present invention. [Explanation of symbols]
[0343] 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 signal generation unit, 107 orthogonal transform and quantization unit, 108 bit string encoding unit, 109 inverse quantization and inverse orthogonal transform unit, 110 decoded image signal superposition unit, 111 encoding information storage memory, 200 image decoding device, 201 bit string decoding unit, 202 block division unit, 203 inter prediction unit 204 intra prediction unit, 205 encoding information storage memory, 206 inverse quantization and inverse orthogonal transform 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, an encoding information storage unit that stores inter prediction information used in inter prediction of an encoded block in a history predicted motion vector candidate list in order from the top; 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 a temporal merge candidate from inter prediction information of a block that is located at the same position as the current block to be encoded or in a vicinity of the current block in a picture different from the current block to be encoded; a history merge candidate derivation unit that derives history merge candidates from the inter prediction information stored in the history predicted motion vector candidate list; Equipped with The history merge candidate derivation unit compares a predetermined number of inter prediction information from the back among the inter prediction information stored in the history predicted motion vector candidate list with the inter prediction information of the spatial merge candidate, and when values of the inter prediction information are different, selects the inter prediction information as the history merge candidate, and selects inter prediction information further forward than the predetermined number from the back as the history merge candidate without comparing the inter prediction information of the spatial merge candidate.
1. An image encoding device comprising:
2. An image coding method for coding a moving image by using inter prediction based on inter prediction information on a block-by-block basis, comprising: an encoding information storing step of storing inter prediction information used in inter prediction of an encoded block in a history predicted motion vector candidate list in order from the top; a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to the encoding target block; a temporal merge candidate derivation step of deriving a temporal merge candidate from inter prediction information of a block located at the same position as the current block to be encoded or in a vicinity thereof in a picture different from the current block to be encoded; a history merge candidate derivation step of deriving a history merge candidate from the inter prediction information stored in the history predicted motion vector candidate list; Equipped with The history merge candidate derivation step compares a predetermined number of inter prediction information from the back among the inter prediction information stored in the history predicted motion vector candidate list with the inter prediction information of the spatial merge candidate, and when values of the inter prediction information are different, selects the inter prediction information as the history merge candidate, and selects inter prediction information further forward than the predetermined number from the back as the history merge candidate without comparing the inter prediction information with the inter prediction information of the spatial merge candidate.
13. An image coding method comprising:
3. An image encoding program for encoding a moving image by using inter prediction based on inter prediction information on a block-by-block basis, an encoding information storing step of storing inter prediction information used in inter prediction of an encoded block in a history predicted motion vector candidate list in order from the top; a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to the encoding target block; a temporal merge candidate derivation step of deriving a temporal merge candidate from inter prediction information of a block located at the same position as the current block to be encoded or in a vicinity thereof in a picture different from the current block to be encoded; a history merge candidate derivation step of deriving a history merge candidate from the inter prediction information stored in the history predicted motion vector candidate list; The history merge candidate derivation step compares a predetermined number of inter prediction information from the back among the inter prediction information stored in the history predicted motion vector candidate list with the inter prediction information of the spatial merge candidate, and when values of the inter prediction information are different, selects the inter prediction information as the history merge candidate, and selects inter prediction information further forward than the predetermined number from the back as the history merge candidate without comparing the inter prediction information with the inter prediction information of the spatial merge candidate.
2. An image encoding program comprising:
4. An image decoding device that decodes an encoded bit string obtained by encoding a moving image block by block using inter prediction, comprising: an encoding information storage unit that stores inter prediction information used in inter prediction of a decoded block in a history predicted motion vector candidate list in order from the top; a spatial merge candidate derivation unit that derives spatial merge candidates from inter prediction information of blocks spatially adjacent to a current block; a temporal merge candidate derivation unit that derives temporal merge candidates from inter prediction information of a block located at the same position as the current block to be decoded or in a vicinity thereof in a picture different from the current block to be decoded; a history merge candidate derivation unit that derives history merge candidates from the inter prediction information stored in the history predicted motion vector candidate list; Equipped with The history merge candidate derivation unit compares a predetermined number of inter prediction information from the back among the inter prediction information stored in the history predicted motion vector candidate list with the inter prediction information of the spatial merge candidate, and when values of the inter prediction information are different, selects the inter prediction information as the history merge candidate, and selects inter prediction information further forward than the predetermined number from the back as the history merge candidate without comparing the inter prediction information of the spatial merge candidate.
2. An image decoding device comprising:
5. 1. An image decoding method for decoding an encoded bitstream obtained by encoding a moving image block by block using inter prediction, comprising: an encoding information storing step of storing inter prediction information used in inter prediction of the decoded block in a history predicted motion vector candidate list in order from the top; a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to the block to be decoded; a temporal merge candidate derivation step of deriving a temporal merge candidate from inter prediction information of a block located at the same position as the current block to be decoded or in a vicinity thereof in a picture different from the current block to be decoded; a history merge candidate derivation step of deriving a history merge candidate from the inter prediction information stored in the history predicted motion vector candidate list; Equipped with The history merge candidate derivation step compares a predetermined number of inter prediction information from the back among the inter prediction information stored in the history predicted motion vector candidate list with the inter prediction information of the spatial merge candidate, and when values of the inter prediction information are different, selects the inter prediction information as the history merge candidate, and selects inter prediction information further forward than the predetermined number from the back as the history merge candidate without comparing the inter prediction information with the inter prediction information of the spatial merge candidate.
2. An image decoding method comprising:
6. An image decoding program for decoding an encoded bit string obtained by encoding a moving image using inter prediction on a block-by-block basis, comprising: an encoding information storing step of storing inter prediction information used in inter prediction of the decoded block in a history predicted motion vector candidate list in order from the top; a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to the block to be decoded; a temporal merge candidate derivation step of deriving a temporal merge candidate from inter prediction information of a block located at the same position as the current block to be decoded or in a vicinity thereof in a picture different from the current block to be decoded; a history merge candidate derivation step of deriving a history merge candidate from the inter prediction information stored in the history predicted motion vector candidate list; The history merge candidate derivation step compares a predetermined number of inter prediction information from the back among the inter prediction information stored in the history predicted motion vector candidate list with the inter prediction information of the spatial merge candidate, and when values of the inter prediction information are different, selects the inter prediction information as the history merge candidate, and selects inter prediction information further forward than the predetermined number from the back as the history merge candidate without comparing the inter prediction information with the inter prediction information of the spatial merge candidate.
2. An image decoding program comprising:
7. A transmission method for transmitting a bitstream generated by an image encoding device, comprising the steps of: an encoding information storing step of storing inter prediction information used in inter prediction of an encoded block in a history predicted motion vector candidate list in order from the top; a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to the encoding target block; a temporal merge candidate derivation step of deriving a temporal merge candidate from inter prediction information of a block located at the same position as the current block to be encoded or in a vicinity thereof in a picture different from the current block to be encoded; a history merge candidate derivation step of deriving a history merge candidate from the inter prediction information stored in the history predicted motion vector candidate list; a bitstream generating step of encoding the encoding information to generate a bitstream; a bitstream transmission step of transmitting the bitstream; Equipped with The history merge candidate derivation step compares a predetermined number of inter prediction information from the back among the inter prediction information stored in the history predicted motion vector candidate list with the inter prediction information of the spatial merge candidate, and when values of the inter prediction information are different, selects the inter prediction information as the history merge candidate, and selects inter prediction information further forward than the predetermined number from the back as the history merge candidate without comparing the inter prediction information with the inter prediction information of the spatial merge candidate. A transmission method comprising:
8. A recording method for recording a bit stream generated by an image encoding device onto a recording medium, comprising: an encoding information storing step of storing inter prediction information used in inter prediction of an encoded block in a history predicted motion vector candidate list in order from the top; a spatial merge candidate derivation step of deriving spatial merge candidates from inter prediction information of blocks spatially adjacent to the encoding target block; a temporal merge candidate derivation step of deriving a temporal merge candidate from inter prediction information of a block located at the same position as the current block to be encoded or in a vicinity thereof in a picture different from the current block to be encoded; a history merge candidate derivation step of deriving a history merge candidate from the inter prediction information stored in the history predicted motion vector candidate list; a bitstream generating step of encoding the encoding information to generate a bitstream; a bitstream recording step of recording the bitstream on the recording medium; Equipped with The history merge candidate derivation step compares a predetermined number of inter prediction information from the back among the inter prediction information stored in the history predicted motion vector candidate list with the inter prediction information of the spatial merge candidate, and when values of the inter prediction information are different, selects the inter prediction information as the history merge candidate, and selects inter prediction information further forward than the predetermined number from the back as the history merge candidate without comparing the inter prediction information with the inter prediction information of the spatial merge candidate. A recording method comprising:
Citation Information
Patent Citations
Moving image coding / decoding device using moving compensation inter-frame prediction system employing affine transformation
JP1997172644A
Update of look up table: FIFO, constrained FIFO
WO2020003278A1
Method and apparatus for processing video signals using inter prediction
WO2020060376A1
Simplified history based motion vector prediction
WO2020065517A1
Method and device for processing video signal on basis of history-based motion vector prediction
WO2020122640A1