Video signal encoding / decoding method and apparatus therefor

By using inter-region motion information to derive merge candidates and update tables post-decoding, the method addresses limitations in existing video encoding/decoding technologies, enhancing inter-block prediction efficiency and compression performance.

JP7894988B2Active Publication Date: 2026-07-24GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2025-08-15
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing video encoding/decoding technologies face limitations in improving compression performance, particularly in deriving merge candidates for video signals, which affects inter-block prediction efficiency.

Method used

The method involves generating a merge candidate list for a block, selecting a merge candidate, and performing motion compensation, with the addition of inter-region motion information from an inter-region motion information table, and updating this table only after decoding all blocks in a merge processing area.

Benefits of technology

This approach enhances inter-block prediction efficiency by deriving merge candidates beyond adjacent blocks, improving the overall compression performance of video signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007894988000045
    Figure 0007894988000045
  • Figure 0007894988000046
    Figure 0007894988000046
  • Figure 0007894988000047
    Figure 0007894988000047
Patent Text Reader

Abstract

To provide a method for deriving merge candidates using an inter-region motion information table in encoding / decoding an image signal, and a device for the same.SOLUTION: An image decoding method includes the steps of: generating a merge candidate list for a first block; selecting one from among merge candidates included in the merge candidate list; and performing motion compensation on the first block based on motion information about the selected merge candidate. In this case, inter-region merge candidates included in an inter region-motion information table can be added to the merge candidate list based on the number of spatial merge candidates and temporal merge candidates included in the merge candidate list.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a video signal encoding / decoding method and apparatus therefor.

Background Art

[0002] With the trend of ever-larger display panels, there is an increasing demand for higher-quality video services. The biggest problem with high-quality video services is a significant increase in data volume. To solve such a problem, research for improving the compression rate of video has been actively carried out. As a typical example, in 2009, the Motion Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) under the umbrella of the International Telecommunication Union - Telecommunication (ITU-T) formed the Joint Collaborative Team on Video Coding (JCT-VC). JCT-VC proposed High Efficiency Video Coding (HEVC), a compression standard having compression performance about twice that of H.264 / AVC, and obtained standard approval on January 25, 2013. With the rapid development of high-quality video services, the performance of HEVC is gradually showing its limits.

Summary of the Invention

Problems to be Solved by the Invention

[0003] An object of the present invention is to provide a method for deriving merge candidates other than merge candidates derived from candidate blocks adjacent to a current block in encoding / decoding a video signal, and an apparatus for executing the method.

[0004] The present invention aims to provide a method for deriving merge candidates using an inter-region motion information table in encoding / decoding video signals, and an apparatus for performing the said method.

[0005] The present invention aims to provide a method for deriving merge candidates for blocks included in a merge processing area when encoding / decoding a video signal, and an apparatus for performing the said method.

[0006] The technical problems that this invention aims to solve are not limited to those mentioned above, and those skilled in the art will be able to clearly understand other technical problems not mentioned above from the following description. [Means for solving the problem]

[0007] The video signal decoding / encoding method according to the present invention includes generating a merge candidate list for a first block, selecting one of the merge candidates included in the merge candidate list, and performing motion compensation for the first block based on the motion information of the selected merge candidate. In this case, based on the number of spatial merge candidates and temporal merge candidates included in the merge candidate list, inter-domain merge candidates included in the inter-domain motion information table can be added to the merge candidate list.

[0008] In the video signal decoding / encoding method according to the present invention, the inter-region motion information table may include inter-region merge candidates derived based on the motion information of a block decoded before the first block. In this case, the inter-region motion information table may not be updated based on the motion information of a second block included in the same merge processing area as the first block.

[0009] In the video signal decoding / encoding method according to the present invention, if the first block is included in the merge processing area, a temporary merge candidate derived based on the motion information of the first block can be added to the temporary motion information table, and when decoding of all blocks included in the merge processing area is completed, the temporary merge candidate can be updated in the inter-area motion information table.

[0010] In the video signal decoding / encoding method according to the present invention, it is possible to determine whether to add the first inter-region merge candidate to the merge candidate list based on the determination result of whether the first inter-region merge candidate included in the inter-region motion information table is the same as at least one merge candidate included in the merge candidate list.

[0011] In the video signal decoding / encoding method according to the present invention, the determination can be performed by comparing at least one merge candidate whose index value is less than or equal to a threshold with the first inter-region merge candidate.

[0012] In the video signal decoding / encoding method according to the present invention, if it is determined that the same merge candidate as the first inter-region merge candidate exists, the first inter-region merge candidate is not added to the merge candidate list. Instead, the decision of whether to add the second inter-region merge candidate to the merge candidate list is made based on the determination result of whether the first inter-region merge candidate included in the inter-region motion information table is the same as at least one merge candidate included in the merge candidate list. In this case, the determination of whether the second inter-region merge candidate and the same merge candidate as the first inter-region merge candidate is identical can be omitted.

[0013] The features of the present invention described above are merely illustrative embodiments of the detailed description of the present invention described later, and do not limit the scope of the present invention. [Effects of the Invention]

[0014] According to the present invention, the inter-block prediction efficiency can be improved by providing a method for deriving merge candidates other than those derived from candidate blocks adjacent to the current block.

[0015] According to the present invention, the inter-region motion information table is used to derive merge candidates, thereby improving inter-region prediction efficiency.

[0016] According to the present invention, the interpretation efficiency can be improved by providing a method for deriving merge candidates for blocks included in the merge processing area.

[0017] The technical effects obtained by the present invention are not limited to those mentioned above, and those skilled in the art will be able to clearly understand other technical effects not mentioned from the following description. [Brief explanation of the drawing]

[0018] [Figure 1] This is a block diagram of a video encoder according to one embodiment of the present invention. [Figure 2] This is a block diagram of an image decoder according to one embodiment of the present invention. [Figure 3] This is a diagram showing a basic coding tree unit according to one embodiment of the present invention. [Figure 4] This diagram illustrates various division patterns of coded blocks. [Figure 5] This diagram shows the partitioning modes of the coding tree unit. [Figure 6] This is a flowchart of an inter-prediction method according to one embodiment of the present invention. [Figure 7] This is a diagram illustrating the nonlinear motion of an object. [Figure 8] This is a flowchart of an inter-prediction method based on affine motion according to one embodiment of the present invention. [Figure 9] A drawing showing affine seed vectors for different affine motion models. [Figure 10] A drawing showing the affine vectors of sub - blocks under a 4 - parameter motion model. [Figure 11] A flowchart of the process for deriving the motion information of the current block under the merge mode. [Figure 12] A drawing showing candidate blocks for deriving merge candidates. [Figure 13] A drawing showing the position of a reference sample. [Figure 14] A drawing showing candidate blocks for deriving merge candidates. [Figure 15] A drawing showing an example where the position of the reference sample is changed. [Figure 16] A drawing showing an example where the position of the reference sample is changed. [Figure 17] A flowchart for explaining the update state of the inter - region motion information table. [Figure 18] A drawing showing an example of updating the inter - region merge candidate list. <00,00108>A drawing showing an example where the index of the stored inter - region merge candidate is updated. [Figure 20] A drawing showing the position of a representative sub - block. [Figure 21] A drawing showing an example where an inter - region motion information table is generated for each inter - prediction mode. [Figure 22] A drawing showing an example where the inter - region merge candidates included in the long - term motion information table are added to the merge candidate list. [Figure 23] A drawing showing an example of performing redundancy detection only for some of the merge candidates. [Figure 24] A drawing showing an example of omitting redundancy detection with a specific merge candidate. [Figure 25]This diagram illustrates an example where a candidate block, located within the same merge processing area as the current block, is set to be unavailable as a merge candidate. [Figure 26] This is a diagram showing a temporary motion information table. [Figure 27] This diagram illustrates an example of merging an inter-domain motion information table with a temporary motion information table. [Figure 28] This is a flowchart of an intra-prediction method according to one embodiment of the present invention. [Figure 29] These are drawings of the reference samples included in each reference sample line. [Figure 30] This diagram shows the intra-prediction mode. [Figure 31] This diagram shows an example of a one-dimensional array in which reference samples are arranged in a single line. [Figure 32] This diagram shows an example of a one-dimensional array in which reference samples are arranged in a single line. [Figure 33] This diagram illustrates the angle formed by the directional intra-prediction mode with a straight line parallel to the x-axis. [Figure 34] This diagram shows how prediction samples are obtained when the current block is not square. [Figure 35] This diagram shows the wide-angle intra-predictive mode. [Figure 36] This is a diagram showing the application of PDPC. [Figure 37] This diagram illustrates an example of how a second merge candidate is identified by considering the search order of candidate blocks. [Figure 38] This diagram shows an example in which a first merge candidate and a second merge candidate are selected from among the merge candidates derived from non-adjacent blocks. [Figure 39] This diagram illustrates an example where weight values ​​applied to a prediction block are determined based on the shape of the candidate block. [Figure 40] This diagram illustrates an example where a non-affine merge candidate is set as the second merge candidate instead of an affine merge candidate. [Figure 41]This diagram shows an example of how merge candidates are replaced. [Figure 42] This is a flowchart showing the process for determining the strength of a block. [Figure 43] This is a diagram showing predefined filter candidates. [Modes for carrying out the invention]

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

[0020] Video encoding and decoding are performed in block units. For example, encoding blocks, transformation blocks, or prediction blocks can be subjected to encoding / decoding processes such as transformation, quantization, prediction, in-loop filtering, or reconstruction.

[0021] Hereinafter, the block to be encoded / decoded will be referred to as the "current block." For example, the current block may represent an encoded block, a transformed block, or a predicted block according to the current encoding / decoding process step.

[0022] Furthermore, as used herein, the term “unit” can be understood to refer to a basic unit for performing a particular encoding / decoding process, while “block” can be understood to refer to a sample array of a given size. Unless otherwise specified, “block” and “unit” can be used interchangeably. For example, in the embodiments described later, encoding blocks and encoding units can be understood to be mutually equivalent.

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

[0024] Referring to Figure 1, the video encoding device 100 may include an image splitting unit 110, prediction units 120, 125, a conversion unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse conversion unit 145, a filter unit 150, and a memory 155.

[0025] The components shown in Figure 1 are shown independently to illustrate different characteristic functions in a video encoding device, and do not imply that each component consists of separate hardware or a single software component. That is, for the sake of explanation, each component can be arranged so that at least two of the components are merged into one component, or one component can be divided into multiple components to perform its function, and as long as these do not deviate from the essence of the present invention, embodiments in which these components are integrated and embodiments in which the components are separated are also covered within the scope of the present invention.

[0026] Furthermore, some components are not necessary to perform the essential functions of the present invention, but are merely optional components for improving performance. The present invention can be embodied by including only the components necessary to embody the essence of the invention, excluding components used to improve performance, and a structure including only the necessary components, excluding optional components for improving performance, is also within the scope of protection of the present invention.

[0027] The image splitting unit 110 can split an input image into at least one processing unit. In this case, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The image splitting unit 110 can split a single image into multiple coding units, combinations of prediction units and transform units, and then select one combination of coding units, prediction units, and transform units based on a predetermined criterion (e.g., a cost function) to encode the image.

[0028] For example, a single image can be divided into multiple coding units. While recursive tree structures such as a Quad Tree Structure can be used to divide an image into coding units, a coding unit that is rooted to a single image or the largest coding unit can be divided into other coding units, each with as many child nodes as there are coding units it is divided into. Depending on certain constraints, coding units that cannot be further divided become leaf nodes. That is, assuming only square division is possible for a single coding unit, a single coding unit can be divided into up to four different coding units.

[0029] In the following embodiments of the present invention, the term "encoding unit" may be used to mean a unit that performs encoding, or it may be used to mean a unit that performs decoding.

[0030] A prediction unit may be divided within a single coding unit into at least one square or rectangle of the same size, or one of the prediction units divided within a single coding unit may be divided such that it has a different shape and / or size from the other prediction unit.

[0031] When generating prediction units for intra-prediction based on coding units, if the coding unit is not the smallest coding unit, intra-prediction can be performed without dividing it into multiple prediction units NxN.

[0032] The prediction units 120 and 125 may include an inter-prediction unit 120 that performs inter-prediction and an intra-prediction unit 125 that performs intra-prediction. For each prediction unit, it is possible to decide whether to use inter-prediction or intra-prediction, and to determine specific information related to each prediction method (e.g., intra-prediction mode, motion vector, reference image, etc.). In this case, the processing unit that performs prediction and the processing unit that determines the prediction method and specific details may be different. For example, the prediction method and prediction mode may be determined at the prediction unit, and the execution of the prediction may be performed at the transformation unit. The residual value (residual block) between the generated prediction block and the original block can be input to the transformation unit 130. In addition, prediction mode information, motion vector information, etc. used for prediction can be encoded together with the residual value in the entropy encoding unit 165 and transmitted to the decoder. When using a specific encoding mode, it is also possible to encode the original block as is and transmit it to the decoder unit without generating prediction blocks via the prediction units 120 and 125.

[0033] The interpretation unit 120 may predict prediction units based on information from at least one image, either the image preceding the current image or the image following the current image. In some cases, it may also predict prediction units based on information from a portion of the current image that has been encoded. The interpretation unit 120 may include a reference image interpolation unit, a motion prediction unit, and a motion compensation unit.

[0034] The reference image interpolation unit receives reference image information from memory 155 and can generate pixel information of integer pixels or smaller from the reference image. In the case of luminance pixels, a DCT-based 8-tab interpolation filter with different filter coefficients can be used to generate pixel information of integer pixels or smaller in 1 / 4 pixel units. In the case of color difference signals, a DCT-based 4-tab interpolation filter with different filter coefficients can be used to generate pixel information of integer pixels or smaller in 1 / 8 pixel units.

[0035] The motion prediction unit can perform motion prediction based on the reference image interpolated by the reference image interpolation unit. Various methods can be used to calculate the motion vector, including the Full search-based Block Matching Algorithm (FBMA), Three Step Search (TSS), and the New Three-Step Search Algorithm (NTS). The motion vector can have motion vector values ​​in units of 1 / 2 or 1 / 4 pixels based on the interpolated pixels. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various motion prediction methods can be used, including the Skip method, Merge method, Advanced Motion Vector Prediction (AMVP) method, and Intra Block Copy method.

[0036] The intra-prediction unit 125 can generate prediction units based on reference pixel information surrounding the current block, which is pixel information within the current image. If the blocks surrounding the current prediction unit are blocks that have undergone inter-prediction, and the reference pixels are pixels that have undergone inter-prediction, the reference pixels included in the inter-predicted block can be replaced with the reference pixel information of the surrounding blocks that have undergone intra-prediction. That is, if a reference pixel is unavailable, the unavailable reference pixel information can be replaced with at least one of the available reference pixels.

[0037] In intra-prediction, the prediction mode may include a directional prediction mode that uses reference pixel information according to the prediction direction, and a non-directional mode that does not use directional information when predicting. The mode for predicting luminance information and the mode for predicting chromatic difference information may be different, and the intra-prediction mode information used for predicting luminance information or the predicted luminance signal information can be applied to predict chromatic difference information.

[0038] When performing intraprediction, if the size of the prediction unit and the size of the transformation unit are the same, intraprediction for the prediction unit can be performed based on the pixels to the left of the prediction unit, the pixels to the upper left, and the pixels at the top of the prediction unit. However, when performing intraprediction, if the size of the prediction unit and the size of the transformation unit are different, intraprediction can be performed using a single reference pixel based on the transformation unit. In addition, intraprediction using NxN partitioning can be used only for the smallest coding unit.

[0039] The intra-prediction method can generate a prediction block after applying an Adaptive Intra Smoothing (AIS) filter to a reference pixel according to the prediction mode. The type of AIS filter applied to the reference pixel may vary. To perform the intra-prediction method, the intra-prediction mode of the current prediction unit can be predicted from the intra-prediction modes of the prediction units surrounding the current prediction unit. When predicting the prediction mode of the current prediction unit using mode information predicted from surrounding prediction units, if the intra-prediction modes of the current prediction unit and the surrounding prediction units are the same, information indicating that the prediction modes of the current prediction unit and the surrounding prediction units are the same can be transmitted using predetermined flag information. If the prediction modes of the current prediction unit and the surrounding prediction units are different, the prediction mode information of the current block can be encoded by entropy coding.

[0040] Furthermore, based on the prediction units generated by the prediction units 120 and 125, residual blocks containing residual value information, which is the difference between the predicted prediction unit and the original block of the prediction unit, can be generated. The generated residual blocks can be input to the conversion unit 130.

[0041] The transformation unit 130 can transform the residual block, which includes the residual value information of the original block and the prediction units generated by the prediction units 120 and 125, using transformation methods such as the discrete cosine transform (DCT), discrete sine transform (DST), and KL transform (KLT). Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on the intra-prediction mode information of the prediction units used to generate the residual block.

[0042] The quantization unit 135 can quantize the values ​​converted to the frequency domain in the conversion unit 130. The quantization coefficient can be changed depending on the block or the importance of the image. The values ​​calculated by the quantization unit 135 can be provided to the inverse quantization unit 140 and the rearrangement unit 160.

[0043] The rearrangement unit 160 can perform a rearrangement of coefficient values ​​for the quantized residual values.

[0044] The rearrangement unit 160 can convert two-dimensional block shape coefficients into one-dimensional vector format through a coefficient scanning method. For example, the rearrangement unit 160 can use a zig-zag scan method to scan from DC coefficients to high-frequency coefficients and convert them into one-dimensional vector format. Depending on the size of the conversion unit and the intra-prediction mode, a vertical scan that scans the two-dimensional block shape coefficients along the column direction or a horizontal scan that scans the two-dimensional block shape coefficients along the row direction can also be used instead of a zig-zag scan. That is, depending on the size of the conversion unit and the intra-prediction mode, it can be determined which scanning method to use from zig-zag scan, vertical scan, and horizontal scan.

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

[0046] The entropy coding unit 165 can encode various information from the rearrangement unit 160 and the prediction units 120 and 125, including residual coefficient information and block type information for coding units, prediction mode information, division unit information, prediction unit information and transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information.

[0047] The entropy encoding unit 165 can entropy encode the coefficient values ​​of the encoding units input to the rearrangement unit 160.

[0048] The inverse quantization unit 140 and the inverse transformation unit 145 inverse quantize the values ​​quantized by the quantization unit 135 and inversely transform the values ​​transformed by the transformation unit 130. The residual values ​​generated by the inverse quantization unit 140 and the inverse transformation unit 145 can be combined with the motion estimation unit included in the prediction units 120 and 125 and the prediction units predicted by the motion compensation unit and the intra prediction unit to generate a reconstructed block.

[0049] The filter section 150 may include at least one of the following: a deblocking filter, an offset correction section, and an adaptive loop filter (ALF).

[0050] A deblocking filter can remove block distortion caused by the boundaries between blocks in a reconstructed image. To determine whether to deblock, it is possible to determine whether to apply a deblocking filter to the current block based on the pixels contained in some columns or rows within the block. If a deblocking filter is applied to a block, a strong filter or a weak filter can be applied depending on the required intensity of the deblocking filter. Furthermore, by applying a deblocking filter, when performing vertical filtering and horizontal filtering, horizontal filtering and vertical filtering can be processed in parallel.

[0051] The offset correction unit can correct the offset between the deblocked image and the original image on a pixel-by-pixel basis. To perform offset correction on a specific image, one can divide the pixels contained in the image into a specific number of regions, determine the region to be offset, and then apply the offset to the corresponding region, or apply the offset while considering the edge information of each pixel.

[0052] Adaptive Loop Filtering (ALF) can be performed based on a comparison between the filtered reconstructed image and the original image. Pixels in the image can be divided into predetermined groups, and a single filter can be determined to apply to each group, allowing for differential filtering. Information related to whether or not to apply ALF, along with luminance signals, can be transmitted for each ALF coding unit (CU), and the shape and filter coefficients of the applied ALF filter will differ depending on the block. Alternatively, the same type of ALF filter (fixed type) can be applied regardless of the characteristics of the block to which it is applied.

[0053] The memory 155 can store the reconstructed blocks or images calculated by the filter unit 150, and the stored reconstructed blocks or images can be provided to the prediction units 120 and 125 when performing interpretation.

[0054] Figure 2 is a block diagram of an image decoder according to an embodiment of the present invention.

[0055] Referring to Figure 2, the video decoder 200 may include an entropy decoding unit 210, a rearrangement unit 215, an inverse quantization unit 220, an inverse transformation unit 225, prediction units 230 and 235, a filter unit 240, and a memory 245.

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

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

[0058] The entropy decoding unit 210 can decode information regarding the intra-prediction and inter-prediction performed by the encoder.

[0059] The rearrangement unit 215 can rearrange the bitstream that has been entropi-decoded by the entropy decoding unit 210 in the encoding unit, based on the rearrangement method used in the encoding unit. Coefficients expressed in the form of one-dimensional vectors can be reconstructed and rearranged into coefficients in the form of two-dimensional blocks. The rearrangement unit 215 can receive information related to the coefficient scan performed by the encoding unit and rearrange it by scanning in reverse based on the scan order performed by the corresponding encoding unit.

[0060] 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.

[0061] The inverse transform unit 225 can perform inverse transforms, i.e., inverse DCT, inverse DST, and inverse KLT, on the quantization results performed by the video encoder, with respect to the transforms performed by the transform unit, i.e., DCT, DST, and KLT. The inverse transform can be performed based on the transmission unit determined by the video encoder. The inverse transform unit 225 of the video decoder can selectively perform a transform method (e.g., DCT, DST, KLT) according to multiple pieces of information such as the prediction method, the current block size, and the prediction direction.

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

[0063] As described above, when performing intraprediction, similar to the operation in a video encoder, if the size of the prediction unit and the size of the transformation unit are the same, intraprediction for the prediction unit is performed based on the pixels to the left of the prediction unit, the pixels to the upper left, and the pixels at the top of the prediction unit. However, when performing intraprediction, if the size of the prediction unit and the size of the transformation unit are different, intraprediction can be performed using a single reference pixel based on the transformation unit. It is also possible to use intraprediction that uses NxN partitioning only for the smallest coding unit.

[0064] The prediction units 230 and 235 may include a prediction unit determination unit, an inter-prediction unit, and an intra-prediction unit. The prediction unit determination unit receives various information such as prediction unit information input from the entropy decoding unit 210, prediction mode information of the intra-prediction method, and motion prediction-related information of the inter-prediction method, and can classify prediction units by the current coding unit and determine whether the prediction unit performs inter-prediction or intra-prediction. The inter-prediction unit 230 can use the information necessary for inter-prediction of the current prediction unit provided by the video encoder to perform inter-prediction for the current prediction unit based on information contained in at least one image that precedes or follows the current image containing the current prediction unit. Alternatively, it can perform inter-prediction based on information of a subregion reconstructed from the current image containing the current prediction unit.

[0065] To perform inter-prediction, it is possible to determine, based on the coding unit, which of the following motion prediction methods—Skip Mode, Merge Mode, Motion Vector Prediction Mode (AMVP Mode), or Intrablock Copy Mode—is used for the prediction unit contained within the corresponding coding unit.

[0066] The intra-prediction unit 235 can generate prediction blocks based on the pixel information in the current image. If the prediction unit is a prediction unit that performs intra-prediction, it can perform intra-prediction 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 AIS filter is the part that filters the reference pixels of the current block, and it can decide whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block using the prediction mode of the prediction unit and the AIS filter information provided by the video encoder. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.

[0067] The reference pixel interpolation unit can interpolate reference pixels to generate reference pixels of integer values ​​or smaller pixel units if the prediction mode of the prediction unit is a prediction unit that performs intra-prediction based on the pixel values ​​that interpolate the reference pixels. If the prediction mode of the current prediction unit is a prediction mode that generates prediction blocks without interpolating reference pixels, the reference pixels may not be interpolated. The DC filter can generate prediction blocks by filtering if the prediction mode of the current block is DC mode.

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

[0069] The video decoder can receive information from the video encoder regarding whether a deblocking filter has been applied to the corresponding block or image, and, if so, whether a strong or weak filter was applied. The video decoder's deblocking filter receives the deblocking filter-related information provided by the video encoder and can perform deblocking filtering on the corresponding block.

[0070] The offset correction unit can apply offset correction to the reconstructed video based on the type of offset correction applied to the video during encoding and information on the offset value.

[0071] Based on information provided by the encoder, such as whether or not to apply ALF, and ALF coefficient information, the ALF can be applied to the coding unit. Such ALF information can be provided in a specific set of parameters.

[0072] The memory 245 stores the reconstructed image or block so that the image or block can be used as a reference image or reference block, and can also provide the reconstructed image to the output unit.

[0073] Figure 3 is a diagram showing a basic coding tree unit according to an embodiment of the present invention.

[0074] The largest coding block can be defined as a coding tree block. A single image is divided into multiple coding tree units (CTUs). A coding tree unit is the largest coding unit and is also called a Largest Coding Unit (LCU). Figure 3 shows an example where a single image is divided into multiple coding tree units.

[0075] The size of an encoded tree unit can be defined at the image level or the sequence level. Therefore, information representing the size of an encoded tree unit can be signaled via an image parameter set or a sequence parameter set.

[0076] For example, the size of the coding tree unit for an image in a sequence can be set to 128x128. Alternatively, the size of the coding tree unit can be determined to be either 128x128 or 256x256 at the image level. For example, the size of the coding tree unit for the first image can be set to 128x128, and the size of the coding tree unit for the second image can be set to 256x256.

[0077] By dividing the coding tree unit, coding blocks can be generated. A coding block represents a basic unit for coding / decoding processing. For example, prediction or transformation can be performed on each coding block, or a predictive coding mode can be determined for each coding block. Here, the predictive coding mode represents a method for generating the predicted image. For example, predictive coding modes may include intra-prediction, inter-prediction, current picture referencing (CPR), or intra-block copy (IBC), or combined prediction. For coding blocks, at least one predictive coding mode from intra-prediction, inter-prediction, current picture referencing, or combined prediction can be used to generate the prediction block associated with the coding block.

[0078] Information representing the predictive coding mode of the current block can be transmitted via a bitstream signal. For example, this information may indicate whether the predictive coding mode is intra-mode or inter-mode with a single-bit flag. Only when the predictive coding mode of the current block is determined to be inter-mode can image referencing or composite prediction be used.

[0079] The current image reference is used to set the current image as the reference image and to obtain the predicted block of the current block from the encoded / decoded region within the current image. Here, the current image means the image containing the current block. Information indicating whether the current block applies the current image reference can be transmitted via a bitstream signal. For example, the information may be a 1-bit flag. If the flag is true, the predicted encoding mode of the current block can be determined as current image reference, and if the flag is false, the predicted mode of the current block can be determined as inter-prediction.

[0080] Alternatively, the predictive coding mode for the current block can be determined based on a reference image index. For example, if the reference image index points to the current image, the predictive coding mode for the current block can be determined as the current image reference. If the reference image index points to an image other than the current image, the predictive coding mode for the current block can be determined as the inter-prediction. That is, current image reference is a prediction method that uses information from the coded / decoded region within the current image, while inter-prediction is a prediction method that uses information from other coded / decoded images.

[0081] Compound prediction is an encoding mode that combines two or more of the following: intra-prediction, inter-prediction, and current image reference. For example, when applying compound prediction, a first prediction block can be generated based on one of the intra-prediction, inter-prediction, or current image reference, and a second prediction block can be generated based on another. Once the first and second prediction blocks are generated, the final prediction block can be generated by averaging or weighting the first and second prediction blocks. Information indicating whether compound prediction is to be applied can be transmitted via a bitstream signal. This information may be a single-bit flag.

[0082] Figure 4 is a diagram illustrating various division patterns of the coding block.

[0083] Based on quad-tree, binary-tree, or triple-tree partitioning, an encoded block can be divided into multiple encoded blocks. Based on quad-tree, binary-tree, or triple-tree partitioning, the divided encoded blocks can also be divided into multiple encoded blocks again.

[0084] Quad tree partitioning refers to a partitioning technique that divides the current block partition into four blocks. As a result of quad tree partitioning, the current block partition can be divided into four square partitions (Figure 4(a) "SPLIT_QT").

[0085] Binary tree partitioning refers to a partitioning technique that divides the current block into two blocks. Dividing the current block into two blocks along the vertical direction (i.e., using vertical lines that cross the current block) can be called vertical binary tree partitioning, and dividing the current block into two blocks along the horizontal direction (i.e., using horizontal lines that cross the current block) can be called horizontal binary tree partitioning. As a result of the binary tree partitioning, the current block can be divided into two non-square partitions. Figure 4(b) "SPLIT_BT_VER" represents the result of vertical binary tree partitioning, and Figure 4(c) "SPLIT_BT_HOR" represents the result of horizontal binary tree partitioning.

[0086] Triple tree partitioning refers to a partitioning technique that divides the current block into three blocks. Dividing the current block into three blocks along the vertical direction (i.e., using two vertical lines that cross the current block) can be called vertical triple tree partitioning, and dividing the current block into three blocks along the horizontal direction (i.e., using two horizontal lines that cross the current block) can be called horizontal triple tree partitioning. As a result of the triple tree partitioning, the current block can be divided into three non-square partitions. In this case, the width / height of the partition located in the center of the current block may be twice the width / height of the other partitions. Figure 4(d) "SPLIT_TT_VER" represents the result of vertical triple tree partitioning, and Figure 4(e) "SPLIT_TT_HOR" represents the result of horizontal triple tree partitioning.

[0087] The number of divisions in an encoded tree unit can be defined as the partitioning depth. The maximum partitioning depth of an encoded tree unit can be determined by the sequence or image level. This means that the maximum partitioning depth of an encoded tree unit may differ from sequence to sequence or image to image.

[0088] Alternatively, the maximum partitioning depth for each partitioning technique can be determined individually. For example, the maximum partitioning depth allowed for a quad-tree partition may differ from the maximum partitioning depth allowed for a binary-tree partition and / or a triple-tree partition.

[0089] The encoder can signal information via the bitstream that represents at least one of the division configuration or division depth of the current block. The decoder can determine the division configuration and division depth of the coded tree unit based on the information analyzed from the bitstream.

[0090] Figure 5 is a diagram showing the partitioning modes of the coding tree unit.

[0091] The process of dividing an encoded block using partitioning techniques such as quad-tree partitioning, binary-tree partitioning, and / or triple-tree partitioning can be referred to as multi-tree partitioning.

[0092] A coded block generated by applying multi-tree partitioning to a coded block can be called a subcoded block. If the partitioning depth of the coded block is k, the partitioning depth of the subcoded block is set to k+1.

[0093] Conversely, for a coding block with a partitioning depth of k+1, a coding block with a partitioning depth of k can be called a higher-level coding block.

[0094] The partition type of the current coded block can be determined based on at least one of the partition configuration of the upper coded block or the partition type of the adjacent coded block. Here, adjacent coded blocks are adjacent to the current coded block and may include at least one of the upper adjacent block, left adjacent block, or adjacent block adjacent to the upper left corner of the current coded block. Here, the partition type may include at least one of whether to partition into a quad tree, whether to partition into a binary tree, the direction of the binary tree partition, whether to partition into a triple tree, or the direction of the triple tree partition.

[0095] To determine the partitioning method of an encoded block, information indicating whether or not the encoded block will be partitioned can be signaled via the bitstream. This information is a 1-bit flag "split_cu_flag", and if the flag is true, it indicates that the encoded block will be partitioned using a multi-tree partitioning technique.

[0096] If split_cu_flag is true, information indicating whether the encoded block is quad-tree split can be signaled via the bitstream. This information is a 1-bit flag "split_qt_flag", and if this flag is true, the encoded block can be split into four blocks.

[0097] As an example, Figure 5 shows that when a coding tree unit is subjected to quad-tree partitioning, four coding blocks with a partitioning depth of 1 are generated. It also shows that the first and fourth coding blocks among the four coding blocks generated as a result of the quad-tree partitioning are subjected to quad-tree partitioning again. As a result, four coding blocks with a partitioning depth of 2 can be generated.

[0098] Furthermore, by applying quad-tree partitioning again to an encoded block with a partitioning depth of 2, it is possible to generate an encoded block with a partitioning depth of 3.

[0099] If a quad-tree split is not applied to an encoded block, it is possible to determine whether to perform a binary tree split or a triple-tree split on the encoded block by considering at least one of the following: the size of the encoded block, whether the encoded block is located at the boundary of the image, the maximum split depth, or the split shape of adjacent blocks. If it is determined that a binary tree split or a triple-tree split is applied to the encoded block, information indicating the split direction can be signaled via the bitstream. This information may be a 1-bit flag "mtt_split_cu_vertical_flag". Based on this flag, it is possible to determine whether the split direction is vertical or horizontal. In addition, information indicating whether either a binary tree split or a triple-tree split is applied to the encoded block can be signaled via the bitstream. This information may be a 1-bit flag "mtt_split_cu_binary_flag". Based on this flag, it is possible to determine whether a binary tree split or a triple-tree split is applied to the encoded block.

[0100] As an example, Figure 5 shows that a vertical binary tree partitioning is applied to an encoded block with a partitioning depth of 1, and as a result of the partitioning, a vertical triple tree partitioning is applied to the left encoded block and a vertical binary tree partitioning is applied to the right encoded block.

[0101] Collocated prediction is a predictive coding mode that uses information from previous images to predict the current block. As an example, a block located at the same position as the current block in a previous image (hereinafter referred to as a collocated block) can be set as the predicted block for the current block. Hereafter, a predicted block generated based on a block at the same position as the current block will be referred to as a collocated prediction block.

[0102] On the other hand, if an object that was present in a previous image moves to a different location in the current image, the object's movement can be used to effectively predict the current block. For example, by comparing the previous image with the current image, the direction and size of the object's movement can be known, and a predicted block (or predicted image) of the current block can be generated, taking into account the object's movement information. Hereafter, the predicted block generated using motion information can be referred to as a motion prediction block.

[0103] A residual block can be generated by subtracting the predicted block from the current block. In this case, if object movement exists, the energy of the residual block can be reduced by using a motion prediction block instead of a same-position prediction block, thereby improving the compression performance of the residual block.

[0104] As described above, generating prediction blocks using motion information can be called motion-compensated prediction. In most interpretation systems, prediction blocks can be generated based on motion-compensated prediction.

[0105] Motion information may include at least one of the following: a motion vector, a reference image index, and a weight index for the prediction direction or both directions. The motion vector represents the direction and size of the object's movement. The reference image index identifies the reference image of the current block from among the reference images included in the reference image list. The prediction direction refers to either a one-way L0 prediction, a one-way L1 prediction, or a two-way prediction (L0 and L1 prediction). Depending on the prediction direction of the current block, at least one of the motion information for the L0 direction or the motion information for the L1 direction can be used. The weight index for both directions identifies the weight values ​​applied to the L0 prediction block and the weight values ​​applied to the L1 prediction block.

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

[0107] Referring to Figure 6, the inter-prediction method includes determining the inter-prediction mode of the current block (step S601), acquiring motion information of the current block according to the determined inter-prediction mode (step S602), and performing motion compensation prediction for the current block based on the acquired motion information (step S603).

[0108] Here, the interpretation mode represents various techniques for determining the motion information of the current block, and this interpretation mode may include an interpretation mode that uses translation motion information and an interpretation mode that uses affine motion information. For example, an interpretation mode that uses translation motion information may include a merge mode and a motion vector prediction mode, and an interpretation mode that uses affine motion information may include an affine merge mode and an affine motion vector prediction mode. According to the interpretation mode, the motion information of the current block can be determined based on information analyzed from adjacent blocks or bitstreams adjacent to the current block.

[0109] The following describes in detail an interpretation method that uses affine motion information.

[0110] Figure 7 is a diagram illustrating the nonlinear motion of an object.

[0111] The movement of objects in a video can be nonlinear. For example, as shown in Figure 7, nonlinear motion of objects can occur through zoom-in, zoom-out, rotation, or affine transformations. When nonlinear motion occurs in an object, the movement cannot be effectively represented by a translational motion vector. Therefore, encoding efficiency can be improved by using affine motion instead of translational motion in parts where nonlinear motion occurs in an object.

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

[0113] Based on the information analyzed from the bitstream, it is possible to determine whether to apply the inter-prediction technique based on affine motion to the current block. Specifically, it is possible to determine whether the inter-prediction technique based on affine motion is applied to the current block based on at least one of the following flags: a flag indicating whether the affine merge mode is applied to the current block, or a flag indicating whether the affine motion vector prediction mode is applied to the current block.

[0114] When an interpretation technique based on affine motion is applied to the current block, the affine motion model of the current block can be determined (step 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. A 6-parameter affine motion model uses six parameters to represent affine motion, and a 4-parameter affine motion model uses four parameters to represent affine motion.

[0115] Equation 1 represents affine motion using six parameters. Affine motion represents translational motion within a given region determined by the affine seed vector.

[0116]

number

[0117] While using six parameters to represent affine motion allows for the representation of complex movements, it can lead to reduced encoding efficiency due to the large number of bits required to encode each parameter. Therefore, it is also possible to represent affine motion using four parameters. Equation 2 shows how affine motion is represented using four parameters.

[0118]

number

[0119] Information for determining the affine motion model of the current block can be encoded and signaled via a bitstream. For example, the information may be a 1-bit flag "affine_type_flag". A value of 0 for the flag indicates that a 4-parameter affine motion model is applied, and a value of 1 indicates that a 6-parameter affine motion model is applied. The flag can be encoded on a slice, tile, or block basis (e.g., encoded block or encoded tree unit). When the flag is signaled at the slice level, the affine motion model determined by the slice level can be applied to all blocks belonging to that slice.

[0120] Alternatively, the affine motion model of the current block can be determined based on the affine interpretation mode of the current block. For example, if the affine merge mode is applied, the affine motion model of the current block can be determined as a 4-parameter motion model. On the other hand, if the affine motion vector prediction mode is applied, information for determining the affine motion model of the current block can be encoded and signaled via a bitstream. For example, if the affine motion vector prediction mode is applied to the current block, the affine motion model of the current block can be determined based on a 1-bit flag "affine_type_flag".

[0121] Next, the affine seed vector of the current block can be derived (step S802). If a 4-parameter affine motion model is selected, motion vectors at two control points of the current block can be derived. Alternatively, if a 6-parameter affine motion model is selected, motion vectors at three control points of the current block can be derived. The motion vectors at the control points can be called affine seed vectors. The control points may include at least one of the top-left corner, top-right corner, or bottom-left corner of the current block.

[0122] Figure 9 is a diagram showing the affine seed vectors for different affine motion models.

[0123] In a four-parameter affine motion model, affine seed vectors can be derived for two of the following corners: the upper left corner, the upper right corner, or the lower left corner. For example, as shown in Figure 9(a), if a four-parameter affine motion model is selected, the affine vector can be derived using the affine seed vector sv0 for the upper left corner of the current block (e.g., the upper left sample (x1, y1)) and the affine seed vector sv1 for the upper right corner of the current block (e.g., the upper right sample (x1, y1)). Instead of the affine seed vector for the upper left corner, the affine seed vector for the lower left corner can be used, or instead of the affine seed vector for the upper right corner, the affine seed vector for the lower left corner can be used.

[0124] In a 6-parameter affine motion model, affine seed vectors can be derived for the upper-left corner, upper-right corner, and lower-left corner. For example, as shown in Figure 9(b), if a 6-parameter affine motion model is selected, affine vectors can be derived using the affine seed vector sv0 for the upper-left corner of the current block (e.g., the upper-left sample (x1, y1)), the affine seed vector sv1 for the upper-right corner of the current block (e.g., the upper-right sample (x1, y1)), and the affine seed vector sv2 for the upper-left corner of the current block (e.g., the upper-left sample (x2, y2)).

[0125] In the embodiments described later, under the four-parameter affine motion model, the affine seed vectors of the upper-left control point and the upper-right control point will be referred to as the first affine seed vector and the second affine seed vector, respectively. In 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 with the affine seed vector of the lower-left control point (third affine seed vector) or the affine seed vector of the lower-right control point (fourth affine seed vector).

[0126] Furthermore, under 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 referred to as the first affine seed vector, second affine seed vector, and third affine seed vector, respectively. In the embodiment 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 with the affine seed vector of the lower-right control point (fourth affine seed vector).

[0127] Using the affine seed vector, an affine vector can be derived for each subblock (step S803). Here, the affine vector represents the translational motion vector derived based on the affine seed vector. The affine vector of a subblock can be referred to as the affine subblock motion vector or subblock motion vector.

[0128] Figure 10 is a diagram showing the affine vectors of a subblock under a four-parameter motion model.

[0129] Based on the control point positions, subblock positions, and affine seed vectors, the affine vectors of the subblocks can be derived. As an example, Equation 3 shows an example of deriving the affine subblock vector.

[0130]

number

[0131] In equation 3 above, (x,y) represents the position of the subblock. Here, the position of the subblock represents the position of the reference sample contained within the subblock. The reference sample may be a sample located in the upper left corner of the subblock, or a sample in which at least one of the x-axis or y-axis coordinates is at the center. (x0,y0) represents the position of the first control point, and (sv 0x sv 0y ) represents the first affine seed vector. Also, (x1, y1) represents the position of the second control point, and (sv 1x sv 1y ) represents the second affine seed vector.

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

[0133] Then, using the affine vector of each subblock, motion compensation prediction can be performed for each subblock (step S804). As a result of the motion compensation prediction, a prediction block can be generated for each subblock. The prediction block of a subblock can be set as the prediction block of the current block.

[0134] The following describes in detail the interpretation method that uses translational motion information.

[0135] The motion information of the current block can be derived from the motion information of other blocks. Here, the other blocks may be blocks that were encoded / decoded by interpretation before the current block. Setting the motion information of the current block in the same way as the motion information of other blocks can be defined as merge mode. Alternatively, setting the motion vectors of other blocks to the predicted values ​​of the motion vectors of the current block can be defined as motion vector prediction mode.

[0136] Figure 11 is a flowchart of the process for deriving the movement information of the current block under merge mode.

[0137] Candidates for merging the current block can be derived (step S1101). Candidates for merging the current block can be derived from blocks that have been encoded / decoded by interpretation prior to the current block.

[0138] Figure 12 is a diagram showing candidate blocks for deriving merge candidates.

[0139] A candidate block may include at least one of the following: an adjacent block containing a sample adjacent to the current block, or a non-adjacent block containing a sample not adjacent to the current block. Hereinafter, the sample used to determine a candidate block will be defined as the reference sample. Furthermore, a reference sample adjacent to the current block will be referred to as the adjacent reference sample, and a reference sample not adjacent to the current block will be referred to as the non-adjacent reference sample.

[0140] An adjacent reference sample may include a column adjacent to the leftmost column of the current block or a row adjacent to the top 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 can be used as a candidate block: the block containing the reference sample at position (-1,H-1), the block containing the reference sample at position (W-1,-1), the block containing the reference sample at position (W,-1), the block containing the reference sample at position (-1,H), or the block containing the reference sample at position (-1,-1). Referring to the drawing, adjacent blocks with indices 0 through 4 can be used as candidate blocks.

[0141] A non-adjacent reference sample represents a sample whose x-axis distance or y-axis distance from an adjacent reference sample to the current block is a predefined value. For example, at least one of the following can be used as a candidate block: a block containing a reference sample whose x-axis distance from the left reference sample is a predefined value; a block containing a non-adjacent sample whose y-axis distance from the top reference sample is a predefined value; or a block containing a non-adjacent sample whose x-axis and y-axis distances from the top-left reference sample are predefined values. The predefined value may be a natural number such as 4, 8, 12, or 16. Referring to the drawing, at least one of the blocks from index 5 to 26 can be used as a candidate block.

[0142] A sample that is not located on the same vertical, horizontal, or diagonal line as an adjacent reference sample can be designated as a non-adjacent reference sample.

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

[0144] As shown in the example in Figure 13, the x-coordinate of the upper non-adjacent reference sample can be set to be different from the x-coordinate of the upper adjacent reference sample. For example, if the position of the upper adjacent reference sample is (W-1, -1), the position of the upper non-adjacent reference sample located N units away from the upper adjacent reference sample on the y-axis can be set to ((W / 2)-1, -1-N), and the position of the upper non-adjacent reference sample located 2N units away on the y-axis can be set to (0, -1-2N). In other words, the position of the non-adjacent reference sample can be determined based on the position of the adjacent reference sample and the distance between them.

[0145] Hereafter, among the candidate blocks, those containing adjacent criterion samples will be referred to as adjacent blocks, and those containing non-adjacent criterion samples will be referred to as non-adjacent blocks.

[0146] If the distance between the current block and a candidate block is greater than or equal to a threshold, the candidate block may be set as unavailable as a merge 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 a value obtained by adding or subtracting an offset from the height of the coding tree unit (e.g., ctu_height±N). The offset N is a value predefined by the encoder and decoder and can be set to 4, 8, 16, 32, or ctu_height.

[0147] If the difference between the y-axis coordinate of the current block and the y-axis coordinate of the sample included in the candidate block is greater than a threshold, the candidate block can be determined to be unavailable as a merge candidate.

[0148] Alternatively, candidate blocks that do not belong to the same coding tree unit as the current block can be set to be unavailable as merge candidates. For example, if a reference sample exceeds the upper boundary of the coding tree unit to which the current block belongs, candidate blocks containing the reference sample can be set to be unavailable as merge candidates.

[0149] If the top boundary of the current block is adjacent to the top boundary of a coding tree unit, many candidate blocks may be determined to be unavailable as merge candidates, potentially reducing the coding / decoding efficiency of the current block. To address this issue, candidate blocks can be configured such that the number of candidate blocks located to the left of the current block is greater than the number of candidate blocks located above the current block.

[0150] Figure 14 is a diagram showing candidate blocks for deriving merge candidates.

[0151] As shown in the example in Figure 14, the upper blocks belonging to the N block columns above the current block and the left blocks belonging to the M block columns to the left of the current block can be set as candidate blocks. In this case, M can be set to be greater than N, so that the number of left candidate blocks is greater than the number of upper candidate blocks.

[0152] For example, the difference between the y-axis coordinate of the reference sample within the current block and the y-axis coordinate of the upper block that can be used as a candidate block can be set so as not to exceed N times the height of the current block. Similarly, the difference between the x-axis coordinate of the reference sample within the current block and the x-axis coordinate of the left block that can be used as a candidate block can be set so as not to exceed M times the width of the current block.

[0153] As an example, the example shown in Figure 14 indicates that the blocks belonging to the top two block columns of the current block and the blocks belonging to the left five block columns of the current block are set as candidate blocks.

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

[0155] Figure 14 is a diagram showing candidate blocks for deriving merge candidates.

[0156] If a reference sample is located in a different coding tree unit than the current block, and the reference sample is not adjacent to the boundary of the coding tree unit, a reference sample adjacent to the boundary of the coding tree unit can be used instead to determine a candidate block.

[0157] As an example, in the examples shown in Figures 15(a) and (b), when the upper boundary of the current block touches the upper boundary of the coding tree unit, the reference sample at the top of the current block belongs to a different coding tree unit than the current block. Among the reference samples belonging to a different coding tree unit than the current block, reference samples that are not adjacent to the upper boundary of the coding tree unit can be replaced with samples that are adjacent to the upper boundary of the coding tree unit.

[0158] For example, as shown in Figure 15(a), the reference sample at position 6 can be replaced with a sample at position 6' located at the upper boundary of the coding tree unit, and as shown in Figure 15(b), the reference sample at position 15 can be replaced with a sample at position 15' located at the upper boundary of the coding tree unit. In this case, the y-coordinate of the substitute sample is deflected to an adjacent position in the coding tree unit, and the x-coordinate of the substitute 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.

[0159] Alternatively, the x-coordinate of the alternative sample can be set by adding or subtracting an offset from the x-coordinate of the reference sample. For example, if the x-coordinates of an adjacent reference sample and a non-adjacent reference sample located at the top of the current block are the same, the x-coordinate of the alternative sample can be set by adding or subtracting an offset from the x-coordinate of the reference sample. This is to avoid the alternative sample replacing a non-adjacent reference sample being in the same position as another non-adjacent or adjacent reference sample.

[0160] Figure 16 is a diagram illustrating an example where the position of the reference sample is changed.

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

[0162] As an example, in the example shown in Figure 16, 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, which have 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 obtained by subtracting W / 2 from the x-coordinate of the reference sample at position 6, and the x-coordinate of the sample at position 15' can be set to a value obtained by subtracting W-1 from the x-coordinate of the reference sample at position 15.

[0163] Unlike the examples shown in Figures 15 and 16, the y-coordinate of the alternate sample can also be set to the y-coordinate of the row located above the top row of the current block, or the y-coordinate of the top boundary of the coding tree unit.

[0164] Although not shown in the diagram, the sample to replace the reference sample can also be determined based on the left boundary of the coding tree unit. For example, if the reference sample is not 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 a y-coordinate obtained by adding or subtracting an offset from the y-coordinate of the reference sample.

[0165] Subsequently, blocks containing alternative samples can be set as candidate blocks, and merge candidates for the current block can be derived based on these candidate blocks.

[0166] It is also possible to derive merge candidates from temporally adjacent blocks contained in a different image from the current block. For example, merge candidates can be derived from blocks at the same location contained in an image at the same location.

[0167] The motion information for merge candidates can be set in the same way as the motion information for candidate blocks. For example, at least one of the following can be set as the motion information for merge candidates: the motion vector of the candidate block, the reference image index, or the weight value index for the predicted direction or both directions.

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

[0169] Multiple merge candidates in the merge candidate list can be assigned indices according to a predetermined order. For example, the index assigned to an adjacent merge candidate will be smaller than the index assigned to a non-adjacent merge candidate. Alternatively, an index can be assigned to each merge candidate based on the index of each block shown in Figure 12 or Figure 14.

[0170] If the merge candidate includes multiple merge candidates, at least one of the multiple merge candidates can be selected (step S1103). In this case, information indicating whether the motion information of the current block can be derived from an adjacent merge candidate can be signaled via the bitstream. This information may be a 1-bit flag. As an example, a syntax element isAdjancentMergeFlag indicating whether the motion information of the current block can be derived from an adjacent merge candidate can be signaled via the bitstream. If the value of the syntax element isAdjancentMergeFlag is 1, the motion information of the current block can be derived based on an adjacent merge candidate. On the other hand, if the value of the syntax element isAdjancentMergeFlag is 0, the motion information of the current block can be derived based on a non-adjacent merge candidate.

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

[0172] [Table 1] JPEG0007894988000005.jpg121161

[0173] Information can be signaled via a bitstream to identify one of several merge candidates. For example, information representing the index of one of the merge candidates included in a list of merge candidates can be signaled via a bitstream.

[0174] If isAdjacentMergeflag is 1, the syntax element merge_idx can be signaled to identify one of the adjacent merge candidates. The maximum value of the syntax element merge_idx can be set to the number of adjacent merge candidates minus 1.

[0175] If isAdjacentMergeflag is 0, the syntax element NA_merge_idx can be signaled to identify one of the non-adjacent merge candidates. The syntax element NA_merge_idx represents the difference between the index of the non-adjacent merge candidate and 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 identified by NA_merge_idx.

[0176] If the number of merge candidates included in the merge candidate list is less than a threshold, merge candidates included in the inter-domain motion information table can be added to the merge candidate list. Here, the threshold may be the maximum number of merge candidates that the merge candidate list can contain, or the maximum number of merge candidates minus an offset. The offset may be a natural number such as 1 or 2. The inter-domain motion information table may contain merge candidates derived based on blocks encoded / decoded before the current block.

[0177] The inter-region motion information table contains merge candidates derived from blocks encoded / decoded based on inter-predictions in the current image. For example, the motion information of merge candidates included in the inter-region motion information table can be set in the same way as the motion information of blocks encoded / decoded based on inter-predictions. Here, the motion information may include at least one of the following: a motion vector, a reference image index, or weight indexes in the prediction direction or both directions.

[0178] For the sake of explanation, merge candidates included in the inter-domain motion information table will be referred to as inter-domain merge candidates.

[0179] The maximum number of merge candidates that the inter-domain motion information table can contain may be predefined by the encoder and decoder. For example, the maximum number of merge candidates that the inter-domain motion information table can contain may be 1, 2, 3, 4, 5, 6, 7, 8 or more (e.g., 16).

[0180] Alternatively, information representing the maximum number of merge candidates for the inter-region motion information table can be signaled via a bitstream. This information can be signaled at the sequence, image, or slice level.

[0181] Alternatively, the maximum number of merge candidates for the interregional motion information table can be determined according to the image size, slice size, or encoding tree unit size.

[0182] The inter-region motion information table can be initialized at the image, slice, tile, brick, encoded tree unit, or encoded tree unit line (row or column) level. For example, when a slice is initialized, the inter-region motion information table is also initialized, and the inter-region motion information table may not contain merge candidates.

[0183] Alternatively, information indicating whether to initialize the inter-region motion information table can be signaled via a bitstream. This information can be signaled at the slice, tile, brick, or block level. A pre-configured inter-region motion information table can be used before the information signals the initialization of the inter-region motion information table.

[0184] Alternatively, information regarding initial inter-region merge candidates can be signaled via an image parameter set or slice header. Even after the slice has been initialized, the inter-region motion information table may include initial inter-region merge candidates. This allows the inter-region merge candidates to be used for the first encoding / decoding mode in the slice, which is the block.

[0185] Blocks are encoded / decoded according to the encoding / decoding order, and based on inter-region prediction, the encoded / decoded blocks can be sequentially set as inter-region merge candidates according to the encoding / decoding order.

[0186] Figure 17 is a flowchart illustrating the update status of the inter-domain motion information table.

[0187] If an inter-region merge prediction is performed on the current block (step S1701), inter-region merge candidates can be derived based on the current block (step S1702). The movement information for the inter-region merge candidates can be set in the same way as the movement information for the current block.

[0188] If the inter-region motion information table is empty (step S1703), inter-region merge candidates derived based on the current block can be added to the inter-region motion information table (step S1704).

[0189] If the inter-region motion information table already contains inter-region merge candidates (step S1703), redundancy detection can be performed on the motion information of the current block (or the inter-region merge candidates derived therefrom) (step S1705). Redundancy detection is used to determine whether the motion information of the inter-region merge candidates stored in the inter-region motion information table is the same as the motion information of the current block. Redundancy detection can be performed on all inter-region merge candidates stored in the inter-region motion information table. Alternatively, redundancy detection can be performed on inter-region merge candidates stored in the inter-region motion information table whose index is above or below a threshold.

[0190] If no interpredictive merge candidates with the same motion information as the current block are included, interregional merge candidates derived based on the current block can be added to the interregional motion information table (step S1708). Whether the interpredictive merge candidates are the same can be determined based on whether their motion information (e.g., motion vectors and / or reference image indices) is the same.

[0191] In this case, if the maximum number of inter-region merge candidates are stored in the inter-region motion information table (step S1706), the oldest inter-region merge candidate can be deleted (step S1707), and an inter-region merge candidate derived based on the current block can be added to the inter-region motion information table (step S1708).

[0192] Inter-region merge candidates can be identified by their respective indices. When an inter-region merge candidate derived from the current block is added to the inter-region motion information table, the lowest index (e.g., 0) can be assigned to the inter-region merge candidate, and the index of the stored inter-region merge candidates can be incremented by 1. In this case, if the maximum number of inter-predicted merge candidates are already stored in the inter-region motion information table, the inter-region merge candidate with the largest index is removed.

[0193] Alternatively, if an inter-region merge candidate derived from the current block is added to the inter-region motion information table, the largest possible index can be assigned to the inter-region merge candidate. For example, if the number of inter-predictive merge candidates stored in the inter-region motion information table is less than the maximum value, the inter-region merge candidate can be assigned an index equal to the number of stored inter-predictive merge candidates. Alternatively, if the number of inter-predictive merge candidates stored in the inter-region motion information table is equal to the maximum value, the inter-region merge candidate can be assigned an index equal to the maximum value minus 1. In addition, the inter-region merge candidate with the smallest index is removed, and the indices of the remaining stored inter-region merge candidates decrease by 1 each.

[0194] Figure 18 is a diagram illustrating an example of updating the interregion merge candidate list.

[0195] Assume that the inter-region merge candidates derived from the current block are added to the inter-region merge candidate table, and that the largest possible index is assigned to each inter-region merge candidate. Also assume that the inter-region merge candidate table already contains the maximum number of inter-region merge candidates.

[0196] When adding the inter-region merge candidate HmvpCand[n+1] derived from the current block to the inter-region merge candidate table HmvpCandList, the inter-region merge candidate HmvpCand[0] with the smallest index among the stored inter-region merge candidates can be deleted, and the indices of the remaining inter-region merge candidates can be decreased by 1. Alternatively, the index of the inter-region merge candidate HmvpCand[n+1] derived from the current block can be set to its maximum value (n in the example shown in Figure 18).

[0197] If the same inter-region merge candidate derived based on the current block is stored (step S1705), the inter-region merge candidate derived based on the current block may not be added to the inter-region motion information table (step S1709).

[0198] Alternatively, it is possible to add inter-region merge candidates derived based on the current block to the inter-region motion information table, while removing stored inter-region merge candidates that are the same as the aforementioned inter-region merge candidates. In this case, the same effect is achieved as updating the index of the stored inter-region merge candidates.

[0199] Figure 19 is a diagram illustrating an example where the index of stored inter-region merge candidates is updated.

[0200] If the index of a stored inter-region merge candidate that is the same as the inter-region merge candidate mvCand derived based on the current block is hIdx, then the stored inter-region merge candidate can be deleted, and the indices of inter-region merge candidates whose index is greater than hIdx can be decreased by 1. For example, in the example shown in Figure 19, HmvpCand[2], which is the same as mvCand, is deleted from the inter-region motion information table HvmpCandList, and the indices from HmvpCand[3] to HmvpCand[n] are decreased by 1.

[0201] Then, the inter-region merge candidate mvCand derived based on the current block can be added to the end of the inter-region motion information table.

[0202] Alternatively, you can update the index assigned to a stored inter-region merge candidate that is the same as the inter-region merge candidate derived based on the current block. For example, you can change the index of a stored inter-region merge candidate to its minimum or maximum value.

[0203] Motion information for blocks included in a predetermined region can be configured not to be added to the inter-region motion information table. For example, inter-region merge candidates derived based on the motion information of blocks included in a merge processing region can not be added to the inter-region motion information table. Since the encoding / decoding order is not defined for blocks included in a merge processing region, it is inappropriate to use the motion information of any of these blocks for inter-prediction of other blocks. This prevents the addition of inter-region merge candidates derived based on blocks included in a merge processing region to the inter-region motion information table.

[0204] When motion compensation prediction is performed at the subblock level, inter-region merge candidates can be derived based on the motion information of a representative subblock among the multiple subblocks included in the current block. For example, when a subblock merge candidate is used for the current block, an inter-region merge candidate can be derived based on the motion information of a representative subblock among the subblocks.

[0205] The motion vectors of subblocks can be derived in the following order. First, one of the merge candidates included in the current block's merge candidate list can be selected, and an initial shift vector (shVector) can be derived based on the motion vector of the selected merge candidate. Then, the initial shift vector can be added to the position (xSb, ySb) of the reference sample (e.g., the top-left sample or the sample in the center) of each subblock in the encoded block to derive a shift subblock where the reference sample position is (xColSb, yColSb). Equation 4 below represents the formula for deriving the shift subblock.

[0206]

number

[0207] Furthermore, the motion vector of the block corresponding to the center position of the subblock containing (xColSb, yColSb) can be set to the motion vector of the subblock containing (xSb, ySb).

[0208] A representative subblock can refer to a subblock containing the top-left or center sample of the current block.

[0209] Figure 20 is a diagram showing the location of representative subblocks.

[0210] Figure 20(a) shows an example where a subblock located in the upper left of the current block is set as the representative subblock, and Figure 20(b) shows an example where a subblock located in the center of the current block is set as the representative subblock. When motion compensation prediction is performed on a subblock basis, inter-region merge candidates for the current block can be derived based on the motion vector of the subblock containing the upper left sample of the current block or the subblock containing the center sample of the current block.

[0211] Based on the current block's inter-prediction mode, it is also possible to determine whether to use the current block as an inter-region merge candidate. For example, blocks encoded / decoded based on an affine motion model can be set as unavailable as inter-region merge candidates. This ensures that even if the current block is encoded / decoded with inter-prediction, the inter-prediction motion information table will not be updated based on the current block if the current block's inter-prediction mode is affine prediction mode.

[0212] Alternatively, inter-region merge candidates can be derived based on at least one subblock vector from the subblocks contained within the block encoded / decoded based on the affine motion model. For example, inter-region merge candidates can be derived using a subblock located in the upper left, center, or upper right of the current block. Alternatively, the motion vector of the inter-region merge candidate can be set to the average of the subblock vectors of multiple subblocks.

[0213] Alternatively, inter-region merge candidates can be derived based on the average value of the affine seed vectors of the encoded / decoded blocks based on the affine motion model. For example, the average value of at least one of the first, second, or third affine seed vectors of the current block can be set as the motion vector of the inter-region merge candidate.

[0214] Alternatively, an inter-domain motion information table can be configured for each inter-prediction mode. For example, at least one of the following can be defined: an inter-domain motion information table for blocks encoded / decoded by intra-block copying, an inter-domain motion information table for blocks encoded / decoded based on a translational motion model, or an inter-domain motion information table for blocks encoded / decoded based on an affine motion model. Depending on the inter-prediction mode of the current block, one of several inter-domain motion information tables can be selected.

[0215] Figure 21 is a diagram showing an example of how inter-domain motion information tables are generated for each inter-prediction mode.

[0216] If a block is encoded / decoded based on a non-affine motion model, the inter-region merge candidate mvCand derived based on the block can be added to the inter-region non-affine motion information table HmvpCandList. On the other hand, if a block is encoded / decoded based on an affine motion model, the inter-region merge candidate mvAfCand derived based on the block can be added to the inter-region affine motion information table HmvpAfCandList.

[0217] Inter-region merge candidates derived from blocks encoded / decoded based on an affine motion model can store the affine seed vector of the said block. This allows the inter-region merge candidates to be used as merge candidates for deriving the affine seed vector of the current block.

[0218] In addition to the inter-domain motion information table described above, another inter-domain motion information table can also be defined. In addition to the inter-domain motion information table described above (hereinafter referred to as the first inter-domain motion information table), a long-term motion information table (hereinafter referred to as the second inter-domain motion information table) can be defined. Here, the long-term motion information table includes long-term merge candidates.

[0219] If the first and second inter-domain motion information tables are empty, an inter-domain merge candidate can first be added to the second inter-domain motion information table. Only after the number of available inter-domain merge candidates in the second inter-domain motion information table reaches the maximum number can an inter-domain merge candidate be added to the first inter-domain motion information table.

[0220] Alternatively, one inter-prediction merge candidate can be added to both the second inter-domain motion information table and the first inter-domain motion information table.

[0221] In this case, the configured second inter-domain motion information table may not be updated further. Alternatively, the second inter-domain motion information table may be updated if the decoded region is greater than or equal to a predetermined ratio of the slice. Alternatively, the second inter-domain motion information table may be updated for every N coded tree unit lines.

[0222] On the other hand, the first inter-domain motion information table can be updated whenever a block is encoded / decoded in the inter-prediction. However, inter-domain merge candidates added to the second inter-domain motion information table can be configured not to be used to update the first inter-domain motion information table.

[0223] Information for selecting either the first inter-domain motion information table or the second inter-domain motion information table can be signaled via the bitstream. If the number of merge candidates included in the merge candidate list is less than a threshold, the merge candidate included in the inter-domain motion information table indicated by the information can be added to the merge candidate list.

[0224] Alternatively, you can select an inter-region motion information table based on the current block size, shape, inter-prediction mode, whether to predict in both directions, whether to refine the motion vector, or whether to triangulate.

[0225] Alternatively, if, despite adding inter-region merge candidates included in the first inter-region motion information table, the number of merge candidates included in the merge candidate list is less than the maximum number of merges, inter-region merge candidates included in the second inter-region motion information table can be added to the merge candidate list.

[0226] Figure 22 is a diagram illustrating an example in which inter-region merge candidates included in the long-term motion information list are added to the merge candidate list.

[0227] If the number of merge candidates included in the merge candidate list is less than the maximum number, the inter-domain merge candidates included in the first inter-domain motion information table HmvpCandList can be added to the merge candidate list. If, despite adding the inter-domain merge candidates included in the first inter-domain motion information table to the merge candidate list, the number of merge candidates included in the merge candidate list is still less than the maximum number, the inter-domain merge candidates included in the long-term motion information table HmvpLTCandList can be added to the merge candidate list.

[0228] Table 2 shows the process of adding inter-region merge candidates included in the long-term motion information table to the merge candidate list.

[0229] [Table 2]

[0230] Inter-region merge candidates can be configured to include additional information in addition to movement information. For example, the size, shape, or partition information of the inter-region merge candidate block can be added and stored. When configuring the current block's merge candidate list, only inter-predictive merge candidates with the same or similar size, shape, or partition information as the current block can be used, or inter-predictive merge candidates with the same or similar size, shape, or partition information as the current block can be added to the merge candidate list first.

[0231] Alternatively, an inter-region motion information table can be generated for each block size, shape, or partition information. A list of merge candidates for the current block can be generated using the inter-region motion information table that matches the current block's shape, size, or partition information from among multiple inter-region motion information tables.

[0232] If the number of merge candidates included in the current block's merge candidate list is less than a threshold, inter-region merge candidates included in the inter-region motion information table can be added to the merge candidate list. This addition process is performed in ascending or descending order based on the index. As an example, the inter-region merge candidate with the largest index can be added to the merge candidate list.

[0233] When attempting to add an inter-region merge candidate included in the inter-region motion information table to the merge candidate list, redundancy detection between the inter-region merge candidate and the merge candidates stored in the merge candidate list can be performed.

[0234] As an example, Table 3 shows the process by which inter-region merge candidates are added to the merge candidate list.

[0235] [Table 3]

[0236] Redundancy detection can also be performed only on a subset of the inter-domain merge candidates included in the inter-domain motion information table. For example, redundancy detection can be performed only on inter-domain merge candidates whose index is above or below a threshold. Alternatively, redundancy detection can be performed only on the N merge candidates with the largest index or the N merge candidates with the smallest index.

[0237] Alternatively, redundancy detection can be performed only on a subset of the merge candidates stored in the merge candidate list. For example, redundancy detection can be performed only on merge candidates whose index is above or below a threshold, or on merge candidates derived from a block at a specific location. Here, the specific location may include at least one of the left-side adjacent block, top-side adjacent block, top-right adjacent block, or bottom-left adjacent block of the current block.

[0238] Figure 23 is a diagram illustrating an example where redundancy detection is performed only on a portion of the merge candidates.

[0239] When attempting to add the inter-region merge candidate HmvpCand[j] to the merge candidate list, redundancy detection can be performed on the inter-region merge candidate between the two merge candidates with the largest indices, mergeCandList[NumMerge-2] and mergeCandList[NumMerge-1], where NumMerge represents the number of available spatial and temporal merge candidates.

[0240] Unlike the illustrated example, when attempting to add the inter-region merge candidate HmvpCand[j] to the merge candidate list, redundancy detection can also be performed on the inter-region merge candidate against up to two merge candidates with the smallest index. For example, it can be checked whether mergeCandList[0] and mergeCandList[1] are the same as HmvpCand[j]. Alternatively, redundancy detection can be performed only on merge candidates derived from a specific location. For example, redundancy detection can be performed on at least one of the merge candidates derived from a surrounding block located to the left of the current block or from a surrounding block located above the current block. If no merge candidates derived from a specific location exist in the merge candidate list, the inter-region merge candidate can be added to the merge candidate list without redundancy detection.

[0241] If the same merge candidate as the first inter-domain merge candidate is found, redundancy detection for the second inter-domain merge candidate can be omitted when performing redundancy detection for the same merge candidate as the first inter-domain merge candidate.

[0242] Figure 24 is a diagram illustrating an example where redundancy detection with specific merge candidates is omitted.

[0243] When attempting to add the inter-area merge candidate HmvpCand[i], whose index is i, to the merge candidate list, redundancy detection is performed between the inter-area merge candidate and the merge candidates stored in the merge candidate list. In this case, if the same merge candidate mergeCandList[j] as the inter-area merge candidate HmvpCand[i] is found, redundancy detection between the inter-area merge candidate HmvpCand[i-1], whose index is i-1, and the merge candidate can be performed without adding the inter-area merge candidate HmvpCand[i] to the merge candidate list. In this case, redundancy detection between the inter-area merge candidate HmvpCand[i-1] and the merge candidate mergeCandList[j] can be omitted.

[0244] As an example, in the example shown in Figure 24, HmvpCand[i] and mergeCandList[2] are determined to be the same. As a result, 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 omitted.

[0245] If the number of merge candidates included in the current block's merge candidate list is less than a threshold, in addition to inter-region merge candidates, it may further include at least one of either pairwise merge candidates or zero merge candidates. A pairwise merge candidate is a merge candidate that uses the average of the motion vectors of two or more merge candidates as its motion vector, and a zero merge candidate is a merge candidate whose motion vector is 0.

[0246] The current block's merge candidate list adds merge candidates in the following order:

[0247] Spatial merge candidates - Temporal merge candidates - Interdomain merge candidates - (Interdomain affine merge candidates) - Pairwise merge candidates - Zero merge candidates Spatial merge candidates refer to merge candidates derived from at least one adjacent or non-adjacent block, while temporal merge candidates refer to merge candidates derived from a previous reference image. Interregional affine merge candidates represent interregional merge candidates derived from blocks encoded / decoded in the affine motion model.

[0248] The Inter-region Motion Information Table can also be used in motion vector prediction mode. For example, if the number of motion vector prediction candidates included in the motion vector prediction candidate list for the current block is less than a threshold, the Inter-region merge candidates included in the Inter-region Motion Information Table can be set as motion vector prediction candidates for the current block. Specifically, the motion vector of the Inter-region merge candidate can be set as a motion vector prediction candidate.

[0249] By selecting one of the motion vector prediction candidates included in the current block's motion vector prediction candidate list, the selected candidate can be set as the current block's motion vector prediction value. Then, after decoding the current block's motion vector residual value, the motion vector of the current block can be obtained by adding the motion vector prediction value and the motion vector residual value.

[0250] The current block's motion vector prediction candidate list can be structured according to the following order:

[0251] Spatial motion vector prediction candidate - Temporal motion vector prediction candidate - Interdecoded region merge candidate - (Interdecoded region affine merge candidate) - Zero motion vector prediction candidate The spatial motion vector prediction candidate means a motion vector prediction candidate derived from at least one of adjacent blocks or non - adjacent blocks, and the temporal motion vector prediction candidate means a motion vector prediction candidate derived from a previous reference image. The inter - region affine merge candidate represents an inter - region motion vector prediction candidate derived from a block encoded / decoded by an affine motion model. The zero motion vector prediction candidate represents a candidate whose motion vector value is 0.

[0252] A merge processing region having a size larger than the encoded block can be defined. The encoded blocks included in the merge processing region are not encoded / decoded sequentially and can be processed in parallel. Here, not being encoded / decoded sequentially means that the encoding / decoding order is not defined. Thereby, the encoding / decoding process of the blocks included in the merge processing region can be processed independently. Or, the blocks included in the merge processing region can share merge candidates. Here, the merge candidates can be derived based on the merge processing region.

[0253] According to the above characteristics, the merge processing region can also be referred to as a parallel processing region, a shared merge region (SMR), or a merge estimation region (MER).

[0254] The merge candidates of the current block can be derived based on the encoded block. However, when the current block is included in a merge processing region having a size larger than the current block, it can be set that the candidate blocks included in the same merge processing region as the current block are not available as merge candidates.

[0255] FIG. 25 is a drawing showing an example in which candidate blocks included in the same merge processing region as the current block are set to be unavailable as merge candidates.

[0256] In the example shown in (a) of FIG. 25, when encoding / decoding CU5, a block including reference samples adjacent to CU5 can be set as a candidate block. In this case, candidate blocks X3 and X4 included in the same merge processing area as CU5 can be set as being unavailable as merge candidates for CU5. On the other hand, candidate blocks X0, X1, and X2 not included in the same merge processing area as CU5 can be set as being available as merge candidates.

[0257] In the example shown in (b) of FIG. 25, when encoding / decoding CU8, a block including reference samples adjacent to CU8 can be set as a candidate block. In this case, candidate blocks X6, X7, and X8 included in the same merge processing area as CU8 can be set as being unavailable as merge candidates. On the other hand, candidate blocks X5 and X9 not included in the same merge area as CU8 can be set as being available as merge candidates.

[0258] The merge processing area may be square or non-square. Information for determining the merge processing area can be signaled via a bitstream. The information may include at least one of information representing the form of the merge processing area or information representing the size of the merge processing area. When the merge processing area is non-square, at least one of information representing the size of the merge processing area, information representing the width and / or height of the merge processing area, or information representing the ratio between the width and height of the merge processing area can be signaled via the bitstream.

[0259] The size of the merge processing area can be determined based on at least one of information signaled by the bitstream, the image resolution, the size of a slice, or the size of a tile.

[0260] When motion compensation prediction is performed on blocks included in the merge processing area, inter-region merge candidates derived based on the motion information of the blocks on which motion compensation prediction was performed can be added to the inter-region motion information table.

[0261] However, when adding an inter-domain merge candidate derived from a block included in the merge processing area to the inter-domain motion information table, the inter-domain merge candidate derived from the block may be used when encoding / decoding other blocks within the merge processing area that are slower to encode / decode than the block in question. That is, when encoding / decoding a block included in the merge processing area, even though inter-block dependencies must be eliminated, motion prediction compensation may be performed using motion information from other blocks included in the merge processing area. To solve the above problem, even after the encoding / decoding of a block included in the merge processing area is completed, the motion information of the encoded / decoded block may not be added to the inter-domain motion information table.

[0262] Alternatively, by performing motion compensation prediction on blocks included in the merge processing area, inter-region merge candidates derived from the blocks can be added to the inter-region motion information table in a predefined order. Here, the predefined order can be determined according to the scan order of the encoded blocks in the merge processing area or encoded tree unit. The scan order may be at least one of raster scan, horizontal scan, vertical scan, or zigzag scan. Alternatively, the predefined order can be determined based on the motion information of each block or the number of blocks having the same motion information.

[0263] Alternatively, an inter-region merge candidate containing unidirectional motion information can be added to the inter-region merge list before an inter-region merge candidate containing bidirectional motion information. Conversely, an inter-region merge candidate containing bidirectional motion information can be added to the inter-region merge candidate list before an inter-region merge candidate containing unidirectional motion information.

[0264] Alternatively, inter-region merge candidates can be added to the inter-region motion information table in order of frequency of use within the merge processing region or coding tree unit, either in descending order of frequency of use or in descending order of frequency of use.

[0265] When the current block is added to the merge processing area, and the number of merge candidates included in the current block's merge candidate list is less than the maximum number, the inter-area merge candidates included in the inter-area motion information table can be added to the merge candidate list. In this case, inter-area merge candidates derived from blocks included in the same merge processing area as the current block can be configured not to be added to the current block's merge candidate list.

[0266] Alternatively, if the current block is included in the merge processing area, it is possible to configure the system not to use the inter-area merge candidates included in the inter-area motion information table. 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 inter-area merge candidates included in the inter-area motion information table are not added to the merge candidate list.

[0267] An inter-domain motion information table can be configured for a merge processing area or an encoded tree unit. The inter-domain motion information table temporarily stores motion information of blocks included in the merge processing area. To distinguish a general inter-domain motion information table from an inter-domain motion information table for a merge processing area or an encoded tree unit, the inter-domain motion information table for a merge processing area or an encoded tree unit will be referred to as a temporary motion information table. Furthermore, inter-domain merge candidates stored in the temporary motion information table will be referred to as temporary merge candidates.

[0268] Figure 26 is a diagram showing a temporary motion information table.

[0269] A temporary motion information table can be configured for an encoded tree unit or merge processing area. When motion compensation prediction is performed on the current block contained in the encoded tree unit or merge processing area, the motion information of the block may not be added to the inter-prediction motion information table HmvpCandList. Instead, temporary merge candidates derived from the block may be added to the temporary motion information table HmvpMERCandList. That is, temporary merge candidates added to the temporary motion information table may not be added to the inter-region motion information table. As a result, the inter-region motion information table does not need to include inter-region merge candidates derived based on the motion information of blocks contained in the encoded tree unit or merge processing area containing the current block.

[0270] The maximum number of merge candidates that a temporary motion information table can contain can be set in the same way as the inter-region motion information table. Alternatively, the maximum number of merge candidates that a temporary motion information table can contain can be determined according to the size of the encoding tree unit or the merge processing area.

[0271] The current block contained within an encoded tree unit or merge processing area can be configured not to use the temporary motion information table for the corresponding encoded tree unit or merge processing area. That is, if the number of merge candidates included in the current block's merge candidate list is less than a threshold, the inter-area merge candidates included in the inter-area motion information table can be added to the merge candidate list, while the temporary merge candidates included in the temporary motion information table can not be added to the merge candidate list. This prevents the use of motion information from other blocks contained within the same encoded tree unit or merge processing area as the current block for motion compensation prediction of the current block.

[0272] Once the encoding / decoding of all blocks contained in the encoding tree unit or merge processing area is complete, the inter-area motion information table and the temporary motion information table can be merged.

[0273] Figure 27 is a diagram illustrating an example of merging an inter-domain motion information table and a temporary motion information table.

[0274] Once the encoding / decoding of all blocks contained in the encoding tree unit or merge processing area is complete, the inter-region motion information table can be updated with the temporary merge candidates contained in the temporary motion information table, as shown in the example in Figure 27.

[0275] In this case, temporary merge candidates included in the temporary motion information table can be added to the inter-region motion information table according to the order in which they were inserted into the temporary motion information table (i.e., in ascending or descending order of index values).

[0276] As another example, temporary merge candidates included in a temporary motion information table can be added to an inter-region motion information table according to a predefined order.

[0277] Here, the predefined order can be determined according to the scan order of coding blocks in the merge processing region or the coding tree unit. The scan order may be at least one of a raster scan, a horizontal scan, a vertical scan, or a zigzag scan. Alternatively, the predefined order can be determined based on the motion information of each block or the number of blocks having the same motion information.

[0278] Alternatively, temporary merge candidates containing one-direction motion information can be added to the inter-region merge list before those containing both-direction motion information. Conversely, temporary merge candidates containing both-direction motion information can be added to the inter-region merge candidate list before those containing one-direction motion information.

[0279] Alternatively, temporary merge candidates can be added to the inter-region motion information table in the order of decreasing or increasing usage frequency within the merge processing region or the coding tree unit.

[0280] When adding temporary merge candidates included in the temporary motion information table to the inter-region motion information table, redundancy detection can be performed on the temporary merge candidates. For example, if the same inter-region merge candidate as a temporary merge candidate included in the temporary motion information table is stored in the inter-region motion information table, the temporary merge candidate may not be added to the inter-region motion information table. In this case, redundancy detection can be performed on a subset of the inter-region merge candidates included in the inter-region motion information table. For example, redundancy detection can be performed on inter-predicted merge candidates whose index is greater than or equal to a threshold. For example, if a temporary merge candidate is the same as an inter-region merge candidate having an index greater than or equal to a predefined value, the temporary merge candidate may not be added to the inter-region motion information table.

[0281] Intra-prediction is the process of predicting the current block using reconstructed samples that have been coded / decoded around the current block. In this case, the intra-prediction of the current block can use reconstructed samples before the in-loop filter is applied.

[0282] Intra-prediction techniques include matrix-based intra-prediction and general intra-prediction that considers orientation 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 current block's location, size, shape, or the intra-prediction techniques of adjacent blocks. For example, if the current block spans across an image, matrix-based intra-prediction may be set not to apply to the current block.

[0283] Matrix-based intra-prediction is a method for obtaining a predicted block for the current block based on the matrix product of a matrix stored in the encoder and decoder and a reconstructed sample surrounding the current block. Information to identify any one of the stored matrices can be signaled via a bitstream. The decoder can determine the matrix for the intra-prediction of the current block based on this information and the size of the current block.

[0284] A typical intra-prediction is a method for obtaining predicted blocks for the current block based on either a non-directional intra-prediction mode or a directional intra-prediction mode. The following diagrams will describe in more detail the process of performing an intra-prediction based on a typical intra-prediction.

[0285] Figure 28 is a flowchart of an intra-prediction method according to an embodiment of the present invention.

[0286] The reference sample line of the current block can be determined (step S2801). The reference sample line refers to the set of reference samples contained in the line that is k-th away from the top and / or left side of the current block. The reference sample can be derived from the reconstructed samples that have been encoded / decoded around the current block.

[0287] Index information can be signaled via a bitstream to identify the reference sample line of the current block from among multiple reference sample lines. Multiple reference sample lines may include at least one of the first, second, third, or fourth rows / columns from the top and / or left of the current block. Table 4 shows the index assigned to each reference sample line. Table 4 assumes that the first, second, and fourth rows / columns use reference sample line candidates.

[0288] [Table 4]

[0289] The reference sample line for the current block can also be determined based on at least one of the current block's location, size, shape, or the predictive coding mode of adjacent blocks. For example, if the current block is the boundary of an image, tile, slice, or coding tree unit, the first reference sample line can be determined as the reference sample line for the current block.

[0290] The reference sample line may include an upper reference sample located above the current block and a left reference sample located to the left of the current block. The upper and left reference samples can be derived from reconstructed samples around the current block. The reconstructed samples may be in their state before the in-loop filter is applied.

[0291] Figure 29 shows the drawings of the reference samples included in each reference sample line.

[0292] According to the current block's intra-prediction mode, a prediction sample can be obtained using at least one of the reference samples belonging to the reference sample line.

[0293] Next, the intra-prediction mode for the current block can be determined (step S2802). The intra-prediction mode for the current block can be determined by at least one of the non-directional intra-prediction modes or the directional intra-prediction mode. The non-directional intra-prediction mode includes Planner and DC, and the directional intra-prediction mode includes 33 or 65 modes from the lower left diagonal to the upper right diagonal.

[0294] Figure 30 is a diagram showing the intra-prediction mode.

[0295] Figure 30(a) shows 35 intra-prediction modes, and Figure 30(b) shows 67 intra-prediction modes.

[0296] It is also possible to define more or fewer intra-prediction modes than those shown in Figure 30.

[0297] Based on the intra-prediction modes of the adjacent blocks next to the current block, the most probable mode (MPM) can be set. Here, adjacent blocks may include the left adjacent block adjacent to the left of the current block and the top adjacent block adjacent to the top of the current block. If the coordinates of the top-left sample of the current block are (0,0), then the left adjacent block may include the sample at positions (-1,0), (-1,H-1), or (-1,(H-1) / 2), where H represents the height of the current block. The top adjacent block may include the sample at positions (0,-1), (W-1,-1), or ((W-1) / 2,-1), where W represents the width of the current block.

[0298] If adjacent blocks are encoded with a general intraprediction, the MPM can be derived based on the intraprediction mode of the adjacent blocks. Specifically, the intraprediction mode of the left adjacent block can be set to the variable candIntraPredModeA, and the intraprediction mode of the upper adjacent block can be set to the variable candIntraPredModeB.

[0299] In this case, if the adjacent block is unavailable (for example, if the adjacent block has not yet been encoded / decoded or if the adjacent block's position is beyond the image boundary), if the adjacent block is encoded with matrix-based intra-prediction, if the adjacent block is encoded with inter-prediction, or if the adjacent block is in a different coding tree unit than the current block, the derived variable candIntraPredModeX (where X is A or B) can be set to the default mode based on the intra-prediction mode of the adjacent block. Here, the default mode may include at least one of planner, DC, vertical mode, or horizontal mode.

[0300] Alternatively, if adjacent blocks are encoded with matrix-based intraprediction, the intraprediction mode corresponding to the index value for identifying any one of the matrices can be set to candIntraPredModeX. Thus, a lookup table representing the mapping relationship between the index value for identifying a matrix and the intraprediction mode can be stored in the encoder and decoder.

[0301] The MPM can be derived based on the variables candIntraPredModeA and candIntraPredModeB. The number of MPMs included in the MPM list can be set by the encoder and decoder. For example, the number of MPMs may be 3, 4, 5, or 6. Alternatively, information representing the number of MPMs can be signaled via the bitstream. Alternatively, the number of MPMs can be determined based on at least one of the following: the predictive coding mode of the adjacent block, the size of the current block, or its shape.

[0302] In the embodiments described later, we assume that there are three MPMs, and these three MPMs will be referred to as MPM[0], MPM[1], and MPM[2]. If there are more than three MPMs, the MPM is configured to include the three MPMs described in the embodiments described later.

[0303] If candIntraPredA and candIntraPredB are the same and candIntraPredA is in planner or DC mode, then MPM[0] and MPM[1] can be set to planner and DC mode, respectively. MPM[2] can be set to vertical intra-prediction mode, horizontal intra-prediction mode, or diagonal intra-prediction mode. The diagonal intra-prediction mode may be the lower left diagonal intra-prediction mode, the upper left intra-prediction mode, or the upper right intra-prediction mode.

[0304] If candIntraPredA and candIntraPredB are the same and candIntraPredA is in a directional intra-prediction mode, then MPM[0] can be set in the same way as candIntraPredA. MPM[1] and MPM[2] can set candIntraPredA to a similar intra-prediction mode. An intra-prediction mode similar to candIntraPredA may be an intra-prediction mode where the index difference value from candIntraPredA is ±1 or ±2. Modular calculations (%) and offsets can be used to derive an intra-prediction mode similar to candIntraPredA.

[0305] If candIntraPredA and candIntraPredB are different, MPM[0] can be set to be the same as candIntraPredA, and MPM[1] can be set to be the same as candIntraPredB. In this case, if both candIntraPredA and candIntraPredB are in non-directional intra-prediction mode, MPM[2] can be set to vertical intra-prediction mode, horizontal intra-prediction mode, or diagonal intra-prediction mode. Alternatively, if at least one of candIntraPredA and candIntraPredB is in directional intra-prediction mode, MPM[2] can be set to an intra-prediction mode derived by adding or subtracting an offset to the maximum value of the planner, DC, or candIntraPredA or candIntraPredB, where the offset may be 1 or 2.

[0306] The system can generate an MPM list containing multiple MPMs and signal via a bitstream whether the MPM in the MPM list is the same as the intra-prediction mode of the current block. This information can be referred to as the MPM flag, which is a 1-bit flag. If the MPM flag indicates that the MPM list contains the same MPM as the current block, the system can signal via a bitstream index information that identifies one of the MPMs. The MPM identified by the index information can be set as the intra-prediction mode of the current block. If the MPM flag indicates that the MPM list does not contain the same MPM as the current block, the system can signal via a bitstream remaining mode information that indicates one of the remaining intra-prediction modes excluding the MPM. The remaining mode information points to the index value corresponding to the intra-prediction mode of the current block when the indices are reassigned to the remaining intra-prediction modes excluding the MPM. The decoder can determine the intra-prediction mode of the current block by arranging the MPMs in ascending order and comparing the remaining mode information with the MPMs. For example, if the remaining mode information is less than or equal to the MPM, the intra-predictive mode of the current block can be derived by adding 1 to the remaining mode information.

[0307] Instead of setting the default mode to an MPM, information indicating whether the current block's intra-prediction mode is the default mode can be signaled via a bitstream. This information is a one-bit flag, which may be referred to as the default mode flag. The default mode flag can only be signaled if the MPM flag indicates that the same MPM as the current block is included in the MPM list. As described above, the default mode may include at least one of the following: planner, DC, vertical mode, or horizontal mode. For example, if planner is set as the default mode, the default mode flag may indicate whether the current block's intra-prediction mode is planner. If the default mode flag indicates that the current block's intra-prediction mode is not the default mode, one of the MPMs indicated by the index information can be set as the current block's intra-prediction mode.

[0308] If multiple intra-prediction modes are set as the default mode, index information can be further signaled to indicate one of the default modes. The intra-prediction mode of the current block can be set to the default mode pointed to by the aforementioned index information.

[0309] If the index of the referenced sample line in the current block is not 0, the default mode can be disabled. This allows the default mode flag to be set to a predefined value (i.e., false) without signaling the default mode flag if the index of the referenced sample line is not 0.

[0310] Once the intra-prediction mode for the current block is determined, prediction samples for the current block can be obtained based on the determined intra-prediction mode (step S2803).

[0311] When DC mode is selected, predicted samples for the current block are generated based on the mean value of the reference samples. Specifically, values ​​for all samples within the predicted block can be generated based on the mean value of the reference samples. The mean value can be derived using at least one of the upper reference samples located above the current block and the left reference samples located to the left of the current block.

[0312] The number or range of reference samples used to derive the average may vary depending on the shape of the current block. For example, if the current block is a non-square block where the width is greater than the height, the average can be calculated using only the top reference samples. On the other hand, if the current block is a non-square block where the width is less than the height, the average can be calculated using only the left reference samples. That is, if the width and height of the current block are different, the average can be calculated using only the reference samples adjacent to the longer side. Alternatively, based on the ratio of the width to height of the current block, it can be decided whether to calculate the average using only the top reference samples or only the left reference samples.

[0313] When Planner mode is selected, prediction samples can be obtained using horizontal and vertical prediction samples. Here, horizontal prediction samples are obtained based on left and right reference samples located on the same horizontal line as the prediction sample, and vertical prediction samples are obtained based on top and bottom reference samples located on the same vertical line as the prediction sample. Here, the right reference sample can be generated by duplicating the reference sample adjacent to the top right corner of the current block, and the bottom reference sample can be generated by duplicating the reference sample adjacent to the bottom left corner of the current block. Horizontal prediction samples can be obtained based on a weighted sum of the left and right reference samples, and vertical prediction samples can be obtained based on a weighted sum of the top and bottom reference samples. In this case, the weight values ​​assigned to each reference sample can be determined according to the position of the prediction sample. Prediction samples can be obtained based on an average or weighted sum of the horizontal and vertical prediction samples. When a weighted sum is performed, the weight values ​​assigned to the horizontal and vertical prediction samples can be determined based on the position of the prediction sample.

[0314] When a direction prediction mode is selected, the parameters indicating the predicted direction (or predicted angle) for the selected direction prediction mode can be determined. Table 5 below shows the intra-direction parameters intraPredAng for each intra-prediction mode.

[0315] [Table 5]

[0316] Table 5 shows the intra-direction parameters for each intra-prediction mode with an index of either 2 or 34, when 35 intra-prediction modes are defined. If more than 33 directional intra-prediction modes are defined, Table 5 can be further subdivided to set the intra-direction parameters for each directional intra-prediction mode.

[0317] After arranging the reference samples at the top and left of the current block into a single column, a predicted sample can be obtained based on the value of the intra-direction parameter. In this case, if the value of the intra-direction parameter is negative, the reference samples at the left and top can be arranged into a single column.

[0318] Figures 31 and 32 are diagrams showing examples of one-dimensional arrays in which reference samples are arranged in a single row.

[0319] Figure 31 shows an example of a vertical one-dimensional array in which reference samples are arranged vertically, and Figure 32 shows an example of a horizontal one-dimensional array in which reference samples are arranged horizontally. The embodiments of Figures 31 and 32 are described assuming that 35 intra-prediction modes are defined.

[0320] If the intra-prediction mode index is 11 to 18, a horizontal one-dimensional array can be applied by rotating the upper reference sample counterclockwise. If the intra-prediction mode index is 19 to 25, a vertical one-dimensional array can be applied by rotating the left reference sample clockwise. When the reference samples are arranged in a single column, the intra-prediction mode angle can be considered.

[0321] Based on the intra-direction parameter, the reference sample determination parameter can be determined. The reference sample determination parameter may include a reference sample index for identifying the reference sample and a weight value parameter for determining the weight value applied to the reference sample.

[0322] The reference sample index iIdx and the weight value parameter ifact can be obtained by the following equations 5 and 6, respectively.

[0323]

number

[0324]

number

[0325] In equations 5 and 6, Pang represents the intra-direction parameter. The reference sample identified by the reference sample index iIdx corresponds to the integer pel.

[0326] To derive prediction samples, at least one reference sample can be identified. Specifically, the location of the reference sample used to derive prediction samples can be determined by considering the slope of the prediction mode. As an example, the reference sample index iIdx can be used to identify the reference sample used to derive prediction samples.

[0327] In this case, if the slope of the intra-prediction mode is not represented by a single reference sample, a prediction sample can be generated by interpolating multiple reference samples. For example, if the slope of the intra-prediction mode is the value between the slope between the prediction sample and the first reference sample and the slope between the prediction sample and the second reference sample, a prediction sample can be obtained by interpolating the first and second reference samples. That is, if the angular line along the intra-prediction angle does not pass through a reference sample located at an integer P, a prediction sample can be obtained by interpolating reference samples located adjacent to the left, right, or above and below the position through which the angular line passes.

[0328] Below, Equation 7 shows an example of obtaining predicted samples based on reference samples.

[0329]

number

[0330] In Equation 7, P represents a predicted sample, and Ref_1D represents one of the reference samples arranged in a one-dimensional array. In this case, the position of the reference sample can be determined according to the position (x,y) of the predicted sample and the reference sample index iIdx.

[0331] If the slope of the intra-prediction mode can be represented by one reference sample, set the weight value parameter ifact to 0. This allows equation 7 to be simplified to equation 8 below.

[0332]

number

[0333] It is also possible to perform intra-prediction for the current block based on multiple intra-prediction modes. For example, an intra-prediction mode can be derived for each prediction sample, and prediction samples can be derived based on the intra-prediction mode assigned to each prediction sample.

[0334] Alternatively, an intra-prediction mode can be derived for each region, and intra-prediction can be performed for each region based on the intra-prediction mode assigned to each region. Here, the region may contain at least one sample. At least one of the size or shape of the region can be adaptively determined based on at least one of the size, shape, or intra-prediction mode of the current block. Alternatively, at least one of the size or shape of the region can be predefined in the encoder and decoder, regardless of the size or shape of the current block.

[0335] Alternatively, intraprediction can be performed based on each of multiple intrapredictions, and the final predicted sample can be derived based on the averaging or weighted sum of the multiple predicted samples obtained by the multiple intrapredictions. For example, an intraprediction can be performed based on a first intraprediction mode to obtain a first predicted sample, and an intraprediction can be performed based on a second intraprediction mode to obtain a second predicted sample. Then, the final predicted sample can be obtained based on the averaging or weighted sum of the first and second predicted samples. In this case, the weight values ​​assigned to the first and second predicted samples can be determined by considering whether the first intraprediction mode is a non-directional / directional prediction mode, whether the second intraprediction mode is a non-directional / directional prediction mode, or at least one of the intraprediction modes of the adjacent block.

[0336] Multiple intra-prediction modes may be combinations of non-directional intra-prediction modes and directional prediction modes, combinations of directional prediction modes, or combinations of non-directional prediction modes.

[0337] Figure 33 is a diagram showing the angle formed by the directional intra-prediction mode with a straight line parallel to the x-axis.

[0338] As shown in the example in Figure 33, the direction prediction mode can exist between the lower left diagonal and the upper right diagonal. Regarding the angle formed by the x-axis and the direction prediction mode, the direction prediction mode can exist between 45 degrees (lower left diagonal) and -135 degrees (upper right diagonal).

[0339] If the current block is not square, according to the intra-prediction mode of the current block, it may occur that, among the reference samples located on an angular line following the intra-prediction angle, a reference sample further from the predicted sample is used to derive the predicted sample, instead of a reference sample closer to the predicted sample.

[0340] Figure 34 is a diagram showing the format in which predictive samples are obtained when the current block is not square.

[0341] As an example, suppose the current block is a non-square shape, with a width greater than its height, as shown in Figure 34(a), and the intra-prediction mode of the current block is a directional intra-prediction mode with an angle between 0 and 45 degrees. In this case, when deriving a predicted sample A near the rightmost column of the current block, it may occur that, among the reference samples located in an angular mode following the angle, the leftmost reference sample L, which is farther from the predicted sample, is used instead of the upper reference sample T, which is closer to the predicted sample.

[0342] As another example, suppose the current block is a non-square shape, with height greater than width, as shown in Figure 34(b), and the intra-prediction mode of the current block is a directional intra-prediction mode between -90 and -135 degrees. In the above case, when deriving a predicted sample A near the bottom row of the current block, it may occur that, among the reference samples located in the angular mode according to the angle, the upper reference sample T, which is farther from the predicted sample, is used instead of the left reference sample L, which is closer to the predicted sample.

[0343] To solve the above problem, if the current block is not square, the intra-prediction mode for the current block can be replaced with the intra-prediction mode in the opposite direction. This allows for the use of directional prediction modes with angles larger or smaller than the directional prediction modes shown in Figure 24 for non-square blocks. Thus, directional intra-prediction modes can be defined as wide-angle intra-prediction modes. Wide-angle intra-prediction modes represent directional intra-prediction modes that do not fall within the range of 45 degrees to -135 degrees.

[0344] Figure 35 is a diagram showing the wide-angle intra-prediction mode.

[0345] In the example shown in Figure 35, the intra-prediction modes with indices from -1 to -14 and the intra-prediction modes with indices from 67 to 80 represent wide-angle intra-prediction modes.

[0346] Figure 35 shows 14 wide-angle intra-prediction modes with angles greater than 45 degrees (-1 to -14) and 14 wide-angle intra-prediction modes with angles less than -135 degrees (67 to 80), but more or fewer wide-angle intra-prediction modes can be defined.

[0347] When wide-angle intra-prediction mode is used, the length of the upper reference sample can be set to 2W+1 and the length of the left reference sample can be set to 2H+1.

[0348] By using the wide-angle intra-prediction mode, it is possible to predict sample A shown in Figure 34(a) using reference sample T, and to predict sample A shown in Figure 34(b) using reference sample L.

[0349] By adding the existing intra-prediction modes to N wide-angle intra-prediction modes, a total of 67+N intra-prediction modes can be used. As an example, Table 6 shows the intra-directional parameters of the intra-prediction modes when 20 wide-angle intra-prediction modes are defined.

[0350] [Table 6]

[0351] If the current block is not square and the intra-prediction mode of the current block obtained in step S2802 falls within the conversion range, the intra-prediction mode of the current block can be converted to a wide-angle intra-prediction mode. The conversion range can be determined based on at least one of the size, shape, or ratio of the current block, where the ratio represents the ratio between the width and height of the current block.

[0352] If the current block is a non-square with a width greater than its height, the conversion range can be set from the intra-prediction mode index in the upper right diagonal direction (e.g., 66) to (the intra-prediction mode index in the upper right diagonal direction - N), where N can be determined based on the proportions of the current block. If the intra-prediction mode of the current block falls within the conversion range, the intra-prediction mode can be converted to a wide-angle intra-prediction mode. This conversion involves subtracting a predefined value from the intra-prediction mode, which may be the total number of intra-prediction modes excluding the wide-angle intra-prediction mode (e.g., 67).

[0353] According to the above embodiment, the intra-prediction modes between the 66th and 53rd can be converted to wide-angle intra-prediction modes between the -1st and -14th, respectively.

[0354] If the current block is a non-square with height greater than width, the conversion range can be set from the lower-left diagonal intra-prediction mode index (e.g., 2) to (lower-left diagonal intra-prediction mode index + M), where M can be determined based on the proportions of the current block. If the current block's intra-prediction mode falls within the conversion range, the intra-prediction mode can be converted to a wide-angle intra-prediction mode. This conversion involves adding a predefined value to the intra-prediction mode, which may be the total number of directional intra-prediction modes excluding the wide-angle intra-prediction mode (e.g., 65).

[0355] In the above embodiment, each of the intra-prediction modes between the 2nd and 15th can be converted to a wide-angle intra-prediction mode between the 67th and 80th.

[0356] Hereafter, the intra-prediction modes that fall within the conversion range will be referred to as wide-angle intra-alternative prediction modes.

[0357] The conversion range can be determined based on the ratio of the current blocks. As an example, Tables 7 and 8 show the conversion range when 35 intra-prediction modes are defined, excluding the wide-angle intra-prediction mode, and when 67 intra-prediction modes are defined, respectively.

[0358] [Table 7]

[0359] [Table 8]

[0360] As shown in the examples in Tables 7 and 8, the number of wide-angle intra-alternative prediction modes included in the conversion range can vary depending on the current block ratio.

[0361] As a wide-angle intra-prediction mode is used in addition to the existing intra-prediction mode, the resources required to encode the wide-angle intra-prediction mode may increase, potentially reducing encoding efficiency. Therefore, encoding efficiency can be improved by encoding an alternative intra-prediction mode for the wide-angle intra-prediction mode instead of encoding the wide-angle intra-prediction mode directly.

[0362] For example, if the current block is encoded using the 67th wide-angle intra-prediction mode, then the 67th wide-angle alternative intra-prediction mode, number 2, can be encoded using the current block's intra-prediction mode. Also, if the current block is encoded using the -1st wide-angle intra-prediction mode, then the -1st wide-angle alternative intra-prediction mode, number 66, can be encoded using the current block's intra-prediction mode.

[0363] The decoder can decode the intra-prediction mode of the current block and determine whether the decoded intra-prediction mode falls within the conversion range. If the decoded intra-prediction mode is a wide-angle alternative intra-prediction mode, the intra-prediction mode can be converted to a wide-angle intra-prediction mode.

[0364] Alternatively, if the current block is encoded in wide-angle intra-predictive mode, the wide-angle intra-predictive mode can be encoded as is.

[0365] The encoding of the intra-prediction mode can be implemented based on the above MPM list. Specifically, if an adjacent block is encoded in wide-angle intra-prediction mode, the MPM can be set based on the wide-angle alternative intra-prediction mode corresponding to the wide-angle intra-prediction mode. For example, if an adjacent block is encoded in wide-angle intra-prediction mode, the variable candIntraPredX (where X is A or B) can be set to wide-angle alternative intra-prediction mode.

[0366] When prediction blocks are generated using the results of intraprediction, the prediction samples can be updated based on the position of each prediction sample included in the prediction block. This update method can be called a Position-Dependent Prediction Combination (PDPC) intraprediction method based on sample position.

[0367] Whether to use PDPC can be determined by considering the current block's intra-prediction mode, the current block's reference sample line, the current block's size, or the color components. For example, PDPC can be used if the current block's intra-prediction mode is at least one of the following: planner, DC, vertical, horizontal, a mode with an index value less than vertical, or a mode with an index value greater than horizontal. Alternatively, PDPC can be used only if at least one of the current block's width or height is greater than 4. Alternatively, PDPC can be used only if the index of the current block's reference image line is 0. Alternatively, PDPC can be used only if the index of the current block's reference image line is greater than or equal to a predefined value. Alternatively, PDPC can be used only for the luminance component. Alternatively, whether to use PDPC can be determined according to whether two or more of the above-listed conditions are met.

[0368] As another example, information indicating whether PDPC applies can be signaled via a bitstream.

[0369] When a prediction sample is obtained via an intra-prediction sample, a reference sample used to correct the prediction sample can be determined based on the position of the obtained prediction sample. For convenience of explanation, in the embodiments described later, the reference sample used to correct the prediction sample will be referred to as the PDPC reference sample. Furthermore, the prediction sample obtained via intra-prediction will be referred to as the first prediction sample, and the prediction sample obtained by correcting the first prediction sample will be referred to as the second prediction sample.

[0370] Figure 36 is a diagram showing a format to which PDPC has been applied.

[0371] The first predicted sample can be corrected using at least one PDPC reference sample. The PDPC reference sample may include at least one of the following: a reference sample adjacent to the upper left corner of the current block, an upper reference sample located at the top of the current block, or a left reference sample located to the left of the current block.

[0372] At least one of the reference samples belonging to the current block's reference sample line can be set as the PDPC reference sample. Alternatively, at least one of the reference samples belonging to the reference sample line with index 0 can be set as the PDPC reference sample, regardless of the current block's reference sample line. For example, even if the first prediction sample is obtained using a reference sample contained in the reference sample line with index 1 or index 2, the second prediction sample can be obtained using a reference sample contained in the reference sample line with index 0.

[0373] The number or position of PDPC reference samples used to correct the first predicted sample can be determined by considering at least one of the current block's intra-prediction mode, current block size, current block shape, or the position of the first predicted sample.

[0374] For example, if the current block's intra-prediction mode is Planner or DC mode, a second prediction sample can be obtained using the upper and left-side reference samples. In this case, the upper reference sample may be a reference sample perpendicular to the first prediction sample (e.g., a reference sample with the same x-coordinate), and the left-side reference sample may be a reference sample horizontal to the first prediction sample (e.g., a reference sample with the same y-coordinate).

[0375] If the current block's intra-prediction mode is a horizontal intra-prediction mode, a second prediction sample can be obtained using the upper reference sample. In this case, the upper reference sample may be a reference sample perpendicular to the first prediction sample.

[0376] If the current block's intra-prediction mode is vertical, a second prediction sample can be obtained using the left-hand reference sample. In this case, the left-hand reference sample may be a horizontal reference sample relative to the first prediction sample.

[0377] If the current block's intra-prediction mode is the diagonal mode in the lower left or upper right direction, a second prediction sample can be obtained based on the upper left reference sample, the top reference sample, and the left reference sample. The upper left reference sample may be a reference sample adjacent to the upper left corner of the current block (for example, a reference sample at position (-1,-1)). The top reference sample is a reference sample located diagonally to the upper right of the first prediction sample, and the left reference sample may be a reference sample located diagonally to the lower left of the first prediction sample.

[0378] In summary, if the position of the first predicted sample is (x,y), then R(-1,-1) can be set as the top-left reference sample, and R(x+y+1,-1) or R(x,-1) can be set as the top reference sample. Additionally, R(-1,x+y+1) or R(-1,y) can be set as the left-side reference sample.

[0379] As another example, the position of the left reference sample or the top reference sample can be determined by considering at least one of the current block shape or whether wide-angle intra mode is applied.

[0380] Specifically, if the current block's intra-prediction mode is wide-angle intra-prediction mode, a reference sample offset by an amount from the reference sample located diagonally opposite the first predicted sample can be set as the PDPC reference sample. For example, the upper reference sample R(x+y+k+1,-1) and the left reference sample R(-1,x+y-k+1) can be set as the PDPC reference samples.

[0381] In this case, the offset k can be determined based on the wide-angle intra-prediction mode. Equations 9 and 10 show an example of deriving the offset based on the wide-angle intra-prediction mode.

[0382]

number

[0383]

number

[0384] The second predicted sample can be determined based on a weighted sum operation between the first predicted sample and the PDPC reference sample. For example, the second predicted sample can be obtained based on the following equation 11.

[0385]

number

[0386] In Equation 11, RL represents the left reference sample, RT represents the top reference sample, and RTL represents the top-left reference sample. Pred(x,y) represents the predicted sample at position (x,y). wL represents the weight value assigned to the left reference sample, wT represents the weight value assigned to the top reference sample, and wTL represents the weight value assigned to the top-left reference sample. The weight value assigned to the first predicted sample can be derived by subtracting the weight value assigned to the reference sample from the maximum value. For the sake of explanation, the weight value assigned to the PDPC reference sample will be referred to as the PDPC weight value.

[0387] The weight value assigned to each reference sample can be determined based on at least one of the current block's intra-prediction mode or the position of the first predicted sample.

[0388] For example, at least one of wL, wT, or wTL may be proportional or inversely proportional to at least one of the x-axis or y-axis coordinate values ​​of the predicted sample. Alternatively, at least one of wL, wT, or wTL may be proportional or inversely proportional to at least one of the width or height of the current block.

[0389] If the current block's intra-prediction mode is DC, the PDPC weight values ​​can be determined by the following equation 12.

[0390]

number

[0391] In Equation 12, x and y represent the positions of the first predicted sample.

[0392] Equation 12 allows us to derive the variable `shift` used in bit shift operations based on the width or height of the current block. For example, the variable `shift` can be derived based on Equation 13 or Equation 14 below.

[0393]

number

[0394]

number

[0395] Alternatively, the variable `shift` can be derived by considering the intra-direction parameter of the current block.

[0396] The number or type of parameters used to derive the variable shift can be determined differently depending on the intra-prediction mode of the current block. For example, if the intra-prediction mode of the current block is planner, DC, vertical, or horizontal, the variable shift can be derived using the width and height of the current block, as shown in the example in Equation 13 or Equation 14. If the intra-prediction mode of the current block is an intra-prediction mode with a higher index than the vertical intra-prediction mode, the variable shift can be derived using the height and intra-direction parameters of the current block. If the intra-prediction mode of the current block is an intra-prediction mode with a lower index than the horizontal intra-prediction mode, the variable shift can be derived using the width and intra-direction parameters of the current block.

[0397] If the current block's intra-prediction mode is Planner, the value of wTL can be set to 0. wL and wT can be derived based on the following equation 15.

[0398]

number

[0399] If the current block's intra-prediction mode is horizontal, wT can be set to 0 and wTL and wL can be set to the same value. Alternatively, if the current block's intra-prediction mode is vertical, wL can be set to 0 and wTL and wT can be set to the same value.

[0400] If the current block's intra-prediction mode is an intra-prediction mode with a larger index value than the vertical intra-prediction mode that points to the upper right, the PDPC weight value can be derived as shown in Equation 16 below.

[0401]

number

[0402] On the other hand, if the current block's intra-prediction mode is an intra-prediction mode with a smaller index value than the horizontal intra-prediction mode which is oriented downwards to the left, the PDPC weight value can be derived as shown in Equation 17 below.

[0403]

number

[0404] As in the above embodiment, the PDPC weight values ​​can be determined based on the positions x and y of the predicted sample.

[0405] As another example, the weight values ​​assigned to each PDPC reference sample can also be determined on a subblock basis. Predicted samples contained within a subblock can share the same PDPC weight values.

[0406] The size of the subblock, which is the basic unit for determining weight values, may be predefined by the encoder and decoder. For example, weight values ​​can be determined for either 2x2 or 4x4 subblocks.

[0407] Alternatively, the size, shape, or number of subblocks can be determined according to the size or shape of the current block. For example, a coded block can be divided into four subblocks, regardless of the size of the coded block. Or, a coded block can be divided into four or sixteen subblocks, according to its size.

[0408] Alternatively, the size, shape, or number of subblocks can be determined based on the current block's intra-prediction mode. For example, if the current block's intra-prediction mode is horizontal, N columns (or N rows) can be set as one subblock, while if the current block's intra-prediction mode is vertical, N rows (or N columns) can be set as one subblock.

[0409] Equations 18 to 20 show examples of determining PDPC weights for a 2x2 subblock. Equation 18 shows the case where the intra-prediction mode of the current block is DC mode.

[0410]

number

[0411] In Equation 18, K can be determined based on the size of the subblock.

[0412] Equation 19 shows the case where the current block's intra-prediction mode has a larger index value than the vertical intra-prediction mode that points to the upper right.

[0413]

number

[0414] Equation 20 shows the case where the current block's intra-prediction mode has a smaller index value than the horizontal intra-prediction mode, which is oriented downward to the left.

[0415]

number

[0416] In equations 18 to 20, x and y represent the position of the reference sample within the subblock. The reference sample may be any one of the following: the sample located in the upper left of the subblock, the sample located in the center of the subblock, or the sample located in the lower right of the subblock.

[0417] Equations 21 to 23 show examples of determining PDPC weights for a 4x4 subblock. Equation 21 shows the case where the intra-prediction mode of the current block is DC mode.

[0418]

number

[0419] Equation 22 shows the case where the current block's intra-prediction mode has a larger index value than the vertical intra-prediction mode that points to the upper right.

[0420]

number

[0421] Equation 23 shows the case where the current block's intra-prediction mode has a smaller index value than the horizontal intra-prediction mode that points downward to the left.

[0422]

number

[0423] In the above embodiment, the PDPC weight values ​​were determined considering the position of the first predicted sample or the predicted sample contained in the subblock. The PDPC weight values ​​can also be determined by giving more consideration to the shape of the current block.

[0424] For example, in DC mode, the method for deriving PDPC weight values ​​may differ depending on whether the current block is a non-square shape where the width is greater than the height, or a non-square shape where the height is greater than the width.

[0425] Equation 24 shows an example of deriving PDPC weight values ​​when the current block is a non-square where the width is greater than the height, and Equation 25 shows an example of deriving PDPC weight values ​​when the current block is a non-square where the height is greater than the width.

[0426]

number

[0427]

number

[0428] If the current block is not square, the wide-angle intra-prediction mode can be used to predict the current block. In this way, even when the wide-angle intra-prediction mode is applied, PDPC can be applied to update the first prediction sample.

[0429] If wide-angle intra-prediction is applied to the current block, the PDPC weight values ​​can be determined by considering the shape of the encoded block.

[0430] For example, if the current block is a non-square with a width greater than its height, depending on the position of the first predicted sample, it may be possible that the upper reference sample located to the upper right of the first predicted sample is closer to the first predicted sample than the left reference sample located to the lower left of the first predicted sample. This allows the weight applied to the upper reference sample to be set to be greater than the weight applied to the left reference sample when correcting the first predicted sample.

[0431] On the other hand, if the current block is a non-square with height greater than width, depending on the position of the first predicted sample, it may be possible that the left reference sample located to the lower left of the first predicted sample is closer to the first predicted sample than the upper reference sample located to the upper right of the first predicted sample. This allows the weight applied to the left reference sample to be set to be greater than the weight applied to the upper reference sample when correcting the first predicted sample.

[0432] Equation 26 shows an example of deriving PDPC weight values ​​when the current block's intra-prediction mode is a wide-angle intra-prediction mode with an index greater than 66.

[0433]

number

[0434] Equation 27 shows an example of deriving PDPC weight values ​​when the current block's intra-prediction mode is a wide-angle intra-prediction mode with an index less than 0.

[0435]

number

[0436] The PDPC weight values ​​can also be determined based on the current block ratio. The current block ratio represents the ratio of the width to the height of the current block and can be defined as shown in Equation 28 below.

[0437]

number

[0438] The method for deriving PDPC weight values ​​can be variably determined according to the current block's intra-prediction mode.

[0439] As an example, equations 29 and 30 show an example of deriving PDPC weight values ​​when the intra-prediction mode of the current block is DC. Specifically, equation 29 is an example where the current block is a non-square shape with width greater than height, and equation 30 is an example where the current block is a non-square shape with height greater than width.

[0440]

number

[0441]

number

[0442] Equation 31 shows an example of deriving PDPC weight values ​​when the current block's intra-prediction mode is a wide-angle intra-prediction mode with an index greater than 66.

[0443]

number

[0444] Equation 32 shows an example of deriving PDPC weight values ​​when the current block's intra-prediction mode is a wide-angle intra-prediction mode with an index less than 0.

[0445]

number

[0446] A single prediction mode can be applied multiple times to the current block, or multiple prediction modes can be applied in a redundant manner. This method of using the same or different types of prediction modes can be called a combined prediction mode (or a multi-hypothesis prediction model).

[0447] Information indicating whether the current block applies a combinatorial prediction mode can be signaled via a bitstream. For example, this information may be a 1-bit flag.

[0448] The combination prediction mode can generate a first prediction block based on the first prediction mode and a second prediction block based on the second prediction mode. It can then generate a third prediction block based on a weighted sum operation of the first and second prediction blocks. The third prediction block can then be set as the final prediction block for the current block.

[0449] The combined prediction mode may include at least one of the following: a mode that combines merge mode and merge mode; a mode that combines interpretation and intraprediction; a mode that combines merge mode and motion vector prediction mode; or a mode that combines merge mode and intraprediction.

[0450] A mode combining merge modes allows motion compensation prediction to be performed using multiple merge candidates. Specifically, a first prediction block can be generated using a first merge candidate, and a second prediction block can be generated using a second merge candidate. A third prediction block can be generated based on a weighted sum operation of the first and second prediction blocks.

[0451] Information for identifying the first and second merge candidates can be signaled via a bitstream. For example, index information merge_idx for identifying the first merge candidate and index information merge_2nd_idx for identifying the second merge candidate can be signaled via a bitstream. Based on the index information merge_2nd_idx and the index information merge_idx, the second merge candidate can be determined.

[0452] The index information merge_idx identifies one of the merge candidates included in the merge candidate list.

[0453] The index information merge_2nd_idx can identify one of the remaining merge candidates excluding the merge candidate identified by merge_idx. This means that if the value of merge_2nd_idx is less than merge_idx, the merge candidate whose index is the value of merge_2nd_idx can be set as the second merge candidate. If the value of merge_2nd_idx is greater than or equal to the value of merge_idx, the merge candidate whose index is the value of merge_2nd_idx plus 1 can be set as the second merge candidate.

[0454] Alternatively, a second merge candidate can be identified by considering the search order of the candidate blocks.

[0455] Figure 37 shows an example of identifying a second merge candidate by considering the search order of candidate blocks.

[0456] In the example shown in Figure 37, the indices indicated for adjacent and non-adjacent samples represent the search order for candidate blocks. For example, candidate blocks can be searched sequentially from position A0 to position A14.

[0457] If block A4 is selected as the first merge candidate, a merge candidate derived from the candidate block that follows A4 in the search order can be identified as the second merge candidate. For example, a merge candidate derived from A5 can be selected as the second merge candidate. If the candidate block at position A5 is unavailable as a merge candidate, a merge candidate derived from the next-ranked candidate block can be selected as the second merge candidate.

[0458] You can also select a first and second merge candidate from among the merge candidates derived from non-adjacent blocks.

[0459] Figure 38 is a diagram showing an example in which a first merge candidate and a second merge candidate are selected from among the merge candidates derived from non-adjacent blocks.

[0460] As shown in the example in Figure 38, merge candidates derived from a first candidate block and a second candidate block that are not adjacent to the current block can be selected as the first and second merge candidates, respectively. In this case, the block line to which the first candidate block belongs and the block line to which the second candidate block belongs may be different. For example, the first merge candidate may be derived from one of the candidate blocks A5 to A10, and the second merge candidate may be derived from one of the candidate blocks A11 to A15.

[0461] Alternatively, you can configure the system so that the first candidate block and the second candidate block do not fall on the same line (for example, a row or column).

[0462] As another example, a second merge candidate can be identified based on a first merge candidate. In this case, the first merge candidate can be identified by the index information merge_idx signaled from the bitstream. As an example, a merge candidate adjacent to the first merge candidate can be identified as the second merge candidate. Here, a merge candidate adjacent to the first merge candidate can mean a merge candidate whose index difference value with the first merge candidate is 1. As an example, a merge candidate with an index value of merge_idx+1 can be set as the second merge candidate. In this case, if the value of merge_idx+1 is greater than the maximum index value (or if the index value of the first merge candidate is the maximum index), a merge candidate with an index value of merge_idx-1 or a merge candidate with an index value of a predefined value (e.g., 0) can be set as the second merge candidate.

[0463] Alternatively, a merge candidate adjacent to the first merge candidate may mean a merge candidate derived from a candidate block spatially adjacent to the candidate block used to derive the first merge candidate. Here, an adjacent candidate block of a candidate block may mean a block adjacent to the candidate block to the left, right, above, below, or diagonally.

[0464] As another example, a second merge candidate can be identified based on the motion information of the first merge candidate. For example, a merge candidate that has the same reference image as the first merge candidate can be selected as the second merge candidate. If there are multiple merge candidates that have the same reference image as the first merge candidate, the merge candidate with the smallest index among the multiple merge candidates, or the merge candidate with the smallest index difference from the first merge candidate, can be selected as the second merge candidate. Alternatively, a second merge candidate can be selected based on index information that identifies any one of the multiple merge candidates.

[0465] Alternatively, if the first merge candidate is a unidirectional prediction in the first direction, a merge candidate containing motion information in the second direction can be set as the second merge candidate. For example, if the first merge candidate has motion information in the L0 direction, a merge candidate with motion information in the L1 direction can be selected as the second merge candidate. If there are multiple merge candidates with motion information in the L1 direction, the merge candidate with the smallest index among the multiple merge candidates, or the merge candidate with the smallest index difference from the first merge candidate, can be set as the second merge candidate. Alternatively, the second merge candidate can be selected based on index information that identifies one of the multiple merge candidates.

[0466] As another example, one can set one of the merge candidates derived from adjacent blocks adjacent to the current block as the first merge candidate, and one of the merge candidates derived from non-adjacent blocks not adjacent to the current block as the second merge candidate.

[0467] As another example, one of the merge candidates derived from the candidate blocks located above the current block can be set as the first merge candidate, and one of the merge candidates derived from the candidate blocks located to the left can be set as the second merge candidate.

[0468] A combined prediction block can be obtained by performing a weighted sum operation on the first prediction block derived from the first merge candidate and the second prediction block derived based on the second merge candidate. In this case, the weight value applied to the first prediction block can be set to a value greater than the weight value applied to the second prediction block.

[0469] Alternatively, the weight values ​​can be determined based on the motion information of the first and second merge candidates. For example, the weight values ​​applied to the first and second prediction blocks can be determined based on the difference in output order between the reference image and the current image. Specifically, the larger the difference in output order between the reference image and the current image, the smaller the weight value applied to the prediction block can be set.

[0470] Alternatively, the weight values ​​applied to the first and second prediction blocks can be determined by considering the size or shape of the candidate block used to derive the first merge candidate (hereinafter referred to as the first candidate block) and the candidate block used to derive the second merge candidate (hereinafter referred to as the second candidate block). For example, among the first and second candidate blocks, the weight value applied to the prediction block derived from having a shape similar to the current block can be set to a large value. On the other hand, the weight value applied to the prediction block derived from having a shape dissimilar to the current block can be set to a small value.

[0471] Figure 39 is a diagram illustrating an example where weight values ​​applied to the predicted block are determined based on the shape of the candidate block.

[0472] Assume the current block is a non-square shape where the width is greater than the height.

[0473] Based on the first and second merge candidates, the first and second prediction blocks can be derived, and a combined prediction block can be generated based on a weighted sum operation of the first and second prediction blocks. In this case, the weight values ​​applied to the first and second prediction blocks can be determined based on the shapes of the first and second candidate blocks.

[0474] As an example, in the example shown in Figure 39, the first candidate block is a square, and the second candidate block is a non-square with a width greater than its height. Since the shape of the second candidate block is the same as the current block, the weight value applied to the second prediction block can be set to be greater than the weight value applied to the first prediction block. For example, a weight value of 5 / 8 can be applied to the second prediction block and a weight value of 3 / 8 can be applied to the first prediction block. Equation 33 shows an example of deriving a combined prediction block based on a weighted sum operation of the first and second prediction blocks.

[0475]

number

[0476] P(x,y) represents a combination prediction block, P1(x,y) represents the first prediction block, and P2(x,y) represents the second prediction block.

[0477] As another example, the weight values ​​applied to the first and second predicted blocks can be determined based on the shape of the current block. For example, if the current block is a non-square with a width greater than its height, a higher weight can be applied to the predicted block generated based on the candidate block located above the current block, among the first and second merge candidates. If both the first and second merge candidates are derived from the candidate block located above, the weight values ​​applied to the first and second predicted blocks can be set to be the same. On the other hand, if the current block is a non-square with a height greater than its width, a higher weight can be applied to the predicted block generated based on the candidate block located to the left of the current block, among the first and second merge candidates. If both the first and second merge candidates are derived from the candidate block located to the left, the weight values ​​applied to the first and second predicted blocks can be set to be the same. If the current block is a square, the weight values ​​applied to the first and second predicted blocks can be set to be the same.

[0478] As another example, the weight values ​​applied to each predicted block can be determined based on the distance between the current block and the candidate blocks. Here, the distance can be derived based on the x-axis coordinate difference, the y-axis coordinate difference, or the minimum of these values ​​from the current block. The weight values ​​applied to predicted blocks derived from merge candidates that are farther from the current block can be set to be greater than the weight values ​​applied to predicted blocks derived from merge candidates that are farther from the current block. For example, in the example shown in Figure 37, the first merge candidate is derived from an adjacent block adjacent to the current block, and the second merge candidate is derived from a non-adjacent block that is not adjacent to the current block. In this case, since the x-axis distance between the first candidate block and the current block is smaller than the x-axis distance between the second candidate block and the current block, the weight values ​​applied to the first predicted block can be set to be greater than the weight values ​​applied to the second predicted block.

[0479] Alternatively, if both the first and second merge candidates are derived from non-adjacent blocks, a larger weight can be assigned to the predicted block derived from the non-adjacent block that is closer to the current block. For example, in the example shown in Figure 38, since the y-axis distance between the first candidate block and the current block is smaller than the y-axis distance between the second candidate block and the current block, the weight applied to the first predicted block can be set to be larger than the weight applied to the second predicted block.

[0480] In the combined prediction mode that combines the merge modes described above, the merge mode can mean either a merge mode based on a translational motion model (hereinafter referred to as the translational merge mode) or a merge mode based on an affine motion model (hereinafter referred to as the affine merge mode). That is, motion compensation prediction can be performed by combining two translational merge modes or by combining two affine merge modes.

[0481] For example, if the first merge candidate is an affine merge candidate, the second merge candidate can also be set as an affine merge candidate. Here, an affine merge candidate is defined as a case where the motion vector of the block containing the reference candidate is an affine motion vector. The second merge candidate can be identified in the various embodiments described above. For example, the second merge candidate can be set as an adjacent merge candidate to the first merge candidate. In this case, if the merge candidate adjacent to the first merge candidate is not encoded as an affine motion model, a merge candidate encoded as an affine motion model can be set as the second merge candidate instead of the aforementioned merge candidate.

[0482] Conversely, if the first merge candidate is a non-affine merge candidate, the second merge candidate can also be set as a non-affine merge candidate. In this case, if a merge candidate adjacent to the first merge candidate is encoded using an affine motion model, a merge candidate encoded using a translational motion model can be set as the second merge candidate instead of the first merge candidate.

[0483] Figure 40 is a diagram illustrating an example where a non-affine merge candidate is set as the second merge candidate instead of an affine merge candidate.

[0484] If a merge candidate at position A1 is identified as the first merge candidate via merge_idx, then merge candidate A2, whose index value is 1 greater than that of the first merge candidate, can be selected as the second merge candidate. In this case, if the first merge candidate is a non-affine merge candidate but the second merge candidate is an affine merge candidate, the second merge candidate can be reset. For example, among the merge candidates with an index greater than merge_idx+1, a non-affine merge candidate with a smaller difference value from merge_idx+1 can be reset as the second merge candidate. As an example, the example shown in Figure 18 shows that merge candidate A3, whose index is merge_idx+2, is set as the second merge candidate.

[0485] As another example, motion compensation prediction can be performed by combining translational merge mode and affine merge mode. That is, one of the first or second merge candidates may be an affine merge candidate, and the other may be a non-affine merge candidate.

[0486] It is also possible to derive integrated motion information based on the first and second merge candidates, and to perform motion compensation prediction for the current block based on the integrated motion information. For example, the motion vector of the current block can be derived based on an average or weighted sum calculation of the motion vectors of the second merge candidate and the motion vectors of the first merge candidate. In this case, the weight values ​​applied to the motion vectors of the first merge candidate and the weight values ​​applied to the motion vectors of the second merge candidate can be determined by the above embodiment.

[0487] If the first merge candidate is a non-affine merge candidate and the second affine merge candidate is an affine merge candidate, the motion vector of the current block can be derived by scaling the motion vector of the second merge candidate. Equation 34 shows an example of deriving the motion vector of the current block.

[0488]

number

[0489] In equation 34, (mvX, mvY) represents the motion vector of the current block, (mv0x, mv0y) represents the motion vector of the first merge candidate, and (mv1x, mv1y) represents the motion vector of the second merge candidate. M represents the scaling parameter. M can be predefined in the encoder and decoder. Alternatively, the value of the scaling parameter M can be determined according to the size of the current block or candidate block. For example, if the width or height of the second candidate block is greater than 32, M can be set to 3, and otherwise, M can be set to 2.

[0490] In a prediction mode that combines merge mode and motion vector prediction mode, a first prediction block can be generated using motion information derived from merge candidates, and a second prediction block can be generated using motion vectors derived from motion vector prediction candidates.

[0491] In motion vector prediction mode, motion vector prediction candidates can be derived from adjacent blocks to the current block or from blocks at the same position within the same position image. Then, one of the multiple motion vector prediction candidates can be identified, and the identified motion vector prediction candidate can be set as the motion vector prediction value for the current block. After that, the motion vector of the current block can be derived by adding the motion vector prediction value and the motion vector difference value.

[0492] In prediction mode, which combines merge mode and motion vector prediction mode, merge candidates and motion vector prediction candidates can be derived from the same candidate block. For example, if a merge candidate is identified via merge_idx, the motion vector of the candidate block used to derive the identified merge candidate can be set as the motion vector prediction value. Alternatively, if a motion vector prediction candidate is identified via mvp_flag, a merge candidate derived from the candidate block used to derive the identified merge candidate can be selected.

[0493] Alternatively, the candidate blocks used to derive the merge candidates may be different from the candidate blocks used to derive the motion vector prediction candidates. For example, you can configure the system so that selecting a merge candidate derived from a candidate block located above the current block will select a motion vector prediction candidate derived from a candidate block located to the left of the current block.

[0494] Alternatively, if the merge candidate selected by the index information and the motion vector prediction candidate selected by the index information are derived from the same candidate block, the motion vector prediction candidate can be replaced with a motion vector prediction candidate derived from a candidate block adjacent to the candidate block, or the merge candidate can be replaced with a merge candidate derived from a candidate block adjacent to the candidate block.

[0495] Figure 41 is a diagram illustrating an example of how merge candidates are replaced.

[0496] In the example shown in Figure 41(a), it is shown that the merge candidate and motion vector prediction candidate are selected from the candidate block located at position A2. As shown, if the merge candidate and motion vector prediction candidate are derived from the same candidate block, the merge candidate or motion vector prediction candidate derived from a candidate block adjacent to the candidate block can be used instead of the merge candidate or motion vector prediction candidate. For example, as shown in Figure 41(b), the merge candidate at position A1 can be used instead of the merge candidate at position A2.

[0497] Based on the current block merge candidates, a first prediction block can be derived, and based on the motion vector prediction candidates, a second prediction block can be derived. Subsequently, a combined prediction block can be derived by performing a weighted sum operation on the first and second prediction blocks. In this case, the weight values ​​applied to the second prediction block, generated in motion vector prediction mode, can be set to have larger values ​​than the weight values ​​applied to the first prediction block, generated in merge mode.

[0498] A residual image can be derived by subtracting the predicted image from the original image. In this case, when the residual image is converted to the frequency domain, the subjective image quality of the image does not deteriorate significantly even if the high-frequency components are removed. This has the effect of improving compression efficiency without causing significant visual distortion by reducing the value of the high-frequency components or setting the value of the high-frequency components to 0. Reflecting the above characteristics, the current block can be transformed to decompose the residual image into two-dimensional frequency components. This transformation can be performed using transformation techniques such as the Discrete Cosine Transform (DCT) or the Discrete Sine Transform (DST).

[0499] DCT uses the cosine transform to decompose (or transform) the residual image into two-dimensional frequency components, while DST uses the sine transform to decompose (or transform) the residual image into two-dimensional frequency components. The transformed residual image's frequency components can be represented as fundamental images. For example, when performing a DCT transform on an NxN block, N2 fundamental pattern components can be obtained. The size of each fundamental pattern component contained in the NxN block can be obtained through the transformation. Depending on the transformation technique used, the size of the fundamental pattern component can be called the DCT coefficient or DST coefficient.

[0500] The DCT conversion technology is primarily used to convert video with a large distribution of non-zero low-frequency components. The DST conversion technology is primarily used to convert video with a large distribution of high-frequency components.

[0501] Residual images can also be converted using conversion technologies other than DCT or DST.

[0502] Hereinafter, the process of converting residual video into two-dimensional frequency components can be referred to as two-dimensional video conversion. Furthermore, the size of the components of the basic pattern obtained by the conversion result will be referred to as the conversion coefficient. As an example, the conversion coefficient can mean the DCT coefficient or the DST coefficient. When both the first and second conversions described later are applied, the conversion coefficient can mean the size of the components of the basic pattern generated as a result of the second conversion.

[0503] The transformation technique can be determined on a block-by-block basis. The transformation technique can be determined based on at least one of the following: the predictive coding mode of the current block, the size of the current block, or the size of the current block. For example, if the current block is coded in intra-predictive mode and the size of the current block is less than NxN, the transformation can be performed using the DST transformation technique. Alternatively, if the above conditions are not met, the DCT transformation technique can be used.

[0504] For some blocks of residual video, the 2D video transformation may not be performed. This skipping of the 2D video transformation can be called a transform skip. When a transform skip is applied, quantization can be applied to the residual values ​​that were not transformed.

[0505] After transforming the current block using DCT or DST, the transformed current block can be re-transformed. In this case, the transformation based on DCT or DST can be defined as the first transformation, and the re-transformation of the block to which the first transformation has been applied can be defined as the second transformation.

[0506] The first transformation can be performed using one of several transformation core candidates. For example, the first transformation can be performed using one of DCT2, DCT8, or DCT7.

[0507] Different conversion cores can be used for horizontal and vertical directions. Information indicating the combination of horizontal and vertical conversion cores can also be signaled via a bitstream.

[0508] The execution units for the first and second transformations may differ. For example, the first transformation can be performed on an 8x8 block, and then the second transformation can be performed on a 4x4 subblock within that transformed 8x8 block. In this case, the transformation coefficient for the remaining area where the second transformation has not been performed can also be set to 0.

[0509] Alternatively, you can perform the first transformation on a 4x4 block and then perform the second transformation on an 8x8 area containing the transformed 4x4 block.

[0510] Information indicating whether a second transformation is being performed can be signaled via the bitstream.

[0511] The decoder can perform the inverse transformation of the second transformation (second inverse transformation), and then perform the inverse transformation of the first transformation (first inverse transformation) on the result of that transformation. As a result of performing the second and first inverse transformations, the residual signal for the current block can be obtained.

[0512] Quantization is performed to reduce the energy of the block, and the quantization process involves dividing the transformation coefficients by a specific constant. This constant may be derived from a quantization parameter, which can be defined as a value between 1 and 63.

[0513] After the encoder performs the transformation and quantization, the decoder can obtain the residual block via inverse quantization and inverse transformation. The decoder can then add the predicted block and the residual block to obtain the reconstructed block for the current block.

[0514] Obtaining a reconstructed block of the current block allows for the reduction of information loss during quantization and encoding via in-loop filtering. The in-loop filter may include at least one of the following: a deblocking filter, a sample adaptive offset filter (SAO), or an adaptive loop filter (ALF). Hereinafter, the reconstructed block before the application of the in-loop filter will be referred to as the first reconstructed block, and the reconstructed block after the application of the in-loop filter will be referred to as the second reconstructed block.

[0515] The second reconstructed block can be obtained by applying at least one of a deblocking filter, SAO, or ALF to the first reconstructed block. In this case, the SAO or ALF can be applied after the deblocking filter has been applied.

[0516] A deblocking filter is used to mitigate the image quality degradation (blocking artifact) at the boundaries of blocks that occurs when quantization is performed on a block-by-block basis. To apply a deblocking filter, the blocking strength (BS) between the first reconstructed block and adjacent reconstructed blocks can be determined.

[0517] Figure 42 is a flowchart showing the process for determining the strength of a block.

[0518] In the example shown in Figure 42, P represents the first reconfiguration block, and Q represents an adjacent reconfiguration block. Here, an adjacent reconfiguration block can be adjacent to the left or above the current block.

[0519] The example shown in Figure 42 demonstrates how block intensity is determined by considering the predictive coding modes of P and Q, whether non-zero conversion coefficients are included, whether they were interpreted using the same reference image, or whether the difference value of the motion vector is greater than or equal to the threshold.

[0520] Based on the block strength, it can be determined whether a deblocking filter is applied. For example, if the block strength is 0, filtering may not be performed.

[0521] SAO is used to mitigate ringing artifacts generated by quantization in the frequency domain. SAO can be performed by adding or subtracting an offset determined by considering the pattern of the first reconstructed image. Methods for determining the offset include edge offset (EO) or band offset. EO indicates a method for determining the offset of the current sample according to the pattern of surrounding pixels. BO indicates a method for applying a common offset to sets of pixels with similar luminance values ​​within a region. Specifically, the brightness of pixels can be divided into 32 equal intervals, and pixels with similar luminance can be set as a single set. As an example, four adjacent bands out of the 32 can be set as one group, and the same offset value can be applied to samples belonging to these four bands.

[0522] ALF is a method for generating a second reconstructed image by applying a predefined size / shape filter to a first reconstructed image or a reconstructed image to which a deblocking filter has been applied. Equation 35 shows an example of ALF application.

[0523]

number

[0524] At the image, coding tree unit, coding block, prediction block, or transformation block level, one of a predefined set of filter candidates can be selected. Each filter candidate may differ in either size or shape.

[0525] Figure 43 shows predefined filter candidates.

[0526] As shown in the example in Figure 43, at least one of the diamond shapes of 5x5, 7x7, or 9x9 sizes can be selected.

[0527] For the chroma component, only a 5x5 diamond shape can be used.

[0528] Applying the embodiments described, which focus on the decoding process or the encoding process, to the encoding process or the decoding process is within the scope of the present invention. Changing the order in which the embodiments described, which are described in a predetermined order, are described to a different order is also within the scope of the present invention.

[0529] Although the above embodiments have been described based on a series of steps or flowcharts, this does not limit the chronological sequence of the invention, and they can be performed simultaneously or in a different order as needed. Furthermore, in the above embodiments, each of the components constituting the block diagram (e.g., units, modules, etc.) can be embodied in hardware devices or software, and multiple components can be combined to be embodied in a single hardware device or software. The above embodiments are embodied in the form of program instructions that can be executed by various computer components and can be stored in a computer-readable storage medium. The computer-readable storage medium may include program instructions, data files, data structures, etc., individually or in combination. Examples of computer-readable storage media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical storage media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices such as ROMs, RAMs, and flash memory that are specifically configured to store and execute program instructions. The hardware device is configured to run as one or more software modules to perform the processing according to the present invention, and vice versa. [Industrial applicability]

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

Claims

1. A video decoding method, To generate a list of merge candidates for the first block, Select one of the merge candidates included in the aforementioned merge candidate list, The process involves generating a predicted block for the first block by performing motion compensation on the first block based on the motion information of the selected merge candidate, wherein the motion information includes a reference image index. The process includes determining the reconstructed block of the first block based on the predicted block of the first block and the residual block of the first block, Based on the number of spatial merge candidates and temporal merge candidates included in the merge candidate list, the inter-domain merge candidates included in the inter-domain motion information table are added to the merge candidate list. Based on the determination result of whether one inter-region merge candidate included in the inter-region motion information table is the same as at least one merge candidate included in the merge candidate list, it is determined whether to add the one inter-region merge candidate to the merge candidate list. The determination is performed by comparing at least one merge candidate whose index value is less than or equal to a threshold with the one inter-region merge candidate. The aforementioned video decoding method.

2. The inter-region motion information table is characterized by including inter-region merge candidates derived based on the motion information of blocks decoded before the first block. The video decoding method according to claim 1.

3. If the first block is included in the merge processing area, temporary merge candidates derived based on the motion information of the first block are added to the temporary motion information table. When decoding of all blocks included in the merge processing area is completed, the temporary merge candidates are updated in the inter-area motion information table, characterized in that The video decoding method according to claim 1.

4. If it is determined that there is a merge candidate identical to the aforementioned inter-region merge candidate, the aforementioned inter-region merge candidate is not added to the merge candidate list. Based on the determination result of whether another inter-region merge candidate included in the inter-region motion information table is the same as at least one merge candidate included in the merge candidate list, it is determined whether to add the other inter-region merge candidate to the merge candidate list. The characteristic feature is that no determination is made as to whether the aforementioned other inter-region merge candidate and the same merge candidate as the aforementioned inter-region merge candidate are identical. The video decoding method according to claim 1.

5. If the merge candidate list contains an inter-region merge candidate that is the same as the motion information of the first block, the index assigned to the inter-region merge candidate in the inter-region motion information table is updated to the maximum value. The video decoding method according to claim 1.

6. The determination is performed by comparing at least one merge candidate whose index value is greater than a threshold with the one inter-region merge candidate. The video decoding method according to claim 1.

7. The determination is performed by comparing a merge candidate derived from a block at a specific location with one inter-region merge candidate, and the specific location includes at least one of the upper right adjacent block or the lower left adjacent block of the first block. The video decoding method according to claim 1.

8. Performing motion compensation for the first block means This method is characterized by performing motion compensation prediction for a first block using multiple merge candidates. The video decoding method according to claim 1.

9. The plurality of merge candidates include a first merge candidate and a second merge candidate, and the first merge candidate and the second merge candidate are included in the merge candidate list of the first block. The first prediction block is generated using the first merge candidate, The second prediction block is generated using the aforementioned second merge candidate, The third prediction block is characterized by being generated based on the first prediction block and the second prediction block. The video decoding method according to claim 8.

10. The third prediction block is characterized by being generated based on a weighted sum operation of the first prediction block and the second prediction block. The video decoding method according to claim 9.

11. The index information merge_idx of the first merge candidate and the index information merge_2nd_idx of the second merge candidate are obtained by analyzing the bitstream. The video decoding method according to claim 9.

12. If the value of the index information merge_2nd_idx is greater than or equal to the value of the index information merge_idx, the value of the index of the second merge candidate is obtained by adding 1 to the value of the index information merge_2nd_idx. The video decoding method according to claim 11.

13. A video encoding method, To generate a list of merge candidates for the first block, Select one of the merge candidates included in the aforementioned merge candidate list, The process involves generating a predicted block for the first block by performing motion compensation on the first block based on the motion information of the selected merge candidate, wherein the motion information includes a reference image index. This includes determining the residual block of the first block based on the predicted block of the first block, Based on the number of spatial merge candidates and temporal merge candidates included in the merge candidate list, the inter-domain merge candidates included in the inter-domain motion information table are added to the merge candidate list. Based on the determination result of whether one inter-region merge candidate included in the inter-region motion information table is the same as at least one merge candidate included in the merge candidate list, it is determined whether to add the one inter-region merge candidate to the merge candidate list. The determination is performed by comparing at least one merge candidate whose index value is less than or equal to a threshold with the one inter-region merge candidate. The aforementioned video encoding method.

14. The inter-region motion information table is characterized by including inter-region merge candidates derived based on the motion information of the block encoded before the first block. The video encoding method according to claim 13.

15. If the first block is included in the merge processing area, temporary merge candidates derived based on the motion information of the first block are added to the temporary motion information table. When encoding of all blocks included in the merge processing area is completed, the temporary merge candidates are updated in the inter-area motion information table, characterized in that The video encoding method according to claim 13.

16. If it is determined that there is a merge candidate identical to the aforementioned inter-region merge candidate, the aforementioned inter-region merge candidate is not added to the merge candidate list. Based on the determination result of whether another inter-region merge candidate included in the inter-region motion information table is the same as at least one merge candidate included in the merge candidate list, it is determined whether to add the other inter-region merge candidate to the merge candidate list. The characteristic feature is that no determination is made as to whether the aforementioned other inter-region merge candidate and the same merge candidate as the aforementioned inter-region merge candidate are identical. The video encoding method according to claim 13.

17. If the merge candidate list contains an inter-region merge candidate that is the same as the motion information of the first block, the index assigned to the inter-region merge candidate in the inter-region motion information table is updated to the maximum value. The video encoding method according to claim 13.

18. The determination is performed by comparing at least one merge candidate whose index value is greater than a threshold with the one inter-region merge candidate. The video encoding method according to claim 13.

19. The determination is performed by comparing a merge candidate derived from a block at a specific location with one inter-region merge candidate, and the specific location includes at least one of the upper right adjacent block or the lower left adjacent block of the first block. The video encoding method according to claim 13.

20. Performing motion compensation for the first block means This method is characterized by performing motion compensation prediction for a first block using multiple merge candidates. The video encoding method according to claim 13.

21. The plurality of merge candidates include a first merge candidate and a second merge candidate, and the first merge candidate and the second merge candidate are included in the merge candidate list of the first block. The first prediction block is generated using the first merge candidate, The second prediction block is generated using the aforementioned second merge candidate, The third prediction block is characterized by being generated based on the first prediction block and the second prediction block. The video encoding method according to claim 20.

22. The third prediction block is characterized by being generated based on a weighted sum operation of the first prediction block and the second prediction block. The video encoding method according to claim 21.

23. The information for identifying the index information merge_idx of the first merge candidate and the index information merge_2nd_idx of the second merge candidate is signaled via a bitstream, characterized in that The video encoding method according to claim 21.

24. If the value of the index information merge_2nd_idx is greater than or equal to the value of the index information merge_idx, the value of the index of the second merge candidate is obtained by adding 1 to the value of the index information merge_2nd_idx. The video encoding method according to claim 23.

25. A video decoding device comprising memory and a processor, The memory is configured to store computer programs that can be executed by the processor. The video decoding apparatus is configured such that the processor executes a computer program to perform the video decoding method described in any one of claims 1 to 12.

26. A video encoding device comprising memory and a processor, The memory is configured to store computer programs that can be executed by the processor. The video encoding device is configured such that the processor executes a computer program to perform the video encoding method described in any one of claims 13 to 24.

27. A bitstream transmission method comprising generating a bitstream by performing the video encoding method described in claim 13, and transmitting the bitstream.