Video signal processing method and apparatus using multiple hypothesis prediction

By constructing a merge candidate list with a history-based motion vector predictor and updating the HMVP table based on decoding order, the method addresses inefficiencies in video signal processing, enhancing coding efficiency and transform kernel suitability.

JP7825313B2Active Publication Date: 2026-03-06WILUS INSTITUTE OF STANDARDS & TECHNOLOGY INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025065101
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-09-06
Filing Date
2025-04-10
Publication Date
2026-03-06
Estimated Expiration
2039-10-14

AI Technical Summary

Technical Problem

Existing video signal processing methods lack efficiency in coding, particularly in the use of transform blocks, which hampers effective compression and transmission of video data.

Method used

The method involves constructing a merge candidate list using spatial candidates and incorporating a history-based motion vector predictor (HMVP) to predict current blocks, while updating the HMVP table based on specific criteria, such as the decoding order of coding blocks within a merge sharing node.

Benefits of technology

This approach enhances coding efficiency by optimizing transform kernel selection for current blocks, improving the overall compression and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007825313000024
    Figure 0007825313000024
  • Figure 0007825313000025
    Figure 0007825313000025
  • Figure 0007825313000026
    Figure 0007825313000026
Patent Text Reader

Abstract

To provide a video signal processing method and apparatus for encoding or decoding a video signal.SOLUTION: A video signal processing method comprises the steps of: receiving information for prediction of a current block; determining whether a merge mode is applied to the current block on the basis of the information for prediction; when a merge mode is applied to the current block, obtaining a first syntax element indicating whether a combined prediction is applied to the current block; generating an inter-prediction block and an intra-prediction block of the current block when the first syntax element indicates that the combined prediction is applied to the current block; and generating a combined prediction block of the current block by weighted-summing the inter-prediction block and the intra-prediction block.SELECTED DRAWING: Figure 45
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a video signal processing method and apparatus, and more particularly to a video signal processing method and apparatus for encoding or decoding a video signal. [Background technology]

[0002] Compression coding refers to a series of signal processing techniques for transmitting digitized information over a communication line or storing it in a form suitable for a storage medium. Compression coding can be used to encode audio, video, text, and other data, but video compression is the technology that specifically targets video. Video signal compression is performed by removing redundant information by taking into account spatial correlation, temporal correlation, and stochastic correlation. However, with the recent development of various media and data transmission media, more efficient video signal processing methods and devices are needed. Summary of the Invention [Problem to be solved by the invention]

[0003] SUMMARY OF THE INVENTION An object of the present invention is to improve the coding efficiency of a video signal. Specifically, the present invention aims to improve the coding efficiency by using a transform kernel suitable for a transform block. [Means for solving the problem]

[0004] In order to solve the above problems, the present invention provides the following video signal processing device and video signal processing method.

[0005] According to one embodiment of the present invention, there is provided a video signal processing method, comprising: constructing a merge candidate list using spatial candidates; adding a specific HMVP in an HMVP table including at least one history-based motion vector predictor (HMVP) to the merge candidate list, wherein the HMVP indicates motion information of a block coded before the plurality of coding blocks; obtaining index information indicating a merge candidate to be used for predicting a current block in the merge candidate list; and generating a predicted block for the current block based on motion information of the merge candidate determined based on the index information, wherein when the current block is located within a merge sharing node including a plurality of coding blocks, the merge candidate list is constructed using spatial candidates adjacent to the merge sharing node, and motion information of at least one coding block included in the merge sharing node is not updated in the HMVP table.

[0006] According to another embodiment of the present invention, there is provided a video signal processing apparatus, the video signal processing apparatus including a processor, wherein the processor configures a merge candidate list using spatial candidates, and adds a specific HMVP in an HMVP table including at least one history-based motion vector predictor (HMVP) to the merge candidate list, wherein the HMVP obtains index information indicating a merge candidate used to predict a current block in the merge candidate list, the merge candidate indicating motion information of blocks coded before the plurality of coding blocks, and generates a predicted block for the current block based on motion information of the merge candidate determined based on the index information, and when the current block is located within a merge sharing node including a plurality of coding blocks, the merge candidate list is configured using spatial candidates adjacent to the merge sharing node, and motion information of at least one coding block among the plurality of coding blocks included in the merge sharing node is not updated in the HMVP table.

[0007] In an embodiment, the method may further include updating the HMVP table using motion information of a predefined number of coding blocks that are relatively late in decoding order among the plurality of coding blocks included in the merge sharing node.

[0008] As an example, the method may further include updating the HMVP table using motion information of a coding block having a relatively latest decoding order among a plurality of coding blocks included in the merge sharing node.

[0009] In an embodiment, if the current block is not located within the merge share node, the method may further include updating the HMVP table using motion information of the merge candidate.

[0010] In an embodiment, the step of adding the HMVP to the merge candidate list may include the steps of: using an HMVP having a specific index predefined in the HMVP table to determine whether it has motion information that overlaps with the candidates in the merge candidate list; and, if the HMVP having the specific index does not have motion information that overlaps with the candidates in the merge candidate list, adding the HMVP having the specific index to the merge candidate list.

[0011] Also, according to one embodiment of the present invention, there is provided a video signal processing method, including: receiving information for prediction of a current block; determining whether a merge mode is applied to the current block based on the information for prediction; if the merge mode is applied to the current block, obtaining a first syntax element indicating whether combined prediction is applied to the current block, wherein the combined prediction indicates a prediction mode combining inter prediction and intra prediction; if the first syntax element indicates that the combined prediction is applied to the current block, generating an inter predicted block and an intra predicted block of the current block; and generating a combined prediction block of the current block by performing a weighted sum of the inter predicted block and the intra predicted block.

[0012] Also, according to one embodiment of the present invention, there is provided a video signal processing device including a processor, wherein when a merge mode is applied to a current block, the processor obtains a first syntax element indicating whether combined prediction is applied to the current block, wherein the combined prediction indicates a prediction mode that combines inter prediction and intra prediction, and when the first syntax element indicates that the combined prediction is applied to the current block, the processor generates an inter predicted block and an intra predicted block of the current block, and generates a combined prediction block of the current block by performing a weighted sum of the inter predicted block and the intra predicted block.

[0013] In an embodiment, the method may further include: decoding a residual block of the current block; and reconstructing the current block using the combined predicted block and the residual block.

[0014] As an embodiment, the step of decoding the residual block may further include, if the first syntax element indicates that the combined prediction is not applied to the current block, obtaining a second syntax element indicating whether a sub-block transform is applied to the current block, and the sub-block transform may indicate a transform mode that applies a transform to only one of the sub-blocks of the current block divided horizontally or vertically.

[0015] As an example, if the second syntax element is not present, the value of the second syntax element may be inferred to be 0.

[0016] As an example, if the first syntax element indicates that the combined prediction is applied to the current block, the intra prediction mode for intra prediction for the current block may be set to a planar mode.

[0017] In an embodiment, the method may further include a step of setting the positions of the left peripheral block and the upper peripheral block referenced for the combined prediction, and the positions of the left peripheral block and the upper peripheral block may be the same as the positions referenced by the intra prediction.

[0018] As an example, the positions of the left and top peripheral blocks may be determined using scaling factor variables that are determined by color component index values ​​of the current block. [Effects of the Invention]

[0019] According to an embodiment of the present invention, it is possible to improve the coding efficiency of a video signal. Also, according to an embodiment of the present invention, it is possible to select a transform kernel suitable for a current transform block. [Brief explanation of the drawings]

[0020] [Figure 1] 1 is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention; [Figure 2] 1 is a schematic block diagram of a video signal decoding device according to an embodiment of the present invention; [Figure 3] FIG. 1 illustrates an example of how coding tree units are divided into coding units within a picture. [Figure 4] FIG. 1 illustrates an embodiment of a method for signaling the splitting of quadtrees and multi-type trees. [Figure 5] 2 is a diagram illustrating in more detail an intra-prediction method according to an embodiment of the present invention; [Figure 6] 2 is a diagram illustrating in more detail an intra-prediction method according to an embodiment of the present invention; [Figure 7] 1 illustrates an inter-prediction method according to one embodiment of the present invention. [Figure 8]FIG. 2 illustrates how the encoder converts the residual signal. [Figure 9] FIG. 2 illustrates how the encoder and decoder inverse transform the transform coefficients to obtain a residual signal. [Figure 10] 1 is a diagram illustrating a motion vector signaling method according to an embodiment of the present invention. [Figure 11] 1 is a diagram illustrating a method for signaling adaptive motion vector resolution information according to one embodiment of the present invention. [Figure 12] FIG. 1 illustrates a history-based motion vector prediction (HMVP) method according to an embodiment of the present invention. [Figure 13] 10 is a diagram illustrating a method for updating an HMVP table according to an embodiment of the present invention. [Figure 14] 10A and 10B are diagrams illustrating a method for updating an HMVP table according to an embodiment of the present invention. [Figure 15] 10A and 10B are diagrams illustrating a method for updating an HMVP table according to an embodiment of the present invention. [Figure 16] 10A and 10B are diagrams illustrating a method for updating an HMVP table according to an embodiment of the present invention. [Figure 17] 10A and 10B are diagrams illustrating a method for updating an HMVP table according to an embodiment of the present invention. [Figure 18] FIG. 2 illustrates a pruning process according to one embodiment of the present invention. [Figure 19] 10 is a diagram illustrating a method for adding an HMVP candidate according to one embodiment of the present invention. [Figure 20] FIG. 2 illustrates a merge sharing node according to one embodiment of the present invention. [Figure 21]10 is a diagram illustrating an HMVP update method when a shared list is used according to an embodiment of the present invention. [Figure 22] 10 is a diagram illustrating a method for updating an HMVP table based on motion information of blocks in a merge shared node according to one embodiment of the present invention. [Figure 23] 10 is a diagram illustrating an HMVP update method when a shared list is used according to an embodiment of the present invention. [Figure 24] 10 is a diagram illustrating a method for updating an HMVP table based on motion information of blocks in a merge shared node according to one embodiment of the present invention. [Figure 25] 1 is a diagram illustrating a method for processing a video signal based on HMVP according to an embodiment of the present invention; [Figure 26] 1 is a diagram illustrating a multi-hypothesis prediction method according to an embodiment of the present invention; [Figure 27] 10 is a diagram illustrating a method for determining a multiple hypothesis prediction mode according to an embodiment of the present invention. [Figure 28] 10 is a diagram illustrating a method for determining a multiple hypothesis prediction mode according to an embodiment of the present invention. [Figure 29] FIG. 10 is a diagram illustrating neighboring positions referenced in multiple hypothesis prediction according to an embodiment of the present invention. [Figure 30] 10 is a diagram illustrating a method for referencing a surrounding mode according to an embodiment of the present invention. [Figure 31] FIG. 10 illustrates a method for generating a candidate list according to an embodiment of the present invention. [Figure 32] FIG. 10 illustrates a method for generating a candidate list according to an embodiment of the present invention. [Figure 33] FIG. 10 is a diagram illustrating neighboring positions referenced in multiple hypothesis prediction according to an embodiment of the present invention. [Figure 34] 10 is a diagram illustrating a method for referencing a surrounding mode according to an embodiment of the present invention. [Figure 35]FIG. 10 is a diagram illustrating a method of using neighboring reference samples according to an embodiment of the present invention. [Figure 36] FIG. 10 illustrates a conversion mode according to an embodiment of the present invention. [Figure 37] FIG. 10 is a diagram illustrating the relationship between color difference components according to an embodiment of the present invention. [Figure 38] FIG. 2 is a diagram illustrating the relationship between color components according to one embodiment of the present invention. [Figure 39] FIG. 10 is a diagram illustrating peripheral reference positions according to an embodiment of the present invention. [Figure 40] FIG. 1 illustrates a weighted sample prediction process according to one embodiment of the present invention. [Figure 41] FIG. 10 is a diagram illustrating peripheral reference positions according to an embodiment of the present invention. [Figure 42] FIG. 1 illustrates a weighted sample prediction process according to one embodiment of the present invention. [Figure 43] FIG. 1 illustrates a weighted sample prediction process according to one embodiment of the present invention. [Figure 44] FIG. 1 illustrates a weighted sample prediction process according to one embodiment of the present invention. [Figure 45] 1 is a diagram illustrating a video signal processing method based on multiple hypothesis prediction according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0021] The terms used in this specification are generally used as widely as possible while taking into consideration the functions of the present invention, but these may vary depending on the intentions of engineers in the field, customs, or the emergence of new technologies. In addition, in certain cases, the applicant may have arbitrarily selected terms, and in such cases, the meanings of these terms will be described in the relevant mode for carrying out the invention. Therefore, it is made clear that the terms used in this specification should be interpreted not simply as terms, but based on the substantive meanings of the terms and the overall content of this specification.

[0022] In this specification, some terms may be interpreted as follows. "Coding" may be interpreted as "encoding" or "decoding" in some cases. In this specification, a device that encodes a video signal to generate a video signal bitstream is referred to as an encoding device or encoder, and a device that decodes a video signal bitstream to restore a video signal is referred to as a decoding device or decoder. In this specification, "video signal processing device" is used as a conceptual term that encompasses both an encoder and a decoder. "Information" is a term that encompasses values, parameters, coefficients, elements, etc., and may be interpreted differently in some cases, so the present invention is not limited thereto. "Unit" is used to represent a basic unit of image processing or a specific location in a picture, and refers to an image region including at least one of a luma component and a chroma component. "Block" refers to an image region including a specific component of a luminance component and a chrominance component (i.e., Cb and Cr). However, depending on the embodiment, the terms "unit," "block," "partition," and "region" may be used interchangeably. In this specification, the term "unit" is used as a concept including a coding unit, a prediction unit, and a transform unit, and the term "picture" refers to a field or a frame, and these terms may be used interchangeably depending on the embodiment.

[0023] 1 is a schematic block diagram of a video signal encoding apparatus 100 according to an embodiment of the present invention. Referring to FIG. 1, the encoding apparatus 100 of the present specification includes a transform unit 110, a quantization unit 115, an inverse quantization unit 120, an inverse transform unit 125, a filtering unit 130, a prediction unit 150, and an entropy coding unit 160.

[0024] The transform unit 110 transforms a residual signal, which is the difference between the input video signal and the prediction signal generated by the prediction unit 150, to obtain a transform coefficient value. For example, a discrete cosine transform (DCT), a discrete sine transform (DST), or a wavelet transform may be used. The discrete cosine transform and the discrete sine transform divide the input picture signal into blocks and then transform the block. During the transform, coding efficiency may vary depending on the distribution and characteristics of values ​​within the transform domain. The quantization unit 115 quantizes the transform coefficient values ​​output from the transform unit 110.

[0025] To improve coding efficiency, instead of directly coding the picture signal, the prediction unit 150 predicts a picture using a pre-coded region and adds the residual value between the original picture and the predicted picture to obtain a reconstructed picture. To avoid mismatch between the encoder and decoder, the encoder should use information available to the decoder when making predictions. To achieve this, the encoder performs a process of further reconstructing the coded current block. The inverse quantization unit 120 inversely quantizes the transform coefficient values, and the inverse transform unit 125 reconstructs the residual values ​​using the inversely quantized transform coefficient values. Meanwhile, the filtering unit 130 performs filtering operations to improve the quality of the reconstructed picture and the coding efficiency. For example, the filtering unit 130 may include a deblocking filter, a sample adaptive offset (SAO), an adaptive loop filter, etc. The filtered picture is stored in the decoded picture buffer (DPB) 156 for output or use as a reference picture.

[0026] To improve coding efficiency, instead of directly coding a picture signal, the prediction unit 150 predicts a picture using an already coded region and adds a residual value between the original picture and the predicted picture to the predicted picture to obtain a reconstructed picture. The intra prediction unit 152 performs intra prediction within the current picture, and the inter prediction unit 154 predicts the current picture using a reference picture stored in the decoded picture buffer 156. The intra prediction unit 152 performs intra prediction from a reconstructed region within the current picture and transmits the intra coding information to the entropy coding unit 160. The inter prediction unit 154 may further include a motion estimation unit 154a and a motion compensation unit 154b. The motion estimation unit 154a obtains a motion vector value for the current region by referring to a specific reconstructed region. The motion estimation unit 154a transmits position information of the reference region (e.g., reference frame, motion vector) to the entropy coding unit 160 so that it can be included in the bitstream. Using the motion vector values ​​transmitted from the motion estimation unit 154a, the motion compensation unit 154b performs inter-frame motion compensation.

[0027] The prediction unit 150 includes an intra prediction unit 152 and an inter prediction unit 154. The intra prediction unit 152 performs intra prediction within the current picture, and the inter prediction unit 154 performs inter prediction to predict the current picture using a reference buffer stored in the decoded picture buffer 156. The intra prediction unit 152 performs intra prediction from reconstructed samples within the current picture and transmits intra coding information to the entropy coding unit 160. The intra coding information includes at least one of an intra prediction mode, an MPM (Most Probable Mode) flag, and an MPM index. The intra coding information may include information about reference samples. The inter prediction unit 154 includes a motion estimation unit 154a and a motion compensation unit 154b. The motion estimation unit 154a obtains a motion vector value for the current region by referring to a specific region of the reconstructed reference signal picture. The motion estimation unit 154a transmits a motion information set (reference picture index, motion vector information) for the reference region to the entropy coding unit 160. The motion compensation unit 154b performs motion compensation using the motion vector values ​​transmitted from the motion compensation unit 154a. The inter prediction unit 154 transmits inter coding information including the motion information for the reference region to the entropy coding unit 160.

[0028] According to a further embodiment, the prediction unit 150 includes an intra block copy (BC) prediction unit (not shown). The intra BC prediction unit performs intra BC prediction from reconstructed samples in the current picture and transmits intra BC coding information to the entropy coding unit 160. The intra BC prediction unit obtains block vector values ​​indicating a reference region to be used for predicting the current region by referring to a specific region in the current picture. The intra BC prediction unit performs intra BC prediction using the obtained block vector values. The intra BC prediction unit transmits the intra BC coding information to the entropy coding unit 160. The intra BC prediction unit includes the block vector information.

[0029] After the picture prediction is performed, the transform unit 110 converts residual values ​​between the original picture and the predicted picture to obtain transform coefficient values. The transform is performed in units of specific blocks within the picture, and the size of the specific blocks varies within a predetermined range. The quantization unit 115 quantizes the transform coefficient values ​​generated by the transform unit 110 and transmits the quantized values ​​to the entropy coding unit 160.

[0030] The entropy coding unit 160 generates a video signal bitstream by entropy coding information indicating quantized transform coefficients, intra-coding information, and inter-coding information. The entropy coding unit 160 uses a variable length coding (VLC) scheme and an arithmetic coding scheme. The variable length coding (VLC) scheme converts input symbols into consecutive codewords, but the length of the codewords is variable. For example, frequently occurring symbols are represented by short codewords, and infrequently occurring symbols are represented by long codewords. The variable length coding scheme used is a context-based adaptive variable length coding (CAVLC). Arithmetic coding converts consecutive data symbols into a single prime number, and arithmetic coding obtains the optimal prime number bits required to represent each symbol. The arithmetic coding scheme used is a context-based adaptive binary arithmetic coding (CABAC). For example, the entropy coding unit 160 may binarize information indicating quantized transform coefficients, and may arithmetically code the binarized information to generate a bitstream.

[0031] The generated bitstream is encapsulated in Network Abstraction Layer (NAL) units as basic units. An NAL unit includes an integer number of coded coding tree units. In order for a video decoder to decode the bitstream, the bitstream must first be separated into NAL units and then each separated NAL unit must be decoded. Meanwhile, information required for decoding the video signal bitstream is transmitted via Raw Byte Sequence Payload (RBSP) of higher level sets such as a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), and a Video Parameter Set (VPS).

[0032] 1 illustrates an encoding device 100 according to one embodiment of the present invention, with separate blocks illustrating logically distinct elements of encoding device 100. Therefore, the elements of encoding device 100 described above may be implemented on a single chip or multiple chips depending on the device design. According to one embodiment, the operation of each element of encoding device 100 described above is performed by a processor (not shown).

[0033] 2 is a schematic block diagram of a video signal decoding apparatus 200 according to an embodiment of the present invention. Referring to FIG. 2, the decoding apparatus 200 of the present invention includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 225, a filtering unit 230, and a prediction unit 250.

[0034] The entropy decoding unit 210 entropy decodes the video signal bitstream to extract transform coefficient information, intra-coding information, inter-coding information, etc. for each region. For example, the entropy decoding unit 210 may obtain a binary code for transform coefficient information of a specific region from the video signal bitstream. The entropy decoding unit 210 also de-binarizes the binary code to obtain quantized transform coefficients. The inverse quantization unit 220 de-quantizes the quantized transform coefficients, and the inverse transform unit 225 restores residual values ​​using the de-quantized transform coefficients. The video signal processing device 200 restores original pixel values ​​by combining the residual values ​​obtained from the inverse transform unit 225 with predicted values ​​obtained from the prediction unit 250.

[0035] Meanwhile, the filtering unit 230 performs filtering on the picture to improve image quality. This includes a deblocking filter to reduce block distortion and / or an adaptive loop filter to remove distortion from the entire picture. The filtered picture is output or stored in the decoded picture buffer (DPB) 256 to be used as a reference picture for the next picture.

[0036] The prediction unit 250 includes an intra prediction unit 252 and an inter prediction unit 254. The prediction unit 250 generates a predicted picture using the coding type, transform coefficients for each region, intra / inter coding information, etc. decoded by the entropy decoding unit 210. To reconstruct the current block to be decoded, the current picture including the current block or a decoded region of another picture can be used. A picture (or tile / slice) that uses only the current picture for reconstruction, i.e., performs intra prediction or intra BC prediction, is called an intra picture or I picture (or tile / slice), and a picture (or tile / slice) that can perform all of intra prediction, inter prediction, and intra BC prediction is called an inter picture (or tile / slice). Among interpictures (or tiles / slices), a picture (or tile / slice) that uses at most one motion vector and reference picture index to predict sample values ​​for each block is called a predictive picture or P picture (or tile / slice), and a picture (or tile / slice) that uses at most two motion vectors and reference picture indexes is called a bi-predictive picture or B picture (or tile / slice). In other words, a P picture (or tile / slice) uses at most one motion information set to predict each block, and a B picture (or tile / slice) uses at most two motion information sets to predict each block. Here, a motion information set includes one or more motion vectors and one reference picture index.

[0037] The intra prediction unit 252 generates a prediction block using intra coding information and reconstructed samples in the current picture. As described above, the intra coding information includes at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, and an MPM index. The intra prediction unit 252 predicts sample values ​​of the current block using reconstructed samples located to the left and / or above the current block as reference samples. In the present disclosure, the reconstructed samples, reference samples, and samples of the current block refer to pixels. Furthermore, sample values ​​refer to pixel values.

[0038] In one embodiment, the reference samples are samples included in neighboring blocks of the current block. For example, the reference samples are samples adjacent to the left boundary and / or the top boundary of the current block. Furthermore, the reference samples are samples located on a line within a predetermined distance from the left boundary of the current block and / or samples located on a line within a predetermined distance from the top boundary of the current block, among samples in neighboring blocks of the current block. In this case, the neighboring blocks of the current block include at least one of the left (L) block, the top (A) block, the below left (BL) block, the above right (AR) block, and the above left (AL) block adjacent to the current block.

[0039] The inter prediction unit 254 generates a prediction block using reference pictures and inter coding information stored in the decoded picture buffer 256. The inter coding information includes a motion information set (e.g., reference picture index, motion vector, etc.) of the current block relative to the reference block. Inter prediction includes L0 prediction, L1 prediction, and bi-prediction. L0 prediction is prediction using one reference picture included in the L0 picture list, and L1 prediction is prediction using one reference picture included in the L1 picture list. This requires one set of motion information (e.g., motion vector and reference picture index). The bi-prediction method uses up to two reference regions, and these two reference regions may exist in the same reference picture or in different pictures. That is, the bi-prediction method uses up to two sets of motion information (e.g., motion vector and reference picture index), and two motion vectors may correspond to the same reference picture index or different reference picture indexes. In this case, the reference picture may be displayed (or output) either temporally before or after the current picture. According to one embodiment, in a bi-predictive scheme, the two reference regions used may be regions selected from the L0 picture list and the L1 picture list, respectively.

[0040] The inter prediction unit 254 obtains a current reference block using a motion vector and a reference picture index. The reference block exists in a reference picture corresponding to the reference picture index. Furthermore, sample values ​​of a block identified by the motion vector or their interpolated values ​​are used as a predictor for the current block. For motion prediction with sub-pel pixel accuracy, for example, an 8-tab interpolation filter is used for the luma signal and a 4-tab interpolation filter is used for the chroma signal. However, the interpolation filters for sub-pel motion prediction are not limited thereto. In this way, the inter prediction unit 254 performs motion compensation, which predicts the texture of the current unit from a previously reconstructed picture. In this case, the inter prediction unit uses a motion information set.

[0041] According to a further embodiment, the predictor 250 may include an intra BC predictor (not shown). The intra BC predictor may reconstruct the current region by referring to a specific region including reconstructed samples in the current picture. The intra BC predictor obtains intra BC coding information for the current region from the entropy decoding unit 210. The intra BC predictor obtains block vector values ​​of the current region indicating the specific region in the current picture. The intra BC predictor may perform intra BC prediction using the obtained block vector values. The intra BC coding information may include block vector information.

[0042] A reconstructed video picture is generated by adding together the predicted value output from the intra prediction unit 252 or the inter prediction unit 254 and the residual value output from the inverse transform unit 225. That is, the video signal decoding apparatus 200 reconstructs a current block using the predicted block generated by the prediction unit 250 and the residual value obtained from the inverse transform unit 225.

[0043] 2 illustrates a decoding device 200 according to one embodiment of the present invention, with separate blocks logically separating elements of the decoding device 200. Thus, the elements of the decoding device 200 described above may be implemented on a single chip or multiple chips depending on the device design. According to one embodiment, the operation of each element of the decoding device 200 described above is performed by a processor (not shown).

[0044] FIG. 3 illustrates an example in which a coding tree unit (CTU) is divided into coding units (CUs) within a picture. During video signal coding, a picture is divided into a sequence of coding tree units (CTUs). A coding tree unit consists of an NXN block of luma samples and two blocks of corresponding chroma samples. A coding tree unit is divided into multiple coding units. A coding tree unit may be a leaf node without being divided. In this case, the coding tree unit itself may be a coding unit. A coding unit refers to a basic unit for processing a picture during the above-mentioned video signal processing, i.e., intra / inter prediction, transform, quantization, and / or entropy coding. Within a picture, the size and shape of coding units are not constant. Coding units have a square or rectangular shape. A rectangular coding unit (or rectangular block) includes a vertical coding unit (or vertical block) and a horizontal coding unit (or horizontal block). In this specification, a vertical block is a block whose height is greater than its width, and a horizontal block is a block whose width is greater than its height. In addition, in this specification, non-square blocks refer to rectangular blocks, but the present invention is not limited to this.

[0045] Referring to Figure 3, a coding tree unit is first divided into a quad tree (QT) structure. That is, in the quad tree structure, one node having a size of 2N x 2N is divided into four nodes having a size of N x N. In this specification, a quad tree is also referred to as a quaternary tree. The quad tree division is performed recursively, and all nodes do not need to be divided to the same depth.

[0046] Meanwhile, the leaf node of the above-mentioned quad tree is further divided into a multi-type tree (MTT) structure. According to an embodiment of the present invention, in the multi-type tree structure, one node is divided into a horizontally or vertically divided binary or ternary tree structure. That is, there are four division structures in the multi-type tree structure: vertical binary division, horizontal binary division, vertical ternary division, and horizontal ternary division. According to an embodiment of the present invention, in each of the tree structures, the width and height of the node are both powers of 2. For example, in a binary tree (BT) structure, a node of size 2N×2N is divided into two N×2N nodes by vertical binary division and into two 2N×N nodes by horizontal binary division. In addition, in a ternary tree (TT) structure, a node of size 2Nx2N is divided into (N / 2)x2N, Nx2N, and (N / 2)x2N nodes by vertical ternary division, and into 2Nx(N / 2), 2NxN, and 2Nx(N / 2) nodes by horizontal ternary division. Such multi-type tree division is performed recursively.

[0047] The leaf nodes of a multi-type tree can be coding units. If no division for a coding unit is specified or the coding unit is not larger than the maximum transform length, the coding unit is used as the unit of prediction and transformation without further division. Meanwhile, in the above-mentioned quad trees and multi-type trees, at least one of the following parameters is predefined or transmitted via the RBSP of a higher-level set such as a PPS, SPS, or VPS: 1) CTU size: the size of the root node of the quad tree; 2) minimum QT size (MinQtSize): the size of the minimum QT leaf node allowed; 3) maximum BT size (MaxBtSize): the size of the maximum BT root node allowed; 4) maximum TT size (MaxTtSize): the size of the maximum TT root node allowed; 5) maximum MTT depth (MaxMttDepth): the maximum allowed depth of MTT division from the QT leaf node; 6) minimum BT size (MinBtSize): the size of the minimum BT leaf node allowed; 7) minimum TT size: the size of the minimum TT leaf node allowed.

[0048] 4 illustrates an embodiment of a method for signaling the splitting of a quadtree and a multi-type tree. Pre-set flags can be used to signal the splitting of the quadtree and multi-type tree. Referring to FIG. 4, at least one of a flag 'qt_split_flag' indicating whether to split a quadtree node, a flag 'mtt_split_flag' indicating whether to split a multi-type tree node, a flag 'mtt_split_vertical_flag' indicating the split direction of a multi-type tree node, and a flag 'mtt_split_binary_flag' indicating the split type of a multi-type tree node can be used.

[0049] According to an embodiment of the present invention, a coding tree unit is the root node of a quad tree and can be split into a quad tree structure first. In the quad tree structure, a 'qt_split_flag' is signaled for each node 'QT_node'. If the value of 'qt_split_flag' is 1, the corresponding node is split into four regular rectangular nodes, and if the value of 'qt_split_flag' is 0, the corresponding node becomes a leaf node 'QT_leaf_node' of the quad tree.

[0050] Each quadtree leaf node 'QT_leaf_node' can be further split into a multi-type tree structure. In a multi-type tree structure, 'mtt_split_flag' is signaled for each node 'MTT_node'. If 'mtt_split_flag' is set to 1, the node is split into multiple rectangular nodes, and if 'mtt_split_flag' is set to 0, the node becomes a leaf node 'MTT_leaf_node' of the multi-type tree. If a multi-type tree node 'MTT_node' is split into multiple rectangular nodes (i.e., if 'mtt_split_flag' is set to 1), 'mtt_split_vertical_flag' and 'mtt_split_binary_flag' can be additionally signaled for the node 'MTT_node'. If the value of 'mtt_split_vertical_flag' is 1, vertical split of node 'MTT_node' is indicated, and if the value of 'mtt_split_vertical_flag' is 0, horizontal split of node 'MTT_node' is indicated. Also, if the value of 'mtt_split_binary_flag' is 1, node 'MTT_node' is split into two rectangular nodes, and if the value of 'mtt_split_binary_flag' is 0, node 'MTT_node' is split into three rectangular nodes.

[0051] Picture prediction (motion compensation) for coding is performed on coding units that cannot be further divided (i.e., leaf nodes of the coding unit tree). Such a basic unit for prediction is hereinafter referred to as a prediction unit or a prediction block.

[0052] Hereinafter, the term "unit" used in this specification is used as an alternative term to the prediction unit, which is a basic unit for performing prediction, but the present invention is not limited thereto and can be understood as a concept including the coding unit in a broader sense.

[0053] 5 and 6 are diagrams illustrating in more detail an intra prediction method according to an embodiment of the present invention. As described above, the intra prediction unit predicts sample values ​​of the current block using reconstructed samples located to the left and / or above the current block as reference samples.

[0054] First, Figure 5 shows an example of reference samples used to predict a current block in intra prediction mode. According to one example, the reference samples are samples adjacent to the left boundary and / or the top boundary of the current block. As shown in Figure 5, if the size of the current block is W x H and samples of a single reference line adjacent to the current block are used for intra prediction, the reference samples are set using up to 2W + 2H + 1 neighboring samples located to the left and / or above the current block.

[0055] Furthermore, if at least some samples used as reference samples have not yet been restored, the intra prediction unit performs a reference sample padding process to obtain reference samples. The intra prediction unit also performs a reference sample filtering process to reduce intra prediction errors. That is, the intra prediction unit performs filtering on neighboring samples and / or the reference samples obtained by the reference sample padding process to obtain filtered reference samples. The intra prediction unit predicts samples of the current block using the reference samples obtained in this manner. The intra prediction unit predicts samples of the current block using unfiltered reference samples or filtered reference samples. In the present disclosure, neighboring samples may include samples on at least one reference line. For example, neighboring samples may include neighboring samples on a line adjacent to a boundary of the current block.

[0056] Next, Figure 6 illustrates an embodiment of prediction modes used for intra prediction. For intra prediction, intra prediction mode information indicating the intra prediction direction can be signaled. The intra prediction mode information indicates one of a plurality of intra prediction modes constituting an intra prediction mode set. If the current block is an intra predicted block, the decoder receives the intra prediction mode information of the current block from the bitstream. An intra prediction unit of the decoder performs intra prediction on the current block based on the extracted intra prediction mode information.

[0057] According to an embodiment of the present invention, the intra prediction mode set includes all intra prediction modes used in intra prediction (e.g., a total of 67 intra prediction modes). More specifically, the intra prediction mode set includes a planar mode, a DC mode, and a plurality of (e.g., 65) angle modes (i.e., directional modes). Each intra prediction mode is indicated by a predetermined index (i.e., intra prediction mode index). For example, as shown in FIG. 6, intra prediction mode index 0 indicates a planar mode, and intra prediction mode index 1 indicates a DC mode. In addition, intra prediction mode indexes 2 to 66 indicate different angle modes. Each angle mode indicates a different angle within a predetermined angle range. For example, the angle mode may indicate an angle within an angle range of 45° to −135° clockwise (i.e., a first angle range). The angle modes may be defined based on the 12 o'clock direction. In this case, intra prediction mode index 2 indicates horizontal diagonal (HDIA) mode, intra prediction mode index 18 indicates horizontal (HOR) mode, intra prediction mode index 34 indicates diagonal (DIA) mode, intra prediction mode index 50 indicates vertical (VER) mode, and intra prediction mode index 66 indicates vertical diagonal (VDIA) mode.

[0058] Hereinafter, an inter prediction method according to an embodiment of the present invention will be described with reference to Figure 7. In the present invention, the inter prediction method may include a general inter prediction method optimized for translation motion and an affine model-based inter prediction method. In addition, the motion vector may generally include at least one of a general motion vector for motion compensation based on the inter prediction method and a control point motion vector for affine motion compensation.

[0059] FIG. 7 illustrates an inter-prediction method according to an embodiment of the present invention. As described above, a decoder can predict a current block by referring to reconstructed samples of other decoded pictures. Referring to FIG. 7, the decoder obtains a reference block 702 in a reference picture 720 based on the motion information set of a current block 701. In this case, the motion information set may include a reference picture index and a motion vector 703. The reference picture index indicates a reference picture 720 in a reference picture list that includes a reference block for inter-prediction of the current block. According to an embodiment, the reference picture list may include at least one of the L0 picture list or the L1 picture list. The motion vector 703 indicates an offset between the coordinate values ​​of the current block 701 in the current picture 710 and the coordinate values ​​of the reference block 702 in the reference picture 720. The decoder obtains a predictor for the current block 701 based on the sample values ​​of the reference block 702 and reconstructs the current block 701 using the predictor.

[0060] Specifically, the encoder can obtain the reference block by searching for a block similar to the current block in an earlier picture in the reconstruction order. For example, the encoder can search for a reference block that minimizes the sum of differences between the current block and sample values ​​within a preset search area. At this time, at least one of SAD (Sum of Absolute Difference) or SATD (Sum of Hadamard Transformed Difference) can be used to measure the similarity between the current block and the reference block samples. Here, SAD may be the sum of all absolute values ​​of differences between sample values ​​included in two blocks. SATD may be the sum of all absolute values ​​of Hadamard transform coefficients obtained by Hadamard transforming the differences between sample values ​​included in two blocks.

[0061] Meanwhile, the current block may be predicted using one or more reference regions. As described above, the current block may be inter-predicted using a bi-prediction scheme using two or more reference regions. According to one embodiment, a decoder may obtain two reference blocks based on two motion information sets of the current block. The decoder may also obtain a first predictor and a second predictor for the current block based on sample values ​​of each of the obtained two reference blocks. The decoder may also reconstruct the current block using the first predictor and the second predictor. For example, the decoder may reconstruct the current block based on a sample-by-sample average of the first predictor and the second predictor.

[0062] As described above, one or more motion information sets can be signaled for motion compensation of the current block. In this case, similarity between the motion information sets for motion compensation of each of the multiple blocks can be utilized. For example, the motion information set used for predicting the current block can be derived from the motion information set used for predicting any one of the other previously reconstructed samples. This allows the encoder and decoder to reduce signaling overhead. Various embodiments in which the motion information set of the current block is signaled will be described below.

[0063] For example, there may be multiple candidate blocks that could be predicted based on a motion information set that is the same as or similar to the motion information set of the current block. The decoder may generate a merge candidate list based on the multiple candidate blocks. Here, the merge candidate list may include candidates corresponding to samples that could be predicted based on a motion information set related to the motion information set of the current block, among samples reconstructed before the current block. The encoder and decoder may construct merge candidate lists for the current block based on a predefined rule. In this case, the merge candidate lists constructed by the encoder and decoder may be identical to each other. For example, the encoder and decoder may construct merge candidate lists for the current block based on the position of the current block within the current picture. The method by which the encoder and decoder construct merge candidate lists for the current block will be described below with reference to FIG. 9. In this disclosure, the position of a specific block refers to the relative position of the top-left sample of the specific block within a picture including the specific block.

[0064] Meanwhile, in order to improve coding efficiency, a method may be used in which, instead of coding the residual signal as is, the transform unit transforms the residual signal to obtain transform coefficient values, quantizes the obtained transform coefficients, and codes the quantized transform coefficients. As described above, the transform unit may transform the residual signal to obtain transform coefficient values. In this case, the residual signal of a specific block may be distributed throughout the entire region of the current block. Thus, energy may be concentrated in the low-frequency region using a frequency domain transform on the residual signal, thereby improving coding efficiency. Hereinafter, a method for transforming or inversely transforming the residual signal will be described in detail.

[0065] FIG. 8 is a diagram specifically illustrating a method in which an encoder transforms a residual signal. As described above, a spatial-domain residual signal may be transformed into a frequency domain. The encoder may transform the obtained residual signal to obtain transform coefficients. First, the encoder may obtain at least one residual block including a residual signal for a current block. The residual block may be either the current block or a block divided from the current block. In this disclosure, the residual block may be referred to as a residual array or a residual matrix including residual samples of the current block. In this disclosure, the residual block refers to a block having the same size as a transform unit or a transform block.

[0066] Next, the encoder may transform the residual block using a transform kernel. The transform kernel used to transform the residual block may be a transform kernel having separable vertical and horizontal transform characteristics. In this case, the transform of the residual block may be performed separately as a vertical transform and a horizontal transform. For example, the encoder may perform a vertical transform by applying a transform kernel to the vertical direction of the residual block. Also, the encoder may perform a horizontal transform by applying a transform kernel to the horizontal direction of the residual block. In this disclosure, the transform kernel may be a term that refers to a set of parameters used to transform the residual signal, such as a transform matrix, a transform array, a transform function, or a transform. According to an embodiment, the transform kernel may be any one of a plurality of available kernels. Furthermore, transform kernels based on different transform types may be used for the vertical transform and the horizontal transform. A method for selecting any one of a plurality of available transform kernels will be described below with reference to FIGS. 12 to 26.

[0067] The encoder may transmit a transform block transformed from the residual block to a quantizer for quantization. At this time, the transform block may include a plurality of transform coefficients. Specifically, the transform block may be composed of a plurality of transform coefficients arranged in a two-dimensional array. The size of the transform block may be the same as that of the current block or one of the blocks divided from the current block, similar to the size of the residual block. The transform coefficients transmitted to the quantizer may be represented by quantized values.

[0068] The encoder may also perform an additional transform before quantizing the transform coefficients. As shown in FIG. 8, the above-described transform method may be referred to as a primary transform, and the additional transform may be referred to as a secondary transform. The secondary transform may be selectively performed for each residual block. According to an embodiment, the encoder may improve coding efficiency by performing a secondary transform on a region where it is difficult to concentrate energy in the low-frequency region using only the primary transform. For example, a secondary transform may be added to a block whose residual values ​​appear significantly in a direction other than the horizontal or vertical direction of the residual block. The residual values ​​of an intra-predicted block may be more likely to change in a direction other than the horizontal or vertical direction than the residual values ​​of an inter-predicted block. Accordingly, the encoder may further perform a secondary transform on the residual signal of the intra-predicted block. Alternatively, the encoder may omit the secondary transform on the residual signal of the inter-predicted block.

[0069] As another example, whether to perform a secondary transform may be determined depending on the size of the current block or the residual block. Also, different sizes of transform kernels may be used depending on the size of the current block or the residual block. For example, an 8x8 secondary transform may be applied to a block whose shorter side, either width or height, is shorter than a first preset length. Also, a 4x4 secondary transform may be applied to a block whose shorter side, either width or height, is longer than a second preset length. In this case, the first preset length may be greater than the second preset length, but the present disclosure is not limited thereto. Also, unlike the primary transform, the secondary transform does not need to be separated into a vertical transform and a horizontal transform. Such a secondary transform may be called a low frequency non-separable transform (LFNST).

[0070] Furthermore, in the case of a video signal of a specific region, high-frequency band energy may not be reduced even after frequency transformation due to a sudden change in brightness. This may result in a decrease in compression performance due to quantization. Furthermore, when a transformation is performed on a region where residual values ​​rarely exist, encoding and decoding times may unnecessarily increase. For this reason, the transformation of the residual signal of the specific region may be omitted. Whether or not to transform the residual signal of the specific region may be determined by a syntax element related to the transformation of the specific region. For example, the syntax element may include transform skip information. The transform skip information may be a transform skip flag. If the transform skip information for a residual block indicates a transform skip, the transformation of the corresponding residual block is not performed. In this case, the encoder may immediately quantize the residual signal of the corresponding region that is not transformed. The operation of the encoder described with reference to FIG. 8 can be performed by the transform unit of FIG. 1.

[0071] The aforementioned transform-related syntax elements may be information parsed from a video signal bitstream. A decoder may entropy decode the video signal bitstream to obtain the transform-related syntax elements. An encoder may entropy code the transform-related syntax elements to generate a video signal bitstream.

[0072] FIG. 9 is a diagram specifically illustrating a method in which an encoder and a decoder inversely transform transform coefficients to obtain a residual signal. Hereinafter, for convenience of explanation, it will be assumed that an inverse transform operation is performed in each inverse transform unit of the encoder and the decoder. The inverse transform unit may inversely transform dequantized transform coefficients to obtain a residual signal. First, the inverse transform unit may detect whether an inverse transform for a specific region is to be performed based on a transform-related syntax element for the specific region. According to an embodiment, if a transform-related syntax element for a specific transform block indicates a transform skip, the transform for the specific transform block may be skipped. In this case, the first inverse transform and the second inverse transform described above may both be skipped for the transform block. Furthermore, the dequantized transform coefficients may be used as a residual signal. For example, a decoder may reconstruct a current block using the dequantized transform coefficients as a residual signal.

[0073] In another embodiment, a transform-related syntax element for a specific transform block may not indicate a transform skip. In this case, the inverse transform unit may determine whether to perform a secondary inverse transform on the secondary transform. For example, if the transform block is a transform block of an intra-predicted block, a secondary inverse transform may be performed on the transform block. Furthermore, a secondary transform kernel to be used for the transform block may be determined based on an intra-prediction mode corresponding to the transform block. As another example, whether to perform a secondary inverse transform may be determined based on the size of the transform block. The secondary inverse transform may be performed after the inverse quantization process and before the primary inverse transform is performed.

[0074] The inverse transform unit may perform a primary inverse transform on the dequantized transform coefficients or the secondary inverse transformed transform coefficients. In the case of a primary inverse transform, a vertical transform and a horizontal transform may be separately performed, similar to the primary transform. For example, the inverse transform unit may perform a vertical inverse transform and a horizontal inverse transform on the transform block to obtain a residual block. The inverse transform unit may inverse transform the transform block based on a transform kernel used to transform the transform block. For example, the encoder may explicitly or implicitly signal information indicating a transform kernel applied to a current transform block from among multiple available transform kernels. The decoder may select a transform kernel to be used for the inverse transform of the transform block from among the multiple available transform kernels using the signaled information indicating the transform kernel. The inverse transform unit may reconstruct the current block using a residual signal obtained by inverse transforming the transform coefficients.

[0075] 10 is a diagram illustrating a motion vector signaling method according to an embodiment of the present invention. According to an embodiment of the present invention, a motion vector (MV) may be generated based on a motion vector prediction (or predictor) (MVP). As an example, the MV may be determined as the MVP according to the following Equation 1. In other words, the MV may be determined (or set or induced) to be the same value as the MVP.

[0076]

number

[0077] As another example, the MV may be determined based on the MVP and a motion vector difference (MVD), as shown in the following Mathematical Formula 2. The encoder can signal MVD information to the decoder to indicate a more accurate MV, and the decoder can derive the MV by adding the obtained MVD to the MVP.

[0078]

number

[0079] According to one embodiment of the present invention, the encoder transmits the determined motion information to the decoder, and the decoder generates (or induces) a motion vector (MVP) from the received motion information and generates a prediction block based on the motion vector (MVD). For example, the motion information may include MVP information and MVD information. In this case, components of the motion information may vary depending on the inter-prediction mode. For example, in a merge mode, the motion information may include MVP information but not MVD information. For another example, in an advanced motion vector prediction (AMVP) mode, the motion information may include MVP information and MVD information.

[0080] To determine, transmit, and receive information about MVPs, the encoder and decoder can generate MVP candidates (or MVP candidate lists) in the same way. For example, the encoder and decoder can generate the same MVP candidates in the same order. Then, the encoder transmits an index indicating (or pointing to) the determined (or selected) MVP from the generated MVP candidates to the decoder, and the decoder can derive the determined MVP and / or MV based on the received index.

[0081] According to an embodiment of the present invention, MVP candidates may include spatial candidates, temporal candidates, etc. The MVP candidates may be referred to as merge candidates when a merge mode is applied, and as AMVP candidates when an AMVP mode is applied. The spatial candidates may be MVs (or motion information) for blocks at specific positions relative to the current block. For example, the spatial candidates may be MVs for blocks at positions adjacent or non-adjacent to the current block. The temporal candidates may be MVs corresponding to blocks in the current picture and other pictures. In addition, for example, the MVP candidates may include affine MVs, ATMVPs, STMVPs, combinations of the above-mentioned MVs (or candidates), average MVs of the above-mentioned MVs (or candidates), and zero MVs.

[0082] In one embodiment, the encoder can signal information indicating the reference picture to the decoder. As an example, if the reference picture of the MVP candidate is different from the reference picture of the current block (or the currently processed block), the encoder / decoder can scale the MV of the MVP candidate (motion vector scaling). In this case, the MV scaling can be performed based on the picture order count (POC) of the current picture, the POC of the reference picture of the current block, and the POC of the reference picture of the MVP candidate.

[0083] A specific embodiment of the MVD signaling method will be described below. Table 1 below illustrates a syntax structure for MVD signaling.

[0084] [Table 1]

[0085] Referring to Table 1, according to one embodiment of the present invention, the MVD may be coded by separately encoding its sign and absolute value. That is, the sign and absolute value of the MVD may be different syntaxes (or syntax elements). The absolute value of the MVD may be coded directly or may be coded stepwise based on a flag indicating whether the absolute value is greater than N, as shown in Table 1. If the absolute value is greater than N, the value of (absolute value - N) may also be signaled. Specifically, in the example of Table 1, abs_mvd_greater0_flag may be transmitted to indicate whether the absolute value is greater than 0. If abs_mvd_greater0_flag indicates (or indicates) that the absolute value is not greater than 0, the absolute value of the MVD may be determined to be 0. Also, if abs_mvd_greater0_flag indicates that the absolute value is greater than 0, additional syntax (or syntax elements) may be present.

[0086] For example, abs_mvd_greater1_flag may be transmitted to indicate whether the absolute value is greater than 1. If abs_mvd_greater1_flag indicates (or indicates) that the absolute value is not greater than 1, the absolute value of the MVD may be determined to be 1. If abs_mvd_greater1_flag indicates that the absolute value is greater than 1, additional syntax may be present. For example, abs_mvd_minus2 may be present. abs_mvd_minus2 may be a value of (absolute value - 2). Because the abs_mvd_greater0_flag and abs_mvd_greater1_flag values ​​determine that the absolute value is greater than 1 (i.e., 2 or greater), a value of (absolute value - 2) may be signaled. In this way, by hierarchically signaling information about the absolute value using syntax, fewer bits can be used than when the absolute value is directly binarized and signaled.

[0087] In one embodiment, the absolute value-related syntax described above may be coded using a variable length binarization method such as Exponential-Golomb, truncated unary, truncated Rice, etc. Also, a flag indicating the sign of the MVD may be signaled by mvd_sign_flag.

[0088] Although the coding method for MVD has been described in the above embodiment, information other than MVD can also be signaled by separating the sign and absolute value. The absolute value may be coded as a flag indicating whether the absolute value is greater than a predefined specific value and a value obtained by subtracting the specific value from the absolute value. In Table 1, [0] and [1] may represent component indexes. For example, they may represent the x-component (i.e., horizontal component) and the y-component (i.e., vertical component).

[0089] FIG. 11 is a diagram illustrating a method for signaling adaptive motion vector resolution information according to an embodiment of the present invention. According to an embodiment of the present invention, the resolution for indicating MV or MVD may vary. For example, the resolution may be expressed based on pixels (or pels). For example, MV or MVD may be signaled in units of 1 / 4, 1 / 2, 1 (integer), 2, or 4 pixels. The encoder may then signal the MV or MVD resolution information to the decoder. For example, 16 may be coded as 64 in 1 / 4 units (1 / 4*64=16), 16 in 1 unit (1*16=16), and 4 in 4 units (4*.4=16). That is, the MV or MVD value may be determined by the following Equation 3:

[0090]

number

[0091] In Equation 3, valueDetermined represents an MV or MVD value. Also, valuePerResolution represents a value signaled based on the determined resolution. If the value signaled by MV or MVD is not divisible by the determined resolution, a rounding process may be applied. Using a high resolution can improve accuracy, but many bits may be used because the coded values ​​are large. Using a low resolution can reduce accuracy, but fewer bits may be used because the coded values ​​are small. In one embodiment, the resolution may be individually set for each unit, such as a sequence, a picture, a slice, a coding tree unit (CTU), or a coding unit (CU). That is, the encoder / decoder may adaptively determine / apply the resolution according to a predefined unit among the above units.

[0092] According to one embodiment of the present specification, the above-mentioned resolution information may be signaled from the encoder to the decoder. At this time, the resolution information may be binarized and signaled based on the above-mentioned variable length. In this case, if the resolution information is signaled based on the index corresponding to the smallest value (i.e., the earliest value), signaling overhead can be reduced. As one embodiment, the resolution information may be mapped to the signaling index in order from highest to lowest resolution.

[0093] According to one embodiment of the present specification, Figure 11 illustrates a signaling method assuming that three resolutions are used among a variety of resolutions. In this case, three signaling bits may be 0, 10, and 11, and the three signaling indexes may represent a first resolution, a second resolution, and a third resolution, respectively. Since one bit is required to signal the first resolution and two bits are required to signal the remaining resolutions, signaling overhead can be relatively reduced when signaling the first resolution. In the example of Figure 11, the first resolution, the second resolution, and the third resolution may be defined as 1 / 4, 1 / 4 pixel resolution, respectively. In the following embodiments, MV resolution may refer to the resolution of MVD.

[0094] 12 is a diagram illustrating a history-based motion vector prediction (HMVP) method according to an embodiment of the present invention. As described above, the encoder / decoder can use spatial candidates, temporal candidates, etc. as motion vector candidates, and in one embodiment of the present invention, the encoder / decoder can also use history-based motion vectors, i.e., HMVP, as motion vector candidates.

[0095] According to one embodiment of the present specification, an encoder / decoder may store motion information of a previously coded block in a table. In this specification, HMVP represents motion information of a previously coded block. That is, the encoder / decoder may store the HMVP in a table. In this specification, a table for storing the HMVP is referred to as a table or an HMVP table, but the present invention is not limited to such names. For example, the table (or the HMVP table) may be referred to as a buffer, an HMVP buffer, an HMVP candidate buffer, an HMVP list, an HMVP candidate list, etc.

[0096] The motion information stored in the HMVP table may include at least one of an MV, a reference list, a reference index, or a utilization flag. For example, the motion information may include at least one of an MV of a reference list L0, an MV of an L1, an L0 reference index, an L1 reference index, an L0 prediction list utilization flag, or an L1 prediction list utilization flag. In this case, the prediction list utilization flag may indicate whether the information is usable for the corresponding list, whether it is significant, etc.

[0097] According to an embodiment of the present specification, the motion information stored in the HMVP table may be generated / stored on a history-based basis. The history-based motion information represents the motion information of blocks coded before the current block in coding order. For example, an encoder / decoder may store the motion information of blocks coded before the current block in the HMVP table. In this case, the blocks may be coding units (CUs) or prediction units (PUs). The motion information of the blocks may refer to motion information used for motion compensation of the blocks or motion information candidates used for motion compensation. The motion information stored in the HMVP table (i.e., HMVP) may be used for motion compensation of blocks to be encoded / decoded later. For example, the motion information stored in the HMVP table may be used for motion candidate list construction.

[0098] Referring to FIG. 12, the encoder / decoder may retrieve one or more HMVP candidates from an HMVP table (S1201). Then, the encoder / decoder may add the HMVP candidates to a motion candidate list. For example, the motion candidate list may be a merge candidate list (or a merge list) or an AMVP candidate list (or an AMVP list). Then, the encoder / decoder may perform motion compensation and encoding / decoding for the current block based on the motion candidate list (S1202). The encoder / decoder may update the HMVP table using information used in motion compensation or decoding of the current block (S1203).

[0099] According to one embodiment of the present invention, HMVP candidates may be used in the merge candidate list construction process. The latest HMVP candidates in the HMVP table may be checked in order and inserted (or added) to the merge candidate list in order of temporal motion vector prediction (or predictor) (TMVP) candidates. Furthermore, when adding HMVP candidates, a pruning process (or pruning check) may be performed on spatial or temporal merge candidates included in the merge list except for sub-block motion candidates (i.e., ATMVPs). In one embodiment, to reduce the number of pruning operations, the following may be applied.

[0100] 1) For example, the number of HMPV candidates may be set as shown in the following mathematical formula 4.

[0101]

number

[0102] In Equation 4, L represents the number of HMVP candidates, N represents the number of available non-subblock merging candidates, and M represents the number of HMVP candidates available in the table. For example, N may represent the number of non-subblock merging candidates included in the merging candidate list. If N is less than or equal to 4, the number of HMVP candidates may be determined as M; otherwise, the number of HMVP candidates may be determined as (8-N).

[0103] 2) Also, for example, the process of constructing a merge candidate list from the HMVP list may terminate once the total number of available merge candidates reaches the signaled maximum number of allowed merge candidates minus one.

[0104] 3) Also, for example, the number of candidate pairs for deriving a combined bi-predictive merge candidate may be reduced from 12 to 6.

[0105] According to one embodiment of the present invention, HMVP candidates may also be used in the AMVP candidate list construction process. The motion vectors of the HMVP candidates with the last K indices in the table may be inserted following the TMVP candidates. In one embodiment, only HMVP candidates with the same reference picture as the AMVP target reference picture may be used to construct the AMVP candidate list. In this case, the pruning process described above may also be applied to the HMVP candidates. For example, the above-mentioned K may be set to 4, and the size (or length) of the AMVP list may be set to 2.

[0106] FIG. 13 is a diagram illustrating a method for updating an HMVP table according to an embodiment of the present invention. According to an embodiment of the present invention, the HMVP table may be maintained / managed in a first-in, first-out (FIFO) manner. That is, when a new input is received, the oldest element (or candidate) may be output first. For example, when adding motion information used in a current block to an HMVP table, if the maximum number of elements in the HMVP table is reached, the encoder / decoder may output the most recently added motion information from the HMVP table and add the motion information used in the current block to the HMVP table. In this case, if motion information already in an existing HMVP table is output, the encoder / decoder may move the motion information at the next position (or index) to fill the output position. For example, if the HMVP table index of the output motion information is m and the oldest element is located at HMVP table index 0, motion information corresponding to index n, which is greater than m, may be moved to index (n-1) in the HMVP table. This leaves the high index positions empty in the HMVP table, allowing the encoder / decoder to assign the highest index in the HMVP table to the motion information used for the current block. That is, when the maximum index containing a valid element is M, the motion information of the current block may be inserted at index (M+1).

[0107] Furthermore, according to one embodiment of the present invention, an encoder / decoder can apply a pruning process when updating an HMVP table based on specific motion information. That is, the encoder / decoder can check whether the specific motion information or information corresponding to the specific motion information is included in the HMVP table. Then, the encoder / decoder can separately define HMVP table update methods for when duplicate motion information is included and when it is not. This can prevent duplicate motion information from being included in the HMVP table and allow various candidates to be considered for motion compensation.

[0108] In one embodiment, when updating the HMVP table based on the motion information used for the current block, if the motion information is already included in the HMVP table, the encoder / decoder may delete the duplicate motion information already included in the HMVP table and add the new motion information to the HMVP table. In this case, the method described above for FIFO may be used before the method of deleting an existing candidate and adding a new one. That is, the index of the motion information currently to be added in the HMVP table may be determined as m, and the oldest motion information may be output. If the motion information is not already included in the HMVP table, the encoder / decoder may delete the most recently added motion information and add the new motion information to the HMVP table.

[0109] In another embodiment, when updating the HMVP table based on the motion information used for the current block, the encoder / decoder may leave the HMVP table unchanged if the motion information is already included in the HMVP table, or may update the HMVP table in a FIFO manner if the motion information is not already included.

[0110] According to an embodiment of the present invention, an encoder / decoder may initialize (or reset) an HMVP table at a predefined time or a predefined position. Because the encoder and decoder must use the same motion candidate list, they must use the same HMVP table. Continuous use of the HMVP table without initializing it can result in dependency between coding blocks. Therefore, to support parallel processing, it is necessary to reduce dependency between blocks, and an operation for initializing the HMVP table may be preset according to the unit supporting parallel processing. For example, the encoder / decoder may be configured to initialize the HMVP table at the slice level, CTU row level, CTU level, etc. For example, if initialization of the HMVP table is defined at the CTU row level, the encoder / decoder may perform encoding / decoding with the HMVP table empty when starting coding for each CTU row.

[0111] FIG. 14 is a diagram illustrating a method for updating an HMVP table according to an embodiment of the present invention. Referring to FIG. 14, in one embodiment of the present invention, an encoder / decoder can update HMVPCandList based on mvCand. In this specification, HMVPCandList represents an HMVP table, and mvCand represents motion information of a current block. The process illustrated in FIG. 14 may receive as input two motion vectors mvL0 and mvL1, two reference indexes refIdxL0 and refIdxL1, and a motion candidate mvCand having two prediction list usage flags predFlagL0 and predFlagL1. The process illustrated in FIG. 14 may then output a modified HMVPCandList array.

[0112] In the first step (Step 1), the encoder / decoder can check whether mvCand is the same as HMVPCandList[HMVPIdx] by changing the value of HMVPIdx, a variable indicating the index of an HMVP in the HMVP table, from 0 to (HMVPCandNum-1). Here, HMVPCandNum indicates the number of HMVPs included in the HMVP table. And HMVPCandList[HMVPIdx] indicates the candidate in the HMVP table having the HMVPIdx value. If mvCand is the same as HMVPCandList[HMVPIdx], the encoder / decoder can set a variable sameCand, indicating whether the candidates are the same, to true. In one embodiment, when checking whether mvCand is identical to HMVPCandList[HMVPIdx], the encoder / decoder can perform a comparison on motion information of MVs and reference indices associated with L0 or MVs and reference indices associated with L1, whose prediction list utilization flag is 1.

[0113] Then, in the second step (Step 2), the encoder / decoder may set a variable tempIdx indicating a temporary index to HMVPCandNum. In the third step (Step 3), if sameCand is true or HMVPCandNum is equal to the maximum HMVP table size (or length), the encoder / decoder may copy HMVPCandList[tempIdx] to HMVPCandList[tempIdx-1] while varying tempIdx from (sameCand?HMVPIdx:1) to (HMVPCandNum-1). That is, if sameCand is true, tempIdx starts from HMVPIdx, and the encoder / decoder may set HMVPIdx to the same element index as mvCand in the HMVP table plus 1. Also, if sameCand is false, tempIdx starts from 1, and HMVPCandList[0] may be written with the contents of HMVPCandList[1].

[0114] In the fourth step (Step 4), the encoder / decoder can copy the motion information mvCand to be updated to HMVPCandList[tempIdx]. In the fifth step (Step 5), if HMVPCandNum is smaller than the maximum HMVP table size, the encoder / decoder can increment HMVPCandNum by 1.

[0115] FIG. 15 is a diagram illustrating a method for updating an HMVP table according to an embodiment of the present invention. Referring to FIG. 15, in an embodiment of the present invention, an encoder / decoder may start comparing HMVPIdx values ​​greater than 0 in determining whether motion information of a current block is included in the HMVP table. For example, when determining whether motion information of a current block is included in the HMVP table, the encoder / decoder may compare only HMVPIdx values ​​excluding those corresponding to HMVPIdx0. In other words, the encoder / decoder may compare candidates corresponding to HMVPIdx1 with mvCand. The process illustrated in FIG. 15 may receive as input a motion candidate mvCand having two motion vectors mvL0 and mvL1, two reference indexes refIdxL0 and refIdxL1, and two prediction list usage flags predFlagL0 and predFlagL1. The process illustrated in FIG. 15 may then output a modified HMVPCandList array.

[0116] 14. Explaining the HMVP table update method described above in Figure 14, in the first step, it is possible to check whether HMVPIdx0 contains the same motion information as mvCand. However, in the above-described update method, if mvCand is present in HMVPCandList[0] or is not present in HMVPCandList[HMVPIdx] corresponding to HMVPIdx0 to HMVPCandNum, the motion information of HMVPCandList[0] is output. If mvCand is present in HMVPCandList[HMVPIdx] among HMVPIdxs other than 0, the contents of HMVPCandList[0] are not updated, so mvCand does not need to be compared with HMVPCandList[0]. Furthermore, since the motion information of the current block is similar to the motion information of spatially adjacent blocks, it is highly likely to be similar to the motion information recently added to the HMVP table. According to this assumption, mvCand may have motion information that is more similar to that of a candidate with HMVPIdx greater than 0 than that of a candidate corresponding to HMVPIdx 0, and if similar (or identical) motion information is found, the pruning process can be terminated. Therefore, by performing the first step of Figure 14 above from a value of HMVPIdx greater than 0, the number of comparisons can be reduced compared to the embodiment of Figure 14 above.

[0117] 16 is a diagram illustrating a method for updating an HMVP table according to an embodiment of the present invention. Referring to FIG. 16, in one embodiment of the present invention, an encoder / decoder can compare HMVPIdx with values ​​greater than 0 in the process of determining whether motion information of a current block, i.e., mvCand, is included in the HMVP table. The process illustrated in FIG. 16 may receive as input two motion vectors mvL0 and mvL1, two reference indexes refIdxL0 and refIdxL1, and a motion candidate mvCand having two prediction list usage flags predFlagL0 and predFlagL1. The process illustrated in FIG. 16 may then output a modified HMVPCandList array. For example, when determining whether mvCand is included in the HMVP table, the encoder / decoder may perform a comparison process (or pruning process) by excluding a predefined specific number of motion information (or candidates) whose HMVPIdx values ​​are greater than or equal to 0. Specifically, when the variable indicating the number of elements to be compared is represented by NumPrune, the encoder / decoder can check whether mvCand matches the HMVP table element corresponding to HMVPIdx (HMVPCandNum-NumPrune+1) to (HMVPCandNum-1). This significantly reduces the number of comparisons compared to the previously described embodiment.

[0118] In another embodiment, the encoder / decoder can compare mvCand with a specific position already set in the HMVP table other than HMVPIdx 0. For example, the encoder / decoder can compare mvCand with HMVP table elements corresponding to HMVPIdx PruneStart to (HMVPCandNum-1) to see if it contains overlapping motion information.

[0119] FIG. 17 is a diagram illustrating a method for updating an HMVP table according to an embodiment of the present invention. Referring to FIG. 17, in an embodiment of the present invention, an encoder / decoder may compare mvCand with the most recently added HMVP table element in order from the oldest HMVP table element to determine whether mvCand is included in the HMVP table. The process illustrated in FIG. 17 may receive as input a motion candidate mvCand having two motion vectors mvL0 and mvL1, two reference indexes refIdxL0 and refIdxL1, and two prediction list usage flags predFlagL0 and predFlagL1. The process illustrated in FIG. 17 may then output a modified HMVPCandList array. Since mvCand is likely to be similar to the motion information of spatially adjacent blocks, it may be similar to the motion information added relatively recently in the HMVP table. In this manner, if similar (or identical) motion information is found, the pruning process can be terminated. Therefore, as in the embodiment of FIG. 17, by performing comparison starting with the HMVPIdx corresponding to the most recently added element, the number of comparisons can be reduced.

[0120] 18 is a diagram illustrating a pruning process according to an embodiment of the present invention. According to an embodiment of the present invention, when determining whether motion information of a current block is already included in an HMVP table, the encoder / decoder may compare the motion information with a portion of the HMVP table. This is to reduce the complexity of the comparison process. For example, when determining whether motion information is included in HMVPCandList[HMVPIdx], the encoder / decoder may perform the pruning process using a subset of HMVPCandList[HMVPIdx] or an HMVPCandList[HMVPIdx] having a predefined index. For example, HMVPCandList[HMVPIdx] may include information about L0 and L1, respectively. If the L0 and L1 utilization flags are both 1, the encoder / decoder may select and compare either L0 or L1 according to a predefined rule (or condition). For example, the pruning process may be performed to check for duplicate motion information only for the reference list with the smaller L0 reference index or L1 reference index.

[0121] In one embodiment, the encoder / decoder may perform the pruning process only on the smaller reference list of the L0 reference index and the L1 reference index of the motion information of the HMVP table. For example, the encoder / decoder may perform the pruning process only on the smaller reference index of the L0 reference index and the L1 reference index of the motion information of the current block. In another embodiment, the encoder / decoder may compare a value based on a subset of the reference index bits and the motion information bits of the current block with a value based on a subset of the reference index bits and the motion information bits of an HMVP table element to determine whether the value is already included in the HMVP table. In one embodiment, the value based on the subset of the reference index bits and the motion information bits may be some of the reference index bits and the motion information bits. In another embodiment, the value based on the subset of the reference index bits and the motion information bits may be a value (or an output) obtained by passing the first and second subsets through a hash function. In another embodiment, if the size difference between the two motion vectors during the pruning process is smaller than or equal to a predefined threshold value, the encoder / decoder may determine that the two motion vectors are the same or similar.

[0122] 19 is a diagram illustrating a method for adding an HMVP candidate according to an embodiment of the present invention. According to an embodiment of the present invention, an encoder / decoder can add an MV included in an HMVP table to a motion candidate list. As an example, since the motion of the current block may be similar to a recently added motion, and the recently added motion may be useful as a candidate, the encoder / decoder can add the recently added element in the HMVP table to the candidate list.

[0123] 19, in one embodiment, the encoder / decoder may add to the candidate list an element having a specific index value rather than the most recently added HMVP table element, or may add to the candidate list a specific number of previously added elements rather than the most recently added HMVP table element, starting from the element next thereto.

[0124] Alternatively, in one embodiment, the encoder / decoder may add a certain number of previously added elements, excluding one or more of the most recently added HMVP table elements, to the candidate list. In this case, the encoder / decoder may preferentially add relatively recently input motion information from among the HMVP table elements to the candidate list.

[0125] Since the most recently added HMVP table element may correspond to a block spatially adjacent to the current block, it is highly likely that it has already been added as a spatial candidate during the candidate list construction process. Therefore, by constructing a candidate list excluding a specific number of recently added candidates as in this embodiment, it is possible to prevent unnecessary candidates from being added to the candidate list and reduce the complexity of the pruning processor when adding candidates to the candidate list. Although the HMVP table elements and their use have been described with a focus on motion candidate list construction, the present invention is not limited thereto and may be applied to other parameters or inter / intra prediction related information.

[0126] FIG. 20 is a diagram illustrating a merge sharing node according to an embodiment of the present invention. According to an embodiment of the present invention, an encoder / decoder may share the same candidate list for multiple blocks to facilitate parallel processing. The candidate list may be a motion candidate list. The multiple blocks may be defined according to a predetermined rule. For example, blocks subordinate to a block (or region) satisfying a specific condition may be defined as the multiple blocks. Alternatively, blocks included in the block satisfying a specific condition may be defined as the multiple blocks. In this specification, a candidate list shared by the multiple blocks may be referred to as a shared list. If applied to a merge candidate list, it may be referred to as a shared merge list.

[0127] In this specification, the block satisfying the specific condition may be referred to as a merge sharing node (i.e., the portion indicated by the dotted line in FIG. 20), a shared merge node, a merge sharing region, a shared merge region, a shared merge list node, a shared merge list region, etc. The encoder / decoder may construct a motion candidate list based on motion information of neighboring blocks adjacent to the merge sharing node, thereby ensuring parallel processing of coding units within the merge sharing node. In addition, a threshold value may be used as the specific condition. For example, the block defined as the merge sharing node may be defined (or determined) based on the threshold value. For example, the threshold value used in the specific condition may be set to a value related to the block size or the width / height of the block.

[0128] FIG. 21 is a diagram illustrating an HMVP update method when a shared list is used according to an embodiment of the present invention. In FIG. 21, it is assumed that the shared list described above in FIG. 20 is used. When constructing a shared list using HMVP candidates, the encoder and decoder must maintain the same HMVP table. If multiple blocks using the same shared list do not have an HMVP table update rule defined based on the motion information used, they cannot construct the same candidate list. Therefore, in FIGS. 22 to 24 (described later), an HMVP table update method for ensuring the same shared list within the merge share node will be described, assuming that CU1, CU2, CU3, and CU4 use a shared list within the merge share node shown in FIG. 21.

[0129] 22 is a diagram illustrating a method for updating an HMVP table based on motion information of blocks in a merge sharing node according to an embodiment of the present invention. Referring to FIG. 22, an encoder / decoder can apply the same sharing list to CU1, CU2, CU3, and CU4 in the subordinate coding units of the merge sharing node. Specifically, the encoder / decoder can construct the same motion candidate list for CU1, CU2, CU3, and CU4 based on the motion information of neighboring blocks adjacent to the merge sharing node (S2201, S2202, S2203, S2204). The motion candidate list can include motion vector components and reference indexes.

[0130] After deriving or encoding / decoding motion information for CU1, CU2, CU3, and CU4 using the shared motion candidate list, the encoder / decoder may update the HMVP table using the motion information for CU1, CU2, CU3, and CU4 (S2205). In a situation where the same candidate list should be used, that is, if multiple CUs within a merged sharing node update their HMVP tables, the same candidate list may not be used. Therefore, according to one embodiment of the present invention, in a situation where a shared list is used, the HMVP table may be updated after MV derivation or coding of all CUs belonging to the merged sharing node is completed, thereby allowing all CUs belonging to the merged sharing node to construct motion candidate lists based on the same HMVP table.

[0131] 23 is a diagram illustrating an HMVP update method when a shared list is used according to an embodiment of the present invention. Referring to FIG. 23, it is assumed that the shared list described in FIGS. 20 to 22 is used. In this case, when MV induction or encoding / decoding of each CU in FIG. 22 is completed, there may be multiple CUs in the merged shared node, and therefore multiple pieces of used motion information may also exist.

[0132] According to one embodiment of the present invention, as shown in Figure 23, the encoder / decoder can update the HMVP table using all motion information in the merge shared node. In other words, the encoder / decoder can update the HMVP table using motion information used by all CUs that use the same shared list. In this case, the update order must already be set in the encoder and decoder.

[0133] In one embodiment, the encoder / decoder may refer to the regular decoding order as the update order. For example, as shown in FIG. 23, the motion information corresponding to each CU may be sequentially used as input for the HMVP table update process according to the regular coding order. Alternatively, in one embodiment, the encoder / decoder may determine the HMVP table update order for the motion information of multiple CUs by referring to the reference index order, the POC relationship between the current picture and the reference picture, etc. For example, all motion information in the merge sharing node may be updated in the HMVP table in the order of the reference index. Alternatively, all motion information in the merge sharing node may be updated in the HMVP table in the order of the lowest or highest POC difference between the current picture and the reference picture.

[0134] 24 is a diagram illustrating a method for updating an HMVP table based on motion information of blocks in a merge sharing node according to an embodiment of the present invention. Referring to FIG. 24, it is assumed that the shared list described in FIGS. 20 to 22 is used. In this case, after MV induction or encoding / decoding of each CU in FIG. 22 is completed, there may be multiple CUs in the merge sharing node, and therefore multiple pieces of motion information may be used.

[0135] According to an embodiment of the present invention, an encoder / decoder may update an HMVP table using some of the motion information used by a plurality of CUs in a merge sharing node. In other words, the encoder / decoder may not update the motion information of at least some of the CUs in the merge sharing node in the HMVP table. As an example, the encoder / decoder may refer to a regular coding order as the update order. For example, the encoder / decoder may update the HMVP table using a predetermined number of motion information items that are later in the decoding order among the motion information items corresponding to each CU according to the regular decoding order. This is because a later block in the regular coding order is likely to be spatially adjacent to the next coded block and may require similar motion during motion compensation.

[0136] 24, when there are CU1 to CU4 that use the same shared list, the encoder / decoder can use only the motion information for CU4, which is coded last in normal decoding order, to update the HMVP table. In another embodiment, the encoder / decoder can update the HMVP table using some of the motion information of multiple CUs, with reference to the reference index order, the POC relationship between the current picture and the reference picture, etc.

[0137] According to another embodiment of the present invention, when adding an HMVP candidate from an HMVP table to a candidate list, the encoder / decoder may add the HMVP candidate to the candidate list by referring to the relationship between the current block and a block corresponding to an element in the HMVP table. Alternatively, when adding an HMVP candidate from an HMVP table to a candidate list, the encoder / decoder may refer to the positional relationship between the candidate blocks included in the HMVP table. For example, the encoder / decoder may add an HMVP candidate from the HMVP table to the candidate list by taking into account the decoding order of the HMVP or blocks.

[0138] 25 is a diagram illustrating a method for processing a video signal based on HMVP according to an embodiment of the present invention. For convenience of explanation, the present invention will be described with reference to a decoder, but the present invention is not limited thereto, and the HMVP-based video signal processing method according to this embodiment can be applied to an encoder in a substantially similar manner.

[0139] Specifically, when a current block is located within a merge sharing node including multiple coding blocks, the decoder can construct a merge candidate list using spatial candidates adjacent to the merge sharing node (S2501). The decoder can add a specific HMVP in an HMVP table including at least one history-based motion vector predictor (HMVP) to the merge candidate list (S2502). Here, the HMVP represents motion information of a block coded before the multiple coding blocks.

[0140] The decoder obtains index information indicating a merge candidate to be used for predicting the current block from the merge candidate list (S2503) and generates a predicted block of the current block based on motion information of the merge candidate (S2504). The decoder may generate a reconstructed block of the current block by adding the predicted block and the residual block. As described above, according to one embodiment of the present invention, motion information of at least one coding block among the plurality of coding blocks included in the merge sharing node may not be updated in the HMVP table. As described above, the decoder may update the HMVP table using motion information of a predefined number of coding blocks that are relatively late in decoding order among the plurality of coding blocks included in the merge sharing node.

[0141] As described above, the decoder may update the HMVP table using motion information of a coding block that is relatively latest in decoding order among a plurality of coding blocks included in the merge sharing node. Furthermore, if the current block is not located within the merge sharing node, the decoder may update the HMVP table using motion information of the merge candidate. Furthermore, as described above, the decoder may check whether an HMVP has motion information that overlaps with a candidate in the merge candidate list, using an HMVP having a specific index predefined within the HMVP table.

[0142] FIG. 26 is a diagram illustrating a multi-hypothesis prediction method according to an embodiment of the present invention. According to an embodiment of the present invention, an encoder / decoder may generate a predicted block based on multiple prediction methods. In this specification, a prediction method based on multiple prediction modes is referred to as multi-hypothesis prediction. However, the present invention is not limited to such names, and in this specification, the multi-hypothesis prediction may be referred to as multi-prediction, multiple prediction, combined prediction, inter-intra weighted prediction, combined inter-intra prediction, combined inter-intra weighted prediction, etc. In one embodiment, multi-hypothesis prediction may refer to a block generated by any prediction method. In another embodiment, a prediction method in multi-prediction may include intra prediction, inter prediction, etc. Alternatively, a prediction method in multi-prediction may be further subdivided to refer to a merge mode, an AMVP mode, a specific mode of intra prediction, etc. In addition, the encoder / decoder may generate a final predicted block by performing a weighted sum of predicted blocks (or predicted samples) generated based on multi-prediction.

[0143] According to an embodiment of the present invention, the maximum number of prediction methods used in multi-prediction may be preset. For example, the maximum number of multi-prediction methods may be 2. Therefore, the encoder / decoder can generate a prediction block by applying two predictions in the case of uni-prediction, and two predictions (i.e., when multi-prediction is used for prediction from only one reference list) or four predictions (i.e., when multi-prediction is used for prediction from two reference lists) in the case of bi-prediction.

[0144] Alternatively, according to an embodiment of the present invention, prediction modes usable in multi-hypothesis prediction may be preset, or prediction mode combinations usable in multi-hypothesis prediction may be preset. For example, an encoder / decoder may perform multi-hypothesis prediction using prediction blocks (or prediction samples) generated by inter prediction and intra prediction.

[0145] According to one embodiment of the present invention, an encoder / decoder may use only some prediction modes among inter prediction and / or intra prediction modes for multiple hypothesis prediction. For example, the encoder / decoder may use only merge mode among inter prediction for multiple hypothesis prediction. Alternatively, the encoder / decoder may use merge mode, but not subblock merge mode, among inter prediction for multiple hypothesis prediction. Alternatively, the encoder / decoder may use a specific intra mode among intra prediction modes for multiple hypothesis prediction. For example, the encoder / decoder may use prediction modes including at least one of planar, DC, vertical, and / or horizontal modes among intra prediction for multiple hypothesis prediction in a restricted manner. In one embodiment, the encoder / decoder may generate a prediction block based on predictions of merge mode and intra prediction, and may use only at least one restricted prediction mode among planar, DC, vertical, and / or horizontal modes for intra prediction.

[0146] Referring to FIG. 26, an encoder / decoder may generate a predicted block using a first prediction (prediction 1) and a second prediction (prediction 2). Specifically, the encoder / decoder may generate a first temporary predicted block (or predicted sample) by applying the first prediction, and generate a second temporary predicted block by applying the second prediction. The encoder / decoder may generate a final predicted block by performing a weighted sum of the first and second temporary predicted blocks. In this case, the encoder / decoder may perform a weighted sum by applying a first weighting value w1 to the first temporary predicted block generated by the first prediction and applying a second weighting value w2 to the second temporary predicted block generated by the second prediction.

[0147] According to an embodiment of the present invention, when a prediction block is generated based on multiple hypothesis prediction, a weight applied to the multiple hypothesis prediction may be determined based on a specific position within a block. In this case, the block may be a current block or a neighboring block. Alternatively, the weight of the multiple hypothesis prediction may be based on a mode for generating a prediction. For example, if one of the modes for generating a prediction is intra prediction, the encoder / decoder may determine the weight based on the prediction mode. Furthermore, for example, if one of the prediction modes is intra prediction and a directional mode, the encoder / decoder may increase the weight for a sample located far away from a reference sample.

[0148] According to one embodiment of the present invention, when the intra prediction mode used in multiple hypothesis prediction is a directional mode and the other prediction mode is inter prediction, the encoder / decoder may apply a relatively high weight to a predicted sample generated based on intra prediction far from a reference sample. This is because, in the case of inter prediction, motion compensation can be performed using spatial neighbor candidates. In such a case, there is a high probability that the motion of the current block and the spatial neighbor block referenced for motion compensation are identical or similar. Therefore, there is a high probability that prediction of an area adjacent to the spatial neighbor block and prediction of an area including an object with motion are more accurate than other areas. In this case, a residual signal adjacent to the opposite boundary of the spatial neighbor block may be more likely to remain than in other areas (or parts). According to one embodiment of the present invention, this can be compensated for by combining and applying intra predicted samples in multiple hypothesis prediction. Furthermore, in one embodiment, since the reference sample position for intra prediction may be near the spatial neighbor candidate for inter prediction, the encoder / decoder may apply a high weight to an area relatively far from it.

[0149] In another embodiment, when one of the modes used to generate multiple hypothesis predicted samples is intra prediction and a directional mode, the encoder / decoder may apply a high weight to a sample located relatively close to the reference sample. More specifically, when one of the modes used to generate multiple hypothesis predicted samples is intra prediction and a directional mode, and the other mode used to generate multiple hypothesis predicted samples is inter prediction, the encoder / decoder may apply a high weight to a prediction generated based on intra prediction closer to the reference sample. This is because, in intra prediction, the closer the distance between a predicted sample and a reference sample, the higher the accuracy of the prediction.

[0150] In another embodiment, when one of the modes used to generate multiple hypothesis prediction samples is intra prediction and is not a directional mode (e.g., planar or DC mode), the weight may be set to a constant value regardless of the position within the block. Also, in one embodiment, in multiple hypothesis prediction, the weight for prediction 2 may be determined based on the weight for prediction 1. The following equation represents an example of determining a prediction sample based on multiple hypothesis prediction.

[0151]

number

[0152] In Equation 5, pbSamples represents (final) predicted samples (or predicted blocks) generated by multiple hypothesis prediction. predSamples represents blocks / samples generated by inter prediction, and predSamplesIntra represents blocks / samples generated by intra prediction. In Equation 5, x and y represent the coordinates of samples within a block and may be in the following range: x=0..nCbW-1 and y=0..nCbH-1. nCbW and nCbH may be the width and height of the current block, respectively. In one embodiment, the weight w may be determined by the following process:

[0153] If predModeIntra is INTRA_PLANAR or INTRA_DC, or nCbW<4, or nCbH<4, or cIdx>0, then w may be set to 4.

[0154] Otherwise, if predModeIntra is INTRA_ANGULAR50 and y<(nCbH / 4), then w may be set to 6.

[0155] - Otherwise, if predModeIntra is INTRA_ANGULAR50 and (nCbH / 4)<=y<(nCbH / 2), then w may be set to 5.

[0156] - Otherwise, if predModeIntra is INTRA_ANGULAR50 and (nCbH / 2)<=y<(3*nCbH / 4), then w may be set to 4.

[0157] - Otherwise, if predModeIntra is INTRA_ANGULAR50 and (3*nCbH / 4)<=y<nCbH, then w may be set to 3.

[0158] - Otherwise, if predModeIntra is INTRA_ANGULAR18 and x<(nCbW / 4), then w may be set to 6.

[0159] - Otherwise, if predModeIntra is INTRA_ANGULAR18 and (nCbW / 4)<=x<(nCbW / 2), then w may be set to 5.

[0160] - Otherwise, if predModeIntra is INTRA_ANGULAR18 and (nCbW / 2)<=x<(3*nCbW / 4), then w may be set to 4.

[0161] - Otherwise, if predModeIntra is INTRA_ANGULAR18 and (3*nCbW / 4)<=x<nCbW, then w may be set to 3.

[0162] The following Table 2 exemplifies the multiple hypothesis prediction related syntax structure according to an embodiment of the present invention.

[0163]

Table 2

[0164] In Table 2, mh_intra_flag is a flag indicating whether or not multiple hypothesis prediction is used. According to an embodiment of the present invention, multiple hypothesis prediction may be applied only when predefined specific conditions for multiple hypothesis prediction (referred to as mh_conditions for convenience of explanation in this specification) are met. If the mh_conditions are not met, the encoder / decoder may not parse mh_intra_flag and may infer it to be 0. For example, mh_conditions may include a condition regarding the block size. Furthermore, mh_conditions may include a condition regarding whether or not a predefined specific mode is used. For example, mh_intra_flag may be parsed when merge_flag, a flag indicating whether or not the merge mode is applied, is 1 and subblock_merge_flag, a flag indicating whether or not the subblock merge mode is applied, is 0. In other words, the encoder / decoder may consider (or apply) multiple hypothesis prediction when the merge mode is applied to the current block and the subblock merge mode is not applied.

[0165] According to one embodiment of the present invention, the encoder may divide candidate modes into multiple lists to determine a mode in multiple hypothesis prediction, and signal to the decoder which list to use. Referring to Table 2, mh_intra_luma_mpm_flag may be a flag indicating which of the multiple lists to use. If mh_intra_luma_mpm_flag is not present, it can be inferred (or considered) to be 1. According to one embodiment of the present invention, the multiple lists may be an MPM list and a non-MPM list.

[0166] Also, as an example, the encoder may signal to the decoder an index (or index information) indicating which index candidate to use in one of the multiple lists. Referring to Table 2, mh_intra_luma_mpm_idx may be the index. Also, as an example, the index may be signaled only when a specific list is selected. The decoder may parse mh_intra_luma_mpm_idx only when a specific list is determined by mh_intra_luma_mpm_flag.

[0167] According to an embodiment of the present invention, as in the embodiment described with reference to FIG. 26, multiple hypothesis prediction may be performed based on a prediction generated by inter prediction and a prediction generated by intra prediction. For example, the encoder / decoder may perform multiple hypothesis prediction only when it is signaled that inter prediction is to be used. Alternatively, the encoder / decoder may perform multiple hypothesis prediction only when it is signaled that a specific inter prediction mode, such as merge mode, is to be used. In this case, separate signaling for inter prediction may not be required. Also, as an example, when generating a prediction using intra prediction, the encoder / decoder may have a total of four candidate modes. For example, the encoder / decoder may configure a first list and a second list using three and one candidate modes, respectively, out of the total four candidate modes. In this case, if the second list including one prediction mode is selected, the encoder does not need to signal an index to the decoder. Alternatively, if the first list is selected, the encoder may signal an index indicating a specific candidate to the decoder. In this case, since the first list contains three candidates, signaling can be performed using one or two bits in a variable length coding scheme.

[0168] Table 3 below illustrates a syntax structure related to multiple hypothesis prediction according to one embodiment of the present invention.

[0169] [Table 3]

[0170] In Table 3, as described in Table 2 above, there may be signaling indicating which list among multiple lists is used, and mh_intra_luma_mpm_flag may be such a syntax element in Tables 2 and 3. In this regard, the description of syntax elements that overlap with those in Table 2 above will be omitted.

[0171] According to one embodiment of the present invention, signaling indicating which list to use may be explicitly signaled only in specific cases. If not explicitly signaled, the encoder / decoder can infer the value of the syntax element according to a pre-defined method. Referring to Table 3, if the condition of mh_mpm_infer_condition is met, explicit signaling may not be present, and if the condition of mh_mpm_infer_condition is not met, explicit signaling may be present. Also, if the condition of mh_mpm_infer_condition is met, mh_intra_luma_mpm_flag may not be present, and in that case, it may be inferred to be 1. That is, the encoder / decoder can infer that an MPM list is to be used in this case.

[0172] Table 4 below illustrates a syntax structure related to multiple hypothesis prediction according to one embodiment of the present invention.

[0173] [Table 4]

[0174] As described above in Tables 2 and 3, signaling indicating which list among multiple lists to use may exist, and if a predefined condition is met, the encoder / decoder can infer the value. In this regard, the description of syntax elements that overlap with those in Tables 2 and 3 will be omitted.

[0175] According to an embodiment of the present invention, a condition for inferring a signaling (or syntax element, parameter) value indicating which list among a plurality of lists to use may be determined based on the size of the current block. For example, the encoder / decoder may determine this based on the width and height of the current block. Specifically, the encoder / decoder may infer the signaling value when the larger of the width and height of the current block is greater than n times the smaller of the width and height of the current block. For example, n may be set to a natural number such as 2, 3, or 4. Referring to Table 4, the condition for inferring the signaling value indicating which list among a plurality of lists to use may be when the larger of the width and height of the current block is greater than twice the smaller of the width and height of the current block. If the width and height of the current block are cbWidth and cbHeight, respectively, the Abs(Log2(cbWidth / cbHeight)) value is 0 when cbWidth and cbHeight are the same, and 1 when they are two times different. Thus, if the difference between cbWidth and cbHeight is more than twice, the Abs(Log2(cbWidth / cbHeight)) value will be greater than 1 (ie, can have a value of 2 or greater).

[0176] FIG. 27 is a diagram illustrating a method for determining a multiple hypothesis prediction mode according to an embodiment of the present invention. As described above with reference to Tables 2 to 4, the determination of a prediction mode to be used in multiple hypothesis prediction may be performed based on a plurality of lists. As an example, the prediction mode may indicate an intra mode for generating a prediction based on intra prediction. Furthermore, the plurality of lists may include two lists, a first list and a second list. Referring to FIG. 27, it may be determined whether the first list is to be used based on list1_flag. In one embodiment, there may be a plurality of candidates that can belong to the first list, and there may be one candidate that can belong to the second list.

[0177] If list1_flag is inferred, the encoder / decoder can infer that the first list is to be used and its value (S2701). In this case, it can parse list1_index, which is an index indicating which candidate in the first list is to be used (S2704). If list1_flag is not inferred (S2701), the encoder / decoder can parse list1_flag (S2702). If list1_flag is 1, the encoder / decoder can parse list1_index, and if list1_flag is not 1, it does not need to parse the index. If list1_flag is 1, it can determine the mode to actually use from among the candidate modes in the first list based on the index (S2703). If list1_flag is not 1, the encoder / decoder can determine the candidate mode in the second list as the mode to actually use without an index. That is, in the first list, the mode may be determined based on the flag and the index, and in the second list, the mode may be determined based on the flag.

[0178] FIG. 28 is a diagram illustrating a method for determining a multiple hypothesis prediction mode according to an embodiment of the present invention. According to an embodiment of the present invention, when an index for determining a candidate mode in a list is variable-length coded, a method for determining the order of modes included in a candidate list may be applied to improve coding efficiency. For example, a method for determining the order of modes included in a first list may exist. In this case, the encoder / decoder may refer to modes surrounding a current block to determine the mode order. The second list may be determined without referring to modes surrounding the current block. For example, the encoder / decoder may generate the first list by referring to modes surrounding the current block, and include modes not included in the first list in the second list. In one embodiment, the first list may be an MPM mode, and the second list may be a non-MPM mode. Furthermore, there may be four total candidate modes, with three modes included in the first list and one mode included in the second list.

[0179] Referring to FIG. 28, a syntax element list1_flag may be present, indicating whether the first list is used. If the first list is used, the encoder / decoder generates the first list (S2801, S2802) and can select a specific mode from the first list. At this time, the generation of the first list and the confirmation of whether the first list is used may be performed in any order. For example, in a situation where the first list is used, the first list may be generated before or after the confirmation of whether the first list is used. Furthermore, if the first list is used, the encoder / decoder may not need to perform the process of generating the second list.

[0180] If the first list is not used, the encoder / decoder may generate a second list (S2803) and select a specific mode from the second list. In this case, the encoder / decoder may generate the first list in order to generate the second list. The encoder / decoder may then include candidate modes not included in the first list in the second list. In addition, according to one embodiment of the present invention, the method of generating the first list may be the same regardless of whether the first list is used (list1_flag value), whether the first list is used, whether inference is performed, etc. In this case, the methods described above with reference to Tables 2 to 4 and FIG. 27 may be applied to list signaling and mode signaling.

[0181] Hereinafter, a method for constructing (or generating) a plurality of lists for determining a prediction mode used in the multiple hypothesis prediction described above with reference to FIGS. 27 and 28 will be further described. As an example, as described above, the plurality of lists may be configured with two lists. That is, the plurality of lists may include a first list and a second list. Furthermore, the plurality of lists may be used in the multiple hypothesis prediction process.

[0182] According to one embodiment of the present invention, an encoder / decoder may generate multiple lists by referring to modes surrounding a current block. The encoder / decoder may then perform intra prediction using a mode selected from the list, and combine predicted samples (or predicted blocks) generated by the intra prediction with inter-predicted predicted samples to generate a multi-hypothesis predicted block. In this specification, the final predicted samples (or predicted blocks) generated by the multi-hypothesis prediction are referred to as a multi-hypothesis predicted block, but the present invention is not limited thereto. For example, the multi-hypothesis predicted block may be referred to as a predicted block, a final predicted block, a multi-hypothesis predicted block, a combined predicted block, an inter-intra weighted predicted block, a combined inter-intra predicted block, a combined inter-intra weighted predicted block, or the like.

[0183] In one embodiment, modes (candidate modes) that can be included in the list may be set to at least one of planar mode, DC mode, vertical mode, and / or horizontal mode of the intra prediction method. In this case, the vertical mode may be the mode with index (or mode number) 50 in Fig. 6, and the horizontal mode may be the mode with index 18 in Fig. 6. In addition, the planar mode and DC mode may have indexes 0 and 1, respectively.

[0184] According to an embodiment of the present invention, a candidate mode list may be generated by referring to prediction modes of neighboring blocks of a current block. The candidate mode list may be referred to as candModeList in this specification. For example, the candidate mode list may be the first list described in the above embodiment. For example, the mode of neighboring blocks of the current block may be expressed as candIntraPredModeX. That is, candIntraPredModeX represents a variable indicating the mode of the neighboring blocks. Here, X represents a variable indicating a specific position, such as A or B, surrounding the current block.

[0185] In one embodiment, the encoder / decoder can generate a candidate mode list based on whether there is a match between multiple candIntraPredModeX. For example, candIntraPredModeX can exist for two positions, and the modes at those positions may be expressed as candIntraPredModeA and candIntraPredModeB. As an example, if candIntraPredModeA and candIntraPredModeB are identical, the candidate mode list can include planar mode and DC mode.

[0186] As an example, if candIntraPredModeA and candIntraPredModeB are the same and their values ​​indicate planar mode or DC mode, the encoder / decoder may add the modes indicated by candIntraPredModeA and candIntraPredModeB to the candidate mode list. Furthermore, the encoder / decoder may add a mode not indicated by candIntraPredModeA and candIntraPredModeB among planar mode and DC mode to the candidate mode list. Furthermore, the encoder / decoder may add a previously set mode, rather than planar mode or DC mode, to the candidate mode list. As an example, in this case, the order of the previously set specific modes, such as planar mode and DC mode, in the candidate mode list may be pre-set. For example, the order may be planar, DC, and the previously set mode. That is, candModeList[0] = planar mode, candModeList[1] = DC mode, and candModeList[2] = the previously set mode. Furthermore, the previously set mode may be vertical mode. In yet another embodiment, among the planar mode, DC mode, and the already set modes, the modes indicated by candIntraPredModeA and candIntraPredModeB may be added first to the candidate mode list, and among the planar mode and DC mode, the modes not indicated by candIntraPredModeA and candIntraPredModeB may be added as the next candidate, followed by the already set modes.

[0187] Furthermore, if candIntraPredModeA and candIntraPredModeB are the same and their values ​​do not indicate planar mode or DC mode, the encoder / decoder can add the modes indicated by candIntraPredModeA and candIntraPredModeB to the candidate mode list. Alternatively, planar mode and DC mode may be added to the candidate mode list. In this case, the order of the modes indicated by candIntraPredModeA and candIntraPredModeB, planar mode, and DC mode in the candidate mode list may be already set. Alternatively, the already set order may be the order of the modes indicated by candIntraPredModeA and candIntraPredModeB, planar mode, and DC mode. That is, candModeList[0] = candIntraPredModeA, candModeList[1] = planar mode, and candModeList[2] = DC mode.

[0188] Furthermore, if candIntraPredModeA and candIntraPredModeB are different from each other, the encoder / decoder may add both candIntraPredModeA and candIntraPredModeB to the candidate mode list. Also, candIntraPredModeA and candIntraPredModeB may be included in the candidate mode list in a predefined order. For example, candIntraPredModeA, candIntraPredModeB may be included in the candidate mode list in that order. There may also be a predefined order among the candidate modes, and the encoder / decoder may add modes other than candIntraPredModeA and candIntraPredModeB to the candidate mode list among the modes in the predefined order. Furthermore, modes other than candIntraPredModeA and candIntraPredModeB may be added after candIntraPredModeA and candIntraPredModeB in the candidate mode list. The predefined order may be planar mode, DC mode, and vertical mode. Alternatively, the previously set order may be planar mode, DC mode, vertical mode, and horizontal mode. That is, candModeList[0]=candIntraPredModeA, candModeList[1]=candIntraPredModeB, and candModeList[2] may be the first mode among planar mode, DC mode, and vertical mode that is neither candIntraPredModeA nor candIntraPredModeB.

[0189] In addition, in one embodiment, a candidate mode that is not included in the candidate mode list may be defined as candIntraPredModeC. As an example, candIntraPredModeC may be included in the second list. Also, if the signaling indicating whether the first list is used indicates that the mode is not to be used, candIntraPredModeC may be determined. If the first list is used, the encoder / decoder determines a mode according to an index in the candidate mode list, and if the first list is not used, the encoder / decoder may use a mode in the second list.

[0190] Furthermore, as described above, after generating the candidate mode list, a process of modifying the candidate mode list may be added. For example, the encoder / decoder may or may not further perform the modifying process depending on the current block size condition. For example, the current block size condition may be determined based on the width and height of the current block. For example, if the larger of the width and height of the current block is n times larger than the other, the modifying process may be further performed. For example, n may be defined as 2.

[0191] In one embodiment, the modifying process may be a process of changing a mode included in the candidate mode list to another mode. For example, if a vertical mode is included in the candidate mode list, the encoder / decoder may insert a horizontal mode into the candidate mode list instead of the vertical mode. Alternatively, if a vertical mode is included in the candidate mode list, the encoder / decoder may insert candIntraPredModeC into the candidate mode list instead of the vertical mode. Since planar mode and DC mode can always be included in the candidate mode list when generating the candidate mode list, candIntraPredModeC may be the horizontal mode in this case. This modifying process may be used when the height of the current block is greater than n times its width. For example, n may be defined as 2. This is because, when the height is greater than the width, the accuracy of the vertical mode may be low because the bottom of the block is far from the reference sample for intra prediction. Alternatively, this modifying process may be used when it is inferred that the first list should be used.

[0192] According to another embodiment of the present invention, as another example of the candidate list modification process, when a horizontal mode is included in the candidate mode list, the encoder / decoder may add a vertical mode to the candidate mode list instead of the horizontal mode. Alternatively, when a horizontal mode is included in the candidate mode list, the encoder / decoder may add candIntraPredModeC to the candidate mode list instead of the horizontal mode. Alternatively, since planar mode and DC mode may always be included in the candidate mode list when generating the candidate mode list, in this case, candIntraPredModeC may be a vertical mode. Furthermore, such a modification process may be used when the width of the current block is greater than n times its height. For example, n may be defined as 2. This is because, when the width is greater than the height, the right side of the block is far from the reference sample for intra prediction, and therefore the accuracy of the horizontal mode may be low. Alternatively, such a modification process may be used when it is inferred that the first list should be used.

[0193] An example of the list setting method described above will be further described below. In this specification, IntraPredModeY indicates a mode used for intra prediction during multiple hypothesis prediction. In addition, IntraPredModeY may indicate a mode of a luma component. As an example, the intra prediction mode of a chroma component during multiple hypothesis prediction may be derived from the luma component. In addition, in this specification, mh_intra_luma_mpm_flag indicates a variable (or syntax element) indicating which list among a plurality of lists to use. For example, mh_intra_luma_mpm_flag may be mh_intra_luma_mpm_flag in Tables 2 to 4, or list1_flag in FIGS. 27 and 28. In addition, in this specification, mh_intra_luma_mpm_idx indicates an index indicating which candidate in the list to use. For example, mh_intra_luma_mpm_idx may be mh_intra_luma_mpm_idx in Tables 2 to 4, or list1_index in Fig. 27. Also, in this specification, xCb and yCb may be the x and y coordinates of the top-left corner of the current block. Also, cbWidth and cbHeight may be the width and height of the current block.

[0194] FIG. 29 is a diagram illustrating neighboring positions referenced in multiple hypothesis prediction according to an embodiment of the present invention. Referring to FIG. 29, as described above, the encoder / decoder may reference neighboring positions in the process of generating a candidate list for multiple hypothesis prediction. For example, the above-described candIntraPredModeX may be required. In this case, the referenced positions A and B around the current block may be NbA and NbB shown in FIG. 29. That is, they may be positions adjacent to the left and above the top-left sample of the current block. If the top-left position of the current block is Cb as shown in FIG. 18 and its coordinates are (xCb, yCb), NbA may be (xNbA, yNbA) = (xCb-1, yCb), and NbB may be (xNbB, yNbB) = (xCb, yCb-1).

[0195] FIG. 30 is a diagram illustrating a method for referring to a neighboring mode according to an embodiment of the present invention. Referring to FIG. 30, as described above, the encoder / decoder may refer to a neighboring position in the process of generating a candidate list for multi-hypothesis prediction. Alternatively, the encoder / decoder may use the neighboring mode as is or generate a candidate mode list using a mode based on the neighboring mode. For example, the mode generated by referring to the neighboring position may be candIntraPredModeX. For example, if the neighboring position is unavailable, candIntraPredModeX may be a pre-set mode. Unavailability may include a case where the neighboring position uses inter prediction, or a case where a mode is not determined in a predetermined encoding / decoding order. Alternatively, if the neighboring position does not use multi-hypothesis prediction, candIntraPredModeX may be a pre-set mode. Alternatively, if the neighboring position is above the CTU to which the current block belongs, candIntraPredModeX may be a pre-set mode. As another example, if the neighboring position is outside the CTU to which the current block belongs, candIntraPredModeX may be a pre-set mode. Furthermore, for example, the pre-set mode may be DC mode. In yet another embodiment, the preset mode may be a planar mode.

[0196] According to one embodiment of the present invention, candIntraPredModeX may be set depending on whether the mode at the peripheral position exceeds a threshold angle or whether the index of the mode at the peripheral position exceeds a threshold. For example, if the index of the mode at the peripheral position is greater than a specific directional mode index, the encoder / decoder may set candIntraPredModeX to a vertical mode index. Furthermore, if the index of the mode at the peripheral position is less than or equal to the specific directional mode index and is a directional mode, the encoder / decoder may set candIntraPredModeX to a horizontal mode index. For example, the specific directional mode index may be mode 34 in FIG. 6 . Furthermore, if the mode at the peripheral position is a planar mode or a DC mode, candIntraPredModeX may be set to the planar mode or the DC mode.

[0197] Referring to Figure 30, mh_intra_flag may be a syntax element (or a variable or parameter) indicating whether multiple hypothesis prediction is used (or has been used). Also, the intra prediction mode used in the surrounding blocks may be X. Also, if the current block can use multiple hypothesis prediction, a candidate list can be generated using candidate intra prediction modes based on the modes of the surrounding blocks. However, if the surrounding blocks did not use multiple hypothesis prediction, the encoder / decoder can set the candidate intra prediction mode to the DC mode, which is the previously set mode, regardless of the intra prediction modes of the used surrounding blocks or whether the surrounding blocks used intra prediction.

[0198] An example of the above-described peripheral mode reference method is further described below.

[0199] According to an embodiment of the present invention, the intra prediction mode candIntraPredModeX (X is A or B) of the neighboring block can be derived in the following manner.

[0200] 1. The availability induction process for the block specified in the adjacent block availability confirmation process is called. The availability induction process can set the position (xCurr, yCurr) to (xCb, yCb), set the input (xNbX, yNbX) to the adjacent neighboring position (xNbY, yNbY), and the output can be assigned to the availability variable availableX.

[0201] 2. The candidate intra prediction mode candIntraPredModeX may be induced in the following manner:

[0202] A. If one or more of the following conditions are true, candIntraPredModeX may be set to the INTRA_DC mode.

[0203] a) If the variable availableX is FALSE.

[0204] b) If mh_intra_flag[xNbX][yNbX] is not 1.

[0205] c) If X is B and yCb - 1 is less than ((yCb >> CtbLog2SizeY) << CtbLog2SizeY).

[0206] B. Otherwise, if IntraPredModeY[xNbX][yNbX] > INTRA_ANGULAR34, candIntraPredModeX may be set to INTRA_ANGULAR50.

[0207] C. Otherwise, if IntraPredModeY[xNbX][yNbX] <= INTRA_ANGULAR34 and IntraPredModeY[xNbX][yNbX] > INTRA_DC, candIntraPredModeX may be set to INTRA_ANGULAR18.

[0208] D. Otherwise, candIntraPredModeX may be set equal to IntraPredModeY[xNbX][yNbX].

[0209] As mentioned above, in the list setting method described above, candIntraPredModeX may be determined by the surrounding mode reference method.

[0210] FIG. 31 illustrates a method for generating a candidate list according to an embodiment of the present invention. According to the first and second list generation methods described in Tables 2 to 4 above, an encoder / decoder may generate the first list by referring to modes surrounding a current block and generate the second list using candidate modes not included in the first list. Because of spatial similarity within a picture, modes referring to surrounding modes may have higher priority. That is, the first list may have higher priority than the second list. However, according to the first and second list signaling methods described in Tables 2 to 4, if signaling for determining the list is not inferred, the encoder / decoder may signal using a flag and an index to use a mode in the first list and use only a flag to use a mode in the second list. That is, the encoder / decoder may use relatively few bits for signaling the second list. However, using relatively many bits for signaling modes in a list with higher priority may be detrimental in terms of coding efficiency. Therefore, according to one embodiment of the present invention, a method is proposed in which relatively few bits of signaling are used for high priority lists and modes.

[0211] That is, according to an embodiment of the present invention, a candidate list generation method may be individually defined depending on whether only a list with a relatively high priority can be used. Whether only the first list can be used may be determined by whether signaling indicating the list to be used is inferred. For example, assuming that a second list generated according to a pre-set method using a candidate mode exists, the encoder / decoder may insert the third list into the first list and the second list separately. For example, the third list generated according to a pre-set method and the method for generating the third list may be the same as the candidate mode list and its generation method described above. If signaling indicating the list to be used is inferred, only the first list may be used, and in this case, the encoder / decoder may fill the first list from the beginning of the third list. Alternatively, if signaling indicating the list to be used is not inferred, either the first list or the second list may be used, and in this case, the encoder / decoder may fill the second list from the beginning of the third list and fill the remainder with the first list. In this case, the encoder / decoder may fill the third list in order even when filling the first list. That is, candIntraPredModeX can be included in the candidate list by referring to the modes around the current block, but candIntraPredModeX can be included in the first list if signaling indicating the list is inferred, and added to the second list if it is not inferred.

[0212] In one embodiment, the size of the second list may be 1. In this case, the encoder / decoder adds candIntraPredModeA to the first list if signaling indicating the list is inferred, and to the second list if not. candIntraPredModeA may be list 3[0], which is the first mode of the third list. Therefore, in the present invention, candIntraPredModeA, which is a mode based on a peripheral mode, may be added to both the first list and the second list depending on the situation. On the other hand, in the method described with reference to Tables 2 to 4, candIntraPredModeA could only be included in the first list. That is, in the present invention, the first list generation method may be individually set depending on whether signaling indicating the list to be used is inferred.

[0213] Referring to FIG. 31, the candidate modes may be candidates that can be used to generate intra-prediction for multiple hypothesis prediction. That is, the method of generating a candidate list may differ depending on whether or not list1_flag, which is signaling indicating the list to be used, is inferred (S3101, S3102). If inferred, it can be inferred that the first list will be used, and only the first list can be used, so the encoder / decoder can add the top candidate of the third list to the first list (S3103). When generating the third list, the encoder / decoder can add a mode based on a surrounding mode to the top candidate. If not inferred, both the first list and the second list may be used, so the encoder / decoder can add the top candidate of the third list to the second list, which requires less signaling (S3104). If the first list is needed, for example, if it is signaled that the first list will be used, the encoder / decoder can add candidates from the third list to the first list, excluding those included in the second list (S3105). For the sake of convenience, the present invention has been described with reference to the case where the third list is generated, but the present invention is not limited to this. The candidates may be temporarily classified and the first and second lists may be generated based on this classification.

[0214] According to an embodiment of the present invention, the method for generating a candidate list according to the embodiment described below and the method for generating a candidate list described in FIGS. 27 and 28 can be adaptively used depending on the situation. For example, the encoder / decoder can select one of two methods for creating a candidate list depending on whether signaling indicating which list to use is inferred. This may also be the case in the case of multiple hypothesis prediction. The following first list may include three modes, and the second list may include one mode. As described above in FIGS. 27 and 28, the encoder / decoder may signal the mode of the first list using a flag and an index, and signal the mode of the second list using a flag.

[0215] As one example, when candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is the planar mode or the DC mode, it may be determined that List2[0] = planar mode, List1[0] = DC mode, List1[1] = vertical mode, and List1[2] = horizontal mode. As yet another example, when candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is the planar mode or the DC mode, it may be determined that List2[0] = candIntraPredModeA, List1[0] = !candIntraPredModeA, List1[1] = vertical mode, and List1[2] = horizontal mode.

[0216] Also, as an example, when candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is a directional mode, it may be determined that List2[0] = candIntraPredModeA, List1[0] = planar mode, List1[1] = DC mode, and List1[2] = vertical mode. Also, as an example, when candIntraPredModeA and candIntraPredModeB are different, List2[0] = candIntraPredModeA and List1[0] = candIntraPredModeB. List1[1] and List1[2] may be added from the planar mode, DC mode, vertical mode, and horizontal mode other than candIntraPredModeA and candIntraPredModeB.

[0217] FIG. 32 is a diagram illustrating a candidate list generation method according to an embodiment of the present invention. In the above embodiment, a method for determining a mode based on multiple lists has been described. Referring to FIG. 32, according to an embodiment of the present invention, a mode may be determined based on a single list rather than multiple lists. Specifically, as shown in FIG. 32, one candidate list including all candidate modes for multi-hypothesis prediction may be generated. Table 5 below illustrates a syntax structure related to multi-hypothesis prediction according to an embodiment of the present invention.

[0218] [Table 5]

[0219] Referring to Table 5, since there is only one candidate list, there is no signaling for selecting the list, and there may be index signaling indicating which mode of the candidate list to use. Therefore, when mh_intra_flag, which indicates whether or not multiple hypothesis prediction is used, is 1, the decoder can parse mh_intra_luma_idx, which is a candidate index. According to one embodiment of the present invention, the method for generating a candidate list for multiple hypothesis prediction may be based on the MPM list generation method used in existing intra prediction. Alternatively, according to one embodiment, the candidate list for multiple hypothesis prediction may be formed by combining the first list and the second list in the order described above in the first and second list generation method shown in FIG. 28.

[0220] That is, if the candidate list for multiple hypothesis prediction is the candidate mode list, the size of the candidate mode list in this embodiment may be 4. If candIntraPredModeA and candIntraPredModeB are the same and represent planar mode or DC mode, the candidate mode list may be determined according to a pre-set order. For example, candModeList[0] may be planar mode, candModeList[1] may be DC mode, candModeList[2] may be vertical mode, and candModeList[3] may be horizontal mode. As another example, if candIntraPredModeA and candIntraPredModeB are the same and represent planar mode or DC mode, the candidate mode list may be determined as candModeList[0] = candIntraPredModeA, candModeList[1] = !candIntraPredModeA, candModeList[2] = vertical mode, and candModeList[3] = horizontal mode.

[0221] Alternatively, if candIntraPredModeA and candIntraPredModeB are the same and are directional modes, candModeList[0] = candIntraPredModeA, candModeList[1] = planar mode, candModeList[2] = DC mode, candModeList[3] = candIntraPredModeA, and a mode other than planar mode and DC mode may be determined. If candIntraPredModeA and candIntraPredModeB are different, candModeList[0] = candIntraPredModeA, candModeList[1] = candIntraPredModeB. Also, modes other than candIntraPredModeA and candIntraPredModeB may be added sequentially to candModeList[2] and candModeList[3] according to the pre-set order of the candidate modes. The pre-set order may be determined as planar mode, DC mode, vertical mode, and horizontal mode.

[0222] According to one embodiment of the present invention, the candidate list may vary depending on the block size condition. If the relatively larger of the block width and height is greater than n times the other, the candidate list may be shorter. For example, if the width is greater than n times the height, the encoder / decoder may remove the horizontal mode from the candidate list described in FIG. 31 and move the next mode forward to fill the candidate list. If the height is greater than n times the width, the encoder / decoder may remove the vertical mode from the candidate list described in FIG. 32 and move the next mode forward to fill the candidate list. Therefore, if the width is greater than n times the height, the candidate list size may be 3. If the width is greater than n times the height, the candidate list size may be smaller or equal to the size when the width is greater than n times the height.

[0223] As one example, the candidate index in the example illustrated in FIG. 32 may be variable-length coded. This can improve signaling efficiency by adding modes with a relatively high probability of use to the front of the list. As another example, the candidate index in the example illustrated in FIG. 32 may be fixed-length coded. The number of modes used in multiple hypothesis prediction may be an exponential power of 2. For example, as described above, it can be used among four intra-prediction modes. In this case, even if fixed-length coding is performed, no unassigned values ​​are generated, and unnecessary portions are not generated in signaling. Furthermore, when fixed-length coding is performed, the number of cases constituting the list may be one. The number of bits is the same regardless of the index signaling.

[0224] According to one embodiment, the candidate index may be variable-length coded or fixed-length coded depending on the situation. For example, as in the above embodiment, the candidate list size may vary depending on the situation. In one embodiment, the candidate index may be variable-length coded or fixed-length coded depending on the candidate list size. For example, if the candidate list size is a power of 2, the candidate index may be fixed-length coded, and if the candidate list size is not a power of 2, the candidate index may be variable-length coded. That is, according to the above embodiment, the coding method may vary depending on the block size condition.

[0225] According to one embodiment of the present invention, when using multiple hypothesis prediction, if DC mode is used, weights between multiple predictions may be the same for the entire block, which may result in the same or similar results as adjusting the weights of the predicted block. Therefore, DC mode can be omitted from multiple hypothesis prediction. As an example, an encoder / decoder may use only one of planar mode, vertical mode, and horizontal mode in multiple hypothesis prediction. In this case, the encoder / decoder may signal multiple hypothesis prediction using one list, as shown in FIG. 32. Alternatively, the encoder / decoder may use variable length coding for index signaling. As an example, the lists may be generated in a fixed order, for example, in the order of planar mode, vertical mode, and horizontal mode.

[0226] In yet another embodiment, the encoder / decoder may generate the list by referring to the modes surrounding the current block. For example, if candIntraPredModeA and candIntraPredModeB are the same, candModeList[0] may be set to candIntraPredModeA. If candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is planar mode, candModeList[1] and candModeList[2] may be set in the same order as previously set. If candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is not planar mode, candModeList[1] may be set to planar mode and candModeList[2] may be set to a mode other than planar mode, rather than candIntraPredModeA. If candIntraPredModeA and candIntraPredModeB are different, candModeList[0]=candIntraPredModeA, candModeList[1]=candIntraPredModeB, and candModeList[2]=candIntraPredModeA or a mode other than candIntraPredModeB.

[0227] In another embodiment, the encoder / decoder may use only one of three modes in multiple hypothesis prediction. The three modes may include planar mode and DC mode. The three modes may also include either vertical mode or horizontal mode depending on a condition. The condition may be a condition related to the block size. For example, whether to include horizontal mode or vertical mode may be determined depending on which of the width and height of the block is larger. For example, if the width of the block is larger than the height, vertical mode may be included. If the height of the block is larger than the width, horizontal mode may be included. If the height and width of the block are equal, a predefined specific mode from vertical mode or horizontal mode may be included.

[0228] Also, in one embodiment, the encoder / decoder may generate the list in a fixed order. For example, the order may be defined as planar mode, DC mode, and vertical or horizontal mode. Alternatively, in another embodiment, the list may be generated by referring to the modes surrounding the current block. For example, if candIntraPredModeA and candIntraPredModeB are the same, candModeList[0] may equal candIntraPredModeA. If candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is not a directional mode, the encoder / decoder may set candModeList[1] and candModeList[2] according to the previously set order. If candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is a directional mode, candModeList[1] may equal planar mode and candModeList[2] may equal DC mode. If candIntraPredModeA and candIntraPredModeB are different, candModeList[0]=candIntraPredModeA, candModeList[1]=candIntraPredModeB, and candModeList[2]=candIntraPredModeA, it is acceptable for it to be a mode other than candIntraPredModeB.

[0229] According to another embodiment of the present invention, only one of two modes may be used in multiple hypothesis prediction. The two modes may include a planar mode. The two modes may also include either a vertical mode or a horizontal mode depending on a condition. The condition may be a condition related to the block size. For example, the encoder / decoder may determine whether to include the horizontal mode or the vertical mode depending on which of the width and height of the block is larger. For example, if the width of the block is larger than the height, the vertical mode may be included. If the height of the block is larger than the width, the horizontal mode may be included. If the height and width of the block are equal, the promised mode of either the vertical mode or the horizontal mode may be included. In such a case, a flag may be signaled to indicate which mode to use in multiple hypothesis prediction.

[0230] According to one embodiment, the encoder / decoder can exclude a specific mode depending on the block size. For example, if the block size is small, the specific mode can be excluded. For example, if the block size is small, only the planar mode can be used in multiple hypothesis prediction. If a specific mode is excluded, mode signaling can be omitted or reduced.

[0231] According to another embodiment of the present invention, an encoder / decoder may use only one mode (i.e., intra prediction mode) to generate intra-predicted samples in multiple hypothesis prediction. In one embodiment, the one mode may be defined as a planar mode. As described above, multiple hypothesis prediction can use inter-predicted samples and intra-predicted samples. Determining an optimal prediction mode to generate intra-predicted samples while generating inter-predicted samples may improve prediction accuracy, but may result in increased encoding complexity and an increase in signaling bits. Therefore, by using only the planar mode, which is statistically most frequently occurring as the intra-prediction mode when performing multiple hypothesis prediction, encoding complexity can be improved, signaling bits can be saved, and video compression performance can be improved.

[0232] In yet another embodiment, the one mode may be determined as either a vertical mode or a horizontal mode based on the block size. For example, the one mode may be determined as either a vertical mode or a horizontal mode depending on which of the width and height of the block is larger. For example, if the width of the block is larger than the height, the vertical mode may be determined, and if the height of the block is larger than the width, the horizontal mode may be determined. If the width and height of the block are equal, the encoder / decoder may determine the previously set mode. If the width and height of the block are equal, the encoder / decoder may determine the previously set mode of either the horizontal mode or the vertical mode. If the width and height of the block are equal, the encoder / decoder may determine the previously set mode of either the planar mode or the DC mode.

[0233] Furthermore, according to an embodiment of the present invention, flipping signaling for flipping a prediction generated by multi-hypothesis prediction may be provided. This may have the effect of eliminating the residual on the opposite side even when one mode is selected in multi-hypothesis prediction by flipping. This may also have the effect of reducing the number of candidate modes available in multi-hypothesis prediction. More specifically, for example, flipping may be used when only one mode is used in the above embodiments. This may improve prediction performance. The flipping may refer to flipping along the x-axis, flipping along the y-axis, or flipping along both the x- and y-axes. In one embodiment, the flipping direction may be determined based on the mode selected in multi-hypothesis prediction. For example, if the mode selected in multi-hypothesis prediction is a planar mode, the encoder / decoder may determine to flip along both the x- and y-axes. Furthermore, flipping along both the x- and y-axes may depend on the block size or shape. For example, if the block is not square, the encoder / decoder may determine not to flip along both the x- and y-axes. For example, if the mode selected in multiple hypothesis prediction is horizontal mode, the encoder / decoder can determine that flipping is for the x-axis. For example, if the mode selected in multiple hypothesis prediction is vertical mode, the encoder / decoder can determine that flipping is for the y-axis. Also, if the mode selected in multiple hypothesis prediction is DC mode, the encoder / decoder can determine that there is no flipping and no explicit signaling / parsing is required.

[0234] Furthermore, in multiple hypothesis prediction, the DC mode may have an effect similar to illumination compensation. Therefore, according to an embodiment of the present invention, if one of the DC mode and the illumination compensation method is used in multiple hypothesis prediction, the other may not be used. Furthermore, multiple hypothesis prediction may have an effect similar to generalized bi-prediction (GBi). For example, in multiple hypothesis prediction, the DC mode may have an effect similar to GBi. GBi prediction may be a technique for adjusting a weight between two reference blocks in bidirectional prediction in block units or CU units. Therefore, according to an embodiment of the present invention, if one of the multiple hypothesis prediction (or the DC mode in multiple hypothesis prediction) and the GBi prediction method is used, the other may not be used. This may also include the case where the prediction in multiple hypothesis prediction is bidirectional. For example, if a selected merge candidate in multiple hypothesis prediction is bidirectional, GBi prediction may not be used. In these embodiments, the relationship between multiple hypothesis prediction and GBi prediction may be limited to the use of a specific mode of multiple hypothesis prediction, for example, the DC mode. Alternatively, if GBi prediction-related signaling exists before multiple hypothesis prediction-related signaling, using GBi prediction eliminates the need to use multiple hypothesis prediction or a specific mode of multiple hypothesis prediction. In the present invention, not using any method may mean not signaling for any of the methods and not parsing related syntax.

[0235] FIG. 33 is a diagram illustrating neighboring positions referenced in multiple hypothesis prediction according to an embodiment of the present invention. As described above, the encoder / decoder may reference neighboring positions in the process of generating a candidate list for multiple hypothesis prediction. For example, the above-described candIntraPredModeX may be used. In this case, the referenced positions A and B around the current block may be NbA and NbB as shown in FIG. 33. If the position of the upper left sample of the current block is Cb as shown in FIG. 29 and its coordinates are (xCb, yCb), NbA may be (xNbA, yNbA) = (xCb-1, yCb+cbHeight-1), and NbB may be (xNbB, yNbB) = (xCb+cbWidth-1, yCb-1). Here, cbWidth and cbHeight may be the width and height of the current block, respectively. In addition, the neighboring positions in the process of creating a candidate list for multiple hypothesis prediction may be the same as the neighboring positions referenced in generating an MPM list for intra prediction.

[0236] In yet another embodiment, the neighboring positions referenced in the process of generating a candidate list for multiple hypothesis prediction may be the left center position and the top center position of the current block or positions close to these. For example, NbA and NbB may be (xCb-1, yCb+cbHeight / 2-1) and (xCb+cbWidth / 2-1, yCb-1). Alternatively, NbA and NbB may be (xCb-1, yCb+cbHeight / 2) and (xCb+cbWidth / 2, yCb-1).

[0237] FIG. 34 is a diagram illustrating a method for referencing a neighboring mode according to an embodiment of the present invention. As described above, neighboring positions can be referenced in the process of creating a candidate list for multi-hypothesis prediction. In the embodiment of FIG. 30, if a neighboring position does not use multi-hypothesis prediction, candIntraPredModeX is set to the previously set mode. This is because when candIntraPredModeX is set, the mode of the neighboring position may not be directly set to candIntraPredModeX. Therefore, according to an embodiment of the present invention, even if a neighboring position does not use multi-hypothesis prediction, if the mode used by the neighboring position is a mode used for multi-hypothesis prediction, the encoder / decoder can set candIntraPredModeX to the mode used by the neighboring position. The mode used for multi-hypothesis prediction may be planar mode, DC mode, vertical mode, or horizontal mode.

[0238] Alternatively, even if the surrounding position does not use multiple hypothesis prediction, if the mode used by the surrounding position is a specific mode, the encoder / decoder can set candIntraPredModeX to the mode used by the surrounding position. Even if the surrounding position did not use multiple hypothesis prediction, if the mode used by the surrounding position is a vertical mode or a height mode, the encoder / decoder can set candIntraPredModeX to the mode used by the surrounding position. Even if the surrounding position does not use multiple hypothesis prediction, if the mode used by the surrounding position is a vertical mode, when the surrounding position is on the upper side of the current block, the encoder / decoder can set candIntraPredModeX to the mode used by the surrounding position. Also, even if the surrounding position does not use multiple hypothesis prediction, if the mode used by the surrounding position is a horizontal mode, when the surrounding position is on the left side of the current block, the encoder / decoder can set candIntraPredModeX to the mode used by the surrounding position.

[0239] Referring to Figure 34, mh_intra_flag may be a syntax element (or variable) indicating whether multiple hypothesis prediction is used (or has been used). In addition, the intra prediction mode used in the surrounding blocks may be horizontal mode. In addition, the current block can use multiple hypothesis prediction, and a candidate list can be generated using candIntraPredMode based on the mode of the surrounding blocks. Even if the surrounding blocks do not use multiple hypothesis prediction, the encoder / decoder can set candIntraPredMode to horizontal mode because the intra prediction mode of the surrounding blocks is a specific mode, for example, horizontal mode.

[0240] The above-described example of the surrounding mode reference method will be described again below in combination with another embodiment of Figure 30. According to one embodiment of the present invention, the intra prediction mode candIntraPredModeX (X is A or B) of the surrounding block can be derived in the following manner.

[0241] 1. An availability induction process for the block specified in the neighbor block availability confirmation process is called, and the availability induction process sets the position (xCurr, yCurr) to (xCb, yCb), and the neighbor position (xNbY, yNbY) can take (xNbX, yNbX) as input, and the output can be assigned to the availability variable availableX.

[0242] 2. The candidate intra prediction mode candIntraPredModeX may be derived in the following manner:

[0243] A. candIntraPredModeX may be set to INTRA_DC mode if one or more of the following conditions are true:

[0244] a) The variable availableX is FALSE.

[0245] b) When mh_intra_flag[xNbX][yNbX] is not 1 and IntraPredModeY[xNbX][yNbX] is not INTRA_ANGULAR50 and INTRA_ANGULAR18.

[0246] c) When X is B and yCb - 1 is less than ((yCb >> CtbLog2SizeY) << CtbLog2SizeY).

[0247] B. Otherwise, if IntraPredModeY[xNbX][yNbX] > INTRA_ANGULAR34, candIntraPredModeX may be set to INTRA_ANGULAR50.

[0248] C. Otherwise, if IntraPredModeY[xNbX][yNbX] <= INTRA_ANGULAR34 and IntraPredModeY[xNbX][yNbX] > INTRA_DC, candIntraPredModeX may be set to INTRA_ANGULAR18.

[0249] D. Otherwise, candIntraPredModeX may be set to IntraPredModeY[xNbX][yNbX].

[0250] According to another embodiment of the present invention, the intra prediction mode candIntraPredModeX of the peripheral block (X is A or B) can be derived in the following manner.

[0251] 1. The availability derivation process for the block specified in the adjacent block availability confirmation process is called. The availability derivation process may set the position (xCurr, yCurr) to (xCb, yCb), and the adjacent position (xNbY, yNbY) can take (xNbX, yNbX) as input, and the output may be assigned to the availability variable availableX.

[0252] 2. The candidate intra prediction mode candIntraPredModeX can be derived in the following way:

[0253] A. If one or more of the following conditions are true, candIntraPredModeX may be set to the INTRA_DC mode.

[0254] a) If the variable availableX is FALSE.

[0255] b) If mh_intra_flag[xNbX][yNbX] is not 1 and IntraPredModeY[xNbX][yNbX] is not INTRA_PLANAR, INTRA_DC, INTRA_ANGULAR50, and INTRA_ANGULAR18.

[0256] c) If X is B and yCb-1 is less than ((yCb>>CtbLog2SizeY)<<CtbLog2SizeY).

[0257] B. Otherwise, if IntraPredModeY[xNbX][yNbX]>INTRA_ANGULAR34, candIntraPredModeX may be set to INTRA_ANGULAR50.

[0258] C. Otherwise, if IntraPredModeY[xNbX][yNbX]<=INTRA_ANGULAR34 and IntraPredModeY[xNbX][yNbX]>INTRA_DC, candIntraPredModeX may be set to INTRA_ANGULAR18.

[0259] D. Otherwise, candIntraPredModeX may be set to IntraPredModeY[xNbX][yNbX].

[0260] In the above-mentioned list setting method, candIntraPredModeX may be determined by the surrounding mode reference method.

[0261] 35 is a diagram illustrating a method of using neighboring reference samples according to an embodiment of the present invention. As described above, when multiple hypothesis prediction is used, intra prediction can be used in combination with other predictions. Therefore, when multiple hypothesis prediction is used, intra prediction can be generated using samples surrounding the current block as reference samples. According to an embodiment of the present invention, when multiple hypothesis prediction is used, a mode using reconstructed samples can be used. Also, when multiple hypothesis prediction is not used, the mode using reconstructed samples does not need to be used. The reconstructed samples may be reconstructed samples surrounding the current block.

[0262] A template matching method can be used as an example of a mode using the reconstructed samples. That is, a reconstructed sample at a position previously set based on a certain block can be defined as a template (or a template region). The template matching may be an operation of comparing the cost of a template of a block to be compared with that of a current block to find a block with a smaller cost. In this case, the cost may be defined as the sum of absolute values ​​of templates, the sum of squared differences, etc. For example, an encoder / decoder can search for a block that is expected to be similar to the current block using template matching between the current block and a block of a reference picture, and can set a motion vector or refine the motion vector based on the search. Further, examples of the mode using the reconstructed samples include motion compensation using reconstructed samples and motion vector refinement.

[0263] In order to use reconstructed samples around the current block, decoding of the current block must wait for the completion of decoding of the neighboring blocks. In such a case, it may be difficult to process the current block and the neighboring blocks in parallel. Therefore, when multiple hypothesis prediction is not used, the encoder / decoder may not use a mode that uses reconstructed samples around the current block to enable parallel processing. Alternatively, when multiple hypothesis prediction is used, since intra prediction can be generated using reconstructed samples around the current block, the encoder / decoder may also use other modes that use reconstructed samples around the current block.

[0264] Furthermore, according to one embodiment of the present invention, even when multiple hypothesis prediction is used, whether or not reconstructed samples around the current block can be used may vary depending on the candidate index. In one embodiment, when the candidate index is smaller than a predetermined threshold, reconstructed samples around the current block can be used. When the candidate index is small, the number of candidate index signaling bits is small, and the accuracy of the candidate is high, and the accuracy can be further improved by using reconstructed samples for candidates with high coding efficiency. In another embodiment, when the candidate index is larger than a certain threshold, reconstructed samples around the current block can be used. When the candidate index is large, the number of candidate index signaling bits is large, and the accuracy of the candidate may be low. The accuracy can be enhanced by using reconstructed samples around the current block for candidates with low accuracy.

[0265] According to one embodiment of the present invention, when using multiple hypothesis prediction, an encoder / decoder may generate inter prediction using reconstructed samples around a current block, and generate a predicted block by combining the inter prediction with intra prediction of the multiple hypothesis prediction. Referring to Figure 35, mh_intra_flag, which is signaling indicating whether the current block uses multiple hypothesis prediction, has a value of 1. Since the current block uses multiple hypothesis prediction, a mode using reconstructed samples around the current block may be used.

[0266] 36 is a diagram illustrating transform modes according to an embodiment of the present invention. According to an embodiment of the present invention, a transform mode may exist in which a transform is applied only to a sub-part of a block. In this specification, such a transform mode in which a transform is applied only to a sub-part may be referred to as a sub-block transform (SBT) or a spatially varying transform (SVT). For example, a CU or PU may be divided into multiple TUs, and only some of the multiple TUs may be transformed. Alternatively, for example, only one of the multiple TUs may be transformed. TUs that are not transformed among the multiple TUs may be set to have a residual of 0.

[0267] Referring to FIG. 36 , there are two types of types for dividing one CU or PU into multiple TUs: SBT-V (SBT-vertical) and SBT-H (SBT-horizontal). SBT-V may be a type in which the height of multiple TUs is equal to the height of the CU or PU, and the width of multiple TUs is different from the width of the CU or PU. SBT-H may be a type in which the height of multiple TUs is different from the height of the CU or PU, and the width of multiple TUs is equal to the width of the CU or PU. As an example, the width and position of the TU to be transformed in SBT-V may be signaled. Also, the height and position of the TU to be transformed in SBT-H may be signaled. According to an example, a transformation kernel according to the SBT type, position, and width or height may be set in advance.

[0268] The reason for the existence of a mode in which only a portion of a CU or PU is transformed is that the residual may mainly exist in a portion of a CU or PU after prediction. That is, SBT has the same concept as the skip mode for a TU. In this case, the existing skip mode may be the skip mode for a CU.

[0269] Referring to FIG. 36, for each type of SBT-V ((a) and (b) in FIG. 36) and SBT-H ((c) and (d) in FIG. 36), a transform position indicated by A may be defined. The width or height may be defined as 1 / 2 or 1 / 4 of the CU width or CU height. In addition, the residual in the area other than the area indicated by A may be considered to be 0. In addition, conditions under which SBT can be used may be defined. For example, the conditions under which SBT is possible may be signaled as to whether it is usable or not in conditions related to the block size or in syntax at a higher level (e.g., sequence, slice, tile, etc.).

[0270] According to an embodiment of the present invention, there may be a correlation between the multi-hypothesis prediction and the transform mode. For example, whether or not one of the modes is used may determine whether or not the other mode is used. Alternatively, whether or not one mode is used may determine whether or not the other mode is used. Alternatively, whether or not one mode is used may determine whether or not the other mode is used. In one embodiment, the transform mode may be SBT as described in FIG. 36. That is, whether or not SBT is used may determine whether or not multi-hypothesis prediction is used. Alternatively, whether or not SBT is used may determine whether or not multi-hypothesis prediction is used. Table 6 below shows a syntax structure illustrating an example of a relationship between the multi-hypothesis prediction and the transform mode according to an embodiment of the present invention.

[0271] [Table 6]

[0272] Referring to Table 6, whether SBT is used may be determined depending on whether multiple hypothesis prediction is used. That is, if multiple hypothesis prediction is not applied to the current block (!mh_intra_flag is true), the decoder can parse cu_sbt_flag, which is a syntax element indicating whether SBT is applied. If multiple hypothesis prediction is not applied to the current block, it is not necessary to parse cu_sbt_flag. In this case, the value of cu_sbt_flag may be inferred to be 0 according to a predefined condition.

[0273] As described above, SBT continues to improve compression performance when residuals exist only in a portion of a block after prediction for the processing block. On the other hand, in the case of multiple hypothesis prediction, inter prediction is used to effectively reflect the movement of an object, and intra prediction can be used to efficiently predict the remaining area, thereby improving prediction performance for the entire block. That is, when multiple hypothesis prediction is applied, prediction performance for the entire block is improved, and the phenomenon of residuals being concentrated only in a portion of the block is relatively less likely to occur. Therefore, according to one embodiment of the present invention, an encoder / decoder may not apply SBT when multiple hypothesis prediction is applied. Alternatively, an encoder / decoder may not apply multiple hypothesis prediction when SBT is applied.

[0274] According to one embodiment of the present invention, the position of a TU transformed by an SBT may be restricted depending on whether or not multiple hypothesis prediction is used or the mode of multiple hypothesis prediction. Alternatively, the width (SBT-V) or height (SBT-H) of a TU transformed by an SBT may be restricted depending on whether or not multiple hypothesis prediction is used or the mode of multiple hypothesis prediction. This can reduce signaling related to the position, width, or height. For example, the position of a TU transformed by an SBT does not need to be in an area with a high intra-prediction weight in multiple hypothesis prediction. This is because the residual in an area with a high weight can be reduced by multiple hypothesis prediction.

[0275] Therefore, when multiple hypothesis prediction is used, a mode that transforms the side with a larger weighting value in SBT may not be necessary. For example, when a horizontal mode or a vertical mode is used in multiple hypothesis prediction, the SBT types (b) and (d) in FIG. 36 may be omitted (i.e., may not be considered). As another example, when a planar mode is used in multiple hypothesis prediction, the position of the TU transformed by the SBT may be restricted. For example, when a planar mode is used in multiple hypothesis prediction, the SBT types (a) and (c) in FIG. 36 may be omitted. This is because, when a planar mode is used in multiple hypothesis prediction, a region adjacent to a reference sample for intra prediction may have a value similar to the reference sample value, and therefore, the residual in the region adjacent to the reference sample may be relatively small.

[0276] In another embodiment, when multiple hypothesis prediction is used, the possible width or height values ​​of the TU to be converted by SBT may change. Alternatively, when a specific mode is used in multiple hypothesis prediction, the possible width or height values ​​of the TU to be converted by SBT may change. For example, when multiple hypothesis prediction is used, large values ​​of the width or height of the TU to be converted by SBT may be excluded because a large amount of residual does not remain in a wide portion of a block. Alternatively, when multiple hypothesis prediction is used, the width or height values ​​of the TU to be converted by SBT may be excluded, such as units in which weight values ​​change in multiple hypothesis prediction.

[0277] Referring to Table 6, cu_sbt_flag indicating whether SBT is used and mh_intra_flag indicating whether multiple hypothesis prediction is used may be present. If mh_intra_flag is 0, cu_sbt_flag can be parsed. Also, if cu_sbt_flag is not present, it may be inferred as 0. Both combining intra prediction with multiple hypothesis prediction and SBT can be used to solve the problem of large residuals remaining in only a portion of a CU or PU when the corresponding technology is not used. Therefore, since both technologies may be related to each other, it is possible to determine whether one technology is used or whether a specific mode of one technology is used based on the other technology.

[0278] Also, in Table 6, sbtBlockConditions may indicate conditions under which SBT is possible. The conditions under which SBT is possible may include conditions related to block size, signaling values ​​regarding whether or not it is available at a higher level (e.g., sequence, slice, tile, etc.), etc.

[0279] FIG. 37 illustrates the relationship between chrominance components according to an embodiment of the present invention. Referring to FIG. 37, a color format may be expressed as chroma_format_idc, Chroma format, separate_colour_plane_flag, etc. If monochrome is used, only one sample array may exist. SubWidthC and SubHeightC may both be 1. If 4:2:0 sampling is used, two chrominance arrays (or chrominance components, chrominance blocks) may exist. The chrominance array may have half the width and half the height of the luma array (or luma component, luminance block). SubWidthC and SubHeightC may both be 2. SubWidthC and SubHeightC may indicate the size of the chrominance array compared to the luma array, where if the width or height of the chrominance array is half the size of the luma array, SubWidthC or SubHeightC may be 2, and if the width or height of the chrominance array is the same size as the luma array, SubWidthC or SubHeightC may be 1.

[0280] If the sampling is 4:2:2, there may be two chrominance arrays. The chrominance arrays may be half the width and the same height as the luma array. SubWidthC and SubHeightC may be 2 and 1, respectively. If the sampling is 4:4:4, the chrominance arrays may be the same width and height as the luma array. SubWidthC and SubHeightC may both be 1. In this case, they may be processed separately based on separate_colour_plane_flag. If separate_colour_plane_flag is 0, the chrominance arrays may have the same width and height as the luma array. If separate_colour_plane_flag is 1, the three color planes (luma, Cb, Cr) may be processed separately. Regardless of separate_colour_plane_flag, if the sampling is 4:4:4, SubWidthC and SubHeightC may both be 1.

[0281] If separate_colour_plane_flag is 1, one slice may only have a component corresponding to one color component. If separate_colour_plane_flag is 0, one slice may have a component corresponding to multiple color components. Referring to FIG. 38, SubWidthC and SubHeightC can be different only in the case of 4:2:2. Therefore, in the case of 4:2:2, the relationship between the luminance-based width and height and the relationship between the chrominance-based width and height may be different.

[0282] For example, if the reference width of the luminance samples is widthL and the reference width of the chrominance samples is widthC, and widthL and widthC correspond to each other, the relationship is expressed by the following Equation 6.

[0283]

number

[0284] Similarly, if the reference height of the luminance sample is heightL and the reference height of the chrominance sample is heightC, and heightL and heightC correspond to each other, the relationship is as shown in Equation 7 below.

[0285]

number

[0286] There may also be a value that indicates a color component. For example, cIdx may indicate a color component. For example, cIdx may be a color component index. If cIdx is 0, it may indicate a luminance component. If cIdx is not 0, it may indicate a chrominance component. If cIdx is 1, it may indicate a chrominance Cb component. If cIdx is 2, it may indicate a chrominance Cr component.

[0287] FIG. 38 illustrates the relationship between color components according to an embodiment of the present invention. (a), (b), and (c) of FIG. 38 assume the cases of 4:2:0, 4:2:2, and 4:4:4, respectively. Referring to FIG. 38(a), one chrominance sample (one Cb, one Cr) may be located for every two luma samples in the horizontal direction. Also, one chrominance sample (one Cb, one Cr) may be located for every two luma samples in the vertical direction. Referring to FIG. 38(b), one chrominance sample (one Cb, one Cr) may be located for every two luma samples in the horizontal direction. Also, one chrominance sample (one Cb, one Cr) may be located for every luma sample in the vertical direction. Referring to FIG. 38(c), one chrominance sample (one Cb, one Cr) may be located for every luma sample in the horizontal direction. Also, one chrominance sample (one Cb and one Cr) may be located for each luma sample in the vertical direction.

[0288] As described above, SubWidthC and SubHeightC described in Fig. 37 may be determined based on such a relationship. Then, conversion between the luminance sample standard and the chrominance sample standard can be performed based on SubWidthC and SubHeightC.

[0289] FIG. 39 is a diagram illustrating a peripheral reference position according to an embodiment of the present invention. According to an embodiment of the present invention, an encoder / decoder may refer to a peripheral position during prediction. For example, as described above, the encoder / decoder may refer to a peripheral position when performing combined inter-picture merge and intra-picture prediction (CIIP). CIIP may be the above-described multiple hypothesis prediction. That is, CIIP may be a prediction method that combines inter prediction (e.g., merge mode inter prediction) and intra prediction. According to an embodiment of the present invention, the encoder / decoder may combine inter prediction and intra prediction by referring to a peripheral position. For example, the encoder / decoder may determine a ratio of inter prediction to intra prediction by referring to a peripheral position. Alternatively, the encoder / decoder may determine a weighting when combining inter prediction and intra prediction by referring to a peripheral position. Alternatively, the encoder / decoder may determine a weighting when performing a weighted sum (or weighted average) of inter prediction and intra prediction by referring to a peripheral position.

[0290] According to an embodiment of the present invention, the referenced neighboring positions may include NbA and NbB. The coordinates of NbA and NbB may be (xNbA, yNbA) and (xNbB, yNbB), respectively. NbA may be the left position of the current block. Specifically, if the top-left coordinate of the current block is (xCb, yCb) and the width and height of the current block are cbWidth and cbHeight, respectively, NbA may be (xCb-1, yCb+cbHeight-1). The top-left coordinate (xCb, yCb) of the current block may be a value based on the luma sample. Alternatively, the top-left coordinate (xCb, yCb) of the current block may be the position of the top-left luma sample of the current luma coding block relative to the top-left luma sample of the current picture. Furthermore, the cbWidth and cbHeight may indicate width and height based on the corresponding color component, respectively. The coordinates described above may be relative to a luma component (or a luma block). For example, the cbWidth and cbHeight may indicate width and height based on the luma component.

[0291] Also, NbB may be the upper position of the current block. More specifically, if the top-left coordinate of the current block is (xCb, yCb) and the width and height of the current block are cbWidth and cbHeight, respectively, NbB may be (xCb+cbWidth-1, yCb-1). The top-left coordinate (xCb, yCb) of the current block may be a value based on a luma sample. Alternatively, the top-left coordinate (xCb, yCb) of the current block may be the position of the top-left luma sample of the current luma coding block relative to the top-left luma sample of the current picture. Also, cbWidth and cbHeight may be values ​​based on the corresponding color component. The above coordinates may be for the luma component (luma block). For example, cbWidth and cbHeight may be values ​​based on the luma component.

[0292] Referring to FIG. 39, the top left corner, coordinates of NbA, and coordinates of NbB for a luminance block are illustrated. NbA may be the left position of the current block. More specifically, if the top left coordinate of the current block is (xCb, yCb) and the width and height of the current block are cbWidth and cbHeight, respectively, NbA may be (xCb-1, yCb+2*cbHeight-1). The top left coordinate (xCb, yCb) of the current block may be a value based on the luminance sample. Alternatively, the top left coordinate (xCb, yCb) of the current block may be the position of the top left luminance sample of the current luminance coding block relative to the top left luminance sample of the current picture. The cbWidth and cbHeight may be values ​​based on the corresponding color component. The above coordinates may be for a chrominance component (chrominance block). For example, cbWidth and cbHeight may be values ​​based on the chrominance components, and these coordinates may be in the 4:2:0 format.

[0293] Also, NbB may be the upper position of the current block. More specifically, if the top left coordinate of the current block is (xCb, yCb) and the width and height of the current block are cbWidth and cbHeight, respectively, NbB may be (xCb+2*cbWidth-1, yCb-1). The top left coordinate (xCb, yCb) of the current block may be a value based on a luma sample. Alternatively, the top left coordinate (xCb, yCb) of the current block may be the position of the top left luma sample of the current luma coding block relative to the top left luma sample of the current picture. Also, cbWidth and cbHeight may be values ​​based on the corresponding color component. The above coordinates may be for a chroma component (chroma block). For example, cbWidth and cbHeight may be values ​​based on a chroma component. Also, this coordinate may be in a 4:2:0 format or a 4:2:2 format. Referring to Figure 39, the top left corner, coordinates of NbA, coordinates of NbB, etc. for a chrominance block are illustrated.

[0294] Figure 40 illustrates a weighted sample prediction process according to an embodiment of the present invention. The embodiment of Figure 40 describes a method for combining two or more prediction signals. The embodiment of Figure 40 can be applied when CIIP is used. The embodiment of Figure 40 can also include the peripheral location reference method described in Figure 39. Referring to Figure 44, a variable scalFact indicating a scaling factor can be expressed as follows:

[0295]

number

[0296] In Mathematical Formula 8, when cIdx is 0, the encoder / decoder can set scallFact to 0, and when cIdx is not 0, the encoder / decoder can set scallFact to 1. In an embodiment of the present invention, x?y:z may indicate a y value when x is true or x is not 0, and may indicate a z value otherwise (when x is false (or when x is 0)).

[0297] Also, the encoder / decoder can set the coordinates (xNbA, yNbA) and (xNbB, yNbB) of the peripheral positions NbA and NbB referred to in multiple hypothesis prediction. According to the embodiment described in FIG. 39, for the luminance component, (xNbA, yNbA) and (xNbB, yNbB) may be (xCb - 1, yCb + cbHeight - 1) and (xCb + cbWidth - 1, yCb - 1) respectively, and for the color difference component, (xNbA, yNbA) and (xNbB, yNbB) may be set to (xCb - 1, yCb + 2*cbHeight - 1) and (xCb + 2*cbWidth - 1, yCb - 1) respectively. Also, the operation of multiplying by 2^n may be the same as the operation of left-shifting n bits. For example, the operation of multiplying by 2 may be calculated as the value of left-shifting 1 bit. Also, left-shifting x by n bits can be expressed as "x << n". Also, the operation of dividing by 2^n may be the same as the operation of right-shifting n bits. Also, the operation of dividing by 2^n and discarding the fraction part may be calculated as the value of right-shifting n bits. For example, the operation of dividing by 2 may be calculated as the value of right-shifting 1 bit. Also, right-shifting x by n bits can be expressed as "x >> n". Therefore, (xCb - 1, yCb + 2*cbHeight - 1) and (xCb + 2*cbWidth - 1, yCb - 1) can be expressed as (xCb - 1, yCb + (cbHeight << 1) - 1) and (xCb + (cbWidth << 1) - 1, yCb - 1). Therefore, when representing both the coordinates for the luminance component and the coordinates for the color difference component described above, it is as shown in the following Mathematical Formula 9.

[0298]

number

[0299] In Equation 9, scalarFact may be determined as (cIdx == 0) ≠ 0:1, as described above. Here, cbWidth and cbHeight represent the width and height, respectively, based on each color component. For example, if the width and height based on the luma component are cbWidthL and cbHeightL, respectively, and a weighted sample prediction process is performed on the luma component, cbWidth and cbHeight may be cbWidthL and cbHeightL, respectively. Furthermore, if the width and height based on the luma component are cbWidthL and cbHeightL, respectively, and a weighted sample prediction process is performed on the chroma component, cbWidth and cbHeight may be cbWidthL / SubWidthC and cbHeightL / SubHeightC, respectively.

[0300] According to an embodiment of the present invention, an encoder / decoder may determine a prediction mode for a corresponding position by referring to neighboring positions. For example, the encoder / decoder may determine whether the prediction mode is intra prediction. The prediction mode may be indicated by CuPredMode. When CuPredMode is MODE_INTRA, intra prediction may be used. The CuPredMode value may be MODE_INTRA, MODE_INTER, MODE_IBC, or MODE_PLT. When CuPredMode is MODE_INTER, inter prediction may be used. When CuPredMode is MODE_IBC, intra block copy (IBC) may be used. When CuPredMode is MODE_PLT, palette mode may be used. CuPredMode may be represented by a channel type (chType) and a position. For example, it may be represented as CuPredMode[chType][x][y], where this value may be a CuPredMode value for the channel type chType at the (x, y) position.

[0301] Also, according to an embodiment of the present invention, chType may be based on a tree type. For example, the tree type may be set to values ​​such as SINGLE_TREE, DUAL_TREE_LUMA, DUAL_TREE_CHROMA, etc. In the case of SINGLE_TREE, the block partitioning of the luma component and the chroma component may be shared to some extent. For example, in the case of SINGLE_TREE, the block partitioning of the luma component and the chroma component may be identical. Alternatively, in the case of SINGLE_TREE, the block partitioning of the luma component and the chroma component may be identical or partially identical. Alternatively, in the case of SINGLE_TREE, the block partitioning of the luma component and the chroma component may be performed using the same syntax element value.

[0302] According to an embodiment of the present invention, in the case of a dual tree, block partitioning of the luma component and the chroma component may be independent. Alternatively, in the case of a dual tree, block partitioning of the luma component and the chroma component may be performed using different syntax element values. In the case of a dual tree, the tree type value may be DUAL_TREE_LUMA or DUAL_TREE_CHROMA. If the tree type is DUAL_TREE_LUMA, DUAL TREE may be used to indicate a process for the luma component. If the tree type is DUAL_TREE_CHROMA, DUAL TREE may be used to indicate a process for the chroma component. In addition, chType may be determined based on whether the tree type is DUAL_TREE_CHROMA. For example, chType may be set to 1 if the tree type is DUAL_TREE_CHROMA, and may be set to 0 if the tree type is not DUAL_TREE_CHROMA. Therefore, referring to Figure 40, the CuPredMode[0][xNbX][yNbY] value can be determined. X can be substituted for A and B. That is, the CuPredMode value for the NbA and NbB positions can be determined.

[0303] Furthermore, according to one embodiment of the present invention, the isIntraCodedNeighbourX value may be set based on the determined prediction mode for the surrounding position. For example, the isIntraCodedNeighbourX value may be set depending on whether the CuPredMode for the surrounding position is MODE_INTRA. If the CuPredMode for the surrounding position is MODE_INTRA, the isIntraCodedNeighbourX value may be set to TRUE, and if the CuPredMode for the surrounding position is not MODE_INTRA, the isIntraCodedNeighbourX value may be set to FALSE. In the present invention described above and below, X may be replaced with A or B, etc. Also, X may indicate that the position corresponds to X.

[0304] According to an embodiment of the present invention, whether a location is available can be determined by referring to neighboring locations. Whether a location is available can be set by availableX. Furthermore, isIntraCodedNeighbourX can be set based on availableX. For example, if availableX is TRUE, isIntraCodedNeighbourX can be set to TRUE, and if availableX is FALSE, isIntraCodedNeighbourX can be set to FALSE. Referring to FIG. 40, whether a location is available can be determined by calling "the derivation process for neighboring block availability." Furthermore, whether a location is available can be determined based on whether the location is inside the current picture. If the location is (xNbY, yNbY) and xNbY or yNbY is less than 0, the location is outside the current picture, and availableX can be set to FALSE. Furthermore, if xNbY is equal to or greater than the picture width, it is a picture that is outside the current picture, and availableX may be set to FALSE. The picture width can be indicated by pic_width_in_luma_samples. Furthermore, if yNbY is equal to or greater than the picture height, it is a picture that is outside the current picture, and availableX may be set to FALSE. The picture height can be indicated by pic_height_in_luma_samples. Furthermore, if the position is in a different block or slice from the current block, availableX may be set to FALSE. Furthermore, if reconstruction of the position is not complete, availableX may be set to FALSE. Whether reconstruction is complete or not can be indicated by IsAvailable[cIdx][xNbY][yNbY]. In short, if any one of the following conditions is met, availableX may be set to FALSE; otherwise (if none of the following conditions are met), availableX may be set to TRUE.

[0305] - Condition 1: xNbY<0

[0306] - Condition 2: yNbY<0

[0307] - Condition 3: xNbY>=pic_width_in_luma_samples

[0308] - Condition 4:yNbY>=pic_height_in_luma_samples

[0309] - Condition 5: IsAvailable[cIdx][xNbY][yNbY]==FALSE

[0310] Condition 6: The position (peripheral position (xNbY, yNbY)) belongs to a block (or a slice) different from the current block.

[0311] Furthermore, according to one embodiment of the present invention, it is possible to determine whether the current location and the target location are in the same CuPredMode by using an option and set availableX. The two conditions described above can be combined to set isIntraCodedNeighbourX. For example, if all of the following conditions are met, isIntraCodedNeighbourX can be set to TRUE, and if not (if at least one of the following conditions is not met), isIntraCodedNeighbourX can be set to FALSE.

[0312] - Condition 1: availableX==TRUE

[0313] - Condition 2: CuPredMode[0][xNbX][yNbX]==MODE_INTRA

[0314] According to an embodiment of the present invention, a weight value of CIIP may be determined based on a plurality of isIntraCodedNeighbourXs. For example, when inter prediction and intra prediction are combined, a weight value may be determined based on a plurality of isIntraCodedNeighbourXs. For example, a weight value may be determined based on isIntraCodedNeighbourA and isIntraCodedNeighbourB. According to an embodiment, if both isIntraCodedNeighbourA and isIntraCodedNeighbourB are TRUE, w may be set to 3. For example, w may be a value that determines the weight value of CIIP or a weight value. Also, if both isIntraCodedNeighbourA and isIntraCodedNeighbourB are FALSE, w may be set to 1. Also, if one of isIntraCodedNeighbourA and isIntraCodedNeighbourB is FALSE (which is the same as if one of them is TRUE), w may be set to 2. That is, w can be set based on whether or not the surrounding positions are predicted by intra prediction, or based on how much the surrounding positions are predicted by intra prediction.

[0315] Furthermore, according to an embodiment of the present invention, w may be a weighting value corresponding to intra prediction. Furthermore, a weighting value corresponding to inter prediction may be determined based on w. For example, a weighting value corresponding to inter prediction may be (4-w). When combining two or more prediction signals, the encoder / decoder may use the following Equation 10.

[0316]

number

[0317] In Equation 10, predSamplesIntra and predSamplesInter may be prediction signals. For example, predSamplesIntra and predSamplesInter may be prediction signals predicted by intra prediction and inter prediction (e.g., merge mode, more specifically, regular merge mode), respectively. Furthermore, predSampleComb may be a prediction signal used in CIIP.

[0318] Furthermore, according to an embodiment of the present invention, a process of updating prediction signals before combining may be included prior to applying Equation 10. For example, the following Equation 11 may be applied to the updating process. For example, the process of updating prediction signals may be a process of updating an inter-prediction signal of CIIP.

[0319]

number

[0320] FIG. 41 is a diagram showing peripheral reference positions according to one embodiment of the present invention.

[0321] Although the peripheral reference positions have been described in FIGS. 39 and 40, problems may arise if the described positions are used in all cases (e.g., all chrominance blocks), and this problem is illustrated in FIG. 41. The example in FIG. 41 illustrates a chrominance block. In FIGS. 39 and 40, the NbA and NbB coordinates of the chrominance block relative to the luma samples are (xCb-1, yCb+2*cbHeight-1) and (xCb+2*cbWidth-1, yCb-1), respectively. However, if SubWidthC or SubHeightC is 1, the position shown in FIG. 41 may differ from the position shown in FIG. 39. In the above coordinates, multiplying cbWidth and cbHeight by 2 may be used to compensate for the number of luma samples versus chrominance samples, since cbWidth and cbHeight are based on each color component (in this example, the chrominance components) and the coordinates are based on luma. This may be used to compensate for the number of luma samples versus chrominance samples in a 4:2:0 format. That is, the coordinates may be used to represent, on a luminance basis, the coordinates of one chrominance sample corresponding to two luminance samples on the x-axis and one chrominance sample corresponding to two luminance samples on the y-axis. Therefore, if SubWidthC or SubHeightC is 1, different positions may be indicated. Therefore, if the (xCb-1, yCb+2*cbHeight-1) or (xCb+2*cbWidth-1, yCb-1) positions are always used for the chrominance blocks, a position far from the current chrominance block may be referenced. In this case, the relative position used for the luminance block of the current block may not match the relative position used for the chrominance block. Furthermore, because different positions are referenced for the chrominance blocks, weights may be set by referring to positions that are less related to the current block, or decoding / reconstruction may not be performed in the block decoding order.

[0322] 41 shows the positions of the above-mentioned luminance reference coordinates in the case of 4:4:4, that is, when SubWidthC and SubHeightC are both 1. NbA and NbB are located away from the chrominance blocks indicated by solid lines.

[0323] FIG. 42 is a diagram illustrating a weighted sample prediction process according to an embodiment of the present invention. The embodiment of FIG. 42 may be an embodiment for solving the problems described in FIGS. 39 to 41. Furthermore, descriptions of content that overlaps with the above content will be omitted. In FIG. 40, peripheral positions are set based on scallFact. As described in FIG. 41, scallFact is a value for converting positions when SubWidthC and SubHeightC are 2. However, as described above, problems may occur depending on the color format, and the ratio of chrominance samples to luma samples may differ between the horizontal and vertical directions. Therefore, according to an embodiment of the present invention, scallFact can be separated into horizontal (width) and vertical (height) directions.

[0324] According to an embodiment of the present invention, scallFactWidth and scallFactHeight may exist, and the peripheral position may be set based on scallFactWidth and scallFactHeight. The peripheral position may be set based on luma samples (luma blocks). scallFactWidth may be set based on cIdx and SubWidthC. For example, if cIdx is 0 or SubWidthC is 1, scallFactWidth may be set to 0; otherwise (if cIdx is not 0 and SubWidthC is not 1 (SubWidthC is 2)), scallFactWidth may be set to 1. In this case, scallFactWidth may be determined using the following Equation 12:

[0325]

number

[0326] Furthermore, scallFactHeight can be set based on cIdx and SubHeightC. For example, if cIdx is 0 or SubHeightC is 1, scallFactHeight can be set to 0, and otherwise (if cIdx is not 0 and SubHeightC is not 1 (SubHeightC is 2)), scallFactHeight can be set to 1. In this case, scallFactHeight can be determined using the following mathematical formula 13.

[0327]

number

[0328] Furthermore, the x-coordinate of the peripheral position can be indicated based on scallFactWidth, and the y-coordinate of the peripheral position can be indicated based on scallFactHeight. For example, the coordinate of NbB can be set based on scallFactWidth. For example, the coordinate of NbA can be set based on scallFactHeight. Also, as described above, the coordinate based on scallFactWidth can be set based on SubWidthC, and the coordinate based on scallFactHeight can be set based on SubHeightC. For example, the peripheral position coordinates are as shown in the following mathematical formula 14.

[0329]

number

[0330] In this case, xCb and yCb may be coordinates expressed based on the luminance sample, as described above, and cbWidth and cbHeight may be expressed based on each color component.

[0331] Therefore, if a block is a chrominance block and SubWidthC is 1, then (xNbB, yNbB) = (xCb+cbWidth-1, yCb-1). That is, in this case, the NbB coordinate for the luma block and the NbB coordinate for the chrominance block may be the same. Also, if a block is a chrominance block and SubHeightC is 1, then (xNbA, yNbA) = (xCb-1, yCb+cbHeight-1). That is, in this case, the NbA coordinate for the luma block and the NbA coordinate for the chrominance block may be the same.

[0332] Therefore, the embodiment of Figure 42 can set the same peripheral coordinates as the embodiments of Figures 39 and 40 when the format is 4:2:0, and can set different peripheral coordinates from the embodiments of Figures 39 and 40 when the format is 4:2:2 or 4:4:4.

[0333] The processes other than those shown in Figure 42 may be the same as those described in Figure 40. That is, the prediction mode or availability may be determined based on the peripheral position coordinates described in Figure 42, and the weight of the CIIP may be determined. In the present invention, the peripheral position and the coordinates of the peripheral position may be used interchangeably.

[0334] FIG. 43 is a diagram illustrating a weighted sample prediction process according to an embodiment of the present invention. The embodiment of FIG. 43 expresses the peripheral position coordinates described in FIG. 42 in a different manner. Therefore, overlapping content with that described above may be omitted. As described above, bit shifting can be expressed by multiplication. FIG. 42 may be shown using bit shifting, while FIG. 43 may be shown using multiplication.

[0335] According to one embodiment, scallFactWidth can be set based on cIdx and SubWidthC. For example, if cIdx is 0 or SubWidthC is 1, scallFactWidth can be set to 1, and otherwise (if cIdx is not 0 and SubWidthC is not 1 (SubWidthC is 2)), scallFactWidth can be set to 2. In this case, scallFactWidth can be determined using the following mathematical formula 15.

[0336]

number

[0337] Furthermore, scallFactHeight can be set based on cIdx and SubHeightC. For example, if cIdx is 0 or SubHeightC is 1, scallFactHeight can be set to 1, and if not (if cIdx is not 0 and SubHeightC is not 1 (if SubHeightC is 2)), scallFactHeight can be set to 2. In this case, scallFactHeight can be determined using the following mathematical formula 16.

[0338]

number

[0339] Furthermore, the x-coordinate of the peripheral position can be indicated based on scallFactWidth, and the y-coordinate of the peripheral position can be indicated based on scallFactHeight. For example, the coordinate of NbB can be set based on scallFactWidth. For example, the coordinate of NbA can be set based on scallFactHeight. Also, as described above, the value based on scallFactWidth can be set based on SubWidthC, and the value based on scallFactHeight can be set based on SubHeightC. For example, the peripheral position coordinates are as shown in the following mathematical formula 17.

[0340]

number

[0341] In this case, xCb and yCb may be coordinates expressed based on the luminance sample, as described above, and cbWidth and cbHeight may be expressed based on each color component.

[0342] FIG. 44 illustrates a weighted sample prediction process according to an embodiment of the present invention. In the embodiments of FIGS. 40, 42, and 43, the availability of a position is determined by referring to neighboring positions. At this time, cIdx, an index indicating a color component, is set to 0 (luminance component). When determining the availability of a position, cIdx can be used to determine whether reconstruction of the position cIdx is complete. That is, when determining the availability of a position, cIdx can be used to determine the IsAvailable[cIdx][xNbY][yNbY] value. However, when performing a weighted sample prediction process on a chrominance block, referring to the IsAvailable value corresponding to cIdx0 may result in an erroneous determination. For example, if the restoration of the luminance component of a block including a neighboring position is not completed but the restoration of the chrominance component is completed, if cIdx is not 0, IsAvailable[0][xNbY][yNbY] may be FALSE and IsAvailable[cIdx][xNbY][yNbY] may be TRUE. Therefore, a neighboring position may be determined to be unavailable even though it is actually available. To solve this problem, in the embodiment of FIG. 44, when determining whether a neighboring position is available by referring to the neighboring position, the cIdx of the current coding block may be used as input. That is, when calling "the derivation process for neighboring block availability," the input cIdx may be the cIdx of the current coding block. In this embodiment, descriptions that overlap with those described with reference to FIGS. 42 and 43 will be omitted.

[0343] In addition, when determining the prediction mode of the peripheral position described above, CuPredMode[0][xNbX][yNbY], which is CuPredMode corresponding to chType0, is referenced, but if the chType for the current block does not match, an incorrect parameter may be referenced. Therefore, according to one embodiment of the present invention, when determining the prediction mode of the peripheral position, CuPredMode[chType][xNbX][yNbY] corresponding to the chType value corresponding to the current block may be referenced.

[0344] 45 is a diagram illustrating a video signal processing method based on multiple hypothesis prediction according to an embodiment of the present invention. For convenience of explanation, the present invention will be described focusing on a decoder, but the present invention is not limited thereto, and the video signal processing method based on multiple hypothesis prediction according to this embodiment can be applied to an encoder in substantially the same manner.

[0345] Specifically, when a merge mode is applied to a current block, the decoder may obtain a first syntax element indicating whether combined prediction is applied to the current block (S4501). Here, the combined prediction refers to a prediction mode that combines inter prediction and intra prediction. As mentioned above, the present invention is not limited to such names, and in this specification, the multiple hypothesis prediction may be referred to as multiple prediction, multiple prediction, combined prediction, inter-intra weighted prediction, combined inter-intra prediction, combined inter-intra weighted prediction, etc. In one embodiment, prior to step S4501, the decoder may receive information for prediction of the current block and determine whether a merge mode is applied to the current block based on the information for prediction.

[0346] If the first syntax element indicates that the combined prediction is applied to the current block, the decoder may generate an inter-predicted block and an intra-predicted block of the current block (S4502).The decoder may then generate a combined prediction block by weighted summing the inter-predicted block and the intra-predicted block (S4503).The decoder may then decode a residual block of the current block and reconstruct the current block using the combined prediction block and the residual block.

[0347] As described above, in one embodiment, decoding the residual block may include obtaining a second syntax element indicating whether a sub-block transform is to be applied to the current block when the first syntax element indicates that the combined prediction is not applied to the current block. That is, a sub-block transform is applicable only when the combined prediction is not applied to the current block, and syntax signaling regarding whether to apply the sub-block transform may be performed. Here, the sub-block transform represents a transform mode for applying a transform to any one of the sub-blocks of the current block divided horizontally or vertically.

[0348] As mentioned above, in one embodiment, if the second syntax element is not present, the value of the second syntax element may be inferred to be 0.

[0349] As mentioned above, in one embodiment, if the first syntax element indicates that the combined prediction is applied to the current block, the intra prediction mode for intra prediction for the current block may be set to planar mode.

[0350] As described above, in one embodiment, the decoder may set the positions of the left and upper neighboring blocks referenced for the combined prediction and perform combined prediction based on the intra prediction mode of the set positions. In one embodiment, the decoder may determine weights to be used for combined prediction based on the intra prediction mode of the set positions. Also, as described above, the positions of the left and upper neighboring blocks may be determined using scaling factor variables determined by color component index values ​​of the current block.

[0351] The above-described embodiments of the present invention may be implemented in various ways, for example, in hardware, firmware, software, or a combination thereof.

[0352] In the case of a hardware implementation, the method according to an embodiment of the present invention may be implemented by one or more ASICs (Application Specific Integrated Circuits), DSPs (Digital Signal Processors), DSDPs (Digital Signal Processing Devices), PDLs (Programmable Logic Devices), FPGAs (Field Programmable Gate Arrays), processors, controllers, microcontrollers, microprocessors, etc.

[0353] In the case of implementation by firmware or software, the methods according to the embodiments of the present invention may be implemented in the form of modules, procedures, or functions that perform the functions or operations described above. The software code is stored in a memory and executed by a processor. The memory may be located inside or outside the processor and exchange data with the processor through various means known in the art.

[0354] Some embodiments may also be embodied in the form of a recording medium containing computer-executable instructions, such as program modules, executed by a computer. Computer-readable media are any available media that can be accessed by a computer, including both volatile and non-volatile media, and both detachable and non-detachable media. Computer-readable media also include both storage media and communication media. Computer storage media include both volatile and non-volatile media, and both detachable and non-detachable media embodied in any method or technology for storage of information, such as computer-readable instructions, data structures, program modules, or other data. Communication media typically include computer-readable instructions, data structures, or other data in a modulated data signal, such as a program module, or other transmission mechanism, and include any information delivery media.

[0355] The above description of the present invention is for illustrative purposes only, and those skilled in the art will understand that the present invention can be easily modified into other specific forms without changing the technical spirit or essential features of the present invention. Therefore, it should be understood that the above-described embodiments are illustrative in all respects and are not limiting. For example, each component described as a single component may be implemented in a distributed form, and components described as distributed may also be implemented in a combined form.

[0356] The scope of the present invention is indicated by the claims that follow rather than by the above detailed description, and all modifications and variations that fall within the meaning and scope of the claims and their equivalents should be interpreted as being included within the scope of the present invention. [Explanation of symbols]

[0357] 110 Conversion unit 115 Quantization section 120 Inverse quantization section 125 Inverse conversion unit 130 Filtering section 150 Prediction Department 152 Intra prediction unit 154 Inter Prediction Unit 154a Motion estimation unit 154b Motion Compensation Unit 160 Entropy Coding Unit 210 Entropy Decoding Unit 220 Inverse quantization section 225 Inverse conversion unit 230 Filtering Section 250 Prediction Department 252 Intra prediction unit 254 Inter Prediction Unit

Claims

1. A video signal decoding device, comprising: a processor; The processor: Obtain a value of a first syntax element indicating whether combined prediction is applied to the current block; When the first syntax element indicates that the combined prediction is not applied to the current block, a value of a second syntax element indicating whether a sub-block transform is applied to the current block is obtained; When the value of the first syntax element indicates that the combined prediction is applied to the current block, reconstructing the current block based on the combined prediction; When the value of the first syntax element indicates that the combined prediction is not applied to the current block and the value of the second syntax element indicates that the sub-block transform is applied to the current block, reconstructing the current block based on the sub-block transform; wherein, when the second syntax element is absent, the value of the second syntax element is inferred as a value indicating that the sub-block transform is not applied to the current block; The combined prediction is a prediction mode using a merge mode of intra prediction and inter prediction, The sub-block transform indicates a transform mode that applies a transform to a part of a sub-block of the current block divided horizontally or vertically. A video signal decoding device configured as follows.

2. A video signal decoding device as described in claim 1, wherein the first syntax element is parsed when the merge mode is applied to the current block.

3. When the value of the first syntax element indicates that the combined prediction is applied to the current block, the current block is reconstructed based on the combined prediction block of the current block; The combined predicted block of the current block is obtained by a weighted sum of an inter predicted block and an intra predicted block; The video signal decoding device of claim 2 , wherein the inter-predicted block is obtained by the merge mode of the inter-prediction of the current block, and the intra-predicted block is obtained by the intra-prediction of the current block.

4. A video signal decoding device as described in Claim 3, wherein the intra-prediction block is obtained based on a planar mode.

5. The adjacent positions referenced by the combined prediction are (xCb-1, yCb-1+cbHeight) and (xCb-1+cbWidth, yCb-1), 2. The video signal decoding apparatus of claim 1, wherein (xCb, yCb) is the coordinate of the top left corner of the current block, cbHeight is the height of the current block, and cbWidth is the width of the current block.

6. The video signal decoding device of claim 1, wherein the adjacent positions referenced by the combined prediction are determined using a scaling factor variable determined based on a color component index value of the current block.

7. A video signal processing method comprising: obtaining a value of a first syntax element indicating whether combined prediction is applied to a current block; obtaining a value of a second syntax element indicating whether a sub-block transform is to be applied to the current block when the first syntax element indicates that the combined prediction is not to be applied to the current block; When the value of the first syntax element indicates that the combined prediction is applied to the current block, reconstructing the current block based on the combined prediction; and When the value of the first syntax element indicates that the combined prediction is not applied to the current block and the value of the second syntax element indicates that the sub-block transform is applied to the current block, reconstructing the current block based on the sub-block transform. Including, When the second syntax element is not present, the value of the second syntax element is inferred as a value indicating that the sub-block transform is not applied to the current block; The combined prediction is a prediction mode using a merge mode of intra prediction and inter prediction, The sub-block transform indicates a transform mode that applies a transform to a part of a sub-block of the current block divided horizontally or vertically.

8. The video signal processing method of claim 7, wherein the first syntax element is parsed when the merge mode is applied to the current block.

9. When the value of the first syntax element indicates that the combined prediction is applied to the current block, the current block is reconstructed based on the combined prediction block of the current block; The combined predicted block of the current block is obtained by a weighted sum of an inter predicted block and an intra predicted block; The video signal processing method of claim 8 , wherein the inter-predicted block is obtained by the merge mode of the inter-prediction of the current block, and the intra-predicted block is obtained by the intra-prediction of the current block.

10. The video signal processing method of claim 9, wherein the intra-prediction block is obtained based on a planar mode.

11. The adjacent positions referenced by the combined prediction are (xCb-1, yCb-1+cbHeight) and (xCb-1+cbWidth, yCb-1), 8. The video signal processing method of claim 7, wherein (xCb, yCb) is the coordinates of the top left corner of the current block, cbHeight is the height of the current block, and cbWidth is the width of the current block.

12. The video signal processing method of claim 7, wherein the adjacent positions referenced by the combined prediction are determined using a scaling factor variable determined based on a color component index value of the current block.

13. A video signal encoding apparatus comprising: a processor; The processor: Determine whether combined prediction is applied to the current block; When the combined prediction is not applied to the current block, determining whether a sub-block transform is applied to the current block; obtaining a bitstream for reconstructing the current block; When the combined prediction is applied to the current block, the current block is reconstructed based on the combined prediction; When the combined prediction is not applied to the current block and the sub-block transform is applied to the current block, reconstructing the current block based on the sub-block transform; wherein, when a second syntax element indicating whether a sub-block transform is applied to the current block is not included in the bitstream, the sub-block transform is not applied to the current block; The combined prediction is a prediction mode using an intra prediction mode and an inter prediction merge mode, The sub-block transform indicates a transform mode that applies a transform to a part of a sub-block of the current block divided horizontally or vertically. A video signal encoding device configured as follows.

14. A video signal encoding device as described in Claim 13, wherein when the merge mode is applied to the current block, a first syntax element is included in the bitstream indicating whether the combined prediction is applied to the current block or not.

15. The method of claim 15, wherein when the combined prediction is applied to the current block, the current block is reconstructed based on the combined prediction block of the current block; The combined predicted block of the current block is obtained by a weighted sum of an inter predicted block and an intra predicted block; The video signal encoding device of claim 14 , wherein the inter-predicted block is obtained by the merge mode of the inter prediction of the current block, and the intra-predicted block is obtained by the intra prediction of the current block.

16. The video signal encoding device of claim 15, wherein the intra-prediction block is obtained based on a planar mode.

17. The method according to claim 17, wherein the adjacent positions referenced by the combined prediction are (xCb-1, yCb-1+cbHeight) and (xCb-1+cbWidth, yCb-1), 14. The video signal encoding device of claim 13, wherein (xCb, yCb) is the coordinate of the top left corner of the current block, cbHeight is the height of the current block, and cbWidth is the width of the current block.

18. The video signal encoding device of claim 13, wherein the adjacent positions referenced by the combined prediction are determined using a scaling factor variable determined based on a color component index value of the current block.

19. A method for obtaining a bitstream, comprising: determining whether combined prediction is applied to a current block; determining whether a sub-block transform is applied to the current block when the combined prediction is not applied to the current block; When the combined prediction is applied to the current block, reconstructing the current block based on the combined prediction; When the combined prediction is not applied to the current block and the sub-block transform is applied to the current block, reconstructing the current block based on the sub-block transform; and obtaining the bitstream for reconstructing the current block; Including, wherein, when a second syntax element indicating whether a sub-block transform is applied to the current block is not included in the bitstream, the sub-block transform is not applied to the current block; The combined prediction is a prediction mode using an intra prediction mode and an inter prediction merge mode, A method for obtaining a bitstream, wherein the sub-block transform indicates a transform mode that applies a transform to some of the sub-blocks of the current block that are divided horizontally or vertically.

20. A method for obtaining a bitstream as described in claim 19, wherein the bitstream includes a first syntax element indicating whether or not the combined prediction is applied to the current block when the merge mode is applied to the current block.

21. The method of claim 21, wherein when the combined prediction is applied to the current block, the current block is reconstructed based on the combined predicted block of the current block; The combined predicted block of the current block is obtained by a weighted sum of an inter predicted block and an intra predicted block; 21. The method for obtaining a bitstream according to claim 20, wherein the inter-predicted block is obtained by the merge mode of the inter prediction of the current block, and the intra-predicted block is obtained by the intra prediction of the current block.

22. A method for obtaining a bitstream as described in claim 21, wherein the intra-predicted blocks are obtained based on a planar mode.

23. The method according to claim 23, wherein the adjacent positions referenced by the combined prediction are (xCb-1, yCb-1+cbHeight) and (xCb-1+cbWidth, yCb-1), 20. The method for obtaining a bitstream of claim 19, wherein (xCb, yCb) is the top left coordinate of the current block, cbHeight is the height of the current block, and cbWidth is the width of the current block.

24. The method for obtaining a bitstream described in claim 19, wherein the adjacent positions referenced by the combined prediction are determined using a scaling factor variable determined based on a color component index value of the current block.