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

By using block vector candidate derivation and reference position correction techniques, image prediction is performed using encoded information and data in the decoded image memory, which solves the problem of low prediction efficiency in existing technologies and achieves efficient image encoding and decoding.

CN118694969APending Publication Date: 2024-09-24JVC KENWOOD CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410940782.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-06-20
Filing Date
2020-06-19
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In existing technologies, prediction is performed using only decoded pixels adjacent to the encoded/decoded block during image encoding and decoding, resulting in low prediction efficiency.

Method used

By deriving and selecting block vector candidates and correcting reference positions, data in the memory is saved using encoded information, and decoded pixels are obtained from the decoded image memory as prediction values, thereby improving prediction efficiency.

Benefits of technology

It achieves efficient image encoding and decoding under low load, thus improving encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694969A
    Figure CN118694969A
Patent Text Reader

Abstract

The invention relates to an image encoding device and method, and an image decoding device and method. An image encoding device includes: a block vector candidate derivation unit that derives a block vector candidate of a block to be processed in a picture to be processed from encoding information stored in an encoding information storage memory; a selection unit that selects a selected block vector from among the block vector candidates; and a reference position correction unit that corrects the reference position of a reference block referenced by the selected block vector so as to refer to the inside of a referable region, and corrects the reference position of the reference block. The image encoding device acquires, from a decoded image memory, decoded pixels within the picture to be processed as prediction values of the block to be processed on the basis of the reference position of the reference block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application based on the invention with application number 202080031476.5, application date June 19, 2020, applicant is JVC KENWOOD Corporation, and invention name is "Moving image encoding device, moving image encoding method and moving image encoding program, moving image decoding device, moving image decoding method and moving image decoding program". Technical Field

[0002] The present invention relates to image encoding and decoding technology for dividing an image into blocks and performing prediction. Background Art

[0003] In image encoding and decoding, the image to be processed is divided into a predetermined number of pixel sets, i.e., blocks, and processed in units of blocks. By dividing into appropriate blocks and appropriately setting intra-picture prediction (intra-frame prediction) and inter-picture prediction (inter-frame prediction), the coding efficiency is improved.

[0004] Patent Document 1 discloses an intra-frame prediction technique for obtaining a predicted image using decoded pixels adjacent to a block to be encoded or decoded.

[0005] Prior art literature

[0006] Patent Literature

[0007] Patent Document 1: Japanese Patent Application Publication No. 2009-246975. Summary of the invention

[0008] However, the technology of Patent Document 1 uses only decoded pixels adjacent to a block to be encoded / decoded for prediction, and thus has poor prediction efficiency.

[0009] In a certain embodiment of the present invention for solving the above-mentioned problem, it includes: a block vector candidate derivation unit, which derives block vector candidates of a processing object block in a processing object picture from coding information stored in a coding information storage memory; a selection unit, which selects a selection block vector from the block vector candidates; and a reference position correction unit, which corrects the reference position of a reference block referenced by the selection block vector to refer to the inside of a referenceable area, and obtains decoded pixels in the processing object picture from a decoded image memory based on the reference position of the reference block as a prediction value of the processing object block.

[0010] According to the present invention, it is possible to realize highly efficient image encoding / decoding processing with a low load. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 is a block diagram of an image encoding device according to an embodiment of the present invention;

[0012] Figure 2is a block diagram of an image decoding device according to an embodiment of the present invention;

[0013] Figure 3 is a flowchart for explaining the action of splitting a tree block;

[0014] Figure 4 is a diagram showing a situation where an input image is divided into tree blocks;

[0015] Figure 5 is a diagram illustrating a z-scan;

[0016] Fig. 6A is a diagram showing the segmented shape of a block;

[0017] Figure 6B is a diagram showing the segmented shape of a block;

[0018] Figure 6C is a diagram showing the segmented shape of a block;

[0019] Fig.6D is a diagram showing the segmented shape of a block;

[0020] Fig. 6E is a diagram showing the segmented shape of a block;

[0021] Figure 7 It is a flowchart for explaining the operation of dividing a block into four;

[0022] Figure 8 It is a flowchart for explaining the operation of dividing a block into two or three.

[0023] Fig. 9 is the syntax used to describe the shape of a block segment;

[0024] Fig. 10A is a diagram for explaining intra prediction;

[0025] Fig. 10B is a diagram for explaining intra prediction;

[0026] Fig.11 is a diagram for illustrating a reference block for inter-frame prediction;

[0027] Fig. 12A is the syntax used to describe the prediction mode of a coding block;

[0028] Fig. 12B is the syntax used to describe the prediction mode of a coding block;

[0029] Fig.13 is a diagram showing the correspondence between syntax elements and modes related to inter-frame prediction;

[0030] Fig.14is a diagram for explaining motion compensation of affine transformation with two control points;

[0031] Fig.15 is a diagram for explaining motion compensation of affine transformation with three control points;

[0032] Fig.16 yes Figure 1 A block diagram showing a detailed structure of the inter-frame prediction unit 102;

[0033] Fig.17 yes Fig.16 A block diagram showing a detailed structure of a normal prediction motion vector mode deriving unit 301;

[0034] Fig.18 yes Fig.16 A block diagram showing a detailed structure of a normal merge mode derivation unit 302;

[0035] Fig.19 It is used to illustrate Fig.16 A flowchart of a normal motion vector prediction mode derivation process of the normal motion vector prediction mode derivation unit 301;

[0036] Fig. 20 is a flowchart showing the processing steps of a normal motion vector prediction mode derivation process;

[0037] Fig.21 is a flowchart illustrating the processing steps of a normal merge mode export process;

[0038] Fig. 22 yes Figure 2 A block diagram showing a detailed structure of the inter-frame prediction unit 203;

[0039] Fig.23 yes Fig. 22 A block diagram showing a detailed structure of a normal prediction motion vector mode deriving unit 401;

[0040] Fig.24 yes Fig. 22 A block diagram showing a detailed structure of a normal merge mode derivation unit 402;

[0041] Fig.25 It is used to illustrate Fig. 22 A flowchart of a normal motion vector prediction mode derivation process of the normal motion vector prediction mode derivation unit 401;

[0042] Fig.26 is a diagram illustrating the steps of initializing / updating a historical motion vector prediction candidate list;

[0043] Fig. 27 This is a flowchart of the same element confirmation processing step in the historical prediction motion vector candidate list initialization / update processing step;

[0044] Fig.28 is a flowchart of an element shift processing step in a historical motion vector prediction candidate list initialization / update processing step;

[0045] Fig.29 is a flowchart illustrating the steps of deriving a historical motion vector prediction candidate;

[0046] Fig.30 is a flow chart illustrating the steps of the historical merge candidate export process;

[0047] Fig.31A is a diagram for explaining an example of a process of updating a historical motion vector prediction candidate list;

[0048] Fig.31B is a diagram for explaining an example of a process of updating a historical motion vector prediction candidate list;

[0049] Fig.31C is a diagram for explaining an example of a process of updating a historical motion vector prediction candidate list;

[0050] Fig.32 A diagram for explaining motion compensation prediction in a case where a reference picture (RefL0Pic) of L0 is before a processing target picture (CurPic) in L0 prediction;

[0051] Fig.33 A diagram for explaining motion compensation prediction in a case where a reference picture of L0 prediction is at a time point after a processing target picture in L0 prediction;

[0052] Fig.34 A diagram for explaining the prediction direction of motion compensation prediction in a case where a reference picture for L0 prediction is before a processing target picture and a reference picture for L1 prediction is after a processing target picture in bi-prediction;

[0053] Fig.35 A diagram for explaining a prediction direction of motion compensation prediction in a case where a reference picture for L0 prediction and a reference picture for L1 prediction in bi-prediction are at a time before a processing target picture;

[0054] Fig.36 A diagram for explaining a prediction direction of motion compensation prediction in a case where a reference picture for L0 prediction and a reference picture for L1 prediction in bi-prediction are at a time point after a processing target picture;

[0055] Fig.37 is a diagram for explaining an example of a hardware configuration of a coding / decoding device according to an embodiment of the present invention;

[0056] Fig.38is a flowchart illustrating the steps of the average merge candidate derivation process;

[0057] Fig.39A is a diagram illustrating a valid reference area for intra block copy;

[0058] Fig.39B is a diagram illustrating a valid reference area for intra block copy;

[0059] Fig.40 yes Figure 1 A block diagram showing a detailed structure of the intra prediction unit 103 in FIG.

[0060] Fig.41 yes Figure 2 A block diagram showing a detailed structure of the intra prediction unit 204 in FIG.

[0061] Fig.42 is a block diagram of the intra block copy prediction unit 352;

[0062] Fig.43 is a block diagram of the intra block copy prediction unit 362;

[0063] Fig.44 is a flowchart for explaining the prediction intra block copy processing of the intra block copy prediction unit 352;

[0064] Fig.45 is a flowchart for explaining the prediction intra block copy processing of the intra block copy prediction unit 362;

[0065] Fig.46 is a flow chart for explaining a merge intra-block copy process;

[0066] Fig.47 is a flowchart showing the processing steps of a block vector mode derivation process for predictive intra block copy;

[0067] Fig.48 2 is a diagram for explaining the processing of the reference position correction section 380 and the reference position correction section 480;

[0068] Fig.49 is a diagram showing a situation of correcting a reference position;

[0069] Fig.50A A diagram illustrating the positions of the upper left and lower right when the referenceable area is set to a rectangular shape;

[0070] Fig.50B A diagram illustrating the positions of the upper left and lower right when the referenceable area is set to a rectangular shape;

[0071] Fig.50C A diagram illustrating the positions of the upper left and lower right when the referenceable area is set to a rectangular shape;

[0072] Fig.50D A diagram illustrating the positions of the upper left and lower right when the referenceable area is set to a rectangular shape;

[0073] Fig.51 is a diagram for explaining a process of correcting the reference position of a portion of a referenceable area that is not a rectangle;

[0074] Fig.52A is a diagram showing a situation of correcting a reference position;

[0075] Fig.52B is a diagram showing a situation of correcting a reference position;

[0076] Fig.53 2 is a diagram for explaining the processing of the reference position correction section 380 and the reference position correction section 480;

[0077] Fig.54A is a diagram illustrating a case where the reference area is decomposed into two;

[0078] Fig.54B is a diagram illustrating a case where the reference area is decomposed into two;

[0079] Fig.54C is a diagram illustrating a case where the reference area is decomposed into two;

[0080] Fig.54D is a diagram illustrating a case where the reference area is decomposed into two;

[0081] Fig.55 This is a diagram for explaining the process of dividing the referenceable area into two and correcting each reference position. DETAILED DESCRIPTION

[0082] Technologies and technical terms used in this embodiment are defined.

[0083] <tree block>

[0084] In the embodiment, the encoding / decoding processing target image is equally divided into predetermined sizes. This unit is defined as a tree block. Figure 4In the embodiment, the size of the tree block is set to 128×128 pixels, but the size of the tree block is not limited to this, and any size can be set. The tree blocks that are the processing objects (corresponding to the encoding object in the encoding process and the decoding object in the decoding process) are switched in the raster scanning order, that is, from left to right and from top to bottom. The inside of each tree block can be further recursively divided. The blocks that become the encoding / decoding objects after the tree blocks are recursively divided are defined as encoding blocks. In addition, tree blocks and encoding blocks are collectively defined as blocks. By performing appropriate block division, efficient encoding can be performed. The size of the tree block can be set to a predetermined fixed value in the encoding device and the decoding device, or a structure in which the size of the tree block determined by the encoding device is transmitted to the decoding device can be adopted. Here, the maximum size of the tree block is set to 128×128 pixels, and the minimum size of the tree block is set to 16×16 pixels. In addition, the maximum size of the encoding block is set to 64×64 pixels, and the minimum size of the encoding block is set to 4×4 pixels.

[0085] <Prediction Mode>

[0086] Intra-frame prediction (MODE_INTRA) and inter-frame prediction (MODE_INTER) are switched in units of the processing target coding block. The intra-frame prediction (MODE_INTRA) performs prediction based on the processed image signal of the processing target image, and the inter-frame prediction (MODE_INTER) performs prediction based on the image signal of the processed image.

[0087] The processed image is used to obtain an image, image signal, tree block, block, coding block, etc. by decoding the signal that has been encoded in the encoding process, and is used to obtain an image, image signal, tree block, block, coding block, etc. that has been decoded in the decoding process.

[0088] A mode for identifying the intra prediction (MODE_INTRA) and the inter prediction (MODE_INTER) is defined as a prediction mode (PredMode). The prediction mode (PredMode) expresses the intra prediction (MODE_INTRA) or the inter prediction (MODE_INTER) in the form of a value.

[0089] <Intra-block copy prediction>

[0090] Intra Block Copy prediction is a process of encoding / decoding the processing object block by referring to the decoded pixels in the processing object picture as the prediction value. And the distance from the processing object block to the pixel to be referenced is represented by a block vector. Since the block vector refers to the processing object picture, the reference picture is uniquely determined, so no reference index is required. The difference between the block vector and the motion vector is whether the picture to be referenced is the processing object picture or the processed picture. In addition, the block vector can use adaptive motion vector resolution (AMVR) to select 1 pixel accuracy or 4 pixel accuracy.

[0091] In the intra block copy, two modes, a prediction intra block copy mode and a merge intra block copy mode, can be selected.

[0092] The prediction intra block copy mode is a mode in which the block vector of the processing target block is determined based on the prediction block vector and the differential block vector derived from the processed information. The prediction block vector is derived based on the processed blocks adjacent to the processing target block and the index for determining the prediction block vector. The index for determining the prediction block vector and the differential block vector are transmitted in the bitstream.

[0093] The merge intra block copy mode is a mode in which the intra block copy prediction information of the processing target block is derived from the intra block copy prediction information of the processed blocks adjacent to the processing target block without transmitting the differential motion vector.

[0094] <Inter-frame prediction>

[0095] In inter-frame prediction for prediction based on an image signal of a processed image, multiple processed images can be used as reference pictures. In order to manage multiple reference pictures, two reference lists, L0 (reference list 0) and L1 (reference list 1), are defined, and reference pictures are determined using reference indexes, respectively. In a P slice (Pslice), L0 prediction (Pred_L0) can be used. In a B slice (Bslice), L0 prediction (Pred_L0), L1 prediction (Pred_L1), and dual prediction (Pred_BI) can be used. L0 prediction (Pred_L0) is an inter-frame prediction with reference to a reference picture managed by L0, and L1 prediction (Pred_L1) is an inter-frame prediction with reference to a reference picture managed by L1. Dual prediction (Pred_BI) is an inter-frame prediction that performs L0 prediction and L1 prediction simultaneously and refers to reference pictures managed by each of L0 and L1. Information for determining L0 prediction, L1 prediction, and dual prediction is defined as an inter-frame prediction mode. In subsequent processing, constants and variables having the subscript LX added to their output are assumed to be processed separately for L0 and L1.

[0096] <Prediction Motion Vector Mode>

[0097] The prediction motion vector mode is a mode that transmits an index for determining a prediction motion vector, a differential motion vector, an inter-prediction mode, and a reference index and determines inter-prediction information of a processing target block. The prediction motion vector is derived from a prediction motion vector candidate and an index for determining the prediction motion vector, wherein the prediction motion vector candidate is derived from a processed block adjacent to the processing target block or a block belonging to a processed image that is located at the same position as the processing target block or in the vicinity (neighborhood) of the processing target block.

[0098] <Merge Mode>

[0099] The merge mode is a mode in which the inter-frame prediction information of the processing object block is derived from the inter-frame prediction information of a processed block adjacent to the processing object block or a block belonging to a processed image that is located at the same position as or near (adjacent to) the processing object block, without transmitting a differential motion vector or a reference index.

[0100] The processed blocks adjacent to the processing object block and the inter-frame prediction information of the processed blocks are defined as spatial merge candidates. The blocks belonging to the processed image that are located at the same position as the processing object block or in the vicinity (neighborhood) and the inter-frame prediction information derived from the inter-frame prediction information of the block are defined as temporal merge candidates. Each merge candidate is registered in the merge candidate list, and the merge candidate used in the prediction of the processing object block is determined by the merge index.

[0101] <adjacent block>

[0102] Fig.11 This is a diagram for explaining reference blocks used to derive inter-frame prediction information in the prediction motion vector mode and the merge mode. A0, A1, A2, B0, B1, B2, and B3 are processed blocks adjacent to the processing target block. T0 is a block that is located at the same position as or near (adjacent to) the processing target block in the processing target image among the processed image blocks.

[0103] A1 and A2 are blocks located on the left side of the processing target coding block and adjacent to the processing target coding block. B1 and B3 are blocks located on the upper side of the processing target coding block and adjacent to the processing target coding block. A0, B0, and B2 are blocks located at the lower left, upper right, and upper left of the processing target coding block, respectively.

[0104] The details of how neighboring blocks are processed in the predicted motion vector mode and the merge mode are described later.

[0105] <Affine Transformation Motion Compensation>

[0106] Affine transformation motion compensation is to divide the coding block into predetermined units of sub-blocks and determine the motion vector for each divided sub-block separately to perform motion compensation. The motion vector of each sub-block is derived based on one or more control points, and the one or more control points are derived based on the inter-frame prediction information of the processed blocks adjacent to the processing object block or the blocks belonging to the processed image that are located at the same position or near (adjacent) as the processing object block. In this embodiment, the size of the sub-block is set to 4×4 pixels, but the size of the sub-block is not limited to this, and the motion vector can also be derived in units of pixels.

[0107] Fig.14 An example of affine transformation motion compensation when there are two control points is shown. In this case, the two control points have two parameters, a horizontal component and a vertical component. Therefore, the affine transformation when there are two control points is called a four-parameter affine transformation. Fig.14 CP0 and CP1 are control points.

[0108] Fig.15 An example of affine transformation motion compensation when there are three control points is shown. In this case, the three control points have two parameters, a horizontal component and a vertical component. Therefore, the affine transformation when there are three control points is called a six-parameter affine transformation. Fig.15 CP0, CP1, and CP2 are control points.

[0109] Affine transformation motion compensation can be used in either the prediction motion vector mode or the merge mode. A mode in which affine transformation motion compensation is applied in the prediction motion vector mode is defined as the sub-block prediction motion vector mode, and a mode in which affine transformation motion compensation is applied in the merge mode is defined as the sub-block merge mode.

[0110] <Syntax of coded blocks>

[0111] use Fig. 12A , Fig. 12B and Fig.13 To illustrate the syntax used to describe the prediction mode of a coding block. Fig. 12Apred_mode_flag is a flag indicating whether it is inter-frame prediction. If pred_mode_flag is 0, it is inter-frame prediction, and if pred_mode_flag is 1, it is intra-frame prediction. In the case of intra-frame prediction, pred_mode_ibc_flag is sent as a flag indicating whether it is intra-frame block copy prediction. In the case of intra-frame block copy prediction (pred_mode_ibc_flag=1), merge_flag is sent. merge_flag is a flag indicating whether it is merged intra-frame block copy mode or predicted intra-frame block copy mode. In the case of merged intra-frame block copy mode (merge_flag=1), merge index merge_idx is sent. In the case of not intra-frame block copy prediction (pred_mode_ibc_flag=0), as normal intra-frame prediction, normal intra-frame prediction information intra_pred_mode is sent.

[0112] In the case of inter prediction, merge_flag is sent. merge_flag is a flag indicating whether it is merge mode or prediction motion vector mode. In the case of prediction motion vector mode (merge_flag = 0), inter_affine_flag is a flag indicating whether sub-block prediction motion vector mode is applied. If sub-block prediction motion vector mode is applied (inter_affine_flag = 1), cu_affine_type_flag is sent. cu_affine_type_flag is a flag used to determine the number of control points in sub-block prediction motion vector mode.

[0113] On the other hand, in the case of merge mode (merge_flag = 1), the Fig. 12Bmerge_subblock_flag. merge_subblock_flag is a flag indicating whether the sub-block merge mode is applied. In the case of sub-block merge mode (merge_subblock_flag=1), the merge index merge_subblock_idx is sent. On the other hand, in the case of not sub-block merge mode (merge_subblock_flag=0), the flag merge_triangle_flag indicating whether the triangle merge mode is applied is sent. If the triangle merge mode is applied (merge_triangle_flag=1), the merge triangle indexes merge_triangle_idx0 and merge_triangle_idx1 are sent for the direction merge_triangle_split_dir of the partition block and the two partitions. On the other hand, if the triangle merge mode is not applied (merge_triangle_flag=0), the merge index merge_idx is sent.

[0114] Fig.13 The values ​​of each syntax element of inter prediction and the prediction mode corresponding thereto are shown. merge_flag=0, inter_affine_flag=0 corresponds to the normal prediction motion vector mode (Inter Pred Mode). merge_flag=0, inter_affine_flag=1 corresponds to the sub-block prediction motion vector mode (Inter Affine Mode). merge_flag=1, merge_subblock_flag=0, merge_trianlge_flag=0 corresponds to the normal merge mode (Merge Mode). merge_flag=1, merge_subblock_flag=0, merge_trianlge_flag=1 corresponds to the triangle merge mode (Triangle Merge Mode). merge_flag=1, merge_subblock_flag=1 corresponds to the sub-block merge mode (Affine Merge Mode).

[0115] <poc>

[0116] POC (Picture Order Count) is a variable associated with the picture to be encoded, and is set to a value that increases by 1 corresponding to the output order of the picture. According to the value of POC, it is possible to distinguish whether it is the same picture, distinguish the front-and-back relationship between pictures in the output order, and derive the distance between pictures. For example, if the POCs of two pictures have the same value, they can be judged to be the same picture. In the case where the POCs of two pictures have different values, it can be judged that the picture with a smaller POC value is the picture output first, and the difference between the POCs of the two pictures represents the distance between the pictures in the time axis direction.

[0117] (First Embodiment)

[0118] An image encoding device 100 and an image decoding device 200 according to the first embodiment of the present invention will be described.

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

[0120] The block division unit 101 recursively divides the input image to generate coding blocks. The block division unit 101 includes a 4-division unit and a 2-3 division unit. The 4-division unit divides the block to be divided in the horizontal direction and the vertical direction respectively, and the 2-3 division unit divides the block to be divided in either the horizontal direction or the vertical direction. The block division unit 101 sets the generated coding block as the processing target coding block, and provides the image signal of the processing target coding block to the inter-frame prediction unit 102, the intra-frame prediction unit 103 and the residual generation unit 106. In addition, the block division unit 101 provides information indicating the determined recursive division structure to the bit string encoding unit 108. The detailed operation of the block division unit 101 will be described later.

[0121] The inter-frame prediction unit 102 performs inter-frame prediction of the processing target coding block. The inter-frame prediction unit 102 derives a plurality of candidates of inter-frame prediction information based on the inter-frame prediction information stored in the coding information storage memory 111 and the decoded image signal stored in the decoded image memory 104, selects an appropriate inter-frame prediction mode from the derived plurality of candidates, and provides the selected inter-frame prediction mode and the predicted image signal corresponding to the selected inter-frame prediction mode to the prediction method determination unit 105. The detailed structure and operation of the inter-frame prediction unit 102 will be described later.

[0122] The intra prediction unit 103 performs intra prediction of the processing target coding block. The intra prediction unit 103 refers to the decoded image signal stored in the decoded image memory 104 as a reference pixel, and generates a predicted image signal through intra prediction based on the coding information such as the intra prediction mode stored in the coding information storage memory 111. In the intra prediction, the intra prediction unit 103 selects a suitable intra prediction mode from a plurality of intra prediction modes, and provides the selected intra prediction mode and the predicted image signal corresponding to the selected intra prediction mode to the prediction method determination unit 105. The detailed structure and operation of the intra prediction unit 103 will be described later.

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

[0124] The prediction method determination unit 105 determines the best prediction mode by evaluating each of intra prediction and inter prediction using the coding information and the amount of residual code, the amount of distortion between the predicted image signal and the processing target image signal, etc. In the case of intra prediction, the prediction method determination unit 105 supplies intra prediction information such as the intra prediction mode as coding information to the bit string coding unit 108. In the case of the merge mode of the inter prediction, the prediction method determination unit 105 supplies inter prediction information such as the merge index and information indicating whether it is the sub-block merge mode (sub-block merge flag) as coding information to the bit string coding unit 108. In the case of the predicted motion vector mode of the inter prediction, the prediction method determination unit 105 supplies inter prediction information such as the inter prediction mode, the predicted motion vector index, the reference index of L0 and L1, the differential motion vector, and the information indicating whether it is the sub-block predicted motion vector mode (sub-block predicted motion vector flag) as coding information to the bit string coding unit 108. In addition, the prediction method determination unit 105 supplies the determined coding information to the coding information storage memory 111. The prediction method determination unit 105 supplies the predicted image signal to the residual generation unit 106 and the decoded image signal superposition unit 110 .

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

[0126] The orthogonal transform / quantization section 107 orthogonally transforms and quantizes the residual according to the quantization parameter to generate an orthogonally transformed / quantized residual, and supplies the generated residual to the bit string encoding section 108 and the inverse quantization / inverse orthogonal transform section 109 .

[0127] The bit string coding unit 108 encodes the coding information corresponding to the prediction method determined by the prediction method determination unit 105 for each coding block in addition to the information in units of sequence, picture, slice, and coding block. Specifically, the bit string coding unit 108 encodes the prediction mode PredMode for each coding block. When the prediction mode is inter-frame prediction (MODE_INTER), the bit string coding unit 108 encodes the coding information (inter-frame prediction information) such as the flag for distinguishing whether it is a merge mode, the sub-block merge flag, the merge index when it is a merge mode, the inter-frame prediction mode when it is not a merge mode, the predicted motion vector index, the information related to the differential motion vector, and the sub-block predicted motion vector flag according to the prescribed syntax (syntactic rule of the bit string) to generate a first bit string. When the prediction mode is intra-frame prediction (MODE_INTRA), the bit string coding unit 108 encodes the flag for distinguishing whether it is an intra-frame block copy according to the prescribed syntax. In the case of intra-frame block copy, if it is a merge mode, the merge index is encoded according to the prescribed syntax, and if it is not a merge mode, the encoding information (intra-frame prediction information) such as the prediction block vector index and the differential block vector is encoded according to the prescribed syntax. In the case of not intra-frame block copy, the encoding information (intra-frame prediction information) such as the intra-frame prediction mode is encoded according to the prescribed syntax. Through the above encoding, a first bit string is generated. In addition, the bit string encoding unit 108 performs entropy encoding on the residual after orthogonal transformation and quantization according to the prescribed syntax to generate a second bit string. The bit string encoding unit 108 multiplexes the first bit string and the second bit string according to the prescribed syntax and outputs a bit stream.

[0128] The inverse quantization / inverse orthogonal transform section 109 inversely quantizes and inversely orthogonally transforms the orthogonally transformed / quantized residual supplied from the orthogonal transform / quantization section 107 to calculate a residual, and supplies the calculated residual to the decoded image signal superposition section 110 .

[0129] The decoded image signal superimposing unit 110 superimposes the predicted image signal corresponding to the decision of the prediction method determining unit 105 and the residual obtained by the inverse quantization and inverse orthogonal transformation performed by the inverse quantization / inverse orthogonal transformation unit 109 to generate a decoded image, and stores it in the decoded image memory 104. In addition, the decoded image signal superimposing unit 110 may perform filtering processing on the decoded image to reduce distortion such as block distortion caused by encoding, and then store it in the decoded image memory 104.

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

[0131] Figure 2 It means Figure 1 The image decoding device of the embodiment of the present invention includes a bit string decoding unit 201, a block division unit 202, an inter-frame prediction unit 203, an intra-frame prediction unit 204, a coding information storage memory 205, an inverse quantization / inverse orthogonal transformation unit 206, a decoded image signal superposition unit 207, and a decoded image memory 208.

[0132] Figure 2 Decoding processing of an image decoding device and Figure 1 The decoding process of the internal setting of the image encoding device corresponds to Figure 2 The encoding information storage memory 205, the inverse quantization / inverse orthogonal transformation unit 206, the decoded image signal superposition unit 207 and the decoded image memory 208 have the same structure as Figure 1 The encoding information storage memory 111, the inverse quantization / inverse orthogonal transformation unit 109, the decoded image signal superposition unit 110 and the decoded image memory 104 of the image encoding device respectively correspond to the functions.

[0133] The bit stream provided to the bitstream decoding unit 201 is separated according to the prescribed syntax rules. The bitstream decoding unit 201 decodes the separated first bitstream to obtain information of the sequence, picture, slice, coding block unit, and coding information of the coding block unit. Specifically, the bitstream decoding unit 201 decodes the prediction mode PredMode in units of coding blocks, and the prediction mode PredMode distinguishes whether it is inter-frame prediction (MODE_INTER) or intra-frame prediction (MODE_INTRA). When the prediction mode is inter-frame prediction (MODE_INTER), the bitstream decoding unit 201 decodes the coding information (inter-frame prediction information) related to the flag for distinguishing whether it is a merge mode, the merge index in the case of the merge mode, the sub-block merge flag, the inter-frame prediction mode in the case of the predicted motion vector mode, the predicted motion vector index, the differential motion vector, the sub-block predicted motion vector flag, etc. according to the prescribed syntax, and provides the coding information (inter-frame prediction information) to the coding information storage memory 205 via the inter-frame prediction unit 203 and the block division unit 202. When the prediction mode is intra prediction (MODE_INTRA), the bitstream decoding unit 201 decodes a flag for determining whether it is an intra block copy. In the case of an intra block copy, if it is a merge mode, the merge index is decoded according to the prescribed syntax, and if it is not a merge mode, the coding information (intra prediction information) such as the prediction block vector index and the differential block vector is decoded according to the prescribed syntax. When it is not an intra block copy, the coding information (intra prediction information) such as the intra prediction mode is decoded according to the prescribed syntax. Through the above decoding, the coding information (intra prediction information) is provided to the coding information storage memory 205 via the inter prediction unit 203 or the intra prediction unit 204, and the block division unit 202. The bitstream decoding unit 201 decodes the separated second bitstream, calculates the residual after orthogonal transformation / quantization, and provides the residual after orthogonal transformation / quantization to the inverse quantization / inverse orthogonal transformation unit 206.

[0134] When the prediction mode PredMode of the coding block to be processed is the prediction motion vector mode in the inter-frame prediction (MODE_INTER), the inter-frame prediction unit 203 uses the coding information of the decoded image signal stored in the coding information storage memory 205 to derive multiple prediction motion vector candidates, and registers the derived multiple prediction motion vector candidates in the prediction motion vector candidate list described later. The inter-frame prediction unit 203 selects a prediction motion vector corresponding to the prediction motion vector index provided by the bit string decoding unit 201 from the multiple prediction motion vector candidates registered in the prediction motion vector candidate list, calculates a motion vector based on the differential motion vector decoded by the bit string decoding unit 201 and the selected prediction motion vector, and stores the calculated motion vector in the coding information storage memory 205 together with other coding information. Here, the coding information of the coding block to be provided / saved is the prediction mode PredMode, the flags predFlagL0[xP][yP] and predFlagL1[xP][yP] indicating whether to use L0 prediction and L1 prediction, the reference indexes refIdxL0[xP][yP] and refIdxL1[xP][yP] of L0 and L1, the 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 the picture. When the prediction mode PredMode is inter-frame prediction (MODE_INTER) and the inter-frame prediction mode is L0 prediction (Pred_L0), the flag predFlagL0 indicating whether L0 prediction is used is 1, and the flag predFlagL1 indicating whether L1 prediction is used is 0. When the inter prediction mode is L1 prediction (Pred_L1), the flag predFlagL0 indicating whether L0 prediction is used is 0, and the flag predFlagL1 indicating whether L1 prediction is used is 1. When the inter prediction mode is bi-prediction (Pred_BI), the flag predFlagL0 indicating whether L0 prediction is used and the flag predFlagL1 indicating whether L1 prediction is used are both 1. And, when the prediction mode PredMode of the coding block of the processing object is the merge mode in the inter prediction (MODE_INTER), the merge candidate is derived.Using the coding information of the 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 the merge index decoded and provided by the bit string decoding unit 201 is selected from the plurality of merge candidates registered in the merge candidate list, and inter-frame prediction information such as flags predFlagL0[xP][yP], predFlagL1[xP][yP] indicating whether to use the L0 prediction and L1 prediction of the selected merge candidate, reference indices refIdxL0[xP][yP], refIdxL1[xP][yP] of L0 and L1, and motion vectors mvL0[xP][yP], mvL1[xP][yP] of L0 and L1 are stored in the coding information storage memory 205. Here, xP and yP are indices indicating the position of the upper left pixel of the coding block in the picture. The detailed structure and operation of the inter-frame prediction unit 203 will be described later.

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

[0136] The inverse quantization / inverse orthogonal transformation unit 206 performs inverse orthogonal transformation and inverse quantization on the orthogonal transformation / quantization residual decoded by the bit string decoding unit 201 to obtain the inverse orthogonal transformation / inverse quantization residual.

[0137] The decoded image signal superimposing unit 207 decodes the decoded image signal by superimposing the predicted image signal obtained by the inter-frame prediction unit 203 or the predicted image signal obtained by the intra-frame prediction unit 204 and the residual after the inverse orthogonal transformation / inverse quantization by the inverse quantization / inverse orthogonal transformation unit 206, and stores the decoded image signal in the decoded image memory 208. When storing in the decoded image memory 208, the decoded image signal superimposing unit 207 may perform filtering processing on the decoded image to reduce block distortion caused by encoding, and then store it in the decoded image memory 208.

[0138] Next, the operation of the block division unit 101 in the image encoding device 100 will be described. Figure 3 The flowchart shows the operation of dividing an image into tree blocks and further dividing each tree block. First, the input image is divided into tree blocks of a predetermined size (step S1001). Each tree block is scanned in a predetermined order, i.e., a raster scan order (step S1002), and the inside of the tree block to be processed is divided (step S1003).

[0139] Figure 7 1 is a flowchart showing the detailed operation of the division process of step S1003. First, it is determined whether the block to be processed is divided into four (step S1101).

[0140] If it is determined that the processing target block is to be divided into four, the processing target block is divided into four (step S1102). Each block obtained by dividing the processing target block is scanned in the Z scanning order, that is, in the order of upper left, upper right, lower left, and lower right (step S1103). Figure 5 is an example of a Z scan sequence, Fig. 6A 601 is an example of dividing the processing object block into four. Fig. 6A The numbers 0 to 3 of 601 indicate the order of processing. Then, for each block obtained by segmentation in step S1101, recursively execute Figure 7 segmentation processing (step S1104).

[0141] When it is determined that the processing target block is not to be divided into four, a 2-3 division is performed (step S1105).

[0142] Figure 8 1 is a flowchart showing the detailed operation of the 2-3 division process of step S1105. First, it is determined whether the block to be processed is to be divided into 2-3, that is, whether it is to be divided into 2 or 3 (step S1201).

[0143] If it is determined that the processing target block is not to be divided into 2-3 blocks, that is, if it is determined that the block is not to be divided, the division is terminated (step S1211). That is, no further recursive division is performed on the block divided by the recursive division process.

[0144] When it is determined that the processing target block is to be divided into 2-3, it is determined whether the processing target block is to be further divided into 2 (step S1202).

[0145] When it is determined that the processing target block is to be divided into two, it is determined whether to divide the processing target block up and down (vertically) (step S1203), and based on the result, the processing target block is divided into two up and down (vertically) (step S1204), or the processing target block is divided into two left and right (horizontally) (step S1205). As a result of step S1204, the processing target block is divided into two Figure 6B As shown in 602 in FIG. 1204 , the processing object block is divided into two parts, the upper and the lower (vertical direction). As a result of step S1205, the processing object block is as follows Fig.6D As shown in 604 in FIG. 1 , it is divided into two parts, left and right (horizontally).

[0146] In step S1202, if it is not determined that the processing object block is to be divided into two, that is, if it is determined that it is to be divided into three, it is determined whether the processing object block is to be divided into the top, middle and bottom (vertical direction) (step S1206), and based on the result, the processing object block is divided into three parts in the top, middle and bottom (vertical direction) (step S1207), or the processing object block is divided into three parts in the left, middle and right (horizontal direction) (step S1208). In the result of step S1207, if the processing object block is divided into three parts in the top, middle and bottom (vertical direction) (step S1208), Figure 6C As shown in 603, it is divided into three parts (upper, middle and lower (vertical direction). In the result of step S1208, the processing object block is as follows Fig. 6E As shown in 605, it is divided into three parts: left, center and right (horizontal direction).

[0147] After any one of step S1204, step S1205, step S1207, and step S1208 is executed, each block obtained by dividing the processing target block is scanned in order from left to right and from top to bottom (step S1209). Figure 6B to Figure 6E The numbers 0 to 2 from 602 to 605 indicate the order of processing. For each divided block, recursively execute Figure 8 2-3 segmentation processing (step S1210).

[0148] The recursive block division described here may also limit the need for division according to the number of divisions or the size of the block to be processed, etc. The information limiting the need for division may be implemented in a structure where the information is agreed upon in advance between the encoding device and the decoding device without transmitting the information, or may be implemented in a structure where the encoding device determines the information limiting the need for division and records it in a bit string and transmits it to the decoding device.

[0149] When a block is split, the block before the split is called a parent block, and each block after the split is called a child block.

[0150] Next, the operation of the block division unit 202 in the image decoding device 200 will be described. The block division unit 202 divides the tree blocks according to the same processing steps as the block division unit 101 of the image encoding device 100. However, the difference is that, in the block division unit 101 of the image encoding device 100, an optimization method such as estimation of the optimal shape based on image recognition or distortion rate optimization is applied to determine the optimal block division shape, while the block division unit 202 in the image decoding device 200 determines the block division shape by decoding the block division information recorded in the bit string.

[0151] Fig. 9 The syntax (syntactic rules of bit strings) related to the block division of the first embodiment is shown. coding_quadtree() represents the syntax involved in the block division process of 4. multi_type_tree() represents the syntax involved in the block division process of 2 or 3. qt_split is a flag indicating whether the block is divided into 4. When the block is divided into 4, set qt_split = 1, and when not divided into 4, set qt_split = 0. In the case of 4 division (qt_split = 1), the 4 division process is recursively performed on each of the divided blocks (coding_quadtree (0), coding_quadtree (1), coding_quadtree (2), coding_quadtree (3), and the independent variables 0 to 3 correspond to Fig. 6A 601). When 4-partition is not performed (qt_split=0), the subsequent partition is determined according to multi_type_tree(). mtt_split is a flag indicating whether to perform further partitioning. Furthermore, when partitioning is performed (mtt_split=1), a flag indicating whether to perform the partitioning in the vertical direction or the horizontal direction, namely mtt_split_vertical, and a flag determining whether to perform the partitioning in the 2 directions or the 3 directions, namely mtt_split_binary, are transmitted. mtt_split_vertical=1 indicates the partitioning in the vertical direction, and mtt_split_vertical=0 indicates the partitioning in the horizontal direction. mtt_split_binary=1 indicates the partitioning in the 2 directions, and mtt_split_binary=0 indicates the partitioning in the 3 directions. In the case of 2-partition (mtt_split_binary=1), the partitioning process is performed recursively on each block after the 2-partition (multi_type_tree(0), multi_type_tree(1), and the 0 to 1 of the independent variable corresponds to Figure 6B , Fig.6D In the case of three-way split (mtt_split_binary=0), each block after the three-way split is recursively split (multi_type_tree(0), multi_type_tree(1), multi_type_tree(2), 0 to 2 correspond to Figure 6C 603 or Fig. 6E 605 of ). By recursively calling multi_type_tree, hierarchical block segmentation is performed until mtt_split=0.

[0152] <Intra-frame prediction>

[0153] The intra-frame prediction method involved in the embodiment is Figure 1 The intra prediction unit 103 of the image encoding device 100 and Figure 2 The intra prediction unit 204 of the image decoding device 200 is implemented.

[0154] The intra-frame prediction method according to the embodiment will be described with reference to the drawings. The intra-frame prediction method is implemented in any one of the encoding and decoding processes performed in units of coding blocks.

[0155] <Description of the Intra Prediction Unit 103 on the Encoding Side>

[0156] Fig.40 Yes means Figure 1 FIG. 3 is a diagram showing a detailed structure of the intra prediction unit 103 of the image encoding device 100. The normal intra prediction unit 351 generates a predicted image signal from decoded pixels adjacent to a coding block to be processed by normal intra prediction, selects a suitable intra prediction mode from a plurality of intra prediction modes, and provides the selected intra prediction mode and the predicted image signal corresponding to the selected intra prediction mode to the prediction method determination unit 105. Fig. 10A and Fig. 10B An example of intra prediction is shown. Fig. 10A The correspondence between the prediction direction of the general intra prediction and the intra prediction mode number is shown. For example, in intra prediction mode 50, an intra prediction image is generated by copying pixels in the vertical direction. Intra prediction mode 1 is a DC mode, which is a mode in which all pixel values ​​of the processing object block are set to the average value of the reference pixels. Intra prediction mode 0 is a planar mode, and is a mode for creating a two-dimensional intra prediction image from reference pixels in the vertical direction and the horizontal direction. Fig. 10B This is an example of generating an intra-prediction image in the case of intra-prediction mode 40. For each pixel of the processing target block, 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 an integer position, the reference pixel value is determined by interpolation based on the reference pixel values ​​at the surrounding integer positions.

[0157] The intra block copy prediction unit 352 obtains a decoded region of the same image signal as the coded block to be processed from the decoded image memory 104, generates a predicted image signal by intra block copy processing, and supplies the predicted image signal to the prediction method determination unit 105. The detailed structure and processing of the intra block copy prediction unit 352 will be described later.

[0158] <Description of the intra prediction unit 204 on the decoding side>

[0159] Fig.41 Yes means Figure 2 FIG. 2 is a diagram showing a detailed structure of the intra prediction unit 204 of the image decoding device 200.

[0160] The normal intra prediction unit 361 generates a predicted image signal by normal intra prediction based on decoded pixels adjacent to the coding block to be processed, selects a suitable intra prediction mode from a plurality of intra prediction modes, obtains the selected intra prediction mode and a predicted image signal corresponding to the selected intra prediction mode, and provides the predicted image signal to the decoded image signal superposition unit 207 via the switch 364. Fig.41 The processing of the usual intra-frame prediction unit 361 corresponds to Fig.40 Since it is a normal intra-frame prediction unit 351, its detailed description is omitted.

[0161] The intra block copy prediction unit 362 obtains a decoded area of ​​the same image signal as the coded block to be processed from the decoded image memory 208, and obtains a predicted image signal through the intra block copy process. The predicted image signal is provided to the decoded image signal superposition unit 207 via the switch 364. The detailed structure and processing of the intra block copy prediction unit 362 will be described later.

[0162] <Inter-frame prediction>

[0163] The inter-frame prediction method of the embodiment is Figure 1 The inter-frame prediction unit 102 of the image encoding device and Figure 2 The method is implemented in the inter-frame prediction unit 203 of the image decoding device.

[0164] The inter-frame prediction method according to the embodiment will be described with reference to the drawings. The inter-frame prediction method is performed in either the encoding process or the decoding process in units of coding blocks.

[0165] <Description of the Inter-frame Prediction Unit 102 on the Encoding Side>

[0166] Fig.16 It is shown Figure 1 FIG. 1 is a diagram showing a detailed structure of the inter-frame prediction unit 102 of the image encoding device of FIG. The normal prediction motion vector mode deriving unit 301 derives a plurality of normal prediction motion vector candidates to select a prediction motion vector, and calculates a differential motion vector between the selected prediction motion vector and the detected motion vector. The detected inter-frame prediction mode, reference index, motion vector, and calculated differential motion vector are inter-frame prediction information of the normal prediction motion vector mode. The inter-frame prediction information is provided to the inter-frame prediction mode determination unit 305. The detailed structure and processing of the normal prediction motion vector mode deriving unit 301 will be described later.

[0167] In the normal merge mode derivation unit 302, a plurality of normal merge candidates are derived, a normal merge candidate is selected, and inter prediction information of the normal merge mode is obtained. The inter prediction information is provided to the inter prediction mode determination unit 305. The detailed structure and processing of the normal merge mode derivation unit 302 will be described later.

[0168] In the sub-block prediction motion vector mode derivation unit 303, multiple sub-block prediction motion vector candidates are derived to select a sub-block prediction motion vector, and a differential motion vector between the selected sub-block prediction motion vector and the detected motion vector is calculated. The detected inter-frame prediction mode, reference index, motion vector and calculated differential motion vector are inter-frame prediction information of the sub-block prediction motion vector mode. The inter-frame prediction information is provided to the inter-frame prediction mode determination unit 305.

[0169] The sub-block merging mode derivation unit 304 derives a plurality of sub-block merging candidates, selects a sub-block merging candidate, and obtains inter-frame prediction information of the sub-block merging mode. The inter-frame prediction information is provided to the inter-frame prediction mode determination unit 305 .

[0170] 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 information corresponding to the determination result is supplied from the inter prediction mode determination unit 305 to the motion compensation prediction unit 306.

[0171] The motion compensation prediction unit 306 performs inter-frame prediction on the reference image signal stored in the decoded image memory 104 based on the determined inter-frame prediction information. The detailed structure and processing of the motion compensation prediction unit 306 will be described later.

[0172] <Description of the Inter-frame Prediction Unit 203 on the Decoding Side>

[0173] Fig. 22 It is shown Figure 2 FIG. 2 is a diagram showing a detailed structure of the inter-frame prediction unit 203 of the image decoding device.

[0174] The normal prediction motion vector mode deriving unit 401 derives a plurality of normal prediction motion vector candidates to select a prediction motion vector, and calculates the sum of the selected prediction motion vector and the decoded differential motion vector as a motion vector. The decoded inter-frame prediction mode, reference index, and motion vector are inter-frame prediction information of the normal prediction motion vector mode. The inter-frame prediction information is provided to the motion compensation prediction unit 406 via the switch 408. The detailed structure and processing of the normal prediction motion vector mode deriving unit 401 will be described later.

[0175] In the normal merge mode derivation unit 402, a plurality of normal merge candidates are derived to select a normal merge candidate, and inter-frame prediction information of the normal merge mode is obtained. The inter-frame prediction information is provided to the motion compensation prediction unit 406 via the switch 408. The detailed structure and processing of the normal merge mode derivation unit 402 will be described later.

[0176] In the sub-block prediction motion vector mode derivation unit 403, multiple sub-block prediction motion vector candidates are derived to select a sub-block prediction motion vector, and the sum of the selected sub-block prediction motion vector and the decoded differential motion vector is calculated as a motion vector. The decoded inter-frame prediction mode, reference index, and motion vector become inter-frame prediction information of the sub-block prediction motion vector mode. The inter-frame prediction information is provided to the motion compensation prediction unit 406 via the switch 408.

[0177] The subblock merging mode derivation unit 404 derives a plurality of subblock merging candidates, selects a subblock merging candidate, and obtains inter-frame prediction information of the subblock merging mode. The inter-frame prediction information is provided to the motion compensation prediction unit 406 via the switch 408 .

[0178] The motion compensation prediction unit 406 performs inter-frame prediction on the reference image signal stored in the decoded image memory 208 based on the determined inter-frame prediction information. The detailed structure and processing of the motion compensation prediction unit 406 are the same as those of the motion compensation prediction unit 306 on the encoding side.

[0179] <Normal Motion Vector Prediction Mode Derivation Unit (Normal AMVP)>

[0180] Fig.17 The normal prediction motion vector mode extraction unit 301 includes a spatial prediction motion vector candidate extraction unit 321, a temporal prediction motion vector candidate extraction unit 322, a historical prediction motion vector candidate extraction unit 323, a prediction motion vector candidate supplement unit 325, a normal motion vector detection unit 326, a prediction motion vector candidate selection unit 327 and a motion vector subtraction unit 328.

[0181] Fig.23 The normal prediction motion vector mode extraction unit 401 includes a spatial prediction motion vector candidate extraction unit 421, a temporal prediction motion vector candidate extraction unit 422, a historical prediction motion vector candidate extraction unit 423, a prediction motion vector candidate supplement unit 425, a prediction motion vector candidate selection unit 426 and a motion vector addition unit 427.

[0182] Use respectively Fig.19 , Fig.25 The flowchart illustrates the processing steps 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. Fig.19 1 is a flowchart showing the normal motion vector prediction mode derivation processing steps by the normal motion vector mode derivation unit 301 on the encoding side. Fig.25 It is a flowchart showing the normal motion vector mode derivation processing procedure by the normal motion vector mode derivation unit 401 on the decoding side.

[0183] <Normal Motion Vector Prediction Mode Derivation Unit (Normal AMVP): Description on the Encoding Side>

[0184] refer to Fig.19 The following describes the steps for deriving the normal motion vector prediction mode on the encoding side. Fig.19 Sometimes the processing steps are omitted. Fig.19 The word "usually" is shown.

[0185] First, the normal motion vector detection unit 326 detects a normal motion vector ( Fig.19 Step S100).

[0186] Next, the spatial motion vector prediction candidate derivation unit 321, the temporal motion vector prediction candidate derivation unit 322, the historical motion vector prediction candidate derivation unit 323, the motion vector prediction candidate supplementation unit 325, the motion vector prediction candidate selection unit 327 and the motion vector subtraction unit 328 calculate, for each of L0 and L1, a differential motion vector ( Fig.19 Steps S101 to S106). Specifically, when the prediction mode PredMode of the processing object 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 differential motion vector mvdL0 of the motion vector mvL0 of L0 is calculated. When the inter prediction mode of the processing object block is L1 prediction (Pred_L1), the prediction motion vector candidate list mvpListL1 of L1 is calculated, the prediction motion vector mvpL1 is selected, and the differential motion vector mvdL1 of the motion vector mvL1 of L1 is calculated. When the inter-frame prediction mode of the processing object block is dual prediction (Pred_BI), L0 prediction and L1 prediction are performed simultaneously, the predicted motion vector candidate list mvpListL0 of L0 is calculated, the predicted motion vector mvpL0 of L0 is selected, the differential motion vector mvdL0 of L0's motion vector mvL0 is calculated, and the predicted motion vector candidate list mvpListL1 of L1 is calculated, the predicted motion vector mvpL1 of L1 is calculated, and the differential motion vector mvdL1 of L1's motion vector mvL1 is calculated respectively.

[0187] The differential motion vector calculation process is performed on L0 and L1 respectively, but the process is common to 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 of LX is 0, and in the process of calculating the differential motion vector of L1, X of LX is 1. In addition, in the process of calculating the differential motion vector of LX, when the information of another list is referred to without referring to LX, the other list is represented as LY.

[0188] In the case of using the motion vector mvLX of LX ( Fig.19 Step S102: Yes), calculate the candidates for the predicted motion vector of LX, and construct a predicted motion vector candidate list mvpListLX of LX ( Fig.19 Step S103). The spatial prediction motion vector candidate derivation unit 321, the temporal prediction motion vector candidate derivation unit 322, the historical prediction motion vector candidate derivation unit 323, and the prediction motion vector candidate supplementation unit 325 in the normal prediction motion vector mode derivation unit 301 derive multiple prediction motion vector candidates to construct a prediction motion vector candidate list mvpListLX. Fig.19 The detailed processing steps of step S103 are as follows: Fig. 20 The flowchart is described later.

[0189] Next, the motion vector predictor candidate selection unit 327 selects a motion vector predictor mvpLX of LX from the motion vector predictor candidate list mvpListLX of LX ( Fig.19 Step S104). Here, in the predicted motion vector candidate list mvpListLX, a certain element (the i-th element counting from 0) is represented as mvpListLX[i]. Each differential motion vector that is the difference between the motion vector mvLX and the candidates mvpListLX[i] of each predicted motion vector stored in the predicted motion vector candidate list mvpListLX is calculated. For each element (prediction motion vector candidate) of the predicted motion vector candidate list mvpListLX, the amount of code when encoding these differential motion vectors is calculated. Then, among the elements registered in the predicted motion vector candidate list mvpListLX, the candidate mvpListLX[i] of the predicted motion vector with the smallest amount of code for each candidate of the predicted motion vector is selected as the predicted motion vector mvpLX, and the index i is obtained. When there are multiple candidates for the predicted motion vector with the smallest amount of generated code in the predicted motion vector candidate list mvpListLX, the predicted motion vector candidate mvpListLX[i] represented by the number with the smallest index i in the predicted motion vector candidate list mvpListLX is selected as the optimal predicted motion vector mvpLX, and the index i is obtained.

[0190] Next, the motion vector subtraction unit 328 subtracts the selected predicted motion vector mvpLX of LX from the motion vector mvLX of LX, and sets mvdLX=mvLX-mvpLX to calculate the differential motion vector mvdLX of LX ( Fig.19 Step S105).

[0191] <Normal Prediction Motion Vector Mode Derivation Unit (Normal AMVP): Description on the Decoding Side>

[0192] Next, refer to Fig.25 The processing steps of the normal prediction motion vector mode on the decoding side are described. On the decoding side, the spatial prediction motion vector candidate derivation unit 421, the temporal prediction motion vector candidate derivation unit 422, the historical prediction motion vector candidate derivation unit 423 and the prediction motion vector candidate supplementation unit 425 calculate the motion vector ( Fig.25 Specifically, when the prediction mode PredMode of the processing object block is inter-frame prediction (MODE_INTER), and the inter-frame prediction mode of the processing object block 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 motion vector mvL0 of L0 is calculated. When the inter-frame prediction mode of the processing object block is L1 prediction (Pred_L1), the prediction motion vector candidate list mvpListL1 of L1 is calculated, the prediction motion vector mvpL1 is selected, and the motion vector mvL1 of L1 is calculated. When the inter-frame prediction mode of the processing object block is dual prediction (Pred_BI), L0 prediction and L1 prediction are performed simultaneously, the predicted motion vector candidate list mvpListL0 of L0 is calculated, the predicted motion vector mvpL0 of L0 is selected, the motion vector mvL0 of L0 is calculated, and the predicted motion vector candidate list mvpListL1 of L1 is calculated, the predicted motion vector mvpL1 of L1 is calculated, and the motion vector mvL1 of L1 is calculated respectively.

[0193] Similar to the encoding side, the decoding side also performs motion vector calculation processing on L0 and L1 respectively, but L0 and L1 are common processes. Therefore, in the following description, L0 and L1 are represented as a common LX. LX represents the inter-frame prediction mode used for inter-frame prediction of the coding block of the processing object. In the process of calculating the motion vector of L0, X is 0, and in the process of calculating the motion vector of L1, X is 1. In addition, in the process of calculating the motion vector of LX, when the same reference list as the calculation object LX is not referenced but the information of another reference list is referenced, the other reference list is represented as LY.

[0194] In the case of using the motion vector mvLX of LX ( Fig.25 Step S202: Yes), calculate the candidates for the predicted motion vector of LX, and construct a predicted motion vector candidate list mvpListLX of LX ( Fig.25 Step S203). The spatial prediction motion vector candidate derivation unit 421, the temporal prediction motion vector candidate derivation unit 422, the historical prediction motion vector candidate derivation unit 423, and the prediction motion vector candidate supplementation unit 425 in the normal prediction motion vector mode derivation unit 401 calculate multiple prediction motion vector candidates and construct a prediction motion vector candidate list mvpListLX. Fig.25 The detailed processing steps of step S203 are as follows: Fig. 20 The flowchart is described later.

[0195] Next, the motion vector predictor candidate selection unit 426 extracts the motion vector predictor candidate mvpListLX[mvpIdxLX] corresponding to the motion vector predictor index mvpIdxLX decoded and provided by the bit string decoding unit 201 from the motion vector predictor candidate list mvpListLX as the selected motion vector predictor mvpLX ( Fig.25 Step S204).

[0196] Next, the motion vector addition unit 427 adds the differential motion vector mvdLX of LX decoded by the bitstream decoding unit 201 and the predicted motion vector mvpLX of LX, and calculates the motion vector mvLX of LX by setting mvLX=mvpLX+mvdLX. Fig.25 Step S205).

[0197] <Normal prediction motion vector mode derivation unit (normal AMVP): motion vector prediction method>

[0198] Fig. 20 It is a flowchart showing the processing steps of the normal prediction motion vector mode derivation processing having a common function in the normal prediction motion vector mode derivation unit 301 of the image encoding device and the normal prediction motion vector mode derivation unit 401 of the image decoding device involved in the embodiment of the present invention.

[0199] In the normal prediction motion vector mode export unit 301 and the normal prediction motion vector mode export unit 401, there is a prediction motion vector candidate list mvpListLX. The prediction motion vector candidate list mvpListLX constitutes a list structure, and is provided with a storage area for storing a prediction motion vector index indicating a position inside the prediction motion vector candidate list and a prediction motion vector candidate corresponding to the index as elements. The number of the prediction motion vector index starts from 0, and the prediction motion vector candidates are stored in the storage area of ​​the prediction motion vector candidate list mvpListLX. In this embodiment, it is assumed that the prediction motion vector candidate list mvpListLX can register at least two prediction motion vector candidates (inter-frame prediction information). In addition, the variable numCurrMvpCand indicating the number of prediction motion vector candidates registered in the prediction motion vector candidate list mvpListLX is set to 0.

[0200] The spatial motion vector prediction candidate derivation units 321 and 421 derive candidates for the motion vector prediction from the block adjacent to the left. In this process, the block adjacent to the left ( Fig.11 The inter-frame prediction information of A0 or A1), that is, the flag indicating whether the predicted motion vector candidate can be used, the motion vector, the reference index, etc., is used to derive the predicted motion vector mvLXA, and the derived mvLXA is added to the predicted motion vector candidate list mvpListLX ( Fig. 20 In step S301 of FIG. 10 , X is 0 in the case of L0 prediction and 1 in the case of L1 prediction (the same applies below). Next, the spatial prediction motion vector candidate derivation units 321 and 421 derive candidates for prediction motion vectors from blocks adjacent to the upper side. In this process, the blocks adjacent to the upper side ( Fig.11 The inter-frame prediction information (B0, B1 or B2), that is, the flag indicating whether the predicted motion vector candidate can be used, as well as the motion vector, reference index, etc., is used to derive the predicted motion vector mvLXB. If the respectively derived mvLXA and mvLXB are not equal, mvLXB is added to the predicted motion vector candidate list mvpListLX ( Fig. 20 In step S302), except that the positions and numbers of the referenced adjacent blocks are different, Fig. 20 The processing of steps S301 and S302 is common, and the flag availableFlagLXN indicating whether the predicted motion vector candidate of the coding block can be used, as well as the motion vector mvLXN and the reference index refIdxN (N represents A or B, the same below) are derived.

[0201] Next, the temporal motion vector predictor candidate derivation units 322 and 422 derive candidates for motion vector predictors of blocks in a picture different in time from the current processing target picture. In this process, a flag availableFlagLXCol indicating whether a motion vector predictor candidate of a coding block in a picture at a different time can be used, 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 ( Fig. 20 Step S303).

[0202] Furthermore, it is assumed that the processing of the temporal motion vector predictor candidate derivation units 322 and 422 in units of a sequence (SPS), a picture (PPS), or a slice can be omitted.

[0203] Next, the historical motion vector predictor candidate derivation units 323 and 423 add the historical motion vector predictor candidates registered in the historical motion vector predictor candidate list HmvpCandList to the motion vector predictor candidate list mvpListLX ( Fig. 20 For details of the registration process steps of step S304, see Fig.29 The flowchart is described later.

[0204] Next, the motion vector predictor candidate supplementing units 325 and 425 add motion vector predictor candidates with predetermined values ​​such as (0, 0) until the motion vector predictor candidate list mvpListLX is filled ( Fig. 20 S305).

[0205] <Normal Merge Mode Export Section (Normal Merge)>

[0206] Fig.18 The normal merge mode derivation unit 302 includes a spatial merge candidate derivation unit 341, a temporal merge candidate derivation unit 342, an average merge candidate derivation unit 344, a historical merge candidate derivation unit 345, a merge candidate supplementation unit 346 and a merge candidate selection unit 347.

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

[0208] Fig.21 It is a flowchart for explaining the steps of a normal merge mode derivation process having a common function in the normal merge mode derivation unit 302 of the image encoding device and the normal merge mode derivation unit 402 of the image decoding device involved in the embodiment of the present invention.

[0209] Each process is described in sequence below. In addition, in the following description, unless otherwise specified, the case where the slice type slice_type is a B slice is described, but it can also be applied to the case of a P slice. However, when the slice type slice_type is a P slice, since only L0 prediction (Pred_L0) exists as an inter-frame prediction mode, L1 prediction (Pred_L1) and bi-prediction (Pred_BI) do not exist. Therefore, the processing around L1 can be omitted.

[0210] In the normal merge mode derivation unit 302 and the normal merge mode derivation unit 402, there is a merge candidate list mergeCandList. The merge candidate list mergeCandList constitutes a list structure, and is provided with a merge index indicating the position inside the merge candidate list, and a storage area for storing the merge candidate corresponding to the index as an element. The number of the merge index starts from 0, and the merge candidates are stored in the storage area of ​​the merge candidate list mergeCandList. In subsequent processing, it is assumed that the merge candidate of the merge index i registered in the merge candidate list mergeCandList is represented by mergeCandList[i]. In this embodiment, it is assumed that the merge candidate list mergeCandList can register at least six merge candidates (inter-frame prediction information). In addition, the variable numCurrMergeCand indicating the number of merge candidates registered in the merge candidate list mergeCandList is set to 0.

[0211] In the spatial merging candidate deriving unit 341 and the spatial merging candidate deriving unit 441, based on the coding information stored in the coding information storage memory 111 of the image coding device or the coding information storage memory 205 of the image decoding device, blocks ( Fig.11 The derived spatial merge candidates are registered in the merge candidate list mergeCandList ( Fig.21 Step S401). Here, N is defined to represent any one of B1, A1, B0, A0, B2 or temporal merge candidate Col. The flag availableFlagN indicating whether the inter-frame prediction information of block N can be used as a spatial merge candidate, the reference index refIdxL0N of L0 and the reference index refIdxL1N of L1 of the spatial merge candidate N, the L0 prediction flag predFlagL0N indicating whether L0 prediction is performed, the L1 prediction flag predFlagL1N indicating whether L1 prediction is performed, the motion vector mvL0N of L0, and the motion vector mvL1N of L1 are derived. However, in the present embodiment, since the merge candidate is derived without reference to the inter-frame prediction information of the block included in the coding block to be processed, the spatial merge candidate using the inter-frame prediction information of the block included in the coding block to be processed is not derived.

[0212] Next, in the temporal merge candidate derivation unit 342 and the temporal merge candidate derivation unit 442, temporal merge candidates from pictures at different times are derived, and the derived temporal merge candidates are registered in the merge candidate list mergeCandList ( Fig.21 Step S402). A flag availableFlagCol indicating whether the temporal merge candidate is available, an L0 prediction flag predFlagL0Col indicating whether to perform L0 prediction of the temporal merge candidate, an L1 prediction flag predFlagL1Col indicating whether to perform L1 prediction, and a motion vector mvL0Col of L0 and a motion vector mvL1Col of L1 are derived.

[0213] Furthermore, the processing of the temporal merging candidate deriving unit 342 and the temporal merging candidate deriving unit 442 in units of a sequence (SPS), a picture (PPS), or a slice can be omitted.

[0214] Next, in the historical merge candidate derivation unit 345 and the historical merge candidate derivation unit 445, the historical motion vector prediction candidates registered in the historical motion vector prediction candidate list HmvpCandList are registered in the merge candidate list mergeCandList ( Fig.21 Step S403).

[0215] In addition, when the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList is less than the maximum number of merge candidates MaxNumMergeCand, the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList is used as the upper limit to derive historical merge candidates and register them in the merge candidate list mergeCandList.

[0216] Next, in the average merge candidate derivation unit 344 and the average merge candidate derivation unit 444, the average merge candidate is derived from the merge candidate list mergeCandList, and the derived average merge candidate is added to the merge candidate list mergeCandList ( Fig.21 Step S404).

[0217] In addition, when the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList is less than the maximum number of merge candidates MaxNumMergeCand, the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList is upper bounded by the maximum number of merge candidates MaxNumMergeCand, and the average merge candidate is derived and registered in the merge candidate list mergeCandList.

[0218] Here, the average merge candidate is a new merge candidate having a motion vector obtained by averaging the motion vectors that the first merge candidate and the second merge candidate registered in the merge candidate list mergeCandList have, in each of the L0 prediction and the L1 prediction.

[0219] Next, in the merge candidate supplement unit 346 and the merge candidate supplement unit 446, when the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList is less than the maximum number of merge candidates MaxNumMergeCand, the number of merge candidates numCurrMergeCand registered in the merge candidate list mergeCandList is derived with the maximum number of merge candidates MaxNumMergeCand as the upper limit to add merge candidates, and is registered in the merge candidate list mergeCandList ( Fig.21 Step S405). With the maximum number of merge candidates MaxNumMergeCand as the upper limit, in the P slice, a merge candidate whose prediction mode is L0 prediction (Pred_L0) and whose motion vector has a value of (0, 0) is added. In the B slice, a merge candidate whose prediction mode is bi-prediction (Pred_BI) and whose motion vector has a value of (0, 0) is added. The reference index when adding the merge candidate is different from the reference index that has been added.

[0220] Next, the merge candidate selection unit 347 and the merge candidate selection unit 447 select a merge candidate from the merge candidates registered in the merge candidate list mergeCandList. The merge candidate selection unit 347 on the encoding side selects a merge candidate by calculating the amount of code and the amount of distortion, and provides the merge index representing the selected merge candidate and the inter-frame prediction information of the merge candidate to the motion compensation prediction unit 306 via the inter-frame prediction mode determination unit 305. On the other hand, the merge candidate selection unit 447 on the decoding side selects a merge candidate based on the decoded merge index, and provides the selected merge candidate to the motion compensation prediction unit 406.

[0221] <Update the historical motion vector prediction candidate list>

[0222] Next, a method of initializing and updating the historical motion vector predictor candidate list HmvpCandList included in the encoding information storage memory 111 on the encoding side and the encoding information storage memory 205 on the decoding side will be described in detail. Fig.26 This is a flowchart used to illustrate the steps of initializing / updating the historical prediction motion vector candidate list.

[0223] In this embodiment, it is assumed that the update of the historical motion vector prediction candidate list HmvpCandList is performed in the coding information storage memory 111 and the coding information storage memory 205. Alternatively, a historical motion vector prediction candidate list update unit may be provided in the inter-frame prediction unit 102 and the inter-frame prediction unit 203 to implement the update of the historical motion vector prediction candidate list HmvpCandList.

[0224] The historical prediction motion vector candidate list HmvpCandList is initially set at the beginning of the strip. On the encoding side, when the normal prediction motion vector mode or the normal merge mode is selected by the prediction method determination unit 105, the historical prediction motion vector candidate list HmvpCandList is updated. On the decoding side, when the prediction information decoded by the bit string decoding unit 201 is the normal prediction motion vector mode or the normal merge mode, the historical prediction motion vector candidate list HmvpCandList is updated.

[0225] The inter-frame prediction information used when performing inter-frame prediction in the normal prediction motion vector mode or the normal merge mode is registered in the historical prediction motion vector candidate list HmvpCandList as the inter-frame prediction information candidate hMvpCand. The inter-frame prediction information candidate hMvpCand includes the reference index refIdxL0 of L0 and the reference index refIdxL1 of L1, the L0 prediction flag predFlagL0 indicating whether to perform L0 prediction and the L1 prediction flag predFlagL1 indicating whether to perform L1 prediction, the motion vector mvL0 of L0 and the motion vector mvL1 of L1.

[0226] In the case where there is inter-frame prediction information having the same value as the inter-frame prediction information candidate hMvpCand among the elements (i.e., inter-frame prediction information) registered in the historical prediction motion vector candidate list HmvpCandList in the encoding information storage memory 111 on the encoding side and the encoding information storage memory 205 on the decoding side, the element is deleted from the historical prediction motion vector candidate list HmvpCandList. On the other hand, in the case where there is no inter-frame prediction information having the same value as the inter-frame prediction information candidate hMvpCand, the element at the beginning of the historical prediction motion vector candidate list HmvpCandList is deleted, and the inter-frame prediction information candidate hMvpCand is added to the end of the historical prediction motion vector candidate list HmvpCandList.

[0227] In the present invention, the number of elements of the historical motion vector predictor candidate list HmvpCandList included in the encoding information storage memory 111 on the encoding side and the encoding information storage memory 205 on the decoding side is set to six.

[0228] First, the historical prediction motion vector candidate list HmvpCandList is initialized in slice units ( Fig.26 At the beginning of the slice, all elements of the historical motion vector prediction candidate list HmvpCandList are made empty, and the value of the number of historical motion vector prediction candidates (the current number of candidates) NumHmvpCand registered in the historical motion vector prediction candidate list HmvpCandList is set to 0.

[0229] Furthermore, although the initialization of the historical motion vector prediction candidate list HmvpCandList is performed in slice units (the first coding block of the slice), it may be performed in picture units, in tile units, or in tree block row units.

[0230] Next, the following update process of the historical motion vector prediction candidate list HmvpCandList is repeated for each coding block in the slice ( Fig.26 Steps S2102 to S2107).

[0231] First, the initial setting is performed in units of coding blocks. The flag identicalCandExist indicating whether there is an identical candidate is set to a value of FALSE (false), and the deletion object index removeIdx indicating the candidate for deletion is set to 0 ( Fig.26 Step S2103).

[0232] Determine whether there is an inter-frame prediction information candidate hMvpCand( Fig.26 Step S2104). When the prediction method determination unit 105 on the encoding side determines that it is the normal prediction motion vector mode or the normal merge mode, or when the bit string decoding unit 201 on the decoding side decodes it as the normal prediction motion vector mode or the normal merge mode, the inter-frame prediction information is set as the inter-frame prediction information candidate hMvpCand of the registration object. When the prediction method determination unit 105 on the encoding side determines that it is the intra-frame prediction mode, the sub-block prediction motion vector mode or the sub-block merge mode, or when the bit string decoding unit 201 on the decoding side decodes it as the intra-frame prediction mode, the sub-block prediction motion vector mode or the sub-block merge mode, the historical prediction motion vector candidate list HmvpCandList is not updated, and there is no inter-frame prediction information candidate hMvpCand of the registration object. When there is no inter-frame prediction information candidate hMvpCand of the registration object, steps S2105 to S2106 are skipped ( Fig.26 Step S2104: No). If there is an inter-frame prediction information candidate hMvpCand to be registered, the processing after step S2105 is performed ( Fig.26 Step S2104: Yes).

[0233] Next, it is determined whether there is an element (inter-frame prediction information) with the same value as the inter-frame prediction information candidate hMvpCand of the registration object in each element of the historical prediction motion vector candidate list HmvpCandList, that is, whether there is an identical element ( Fig.26 Step S2105). Fig. 27 Flowchart of the same element confirmation processing steps. When the value of the historical prediction motion vector candidate number NumHmvpCand is 0 ( Fig. 27 Step S2121: No), the historical motion vector prediction candidate list HmvpCandList is empty, and since there is no identical candidate, the process is skipped. Fig. 27 Steps S2122 to S2125 are performed to terminate the same element confirmation processing step. If the value of the historical motion vector prediction candidate number NumHmvpCand is greater than 0 ( Fig. 27 Step S2121: Yes), the historical predicted motion vector index hMvpIdx increases from 0 to NumHmvpCand-1, and the process of step S2123 is repeated ( Fig. 27 First, compare whether the hMvpIdx-th element HmvpCandList[hMvpIdx] of the historical prediction motion vector candidate list, which is counted from 0, is the same as the inter-frame prediction information candidate hMvpCand ( Fig. 27 Step S2123). In the same case ( Fig. 27 Step S2123: Yes), set the flag identicalCandExist indicating whether there is an identical candidate to TRUE, set the deletion object index removeIdx indicating the position of the element to be deleted to the value of the current historical predicted motion vector index hMvpIdx, and end the identical element confirmation process. Fig. 27 Step S2123: No), increase hMvpIdx by 1. If the historical predicted motion vector index hMvpIdx is less than NumHmvpCand-1, perform the processing after step S2123.

[0234] Return again Fig.26 , and performs shifting and adding processing of elements of the historical motion vector prediction candidate list HmvpCandList ( Fig.26 Step S2106). Fig.28 yes Fig.26 Flowchart of the element shifting / adding processing steps of the historical motion vector prediction candidate list HmvpCandList in step S2106. First, it is determined whether to add a new element after removing the element stored in the historical motion vector prediction candidate list HmvpCandList, or to add a new element without removing the element. Specifically, it is compared whether the flag identicalCandExist indicating whether there is an identical candidate is TRUE (true) or whether NumHmvpCand is 6 ( Fig.28 Step S2141). If the flag identicalCandExist indicating whether there is an identical candidate is TRUE (true) or the current number of candidates NumHmvpCand is 6, either ( Fig.28 Step S2141: Yes), remove the elements stored in the historical prediction motion vector candidate list HmvpCandList, and then add new elements. Set the initial value of index i to the value of removeIdx+1. Repeat the element shifting process of step S2143 from this initial value to NumHmvpCand. Fig.28 Steps S2142 to S2144). By copying the elements of HmvpCandList[i] to HmvpCandList[i-1], the elements are shifted forward ( Fig.28 Step S2143), increase i by 1 ( Fig.28 Next, the inter-frame prediction information candidate hMvpCand is added to the (NumHmvpCand-1)th HmvpCandList[NumHmvpCand-1] (NumHmvpCand-1)th HmvpCandList[NumHmvpCand-1] corresponding to the last one in the historical prediction motion vector candidate list. Fig.28 Step S2145) ends the element shifting / adding process of the historical motion vector prediction candidate list HmvpCandList. On the other hand, if the flag identicalCandExist indicating whether there is an identical candidate is TRUE (true) and NumHmvpCand is 6, neither of the conditions is satisfied ( Fig.28 Step S2141: No), without removing the elements stored in the historical motion vector prediction candidate list HmvpCandList, the inter-frame prediction information candidate hMvpCand is added to the end of the historical motion vector prediction candidate list ( Fig.28 Here, the end of the historical motion vector prediction candidate list is HmvpCandList[NumHmvpCand], which is the NumHmvpCand number starting from 0. In addition, NumHmvpCand is increased by 1, and the shifting and adding processing of the elements of the historical motion vector prediction candidate list HmvpCandList is ended.

[0235] FIG. 31A to FIG. 31C 1 is a diagram for explaining an example of updating the historical motion vector prediction candidate list. When a new element is added to the historical motion vector prediction candidate list HmvpCandList in which six elements (inter-frame prediction information) are registered, the elements starting from the front of the historical motion vector prediction candidate list HmvpCandList are compared with the new inter-frame prediction information in sequence ( Fig.31A ), if the new element has the same value as the third element HMVP2 from the beginning of the historical prediction motion vector candidate list HmvpCandList, then the element HMVP2 is deleted from the historical prediction motion vector candidate list HmvpCan dList, and the rear elements HMVP3 to HMVP5 are shifted (copied) one by one to the front, and the new element is added to the end of the historical prediction motion vector candidate list HmvpCandList ( Fig.31B ), complete the update of the historical prediction motion vector candidate list HmvpCandList ( Fig.31C ).

[0236] <Historical motion vector predictor candidate derivation process>

[0237] Next, we will explain in detail Fig. 20 The method of deriving the historical motion vector prediction candidate from the historical motion vector prediction candidate list HmvpCandList in the processing step of step S304, Fig. 20 The processing procedure of step S304 is a common process in 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.29 This is a flowchart illustrating the steps of deriving historical motion vector prediction candidates.

[0238] When the current number of predicted motion vector candidates numCurrMvpCand is greater than the maximum number of elements in the predicted motion vector candidate list mvpListLX (here 2) or the value of the historical number of predicted motion vector candidates NumHmvpCand is 0 ( Fig.29 Step S2201 of No), omitted Fig.29 The processing of steps S2202 to S2209 ends the historical motion vector prediction candidate derivation processing step. When the current number of motion vector prediction candidates numCurrMvpCand is less than the maximum number of elements 2 in the motion vector prediction candidate list mvpListLX and the value of the historical motion vector prediction candidate number NumHmvpCand is greater than 0 ( Fig.29 Step S2201 is), execute Fig.29 Processing of steps S2202 to S2209.

[0239] Next, repeat Fig.29 The processing of steps S2203 to S2208 is repeated until the index i is a smaller value from 1 to 4 and the number of historical prediction motion vector candidates numCheckedHMVPCand ( Fig.29 Steps S2202 to S2209). If the current number of predicted motion vector candidates numCurrMvpCand is greater than the maximum number of elements in the predicted motion vector candidate list mvpListLX, which is 2 ( Fig.29 Step S2203: No), omitted Fig.29 The processing of steps S2204 to S2209 ends the historical motion vector prediction candidate derivation processing step. When the current number of motion vector prediction candidates numCurrMvpCand is less than the maximum number of elements in the motion vector prediction candidate list mvpListLX, 2 ( Fig.29 Step S2203: Yes), execute Fig.29 Processing after step S2204.

[0240] Next, the processing from step S2205 to step S2207 is performed for Y = 0 and 1 (L0 and L1) respectively ( Fig.29 Steps S2204 to S2208). If the current number of predicted motion vector candidates numCurrMvpCand is greater than or equal to the maximum number of elements in the predicted motion vector candidate list mvpListLX, which is 2 ( Fig.29 Step S2205: No), omitted Fig.29 The processing of steps S2206 to S2209 ends the historical motion vector prediction candidate derivation processing step. If the current number of motion vector prediction candidates numCurrMvpCand is less than the maximum number of elements 2 in the motion vector prediction candidate list mvpListLX ( Fig.29 Step S2205: Yes), execute Fig.29 Processing after step S2206 in .

[0241] Next, if there is an element having the same reference index as the reference index refIdxLX of the encoding / decoding target motion vector in the historical prediction motion vector candidate list HmvpCandList and an element that is different from any element in the prediction motion vector list mvpListLX ( Fig.29 Step S2206: Yes), add the motion vector of LY of the historical motion vector prediction candidate HmvpCandList[NumHmvpCand-i] to the numCurrMvpCandth element mvpListLX[numCurrMvpCand] counting from 0 of the motion vector prediction candidate list ( Fig.29 Step S2207), the current number of predicted motion vector candidates numCurrMvpCand is increased by 1. If there is no element with the same reference index as the reference index refIdxLX of the encoding / decoding target motion vector in the historical predicted motion vector candidate list HmvpCandList, and no element is the same as any element in the predicted motion vector list mvpListLX ( Fig.29 Step S2206: No), skip the adding process of step S2207.

[0242] In both L0 and L1, the above Fig.29 The processing of steps S2205 to S2207 ( Fig.29 The index i is increased by 1, and when the index i is less than or equal to 4 and the number of historical motion vector prediction candidates NumHmvpCand, whichever is smaller, the processing after step S2203 is performed again ( Fig.29 Steps S2202~S2209).

[0243] <Historical Merge Candidate Export Processing>

[0244] Next, we will explain in detail Fig.21 The method of deriving historical merge candidates from the historical merge candidate list HmvpCandList in the processing step of step S404, Fig.21 The processing procedure of step S404 is a common process in the historical merge candidate derivation unit 345 of the normal merge mode derivation unit 302 on the encoding side and the historical merge candidate derivation unit 445 of the normal merge mode derivation unit 402 on the decoding side. Fig.30 This is a flowchart illustrating the steps of the historical merge candidate derivation process.

[0245] First, perform initialization processing ( Fig.30 Step S2301). The value of FALSE is set for each of the elements from 0 to the (numCurrMergeCand-1)th element of isPruned[i], and the number of elements numCurrMergeCand registered in the current merge candidate list is set for the variable numOrigMergeCand.

[0246] Next, the initial value of the index hMvpIdx is set to 1, and the index is repeated from the initial value to NumHmvpCand. Fig.30 The addition process from step S2303 to step S2310 ( Fig.30 If the number of elements numCurrMergeCand registered in the current merge candidate list is not less than (the maximum number of merge candidates MaxNumMergeCand-1), the merge candidate is added to all elements in the merge candidate list, and thus the historical merge candidate derivation process is terminated ( Fig.30 If the number of elements numCurrMergeCand registered in the current merge candidate list is less than (the maximum number of merge candidates MaxNumMergeCand-1), the processing after step S2304 is executed. Set the value of FALSE (false) to sameMotion ( Fig.30 Next, the initial value of index i is set to 0, and the index is incremented from the initial value to numOrigMergeCand-1. Fig.30 The processing of steps S2306 and S2307 ( Fig.30 S2305 to S2308). Compare whether the (NumHmvpCand–hMvpIdx)th element HmvpCandList[NumHmvpCand-hMvpIdx] of the historical motion vector prediction candidate list, which is counted from 0, is the same value as the i-th element mergeCandList[i] of the merge candidate list, which is counted from 0. Fig.30 Step S2306).

[0247] The same value of the merge candidate means that the merge candidate has the same value when the values ​​of all the components (inter-frame prediction mode, reference index and motion vector) of the merge candidate are the same. In the case where the merge candidate has the same value and isPruned[i] is FALSE (false) ( Fig.30 In step S2306, sameMotion and isPruned[i] are both set to TRUE (true) ( Fig.30 Step S2307). In the case where the values ​​are not the same ( Fig.30 If the result of step S2306 is No, the processing of step S2307 is skipped. Fig.30 After the repetitive processing of steps S2305 to S2308 is completed, compare whether sameMotion is FALSE (false) ( Fig.30 Step S2309), if sameMotion is FALSE (false) ( Fig.30 In step S2309, since the (NumHmvpCand-hMvpIdx)th element HmvpCandList[NumHvpCand-hMvpIdx] counting from 0 of the historical prediction motion vector candidate list does not exist in mergeCandList, the (NumHmvpCand-hMvpIdx)th element HmvpCandList[NumHmvpCand-hMvpIdx] counting from 0 of the historical prediction motion vector candidate list is added to the mergeCandList[numCurrMergeCand] of the numCurrMergeCand-th merge candidate list, and numCurrMergeCand is increased by 1 ( Fig.30 Step S2310). Increase the index hMvpIdx by 1 ( Fig.30 Step S2302), perform Fig.30 Repeat the processing of steps S2302 to S2311.

[0248] After all elements in the historical prediction motion vector candidate list have been confirmed, or merge candidates have been added to all elements in the merge candidate list, the derivation process of the historical merge candidates is completed.

[0249] <Average Merge Candidate Derivation Process>

[0250] Next, we will explain in detail Fig.21 The method for deriving the average merge candidate of the processing step of step S403, Fig.21 The processing steps of step S403 are common processing in 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.38 This is a flowchart for explaining the steps of deriving average merging candidates.

[0251] First, perform initialization processing ( Fig.38 Step S1301). The variable numOrigMergeCand is set to the number of elements numCurrMergeCand registered in the current merge candidate list.

[0252] Next, scan from the beginning of the merge candidate list to determine two motion information. Set the index i=0 for the first motion information and the index j=0 for the second motion information. Fig.38 If the number of elements numCurrMergeCand registered in the current merge candidate list is not less than (the maximum number of merge candidates MaxNumMergeCand-1), the merge candidate has been added to all elements in the merge candidate list, and thus the historical merge candidate derivation process is terminated ( Fig.38 If the number of elements numCurrMergeCand registered in the current merge candidate list is less than (the maximum number of merge candidates MaxNumMergeCand-1), the processing after step S1305 is performed.

[0253] Determine 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 ( Fig.38 If they are both invalid, then the average merge candidate of mergeCandList[i] and mergeCandList[j] is not derived, and the next element is transferred. If mergeCandList[i] and mergeCandList[j] are not both invalid, then X is set to 0 and 1, and the following process is repeated ( Fig.38 Steps S1306 to S1314).

[0254] Determine whether the LX prediction of mergeCandList[i] is valid ( Fig.38 Step S1307). When the LX prediction of mergeCandList[i] is valid, determine whether the LX prediction of mergeCandList[j] is valid ( Fig.38 Step S1308). If the LX prediction of mergeCandList[j] is valid, that is, if both the LX prediction of mergeCandList[i] and the LX prediction of mergeCandList[j] are valid, an average merge candidate of the LX prediction having the motion vector of the LX prediction and the reference index of the LX prediction of mergeCandList[i] is derived and set as the LX prediction of averageCand, so that the LX prediction of averageCand is valid ( Fig.38 Step S1309). Fig.38 In step S1308, if the LX prediction of mergeCandList[j] is not valid, that is, the LX prediction of mergeCandList[i] is valid and the LX prediction of mergeCandList[j] is invalid, an 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, so that the LX prediction of averageCand is valid ( Fig.38 Step S1310). Fig.38 In step S1307, if the LX prediction of mergeCandList[i] is not valid, it is determined whether the LX prediction of mergeCandList[j] is valid ( Fig.38 Step S1311). If the LX prediction of mergeCandList[j] is valid, that is, if the LX prediction of mergeCandList[i] is invalid and the LX prediction of mergeCandList[j] is valid, then an average merge candidate of the LX prediction with the motion vector and reference index of the LX prediction of mergeCandList[j] is derived and set as the LX prediction of averageCand, making the LX prediction of averageCand valid ( Fig.38 Step S1312). Fig.38 In step S1311, 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, then the LX prediction of averageCand is invalidated ( Fig.38 Step S1312).

[0255] Add the average merge candidate averageCand of the L0 prediction, L1 prediction or BI prediction generated as described above to the numCurrMergeCandth mergeCandList[numCurrMergeCand] in the merge candidate list, and increase numCurrMergeCand by 1 ( Fig.38 The above completes the process of deriving the average merge candidate.

[0256] In addition, the average merge candidate is averaged with the horizontal component of the motion vector and the vertical component of the motion vector respectively.

[0257] <Motion Compensated Prediction Processing>

[0258] The motion compensation prediction unit 306 obtains the position and size of the block that is the object of the current prediction process in the encoding. In addition, the motion compensation prediction unit 306 obtains the inter-frame prediction information from the inter-frame prediction mode determination unit 305. The reference index and the motion vector are derived from the obtained inter-frame prediction information, and after obtaining the image signal of the reference picture specified by the reference index in the decoded image memory 104, the position is moved from the same position as the image signal of the prediction block by the amount of the motion vector, and a prediction signal is generated.

[0259] In the case where the inter-frame prediction mode in the inter-frame prediction is a prediction from a single reference picture such as L0 prediction or L1 prediction, the prediction signal obtained from one reference picture is set as a motion compensation prediction signal. In the case where the inter-frame prediction mode is a prediction from two reference pictures such as BI prediction, the signal obtained by weighted averaging the prediction signals obtained from the two reference pictures is set as a motion compensation prediction signal, and the motion compensation prediction signal is provided to the prediction method determination unit 105. Here, the weighted average ratio of the double prediction is set to 1:1, but other ratios can also be used for weighted averaging. For example, the closer the picture interval between the picture to be predicted and the reference picture, the larger the weighted ratio. In addition, the weighted ratio can also be calculated using a correspondence table of combinations of picture intervals and weighted ratios.

[0260] 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-frame prediction information from the normal prediction motion vector mode derivation unit 401, the normal merge mode derivation unit 402, the sub-block prediction motion vector mode derivation unit 403, and the sub-block merge mode derivation unit 404 through the switch 408. The motion compensation prediction unit 406 supplies the obtained motion compensation prediction signal to the decoded image signal superposition unit 207.

[0261] <About Inter Prediction Mode>

[0262] The process of performing prediction based on a single reference picture is defined as uni-prediction. In the case of uni-prediction, prediction using one of two reference pictures registered in the reference list L0 or L1, such as L0 prediction or L1 prediction, is performed.

[0263] Fig.32 The case where the reference picture (RefL0Pic) of L0 in uni-prediction is before the processing target picture (CurPic) is shown. Fig.33 1 shows the case where the reference picture of L0 prediction in single prediction is at a time after the processing target picture. Fig.32 and Fig.33 The reference picture of L0 prediction is replaced with the reference picture of L1 prediction (RefL1Pic) to perform single prediction.

[0264] The process of performing prediction based on two reference pictures is defined as bi-prediction. In the case of bi-prediction, both L0 prediction and L1 prediction are used to express BI prediction. Fig.34 The case where the reference picture of the L0 prediction in the bi-prediction is at a time before the processing target picture and the reference picture of the L1 prediction is at a time after the processing target picture is shown. Fig.35 The case where the reference picture of the L0 prediction and the reference picture of the L1 prediction in the bi-prediction are at a time point before the processing target picture is shown. Fig.36 The case where the reference picture of the L0 prediction and the reference picture of the L1 prediction in the bi-prediction are at a time point after the processing target picture is shown.

[0265] In this way, the relationship between the prediction type and time of L0 / L1 can be used when L0 is not limited to the past direction and L1 is not limited to the future direction. In addition, in the case of dual prediction, each of L0 prediction and L1 prediction can be performed using the same reference picture. In addition, based on information (e.g., a flag) indicating whether to use L0 prediction and whether to use L1 prediction, it is determined whether to perform motion compensation prediction in single prediction or in dual prediction.

[0266] <About Reference Index>

[0267] In an embodiment of the present invention, in order to improve the accuracy of motion compensation prediction, the best reference picture can be selected from multiple reference pictures in motion compensation prediction. Therefore, the reference picture used in motion compensation prediction is used as a reference index, and the reference index is encoded into the bit stream together with the differential motion vector.

[0268] <Motion compensation processing based on normal motion vector prediction mode>

[0269] As in Fig.16 As also shown in the inter-frame prediction unit 102 on the encoding side, when the inter-frame prediction information based on the normal prediction motion vector mode deriving unit 301 is selected in the inter-frame prediction mode determination unit 305, the motion compensation prediction unit 306 obtains the inter-frame prediction information from the inter-frame prediction mode determination unit 305, derives the inter-frame prediction mode, reference index and motion vector of the block to be currently processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is provided to the prediction method determination unit 105.

[0270] Similarly, as in Fig. 22 As also shown in the inter-frame prediction unit 203 on the decoding side of the decoder, when the switch 408 is connected to the normal prediction motion vector mode deriving unit 401 during the decoding process, the motion compensation prediction unit 406 obtains the inter-frame prediction information based on the normal prediction motion vector mode deriving unit 401, derives the inter-frame prediction mode, reference index and motion vector of the block to be currently processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is provided to the decoded image signal superposition unit 207.

[0271] <Motion compensation processing based on normal merge mode>

[0272] As in Fig.16 As also shown in the inter-frame prediction unit 102 in the encoding side of , when the inter-frame prediction information based on the normal merge mode deriving unit 302 is selected in the inter-frame prediction mode determination unit 305, the motion compensation prediction unit 306 obtains the inter-frame prediction information from the inter-frame prediction mode determination unit 305, derives the inter-frame prediction mode, reference index and motion vector of the block to be currently processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is provided to the prediction method determination unit 105.

[0273] Similarly, as in Fig. 22 As also shown in the inter-frame prediction unit 203 on the decoding side of the decoder, when the switch 408 is connected to the normal merge mode deriving unit 402 during the decoding process, the motion compensation prediction unit 406 obtains the inter-frame prediction information based on the normal merge mode deriving unit 402, derives the inter-frame 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 provided to the decoded image signal superposition unit 207.

[0274] <Motion compensation processing based on sub-block prediction motion vector mode>

[0275] As in Fig.16 As also shown in the inter-frame prediction unit 102 on the encoding side, when the inter-frame prediction information based on the sub-block prediction motion vector mode deriving unit 303 is selected in the inter-frame prediction mode determination unit 305, the motion compensation prediction unit 306 obtains the inter-frame prediction information from the inter-frame prediction mode determination unit 305, derives the inter-frame prediction mode, reference index and motion vector of the block to be currently processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is provided to the prediction method determination unit 105.

[0276] Similarly, as in Fig. 22 As also shown in the inter-frame prediction unit 203 on the decoding side of the decoder, when the switch 408 is connected to the sub-block prediction motion vector mode deriving unit 403 during the decoding process, the motion compensation prediction unit 406 obtains the inter-frame prediction information based on the sub-block prediction motion vector mode deriving unit 403, derives the inter-frame prediction mode, reference index and motion vector of the block to be currently processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is provided to the decoded image signal superposition unit 207.

[0277] <Motion compensation processing based on sub-block merging mode>

[0278] As in Fig.16 As also shown in the inter-frame prediction unit 102 on the encoding side, when the inter-frame prediction information based on the sub-block merging mode deriving unit 304 is selected in the inter-frame prediction mode determination unit 305, the motion compensation prediction unit 306 obtains the inter-frame prediction information from the inter-frame prediction mode determination unit 305, derives the inter-frame prediction mode, reference index and motion vector of the block to be currently processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is provided to the prediction method determination unit 105.

[0279] Similarly, as in Fig. 22 As also shown in the inter-frame prediction unit 203 on the decoding side of the decoder, when the switch 408 is connected to the sub-block merging mode deriving unit 404 during the decoding process, the motion compensation prediction unit 406 obtains the inter-frame prediction information based on the sub-block merging mode deriving unit 404, derives the inter-frame prediction mode, reference index and motion vector of the block to be currently processed, and generates a motion compensation prediction signal. The generated motion compensation prediction signal is provided to the decoded image signal superposition unit 207.

[0280] <Motion compensation processing based on affine transformation prediction>

[0281] In the normal prediction motion vector mode and the normal merge mode, motion compensation based on the affine model can be used based on the following flag. The following flag is reflected in the following flag based on the inter-frame prediction condition determined by the inter-frame prediction mode determination unit 305 in the encoding process and is encoded in the bit stream. In the decoding process, whether to perform motion compensation based on the affine model is determined based on the following flag in the bit stream.

[0282] sps_affine_enabled_flag indicates whether affine model-based motion compensation can be used in inter-frame prediction. If sps_affine_enabled_flag is 0, it is suppressed in sequence units so that affine model-based motion compensation is not used. In addition, inter_affine_flag and cu_affine_type_flag are not transmitted in the CU (coding block) syntax of the coded video sequence. If sps_affine_enabled_flag is 1, affine model-based motion compensation can be used in the coded video sequence.

[0283] sps_affine_type_flag indicates whether motion compensation based on the six-parameter affine model can be used in inter-frame prediction. If sps_affine_type_flag is 0, it is suppressed as motion compensation not based on the six-parameter affine model. In addition, cu_affine_type_flag is not transmitted in the CU syntax of the encoded video sequence. If sps_affine_type_flag is 1, motion compensation based on the six-parameter affine model can be used in the encoded video sequence. In the absence of sps_affine_type_flag, it is set to 0.

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

[0285] When decoding a P slice or a B slice, in the CU that is currently being processed, if cu_affine_type_flag is 1, motion compensation based on a six-parameter affine model is used to generate a motion compensation prediction signal for the CU that is currently being processed. If cu_affine_type_flag is 0, motion compensation based on a four-parameter affine model is used to generate a motion compensation prediction signal for the CU that is currently being processed.

[0286] In motion compensation based on an affine model, since a reference index or a motion vector is derived in units of sub-blocks, a motion compensation prediction signal is generated using the reference index or motion vector to be processed in units of sub-blocks.

[0287] The four-parameter affine model is a mode in which the motion vector of a sub-block is derived from four parameters of the horizontal component and the vertical component of the motion vectors of two control points, and motion compensation is performed in units of sub-blocks.

[0288] <Intra-block copy (IBC)>

[0289] Refer to Figure 39 to explain the valid reference area of ​​intra block copy. Fig.39A This is an example of determining a valid reference area using a coding tree block unit as an intra block copy reference block. Fig.39A 500, 501, 502, 503, 504 are coding tree blocks, and 504 is the coding tree block to be processed. 505 is the coding block to be processed. The processing order of the coding tree blocks is 500, 501, 502, 503, 504. In this case, the three coding tree blocks 501, 502, 503 processed immediately before the coding tree block 504 including the coding block to be processed 505 are used as valid reference areas for the coding block to be processed 505. Regardless of whether the coding tree blocks processed before the coding tree block 501 and the processing before the coding tree block 505 are completed, all areas included in the coding tree block 504 including the coding block to be processed 505 are set as invalid reference areas.

[0290] Fig.39B This is an example of determining a valid reference area using a unit obtained by dividing a coding tree block into four as an intra block copy reference block. Fig.39B 515 and 516 are coding tree blocks, and 516 is the coding tree block to be processed. Coding tree block 515 is divided into 4 parts 506, 507, 508, and 509, and 516 is divided into 4 parts 510, 511, 512, and 513. 514 is the coding block to be processed. The processing order of the intra-block copy reference blocks is 506, 507, 508, 509, 510, 511, 512, and 513. In this case, the three intra-block copy reference blocks 508, 509, and 510 processed immediately before the intra-block copy reference block 511 containing the coding block to be processed 514 are used as valid reference areas for the coding block to be processed 514. Regardless of whether the coding tree blocks processed before the intra-block copy reference block 508 and the processing before the coding block to be processed 514 are completed, all areas included in the intra-block copy reference block 511 containing the coding block to be processed 514 are set as invalid reference areas.

[0291] <Prediction Intra Block Copy: Description on the Encoding Side>

[0292] refer to Fig.44 To illustrate the prediction intra-frame block copy processing steps on the encoding side.

[0293] First, the block vector mvL ( Fig.44 Next, the differential block vector ( ) of the block vector used in the prediction block vector mode is calculated by the IBC spatial block vector candidate derivation unit 371, the IBC historical block vector candidate derivation unit 372, the IBC prediction block vector candidate supplement unit 373, the IBC prediction block vector candidate selection unit 376, and the block vector subtraction unit 378. Fig.44 Steps S4501~S4503).

[0294] Calculate the candidates for the prediction block vector and build the block vector candidate list mvpList( Fig.44 Step S4501). Multiple prediction block vector candidates are derived by the IBC spatial block vector candidate derivation unit 371, the IBC historical block vector candidate derivation unit 372, and the IBC prediction block vector candidate supplementation unit 373 in the intra-frame block copy prediction unit 352 to construct a prediction block vector candidate list mvpList. Fig.47 Flowchart description of Fig.44 Detailed processing steps of step S4501.

[0295] Next, the IBC prediction block vector candidate selection unit 376 selects a prediction block vector mvpL ( Fig.44 Step S4502). Calculate the difference between the block vector mvL and the candidates mvpListL[i] of each prediction block vector stored in the prediction block vector candidate list mvpListL, that is, each differential block vector. Calculate the code amount when encoding these differential block vectors for each element of the prediction block vector candidate list mvpListL. Then, among the elements registered in the prediction block vector candidate list mvpListL, select the candidate mvpListL[i] of the prediction block vector with the smallest code amount for each candidate of the prediction block vector as the prediction block vector mvpL, and obtain its index i. When there are multiple candidates for the prediction block vector with the smallest generated code amount in the prediction block vector candidate list mvpListL, select the candidate mvpListL[i] of the prediction block vector represented by the number with a smaller index i in the prediction block vector candidate list mvpListL as the best prediction block vector mvpL, and obtain the index i.

[0296] Next, in the block vector subtraction unit 378, the selected prediction block vector mvpL is subtracted from the block vector mvL to obtain mvdL=mvL−mvpL, and the difference block vector mvdL ( Fig.44 Step S4503).

[0297] <Prediction Intra Block Copy: Decoding Side Description>

[0298] Next, refer to Fig.45 The prediction block vector mode processing steps on the decoding side are described. On the decoding side, the block vector ( Fig.45 Specifically, a prediction block vector candidate list mvpListL is calculated, a prediction block vector mvpL is selected, and a block vector mvL is calculated.

[0299] Calculate the candidates for the prediction block vector and construct the prediction block vector candidate list mvpListL( Fig.45 Step S4601). The IBC spatial block vector candidate derivation unit 471, the IBC historical block vector candidate derivation unit 472 and the IBC block vector supplementation unit 473 in the intra-frame block copy prediction unit 362 calculate multiple prediction block vector candidates and construct a prediction block vector candidate list mvpListL. Fig.45 Next, the IBC prediction block vector candidate selection unit 476 extracts the candidate mvpListL[mvpIdxL] of the prediction block vector corresponding to the index mvpIdxL of the prediction block vector decoded and provided by the bit string decoding unit 201 from the prediction block vector candidate list mvpListL as the selected prediction block vector mvpL ( Fig.45 Next, the block vector addition unit 478 adds the difference block vector mvdL decoded and provided by the bit string decoding unit 201 and the prediction block vector mvpL to calculate the block vector mvL ( mvL = mvpL + mvdL ) Fig.45 Step S4602).

[0300] <Prediction block vector mode: Block vector prediction method>

[0301] Fig.47 This is a flowchart showing the processing steps of a predicted intra block copy mode derivation process having functions common to the intra block copy prediction unit 352 of the moving picture encoding device and the intra block copy prediction unit 362 of the moving picture decoding device according to the embodiment of the present invention.

[0302] The intra-block copy prediction unit 352 and the intra-block copy prediction unit 362 include a prediction block vector candidate list mvpListL. The prediction block vector candidate list mvpListL forms a list structure, and is provided with a prediction block vector index indicating a position inside the prediction block vector candidate list, and a storage area for storing the prediction block vector candidates corresponding to the index as elements. The number of the prediction block vector index starts from 0, and the prediction block vector candidates are stored in the storage area of ​​the prediction block vector candidate list mvpListL. In the present embodiment, the prediction block vector candidate list mvpListL can register 3 prediction block vector candidates. In addition, the variable numCurrMvpIbcCand indicating the number of prediction block vector candidates registered in the prediction block vector candidate list mvpListL is set to 0.

[0303] The IBC spatial block vector candidate derivation units 371 and 471 derive candidates for the prediction block vector from the block adjacent to the left ( Fig.47 In this process, availableFlagLA, which indicates whether the prediction block vector candidate of the left adjacent block (A0 or A1) can be used, and block vector mvLA are derived, and mvLA is added to the prediction block vector candidate list mvpListL. Subsequently, the IBC spatial block vector candidate derivation units 371 and 471 derive candidates for the prediction block vector from the upper adjacent block (B0, B1, or B2). Fig.47 In this process, a flag availableFlagLB indicating whether the prediction motion vector candidate of the block adjacent to the upper side can be used and a block vector mvLB are derived. If mvLA is not equal to mvLB, mvLB is added to the prediction block vector candidate list mvpListL. Fig.47 The processing of steps S4801 and S4802 is common except that the position and number of adjacent blocks to be referenced are different, and the flag availableFlagLN indicating whether the prediction block vector candidate of the coding block can be used and the motion vector mvLN (N is A or B, the same below) are derived.

[0304] Next, the IBC historical block vector candidate derivation units 372 and 472 add the historical block vector candidates registered in the historical block vector candidate list HmvpIbcCandList to the prediction block vector candidate list mvpListL. Fig.47 For details of the registration process of step S4803, see Fig.29 In the description of the actions shown in the flowchart, the description is omitted because the actions are the same as those in the case where the motion vector is set to a block vector, the list of reference indices is set to L0, and the historical predicted motion vector candidate list HmvpCandList is set to the historical block vector candidate list HmvpIbcCandList.

[0305] Next, the IBC prediction block vector supplementing units 373 and 473 add block vectors of predetermined values ​​such as (0, 0) until the prediction block vector candidate list mvpListL is filled ( Fig.47 S4804).

[0306] <Merge Intra Block Copy Mode Derivation Section>

[0307] Fig.42 The intra-frame block copy prediction unit 352 includes an IBC spatial block vector candidate derivation unit 371, an IBC historical block vector candidate derivation unit 372, an IBC block vector supplement unit 373, a reference position correction unit 380, a reference area boundary correction unit 381, an IBC merge candidate selection unit 374 and an IBC prediction mode determination unit 377.

[0308] Fig.43 The intra-frame block copy prediction unit 362 includes an IBC spatial block vector candidate derivation unit 471, an IBC historical block vector candidate derivation unit 472, an IBC block vector supplement unit 473, an IBC merge candidate selection unit 474, a reference position correction unit 480, a reference area boundary correction unit 481 and a block copy unit 477.

[0309] Fig.46 This is a flowchart for explaining the steps of a merged intra block copy mode derivation process having a common function in the intra block copy prediction unit 352 of the moving picture encoding device and the intra block copy prediction unit 362 of the moving picture decoding device according to the embodiment of the present invention.

[0310] The intra block copy prediction unit 352 and the intra block copy prediction unit 362 include a merge intra block copy candidate list mergeIbcCandList. The merge intra block copy candidate list mergeIbcCandList forms a list structure, and is provided with a merge index indicating the position inside the merge intra block copy candidate, and a storage area for storing the merge intra block copy candidate corresponding to the index as an element. The number of the merge index starts from 0, and the merge intra block copy candidate is stored in the storage area of ​​the merge intra block copy candidate list mergeIbcCandList. In subsequent processing, the merge candidate of the merge index i registered in the merge intra block copy candidate list mergeIbcCandList is represented as mergeIbcCandList[i]. In this embodiment, it is assumed that the merge candidate list mergeCandList can register at least 3 merge intra block copy candidates. In addition, the variable numCurrMergeIbcCand indicating the number of merge intra block copy candidates registered in the merge intra block copy candidate list mergeIbcCandList is set to 0.

[0311] In the IBC spatial block vector candidate derivation unit 371 and the IBC spatial block vector candidate derivation unit 471, spatial merge candidates A and B from blocks adjacent to the left and the top of the processing target block are derived from the coding information stored in the coding information storage memory 111 of the moving picture coding device or the coding information storage memory 205 of the moving picture decoding device, and the derived spatial merge candidates are registered in the merge intra block copy candidate list mergeIbcCandList ( Fig.46 Step S4701). Here, N representing any one of the spatial merge candidates A and B is defined. A flag availableFlagN and a block vector mvL indicating whether the intra-block copy prediction information of block N can be used as a spatial block vector merge candidate N are derived. However, in this embodiment, since block vector merge candidates are derived without reference to other coding blocks included in the block including the coding block to be processed, spatial block vector merge candidates included in the block including the coding block to be processed are not derived.

[0312] Next, in the IBC historical block vector candidate derivation unit 372 and the IBC historical block vector candidate derivation unit 472, the historical prediction block vector candidates registered in the historical prediction block vector candidate list HmvpIbcCandList are added to the merged intra block copy candidate list mergeIbcCandList ( Fig.46 In the present embodiment, when the block vector already added to mergeIbcCandList has the same value as the block vector of the historical prediction block vector candidate, it is not added to mergeIbcCandList.

[0313] Next, when the number of merge candidates numCurrMergeIbcCand registered in the merged intra block copy candidate list mergeIbcCandList is less than the maximum number of intra block merge candidates MaxNumMergeIbcCand, the IBC prediction block vector supplement unit 373 and the IBC prediction block vector supplement unit 473 use the number of merge candidates numCurrMergeIbcCand registered in the merged intra block copy candidate list mergeIbcCandList as the maximum number of merge candidates MaxNumMergeIbcCand as the upper limit to derive additional intra block merge candidates, and register them in the merged intra block copy candidate list mergeIbcCandList ( Fig.46 Step S4703). With the maximum merge candidate number MaxNumMergeIbcCand as the upper limit, the block vector having the value of (0, 0) is added to the merge intra block copy candidate list mergeIbcCandList.

[0314] Next, in the IBC merge candidate selection unit 374 and the IBC merge candidate selection unit 474, one intra block merge candidate is selected from the intra block copy candidate registered in the merge intra block copy candidate list mergeIbcCandList ( Fig.46 The IBC merge candidate selection unit 374 obtains the decoded image at the reference position from the decoded image memory 104, calculates the code amount and the distortion amount to select a merge candidate, and provides the merge index representing the selected intra-block merge candidate to the IBC prediction mode determination unit 377. The IBC prediction mode determination unit 377 selects whether it is a merge mode by calculating the code amount and the distortion amount, and provides the result to the prediction method determination unit 105. On the other hand, the IBC merge candidate selection unit 474 on the decoding side selects an intra-block merge candidate based on the decoded merge index, and provides the selected intra-block merge candidate to the reference position correction unit 480.

[0315] Next, the reference position correction unit 380 and the reference position correction unit 480 perform a process of correcting the reference position on the intra block merging candidate ( Fig.46 The details of the processing of the reference position correction unit 380 and the reference position correction unit 480 will be described later.

[0316] Next, the reference area boundary correction unit 381 and the reference area boundary correction unit 481 perform a process of correcting the reference area boundary on the intra block merging candidate ( Fig.46 The details of the processing of the reference position correction unit 381 and the reference position correction unit 481 will be described later.

[0317] The block copy section 477 acquires the decoded image of the reference position from the decoded image memory 208, and supplies the decoded image signal to the decoded image signal superimposing section 207. Here, in the block copy section 477, the luminance component and the color difference component are copied.

[0318] The block vector mvL above represents the block vector of brightness. The block vector mvC of color difference becomes:

[0319] mvC=((mvL>>(3+2))*32. Through the above formula, the x and y components of mvC are processed separately.

[0320] <Reference position correction unit>

[0321] Fig.48 1 is a flowchart for explaining the processing of the reference position correction section 380 and the reference position correction section 480. Currently, it is assumed that the unit of the intra block copy reference block is a coding tree block (CTU), and the size thereof is not 128×128 pixels.

[0322] First, the upper left and lower right positions of the reference block are calculated (S6001). The reference block refers to the block that the processing target coding block refers to using the block vector. When the upper left of the reference block is set to (xRefTL, yRefTL) and the lower right of the reference block is set to (xRefBR, yRefBR), it becomes:

[0323] (xRefTL, yRefTL)=(xCb+(mvL[0]>>4), yCb+(mvL[1]>>4))

[0324] (xRefBR, yRefBR) = (xRefTL + cbWidth-1, yRefTL + cbHeight-1). Here, the position of the processing target coding block is set to (xCb, yCb), the block vector is set to (mvL[0], mvL[1]), the width of the processing target coding block is set to cbWidth, and the height is set to cbHeight.

[0325] Next, it is determined whether the size of the CTU is 128×128 pixels (S6002). Currently, its size is not 128×128 pixels (S6002: No), so the positions of the upper left and lower right of the referenceable area are calculated (S6003). When the upper left of the referenceable area is set as (xAvlTL, yAvlTL) and the lower right is set as (xAvlBR, yAvlBR), it becomes:

[0326] NL = Min(1, 7 - CtbLog2SizeY) - (1 << ((7 - CtbLog2SizeY) << 1))

[0327] (xAvlTL, yAvlTL) = ((((xCb >> CtbLog2SizeY) + NL) << CtbLog2SizeY,

[0328] (yCb >> CtbLog2SizeY) << CtbLog2SizeY)

[0329] (xAvlBR, yAvlBR) = ((((xCb >> CtbLog2SizeY) << CtbLog2SizeY) - 1,

[0330] ((((yCb >> CtbLog2SizeY) + 1) << CtbLog2SizeY) - 1). Here, the size of the CTU is CtbLog2SizeY.

[0331] Next, it is determined whether the reference position in the x direction of the reference block is smaller than the upper left of the referenceable area (S6004). If the determination is false (S6004: No), the process proceeds to the next process (S6006). On the other hand, if the determination is true (S6004: Yes), the reference position in the x direction is corrected to be the same as the upper left of the referenceable area (S6005).

[0332] Fig.49 It is a diagram showing the case of correcting the reference position. 6001 represents the coding tree block to be processed, 6002 represents the coding block to be processed, and 6003 represents the referenceable area. Currently, if the reference block r2 is at 6011, the reference position in the x direction is smaller than the upper left of the referenceable area (S6004: Yes). Therefore, xRefTL = xAvlTL is set, and the reference position is corrected to the position at 6012 (S6005). Here, as shown in S6001, since xRefBR = xRefTL + cbWidth - 1, as xRefTL is corrected, xRefBR is also corrected. In the correction of this reference position, the block vector mvL[0] can also be corrected. That is, it is corrected to:

[0333] mvL[0]=(xAvlTL-xCb)<<4. Therefore, xRefTL=xAvlTL, and thus the reference position can be corrected.

[0334] In this way, even when the reference block is located outside the referenceable area, reference can be made by correcting the reference position.

[0335] Currently, it is assumed that some block vectors in the block vector candidate list constructed in the intra-frame block copy prediction unit 352 are located outside the referenceable area. Without correcting the reference position, reference based on these block vectors cannot be made, and therefore these block vectors cannot be used as candidates for the IBC merge mode. On the other hand, in the case of correcting the reference position in the present invention, all block vectors in the constructed block vector candidate list are located inside the referenceable area. Therefore, reference based on all block vectors can be made, and all block vectors can be set as candidates for the IBC merge mode. Therefore, the IBC merge mode selection unit 374 can select the best prediction mode from the candidates for each IBC merge mode corresponding to all block vectors, thereby improving the encoding efficiency.

[0336] At present, it is assumed that some block vectors in the block vector candidate list constructed in the intra-frame block copy prediction unit 362 are located outside the referenceable area. If the reference position is not corrected, reference based on these block vectors cannot be made, and therefore the IBC merge mode using these block vectors cannot be decoded. In an encoding device other than the present invention, a merge index indicating the IBC merge mode using these block vectors acts as an index that is not encoded. However, due to an operation failure, etc., there is a possibility that such a merge index is encoded to generate a bit stream. Or, due to a packet loss, etc., a part of the bit stream is missing, etc., and the decoding result may become such a merge index. If such an incomplete bit stream is to be decoded, there is a possibility that the decoded image memory of an incorrect position is accessed by referring to the outside of the referenceable area. As a result, depending on the decoding device, the decoding result is different, or the decoding process stops. On the other hand, in the case of correcting the reference position in the present invention, all block vectors in the constructed block vector candidate list are located inside the referenceable area. Therefore, even if such an incomplete bit stream is decoded, the reference position is corrected to the inside of the referenceable area and can be referenced. In this way, the memory access range is guaranteed by correcting the reference position. As a result, the decoding result of the decoding device remains the same and the decoding process can be continued, thereby improving the robustness of the decoding device.

[0337] In addition, when the block vector is corrected in the correction of the reference position, the object is the block vector of luminance. Here, the block vector of chrominance is calculated from the block vector of luminance. That is, if the block vector of luminance is corrected, the block vector of chrominance is also corrected. Therefore, it is not necessary to correct the reference position again in chrominance. Compared with the case where it is necessary to determine whether both luminance and chrominance can be used for reference without correcting the block vector, the amount of processing can be reduced.

[0338] In addition, when the block vector is corrected in the correction of the reference position, the corrected block vector is stored in the coding information storage memory 111 or the coding information storage memory 205 as the block vector of the processing object coding block. That is, the corrected reference position and the position indicated by the block vector are the same. Here, when the decoding result is stored in the decoded image memory, a deblocking filter process is sometimes performed. In this filtering process, the strength of the filter is controlled according to the difference between the block vectors of the two blocks facing the block boundary. In the case where the block vector is not corrected, compared with the case where the corrected reference position and the position indicated by the block vector are different, the coding efficiency can be improved because the filter strength is more appropriate.

[0339] Next, it is determined whether the reference position in the y direction of the reference block is smaller than the upper left of the referenceable area (S6006). If the determination is false (S6006: No), the next process is entered (S6008). On the other hand, if the determination is true (S6006: Yes), the reference position in the y direction is corrected to be consistent with the upper left of the referenceable area (S6007).

[0340] Currently, if the reference block r4 is located at 6021, the reference position in the y direction is smaller than the upper left of the referenceable area (S6006: Yes). Therefore, yRefTL is set to yAvlTL, and the reference position is corrected to the position of 6022 (S6007). Here, as shown in S6001, since yRefBR=yRefTL+cbHeight-1, yRefBR is also corrected as yRefTL is corrected. In the correction of this reference position, the block vector mvL[1] can also be corrected. That is, the correction is:

[0341] mvL[1]=(yAvlTL-yCb)<<4. Thus, yRefTL=yAvlTL is achieved, and thus the reference position can be corrected.

[0342] Next, it is determined whether the reference position in the x direction of the reference block is larger than the lower right of the referenceable area (S6008). If the determination is false (S6008: No), the next process is entered (S6010). On the other hand, if the determination is true (S6008: Yes), the reference position in the x direction is corrected to be consistent with the lower right of the referenceable area (S6009).

[0343] Currently, if the reference block r7 is located at 6031, the reference position in the x direction is larger than the lower right corner of the referenceable area (S6008: Yes). Therefore, xRefBR is set to xAvlBR, and the reference position is corrected to the position of 6032 (S6009). Here, as shown in S6001, since xRefBR = xRefTL + cbWidth-1, that is, xRefTL = xRefBR-(cbWidth-1), xRefTL is also corrected as xRefBR is corrected. In the correction of this reference position, the block vector mvL[0] can also be corrected. That is, the correction is:

[0344] mvL[0]=(xAvlBR-(xCb+cbWidth-1))<<4. Thus, xRefBR=xAvlBR is achieved, and thus the reference position can be corrected.

[0345] Next, it is determined whether the reference position in the y direction of the reference block is larger than the lower right of the referenceable area (S6010). If the determination is false (S6010: No), the process ends. On the other hand, if the determination is true (S6010: Yes), the reference position in the y direction is corrected to be consistent with the lower right of the referenceable area (S6011).

[0346] Currently, if the reference block r5 is located at 6041, the reference position in the y direction is larger than the lower right corner of the referenceable area (S6010: Yes). Therefore, yRefBR is set to yAvlBR, and the reference position is corrected to the position of 6042 (S6011). Here, as shown in S6001, since yRefBR = yRefTL + cbHeight-1, that is, yRefTL = yRefBR-(cbHeight-1), yRefTL is also corrected as yRefBR is corrected. In the correction of this reference position, the block vector mvL[1] can also be corrected. That is, the correction is:

[0347] mvL[1]=(yAvlBR-(yCb+cbHeight-1))<<4. Thus, yRefBR=yAvlBR is achieved, and the reference position can be corrected.

[0348] Here, the case where the reference block r1 is located at 6051 is described. In this case, the reference position in the x direction is corrected in the same manner as the case where the reference block is r2. Also, the reference position in the y direction is corrected in the same manner as the case where the reference block is r4. As a result, the reference block r1 is located at 6052 which is inside the referenceable area.

[0349] When reference block r3 is located at 6061, reference block r6 is located at 6062, and reference block r8 is located at 6063, the reference positions in the x and y directions are corrected in the same manner as described above. As a result, each reference block is located inside the referenceable area.

[0350] Thus, the processing ends when the CTU size is not 128×128 pixels. On the other hand, when the CTU size is 128×128 pixels ( S6002 : Yes), the upper left and lower right positions of the rectangular reference area are calculated ( S6012 ).

[0351] FIG. 50 is a diagram for explaining the upper left and lower right positions when the referenceable area is set to a rectangular shape. Fig.50A In the case of , the coding tree block 6101 of the processing object is divided into 4 parts, and the coding block 6102 of the processing object is located in the upper left of the division. At this time, the reference area becomes an inverted L shape as shown in the oblique line portion in 6103. When the reference area is set to a rectangular shape, its range is set to the rectangular range of 6103. When the reference area is set to a rectangular shape, if the upper left of the reference block is set to (xRefTL, yRefTL) and the lower right is set to (xRefBR, yRefBR), it becomes:

[0352] offset[4]={0, 64, 128, 128}

[0353] NL=-offset[3-blk_idx], NR=offset[blk_idx]

[0354] (xAvlTL,yAvlTL)=((xCb>>CtbLog2SizeY)< <CtbLog2SizeY+NL,

[0355] (yCb>>CtbLog2SizeY)< <CtbLog2SizeY)

[0356] (xAvlBR,yAvlBR)=(((xCb>>CtbLog2SizeY)< <CtbLog2SizeY)-1+NR,

[0357] (((yCb>>CtbLog2SizeY)+1)< <CtbLog2SizeY)-1)。

[0358] Here, blk_idx is an index indicating the position of the coding block of the processing object. After the coding tree block of the processing object is divided into 4, if the coding block of the processing object is located in the upper left, blk_idx is set to 0. Similarly, if the coding block of the processing object is located in the upper right, lower left, and lower right, blk_idx is set to 1, 2, and 3 respectively. Fig.50A is a diagram showing the case where blk_idx = 0. Similarly, FIG. 50B to FIG. 50D These diagrams respectively show the cases where blk_idx=1 to 3.

[0359] Next, the reference position of the portion of the referenceable area that is not a rectangle is corrected (S6013). Fig.51 50. This is a flowchart for explaining the process of correcting the reference position of the part of the reference area that is not a rectangle. First, the upper left position of the reference area is calculated (S6021). The reference area is the oblique line portion of FIG. 50, so except for the case where blk_idx=3, the upper left position has two points, 6111 and 6112. If they are respectively set to (X1, Y1) and (X2, Y2), it becomes:

[0360] offset[4]={64, 128, 64, 0}, NL=offset[blk_idx]

[0361] (X1, Y1)=(xAvlTL, yAvlTL+64)

[0362] (X2, Y2)=(xAvlTL+NL, yAvlTL).

[0363] Next, it is determined whether the reference position is corrected in accordance with the upper left of the referenceable area (S6022). In this determination, if blk_idx=3 is not true and the reference block is located in an area smaller than X2 and Y1, it is determined to be true (S6022: Yes). If it is false (S6022: No), the next process is entered (S6026).

[0364] Next, it is determined whether the difference between the reference block and the referenceable area in the x direction is smaller than the difference between the reference block and the referenceable area in the y direction (S6023). If the determination is true (S6023: Yes), the reference position in the x direction is corrected (S6024). On the other hand, if the determination is false (S6023: No), the reference position in the y direction is corrected (S6025).

[0365] Fig.52A : is a diagram showing the case of correcting the reference position in S6024 and S6025. Currently, blk_idx=0. If the reference block r1 is located at 6201, blk_idx=3 is not, and the upper left corner of the reference block is located in an area smaller than X2 (x direction of 6112) and Y1 (y direction of 6111) (S6022: Yes). In addition, the difference between the reference block and the referenceable area in the x direction is smaller than the difference between the reference block and the referenceable area in the y direction (S6023: Yes). Therefore, set xRefTL=xAvlTL+NL, and correct the reference position in the x direction to the position of 6202 (S6024). Here, as shown in S6001, since xRefBR=xRefTL+cbWidth-1, xRefBR is also corrected as xRefTL is corrected. In the correction of this reference position, the block vector mvL[0] can also be corrected. That is, the correction is:

[0366] mvL[0]=(xAvlTL+NL-xCb)<<4. Therefore, xRefTL=xAvlTL+NL is obtained, and thus the reference position can be corrected.

[0367] On the other hand, if the reference block r2 is located at 6203, blk_idx=3 is not set, and the upper left corner of the reference block is located in an area smaller than X2 (the x direction of 6112) and Y1 (the y direction of 6111) (S6022: Yes). In addition, the difference between the reference block and the reference area in the x direction is not less than the difference between the reference block and the reference area in the y direction (S6023: No). Therefore, yRefTL=yAvlTL+64 is set to correct the reference position in the y direction to the position of 6204 (S6025). Here, as shown in S6001, since yRefBR=yRefTL+cbHeight-1, yRefBR is also corrected as yRefTL is corrected. In the correction of this reference position, the block vector mvL[0] can also be corrected. That is, the correction is:

[0368] mvL[1]=(yAvlTL+64-yCb)<<4. Thus, yRefTL=yAvlTL+64 is obtained, and thus the reference position can be corrected.

[0369] Here, it is assumed that the reference block r3 is located at 6205. In this case, the difference between the reference block and the referenceable region in the x direction is smaller than the difference between the reference block and the referenceable region in the y direction (S6023: Yes). Therefore, by correcting the reference position in the x direction in the same way as the reference block r1, it is located at 6206 (S6024). At this moment, the reference block is outside the referenceable region. However, by the processing of S6006 and S6007 described later, the reference position in the y direction is corrected. As a result, the reference block becomes inside the referenceable region.

[0370] Next, the lower right position of the reference area is calculated (S6026). The reference area is the shaded area in FIG50, so except for the case where blk_idx=0, the lower right position is 6113 and 6114. If they are respectively set to (X3, Y3) and (X4, Y4), then:

[0371] offset[4]={0, 64, 128, 64}, NR=offset[blk_idx]

[0372] (X3, Y3) = (xAvlBR, yAvlBR-64)

[0373] (X4, Y4)=(xAvlBR-NR, yAvlBR).

[0374] Next, it is determined whether the reference position is corrected to coincide with the lower right of the referenceable area (S6027). In this determination, if blk_idx is not 0 and the reference block is located in an area larger than X4 and Y3, the determination is true (S6027: Yes). If it is false (S6027: No), the process ends.

[0375] Next, it is determined whether the difference between the reference block and the referenceable area in the x direction is smaller than the difference between the reference block and the referenceable area in the y direction (S6028). If the determination is true (S6028: Yes), the reference position in the x direction is corrected (S6029). On the other hand, if the determination is false (S6028: No), the reference position in the y direction is corrected (S6030).

[0376] Fig.52B : is a diagram showing the case of correcting the reference position in S6029 and S6030. Currently, blk_idx=3. If the reference block r1 is located at 6211, blk_idx=0 is not, and the lower right corner of the reference block is located in an area larger than X4 (x direction of 6114) and Y3 (y direction of 6113) (S6027: Yes). In addition, the difference between the reference block and the referenceable area in the x direction is smaller than the difference between the reference block and the referenceable area in the y direction (S6028: Yes). Therefore, set xRefBR=xAvlBR, and correct the reference position in the x direction to the position of 6212 (S6029). Here, as shown in S6001, since xRefBR=xRefTL+cbWidth-1, that is, xRefTL=xRefBR-(cbWidth-1), xRefTL is also corrected as xRefBR is corrected. In the correction of this reference position, the block vector mvL[0] can also be corrected. That is, the correction is:

[0377] mvL[0]=(xAvlBR-NR-(xCb+cbWitdh-1))<<4. Therefore, xRefBR=xAvlBR is achieved, and thus the reference position can be corrected.

[0378] On the other hand, if the reference block r2 is located at 6213, blk_idx=0 is not set, and the lower right corner of the reference block is located in an area larger than X4 (the x direction of 6114) and Y3 (the y direction of 6113) (S6027: Yes). In addition, the difference between the reference block and the reference area in the x direction is not less than the difference between the reference block and the reference area in the y direction (S6028: No). Therefore, yRefBR=yAvlBR is set to correct the reference position in the y direction to the position of 6214 (S6030). Here, as shown in S6001, since yRefBR=yRefTL+cbHeight-1, that is, yRefTL=yRefBR-(cbHeight-1), yRefTL is also corrected as yRefBR is corrected. In the correction of this reference position, the block vector mvL[1] can also be corrected. That is, the correction is:

[0379] mvL[1]=(yAvlBR-64-(yCb+cbHeight-1))<<4. Thus, yRefBR=yAvlBR is achieved, and the reference position can be corrected.

[0380] Here, it is assumed that the reference block r3 is located at 6215. In this case, the difference between the reference block and the referenceable area in the x direction is not smaller than the difference between the reference block and the referenceable area in the y direction (S6028: No). Therefore, by correcting the reference position in the y direction in the same way as the reference block r2, it is located at 6216 (S6030). At this moment, the reference block is outside the referenceable area. However, by the processing of S6008 and S6009 described later, the reference position in the x direction is corrected. As a result, the reference block becomes inside the referenceable area.

[0381] 52 , the process of correcting the reference position is described by taking the case of blk_idx=0 and 3 as an example. In the case of blk_idx=1 or 2, the process of correcting the reference position is performed in the same manner as in the case of blk_idx=0 and 3.

[0382] After the process of correcting the reference position of the portion of the referenceable area that is not a rectangle ( S6013 ), the processes of S6004 to S6011 are performed. Thus, the process when the size of the CTU is 128×128 pixels ends.

[0383] At present, it is assumed that in the process of correcting the reference position of the portion of the referenceable area that is not a rectangle (S6013), the process of correcting the reference position in the x direction (S6024) is performed in accordance with the upper left of the referenceable area. Therefore, the reference position in the x direction of the reference block does not become smaller than the upper left of the referenceable area, and therefore the determination of S6004 is always false (S6004: No). Therefore, in the case where the process of S6024 is performed, the processes of S6004 and S6005 may not be performed. Similarly, in the case where the process of S6025 is performed, the processes of S6006 and S6007 may not be performed, in the case where the process of S6029 is performed, the processes of S6008 and S6009 may not be performed, and in the case where the process of S6030 is performed, the processes of S6010 and S6011 may not be performed.

[0384] In addition, Fig.51 In the flowchart of FIG. 1 , the comparison process of step S6023 can be omitted, and a structure in which step S6024 is always executed can be adopted, or a structure in which step S6025 is always executed can be adopted. Similarly, the comparison process of step S6028 can be omitted, and a structure in which step S6029 is always executed can be adopted, or a structure in which step S6030 is always executed can be adopted. In such a structure, the reference position can be corrected by a simple process.

[0385] exist Fig.48 In the case where the size of the CTU is 128×128 pixels, the reference position is corrected by using the processes of S6012, S6013, and S6004 to S6011. Fig.53 As shown, this can also be achieved by decomposing the referenceable area into two and correcting the processing (S6101) of each reference position.

[0386] FIG. 54 is a diagram for explaining the case where the reference area is decomposed into two. Unlike the case where the reference area is set to a rectangular shape in FIG. 50, the reference area is decomposed into two in FIG. 54. After the coding tree block (6101) of the processing object is divided into four, when the coding block (6102) of the processing object is located in the upper left, blk_idx is set to 0. Similarly, when the coding blocks of the processing object are located in the upper right, lower left, and lower right, blk_idx is set to 1, 2, and 3. Fig.54A is a diagram showing the case where blk_idx = 0. Similarly, FIG. 54B to FIG. 54D The diagrams respectively show the cases where blk_idx = 1 to 3. In addition, one referenceable region (6301) is set as referenceable region A, and the other referenceable region (6302) is set as referenceable region B.

[0387] Fig.55 4 is a flowchart for explaining the process (S6101) of dividing the referenceable area into two and correcting each reference position. Fig.55 In, with Fig.48 The same processing is marked with the same step number and the description is omitted. First, the upper left and lower right positions of the reference area A are calculated (S6111). When the upper left of the reference area A is set to (xAvlTL, yAvlTL) and the lower right of the reference area A is set to (xAvlBR, yAvlBR), it becomes:

[0388] xOffsetTL[4]={-128,-128,-64,0}, yOffsetTL[4]={64,64,64,0}

[0389] xOffsetBR[4]={0, 0, 0, 128}, yOffsetBR[4]={128, 128, 128, 64}

[0390] (xAvlTL,yAvlTL)=((xCb>>CtbLog2SizeY)< <CtbLog2SizeY+xOffsetTL[blk_idx],

[0391] (yCb>>CtbLog2SizeY)< <CtbLog2SizeY+yOffsetTL[blk_idx])

[0392] (xAvlBR,yAvlBR)=(((xCb>>CtbLog2SizeY)< <CtbLog2SizeY)-1

[0393] +xOffsetBR[blk_idx],

[0394] (((yCb>>CtbLog2SizeY+1)< <CtbLog2SizeY)-1+yOffsetBR[blk_idx]。

[0395] Next, whether the reference block is outside the reference area A is calculated as follows (S6112).

[0396] out_xRefTL=xRefTL <xAvlTL

[0397] out_yRefTL=yRefTL <yAvlTL

[0398] out_xRefBR=xRefBR>xAvlBR

[0399] out_yRefBR=yRefBR>yAvlBR

[0400] Next, the upper left and lower right positions of the reference area B are calculated (S6113). When the upper left of the reference area B is set to (xAvlTL, yAvlTL) and the lower right of the reference area B is set to (xAvlBR, yAvlBR), it becomes:

[0401] xOffsetTL[4]={-64,0,0,0}, yOffsetTL[4]={0,0,0,0}

[0402] xOffsetBR[4]={0, 64, 128, 64}, yOffsetBR[4]={128, 64, 64, 128}

[0403] (xAvlTL,yAvlTL)=((xCb>>CtbLog2SizeY)< <CtbLog2SizeY+xOffsetTL[blk_idx],

[0404] (yCb>>CtbLog2SizeY)< <CtbLog2SizeY+yOffsetTL[blk_idx])

[0405] (xAvlBR,yAvlBR)=(((xCb>>CtbLog2SizeY)< <CtbLog2SizeY)-1

[0406] +xOffsetBR[blk_idx],

[0407] (((yCb>>CtbLog2SizeY)+1)< <CtbLog2SizeY)-1+yOffsetBR[blk_idx])。

[0408] Next, it is determined whether the reference position in the x direction of the reference block is smaller than the upper left of the referenceable region A and whether the reference position in the x direction of the reference block is smaller than the upper left of the referenceable region B (S6114). If the determination is false (S6114: No), the next process is entered (S6116). On the other hand, if the determination is true (S6114: Yes), the reference position in the x direction is corrected in accordance with the upper left of the referenceable region B (S6005). The process of S6005 has been described, so the description is omitted.

[0409] Subsequently, it is determined whether the reference position in the y direction of the reference block is smaller than the upper left of the referenceable region A and whether the reference position in the y direction of the reference block is smaller than the upper left of the referenceable region B (S6116). If the determination is false (S6116: No), the next process is entered (S6118). On the other hand, if the determination is true (S6116: Yes), the reference position in the y direction is corrected in accordance with the upper left of the referenceable region B (S6007). The process of S6007 has been described, so the description is omitted.

[0410] Next, it is determined whether the reference position in the x direction of the reference block is larger than the lower right of the reference area A and whether the reference position in the x direction of the reference block is larger than the lower right of the reference area B (S6118). If the determination is false (S6118: No), the next process is entered (S6120). On the other hand, if the determination is true (S6118: Yes), the reference position in the x direction is corrected to be consistent with the lower right of the reference area B (S6009). Since the process of S6009 has been described, the description is omitted.

[0411] Next, it is determined whether the reference position in the y direction of the reference block is larger than the lower right of the reference area A and whether the reference position in the y direction of the reference block is larger than the lower right of the reference area B (S6120). If the determination is false (S6120: No), the process is terminated (S6120). On the other hand, if the determination is true (S6120: Yes), the reference position in the y direction is corrected to be consistent with the lower right of the reference area B (S6011). Since the process of S6011 has been described, the description is omitted.

[0412] Thus, when the size of the CTU is 128×128 pixels, even if the reference block is located outside the reference area, the reference position can be corrected for reference. In addition, by decomposing the reference area into two and correcting each reference position, the processing can be simplified and the amount of calculation can be reduced. Here, one reference area (6301) is set as reference area A, and the other reference area (6302) is set as reference area B. Alternatively, the reference area A and the reference area B can be swapped, and one reference area (6301) can be set as reference area B, and the other reference area (6302) can be set as reference area A for processing.

[0413] In this embodiment, it is determined whether the size of the CTU is 128×128 pixels (S6002) and the process is switched. This can determine whether the intra block copy reference block is a unit obtained by dividing the coding tree block into four, and can also determine whether the size of the CTU is larger than the maximum size of the coding block.

[0414] All the above-described embodiments may be combined in multiple forms.

[0415] In all the above-described embodiments, the bit stream output by the image encoding device has a specific data format so that it can be decoded according to the encoding method used in the embodiment. The bit stream can be provided by recording in a recording medium such as an HDD, SSD, flash memory, or optical disk that can be interpreted by a computer, or it can be provided from a server via a wired or wireless network. Therefore, the image decoding device corresponding to the image encoding device can decode the bit stream of the specific data format without using a providing means.

[0416] In the case of using a wired or wireless network for exchanging a bit stream between an image encoding device and an image decoding device, the bit stream may be converted into a data format suitable for the transmission form of the communication line for transmission. In this case, a transmitting device is provided, which converts the bit stream output from the image encoding device into coded data in a data format suitable for the transmission form of the communication line and transmits the coded data to the network; and a receiving device is provided, which receives the coded data from the network and restores the coded data to a bit stream and provides it to the image decoding device. The transmitting device includes: a memory that buffers the bit stream output from the image encoding device; a packet processing unit that packets the bit stream; 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 performs packet processing on the coded data to generate a bit stream, and provides the bit stream to the image decoding device.

[0417] In order to exchange bit streams between an image encoding device and an image decoding device, in addition to a transmitting device and a receiving device, a relay device may be provided to receive the encoded data sent by the transmitting device and provide the encoded data to the receiving device when a wired or wireless network is used. The relay device includes: a receiving unit that receives the packetized encoded data sent by the transmitting device; a memory that buffers the received encoded data; and a transmitting unit that transmits the packetized encoded data to the network. In addition, the relay device may also include: a receiving packet processing unit that performs packet processing on the packetized encoded data to generate a bit stream; a recording medium that stores the bit stream; and a sending packet processing unit that packets the bit stream.

[0418] In addition, a display unit for displaying the image decoded by the image decoding device may be added to the configuration to serve as a display device. In this case, the display unit reads the decoded image signal generated by the decoded image signal superimposing unit 207 and stored in the decoded image memory 208, and displays it on the screen.

[0419] In addition, a photographing unit may be added to the configuration, and the photographed image may be input to the image encoding device to serve as the photographing device. In this case, the photographing unit inputs the photographed image signal to the block division unit 101 .

[0420] Fig.37 An example of the hardware structure of the coding and decoding device of this embodiment is shown. The coding and decoding device includes the structure of the image coding device and the image decoding device involved in the embodiment of the present invention. The coding and 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 part is connected via a bus 9010.

[0421] The image coding unit 9007 and the image decoding unit 9008 are typically implemented as a codec IC 9002. The image coding process of the image coding device according to the embodiment of the present invention is performed by the image coding unit 9007, and the image decoding process in the image decoding device according to the embodiment of the present invention is performed by the image decoding unit 9008. The I / O interface 9003 is realized by, for example, a USB interface, and is connected to an external keyboard 9104, a mouse 9105, etc. The CPU 9001 controls the coding and decoding device 9000 based on the user operation input through the I / O interface 9003 so as to perform the action desired by the user. As the operation performed by the user through the keyboard 9104, the mouse 9105, etc., there are selection of which function of coding and decoding is to be performed, setting of coding quality, input and output destination of bit stream, input and output destination of image, etc.

[0422] When a user wishes to reproduce an image recorded in the disk recording medium 9100, the optical disk drive 9005 reads a bit stream from the inserted disk recording medium 9100 and transmits the read bit stream to the image decoding unit 9008 of the codec IC 9002 via the bus 9010. The image decoding unit 9008 performs image decoding processing in the image decoding device according to the embodiment of the present invention on the input bit stream, and transmits the decoded image to the external monitor 9103 via the video interface 9009. In addition, the coding and decoding device 9000 has a network interface 9006 and can be connected to an external distribution server 9106 and a portable terminal 9107 via a network 9101. When a user wishes to reproduce an image recorded on the distribution server 9106 or the mobile terminal 9107 instead of the image recorded on the disk recording medium 9100, the network interface 9006 obtains a bit stream from the network 9101 instead of reading the bit stream from the input disk recording medium 9100. Furthermore, when a user wishes to reproduce an image recorded in the memory 9004 , the image decoding process in the image decoding device according to the embodiment of the present invention is performed on the bit stream recorded in the memory 9004 .

[0423] In the case of an operation in which a user wishes to encode an image captured by an external camera 9102 and record it in the memory 9004, the video interface 9009 inputs the image from the camera 9102 and sends it to the image encoding unit 9007 of the codec IC 9002 via the bus 9010. The image encoding unit 9007 performs the image encoding process in the image encoding device involved in the embodiment of the present invention on the image input via the video interface 9009, and generates a bit stream. Then, the bit stream is sent to the memory 9004 via the bus 9010. When the user wishes to record the bit stream on the disk recording medium 9100 instead of the memory 9004, the optical disk drive 9005 reads and writes the bit stream with respect to the inserted disk recording medium 9100.

[0424] 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 may be realized. Such a hardware configuration may be realized by replacing the codec IC 9002 with the image encoding unit 9007 or the image decoding unit 9008, for example.

[0425] The processing related to the above encoding and decoding can of course be implemented as a transmission, storage and reception device using hardware, and can be implemented by firmware stored in a ROM (read only memory), flash memory, etc. or software of a computer, etc. The firmware program or software program can be provided by recording it in a recording medium readable by a computer, etc., or provided from a server via a wired or wireless network, or provided as a data broadcast of a terrestrial wave or satellite digital broadcast.

[0426] The present invention has been described above based on the embodiments. The embodiments are for illustration only, and it is understood by those skilled in the art that various modifications may be made to the combinations of the constituent elements and the processing steps, and such modifications are also within the scope of the present invention.

[0427] Industrial Applicability

[0428] The present invention can be used in image encoding and decoding technology for dividing an image into blocks and performing prediction.

[0429] Explanation of symbols

[0430] 100 image encoding device, 101 block division unit, 102 inter-frame prediction unit, 103 intra-frame prediction unit, 104 decoded image memory, 105 prediction method determination unit, 106 residual generation unit, 107 orthogonal transformation / quantization unit, 108 bit string encoding unit, 109 inverse quantization / inverse orthogonal transformation unit, 110 decoded image signal overlapping unit, 111 coding information storage memory, 200 image decoding device, 201 bit string decoding unit, 202 block division unit, 203 inter-frame prediction unit, 204 intra-frame prediction unit, 205 coding information storage memory, 206 inverse quantization / inverse orthogonal transformation unit, 207 decoded image signal overlapping unit, 208 decoded image memory.< / poc>

Claims

1. An image encoding device for encoding using intra-frame block copy reference blocks as units, characterized in that: include: The block vector candidate list generating unit derives block vector candidates of a processing target block in a processing target picture from the coding information stored in the coding information storage memory, and generates a block vector candidate list. a spatial block vector candidate derivation unit that adds a predicted block vector predicted based on a block adjacent to the processing target block to the block vector candidate list; A selection unit, selecting a selected block vector from the block vector candidate list; an encoding unit, encoding a block vector index, wherein the block vector index indicates a position of the selected block vector in the block vector candidate list; a reference position correction unit, for a reference block referenced by the selected block vector, correcting a reference position of the reference block so as to refer to an interior of a referenceable area; as well as a prediction unit that acquires decoded pixels in the processing target picture from a decoded image memory as prediction values ​​of the processing target block based on a reference position of the reference block, The reference position correction unit uses a fixed number of intra-block copy reference blocks that have been encoded immediately before the intra-block copy reference block containing the processing object block as a reference area, and sets the intra-block copy reference block before the reference area and the intra-block copy reference block containing the processing object block as an invalid reference area regardless of whether the encoding process is completed.

2. A method for encoding an image, wherein encoding is performed in units of intra-frame block copy reference blocks, characterized in that: include: a block vector candidate list generating step of deriving block vector candidates of a processing target block in a processing target picture from the coding information stored in the coding information storing memory, and generating a block vector candidate list; a spatial block vector candidate derivation step of adding a predicted block vector predicted based on a block adjacent to the processing target block to the block vector candidate list; A selection step, selecting a selected block vector from the block vector candidate list; An encoding step of encoding a block vector index, wherein the block vector index indicates a position of the selected block vector in the block vector candidate list; A reference position correction step, for a reference block referenced by the selected block vector, correcting the reference position of the reference block so as to refer to the inside of the referenceable area; as well as A prediction step of acquiring decoded pixels in the processing target picture from a decoded image memory as prediction values ​​of the processing target block based on a reference position of the reference block, In the reference position correction step, a fixed number of intra-block copy reference blocks that are encoded and processed immediately before the intra-block copy reference block containing the processing object block are used as reference areas, and regardless of whether the encoding process is completed, the intra-block copy reference block before the reference area and the intra-block copy reference block containing the processing object block are set as invalid reference areas.

3. An image decoding device, which performs decoding in units of intra-block copy reference blocks, characterized in that: include: The block vector candidate list generating unit derives block vector candidates of a processing target block in a processing target picture from the coding information stored in the coding information storage memory, and generates a block vector candidate list. a spatial block vector candidate derivation unit that adds a predicted block vector predicted based on a block adjacent to the processing target block to the block vector candidate list; a decoding unit that decodes a block vector index, wherein the block vector index indicates a position of a selected block vector in the block vector candidate list; A selection unit, selecting the selected block vector from the block vector candidate list based on the block vector index; a reference position correction unit, for a reference block referenced by the selected block vector, correcting a reference position of the reference block so as to refer to an interior of a referenceable area; as well as a prediction unit, which obtains decoded pixels in the processing target picture from a decoded image memory based on a reference position of the reference block as a prediction value of the processing target block, The reference position correction unit uses a fixed number of intra-block copy reference blocks that have been decoded and processed immediately before the intra-block copy reference block containing the processing object block as a reference area, and sets the intra-block copy reference block before the reference area and the intra-block copy reference block containing the processing object block as an invalid reference area regardless of whether the decoding process is completed.

4. A method for decoding an image, wherein decoding is performed in units of intra-block copy reference blocks, characterized in that: include: a block vector candidate list generating step of deriving block vector candidates of a processing target block in a processing target picture from the coding information stored in the coding information storing memory, and generating a block vector candidate list; a spatial block vector candidate derivation step of adding a predicted block vector predicted based on a block adjacent to the processing target block to the block vector candidate list; An encoding step of encoding a block vector index, wherein the block vector index indicates a position of a selected block vector in the block vector candidate list; A selection step, selecting the selected block vector from the block vector candidate list based on the block vector index; A reference position correction step, for a reference block referenced by the selected block vector, correcting the reference position of the reference block so as to refer to the inside of the referenceable area; as well as A prediction step of acquiring decoded pixels in the processing target picture from a decoded image memory based on a reference position of the reference block as a prediction value of the processing target block, In the reference position correction step, a fixed number of intra-block copy reference blocks that are decoded and processed immediately before the intra-block copy reference block containing the processing object block are used as reference areas, and regardless of whether the decoding process is completed, the intra-block copy reference blocks before the reference area and the intra-block copy reference block containing the processing object block are set as invalid reference areas.

5. A storage method for storing a bit stream generated by the image encoding method according to claim 2 in a recording medium.

6. A transmission method for transmitting a bit stream generated by the image encoding method according to claim 2.

Citation Information

Cited By

  • Space boundary calibration method and device and measurement equipment

    CN122708709A