Video encoding / decoding method and apparatus, medium

By deriving a candidate merging method and using a list of motion information in the predicted region to detect redundancy, the problem of increased data volume in high-efficiency video services is solved, and the inter-frame prediction efficiency of video signal encoding/decoding is improved.

CN121037560BActive Publication Date: 2026-07-21GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2019-11-08
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing video coding technologies suffer from a significant increase in data volume in high-efficiency video services, and the compression performance of HEVC has gradually revealed its limitations.

Method used

By deriving merge candidates from the list of predicted region motion information, the redundancy between the predicted region merge candidates included in the list of predicted region motion information and the merge candidates in the list of merge candidates is detected. Merge candidates for the blocks included in the merge processing area are then derived, and the motion information of the current block is derived based on the list of merge candidates.

Benefits of technology

It improves the efficiency of inter-frame prediction, simplifies the redundancy detection between prediction region merging candidates, and enhances the efficiency of video signal encoding/decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121037560B_ABST
    Figure CN121037560B_ABST
Patent Text Reader

Abstract

The present application relates to a video encoding / decoding method and device, medium. Based on the neighboring block of the current block, the spatial merge candidate of the current block is derived; based on the block in the reference image, the temporal merge candidate of the current block is derived; based on the derived spatial merge candidate and temporal merge candidate, the merge candidate list of the current block is derived; when the number of merge candidates in the merge candidate list is less than the first threshold, whether a prediction region merge candidate included in the prediction region motion information list is added to the merge candidate list is determined based on conditions. In response to determining that the prediction region merge candidate is added to the merge candidate list, the prediction region merge candidate is added to the merge candidate list; based on the merge candidate list, the motion information of the current block is derived; based on the derived motion information, the current block is motion compensated.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of Chinese patent application No. 201980063279.9, entitled "Image Signal Encoding / Decoding Method and Apparatus", which entered the Chinese national phase of PCT international patent application PCT / KR2019 / 015199 filed on November 8, 2019.

[0002] Cross-references to related applications

[0003] This application is based on and claims priority to Korean Patent Application No. 10-2018-0136308, filed on November 8, 2018, the entire contents of which are incorporated herein by reference.

[0004] This application is based on and claims priority to Korean Patent Application No. 10-2018-0148874, filed on November 27, 2018, the entire contents of which are incorporated herein by reference. Technical Field

[0005] This invention relates to video signal encoding / decoding methods and devices. Background Technology

[0006] With the trend of increasingly larger display panels, there is a growing need for higher-quality video services. The biggest problem with high-definition video services is the significant increase in data volume. To address this issue, research is actively underway to improve video compression rates. As a representative example, in 2009, the Moving Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) of the International Telecommunication Union-Telecommunication (ITU-T) established the Joint Collaborative Team on Video Coding (JCT-VC). JCT-VC proposed the video compression standard HEVC (High Efficiency Video Coding), which was approved on January 25, 2013, and its compression performance is approximately twice that of H.264 / AVC. However, with the rapid development of high-definition video services, the limitations of HEVC have gradually become apparent. Summary of the Invention

[0007] Technical problems to be solved

[0008] The purpose of this invention is to provide a method for deriving merging candidates using a list of predicted region motion information when encoding / decoding video signals, and an apparatus for performing said method.

[0009] The purpose of this invention is to provide a redundancy detection method for detecting the redundancy between prediction region merging candidates included in the prediction region motion information list and merging candidates included in the merging candidate list when encoding / decoding video signals.

[0010] The purpose of this invention is to provide a method for deriving merging candidates of blocks included in a merging processing region when encoding / decoding video signals, and an apparatus for performing said method.

[0011] The technical problems to be solved by the present invention are not limited to those mentioned above, and those skilled in the art to which the present invention pertains will clearly understand other technical problems not mentioned through the following description.

[0012] Technical solution

[0013] The video signal decoding / encoding method according to the present invention includes the following steps: deriving merging candidates of the current block from neighboring blocks; adding the derived merging candidates to a merging candidate list; and when the number of merging candidates already added to the merging candidate list is less than a threshold, adding at least one predicted region merging candidate included in the predicted region motion information list to the merging candidate list; deriving motion information of the current block based on the merging candidate list; and performing motion compensation on the current block based on the derived motion information. In this case, it can be determined whether to add the predicted region merging candidate to the merging candidate list based on a comparison result between the motion information of the predicted region merging candidate and the motion information of the merging candidates included in the merging candidate list.

[0014] In the video signal decoding / encoding method according to the present invention, the comparison can be performed on at least one merging candidate in the merging candidate list whose index is less than or equal to a threshold.

[0015] In the video signal decoding / encoding method according to the present invention, the comparison can be performed on at least one of the merge candidates derived from the left adjacent block located to the left of the current block or the merge candidates derived from the upper adjacent block located above the current block.

[0016] In the video signal decoding / encoding method according to the present invention, when it is determined that there is a merging candidate with the same motion information as the first prediction region merging candidate in the merging candidate list, the first prediction region merging candidate is not added to the merging candidate list, and it can be determined whether to add the second prediction region merging candidate to the merging candidate list based on the comparison result between the motion information of the second prediction region merging candidate included in the prediction region motion information list and the motion information of the merging candidate included in the merging candidate list.

[0017] In the video signal decoding / encoding method according to the present invention, the determination of whether the motion information of the second prediction region merging candidate is the same as the motion information of the merging candidate having the same motion information as the first prediction region merging candidate can be skipped.

[0018] In the video signal decoding / encoding method according to the present invention, the difference between the number of prediction region merging candidates included in the prediction region merging candidates and the index of the prediction region merging candidates is less than or equal to a threshold.

[0019] The video signal decoding / encoding method according to the present invention may further include the following steps: adding a current prediction region merging candidate derived based on the motion information of the current block to the prediction region motion information list. In this case, when there is a prediction region merging candidate that is the same as the current prediction region merging candidate, the prediction region merging candidate that is the same as the current prediction region merging candidate can be deleted, and the maximum index can be assigned to the current prediction region merging candidate.

[0020] The features briefly outlined above are merely exemplary embodiments of the invention as described in the detailed description to follow, and do not limit the scope of the invention.

[0021] Beneficial effects

[0022] According to the present invention, inter-frame prediction efficiency can be improved by providing a method for deriving merging candidates using a list of motion information in the predicted region.

[0023] According to the present invention, the efficiency of inter-frame prediction can be improved by simplifying the detection of redundancy between prediction region merging candidates.

[0024] According to the present invention, inter-frame prediction efficiency can be improved by providing a method for deriving merging candidates of blocks included in the merging processing region.

[0025] The effects that can be obtained in this invention are not limited to those described above, and other effects not mentioned will be clearly understood by those skilled in the art through the following description. Attached Figure Description

[0026] Figure 1 This is a block diagram of a video encoder according to an embodiment of the present invention.

[0027] Figure 2 This is a block diagram of a video decoder according to an embodiment of the present invention.

[0028] Figure 3 This is a diagram illustrating the basic coding tree unit of an embodiment of the present invention.

[0029] Figure 4(a) , 4(b) Figures 4(c), 4(d), and 4(e) are diagrams illustrating various partitioning types of coded blocks.

[0030] Figure 5 This is a diagram illustrating the partitioning pattern of the coding tree unit.

[0031] Figure 6 This is a flowchart of the inter-frame prediction method according to an embodiment of the present invention.

[0032] Figure 7 It is a diagram showing the nonlinear motion of an object.

[0033] Figure 8 This is a flowchart illustrating an inter-frame prediction method based on affine motion according to an embodiment of the present invention.

[0034] Figure 9 This is a diagram showing an example of the affine seed vector for each affine motion model.

[0035] Figure 10 This is a diagram showing an example of the affine vectors of a sub-block under a 4-parameter motion model.

[0036] Figure 11 This is a flowchart of the process of exporting motion information of the current block in merge mode.

[0037] Figure 12 This is a diagram showing an example of a candidate block used to derive merge candidates.

[0038] Figure 13 This is a diagram showing the location of the reference sample.

[0039] Figure 14 This is a diagram showing an example of a candidate block used to derive merge candidates.

[0040] Figure 15 This is a diagram illustrating an example of changing the position of a reference sample.

[0041] Figure 16 This is a diagram illustrating an example of changing the position of a reference sample.

[0042] Figure 17 It is a flowchart illustrating the process of updating the list of motion information for the predicted region.

[0043] Figure 18 This is a diagram illustrating an example of updating the candidate list for merging predicted regions.

[0044] Figure 19 This is a diagram illustrating an example of updating the index of a stored predicted region merging candidate.

[0045] Figure 20 This is a diagram showing the location of representative sub-blocks.

[0046] Figure 21 A diagram showing an example of generating a list of motion information for the predicted region for each inter-frame prediction mode is provided.

[0047] Figure 22 This is a diagram illustrating an example of adding predicted region merging candidates included in the long-term motion information list to the merge candidate list.

[0048] Figure 23 This is a diagram illustrating an example of performing redundancy detection only on some merge candidates.

[0049] Figure 24 This is a diagram illustrating an example of skipping redundant checks on a specific merge candidate.

[0050] Figure 25 This is a diagram illustrating an example of setting candidate blocks included in the same merge processing area as the current block as unusable as merge candidates.

[0051] Figure 26 This is a diagram showing a list of temporary motion information.

[0052] Figure 27 This is a diagram illustrating an example of merging the list of predicted regional motion information and the temporary motion information list.

[0053] Figure 28 and Figure 29 This is a diagram illustrating an example of address information for candidate blocks in a coded region merging scheme.

[0054] Figure 30 and Figure 31 This is a diagram illustrating an example of setting a merge candidate for an encoded region with the same address information as the current block as an unusable merge candidate for the current block. Detailed Implementation

[0055] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[0056] Video encoding and decoding are performed on a block-by-block basis. For example, encoding / decoding processes such as transform, quantization, prediction, in-loop filtering, or reconstruction can be performed on encoded blocks, transform blocks, or prediction blocks.

[0057] Hereinafter, the block to be encoded / decoded will be referred to as the "current block". For example, depending on the current encoding / decoding process step, the current block can represent an encoded block, a transform block, or a prediction block.

[0058] Additionally, as used herein, the term "unit" refers to a basic unit used to perform a specific encoding / decoding process, and "block" can be understood as representing a sample array of a predetermined size. Unless otherwise stated, "block" and "unit" are used interchangeably. For example, in the embodiments described later, encoding block and encoding unit can be understood to have the same meaning.

[0059] Figure 1 This is a block diagram of a video encoder according to an embodiment of the present invention.

[0060] Reference Figure 1 The video encoding device 100 may include an image segmentation unit 110, a prediction unit 120 and 125, a transformation unit 130, a quantization unit 135, a rearrangement unit 160, an entropy coding unit 165, an inverse quantization unit 140, an inverse transformation unit 145, a filter unit 150, and a memory 155.

[0061] Figure 1 The components shown are illustrated individually to illustrate the distinct functionalities of the video encoding device and do not imply that each component is composed of separate hardware or a single software component. That is, for ease of explanation, the components are arranged such that at least two components are combined into one, or one component is divided into multiple components, thereby performing functions. Such embodiments of integrated components and embodiments of separated components are also within the scope of this invention, provided they do not depart from its spirit.

[0062] Furthermore, some structural elements are not essential structural elements for performing the essential functions of this invention, but rather optional structural elements used only to improve performance. This invention can be implemented by including only the components necessary for realizing the essence of the invention, excluding the structural elements used only to improve performance, and structures including only the essential structural elements, excluding the optional structural elements used only to improve performance, are also within the scope of this invention.

[0063] The image partitioning unit 110 can divide the input image into at least one processing unit. In this case, the processing unit can be a prediction unit (PU), a transformation unit (TU), or a coding unit (CU). The image partitioning unit 110 divides an image into a combination of multiple coding units, prediction units, and transformation units, and can select a combination of coding units, prediction units, and transformation units to encode the image based on a predetermined criterion (e.g., a cost function).

[0064] For example, an image can be divided into multiple coding units. To segment an image into coding units, a recursive tree structure such as a quadtree structure can be used. A video or the largest coding unit can be used as the root, and the coding unit can be divided into additional coding units with a number of child nodes equivalent to the number of coding units in the division. Coding units that are no longer divided according to certain constraints become leaf nodes. That is, when it is assumed that a coding unit can only be divided into squares, a coding unit can be divided into a maximum of four other coding units.

[0065] In the embodiments of the present invention, the encoding unit may mean a unit that performs encoding, or it may mean a unit that performs decoding.

[0066] A prediction unit within a coding unit can be divided into at least one shape of the same size, such as a square or a rectangle, or a prediction unit within a coding unit can be divided into shapes and / or sizes different from those of another prediction unit.

[0067] When the prediction unit for intra-frame prediction based on the coding unit is not the smallest coding unit, intra-frame prediction can be performed without splitting into multiple prediction units N×N.

[0068] Prediction units 120 and 125 may include an inter-frame prediction unit 120 that performs inter-frame prediction and an intra-frame prediction unit 125 that performs intra-frame prediction. It can be determined whether inter-frame prediction or intra-frame prediction is used for the prediction unit, and specific information (e.g., intra-frame prediction mode, motion vectors, reference image, etc.) is determined based on each prediction method. In this case, the processing unit performing the prediction may be different from the processing unit that determines the prediction method and specific content. For example, the prediction unit may determine the prediction method and prediction mode, and the transformation unit may perform the prediction. The residual value (residual block) between the generated prediction block and the original block can be input to the transformation unit 130. Furthermore, the prediction mode information, motion vector information, etc., used for prediction, along with the residual value, can be encoded in the entropy coding unit 165 and transmitted to the decoder. When using a specific coding mode, the original block can also be directly encoded and transmitted to the decoder without generating a prediction block through prediction units 120 and 125.

[0069] The inter-frame prediction unit 120 can predict prediction units based on information from at least one of the previous or next images of the current image. In some cases, it can also predict prediction units based on information from a portion of the encoded region within the current image. The inter-frame prediction unit 120 may include a reference image interpolation unit, a motion prediction unit, and a motion compensation unit.

[0070] The reference image interpolation unit receives reference image information from memory 155 and can generate pixel information of integer pixels or less from the reference image. For luminance pixels, in order to generate pixel information of integer pixels or less in 1 / 4 pixel units, an 8th-order DCT-based interpolation filter with different filter coefficients can be used. For chrominance signals, in order to generate pixel information of integer pixels or less in 1 / 8 pixel units, a 4th-order DCT-based interpolation filter with different filter coefficients can be used.

[0071] The motion prediction unit can perform motion prediction based on a reference image interpolated by the reference image interpolation unit. Various methods can be used to calculate motion vectors, such as the Full Search-based Block Matching Algorithm (FBMA), the Three-Step Search (TSS), and the New Three-Step Search Algorithm (NTS). Motion vectors can have values ​​in units of 1 / 2 pixel or 1 / 4 pixel based on the interpolated pixels. Different motion prediction methods can be used in the motion prediction unit to predict the current prediction unit. These methods include skipping, merging, Advanced Motion Vector Prediction (AMVP), and Intra Block Copying.

[0072] The intra-prediction unit 125 can generate prediction units based on reference pixel information surrounding the current block, which serves as pixel information within the current image. When the neighboring block of the current prediction unit is a block that has already undergone inter-frame prediction, and the reference pixel is a pixel that has undergone inter-frame prediction, the reference pixel included in the block that has undergone inter-frame prediction can be used as the reference pixel information for the surrounding block that has undergone intra-frame prediction. That is, when a reference pixel is unavailable, at least one of the available reference pixels can be used to replace the unavailable reference pixel information.

[0073] In intra-frame prediction, the prediction mode can have an angular prediction mode that uses reference pixel information in the prediction direction and a non-angular mode that does not use direction information when performing prediction. The mode used to predict luminance information and the mode used to predict chrominance information can be different. To predict chrominance information, either the intra-frame prediction mode information used for predicting luminance information or the predicted luminance signal information can be applied.

[0074] When performing intra-frame prediction, if the size of the prediction unit is the same as the size of the transform unit, intra-frame prediction can be performed based on pixels to the left, upper left, and upper right of the prediction unit. However, when performing intra-frame prediction, if the size of the prediction unit is different from the size of the transform unit, intra-frame prediction can be performed using reference pixels based on the transform unit. Furthermore, intra-frame prediction using an N×N partition only for the smallest coding unit can be applied.

[0075] Intra-prediction methods can generate prediction blocks after applying an Adaptive Intra Smoothing (AIS) filter to a reference pixel based on the prediction mode. The type of AIS filter used for the reference pixel may vary. To perform intra-prediction, the intra-prediction mode of the current prediction unit can be predicted from the intra-prediction modes of prediction units existing in the vicinity of the current prediction unit. When using mode information predicted from surrounding prediction units to predict the prediction mode of the current prediction unit, if the intra-prediction modes of the current prediction unit and those of the surrounding prediction units are the same, predetermined flag information can be used to convey information indicating that the prediction modes of the current prediction unit and those of the surrounding prediction units are the same. If the prediction modes of the current prediction unit and those of the surrounding prediction units are different, entropy coding can be performed to encode the prediction mode information of the current block.

[0076] Furthermore, a residual block can be generated that includes residual value information, which is the difference between the original block of the prediction unit and the prediction unit that performs prediction based on the prediction unit generated in the prediction units 120 and 125. The generated residual block can be input to the transformation unit 130.

[0077] In the transform unit 130, transform methods such as Discrete Cosine Transform (DCT) or Discrete Sine Transform (DST) can be used to transform the original block and the residual block, which includes residual information between the prediction units generated by the prediction units 120 and 125. The DCT transform kernel includes at least one of DCT2 or DCT8, and the DST transform kernel includes DST7. Whether to apply DCT or DST to transform the residual block can be determined based on the intra-frame prediction mode information of the prediction units used to generate the residual block. Transformation of the residual block can also be skipped. A flag indicating whether to skip the transformation of the residual block can be encoded. Transformation skipping is allowed for residual blocks with a size below a threshold, or for luma or chroma components (4:4:4 format or below).

[0078] The quantization unit 135 can quantize the values ​​that have been transformed into the frequency domain in the transformation unit 130. The quantization coefficients can be changed according to the importance of the block or video. The values ​​calculated in the quantization unit 135 can be provided to the inverse quantization unit 140 and the rearrangement unit 160.

[0079] The rearrangement unit 160 can rearrange the coefficient values ​​of the quantized residual values.

[0080] The rearrangement unit 160 can transform 2D block shape coefficients into 1D vector form using a coefficient scanning method. For example, the rearrangement unit 160 can use a zig-zag scan method to scan the DC coefficients and even the coefficients in the high-frequency domain, and transform them into 1D vector form. Depending on the size of the transform unit and the intra-frame prediction mode, instead of zig-zag scanning, vertical scanning along the column direction and horizontal scanning along the row direction can also be used to scan the 2D block shape coefficients. That is, the choice between zig-zag scanning, vertical scanning, and horizontal scanning can be determined based on the size of the transform unit and the intra-frame prediction mode.

[0081] The entropy coding unit 165 can perform entropy coding based on the value calculated by the rearrangement unit 160. For example, entropy coding can use various coding methods such as Exponential Golomb code, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC).

[0082] The entropy coding unit 165 can encode various information such as residual coefficient information, block type information, prediction mode information, partitioning unit information, prediction unit information and transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information of the coding units originating from the rearrangement unit 160 and the prediction units 120 and 125.

[0083] The coefficient values ​​of the coding units input from the rearrangement unit 160 can be entropy encoded in the entropy coding unit 165.

[0084] The inverse quantization unit 140 and the inverse transform unit 145 perform inverse quantization on the multiple values ​​quantized in the quantization unit 135, and perform inverse transform on the values ​​transformed in the transform unit 130. The residual values ​​generated in the inverse quantization unit 140 and the inverse transform unit 145 can be merged with the prediction units predicted by the motion prediction unit, motion compensation unit and intra-frame prediction unit included in the prediction units 120 and 125 to generate a reconstructed block.

[0085] The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).

[0086] Deblocking filters eliminate block distortion in reconstructed images caused by boundaries between blocks. To determine whether to perform deblocking, the number of pixels in a block (either columns or rows) can be used. When applying a deblocking filter to a block, a strong or weak filter can be applied depending on the desired deblocking intensity. Furthermore, during deblocking, horizontal and vertical filtering can be processed simultaneously.

[0087] The offset correction unit can correct the offset between the video being deblocked and the original video on a pixel-by-pixel basis. To perform offset correction on a specific image, the following methods can be used: after dividing the pixels included in the video into a predetermined number of regions, determine the region to be offset and apply the offset to the corresponding region, or apply the offset by taking into account the edge information of each pixel.

[0088] Adaptive Loop Filtering (ALF) can be performed based on a comparison between the filtered reconstructed image and the original video. After dividing the pixels in the video into predetermined groups, filtering can be performed differently for each group by determining a filter to be used for the corresponding group. Information related to whether adaptive loop filtering is applied, along with the luminance signal, can be transmitted per coding unit (CU). The shape and filter coefficients of the adaptive loop filter to be applied can vary depending on the block. Furthermore, it is possible to apply the same type (fixed type) of adaptive loop filter regardless of the characteristics of the block to which it is applied.

[0089] The memory 155 can store the reconstructed blocks or images calculated by the filter unit 150, and can provide the stored reconstructed blocks or images to the prediction units 120 and 125 when performing inter-frame prediction.

[0090] Figure 2 This is a block diagram of a video decoder according to an embodiment of the present invention.

[0091] Reference Figure 2 The video decoder 200 may include an entropy decoding unit 210, a rearrangement unit 215, an inverse quantization unit 220, an inverse transform unit 225, a prediction unit 230, a prediction unit 235, a filter unit 240, and a memory 245.

[0092] When inputting a video bitstream from a video encoder, the input bitstream can be decoded by following the reverse steps of the video encoder.

[0093] The entropy decoding unit 210 can perform entropy decoding in the reverse order of the entropy encoding steps performed in the entropy encoding unit of the video encoder. For example, corresponding to the methods performed in the video encoder, various methods such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) can be applied.

[0094] The entropy decoding unit 210 can decode information related to intra-frame prediction and inter-frame prediction performed by the encoder.

[0095] The rearrangement unit 215 can perform rearrangement based on a method used in the encoding unit to rearrange the bitstream that has been entropily decoded by the entropy decoding unit 210. Multiple coefficients represented in one-dimensional vector form can be reconstructed into two-dimensional block-shaped coefficients for rearrangement. The rearrangement unit 215 receives information related to the coefficient scan performed in the encoding unit and can perform rearrangement by performing a reverse scan based on the scan order performed in the corresponding encoding unit.

[0096] The inverse quantization unit 220 can perform inverse quantization based on the quantization parameters provided by the encoder and the coefficient values ​​of the rearranged blocks.

[0097] The inverse transform unit 225 can perform inverse discrete cosine transform and inverse discrete sine transform on the quantization result performed by the video encoder. These inverse discrete cosine transforms and inverse discrete sine transforms are inverse transforms of the transforms performed in the transform unit, i.e., inverse transforms of the discrete cosine transform and discrete sine transform. The DCT transform kernel can include at least one of DCT2 or DCT8, and the DST transform kernel can include DST7. Alternatively, if the transform is skipped in the video encoder, the inverse transform unit 225 may not perform the inverse transform. The inverse transform can be performed based on the transmission unit determined in the video encoder. In the inverse transform unit 225 of the video decoder, a transform method (e.g., DCT or DST) can be selectively performed based on multiple pieces of information such as the prediction method, the size of the current block, and the prediction direction.

[0098] Prediction units 230 and 235 can generate prediction blocks based on information related to prediction block generation provided by entropy decoding unit 210 and previously decoded block or image information provided by memory 245.

[0099] As described above, when intra-prediction is performed in the same manner as in the video encoder, if the size of the prediction unit is the same as the size of the transform unit, intra-prediction is performed on the prediction unit based on the pixels to its left, the pixels to its upper left, and the pixels above it. If the size of the prediction unit is different from the size of the transform unit, intra-prediction can be performed using reference pixels based on the transform unit. Furthermore, intra-prediction using only N×N partitioning for the smallest coding unit can also be applied.

[0100] Prediction units 230 and 235 may include a prediction unit determination unit, an inter-frame prediction unit, and an intra-frame prediction unit. The prediction unit determination unit receives various information input from the entropy decoding unit 210, such as prediction unit information, prediction mode information of the intra-frame prediction method, and motion prediction-related information of the inter-frame prediction method. It classifies prediction units according to the current coding unit and determines whether the prediction unit is performing inter-frame prediction or intra-frame prediction. The inter-frame prediction unit 230 can use the information required for inter-frame prediction of the current prediction unit provided by the video encoder and perform inter-frame prediction on the current prediction unit based on information included in at least one of the previous or next images of the current image to which the current prediction unit belongs. Alternatively, inter-frame prediction can also be performed based on information from a portion of the reconstructed region within the current image to which the current prediction unit belongs.

[0101] In order to perform inter-frame prediction, it is possible to determine, based on the coding unit, which of the following modes of motion prediction method is used for the prediction units included in the corresponding coding unit: Skip Mode, Merge Mode, Advanced Motion Vector Prediction Mode (AMVP Mode), or Intra-Block Copy Mode.

[0102] The intra-prediction unit 235 can generate prediction blocks based on pixel information within the current image. When the prediction unit is one that has already performed intra-prediction, intra-prediction can be performed based on the intra-prediction mode information of the prediction unit provided by the video encoder. The intra-prediction unit 235 may include an adaptive intra-smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. The adaptive intra-smoothing filter is the part that performs filtering on the reference pixels of the current block, and whether to apply the filter can be determined according to the prediction mode of the current prediction unit. Adaptive intra-smoothing filtering can be performed on the reference pixels of the current block using the prediction mode of the prediction unit provided by the video encoder and the adaptive intra-smoothing filter information. If the prediction mode of the current block is a mode that does not perform adaptive intra-smoothing filtering, then the adaptive intra-smoothing filter may not be applied.

[0103] For the reference pixel interpolation unit, if the prediction mode of the prediction unit is a prediction unit that performs intra-frame prediction based on pixel values ​​interpolated from reference pixels, then reference pixels with integer values ​​or smaller pixel units can be generated by interpolating the reference pixels. If the prediction mode of the current prediction unit is a prediction mode that generates prediction blocks without interpolating reference pixels, then interpolation of reference pixels is not required. If the prediction mode of the current block is DC mode, then the DC filter can generate prediction blocks by filtering.

[0104] The reconstructed blocks or images can be provided to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset correction unit, and an ALF.

[0105] Information related to whether to apply a deblocking filter to a corresponding block or image can be received from the video encoder, as well as information related to whether a strong or weak filter is applied when applying the deblocking filter. Information related to the deblocking filter provided by the video encoder can be received from the video decoder's deblocking filter, and deblocking filtering can be performed on the corresponding block at the video decoder.

[0106] The offset correction unit can perform offset correction on the reconstructed video based on the type and amount of offset correction used during video encoding.

[0107] The ALF can be applied to the coding unit based on information provided by the encoder, such as whether the ALF is applied and ALF coefficient information. This ALF information can be provided by including it in a specific parameter set.

[0108] The memory 245 stores the reconstructed image or block, such that the image or block can be used as a reference image or reference block, and the reconstructed image can be provided to the output unit.

[0109] Figure 3 This is a diagram illustrating the basic coding tree unit of an embodiment of the present invention.

[0110] The largest coding block can be defined as the coding tree block. An image can be divided into multiple coding tree units (CTUs). The coding tree unit is the largest coding unit and can also be called the largest coding unit (LCU). Figure 3 An example of dividing an image into multiple coding tree units is shown.

[0111] The size of a coding tree unit can be defined at the image level or the sequence level. Therefore, information representing the size of a coding tree unit can be transmitted via signals using either an image parameter set or a sequence parameter set.

[0112] For example, the size of the coding tree unit for the entire image within the sequence can be set to 128×128. Alternatively, either 128×128 or 256×256 at the image level can be determined as the size of the coding tree unit. For example, the size of the coding tree unit in the first image can be set to 128×128, and the size of the coding tree unit in the second image can be set to 256×256.

[0113] Coded blocks can be generated by dividing the coding tree into units. A coded block represents the basic unit used for encoding / decoding processing. For example, prediction or transformation can be performed on different coded blocks, or prediction coding modes can be determined on different coded blocks. The prediction coding mode represents the method for generating the predicted image. For example, prediction coding modes can include intra-prediction, inter-prediction, current picture referencing (CPR, or intra-block copy (IBC)), or combined prediction. For a coded block, at least one of the prediction coding modes—intra-prediction, inter-prediction, current picture referencing, or combined prediction—can be used to generate the prediction block associated with that coded block.

[0114] Information representing the predictive coding mode of the current block can be transmitted via a bitstream signal. For example, this information could be a 1-bit flag indicating whether the predictive coding mode is intra-frame or inter-frame. Current image reference or combined prediction can be used only if the predictive coding mode of the current block is determined to be inter-frame.

[0115] The current image reference is used to set the current image as the reference image and obtain the prediction block of the current block from the encoded / decoded regions within the current image. Here, the current image means the image that includes the current block. Information indicating whether the current image reference is applied to the current block can be sent via a bitstream signal. For example, this information could be a 1-bit flag. When the flag is true, the prediction coding mode of the current block can be determined as the current image reference; when the flag is false, the prediction mode of the current block can be determined as inter-frame prediction.

[0116] Alternatively, the predictive coding mode for the current block can be determined based on a reference image index. For example, when the reference image index points to the current image, the predictive coding mode for the current block can be determined to be the current reference image. When the reference image index points to another image instead of the current image, the predictive coding mode for the current block can be determined to be inter-frame prediction. That is, current image reference is a prediction method that uses information from encoded / decoded regions within the current image, and inter-frame prediction is a prediction method that uses information from other encoded / decoded images.

[0117] Combinatorial prediction represents a coding mode composed of two or more of intra-frame prediction, inter-frame prediction, and current image reference. For example, when applying combinatorial prediction, a first prediction block can be generated based on one of intra-frame prediction, inter-frame prediction, or the current image reference, and a second prediction block can be generated based on another. If a first and a second prediction block are generated, a final prediction block can be generated by averaging or weighted summing the first and second prediction blocks. Information indicating whether combinatorial prediction is applied can be transmitted via a bitstream signal. This information can be a 1-bit flag.

[0118] Figure 4(a) , 4(b) Figures 4(c), 4(d), and 4(e) are diagrams illustrating various partitioning types of coded blocks.

[0119] A coded block can be divided into multiple coded blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning. Furthermore, the divided coded blocks can be further divided into multiple coded blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning.

[0120] Quadtree partitioning is a partitioning technique that divides the current block into four blocks. As a result of quadtree partitioning, the current block can be divided into four square partitions (refer to “SPLIT_QT” in part 4(a) of Figure 4).

[0121] Binary tree partitioning refers to a partitioning technique that divides the current block into two blocks. The process of partitioning the current block along a vertical direction (i.e., using a vertical line crossing the current block) is called vertical binary tree partitioning, and the process of partitioning the current block along a horizontal direction (i.e., using a horizontal line crossing the current block) is called horizontal binary tree partitioning. After binary tree partitioning, the current block can be divided into two non-square partitions. "SPLIT_BT_VER" in part 4(b) represents the result of vertical binary tree partitioning, and "SPLIT_BT_HOR" in part 4(c) represents the result of horizontal binary tree partitioning.

[0122] Ternary tree partitioning refers to a partitioning technique that divides the current block into three blocks. The process of dividing the current block into three blocks along a vertical direction (i.e., using two vertical lines crossing the current block) is called vertical ternary tree partitioning, and the process of dividing the current block into three blocks along a horizontal direction (i.e., using two horizontal lines crossing the current block) is called horizontal ternary tree partitioning. After ternary tree partitioning, the current block can be divided into three non-square partitions. In this case, the width / height of the partition located at the center of the current block can be twice the width / height of the other partitions. "SPLIT_TT_VER" in part 4(d) represents the result of vertical ternary tree partitioning, and "SPLIT_TT_HOR" in part 4(e) represents the result of horizontal ternary tree partitioning.

[0123] The number of times a coding tree unit is divided can be defined as the partitioning depth. The maximum partitioning depth of a coding tree unit can be determined at the sequence or image level. Therefore, the maximum partitioning depth of a coding tree unit can vary depending on different sequences or images.

[0124] Alternatively, the maximum partitioning depth can be determined individually for each of the multiple partitioning techniques. For example, the maximum partitioning depth allowed for quadtree partitioning can be different from the maximum partitioning depth allowed for binary tree partitioning and / or ternary tree partitioning.

[0125] The encoder can transmit information representing at least one of the partition shape or partition depth of the current block via a bitstream. The decoder can determine the partition shape and partition depth of the coding tree unit based on the information parsed from the bitstream.

[0126] Figure 5 This is a diagram illustrating the partitioning pattern of the coding tree unit.

[0127] The process of dividing coding blocks using partitioning techniques such as quadtree partitioning, binary tree partitioning, and / or ternary tree partitioning is called multitree partitioning.

[0128] The coded blocks generated by applying a multi-way tree partitioning to the coded block can be called multiple downstream coded blocks. When the partitioning depth of the coded block is k, the partitioning depth of the multiple downstream coded blocks is set to k+1.

[0129] On the other hand, for multiple coding blocks with a partitioning depth of k+1, the coding block with a partitioning depth of k can be called the upstream coding block.

[0130] The partition type of the current coding block can be determined based on at least one of the partition shape of the upstream coding block or the partition type of the adjacent coding blocks. The adjacent coding blocks are adjacent to the current coding block and can include at least one of the blocks above, to the left, or to the top-left corner of the current coding block. The partition type can include at least one of whether to partition into a quadtree, whether to partition into a binary tree, the binary tree partition direction, whether to partition into a ternary tree, or the ternary tree partition direction.

[0131] To determine the shape of the coded block partition, information indicating whether the coded block has been partitioned can be sent via a bitstream signal. This information is a 1-bit flag "split_cu_flag," and when the flag is true, it indicates that the coded block has been partitioned using a multi-way tree partitioning technique.

[0132] When "split_cu_flag" is true, information indicating whether the coded block has been partitioned by a quadtree can be sent via a bitstream signal. This information is a 1-bit flag "split_qt_flag". When this flag is true, the coded block can be divided into 4 blocks.

[0133] For example, in Figure 5 The example shown illustrates how the coding tree unit is partitioned by a quadtree to generate four coding blocks with a partition depth of 1. Furthermore, the example illustrates applying quadtree partitioning again to the first and fourth coding blocks generated as a result of the quadtree partitioning. Ultimately, four coding blocks with a partition depth of 2 can be generated.

[0134] Furthermore, a coded block with a partition depth of 3 can be generated by applying a quadtree partition to the coded block with a partition depth of 2 again.

[0135] When a quadtree partition is not applied to the coded block, it can be determined whether to perform a binary tree partition or a ternary tree partition by considering at least one of the following: the size of the coded block, whether the coded block is located at an image boundary, the maximum partition depth, or the partition shape of adjacent blocks. When it is determined whether to perform a binary tree partition or a ternary tree partition, information indicating the partition direction can be transmitted via a bitstream signal. This information can be a 1-bit flag "mtt_split_cu_vertical_flag". The partition direction (vertical or horizontal) can be determined based on this flag. Alternatively, information indicating whether a binary tree partition or a ternary tree partition is applied to the coded block can be transmitted via a bitstream signal. This information can be a 1-bit flag "mtt_split_cu_binary_flag". The binary tree partition or ternary tree partition can be determined based on this flag.

[0136] For example, in Figure 5The example shown illustrates the application of a vertical binary tree partitioning to a coded block with a partitioning depth of 1, the application of a vertical ternary tree partitioning to the left coded block in the resulting coded block, and the application of a vertical binary tree partitioning to the right coded block.

[0137] Inter-frame prediction refers to using information from the previous image to predict the predictive coding mode of the current block. For example, a block in the previous image that is at the same position as the current block (hereinafter referred to as a collocated block) can be set as the prediction block for the current block. Hereinafter, the prediction block generated based on the block at the same position as the current block will be called a collocated prediction block.

[0138] On the other hand, if an object that existed in the previous image has moved to a different position in the current image, the object's motion can be used to effectively predict the current block. For example, if the direction and size of the object's movement can be known by comparing the previous and current images, the object's motion information can be considered to generate a predicted block (or predicted image) for the current block. Hereinafter, the predicted block generated using motion information can be referred to as a motion prediction block.

[0139] A residual block can be generated by subtracting a prediction block from the current block. In this case, when there is motion of the object, the energy of the residual block can be reduced by using a motion prediction block instead of a prediction block at the same location, thereby improving the compression performance of the residual block.

[0140] As mentioned above, the process of generating prediction blocks using motion information can be called motion-compensated prediction. In most inter-frame predictions, prediction blocks can be generated based on motion-compensated prediction.

[0141] Motion information may include at least one of motion vectors, reference image indices, prediction directions, or bidirectional weighted indexes. Motion vectors represent the direction and magnitude of an object's movement. Reference image indices specify the reference image for the current block among a list of reference images. Prediction directions refer to any one of unidirectional L0 prediction, unidirectional L1 prediction, or bidirectional prediction (L0 and L1 prediction). Motion information in either the L0 or L1 direction can be used based on the prediction direction of the current block. Bidirectional weighted indexes specify the weights applied to the L0 prediction block and the weights applied to the L1 prediction block.

[0142] Figure 6 This is a flowchart of the inter-frame prediction method according to an embodiment of the present invention.

[0143] refer to Figure 6The inter-frame prediction method includes the following steps: determining the inter-frame prediction mode of the current block (S601); obtaining motion information of the current block according to the determined inter-frame prediction mode (S602); and performing motion compensation prediction on the current block based on the obtained motion information (S603).

[0144] Inter-frame prediction modes represent various techniques used to determine the motion information of the current block, and can include inter-frame prediction modes using translational motion information and inter-frame prediction modes using affine motion information. For example, inter-frame prediction modes using translational motion information can include merging mode and advanced motion vector prediction mode, while inter-frame prediction modes using affine motion information can include affine merging mode and affine motion vector prediction mode. Based on the inter-frame prediction mode, the motion information of the current block can be determined based on neighboring blocks adjacent to the current block or information parsed from the bitstream.

[0145] The following section details the inter-frame prediction method using affine motion information.

[0146] Figure 7 It is a diagram showing the nonlinear motion of an object.

[0147] The motion of objects within a video may be non-linear. For example, such as... Figure 7 The example shown may involve non-linear motion of the object, such as camera zoom-in, zoom-out, rotation, or affine transformation. When non-linear motion occurs, it is impossible to effectively represent the object's motion using translational motion vectors. Therefore, in parts where non-linear motion occurs, affine motion can be used instead of translational motion, thereby improving coding efficiency.

[0148] Figure 8 This is a flowchart illustrating an inter-frame prediction method based on affine motion according to an embodiment of the present invention.

[0149] Whether to apply an affine motion-based inter-frame prediction technique to the current block can be determined based on information parsed from the bitstream. Specifically, whether to apply an affine motion-based inter-frame prediction technique to the current block can be determined based on at least one of a flag indicating whether an affine merging mode is applied to the current block or a flag indicating whether an affine motion vector prediction mode is applied to the current block.

[0150] When an inter-frame prediction technique based on affine motion is applied to the current block, the affine motion model of the current block can be determined (S801). The affine motion model can be determined by at least one of a 6-parameter affine motion model or a 4-parameter affine motion model. The 6-parameter affine motion model uses 6 parameters to represent the affine motion, while the 4-parameter affine motion model uses 4 parameters to represent the affine motion.

[0151] Equation 1 represents the case of affine motion using 6 parameters. Affine motion represents translational motion relative to a predetermined region determined by an affine seed vector.

[0152] [Formula 1]

[0153] v x =ax-by+e

[0154] v y =cx+dy+f

[0155] While using six parameters to represent affine motion allows for the representation of complex motions, the increased number of bits required to encode each parameter reduces encoding efficiency. Therefore, affine motion can also be represented using four parameters. Equation 2 illustrates the case of representing affine motion using four parameters.

[0156] [Formula 2]

[0157] v x =ax-by+e

[0158] v y =bx+ay+f

[0159] Information used to determine the affine motion model for the current block can be encoded and transmitted via a bitstream signal. For example, this information could be a 1-bit flag, "affine_type_flag". A value of 0 indicates the application of a 4-parameter affine motion model, and a value of 1 indicates the application of a 6-parameter affine motion model. The flag can be encoded at the slice, tile, or block level (e.g., coded block or coded tree unit). When the flag is transmitted at the slice level, the affine motion model determined at that slice level can be applied to all blocks within that slice.

[0160] Alternatively, the affine motion model of the current block can be determined based on the affine inter-frame prediction mode of the current block. For example, when applying the affine merging mode, the affine motion model of the current block can be determined as a 4-parameter motion model. On the other hand, when applying the affine motion vector prediction mode, the information used to determine the affine motion model of the current block can be encoded and transmitted as a signal via a bitstream. For example, when applying the affine motion vector prediction mode to the current block, the affine motion model of the current block can be determined based on a 1-bit flag "affine_type_flag".

[0161] Next, the affine seed vector of the current block can be exported (S802). When a 4-parameter affine motion model is selected, motion vectors at the two control points of the current block can be exported. On the other hand, when a 6-parameter affine motion model is selected, motion vectors at the three control points of the current block can be exported. The motion vectors at the control points can be called affine seed vectors. Control points can include at least one of the top-left, top-right, or bottom-left corners of the current block.

[0162] Figure 9 This is a diagram showing an example of the affine seed vector for each affine motion model.

[0163] In a 4-parameter affine motion model, two related affine seed vectors can be derived from the top-left, top-right, or bottom-left corners. For example, ... Figure 9 In the example shown in section (a), when the 4-parameter affine motion model is selected, the affine vectors can be derived by using an affine seed vector sv0 associated with the top-left corner of the current block (e.g., the top-left sample (x0, y0)) and an affine seed vector sv1 associated with the top-right corner of the current block (e.g., the top-right sample (x1, y1)). Alternatively, the affine seed vector associated with the bottom-left corner can be used instead of the affine seed vector associated with the top-left corner, or vice versa.

[0164] In a 6-parameter affine motion model, affine seed vectors related to the top-left, top-right, and bottom-left corners can be derived. For example, ... Figure 9 In the example shown in section (b), when the 6-parameter affine motion model is selected, the affine vectors can be derived by using the affine seed vector sv0 associated with the top-left corner of the current block (e.g., the top-left sample (x0, y0)), the affine seed vector sv1 associated with the top-right corner of the current block (e.g., the top-right sample (x1, y1)), and the affine seed vector sv2 associated with the top-left corner of the current block (e.g., the top-left sample (x2, y2)).

[0165] In the embodiments described later, under the 4-parameter affine motion model, the affine seed vectors of the upper left control point and the upper right control point are referred to as the first affine seed vector and the second affine seed vector, respectively. In the embodiments using the first and second affine seed vectors described later, at least one of the first and second affine seed vectors can be replaced by the affine seed vector of the lower left control point (the third affine seed vector) or the affine seed vector of the lower right control point (the fourth affine seed vector).

[0166] Furthermore, in the 6-parameter affine motion model, the affine seed vectors of the upper left control point, upper right control point, and lower left control point are respectively referred to as the first affine seed vector, the second affine seed vector, and the third affine seed vector. In the embodiments using the first, second, and third affine seed vectors described later, at least one of the first, second, and third affine seed vectors can be replaced by the affine seed vector of the lower right control point (the fourth affine seed vector).

[0167] Affine vectors can be derived for different sub-blocks using an affine seed vector (S803). Here, the affine vector represents the translational motion vector derived from the affine seed vector. The affine vector of a sub-block can be called the affine sub-block motion vector or the sub-block motion vector.

[0168] Figure 10 This is a diagram showing an example of the affine vectors of a sub-block under a 4-parameter motion model.

[0169] The affine vector of a sub-block can be derived based on the position of the control point, the position of the sub-block, and the affine seed vector. For example, Equation 3 shows an example of deriving the affine sub-block vector.

[0170] [Formula 3]

[0171]

[0172] In Formula 3, (x, y) represents the position of the sub-block. The position of the sub-block refers to the position of the reference sample included within it. The reference sample can be the sample located at the top left corner of the sub-block, or at least one sample located at the center of the x-axis or y-axis coordinate system. (x0, y0) represents the position of the first control point, and (sv 0x sv 0y Let (x1, y1) represent the first affine seed vector. Additionally, (x1, y1) represents the position of the second control point, and (sv... 1x sv 1y ) represents the second affine seed vector.

[0173] When the first control point and the second control point correspond to the top left corner and the top right corner of the current block, respectively, x1-x0 can be set to the same value as the width of the current block.

[0174] Then, motion compensation prediction can be performed on each sub-block using its affine vectors (S804). After performing motion compensation prediction, prediction blocks associated with each sub-block can be generated. The prediction blocks of the sub-blocks can be set as the prediction blocks of the current block.

[0175] Next, we will explain in detail the inter-frame prediction method that uses translational motion information.

[0176] Motion information for the current block can be derived from the motion information of other blocks. These other blocks can be those that are prioritized for inter-frame prediction encoding / decoding compared to the current block. Setting the motion information of the current block to be the same as that of other blocks is defined as a merging mode. Furthermore, setting the motion vectors of other blocks to the predicted values ​​of the motion vectors of the current block is defined as a motion vector prediction mode.

[0177] Figure 11 This is a flowchart of the process of exporting motion information of the current block in merge mode.

[0178] Merging candidates for the current block can be exported (S1101). Merging candidates for the current block can be exported from blocks that were encoded / decoded using inter-frame prediction before the current block.

[0179] Figure 12 This is a diagram showing an example of a candidate block used to derive merge candidates.

[0180] Candidate blocks can include at least one of the following: neighboring blocks containing samples adjacent to the current block, or non-neighboring blocks containing samples not adjacent to the current block. Hereinafter, the samples used to determine candidate blocks will be designated as reference samples. Furthermore, reference samples adjacent to the current block will be referred to as neighboring reference samples, and reference samples not adjacent to the current block will be referred to as non-neighboring reference samples.

[0181] Adjacent reference samples can be included in the adjacent column of the leftmost column of the current block or the adjacent row of the topmost row of the current block. For example, if the coordinates of the top-left sample of the current block are (0, 0), then at least one of the following blocks—a block including a reference sample at position (-1, H-1), a block including a reference sample at position (W-1, -1), a block including a reference sample at position (W, -1), a block including a reference sample at position (-1, H), or a block including a reference sample at position (-1, -1)—can be used as candidate blocks. Referring to the accompanying drawings, adjacent blocks with indices 0 to 4 can be used as candidate blocks.

[0182] A non-adjacent reference sample refers to a sample whose x-axis distance or y-axis distance to the reference sample adjacent to the current block has a predefined value. For example, a block containing a reference sample whose x-axis distance to the left reference sample is a predefined value, a block containing a non-adjacent sample whose y-axis distance to the upper reference sample is a predefined value, or a block containing non-adjacent samples whose x-axis and y-axis distances to the upper-left reference sample are both predefined values ​​can be used as a candidate block. The predefined value can be an integer such as 4, 8, 12, 16, etc. Referring to the accompanying drawings, at least one of the blocks with indices from 5 to 26 can be used as a candidate block.

[0183] Samples that are not on the same vertical, horizontal, or diagonal line as adjacent reference samples can be set as non-adjacent reference samples.

[0184] Figure 13 This is a diagram showing the location of the reference sample.

[0185] like Figure 13 The example shown allows setting the x-coordinate of a non-adjacent reference sample above to be different from the x-coordinate of the adjacent reference sample above. For instance, when the position of the adjacent reference sample above is (W-1, -1), the position of a non-adjacent reference sample above that is N away from the adjacent reference sample above along the y-axis can be set to ((W / 2)-1, -1-N), and the position of a non-adjacent reference sample above that is 2N away from the adjacent reference sample above along the y-axis can be set to (0, -1-2N). That is, the position of a non-adjacent reference sample can be determined based on the position of the adjacent reference sample and the distance between the adjacent reference samples.

[0186] In the following text, a candidate block containing an adjacent reference sample is called a neighboring block, and a block containing a non-adjacent reference sample is called a non-adjacent block.

[0187] When the distance between the current block and a candidate block is greater than or equal to a threshold, the candidate block can be set as unusable as a merging candidate. The threshold can be determined based on the size of the coding tree unit. For example, the threshold can be set to the height of the coding tree unit (ctu_height), or the height of the coding tree unit plus or minus an offset value (e.g., ctu_height ± N). The offset value N is a predefined value in the encoder and decoder, and can be set to 4, 8, 16, 32, or ctu_height.

[0188] If the difference between the y-axis coordinate of the current block and the y-axis coordinate of the samples included in the candidate block is greater than a threshold, the candidate block can be determined as unsuitable for merging.

[0189] Alternatively, candidate blocks that do not belong to the same coding tree unit as the current block can be set as unsuitable for merging. For example, when the reference sample exceeds the upper boundary of the coding tree unit to which the current block belongs, candidate blocks that include the reference sample can be set as unsuitable for merging.

[0190] If the upper boundary of the current block is adjacent to the upper boundary of a coding tree unit, multiple candidate blocks will be determined as unsuitable for merging, which will reduce the encoding / decoding efficiency of the current block. To resolve this issue, candidate blocks can be configured such that the number of candidate blocks above the current block is greater than the number of candidate blocks to the left of the current block.

[0191] Figure 14 This is a diagram showing an example of a candidate block used to derive merge candidates.

[0192] like Figure 14 The example shown allows setting the top block of the N blocks above the current block and the left block of the M blocks to the left of the current block as candidate blocks. In this case, by setting M to be greater than N, the number of left candidate blocks can be set to be greater than the number of top candidate blocks.

[0193] For example, the difference between the y-axis coordinate of the reference sample within the current block and the y-axis coordinate of the block above which can be used as a candidate block can be set to no more than N times the height of the current block. Additionally, the difference between the x-axis coordinate of the reference sample within the current block and the x-axis coordinate of the block to the left of which can be used as a candidate block can be set to no more than M times the width of the current block.

[0194] For example, such as Figure 14 The example shown illustrates setting the blocks belonging to the two blocks above the current block and the five blocks belonging to the left of the current block as candidate blocks.

[0195] As another example, when a candidate block does not belong to the same coding tree unit as the current block, a merge candidate can be derived by using a block that belongs to the same coding tree unit as the current block, or a block that contains a reference sample adjacent to the boundary of the coding tree unit, instead of the candidate block.

[0196] Figure 15 This is a diagram illustrating an example of changing the position of a reference sample.

[0197] When a reference sample is included in a coding tree unit that is different from the current block, and the reference sample is not adjacent to the boundary of the coding tree unit, a candidate block reference sample can be determined by using a reference sample adjacent to the boundary of the coding tree unit instead of the reference sample.

[0198] For example, in Figure 15 (a) and Figure 15In the example shown in (b), when the upper boundary of the current block touches the upper boundary of the coding tree unit, the reference sample above the current block belongs to a coding tree unit different from the current block. A reference sample belonging to a coding tree unit different from the current block that is not adjacent to the upper boundary of the coding tree unit can be replaced with a sample adjacent to the upper boundary of the coding tree unit.

[0199] For example, such as Figure 15 As shown in example (a), the reference sample at position 6 is replaced with the sample at position 6' located at the upper boundary of the coding tree unit, as follows. Figure 15 As shown in example (b), the reference sample at position 15 is replaced by the sample at position 15', which is located at the upper boundary of the coding tree unit. In this case, the y-coordinate of the replacement sample can be changed to that of an adjacent position in the coding tree unit, and the x-coordinate of the replacement sample can be set to be the same as that of the reference sample. For example, the sample at position 6' can have the same x-coordinate as the sample at position 6, and the sample at position 15' can have the same x-coordinate as the sample at position 15.

[0200] Alternatively, the x-coordinate of the replacement sample can be set by adding or subtracting the offset value from the x-coordinate of the reference sample. For example, when the x-coordinates of adjacent and non-adjacent reference samples above the current block are the same, the x-coordinate of the replacement sample can be set by adding or subtracting the offset value from the x-coordinate of the reference sample. This is to prevent the replacement sample used to replace a non-adjacent reference sample from being in the same position as other non-adjacent or adjacent reference samples.

[0201] Figure 16 This is a diagram illustrating an example of changing the position of a reference sample.

[0202] When replacing a reference sample that is included in a different coding tree unit than the current block and is not adjacent to the boundary of the coding tree unit with a sample located at the boundary of the coding tree unit, the x-coordinate of the replacement sample can be set by adding or subtracting the offset value to the x-coordinate of the reference sample.

[0203] For example, in Figure 16 In the example shown, the reference sample at position 6 and the reference sample at position 15 can be replaced with the sample at position 6' and the sample at position 15', respectively, having the same y-coordinate as the row adjacent to the upper boundary of the coding tree unit. In this case, the x-coordinate of the sample at position 6' can be set to a value where the difference between its x-coordinate and the x-coordinate of the reference sample at position 6 is W / 2, and the x-coordinate of the sample at position 15' can be set to a value where the difference between its x-coordinate and the x-coordinate of the reference sample at position 15 is W-1.

[0204] Unlike Figure 15 and Figure 16In the example shown, the y-coordinate of the row above the top row of the current block or the y-coordinate of the upper boundary of the coding tree unit can also be set to the y-coordinate of the replacement sample.

[0205] Although not illustrated, the sample replacing the reference sample can also be determined based on the left boundary of the coding tree unit. For example, when the reference sample is not included in the same coding tree unit as the current block and is not adjacent to the left boundary of the coding tree unit, the reference sample can be replaced with a sample adjacent to the left boundary of the coding tree unit. In this case, the replacement sample can have the same y-coordinate as the reference sample, or it can have a y-coordinate obtained by adding or subtracting an offset value to the y-coordinate of the reference sample.

[0206] Then, the block containing the replacement sample can be set as a candidate block, and the merge candidates for the current block can be derived based on the candidate blocks.

[0207] Merge candidates can also be derived from temporally adjacent blocks included in images different from the current block. For example, merge candidates can be derived from blocks at the same location included in images at the same location.

[0208] The motion information of the merged candidate can be set to be the same as that of the candidate block. For example, at least one of the motion vector, reference image index, prediction direction, or bidirectional weighted index of the candidate block can be set as the motion information of the merged candidate.

[0209] A list of merge candidates, including merge candidates, can be generated (S1102). The merge candidates can be classified into adjacent merge candidates derived from adjacent blocks adjacent to the current block, and non-adjacent merge candidates derived from non-adjacent blocks.

[0210] The indices of multiple merge candidates within the merge candidate list can be assigned in a predetermined order. For example, the index assigned to an adjacent merge candidate can have a smaller value than the index assigned to a non-adjacent merge candidate. Alternatively, based on Figure 12 or Figure 14 The index shown for each block can be assigned to each merge candidate.

[0211] When the merge candidate list includes multiple merge candidates, at least one of the multiple merge candidates can be selected (S1103). At this time, information indicating whether the motion information of the current block is derived from adjacent merge candidates can be sent via a bit stream signal. The information can be a 1-bit flag. For example, the syntax element isAdjancentMergeFlag indicating whether the motion information of the current block is derived from adjacent merge candidates can be sent via a bit stream signal. When the value of the syntax element isAdjancentMergeFlag is 1, the motion information of the current block can be derived based on adjacent merge candidates. On the other hand, when the value of the syntax element isAdjancentMergeFlag is 0, the motion information of the current block can be derived based on non-adjacent merge candidates.

[0212] Table 1 shows the syntax table including the syntax element isAdjancentMergeFlag.

[0213] Table 1

[0214]

[0215]

[0216] Information specifying any one of multiple merge candidates can be transmitted via a bitstream signal. For example, information indicating the index of any merge candidate included in the merge candidate list can be transmitted via a bitstream signal.

[0217] When isAdjacentMergeflag is 1, the syntax element merge_idx can be signaled to determine which of the adjacent merge candidates is being merged. The maximum value of the syntax element merge_idx can be set to a value that is 1 greater than the difference between the number of adjacent merge candidates.

[0218] When isAdjacentMergeflag is 0, the syntax element NA_merge_idx can be signaled to determine any of the non-adjacent merge candidates. The syntax element NA_merge_idx indicates the value obtained by subtracting the index of the non-adjacent merge candidate from the number of adjacent merge candidates. The decoder can select a non-adjacent merge candidate by adding the number of adjacent merge candidates to the index determined by NA_merge_idx.

[0219] When the number of merge candidates included in the merge candidate list is less than a threshold, merge candidates included in the prediction region motion information list can be added to the merge candidate list. The threshold can be a value calculated from the maximum number of merge candidates that the merge candidate list can include, or the maximum number of merge candidates minus an offset. The offset can be an integer such as 1 or 2. The inter-frame motion information list can include merge candidates derived based on blocks encoded / decoded prior to the current block.

[0220] The prediction region motion information list includes merging candidates derived from blocks encoded / decoded based on inter-frame predictions in the current image. For example, the motion information of the merging candidates included in the prediction region motion information list can be set to be equal to the motion information of the blocks encoded / decoded based on inter-frame predictions. The motion information may include at least one of motion vectors, reference image indices, prediction directions, or bidirectional weighted indexes.

[0221] For ease of explanation, the merge candidates included in the prediction region motion information list are called prediction region merge candidates.

[0222] The maximum number of merged candidates that can be included in the list of motion information for the predicted region can be predefined by the encoder and decoder. For example, the maximum number of merged candidates that can be included in the list of motion information for the predicted region can be 1, 2, 3, 4, 5, 6, 7, 8 or more (e.g., 16).

[0223] Alternatively, information indicating the maximum number of merge candidates that the predicted region motion information list can include can be transmitted via a bitstream signal. This information can be transmitted at the sequence level, image level, or slice level signal. The information can indicate the maximum number of merge candidates that the predicted region motion information list can include. Alternatively, the information can indicate the difference between the maximum number of merge candidates that the predicted region motion information list can include and the maximum number of merge candidates that the merge candidate list can include.

[0224] Alternatively, the maximum number of merged candidates in the prediction region motion information list can be determined based on the image size, patch size, or coding tree unit size.

[0225] The list of predicted region motion information can be initialized in units of images, slices, tiles, bricks, coding tree units, or coding tree unit lines (rows or columns). For example, if a slice is initialized, the list of predicted region motion information is also initialized, and the list of predicted region motion information may not include any merge candidates.

[0226] Alternatively, information indicating whether to initialize the predictive region motion information list can be transmitted via a bitstream signal. This information can be transmitted at the slice, tile, brick, or block level. A pre-configured predictive region motion information list can be used before the information indicates that the predictive region motion information list should be initialized.

[0227] Alternatively, information about initial predictive region merging candidates can be signaled via an image parameter set or a slice header. Even after the slice is initialized, the predictive region motion information list can include initial predictive region merging candidates. Therefore, predictive region merging candidates can be used as the first blocks to be encoded / decoded in the slice.

[0228] Alternatively, the prediction region merging candidates included in the prediction region motion information list of the previous coding tree unit can be set as the initial prediction region merging candidates. For example, among the prediction region merging candidates included in the prediction region motion information list of the previous coding tree unit, the prediction region merging candidate with the smallest index or the prediction region merging candidate with the largest index can be set as the initial prediction region merging candidate.

[0229] Blocks are encoded / decoded according to the encoding / decoding order, and blocks encoded / decoded based on inter-frame prediction can be set as prediction region merging candidates in sequence according to the encoding / decoding order.

[0230] Figure 17 It is a flowchart illustrating the process of updating the list of motion information for the predicted region.

[0231] When performing inter-frame prediction on the current block (S1701), prediction region merging candidates can be derived based on the current block (S1702). The motion information of the prediction region merging candidates can be set equal to the motion information of the current block.

[0232] When the predicted region motion information list is empty (S1703), the predicted region merging candidates derived from the current block can be added to the predicted region motion information list (S1704).

[0233] When the predicted region motion information list already includes the predicted region merging candidates (S1703), redundancy detection can be performed on the motion information of the current block (or the predicted region merging candidates derived from the current block) (S1705). Redundancy detection is used to determine whether the motion information of the predicted region merging candidates already stored in the predicted region motion information list is the same as the motion information of the current block. Redundancy detection can be performed on all predicted region merging candidates already stored in the predicted region motion information list. Alternatively, redundancy detection can be performed on predicted region merging candidates whose indices are greater than or less than a threshold among the predicted region merging candidates already stored in the predicted region motion information list.

[0234] If inter-frame prediction merging candidates with the same motion information as the current block are not included, prediction region merging candidates derived from the current block can be added to the prediction region motion information list (S1708). Whether inter-frame merging candidates are the same can be determined based on whether the motion information (e.g., motion vectors and / or reference image index, etc.) of the inter-frame merging candidates are the same.

[0235] In this case, when the maximum number of predicted region merging candidates has already been stored in the predicted region motion information list (S1706), the earliest predicted region merging candidate is deleted (S1707), and predicted region merging candidates derived based on the current block can be added to the predicted region motion information list (S1708). Here, the earliest predicted region merging candidate can be either the predicted region merging candidate with the largest index or the predicted region merging candidate with the smallest index.

[0236] Each predicted region merge candidate can be identified by an index. When a predicted region merge candidate derived from the current block is added to the predicted region motion information list, the smallest index (e.g., 0) is assigned to that candidate, and the indices of already stored candidates can be incremented by 1. In this case, if the predicted region motion information list already stores the maximum number of inter-frame predicted region merge candidates, the candidate with the largest index is removed.

[0237] Alternatively, when a predicted region merge candidate derived from the current block is added to the predicted region motion information list, the largest index can be assigned to that predicted region merge candidate. For example, when the number of inter-frame predicted merge candidates already stored in the predicted region motion information list is less than the maximum value, an index with the same value as the number of stored inter-frame predicted merge candidates can be assigned to that predicted region merge candidate. Alternatively, when the number of inter-frame predicted merge candidates already stored in the predicted region motion information list is the same as the maximum value, an index obtained by subtracting 1 from the maximum value can be assigned to that predicted region merge candidate. Furthermore, the predicted region merge candidate with the smallest index is removed, and the indices of the remaining stored predicted region merge candidates can be reduced by 1.

[0238] Figure 18 This is a diagram illustrating an example of updating the candidate list for merging predicted regions.

[0239] Assume that when adding a predicted region merge candidate derived from the current block to the predicted region merge candidate list, the largest index is assigned to the predicted region merge candidate. Furthermore, assume that the predicted region merge candidate list already stores the maximum number of predicted region merge candidates.

[0240] When a predicted region merge candidate HmvpCand[n+1] exported from the current block is added to the predicted region merge candidate list HmvpCandList, the predicted region merge candidate HmvpCand[0] with the smallest index among the stored predicted region merge candidates is deleted, and the indices of the remaining predicted region merge candidates can be decreased by 1. Alternatively, the index of the predicted region merge candidate HmvpCand[n+1] exported from the current block can be set to the maximum value (in...). Figure 18 In the example shown, n).

[0241] If a prediction region merging candidate that is the same as the prediction region merging candidate derived from the current block is already stored (S1705), the prediction region merging candidate derived from the current block may not be added to the prediction region motion information list (S1709).

[0242] Alternatively, when adding a predicted region merge candidate derived from the current block to the predicted region motion information list, an already stored predicted region merge candidate that is identical to the original predicted region merge candidate can be removed. In this case, the same effect is achieved as updating the index of a newly stored predicted region merge candidate.

[0243] Figure 19 This is a diagram illustrating an example of updating the index of a stored predicted region merging candidate.

[0244] When the index of an inter-frame prediction merge candidate that is the same as the predicted region merge candidate mvCand derived based on the current block is hIdx, the index of the stored inter-frame prediction merge candidate is deleted, and the index of inter-frame prediction merge candidates with an index greater than hIdx can be reduced by 1. For example, in Figure 19 The example shown illustrates removing HmvpCand[2], which is identical to mvCand, from the prediction region motion information list HvmpCand, and decreasing the indices of HmvpCand[3] to HmvpCand[n] by 1.

[0245] Additionally, the predicted region merge candidate mvCand derived from the current block can be added to the end of the predicted region motion information list.

[0246] Alternatively, the indexes assigned to stored predictive region merge candidates that are the same as those derived from the current block can be updated. For example, the indexes of stored predictive region merge candidates can be changed to the minimum or maximum value.

[0247] It can be configured not to add motion information of blocks included in a predetermined region to the prediction region motion information list. For example, prediction region merge candidates derived based on motion information of blocks included in the merge processing region can be excluded from the prediction region motion information list. Since the encoding / decoding order of the blocks included in the merge processing region is not defined, it is inappropriate to use the motion information of any of these blocks for inter-frame prediction of other blocks. Therefore, prediction region merge candidates derived based on blocks included in the merge processing region can be excluded from the prediction region motion information list.

[0248] Alternatively, it can be configured not to add motion information of blocks smaller than a preset size to the prediction region motion information list. For example, prediction region merging candidates derived from motion information of coded blocks with a width or height less than 4 or 8, or coded blocks with a size of 4×4, can be excluded from the prediction region motion information list.

[0249] When performing motion compensation prediction on a sub-block basis, prediction region merging candidates can be derived based on the motion information of representative sub-blocks among the multiple sub-blocks included in the current block. For example, when using sub-block merging candidates for the current block, prediction region merging candidates can be derived based on the motion information of representative sub-blocks within the sub-block.

[0250] The motion vector of a sub-block can be derived in the following order. First, any of the merge candidates included in the merge candidate list of the current block can be selected, and the initial shift vector (shVector) can be derived based on the motion vector of the selected merge candidate. Then, by adding the initial shift vector to the positions (xSb, ySb) of the reference samples (e.g., the top-left sample or the middle sample) of each sub-block within the coded block, a shifted sub-block with reference sample positions (xColSb, yColSb) can be derived. Equation 4 below shows the formula for deriving the shifted sub-block.

[0251] [Formula 4]

[0252] (xColSb,yColSb)=(xSb+shVector[0]>>4,ySb+shVector[1]>>4)

[0253] Next, the motion vector of the block at the same position corresponding to the center position of the sub-block including (xColSb, yColSb) is set as the motion vector of the sub-block including (xSb, ySb).

[0254] A representative sub-block can mean a sub-block that includes the top-left sample or the center sample of the current block.

[0255] Figure 20 This is a diagram showing the location of representative sub-blocks.

[0256] Figure 20 (a) shows an example of setting the child block located to the upper left of the current block as the representative child block. Figure 20 (b) illustrates an example of setting the sub-block located at the center of the current block as the representative sub-block. When performing motion compensation prediction on a sub-block basis, the prediction region merging candidate for the current block can be derived based on the motion vectors of sub-blocks that include the top-left sample of the current block or sub-blocks that include the center sample of the current block.

[0257] Whether to use the current block as a prediction region merging candidate can be determined based on the inter-frame prediction mode of the current block. For example, blocks encoded / decoded based on an affine motion model can be set as unavailable as prediction region merging candidates. Thus, even if the current block is encoded / decoded using inter-frame prediction, the inter-frame prediction motion information list will not be updated based on the current block if the inter-frame prediction mode of the current block is affine prediction mode.

[0258] Alternatively, the predicted region merging candidate can be derived based on at least one sub-block vector from among the sub-blocks included in a block encoded / decoded using an affine motion model. For example, the predicted region merging candidate can be derived using a sub-block located to the upper left of the current block, a sub-block located at the center of the current block, or a sub-block located to the upper right of the current block. Alternatively, the average of the sub-block vectors of multiple sub-blocks can be used as the motion vector for the predicted region merging candidate.

[0259] Alternatively, the predicted region merging candidate can be derived from the average of the affine seed vectors of the blocks encoded / decoded based on the affine motion model. For example, the average of at least one of the first, second, and third affine seed vectors of the current block can be set as the motion vector for the predicted region merging candidate.

[0260] Alternatively, a list of prediction region motion information can be configured for each inter-frame prediction mode. For example, at least one of the following can be defined: a list of prediction region motion information for blocks encoded / decoded via intra-frame block copying, a list of prediction region motion information for blocks encoded / decoded based on a translational motion model, and a list of prediction region motion information for blocks encoded / decoded based on an affine motion model. Any one of the multiple lists of prediction region motion information can be selected depending on the inter-frame prediction mode of the current block.

[0261] Figure 21 A diagram showing an example of generating a list of motion information for the predicted region for each inter-frame prediction mode is provided.

[0262] When encoding / decoding a block based on a non-affine motion model, the predicted region merging candidate `mvCand` derived from the block can be added to the predicted region non-affine motion information list `HmvpCandList`. Conversely, when encoding / decoding a block based on an affine motion model, the predicted region merging candidate `mvAfCand` derived from the block can be added to the predicted region affine motion information list `HmvpAfCandList`.

[0263] The affine seed vector of a block encoded / decoded based on an affine motion model can be stored in a prediction region merging candidate derived from the block. Therefore, the prediction region merging candidate can be used as a merging candidate for deriving the affine seed vector of the current block.

[0264] In addition to the aforementioned list of predicted region motion information, another list of predicted region motion information can be defined. Besides the aforementioned list of predicted region motion information (hereinafter referred to as the first list of predicted region motion information), a long-term motion information list (hereinafter referred to as the second list of predicted region motion information) can also be defined. The long-term motion information list includes long-term merging candidates.

[0265] When both the first and second prediction region motion information lists are empty, prediction region merging candidates can first be added to the second prediction region motion information list. Prediction region merging candidates can only be added to the first prediction region motion information list after the number of available prediction region merging candidates in the second prediction region motion information list has reached its maximum.

[0266] Alternatively, an inter-frame prediction merge candidate can be added to both the second prediction region motion information list and the first prediction region motion information list.

[0267] In this case, the already configured second prediction region motion information list does not need to be updated. Alternatively, the second prediction region motion information list can be updated when the decoded region is greater than or equal to a predetermined ratio of slices. Alternatively, the second prediction region motion information list can be updated every N coding tree unit lines.

[0268] On the other hand, the first prediction region motion information list can be updated whenever a block is generated that is encoded / decoded via inter-frame prediction. However, it can be configured not to update the first prediction region motion information list using prediction region merging candidates added to the second prediction region motion information list.

[0269] Information for selecting either the first prediction region motion information list or the second prediction region motion information list can be transmitted via a bitstream signal. When the number of merge candidates included in the merge candidate list is less than a threshold, merge candidates included in the prediction region motion information list indicated by the information can be added to the merge candidate list.

[0270] Alternatively, the list of motion information for the prediction region can be selected based on the size and shape of the current block, the inter-frame prediction mode, whether bidirectional prediction is enabled, whether motion vector refinement is enabled, or whether triangulation is enabled.

[0271] Alternatively, even if the predicted region merging candidates included in the first predicted region motion information list are added, if the number of merging candidates included in the merging candidate list is less than the maximum number of merging, the predicted region merging candidates included in the second predicted region motion information list can be added to the merging candidate list.

[0272] Figure 22 This is a diagram illustrating an example of adding predicted region merging candidates included in the long-term motion information list to the merge candidate list.

[0273] If the number of merge candidates included in the merge candidate list is less than the maximum number, the predicted region merge candidates included in the first predicted region motion information list HmvpCandList can be added to the merge candidate list. If even if the number of merge candidates included in the first predicted region motion information list is less than the maximum number, the predicted region merge candidates included in the long-term motion information list HmvpLTCand can be added to the merge candidate list.

[0274] Table 2 illustrates the process of adding predicted region merging candidates included in the long-term motion information list to the merge candidate list.

[0275] Table 2

[0276]

[0277]

[0278] Predicted region merge candidates can be configured to include additional information besides motion information. For example, block size, shape, or partitioning information can be stored separately for predicted region merge candidates. When constructing the merge candidate list for the current block, only inter-frame merge candidates with the same or similar size, shape, or partitioning information as the current block are used in the inter-frame merge candidate list, or inter-frame merge candidates with the same or similar size, shape, or partitioning information as the current block can be preferentially added to the merge candidate list.

[0279] Alternatively, a list of predicted region motion information can be generated for each of the block's size, shape, or partitioning information. From these multiple lists of predicted region motion information, a list of candidate blocks to be merged can be generated for the current block by using the list of predicted region motion information corresponding to the current block's shape, size, or partitioning information.

[0280] When the number of merge candidates included in the current block's merge candidate list is less than a threshold, the predicted region merge candidates included in the predicted region motion information list can be added to the merge candidate list. The addition process is performed in ascending or descending order of the index. For example, the predicted region merge candidate with the largest index can be added to the merge candidate list first.

[0281] When it is desired to add a predicted region merging candidate to the merge candidate list that will be included in the predicted region motion information list, redundancy detection can be performed between the predicted region merging candidate and the merge candidate already stored in the merge candidate list.

[0282] For example, Table 3 shows the process of adding predicted region merge candidates to the merge candidate list.

[0283] Table 3

[0284]

[0285] Redundancy detection can be performed only on some of the predicted region merging candidates included in the predicted region motion information list. For example, redundancy detection can be performed only on predicted region merging candidates whose indices are greater than or equal to a threshold. Alternatively, redundancy detection can be performed only on the N merging candidates with the largest indices or the N merging candidates with the smallest indices.

[0286] Alternatively, redundancy detection can be performed only on some of the merge candidates already stored in the merge candidate list. For example, redundancy detection can be performed only on merge candidates with an index above or below a threshold, or on merge candidates derived from a block at a specific location. This specific location can include at least one of the current block's left-side neighbor, top-side neighbor, top-right neighbor, or bottom-left neighbor.

[0287] Figure 23 This is a diagram illustrating an example of performing redundancy detection only on some merge candidates.

[0288] When it is desired to add the predicted region merge candidate HmvpCand[j] to the merge candidate list, redundancy checks can be performed on the predicted region merge candidate and the two merge candidates with the largest index, mergeMandCandList[NumMerge-2] and mergeCandList[NumMerge-1]. Here, NumMerge can represent the number of available spatial merge candidates and temporal merge candidates.

[0289] Unlike the example shown in the figure, when it is desired to add the predicted region merge candidate HmvpCand[j] to the merge candidate list, redundancy checks can be performed on the predicted region merge candidate and at most two merge candidates with the smallest index. For example, it can be verified whether mergeCandList[0] and mergeCandList[1] are the same as HmvpCand[j].

[0290] Alternatively, redundancy detection can be performed only on merge candidates derived from a specific location. For example, redundancy detection can be performed only on at least one of merge candidates derived from a neighboring block to the left of the current block or from a neighboring block above the current block. When no merge candidate derived from a specific location exists in the merge candidate list, a predicted region merge candidate can be added to the merge candidate list without performing redundancy detection.

[0291] When it is desired to add the predicted region merge candidate HmvpCand[j] to the merge candidate list, redundancy checks can be performed on the predicted region merge candidate and the two merge candidates with the largest index, mergeMandCandList[NumMerge-2] and mergeCandList[NumMerge-1]. Here, NumMerge can represent the number of available spatial merge candidates and temporal merge candidates.

[0292] Redundancy detection can be performed only on a subset of predicted region merging candidates. For example, redundancy detection can be performed only on N predicted region merging candidates with larger indices or N predicted region merging candidates with smaller indices included in the predicted region motion information list. Alternatively, redundancy detection can be performed only on predicted region merging candidates whose difference between the number of predicted region merging candidates included in the predicted region motion information list and their indices is less than or equal to a threshold. When the threshold is 2, redundancy detection can be performed only on the three predicted region merging candidates with the largest index values ​​included in the predicted region motion information list. Redundancy detection can be skipped for predicted region merging candidates other than these three. When redundancy detection is skipped, predicted region merging candidates can be added to the merging candidate list, regardless of whether they have the same motion information as other merging candidates.

[0293] On the other hand, it can be configured to perform redundancy detection only on prediction region merging candidates whose difference between the number of prediction region merging candidates included in the prediction region motion information list and the index is equal to or greater than a threshold.

[0294] The number of candidate prediction regions to merge for performing redundancy detection can be predefined in the encoder and decoder. For example, the threshold can be an integer such as 0, 1, or 2.

[0295] Alternatively, the threshold can be determined based on at least one of the number of merge candidates included in the merge candidate list and the number of predicted region merge candidates included in the predicted region motion information list.

[0296] When a merge candidate identical to the first predicted region merge candidate is found and redundancy detection is performed on the second predicted region merge candidate, the redundancy detection of the merge candidate identical to the first predicted region merge candidate can be skipped.

[0297] Figure 24 This is a diagram illustrating an example of skipping redundant checks on a specific merge candidate.

[0298] When it is desired to add the predicted region merge candidate HmvpCand[i] with index i to the merge candidate list, redundancy detection is performed between the predicted region merge candidate and the merge candidates already stored in the merge candidate list. In this case, when a merge candidate mergeCand list[j] identical to the predicted region merge candidate HmvpCand[i] is found, redundancy detection can be performed between the predicted region merge candidate HmvpCand[i-1] with index i-1 and the merge candidate, without adding the predicted region merge candidate HmvpCand[i] to the merge candidate list. In this case, redundancy detection between the predicted region merge candidate HmvpCand[i-1] and the merge candidate mergeCandList[j] can be skipped.

[0299] For example, in Figure 24 In the example shown, HmvpCand[i] is determined to be the same as mergeCandList[2]. Therefore, HmvpCand[i] is not added to the merge candidate list, and redundancy detection can be performed on HmvpCand[i-1]. In this case, redundancy detection between HvmpCand[i-1] and mergeCandList[2] can be skipped.

[0300] When the number of merge candidates included in the merge candidate list of the current block is less than a threshold, in addition to the predicted region merge candidates, at least one of paired merge candidates and zero merge candidates may be further included. Paired merge candidates refer to merge candidates whose motion vector is the average of two or more merge candidates, and zero merge candidates refer to merge candidates whose motion vector is 0.

[0301] Merge candidates for the current block can be added in the following order.

[0302] Spatial merge candidate - Temporal merge candidate - Predicted region merge candidate - (Predicted region affine merge candidate) - Paired merge candidate - Zero merge candidate

[0303] Spatial merge candidates refer to merge candidates derived from at least one of neighboring or non-neighboring blocks, while temporal merge candidates refer to merge candidates derived from the previous reference image. The predicted region affine merge candidate column represents predicted region merge candidates derived from blocks encoded / decoded using an affine motion model.

[0304] The prediction region motion information list can also be used in motion vector prediction mode. For example, when the number of motion vector prediction candidates included in the current block's motion vector prediction candidate list is less than a threshold, prediction region merging candidates included in the prediction region motion information list can be set as motion vector prediction candidates for the current block. Specifically, motion vectors from prediction region merging candidates can be set as motion vector prediction candidates.

[0305] If any one of the motion vector prediction candidates included in the motion vector prediction candidate list for the current block is selected, the selected candidate is set as the motion vector prediction value for the current block. Then, after decoding the motion vector residual value for the current block, the motion vector for the current block can be obtained by adding the motion vector prediction value and the motion vector residual value.

[0306] The candidate list for motion vector prediction of the current block can be constructed in the following order.

[0307] Spatial motion vector prediction candidate - Temporal motion vector prediction candidate - Inter-frame prediction region merging candidate - (Inter-frame prediction region affine merging candidate) - Zero motion vector prediction candidate

[0308] Spatial motion vector prediction candidates refer to motion vector prediction candidates derived from at least one of neighboring or non-neighboring blocks, while temporal motion vector prediction candidates refer to motion vector prediction candidates derived from the previous reference image. The prediction region affine merge candidate column represents the prediction region motion vector prediction candidates derived from the blocks encoded / decoded using an affine motion model. Zero motion vector prediction candidates represent candidates with a motion vector value of 0.

[0309] A merge processing region larger than the encoded block can be specified. Encoded blocks included in the merge processing region can be encoded / decoded in parallel, not sequentially. "Not encoded / decoded in sequence" means that the encoding / decoding order is not specified. Therefore, the encoding / decoding process of blocks included in the merge processing region can be processed independently. Alternatively, blocks included in the merge processing region can share merge candidates. These merge candidates can be derived based on the merge processing region.

[0310] Based on the aforementioned characteristics, the merged processing region can also be referred to as the parallel processing region, the shared merge region (SMR), or the merge estimation region (MER).

[0311] Merge candidates for the current block can be derived based on the encoded blocks. However, when the current block is included in a merge processing region that is larger than the current block, candidate blocks included in the same merge processing region as the current block can be set as unusable as merge candidates.

[0312] Figure 25 This is a diagram illustrating an example of setting candidate blocks included in the same merge processing area as the current block as unusable as merge candidates.

[0313] exist Figure 25 In the example on the left shown, when encoding / decoding CU5, blocks that include reference samples adjacent to CU5 can be set as candidate blocks. In this case, candidate blocks X3 and X4, which are included in the same merge processing area as CU5, can be set as unusable merge candidates for CU5. On the other hand, candidate blocks X0, X1, and X2, which are not included in the same merge processing area as CU5, can be set as usable merge candidates.

[0314] exist Figure 25 In the example shown on the right, when encoding / decoding CU8, blocks that include reference samples adjacent to CU8 can be designated as candidate blocks. In this case, candidate blocks X6, X7, and X8, which are included in the same merge processing region as CU8, can be designated as non-merge candidates. On the other hand, candidate blocks X5 and X9, which are not included in the same parallel merge region as CU8, can be designated as merge candidates.

[0315] The merging processing area can be square or non-square. Information for determining the merging processing area can be transmitted via a bit stream using signals. This information may include at least one of information indicating the shape of the merging processing area and information indicating the size of the merging processing area. When the merging processing area is non-square, at least one of information indicating the size of the merging processing area, information indicating the width and / or height of the merging processing area, and information indicating the width-to-height ratio of the merging processing area can be transmitted via a bit stream using signals.

[0316] The size of the merged processing area can be determined based on at least one of the information transmitted via a signal through a bitstream, the image resolution, the slice size, or the tile size.

[0317] When performing motion compensation prediction on blocks included in the merged processing area, prediction region merge candidates derived from the motion information of blocks that have already undergone motion compensation prediction can be added to the prediction region motion information list.

[0318] However, when adding predicted region merging candidates derived from blocks included in the merged processing region to the predicted region motion information list, there may be cases where predicted region merging candidates derived from another block in the merged processing region (which will actually be encoded / decoded after the first block is encoded / decoded) are used when encoding / decoding that other block. That is, although dependencies between blocks should be excluded when encoding / decoding blocks included in the merged processing region, there may be cases where motion information from another block included in the merged processing region is used to perform motion prediction compensation. To address this problem, even after encoding / decoding of blocks included in the merged processing region has been completed, the motion information of the encoded / decoded blocks may not be added to the predicted region motion information list.

[0319] Alternatively, when performing motion compensation prediction on blocks included in the merging processing region, merging candidates for predicted regions derived from the blocks can be added to the predicted region motion information list in a predefined order. Here, the predefined order can be determined based on the scanning order of the coded blocks in the merging processing region or coding tree unit. The scanning order can be at least one of raster scanning, horizontal scanning, vertical scanning, or zigzag scanning. Alternatively, the predefined order can be determined based on the number of blocks having motion information for each block or the number of blocks with the same motion information.

[0320] Alternatively, prediction region merging candidates including unidirectional motion information can be added to the prediction region merging candidate list before those including bidirectional motion information. Conversely, prediction region merging candidates including bidirectional motion information can be added to the prediction region merging candidate list before those including unidirectional motion information.

[0321] Alternatively, prediction region merging candidates can be added to the prediction region motion information list based on the order of high or low usage frequency within the merged processing region or coding tree unit.

[0322] When the current block is included in the merge processing region and the number of merge candidates included in the merge candidate list of the current block is less than the maximum number, predicted region merge candidates included in the predicted region motion information list can be added to the merge candidate list. In this case, it can be configured not to add predicted region merge candidates derived from blocks included in the same merge processing region as the current block to the merge candidate list of the current block.

[0323] Alternatively, when including the current block in the merge processing region, it can be configured not to use the predicted region merge candidates included in the predicted region motion information list. That is, even if the number of merge candidates included in the current block's merge candidate list is less than the maximum number, the predicted region merge candidates included in the predicted region motion information list can be excluded from the merge candidate list.

[0324] A list of predicted region motion information can be configured for merging processing regions or coding tree units. This list serves as a temporary storage for the motion information of blocks included in the merging processing region. To distinguish it from the general predicted region motion information list, the list of predicted region motion information for merging processing regions or coding tree units is referred to as the temporary motion information list. Furthermore, the predicted region merging candidates stored in the temporary motion information list are called temporary merge candidates.

[0325] Figure 26 This is a diagram showing a list of temporary motion information.

[0326] A temporary motion information list for a coding tree unit or merging region can be configured. When motion compensation prediction has already been performed on the current block included in the coding tree unit or merging region, the motion information of that block may not be added to the inter-frame prediction motion information list HmvpCandList. Instead, temporary merging candidates derived from that block can be added to the temporary motion information list HmvpMERCandList. That is, temporary merging candidates added to the temporary motion information list may not be added to the prediction region motion information list. Therefore, the prediction region motion information list may not include prediction region merging candidates derived from the motion information of blocks included in the coding tree unit or merging region.

[0327] The maximum number of merge candidates that the temporary motion information list can include can be set to the same as the maximum number of merge candidates that the prediction region motion information list can include. Alternatively, the maximum number of merge candidates that the temporary motion information list can include can be determined based on the size of the coding tree unit or the merge processing region.

[0328] The current block included in the coding tree unit or merge processing region can be set to a temporary motion information list that does not use the corresponding coding tree unit or merge processing region. That is, when the number of merge candidates included in the current block's merge candidate list is less than a threshold, the predicted region merge candidates included in the predicted region motion information list are added to the merge candidate list, and temporary merge candidates included in the temporary motion information list may not be added to the merge candidate list. Therefore, motion information from other blocks included in the same coding tree unit or merge processing region as the current block can be excluded from motion compensation prediction for the current block.

[0329] Once the encoding / decoding of all blocks included in the coding tree unit or merged processing area is complete, the predicted region motion information list and the temporary motion information list can be merged.

[0330] Figure 27 This is a diagram illustrating an example of merging the list of predicted regional motion information and the temporary motion information list.

[0331] When the encoding / decoding of all blocks included in the encoding tree unit or merge processing area is completed, such as Figure 27 As shown in the example, the predicted region motion information list can be updated using temporary merge candidates included in the temporary motion information list.

[0332] In this case, temporary merge candidates included in the temporary motion information list can be added to the predicted region motion information list in the order they were inserted into the temporary motion information list (i.e., in ascending or descending order of index values).

[0333] As another example, temporary merge candidates included in the temporary motion information list can be added to the predicted region motion information list in a predefined order.

[0334] Here, the predefined order can be determined based on the scanning order of the coded blocks in the merging processing region or coded tree unit. The scanning order can be at least one of raster scanning, horizontal scanning, vertical scanning, or zigzag scanning. Alternatively, the predefined order can be determined based on the number of blocks with motion information for each block or the number of blocks with the same motion information.

[0335] Alternatively, temporary merge candidates including unidirectional motion information can be added to the predicted region merge candidate list before those including bidirectional motion information. Conversely, temporary merge candidates including bidirectional motion information can be added to the predicted region merge candidate list before those including unidirectional motion information.

[0336] Alternatively, temporary merging candidates can be added to the prediction region motion information list based on the order of high or low usage frequency within the merging processing region or coding tree unit.

[0337] When a temporary merge candidate included in the temporary motion information list is added to the prediction region motion information list, redundancy detection of the temporary merge candidate can be performed. For example, if the same prediction region merge candidate as the one included in the temporary motion information list is already stored in the prediction region motion information list, the temporary merge candidate may not be added to the prediction region motion information list. In this case, redundancy detection can be performed on some prediction region merge candidates included in the prediction region motion information list. For example, redundancy detection can be performed on inter-frame prediction merge candidates with an index greater than or equal to a threshold. For example, if a temporary merge candidate is the same as a prediction region merge candidate with an index greater than or equal to a predefined value, the temporary merge candidate may not be added to the prediction region motion information list.

[0338] It is possible to restrict the use of predicted region merge candidates derived from blocks included in the same coding tree unit or merge processing region as the current block as the current block's merge candidate. To this end, address information of the block can be stored separately for the predicted region merge candidates. The block address information includes at least one of the following: the block's location, the block's address, the block's index, the location of the merge processing region including the block, the address of the merge processing region including the block, the index of the merge processing region including the block, the location of the coding tree region including the block, the address of the coding tree region including the block, and the index of the coding tree region including the block.

[0339] Figure 28 and Figure 29 This is a diagram illustrating an example of address information for candidate blocks in a coded region merging scheme.

[0340] Motion information of blocks encoded via inter-frame prediction can be stored as motion information of coding region merging candidates. For example, the block's motion vector mv can be stored as the motion vector mvCand of the coding region merging candidate, and the block's reference image index RefIdx can be stored as the reference image index RefIdxCand of the coding region merging candidate.

[0341] In addition, for coded region merging candidates, the address information of the blocks can be further stored. For example, the address of the block BLK_ADR, the address of the merge processing region of the block MER_ADDR, or the address of the coding tree unit of the block CTU_ADDR can be stored separately.

[0342] exist Figure 28The example shown illustrates how, for a candidate region to be merged, the motion vector mvCand, the reference image index RefIdxCand, and the address MER_ADDR of the region to be merged are stored.

[0343] For the candidate merging of the encoded regions, multiple address information can be stored. Figure 29 The example shown illustrates how, for a candidate region to be merged, the motion vector mvCand, the reference image index RefIdxCand, the address of the merged processing region MER_ADDR, and the address of the coding tree unit CTU_ADDR are stored.

[0344] Whether a coding region merge candidate can be used as a merge candidate for the current block can be determined by comparing the address of the current block with the addresses of coding region merge candidates. For example, a coding region merge candidate can be set to unavailable as a merge candidate for the current block when the index of the merge processing region including the current block is the same as the index of the merge processing region indicated by the coding region merge candidate. Alternatively, a coding region merge candidate can be set to unavailable as a merge candidate for the current block when the index of the coding tree region including the current block is the same as the index of the coding tree region indicated by the coding region merge candidate. That is, coding region merge candidates derived from blocks included in the same merge processing region or coding tree unit as the current block, or coding region merge candidates derived from blocks adjacent to the current block, may not be added to the merge candidate list of the current block.

[0345] Figure 30 and Figure 31 This is a diagram illustrating an example of setting a merge candidate for an encoded region with the same address information as the current block as an unusable merge candidate for the current block.

[0346] When the index of the merge processing region to which the current block belongs is 2, the merge candidate of the encoding region derived from the block belonging to the merge processing region with index 2 can be set to unavailable as the merge candidate of the current block. Figure 30 In the example shown, since the address information of the coding region merging candidate HvmpCand[5] with index 5 indicates index 2, the coding region merging candidate can be set to unavailable as the merging candidate for the current block.

[0347] When the index of the coding tree unit to which the current block belongs is 2 and the index of the merge processing region to which the current block belongs is 1, the coding region merge candidate derived from the block included in the same coding tree unit and merge processing region as the current block can be set as not usable as a merge candidate for the current block. Figure 31In the example shown, in the case of HvmpCand[5], a candidate for merging the coding region with index 5, since the index indicator of the coding tree unit is 2 and the index indicator of the merging processing region is 1, the candidate for merging the coding region can be set as a candidate for merging that cannot be used as the current block.

[0348] As another example, a coding region merge candidate can be set to unavailable when the difference between the address information indicated by the coding region merge candidate and the address information of the current block is greater than or equal to a threshold. For instance, a coding region merge candidate can be set to unavailable when the difference between the address or index of the coding tree unit indicated by the coding region merge candidate and the address or index of the coding tree unit to which the current block belongs is greater than or equal to a threshold.

[0349] Alternatively, as another example, a coded region merge candidate can be set to unavailable when the difference between the address information indicated by the coded region merge candidate and the address information of the current block is less than or equal to a threshold. For example, a coded region merge candidate can be set to unavailable when the difference between the address or index indicated by the coded region merge candidate and the address or index of the current block is less than or equal to a threshold. That is, a coded region merge candidate derived from a block adjacent to the current block can be set to unavailable as a merge candidate for the current block.

[0350] When adding a coded region merge candidate derived from the current block to the coded region motion information list, redundancy detection can be performed. In this case, redundancy detection can determine whether the motion and address information of the coded region merge candidate derived from the current block are identical to those of coded region merge candidates already stored in the coded region motion information list. For example, if a coded region merge candidate with the same motion vector, reference image index, and address information as a coded region merge candidate derived from the current block is already stored, it may not be added to the coded region motion information list. Alternatively, if a coded region merge candidate with the same motion vector, reference image index, and address information as a coded region merge candidate derived from the current block is already stored, the stored coded region merge candidate may be deleted, and the coded region merge candidate derived from the current block may be added to the coded region motion information list. In this case, the maximum or minimum index may be assigned to the coded region merge candidate derived from the current block.

[0351] Alternatively, it can be configured to disregard address information similarity when detecting redundancy. For example, even if the address information of a coding region merge candidate derived from the current block differs from the address information of a coding region merge candidate already stored in the coding region motion information list, if the motion information of the two coding region merge candidates is the same, the coding region merge candidate derived from the current block may not be added to the coding region motion information list. Alternatively, if the address information of a coding region merge candidate derived from the current block is the same as the motion information (address information) of a coding region merge candidate already stored in the coding region motion information list, but the address information (motion information) is different, the stored coding region merge candidate can be deleted, and the coding region merge candidate derived from the current block can be added to the coding region motion information list. In this case, the maximum or minimum index can be assigned to the coding region merge candidate derived from the current block.

[0352] Intra-frame prediction uses reconstructed samples that have already been encoded / decoded from the surrounding blocks to predict the current block. In this case, intra-frame prediction of the current block can use reconstructed samples before the application of the in-loop filter.

[0353] Intra-prediction techniques include matrix-based intra-prediction and general intra-prediction that takes into account the directionality with surrounding reconstructed samples. Information indicating the intra-prediction technique for the current block can be signaled via a bitstream. This information may be a 1-bit flag. Alternatively, the intra-prediction technique for the current block can be determined based on at least one of the intra-prediction techniques of the current block's position, size, shape, or neighboring blocks. For example, when the current block crosses an image boundary, the current block is set not to apply matrix-based intra-prediction.

[0354] Matrix-based intra-frame prediction is a method that obtains the predicted block for the current block by performing matrix multiplication between the matrices stored in the encoder and decoder and the reconstructed samples surrounding the current block. Information specifying any one of the stored matrices can be sent via a bitstream signal. The decoder can then determine the matrix for intra-frame prediction of the current block based on this information and the size of the current block.

[0355] Intra-frame prediction is a method that uses either non-angular intra-frame prediction mode or angular intra-frame prediction mode to obtain the prediction block associated with the current block.

[0356] The residual image can be derived by subtracting the predicted image from the original image. In this case, when the residual image is transformed into the frequency domain, even if high-frequency components are removed, the subjective image quality of the video is not significantly degraded. Therefore, reducing the value of high-frequency components or setting the value of high-frequency components to 0 can improve compression efficiency without causing significant visual distortion. Reflecting these characteristics, the current block can be transformed to decompose the residual image into 2D frequency components. This transformation can be performed using transformation techniques such as Discrete Cosine Transform (DCT) or Discrete Sine Transform (DST).

[0357] After transforming the current block using DCT or DST, the transformed current block can be transformed again. In this case, the DCT- or DST-based transformation can be defined as the first transformation, and the process of transforming the block again using the first transformation can be called the second transformation.

[0358] The first transform can be performed using any of a number of transform kernel candidates. For example, the first transform can be performed using any of DCT2, DCT8, or DCT7.

[0359] Different transform cores can be used for the horizontal and vertical directions. Information representing combinations of horizontal and vertical transform cores can also be transmitted as signals via bitstreams.

[0360] The execution units for the first and second transformations will be different. For example, the first transformation can be performed on an 8×8 block, and the second transformation can be performed on the 4×4 sub-blocks within the transformed 8×8 block. In this case, the transformation coefficients of the remaining regions where the second transformation is not performed can also be set to 0.

[0361] Alternatively, a first transformation can be performed on a 4×4 block, and a second transformation can be performed on an 8×8 region of the 4×4 block that includes the transformation.

[0362] Information indicating whether to perform the second transformation can be sent via a bitstream signal.

[0363] The decoder can perform the inverse of the second transform (second inverse transform), and the result of the second transform can be subjected to the inverse of the first transform (first inverse transform). The residual signal of the current block can be obtained as the result of the execution of the second inverse transform and the first inverse transform.

[0364] Quantization is used to reduce the energy of the block, and the quantization process involves dividing the transformation coefficients by a specific constant. This constant can be derived from quantization parameters, which can be defined as values ​​between 1 and 63.

[0365] If transform and quantization are performed in the encoder, the decoder can obtain the residual block through inverse quantization and inverse transform. The decoder then adds the predicted block and the residual block together to obtain the reconstructed block of the current block.

[0366] If a reconstructed block of the current block is obtained, in-loop filtering can be used to reduce information loss during quantization and encoding. In-loop filters can include at least one of a deblocking filter, a sample adaptive offset filter (SAO), or an adaptive loop filter (ALF).

[0367] Embodiments described with a focus on the decoding or encoding process are also included within the scope of this invention. Variations of multiple embodiments described in a predetermined order, in a different order than those described, are also included within the scope of this invention.

[0368] The embodiments have been described based on a series of steps or flowcharts, but this does not limit the chronological order of the invention, and they can be performed simultaneously or in a different order as needed. Furthermore, in the above embodiments, the structural elements constituting the block diagrams (e.g., units, modules, etc.) can also be implemented as hardware devices or software, and multiple structural elements can be combined to implement a single hardware device or software. The embodiments can be implemented in the form of program instructions, which can be executed by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium can individually or in combination include program instructions, data files, data structures, etc. Examples of computer-readable recording media can include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as CD-ROMs and DVDs; magneto-optical media such as floppy optical disks; and hardware devices specifically configured to store and execute program instructions, such as ROMs, RAMs, and flash memory. The hardware device can be configured to operate as one or more software modules to perform the processing according to the invention, and vice versa.

[0369] Industrial applicability

[0370] This invention can be applied to electronic devices that encode / decode video.

Claims

1. A video decoding method, comprising the following steps: Based on the adjacent blocks of the current block, derive the spatial merging candidates for the current block; Based on the blocks in the reference image, derive temporal merging candidates for the current block; Based on the derived spatial merge candidates and temporal merge candidates, derive the merge candidate list for the current block; When the number of merge candidates in the merge candidate list is less than a first threshold, it is determined whether to add a predicted region merge candidate included in the predicted region motion information list to the merge candidate list based on the following conditions: (a) Whether the difference between the number of predicted region merging candidates included in the predicted region motion information list and the index of the predicted region merging candidate is less than or equal to a second threshold; (b) Whether the motion information of the predicted region merging candidate is the same as the motion information of at least two spatial merging candidates in the current block; In response to determining that the predicted region merging candidate is to be added to the merge candidate list, the predicted region merging candidate is added to the merge candidate list; Based on the merge candidate list, the motion information of the current block is derived; Motion compensation is performed on the current block based on the exported motion information.

2. The method according to claim 1, wherein, The two spatial merge candidates include: a merge candidate derived from the adjacent block to the left of the current block, and a merge candidate derived from the adjacent block above the current block.

3. The method according to claim 2, wherein, When the position of the top-left sample of the current block is (x0, y0), the two spatial merging candidates include: a merging candidate derived from the neighboring block containing the reference sample at position (x0-1, y0+H-1), and a merging candidate derived from the neighboring block containing the reference sample at position (x0+W-1, y0-1), where W is the width of the current block and H is the height of the current block.

4. The method according to claim 2 or 3, wherein, Whether to add a predicted region merging candidate included in the predicted region motion information list to the merging candidate list is determined based on the following conditions: If both conditions (a) and (b) are met, then it is determined that the predicted region merging candidate will not be added to the merging candidate list; If at least one of conditions (a) and (b) is not met, then the predicted region merging candidate is determined to be added to the merging candidate list.

5. The method according to claim 4, wherein, If at least one of conditions (a) and (b) is not met, then it is determined that the predicted region merging candidate is added to the merging candidate list, including: If condition (a) is not met, then regardless of whether condition (b) is met, the predicted region merging candidate is determined to be added to the merging candidate list.

6. The method according to any one of claims 1-5, further comprising: In addition to merging candidates based on the predicted region, the list of merging candidates is also determined based on paired merging candidates and / or zero merging candidates; Based on the merge candidate list, guide the motion information of the current block.

7. A video encoding method, comprising the following steps: Based on the adjacent blocks of the current block, derive the spatial merging candidates for the current block; Based on the blocks in the reference image, derive temporal merging candidates for the current block; Based on the derived spatial merge candidates and temporal merge candidates, derive the merge candidate list for the current block; When the number of merge candidates in the merge candidate list is less than a first threshold, it is determined whether to add a predicted region merge candidate included in the predicted region motion information list to the merge candidate list based on the following conditions: (a) Whether the difference between the number of predicted region merging candidates included in the predicted region motion information list and the index of the predicted region merging candidate is less than or equal to a second threshold; (b) Whether the motion information of the predicted region merging candidate is the same as the motion information of at least two spatial merging candidates in the current block; In response to determining that the predicted region merging candidate is to be added to the merge candidate list, the predicted region merging candidate is added to the merge candidate list; Based on the merge candidate list, the motion information of the current block is derived; Motion compensation is performed on the current block based on the exported motion information.

8. The method according to claim 7, wherein, The two spatial merge candidates include: a merge candidate derived from the adjacent block to the left of the current block, and a merge candidate derived from the adjacent block above the current block.

9. The method according to claim 8, wherein, When the position of the top-left sample of the current block is (x0, y0), the two spatial merging candidates include: a merging candidate derived from the neighboring block containing the reference sample at position (x0-1, y0+H-1), and a merging candidate derived from the neighboring block containing the reference sample at position (x0+W-1, y0-1), where W is the width of the current block and H is the height of the current block.

10. The method according to claim 8 or 9, wherein, Whether to add a predicted region merging candidate included in the predicted region motion information list to the merging candidate list is determined based on the following conditions: If both conditions (a) and (b) are met, then it is determined that the predicted region merging candidate will not be added to the merging candidate list; If at least one of conditions (a) and (b) is not met, then the predicted region merging candidate is determined to be added to the merging candidate list.

11. The method according to claim 10, wherein, If at least one of conditions (a) and (b) is not met, then it is determined that the predicted region merging candidate is added to the merging candidate list, including: If condition (a) is not met, then regardless of whether condition (b) is met, the predicted region merging candidate is determined to be added to the merging candidate list.

12. The method according to any one of claims 7-11, further comprising: In addition to merging candidates based on the predicted region, the list of merging candidates is also determined based on paired merging candidates and / or zero merging candidates; Based on the merge candidate list, guide the motion information of the current block.

13. A video decoding device comprising: An inter-frame prediction unit, which performs the method according to any one of claims 1 to 6.

14. A video encoding device comprising: An inter-frame prediction unit, which is used to perform the method according to any one of claims 7 to 12.

15. A computer-readable storage medium having a computer program and a bitstream stored thereon, characterized in that, When executed by a processor, the computer program implements the method of any one of claims 7 to 12 to generate the bitstream.