Method and device for processing video signal

The method and apparatus improve video signal processing efficiency by dividing blocks based on color component and transform unit conditions, enhancing coding and prediction mode selection.

JP2025170018APending Publication Date: 2025-11-14WILUS INSTITUTE OF STANDARDS & TECHNOLOGY INC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2025141511
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-12-19
Filing Date
2025-08-27
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing video signal processing methods lack efficiency in coding and do not effectively utilize transform unit division for improved prediction modes.

Method used

A method and apparatus that utilize quadratic transform to divide video signal blocks based on pre-set conditions, including color component, width, and maximum transform block size, to enhance coding efficiency and prediction mode selection.

Benefits of technology

Enhances coding efficiency and improves the selection of prediction modes in video signal processing, particularly through efficient transform unit division and color component-based conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025170018000001_ABST
    Figure 2025170018000001_ABST
Patent Text Reader

Abstract

To provide a method for processing a video signal using a secondary transform.SOLUTION: A video signal decoding device includes a processor. The processor is characterized by: determining a result value that indicates the direction for dividing a current transform block (TB) on the basis of preset conditions; dividing the current transform block into a plurality of transform blocks on the basis of the result value; and decoding a video signal by using the plurality of transform blocks; where the preset conditions include a condition pertaining to a color component of the current transform block.SELECTED DRAWING: Figure 46
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] An object of the present invention is to increase the coding efficiency of video signals.

[0004] The object of the present invention is to increase the coding efficiency of video signals using division into transform units (blocks).

[0005] An object of the present invention is to efficiently receive a prediction mode selected by an encoder in an intra prediction method. [Means for solving the problem]

[0006] This specification provides a method for processing a video signal using a quadratic transform.

[0007] Specifically, the video signal decoding device includes a processor, which determines a result value indicating a division direction of a current transform block (TB) based on a pre-set condition, divides the current transform block into a plurality of transform blocks based on the result value, and decodes a video signal using the plurality of transform blocks, wherein the pre-set condition includes a condition related to a color component of the current transform block.

[0008] In addition, in this specification, the pre-set conditions further include conditions related to the result of comparing the width of the current transform block with a maximum transform block width, and the maximum transform block width is determined based on a chroma format related to the current transform block, color components of the current transform block, and a maximum transform size.

[0009] In addition, in this specification, the pre-set conditions further include a condition related to a result of comparing a first width value, which is a value obtained by multiplying the width of the current transformation block by a first value, with a first height value, which is a value obtained by multiplying the height of the current transformation block by a second value, and the first value and the second value are values ​​related to the width and height of the current transformation block, respectively, and are set to 1 if the color component of the current transformation block is luma, and are determined based on a chroma format related to the current transformation block if the color component is chroma.

[0010] Further, in this specification, when the width of the current transform block is greater than the maximum transform block width and the first width value is greater than the first height value, the result value is determined to be 1, which is a value indicating that the division direction is vertical, and the width of each of the plurality of transform blocks is a value obtained by dividing the width of the transform block by 2, and the height of each of the plurality of transform blocks is the same value as the height of the transform block.

[0011] Further, in this specification, when the width of the current transform block is equal to or less than the maximum transform block width or the first width value is equal to or less than the first height value, the result value is determined to be 0, which is a value indicating that the division direction is horizontal, and the width of each of the plurality of transform blocks is the same value as the width of the transform block, and the height of each of the plurality of transform blocks is a value obtained by dividing the height of the transform block by 2.

[0012] In addition, in this specification, the maximum transform size is characterized in that it is determined based on the size of a coding tree block (CTB) having a luma component included in a coding tree unit (CTU) related to the current transform block.

[0013] In addition, in this specification, when the size of the coding tree block is 32, the maximum transform size is 32.

[0014] In addition, in this specification, the processor is characterized in that, if a color component of the current transform block is chroma, the processor parses a syntax element indicating whether a prediction method of a coding block related to the current transform block is BDPCM (Block-based Delta Pulse Code Modulation), and if the parsing result indicates that the prediction method of the coding block is not BDPCM, the processor further parses a syntax element related to the prediction method of the coding block and determines the prediction method of the coding block based on the parsing result, and the syntax element related to the prediction method of the coding block is a syntax element indicating at least one of CCLM (Cross Component Linear Model), planar mode, DC mode, vertical mode, horizontal mode, diagonal mode, and DM mode.

[0015] Also, in this specification, a video signal encoding device includes a processor, wherein the processor determines a result value indicating a division direction of a current transform block (TB) based on a pre-set condition, divides the current transform block into a plurality of transform blocks based on the result value, and generates a bitstream including information about the plurality of transform blocks, wherein the pre-set condition includes a condition related to a color component of the current transform block.

[0016] In addition, in this specification, the pre-set conditions further include conditions related to the result of comparing the width of the current transform block with a maximum transform block width, and the maximum transform block width is determined based on a chroma format related to the current transform block, color components of the current transform block, and a maximum transform size.

[0017] In addition, in this specification, the pre-set conditions further include a condition related to a result of comparing a first width value, which is a value obtained by multiplying the width of the current transformation block by a first value, with a first height value, which is a value obtained by multiplying the height of the current transformation block by a second value, and the first value and the second value are values ​​related to the width and height of the current transformation block, respectively, and are set to 1 if the color component of the current transformation block is luma, and are determined based on a chroma format related to the current transformation block if the color component is chroma.

[0018] Further, in this specification, when the width of the current transform block is greater than the maximum transform block width and the first width value is greater than the first height value, the result value is determined to be 1, which is a value indicating that the division direction is vertical, and the width of each of the plurality of transform blocks is a value obtained by dividing the width of the transform block by 2, and the height of each of the plurality of transform blocks is the same value as the height of the transform block.

[0019] Furthermore, in this specification, when the width of the transform block is equal to or less than the maximum transform block width or the first width value is equal to or less than the first height value, the result value is determined to be 0, which is a value indicating that the division direction is horizontal, and the width of each of the plurality of transform blocks is the same value as the width of the transform block, and the height of each of the plurality of transform blocks is a value obtained by dividing the height of the transform block by 2.

[0020] In addition, in this specification, the maximum transform size is characterized in that it is determined based on the size of a coding tree block (CTB) having a luma component included in a coding tree unit (CTU) related to the current transform block.

[0021] In addition, in this specification, when the size of the coding tree block is 32, the maximum transform size is 32.

[0022] In addition, in this specification, the processor is characterized in that, if a color component of the current transform block is chroma, the processor parses a syntax element indicating whether a prediction method of a coding block related to the current transform block is BDPCM (Block-based Delta Pulse Code Modulation), and if the parsing result indicates that the prediction method of the coding block is not BDPCM, the processor further parses a syntax element related to the prediction method of the coding block and determines the prediction method of the coding block based on the parsing result, and the syntax element related to the prediction method of the coding block is a syntax element indicating at least one of CCLM (Cross Component Linear Model), planar mode, DC mode, vertical mode, horizontal mode, diagonal mode, and DM mode.

[0023] Also, in this specification, in a non-transitory computer-readable medium that stores a bitstream, the bitstream is encoded by an encoding method including the steps of: determining a result value indicating a division direction of a current transform block (TB) based on a pre-set condition; dividing the current transform block into a plurality of transform blocks based on the result value; and encoding a bitstream including information about the plurality of transform blocks, wherein the pre-set condition includes a condition related to a color component of the current transform block.

[0024] In addition, in this specification, the pre-set conditions further include conditions related to the result of comparing the width of the current transform block with a maximum transform block width, and the maximum transform block width is determined based on a chroma format related to the current transform block, color components of the current transform block, and a maximum transform size.

[0025] In addition, in this specification, the pre-set conditions further include a condition related to a result of comparing a first width value, which is a value obtained by multiplying the width of the current block by a first value, with a first height value, which is a value obtained by multiplying the height of the current transformation block by a second value, and the first value and the second value are values ​​related to the width and height of the current transformation block, respectively, and are set to 1 if the color component of the current transformation block is luma, and are determined based on a chroma format related to the current transformation block if the color component is chroma.

[0026] In addition, in this specification, the maximum transform size is characterized in that it is determined based on the size of a coding tree block (CTB) having a luma component included in a coding tree unit (CTU) related to the current transform block. [Effects of the Invention]

[0027] One embodiment of the present invention provides a video signal processing method and apparatus using transform unit division.

[0028] An embodiment of the present invention provides a video signal processing method and apparatus for efficiently receiving a prediction mode selected by an encoder in an intra prediction method. [Brief explanation of the drawings]

[0029] [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 is a diagram illustrating an inter-prediction method according to an embodiment of the present invention. [Figure 8] 10 illustrates how a motion vector of a current block is signaled according to one embodiment of the present invention. [Figure 9]10 illustrates how motion vector difference values ​​of a current block are signaled according to one embodiment of the present invention. [Figure 10] FIG. 2 is a diagram illustrating a coding unit and a transform unit according to an embodiment of the present invention. [Figure 11] FIG. 2 illustrates a transform tree syntax according to an embodiment of the present invention.

[0030] [Figure 12] FIG. 10 is a diagram illustrating a decoding process for an intra block according to one embodiment of the present invention. [Figure 13] FIG. 10 illustrates a residual signal decoding process according to one embodiment of the present invention. [Figure 14] FIG. 2 is a diagram illustrating the relationship between color components according to an embodiment of the present invention. [Figure 15] FIG. 2 is a diagram illustrating the relationship between color components according to an embodiment of the present invention. [Figure 16] FIG. 10 is a diagram illustrating the maximum transform size according to one embodiment of the present invention.

[0031] [Figure 17] FIG. 2 illustrates a high-level syntax diagram for one embodiment of the present invention. [Figure 18] FIG. 2 illustrates a transform tree syntax according to an embodiment of the present invention. [Figure 19] FIG. 10 is a diagram illustrating TU division according to one embodiment of the present invention. [Figure 20] FIG. 10 is a diagram illustrating TU division according to one embodiment of the present invention. [Figure 21] FIG. 2 illustrates a decoding process according to one embodiment of the present invention. [Figure 22] FIG. 2 illustrates a decoding process according to one embodiment of the present invention. [Figure 23] FIG. 2 is a diagram illustrating a high-level syntax according to one embodiment of the present invention. [Figure 24] FIG. 2 is a diagram illustrating a high-level syntax according to one embodiment of the present invention. [Figure 25]FIG. 2 illustrates a transform tree syntax according to an embodiment of the present invention. [Figure 26] FIG. 2 illustrates a decoding process according to one embodiment of the present invention. [Figure 27] FIG. 1 illustrates a BDPCM execution method according to one embodiment of the present invention. [Figure 28] FIG. 10 is a diagram illustrating syntax related to BDPCM according to one embodiment of the present invention. [Figure 29] FIG. 10 is a diagram illustrating BDPCM enabling conditions according to one embodiment of the present invention. [Figure 30] FIG. 1 is a diagram illustrating CIIP and intra prediction according to an embodiment of the present invention. [Figure 31] FIG. 10 is a diagram illustrating merge data syntax according to one embodiment of the present invention. [Figure 32] FIG. 10 is a diagram illustrating merge data syntax according to one embodiment of the present invention. [Figure 33] FIG. 10 is a diagram illustrating a method for executing a CIIP mode according to one embodiment of the present invention. [Figure 34] FIG. 1 is a diagram illustrating a chroma BDPCM syntax structure according to one embodiment of the present invention. [Figure 35] FIG. 1 is a diagram illustrating a chroma BDPCM syntax structure according to one embodiment of the present invention. [Figure 36] FIG. 2 is a diagram illustrating a higher level syntax associated with BDPCM according to one embodiment of the present invention. [Figure 37] FIG. 10 is a diagram illustrating syntax elements signaled at a higher level for BDPCM according to one embodiment of the present invention. [Figure 38] FIG. 10 is a diagram illustrating syntax related to chroma BDPCM according to one embodiment of the present invention. [Figure 39] FIG. 10 is a diagram illustrating syntax related to intra prediction according to an embodiment of the present invention. [Figure 40] FIG. 1 illustrates syntax related to intra prediction according to an embodiment of the present invention. [Figure 41]A diagram showing a sequence parameter set syntax according to one embodiment of the present invention. [Figure 42] FIG. 2 is a diagram illustrating syntax elements related to sub-pictures according to one embodiment of the present invention. [Figure 43] FIG. 10 is a diagram illustrating an operator according to an embodiment of the present invention. [Figure 44] 1 is a diagram showing a picture and a sub-picture according to an embodiment of the present invention; [Figure 45] FIG. 2 is a diagram illustrating syntax elements related to sub-pictures according to one embodiment of the present invention. [Figure 46] 10 is a diagram illustrating a method for dividing a transform block according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

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

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

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

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

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

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

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

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

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

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

[0042] 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 may be transmitted in the Raw Byte Sequence Payload (RBSP) of higher level sets such as a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), a Video Parameter Set (VPS), and Decoding Capability Information (DCI).

[0043] 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).

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

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

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

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

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

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

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

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

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

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

[0054] 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).

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

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

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

[0058] The leaf nodes of a multi-type tree may be coding units. If a coding unit is not larger than the maximum transform length, the coding unit may be used as a unit of prediction and / or transformation without further division. In one embodiment, if the width or height of a current coding unit is larger than the maximum transform length, the current coding unit may be divided into multiple transform units without explicit signaling regarding division. Meanwhile, in the above-mentioned quad tree and multi-type tree, at least one of the following parameters is predefined or transmitted via the RBSP of a higher level set such as PPS, SPS, VPS, etc. 1) CTU size: The size of the root node of the quadtree, 2) Min QT size (MinQtSize): The size of the smallest QT leaf node allowed, 3) Max BT size (MaxBtSize): The size of the largest BT root node allowed, 4) Max TT size (MaxTtSize): The size of the largest TT root node allowed, 5) Max MTT depth (MaxMttDepth): The maximum allowed depth of MTT split from the QT leaf node, 6) Min BT size (MinBtSize): The size of the smallest BT leaf node allowed, 7) Min TT size: The size of the smallest TT leaf node allowed.

[0059] 4 illustrates an embodiment of a method for signaling the split of a quadtree or a multitype tree. To signal the split of the quadtree or multitype tree, a previously set flag may be used. Referring to FIG. 4, at least one of a flag 'split_cu_flag' indicating whether a node is split, a flag 'split_qt_flag' indicating whether a quadtree node is split, a flag 'mtt_split_cu_vertical_flag' indicating the split direction of a multitype tree node, or a flag 'mtt_split_cu_binary_flag' indicating the split type of a multitype tree node may be used.

[0060] According to an embodiment of the present invention, a flag 'split_cu_flag' indicating whether the current node is split may be signaled first. If the value of 'split_cu_flag' is 0, it indicates that the current node is not split, and the current node becomes a coding unit. If the current node is a coding tree unit, the coding tree unit contains one unsplit coding unit. If the current node is a quad tree node 'QT node', the current node is a leaf node 'QT leaf node' of the quad tree and becomes a coding unit. If the current node is a multitype tree node 'MTT node', the current node is a leaf node 'MTT leaf node' of the multitype tree and becomes a coding unit.

[0061] If the value of 'split_cu_flag' is 1, the current node may be split into quadtree or multitype tree nodes depending on the value of 'split_qt_flag'. A coding tree unit is the root node of a quadtree and may be first split into a quadtree structure. In the quadtree structure, 'split_qt_flag' is signaled for each node ('QT node'). If the value of 'split_qt_flag' is 1, the node is split into four square nodes. If the value of 'qt_split_flag' is 0, the node becomes a leaf node ('QT leaf node') of the quadtree and is split into a multitype node. According to an embodiment of the present invention, quadtree splitting may be restricted depending on the type of the current node. If the current node is a coding tree unit (root node of a quadtree) or a quadtree node, quadtree splitting may be allowed. However, if the current node is a multitype tree node, quadtree splitting may not be allowed. Each quadtree leaf node 'QT leaf node' may be further split into a multitype tree structure. As described above, if 'split_qt_flag' is 0, the current node may be split into multitype nodes. 'mtt_split_cu_vertical_flag' and 'mtt_split_cu_binary_flag' may be signaled to indicate the split direction and split type. If 'mtt_split_cu_vertical_flag' is 1, it indicates a vertical split of the node 'MTT node', and if 'mtt_split_cu_vertical_flag' is 0, it indicates a horizontal split of the node 'MTT node'. Also, if 'mtt_split_cu_binary_flag' is 1, the node 'MTT node' is split into two rectangular nodes, and if 'mtt_split_cu_binary_flag' is 0, it is split into three rectangular nodes.

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

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

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

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

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

[0067] Next, Figure 6 illustrates an embodiment of prediction modes used in 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.

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

[0069] Meanwhile, the preset angle range may be individually set according to the shape of the current block. For example, if the current block is a rectangular block, a wide angle mode indicating an angle greater than 45° or less than −135° in a clockwise direction may be additionally used. If the current block is a horizontal block, the angle mode may indicate an angle within an angle range of (45 + offset 1)° to (−135 + offset 1)° in a clockwise direction (i.e., a second angle range). In this case, angle modes 67 to 76 outside the first angle range may be additionally used. Also, if the current block is a vertical block, the angle mode may indicate an angle within an angle range of (45 − offset 2)° to (−135 − offset 2)° in a clockwise direction (i.e., a third angle range). In this case, angle modes −10 to −1 outside the first angle range may be additionally used. According to an embodiment of the present invention, the values ​​of offset 1 and offset 2 may be individually determined according to the ratio of the width to the height of the rectangular block. Additionally, offset 1 and offset 2 may be positive numbers.

[0070] According to a further embodiment of the present invention, the plurality of angle modes constituting the intra prediction mode set may include a base angle mode and an extended angle mode, wherein the extended angle mode may be determined based on the base angle mode.

[0071] According to one embodiment, the basic angle mode may be a mode corresponding to an angle used in intra prediction of the existing High Efficiency Video Coding (HEVC) standard, and the extended angle mode may be a mode corresponding to an angle newly added in intra prediction of the next-generation video codec standard. More specifically, the basic angle mode may be an angle mode corresponding to one of the intra prediction modes {2, 4, 6, ..., 66}, and the extended angle mode may be an angle mode corresponding to one of the intra prediction modes {3, 5, 7, ..., 65}. That is, the extended angle mode may be an angle mode between the basic angle modes within a first angle range. Therefore, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode.

[0072] According to another embodiment, the base angle mode may be a mode corresponding to an angle within a pre-defined first angle range, and the extension angle mode may be a wide-angle mode outside the first angle range. That is, the base angle mode may be an angle mode corresponding to one of the intra-prediction modes {2, 3, 4, ..., 66}, and the extension angle mode may be an angle mode corresponding to one of the intra-prediction modes {-10, -9, ..., -1} and {67, 68, ..., 76}. The angle indicated by the extension angle mode may be determined to be the angle opposite to the angle indicated by the corresponding base angle mode. Therefore, the angle indicated by the extension angle mode may be determined based on the angle indicated by the base angle mode. However, the number of extension angle modes is not limited thereto, and additional extension angles may be defined depending on the size and / or shape of the current block. For example, the extension angle mode may be defined as an angle mode corresponding to one of the intra-prediction modes {-14, -13, ..., -1} and {67, 68, ..., 80}. Meanwhile, the total number of intra prediction modes included in the intra prediction mode set may vary depending on the configuration of the basic angle mode and the extended angle mode.

[0073] In the above embodiment, the spacing between extension angle modes may be set based on the spacing between corresponding basic angle modes. For example, the spacing between extension angle modes {3, 5, 7, ..., 65} may be determined based on the spacing between corresponding basic angle modes {2, 4, 6, ..., 66}. Furthermore, the spacing between extension angle modes {-10, -9, ..., -1} may be determined based on the spacing between corresponding opposite basic angle modes {56, 57, ..., 65}, and the spacing between extension angle modes {67, 68, ..., 76} may be determined based on the spacing between corresponding opposite basic angle modes {3, 4, ..., 12}. The angular spacing between extension angle modes may be set to be the same as the angular spacing between corresponding basic angle modes. Furthermore, the number of extension angle modes in the intra prediction mode set may be set to be equal to or less than the number of basic angle modes.

[0074] According to an embodiment of the present invention, an extension angle mode may be signaled based on a base angle mode. For example, a wide angle mode (i.e., an extension angle mode) may replace at least one angle mode (i.e., a base angle mode) within a first angle range. The replaced base angle mode may be an angle mode corresponding to the opposite side of the wide angle mode. That is, the replaced base angle mode may be an angle mode corresponding to an angle opposite to the angle indicated by the wide angle mode or an angle that differs from the opposite angle by a pre-set offset index. According to an embodiment of the present invention, the pre-set offset index is 1. An intra-prediction mode index corresponding to the replaced base angle mode may be re-mapped to the wide angle mode to signal the wide angle mode. For example, wide angle modes {-10, -9, ..., -1} may be signaled by intra-prediction mode indexes {57, 58, ..., 66}, respectively, and wide angle modes {67, 68, ..., 76} may be signaled by intra-prediction mode indexes {2, 3, ..., 11}, respectively. By signaling the extended angular mode using the intra-prediction mode index for the base angular mode in this way, even if the configurations of the angular modes used for intra-prediction of each block are different, the same set of intra-prediction mode indexes may be used to signal the intra-prediction mode, thereby minimizing signaling overhead due to changes in the intra-prediction mode configuration.

[0075] Meanwhile, whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block. According to one embodiment, if the size of the current block is larger than a predetermined size, the extended angle mode may be used for intra prediction of the current block, and if not, only the basic angle mode may be used for intra prediction of the current block. According to another embodiment, if the current block is a non-square block, the extended angle mode may be used for intra prediction of the current block, and if the current block is a square block, only the basic angle mode may be used for intra prediction of the current block.

[0076] An inter prediction method according to an embodiment of the present invention will be described below with reference to Figure 7. The inter prediction method described herein may include a general inter prediction method optimized for translation motion and an affine model-based inter prediction method. Furthermore, the motion vector may include at least one of a general motion vector for motion compensation using the general inter prediction method and a control point motion vector for affine motion compensation.

[0077] 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 another decoded picture. Referring to FIG. 7, the decoder obtains a reference block 702 in a reference picture 720 based on a motion information set of a current block 701. 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 and the L1 picture list. The motion vector 703 represents 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 sample values ​​of the reference block 702 and reconstructs the current block 701 using the predictor.

[0078] Specifically, the encoder may search for a block similar to the current block from a picture that comes first in the reconstruction order to obtain the reference block. For example, the encoder may search for a reference block that minimizes the sum of differences between the current block and sample values ​​within a pre-set search area. At this time, at least one of SAD (sum of absolute difference) and SATD (sum of Hadamard transformed difference) may be used to measure the similarity between samples of the current block and the reference block. Here, SAD may be a value obtained by adding up all absolute values ​​of differences between sample values ​​included in both blocks. Furthermore, SATD may be a value obtained by adding up all absolute values ​​of Hadamard transform coefficients obtained by Hadamard transforming each difference between sample values ​​included in both blocks.

[0079] 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 of the current block based on sample values ​​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.

[0080] As described above, one or more motion information sets may 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 may be used. For example, the motion information set used for predicting the current block may be derived from the motion information set used for predicting any one of the other samples that have already been reconstructed. This allows the encoder and decoder to reduce signaling overhead. Various embodiments for signaling the motion information set of the current block will be described below.

[0081] 8 is a diagram illustrating a method for signaling a motion vector of a current block according to an embodiment of the present invention. According to an embodiment of the present invention, the motion vector of the current block may be derived from a motion vector predictor (MVP) of the current block. According to an embodiment, the motion vector predictor referenced to derive the motion vector of the current block may be obtained using a motion vector predictor (MVP) candidate list. The MVP candidate list may include a preset number of MVP candidates, Candidate 1, Candidate 2, ..., Candidate N.

[0082] According to one embodiment, the MVP candidate list may include at least one of spatial candidates and temporal candidates. A spatial candidate may be a set of motion information used to predict neighboring blocks within a certain range from the current block in the current picture. A spatial candidate may be constructed based on available neighboring blocks of the current block. A temporal candidate may be a set of motion information used to predict blocks in the current picture and another picture. For example, a temporal candidate may be constructed based on a specific block corresponding to the position of the current block in a specific reference picture. In this case, the position of the specific block represents the position of the top-left sample of the specific block in the reference picture. According to another embodiment, the MVP candidate list may include a zero motion vector. According to another embodiment, a rounding process may be performed on the MVP candidates included in the MVP candidate list for the current block. In this case, the resolution of the motion vector difference value of the current block, which will be described later, may be used. For example, each MVP candidate for the current block may be rounded based on the resolution of the motion vector difference value of the current block.

[0083] In this disclosure, the MVP candidate list may include an advanced temporal motion vector prediction (ATMVP) list, a merge candidate list for merge inter-prediction, a control point motion vector candidate list for affine motion compensation, a subblock-based temporal motion vector prediction (STMVP) list for subblock-based motion compensation, and combinations thereof.

[0084] According to one embodiment, the encoder 810 and the decoder 820 may construct an MVP candidate list for motion compensation of the current block. For example, among samples reconstructed before the current block, there may be candidates corresponding to samples that may 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 encoder 810 and the decoder 820 may construct an MVP candidate list for the current block based on the plurality of candidate blocks. In this case, the encoder 810 and the decoder 820 may construct the MVP candidate list according to a rule predefined between the encoder 810 and the decoder 820. That is, the MVP candidate lists constructed by the encoder 810 and the decoder 820 may be identical to each other.

[0085] In addition, the predefined rule may vary depending on the prediction mode of the current block. For example, if the prediction mode of the current block is an affine prediction mode based on an affine model, the encoder and decoder may construct an MVP candidate list for the current block using a first method based on the affine model. The first method may be a method of obtaining a control point motion vector candidate list. On the other hand, if the prediction mode of the current block is a general inter prediction mode not based on an affine model, the encoder and decoder may construct an MVP candidate list for the current block using a second method not based on an affine model. In this case, the first method and the second method may be different from each other.

[0086] The decoder 820 may derive a motion vector for the current block based on one of at least one MVP candidates included in the MVP candidate list for the current block. For example, the encoder 810 may signal an MVP index indicating a motion vector predictor to be referenced to derive a motion vector for the current block. The decoder 820 may obtain a motion vector predictor for the current block based on the signaled MVP index. The decoder 820 may derive a motion vector for the current block using the motion vector predictor. According to one embodiment, the decoder 820 may use the motion vector predictor obtained from the MVP candidate list as the motion vector for the current block without a separate motion vector differential value. The decoder 820 may reconstruct the current block based on the motion vector of the current block. An inter prediction mode in which a motion vector predictor obtained from the MVP candidate list is used as the motion vector for the current block without a separate motion vector differential value may be referred to as a merge mode.

[0087] In another embodiment, the decoder 820 may obtain a separate motion vector difference value for the motion vector of the current block. The decoder 820 may obtain the motion vector of the current block by summing the motion vector predictor obtained from the MVP candidate list and the motion vector difference value of the current block. In this case, the encoder 810 may signal a motion vector (MV) difference value (MV difference) representing the difference between the motion vector of the current block and the motion vector predictor. A method for signaling the motion vector difference value will be described in detail with reference to FIG. 9. The decoder 820 may obtain the motion vector of the current block based on the motion vector difference value (MV difference). The decoder 820 may reconstruct the current block based on the motion vector of the current block.

[0088] Furthermore, a reference picture index for motion compensation of the current block may be signaled. The encoder 810 may signal a reference picture index indicating a reference picture including the reference block. The decoder 820 may obtain a POC of a reference picture referenced for reconstruction of the current block based on the signaled reference picture index. In this case, the POC of the reference picture may be different from the POC of a reference picture corresponding to an MVP referenced for deriving a motion vector of the current block. In this case, the decoder 820 may perform motion vector scaling. That is, the decoder 820 may obtain an MVP' by scaling the MVP. In this case, the motion vector scaling may be performed based on the POC of the current picture, the POC of the signaled reference picture of the current block, and the POC of the reference picture corresponding to the MVP. In addition, the decoder 820 may use the MVP' as a motion vector predictor for the current block.

[0089] As described above, the motion vector of the current block may be obtained by summing the motion vector predictor of the current block and the motion vector differential value. In this case, the motion vector differential value may be signaled from an encoder. The encoder may encode the motion vector differential value and generate and signal information indicating the motion vector differential value. A method for signaling the motion vector differential value according to one embodiment of the present invention will now be described.

[0090] 9 is a diagram illustrating a method for signaling a motion vector difference value of a current block according to an embodiment of the present invention. According to an embodiment, the information indicating the motion vector difference value may include at least one of absolute value information of the motion vector difference value or sign information of the motion vector difference value. The absolute value and sign of the motion vector difference value may be encoded separately.

[0091] In one embodiment, the absolute value of the motion vector difference value may be signaled by the value itself. The encoder can reduce the size of the signaled value using at least one flag that indicates the characteristics of the absolute value of the motion vector difference value. The decoder can derive the absolute value of the motion vector difference value from the signaled value using at least one flag.

[0092] For example, the at least one flag may include a first flag indicating whether the absolute value of the motion vector difference value is greater than N, where N may be an integer. If the absolute value of the motion vector difference value is greater than N, a value (absolute value of the motion vector difference value - N) may be signaled together with an activated first flag. In this case, the activated flag may indicate that the absolute value of the motion vector difference value is greater than N. The decoder may obtain the absolute value of the motion vector difference value based on the activated first flag and the signaled value.

[0093] 9, a second flag (abs_mvd_greater0_flag) indicating whether the absolute value of the motion vector differential value is greater than '0' may be signaled. If the second flag (abs_mvd_greater0_flag[]) indicates that the absolute value of the motion vector differential value is greater than '0', the absolute value of the motion vector differential value may be '0'. Also, if the second flag (abs_mvd_greater0_flag) indicates that the absolute value of the motion vector differential value is greater than '0', the decoder may obtain the absolute value of the motion vector differential value using other information about the motion vector differential value.

[0094] According to one embodiment, a third flag (abs_mvd_greater1_flag) may be signaled to indicate whether the absolute value of the motion vector differential value is greater than '1.' If the third flag (abs_mvd_greater1_flag) indicates that the absolute value of the motion vector differential value is not greater than '1,' the decoder may determine that the absolute value of the motion vector differential value is '1.'

[0095] Conversely, if the third flag (abs_mvd_greater1_flag) indicates that the absolute value of the motion vector differential value is greater than '1', the decoder can obtain the absolute value of the motion vector differential value using further information about the motion vector differential value. For example, the value (abs_mvd_minus2) (absolute value of the motion vector differential value - 2) may be signaled. This is because if the absolute value of the motion vector differential value is greater than '1', the absolute value of the motion vector differential value may be a value equal to or greater than 2.

[0096] As described above, the absolute value of the motion vector difference of the current block may be modified into at least one flag. For example, the modified absolute value of the motion vector difference may be represented by (absolute value of the motion vector difference - N) depending on the size of the motion vector difference. According to one embodiment, the modified absolute value of the motion vector difference may be signaled by at least one bit. In this case, the number of bits signaled to represent the modified absolute value of the motion vector difference may be variable. The encoder may encode the modified absolute value of the motion vector difference using a variable length binarization method. For example, the encoder may use at least one of truncated unary binarization, unary binarization, truncated rice, or exponential-Golomb binarization as the variable length binarization method.

[0097] Additionally, the sign of the motion vector difference value may be signaled by a sign flag (mvd_sign_flag), or alternatively, the sign of the motion vector difference value may be implicitly signaled by sign-bit-hiding.

[0098] Meanwhile, the motion vector differential value of the current block may be signaled in a specific resolution unit. In the present disclosure, the resolution of the motion vector differential value may represent the unit in which the motion vector differential value is signaled. That is, in the present disclosure, a resolution other than the picture resolution may represent the precision or granularity with which the motion vector differential value is signaled. The resolution of the motion vector differential value may be expressed in units of samples or pixels. For example, the resolution of the motion vector differential value may be expressed using sample units such as 1 / 4 (quarter), 1 / 2 (half), 1 (integer), 2, or 4 sample units. In addition, the smaller the resolution of the motion vector differential value of the current block, the greater the precision of the motion vector differential value of the current block.

[0099] According to an embodiment of the present invention, motion vector differential values ​​may be signaled based on various resolutions. According to an embodiment, the absolute value or modified absolute value of the motion vector differential value may be signaled in integer sample units. Alternatively, the absolute value of the motion vector differential value may be signaled in 1 / 2 sub-pel units. That is, the resolution of the motion vector differential value may be set differently depending on the situation. An encoder and a decoder according to an embodiment of the present invention can efficiently signal the motion vector differential value of a current block by appropriately using various resolutions for the motion vector differential value.

[0100] According to one embodiment, the resolution of the motion vector differential value may be set to a different value for at least one unit of a block, a coding unit, a slice, or a tile. For example, the first resolution of the motion vector differential value of a first block may be in units of 1 / 4 samples. In this case, '64', which is the absolute value of the motion vector differential value '16' divided by the first resolution, may be signaled. Also, the second resolution of the motion vector differential value of a second block may be in units of integer samples. In this case, '16', which is the absolute value of the second motion vector differential value '16' divided by the second resolution, may be signaled. In this way, even if the absolute values ​​of the motion vector differential values ​​are the same, different values ​​may be signaled depending on the resolution. In this case, if the value obtained by dividing the absolute value of the motion vector differential value by the resolution includes decimal places, a rounding function may be applied to the value.

[0101] The encoder can signal information indicating a motion vector differential value based on the resolution of the motion vector differential value. The decoder can obtain a modified motion vector differential value from the signaled motion vector differential value. The decoder can modify the motion vector differential value based on the resolution of the resolution differential value. The relationship between the signaled motion vector differential value (valuePerResolution) and the modified motion vector differential value (valueDetermined) of the current block is shown in Equation 1 below. Hereinafter, in this disclosure, unless otherwise specified, the motion vector differential value represents the modified motion vector differential value (valueDetermined). Also, the signaled motion vector differential value represents the value before being modified by resolution.

[0102]

number

[0103] In Equation 1, resolution represents the resolution of the motion vector differential value of the current block. That is, the decoder can obtain a modified motion vector differential value by multiplying the signaled motion vector differential value of the current block by the resolution. Next, the decoder can obtain the motion vector of the current block based on the modified motion vector differential value. The decoder can also reconstruct the current block based on the motion vector of the current block.

[0104] When a relatively small value is used as the resolution of the motion vector differential value of the current block (i.e., when the precision is high), it is easier to indicate the motion vector differential value of the current block more precisely. However, in this case, the signaled value itself becomes large, which may increase the signaling overhead for the motion vector differential value of the current block. Conversely, when a relatively large value is used as the resolution of the motion vector differential value of the current block (i.e., when the precision is low), the size of the signaled value can be reduced, which may reduce the signaling overhead for the motion vector differential value. That is, when the resolution of the motion vector differential value is high, the motion vector differential value of the current block may be signaled with fewer bits than when the resolution of the motion vector differential value of the current block is low. However, in this case, it may be difficult to indicate the motion vector differential value of the current block more precisely.

[0105] As a result, the encoder and decoder can select an advantageous resolution for signaling a motion vector differential value from a plurality of resolutions depending on the situation. For example, the encoder can signal a selected resolution based on the situation. The decoder can obtain a motion vector differential value of the current block based on the signaled resolution. A method for signaling a resolution of a motion vector differential value of a current block according to an embodiment of the present invention will be described below. According to an embodiment of the present invention, the resolution of the motion vector differential value of the current block may be one of a plurality of available resolutions included in a resolution set. Here, the plurality of available resolutions may represent resolutions that can be used in a specific situation. The type and number of available resolutions included in the resolution set may vary depending on the situation.

[0106] FIG. 10 is a diagram illustrating a coding unit and a transform unit according to an embodiment of the present invention.

[0107] FIG. 10(a) is a diagram showing a coding unit according to an embodiment of the present invention, and FIG. 10(b) is a diagram showing a transform unit according to an embodiment of the present invention.

[0108] According to an embodiment of the present invention, a block unit on which a transform is performed may exist. For example, the block unit on which a transform is performed may be the same as or smaller than a coding unit (CU), or may be the same as or smaller than a block unit on which a prediction is performed. The size of the block unit on which a transform is performed may be limited by a maximum transform size. For example, the width or height of the block unit on which a transform is performed may be limited by the maximum transform size. Specifically, the width or height of the block unit on which a transform is performed may be equal to or smaller than the maximum transform size. The maximum transform size may differ depending on the color difference components, i.e., luma components and chroma components, of the transform block. In this case, the block unit on which a transform is performed may be referred to as a transform unit (TU). If a coding unit or a prediction unit (PU) is larger than the maximum transform size, the coding unit or the prediction unit may be split to generate multiple transform units. A transform unit larger than the maximum transform size among the multiple transform units may be split to generate multiple transform units. The sizes of the multiple transform units generated in this process may all be equal to or less than the maximum transform size. In the present invention, a unit (block) having a size larger than the maximum transform size may mean that the width or height of the unit (block) is larger than the maximum transform size. Meanwhile, a unit (block) having a size equal to or less than the maximum transform size may mean that both the width and height of the unit (block) are equal to or less than the maximum transform size. According to an embodiment of the present invention, the operation of dividing the transform units based on the maximum transform size may be performed in situations such as when intra prediction is performed or when processing a residual signal. The operation of dividing the transform units based on the maximum transform size may be performed recursively until the size of the transform units becomes equal to or less than the maximum transform size.

[0109] Referring to FIG. 10(a), the width and height of a coding unit may be expressed as cbWidth and cbHeight, respectively. Referring to FIG. 10(b), the width and height of a transform unit may be expressed as tbWidth and tbHeight, respectively. The maximum transform size may be expressed as MaxTbSizeY. Specifically, MaxTbSizeY may be the maximum transform size for the luma component. If a transform unit must be split because its size is larger than the maximum transform size, the tbWidth and tbHeight of the transform unit before splitting may be cbWidth and cbHeight, respectively. That is, depending on whether the width or height of the transform unit is larger than the maximum transform size, the transform unit may be split, and tbWidth or tbHeight may be updated. For example, referring to FIG. 10(a), cbWidth is larger than MaxTbSizeY. In this case, the transform unit may be split, but the tbWidth and tbHeight of the transform unit before the split may be cbWidth and cbHeight, respectively. Referring to Figure 10(b), since tbWidth is larger than MaxTbSizeY, the TU may be split into transform unit 1 and transform unit 2. In this case, newTbWidth, which is the width of the new transform unit (the width of the transform unit after split), may be tbWidth / 2.

[0110] The transform unit (TU) division described in this specification may refer to the division of a transform block (TB) included in the TU.

[0111] In this specification, the terms "unit" and "block" are used interchangeably. A "unit" may refer to a concept including one or more blocks of color difference components. For example, a "unit" may refer to a concept including a block for luma and one or more blocks for chroma.

[0112] FIG. 11 is a diagram illustrating a transform tree syntax according to one embodiment of the present invention.

[0113] The syntax in FIG. 11 may be the syntax for dividing TUs described with reference to FIG.

[0114] The transform tree syntax shown in FIG. 11 may be called from a coding unit syntax or a prediction unit syntax. Here, the input values ​​tbWidth and tbHeight of the transform tree syntax may be cbWidth and cbHeight described in FIG. 10. The decoder may then check whether tbWidth is greater than the maximum transform size (MaxTbSizeY) or whether tbHeight is greater than MaxTbSizeY. If the check shows that tbWidth or tbHeight is greater than MaxTbSizeY, TU partitioning may be performed, and the transform tree syntax may be called again. Otherwise, the transform unit syntax may be called. Here, when the transform tree syntax is called again, the input values ​​may be updated. For example, if tbWidth or tbHeight is greater than MaxTbSizeY, the input values ​​may be updated to tbWidth / 2 or tbHeight / 2. In FIG. 11, the updated tbWidth and tbHeight may be expressed as trafoWidth and trafoHeight. Also, in the syntax element transform_tree(x0, y0, tbWidth, tbHeight, treeType), x0 and y0 may be horizontal and vertical coordinate values ​​indicating the position of the block to which the transform tree syntax is applied. A decoder can parse the syntax element transform_tree(x0, y0, trafoWidth, trafoHeight, treeType) using the values ​​of trafoWidth and trafoHeight. If tbWidth is greater than MaxTbSizeY, the decoder can parse the syntax element transform_tree(x0+trafoWidth, y0, trafoWidth, trafoHeight, treeType).If tbheight is greater than MaxTbSizeY, the decoder may parse the syntax element transform_tree(x0, y0 + trafoHeight, trafoWidth, trafoHeight, treeType). If tbWidth is greater than MaxTbSizeY and tbHeight is greater than MaxTbSizeY, the decoder may parse the syntax element transform_tree(x0 + trafoWidth, y0 + trafoHeight, trafoWidth, trafoHeight, treeType). In this case, the order in which the transform tree syntax 'transform_tree()' is called multiple times may be important in terms of encoder and decoder match or coding performance. In this case, the order may follow a preset order, which may be the order according to the syntax disclosed in FIG. 11.

[0115] 11 is called for the first time in a coding unit or a prediction unit, tbWidth, tbHeight, x0, and y0 may be values ​​set based on the luma component. For example, when the size of a luma block is 16x16, the size of a chroma block in a chroma format may be 8x8. In this case, even if a decoder parses the transform tree syntax for the chroma block, the values ​​of tbWidth and tbHeight may be 16 and 16, respectively.

[0116] In addition, the transform tree syntax of FIG. 11 may be parsed regardless of the tree type (treeType) value. The tree type indicates whether the block structure of the luma component and the block structure of the chroma component are the same or different. For example, if the tree type is SINGLE_TREE, the block structure of the luma component and the block structure of the chroma component may be the same. On the other hand, if the tree type is not SINGLE_TREE, the block structure of the luma component and the block structure of the chroma component may be different. If the tree type is DUAL_TREE_LUMA, the block structure of the luma component and the block structure of the chroma component may be different. In this case, the tree type may indicate that the tree is for the luma component or that the transform tree syntax for the luma component is to be parsed. On the other hand, if the tree type is DUAL_TREE_CHROMA, the block structure of the luma component and the block structure of the chroma component may be different from each other, and in this case, the tree type may indicate that it is a tree for the chroma component or that a transform tree syntax for the chroma component is parsed.

[0117] FIG. 12 is a diagram illustrating a decoding process for an intra block according to an embodiment of the present invention.

[0118] FIG. 12 illustrates a transform unit division and an intra prediction process.

[0119] The terms used in the embodiments described with reference to the drawings of this specification are defined below.

[0120] (xTb0, yTb0): Coordinates of the top left sample position of the current transformation block

[0121] nTbW: width of the current transform block

[0122] nTbH: height of current transformation block

[0123] Section 8.4.1 of Figure 12 illustrates a decoding process for a luma block and a decoding process for a chroma block of a coding unit. The decoding process for a chroma block may include a decoding process for a Cb block and a decoding process for a Cr block. Referring to Section 8.4.1 of Figure 12, different inputs may be used for the decoding process for the luma block and the decoding process for the chroma block, and the decoder may perform the operations disclosed in Section 8.4.5.1 of Figure 12 using the different inputs.

[0124] cbWidth and cbHeight disclosed in Section 8.4.1 of FIG. 12 may refer to the width and height of a current coding block, and the cbWidth and cbHeight values ​​may be values ​​based on luma samples. For example, if the luma block size is 16x16, the chroma block size may be 8x8 depending on the chroma format. In this case, the cbWidth and cbHeight values ​​for the chroma coding block may be 16 and 16, respectively. Also, (xCb, yCb) disclosed in FIG. 12 may indicate the coordinates of the current coding block and may be the coordinate values ​​of the top-left sample of the current coding block. In this case, the coordinate values ​​may be set based on the coordinates of the top-left sample of the current picture. Also, (xCb, yCb) may be values ​​indicated based on luma samples.

[0125] Referring to Section 8.4.1 of Figure 12, if the tree type (treeType) is SINGLE_TREE or DUAL_TREE_LUMA, the decoder can perform a decoding process for the luma block. In this case, Section 8.4.5.1 disclosed in Figure 12 may be invoked, where the sample location input may be (xCb, yCb), and the width and height of the block may be cbWidth and cbHeight, respectively. In addition, the value of cIdx, which indicates a color component, may be 0.

[0126] If the tree type (treeType) is SINGLE_TREE or DUAL_TREE_CHROMA, the decoder can perform a decoding process for the chroma blocks. In this case, 8.4.5.1 disclosed in FIG. 12 may be invoked, and may be invoked for each of the Cb block and the Cr block. The sample location input may be (xCb / SubWidthC, yCb / SubHeightC), and the block width and height may be cbWidth / SubWidthC and cbHeight / SubHeightC, respectively. The value of cIdx may not be 0, and may be set to 1 for the Cb block and 2 for the Cr block. SubWidthC and SubHeightC may be values ​​that are preset based on the chroma format. The values ​​of SubWidthC and SubHeightC may be 1 or 2, and may be values ​​corresponding to the relationship between the luma component and the chroma component. SubWidthC and SubHeightC will be described later with reference to FIGS.

[0127] When the decoder performs the decoding process disclosed in Section 8.4.5.1 of Figure 12, the input may be converted to correspond to a luma block and a chroma block. For example, the block width (nTbW), block height (nTbH), and sample location coordinates (xTb0, yTb0) disclosed in Section 8.4.5.1 of Figure 12 may be determined based on the number of chroma samples when the decoding process is performed on a chroma block, and may be determined based on the number of luma samples when the decoding process is performed on a luma block.

[0128] The above-mentioned TU division may be performed using Section 8.4.5.1 of FIG. 12. maxTbWidth and maxTbHeight disclosed in FIG. 12 are values ​​indicating the maximum transform size corresponding to a color component, and may be values ​​corresponding to width and height, respectively. As described above, MaxTbSizeY may be the maximum transform size for a luma block. Therefore, for a chroma block (i.e., when cIdx is not 0), maxTbWidth may be MaxTbSizeY / SubWidthC, and maxTbHeight may be MaxTbSizeY / SubHeightC. For a luma block, maxTbWidth and maxTbHeight may both be MaxTbSizeY.

[0129] Also, referring to 8-43 of FIG. 12, the coordinates ((xTbY, yTbY)) may be converted based on the luma standard, and in this case, the coordinates may be calculated based on cIdx, SubWidthC, and SubHeightC.

[0130] The decoding process described in Figure 12 must be consistent with the syntax structure, i.e., the decoding process in Figure 12 must be consistent with the syntax structure in Figure 11.

[0131] In section 8.4.5.1 of Figure 12, if nTbW is greater than maxTbWidth or nTbH is greater than maxTbHeight, steps 1 to 5 disclosed in 8.4.5.1 of Figure 12 may be performed. Referring to step 1 of Figure 12, the width (nTbW) and height (nTbH) of the block may be updated to newTbW and newTbH. Specifically, if nTbW is greater than maxTbWidth, the width of the block is updated to nTbW / 2; otherwise, the width of the block remains nTbW. If nTbH is greater than maxTbHeight, the height of the block is updated to nTbH / 2; otherwise, the height of the block remains nTbH. Referring to step 2 of Figure 12, section 8.4.5.1 of Figure 12 may be invoked again with the coordinates (xTb0, yTb0), newTbW, and newTbH as input. Referring to step 3 of Figure 12, if nTbW is greater than maxTbWidth, section 8.4.5.1 of Figure 12 may be invoked again with the coordinates (xTb0 + newTbW, yTb0), newTbW, and newTbH as input. Referring to step 4 of Figure 12, if nTbH is greater than maxTbHeight, section 8.4.5.1 of Figure 12 may be invoked again with the coordinates (xTb0, yTb0 + newTbH), newTbW, and newTbH as input. Referring to step 5 of Figure 12, if nTbW is greater than maxTbWidth and nTbH is greater than maxTbHeight, then section 8.4.5.1 of Figure 12 may be invoked again with the coordinates (xTb0+newTbW, yTb0+newTbH), newTbW, and newTbH as input. Steps 2 to 5 of Figure 12 may be the same as the steps of re-invoking the transform tree syntax in Figure 11.

[0132] On the other hand, if nTbW is equal to or less than maxTbWidth and nTbH is equal to or less than maxTbHeight, processes other than steps 1 to 5 in Figure 12 may be performed. In this case, the processes other than steps 1 to 5 in Figure 12 may actually be processes related to intra prediction, residual signal decoding, transform, reconstruction, etc.

[0133] FIG. 13 is a diagram illustrating a residual signal decoding process according to one embodiment of the present invention.

[0134] Of the contents disclosed in FIG. 13, those that overlap with the above-mentioned contents will be omitted.

[0135] The decoding process disclosed in Figure 13 may be performed when inter prediction, IBC (intra block copy) prediction, etc. Also, Figure 13 may disclose the above-mentioned TU division.

[0136] Referring to S1301 of Figure 13, the process of invoking section 8.5.8 of Figure 13 may be performed for each color component. In this case, the decoding process of section 8.5.8 of Figure 13 may be performed using inputs corresponding to each color component, as described with reference to Figure 12. The coordinates (xTb0, yTb0) of the sample location, the block width (nTbW), and the block height (nTbH), which are inputs to the decoding process of section 8.5.8 of Figure 13, may be (xCb, yCb), cbWidth, and cbHeight for the luma block, and (xCb / SubWidthC, yCb / SubHeightC), cbWidth / SubWidthC, and cbHeight / SubHeightC for the chroma block. Furthermore, the cIdx value indicating a color component may be set to 0 if the block is a luma component, and may be set to a value other than 0 if the block is a chroma component. For example, the cIdx value may be set to 1 if the block is a Cb component, and 2 if the block is a Cr component.

[0137] When the decoding process of Section 8.5.8 of Figure 13 is performed, (xTb0, yTb0), nTbW, and nTbH may be values ​​corresponding to each color component, i.e., values ​​corresponding to the number of samples of each color component.

[0138] Referring to 8-849 and 8-850 of Figure 13, a maximum transform size may be calculated for each color component. Also, referring to 8-852 and 8-853 of Figure 13, the block width or block height may be updated and written as newTbW or newTbH depending on whether nTbW or nTbH is greater than the maximum transform size. Steps 2 to 5 of section 8.5.8 of Figure 13 disclose a process of re-invoking section 8.5.8, which may be the same as the process described above with reference to Figure 12.

[0139] On the other hand, if nTbW is equal to or less than maxTbWidth and nTbH is equal to or less than maxTbHeight, processes other than steps 1 to 5 in Figure 13 may be performed. In this case, the processes other than steps 1 to 5 in Figure 13 may be processes related to actual residual signal decoding, transform, etc.

[0140] FIG. 14 is a diagram showing the relationship between color components according to one embodiment of the present invention.

[0141] Referring to FIG. 14, elements related to color components may include chroma_format_idc, Chroma format, and separate_colour_plane_flag.

[0142] For example, if the chroma format is monochrome, there may be only one sample array, and SubWidthC and SubHeightC may both be 1. If the chroma format is 4:2:0 sampling, there may be two chroma arrays. In this case, the chroma array may have half the width and half the height of the luma array, and SubWidthC and SubHeightC may both be 2. If the chroma format is 4:2:2 sampling, there may be two chroma arrays. In this case, the chroma array may have half the width and the same height as the luma array, and SubWidthC and SubHeightC may be 2 and 1, respectively. If the chroma format is 4:4:4 sampling, there may be two chroma arrays. In this case, the chroma array may have the same width and height as the luma array, and SubWidthC and SubHeightC may both be 1.

[0143] On the other hand, if the chroma format is 4:4:4 sampling, the processes performed may differ depending on the separate_colour_plane_flag. If separate_colour_plane_flag is 0, the chroma array may have the same width and height as the luma array. If separate_colour_plane_flag is 1, processes may be performed separately for three color planes, i.e., luma, Cb, and Cr. If separate_colour_plane_flag is 1, only one color component may exist in one slice. On the other hand, if separate_colour_plane_flag is 0, multiple color components may exist in one slice. As shown in FIG. 14, if the chroma format is 4:4:4 sampling, SubWidthC and SubHeightC may both be 1 regardless of separate_colour_plane_flag.

[0144] SubWidthC and SubHeightC can indicate what size the chroma array is relative to the luma array; if the chroma array width or height is half that of the luma array, SubWidthC or SubHeightC can be 2; if the chroma array width or height is the same size as the luma array, SubWidthC or SubHeightC can be 1.

[0145] 14, SubWidthC and SubHeightC may have different values ​​only when the chroma format is 4:2:2 sampling. Therefore, when the chroma format is 4:2:2 sampling, the width-to-height relationship based on the luma component may be different from the width-to-height relationship based on the chroma component.

[0146] FIG. 15 is a diagram showing the relationship between color components according to one embodiment of the present invention.

[0147] FIG. 15(a) shows the case where the chroma format is 4:2:0 sampling, FIG. 15(b) shows the case where the chroma format is 4:2:2 sampling, and FIG. 15(c) shows the case where the chroma format is 4:4:4 sampling.

[0148] Referring to Figure 15(a), when the chroma format is 4:2:0 sampling, one chroma sample (one Cb, one Cr) may be located for every two luma samples in the horizontal direction, and one chroma sample (one Cb, one Cr) may be located for every two luma samples in the vertical direction.

[0149] Referring to Figure 15(b), when the chroma format is 4:2:2 sampling, one chroma sample (one Cb, one Cr) may be located for every two luma samples in the horizontal direction, and one chroma sample (one Cb, one Cr) may be located for every luma sample in the vertical direction.

[0150] Referring to Figure 15(c), when the chroma format is 4:4:4 sampling, one chroma sample (one Cb, one Cr) may be located for each luma sample in the horizontal direction, and one chroma sample (one Cb, one Cr) may be located for each luma sample in the vertical direction.

[0151] The above-mentioned SubWidthC and SubHeightC may be determined based on the relationship between the luma samples and chroma samples shown in Figure 15, and conversion based on the luma samples and conversion based on the chroma samples may be performed based on SubWidthC and SubHeightC.

[0152] FIG. 16 is a diagram showing the maximum transform size according to one embodiment of the present invention.

[0153] The maximum transform size may be variable, but the complexity of the encoder or decoder may be adjusted by changing the maximum transform size, e.g., if the maximum transform size is small, the complexity of the encoder or decoder may be reduced.

[0154] In one embodiment of the present invention, the maximum transform size may be limited to one of two values, such as 32, 64, or a luma-based size.

[0155] The maximum transform size may be signaled at a higher level, which may be a level including the current block, such as a sequence, a sequence parameter, a slice, a tile, a tile group, a picture, or a coding tree unit (CTU).

[0156] 16, sps_max_luma_transform_size_64_flag may be a flag indicating the maximum transform size. For example, if the value of sps_max_luma_transform_size_64_flag is 1, the maximum transform size may be 64, and if the value of sps_max_luma_transform_size_64_flag is 0, the total maximum transform size may be 32. In this case, the maximum transform size may be a size based on luma samples.

[0157] Also, MaxTbLog2SizeY may be the value obtained by taking the log2 of the maximum transform size. Therefore, MaxTbLog2SizeY may be (sps_max_luma_transform_size_64_flag? 6:5). That is, if the value of sps_max_luma_transform_size_64_flag is 1, the MaxTbLog2SizeY value is 6, and if the value of sps_max_luma_transform_size_64_flag is 0, the MaxTbLog2SizeY value is 5.

[0158] Also, MaxTbSizeY indicating the maximum transform size may be (1 << MaxTbLog2SizeY). That is, if the value of MaxTbLog2SizeY is 6, shift the bits 6 digits to the left, and the value of MaxTbSizeY becomes 64. If the value of MaxTbLog2SizeY is 5, shift the bits 5 digits to the left, and the value of MaxTbSizeY becomes 32.

[0159] MinTbSizeY disclosed in FIG. 16 may be a value indicating the minimum transform size.

[0160] The size of the luma coding tree block (CtbSizeY) or the size of the coding tree unit (CTU size) may be variable. For example, when CtbSizeY is smaller than 64, the minimum transform size may be smaller than 64. Therefore, when CtbSizeY is smaller than 64, the value of sps_max_luma_transform_size_64_flag may be 0.

[0161] Hereinafter, CtbsizeY described in the present invention means the size of the luma coding tree block, and specifically, indicates the width and height of the luma coding tree block.

[0162] [[ID=I9]] FIG. 17 is a diagram showing the syntax at the upper level according to an embodiment of the present invention.

[0163] Referring to FIG. 17, the syntax structure shown in FIG. 17 may be a high-level syntax and may include sps_max_luma_transform_size_64_flag.

[0164] Also, the syntax structure of FIG. 17 may include log2_ctu_size_minus5. Based on log2_ctu_size_minus5, the CTU size and the size CtbSizeY of the luma coding tree block may be determined. For example, log2_ctu_size_minus5 + 5 is CtbLog2SizeY, and CtbLog2SizeY represents log2(CtbSizeY). Also, CtbSizeY may be determined as (1 << CtbLog2SizeY).

[0165] Also, the syntax structure of FIG. 17 may include sps_sbt_enabled_flag and sps_sbt_max_size_64_flag. sps_sbt_enabled_flag may be a flag indicating whether subblock transform (SBT) can be used. SBT may transform only some samples of a CU or PU. sps_sbt_max_size_64_flag may be a flag indicating the maximum size for which SBT may be used. Referring to FIG. 17, when sps_sbt_enabled_flag indicates that SBT may be used (for example, when the value of sps_sbtenabled_flag is 1), sps_sbt_max_size_64_flag may be signaled. On the other hand, when sps_sbt_enabled_flag indicates that SBT may not be used (for example, when the value of sps_sbt_enabled_flag is 0), sps_sbt_max_size_64_flag may not be signaled. Also, SBT may be used when both the width and height of the block are below the maximum size for which SBT may be used.

[0166] The maximum size for which SBT may be used, indicated by sps_sbt_max_size_64_flag, may include 32. Also, the maximum size for which SBT may be used, indicated by sps_sbt_max_size_64_flag, may be 32 or 64. If the maximum transform size is smaller than the maximum size for which SBT may be used, indicated by sps_sbt_max_size_64_flag, the maximum size for which SBT may be used may be set to the maximum transform size. Referring to 7-31 in FIG. 17, the smaller value of the maximum transform size (MaxTbSizeY) and the maximum size for which SBT may be used, indicated by sps_sbt_max_size_64_flag, may be set as the maximum size for which SBT may be used (MaxSbtSize).

[0167] 17 may include sps_transform_skip_enabled_flag. sps_transform_skip_enabled_flag may be a flag indicating whether transform skip is enabled. In this case, transform skip may indicate that no transform is performed.

[0168] FIG. 18 is a diagram illustrating a transform tree syntax according to one embodiment of the present invention.

[0169] The transform tree syntax of FIG. 18 may be a syntax for supporting the variable maximum transform size described with reference to FIGS.

[0170] When the maximum size of a CU or PU is twice the maximum transform size and a fixed maximum transform size is used, the syntax and decoding processor described in Figures 11 to 13 may be used. Specifically, when the maximum size of a CU or PU is 128 and the maximum transform size is 64, the embodiments of Figures 11 to 13 may be used. In this case, when a TU is split because a CU or PU is larger than the maximum transform size, the TU may be split into two or four TUs. The split may be up to two in both the horizontal and vertical directions.

[0171] However, when a variable maximum transform size is used, when a maximum transform size smaller than the conventional maximum transform size is supported, or when the maximum size of a CU or PU is greater than twice the maximum transform size, the TU needs to be divided into two or more parts horizontally and vertically. However, the syntax and process described in Figures 11 to 13 have the problem that they do not support such division.

[0172] Therefore, to solve this problem, a syntax for recursively dividing a TU into two pieces only in either the horizontal or vertical direction will be described with reference to FIG. 18. Referring to FIG. 18, if tbWdith is greater than MaxTbSizeY or tbHeight is greater than MaxTbSizeY, the transform tree syntax 'transform_tree()' of FIG. 18 may be called again. In this case, 'transform_tree()' may be called twice ((6) and (8) of FIG. 18 or (6) and (10) of FIG. 18). Whether the two calls are (6) and (8) of FIG. 18 or (6) and (10) of FIG. 18 may be determined depending on the initial split direction of the TU. The initial split direction of the TU may be determined based on verSplitFirst. The input of the called 'transform_tree()' may change based on verSplitFirst. Also, based on verSplitFirst, it may be determined whether the two calls are (6) and (8) in Figure 18 or (6) and (10) in Figure 18. tbWidth and tbHeight are the width and height of the block, and MaxTbSizeY is the maximum transform size.

[0173] Referring to (3) in FIG. 18, the verSplitFirst value may be determined based on tbWidth, tbHeight, and MaxTbSizeY.

[0174] In one embodiment of the present invention, if tbWidth is greater than MaxTbSizeY and tbWidth is greater than tbHeight, the verSplitFirst value may be set to 1; otherwise, the verSplitFirst value may be set to 0.

[0175] The block width and height, which are inputs to 'transform_tree()' in FIG. 18, may be trafoWidth and trafoHeight in (6), (8), and (10) of FIG. 18. trafoWidth and trafoHeight may be determined based on verSplitFirst. For example, when verSplitFirst is 1, trafoWidth may be set to tbWidth / 2, and when verSplitFirst is 0, trafoWidth may be set to tbWidth. Also, when verSplitFirst is 0, trafoHeight may be set to tbHeight / 2, and when verSplitFirst is 1, trafoHeight may be set to tbHeight. In other words, trafoWidth and trafoHeight, which are inputs to (6), (8), and (10) of FIG. 18, may be the same as any one of the existing block widths and heights, and the remaining one may be half the existing value. In other words, trafoWidth, trafoHeight may be tbWidth / 2, tbHeight, or tbWidth, tbHeight / 2.

[0176] In one embodiment of the present invention, if tbWidth is greater than or equal to MaxTbSizeY and tbWidth is greater than or equal to tbHeight, verSplitFirst may be set to 1; otherwise, verSplitFirst may be set to 0.

[0177] The width and height of the block may be updated according to (4) and (5) of Figure 18. In this case, the updated width and height of the block may be trafoWidth and trafoHeight. In (6) of Figure 18, i.e., trafoWidth and trafoHeight may be used as inputs to 'transform_tree()', which is called again. (6) of Figure 18 may be a process of calling 'transform_tree()' with the coordinates (x0, y0), trafoWidth, and trafoHeight as inputs. In other words, 'transform_tree()' may be called with the same coordinates as the inputs of the existing 'transform_tree()' and the updated block width (i.e., trafoWidth) or the updated block height (i.e., trafoHeight) as inputs.

[0178] Based on verSplitFirst, (8) or (10) of Figure 18 may be performed. When (8) of Figure 18 is performed, 'transform_tree()' may be called with input of coordinates (x0 + trafoWidth, y0), trafoWidth, and trafoHeight. When (10) of Figure 18 is performed, 'transform_tree()' may be called with input of coordinates (x0, y0 + trafoHeight), trafoWidth, and trafoHeight. That is, calling 'transform_tree()' corresponding to the remaining blocks (because the coordinates are different) excluding the block corresponding to (6) of Figure 18 in the existing 'transform_tree()' may be performed as (8) and (10) of Figure 18.

[0179] The process of calling 'transform_tree()' may be done recursively.

[0180] If tbWidth is less than or equal to MaxTbSizeY and tbHeight is less than or equal to MaxTbSizeY, 'transform_unit()' may be called.

[0181] In FIG. 18, x0, y0, tbWidth, and tbHeight may be values ​​based on luma samples and may be the same as those described in FIG. 11. Therefore, size comparison for determining verSplitFirst may be performed based on values ​​based on luma samples. If based on chroma samples, even when the width and height of transform blocks (units) are the same, the tbWidth of a chroma block may be greater than the tbHeight. For example, if the chroma format is 4:2:2 sampling, a situation may occur in which tbWidth is greater than tbHeight and tbWidth / SubWidthC is equal to tbHeight / SubHeightC.

[0182] FIG. 19 is a diagram illustrating TU division according to one embodiment of the present invention.

[0183] The TU division shown in FIG. 19 may represent division according to the syntax of FIG. 18. For example, if the block width (tbWidth) is greater than the maximum transform size (MaxTbSizeY) and the block width (tbWidth) is greater than the block height (tbHeight), a vertical split may be applied to divide the block into one TU on the left and two TUs on the right, as shown in FIG. 19. As described in FIG. 18, if the value of verSplitFirst is 1, the block may be divided into two TUs, one on the left and one on the right, as shown in FIG. 19. At this time, the block may be further divided by calling 'transform_tree()' again. FIG. 19 shows a case where tbHeight is also greater than the maximum transform size (MaxTbSizeY). Division may occur within TU(1) on the left side of Figure 19, and division may occur within TU(2) on the right side of Figure 19. However, according to the syntax of Figure 18, 'transform_tree()' is called recursively, so that operations related to the division performed in TU(1) on the left side may be parsed or performed after all operations related to the division performed in TU2 are parsed or performed. On the other hand, if the width of the block is smaller than the maximum transform size or the width of the block is smaller than the height of the block, the value of verSplit may be determined to be 0. In this case, a horizontal split may be applied to the TU, and the TU may be divided into an upper TU and a lower TU.

[0184] FIG. 20 is a diagram illustrating TU division according to one embodiment of the present invention.

[0185] The TU division in Fig. 20 may be the TU division according to the embodiments described with reference to Figs. 11 to 13. For example, if the block width (tbWidth) is greater than the maximum transform size (MaxTbSizeY) and the block height (tbHeight) is greater than MaxTbSizeY, one TU may be divided into four TUs at once, as shown in Fig. 20. Also, with reference to the embodiments of Figs. 11 to 13, there may be a pre-set order in which the decoding process for the divided TUs is performed. As an example of the pre-set order, the decoding process may be performed in the order of (a), (b), (c), and (d) in Fig. 20.

[0186] However, since the region corresponding to (1) in Figure 19 is (a) and (c) in Figure 20, and the region corresponding to (2) in Figure 19 is (b) and (d) in Figure 20, there may be a problem that the execution orders of the decoding processes for the divided TUs in Figures 19 and 20 are different from each other. In addition, when the syntax order and the decoding process order are different, if the order of the blocks in the syntax and the order of the blocks in the decoding process are different, there is a problem that the complexity of implementation increases. This is because in the decoding process of a certain block, syntax corresponding to the decoding process applied to each block needs to be applied.

[0187] The block decoding process order may be reversed when tbWidth is greater than MaxTbSizeY and tbWidth is greater than tbHeight, as in the embodiments of Figures 19 and 20. Specifically, the block decoding process order may be reversed when tbWidth is greater than MaxTbSizeY, tbWidth is greater than tbHeight, and tbHeight is greater than MaxTbSizeY. For example, when MaxTbSize is 32, tbWidth is 128, and tbHeight is 64, the block decoding process order may be reversed.

[0188] FIG. 21 illustrates a decoding process according to one embodiment of the present invention.

[0189] Although the disclosure of FIG. 21 relates to intra blocks, it is not limited thereto and can also be applied to other embodiments of TU partitioning, such as a residual signal decoding process.

[0190] The decoding process disclosed in FIG. 21 is a decoding process corresponding to the syntax of FIG.

[0191] To solve the above-mentioned problems in embodiments such as FIG. 20, the decoding process related to TU division needs to be modified. As mentioned above, TU division described herein may be equivalent to dividing a TB. The decoding process disclosed in FIG. 21 may be defined as a form in which a TB is divided into two and operates recursively. For example, the TB may be divided into two based on verSplitFirst. Referring to 8-41 and 8-42 of FIG. 21, maxTbWidth and maxTbHeight may be determined in the same manner as in the embodiment of FIG. 12. Furthermore, nTbW and nTbH in FIG. 21 may be values ​​set based on each color component. maxTbWidth and maxTbHeight indicate the width and height of the largest transform block, and nTbW and nTbH indicate the width and height of the block.

[0192] For example, if nTbW is greater than maxTbWidth and nTbW is greater than nTbH, verSplitFirst may be set to 1, otherwise verSplitFirst may be set to 0. Also, newTbW may be set to nTbW / 2 if verSplitFirst is 1, otherwise nTbW (8-44 in FIG. 21). Also, newTbH may be set to nTbH / 2 if verSplitFirst is 0, otherwise nTbH (8-45 in FIG. 21).

[0193] Meanwhile, if verSplitFirst is defined differently in the syntax disclosed in Figure 18, verSplitFirst in Figure 21 may be defined differently. For example, if tbWidth is greater than MaxTbSizeY and tbWidth is greater than or equal to tbHeight in Figure 18, verSplitFirst is set to 1, and otherwise verSplitFirst is set to 0, then verSplitFirst in Figure 21 may be set to 1 if nTbW is greater than maxTbWidth and nTbW is greater than or equal to nTbH, and otherwise 0.

[0194] In step 2 of Fig. 21, Section 8.4.5.1 disclosed in Fig. 21 can be invoked again. At this time, the coordinates of the sample location (xTb0, yTb0), newTbH, and newTbH may be used as input. This may be for the first (left or upper) TU when the TU is divided like the left TU(1) in Fig. 19.

[0195] Also, based on verSplitFirst, Section 8.4.5.1 of Figure 21 may be invoked again in step 3 or 4 of Figure 21. This may be for the second (right or lower) TU when a TU is split, as in the right-hand TU(2) part of Figure 19. When Section 8.4.5.1 of Figure 21 is invoked in step 3 of Figure 21, the coordinates (xTb0 + newTbW, yTb0), newTbH, and newTbH may be used as input. When Section 8.4.5.1 of Figure 21 is invoked in step 4 of Figure 21, the coordinates (xTb0, yTb0 + newTbH), newTbH, and newTbH may be used as input.

[0196] As described above, tbWidth and tbHeight in FIG. 18 may be values ​​based on the luma component, and nTbW and nTbH in FIG. 21 may be values ​​based on each color component. Therefore, when the decoding process disclosed in FIG. 21 is performed on a block of chroma components, a discrepancy may occur between the syntax of FIG. 18 and the decoding process of FIG. 21. For example, the relationship between tbWidth and nTbW may be as follows: For a block of luma components, tbWidth may be equal to nTbW, and tbHeight may be equal to nTbH. For a block of chroma components, tbWidth / SubWidthC may be equal to nTbW, and tbHeight / SubHeightC may be equal to nTbH. Therefore, the result of comparing the width and height of a block to determine verSplit as disclosed in Figure 18 may differ from the result of comparing the width and height of a block to determine verSplit as disclosed in step 1 of Figure 21. For example, the result of tbWidth>tbHeight in Figure 18 may differ from the result of nTbW>nTbH in Figure 21, which results in different verSplitFirst values ​​in Figures 18 and 21.

[0197] FIG. 22 illustrates a decoding process according to one embodiment of the present invention.

[0198] Although the content disclosed in Figure 22 is related to intra blocks, it is not limited thereto and can be applied to other embodiments of TB division, such as a residual signal decoding process, etc. Of the content disclosed in Figure 22, the content that is the same as the content described above will be omitted.

[0199] The content disclosed in Fig. 22 may be a decoding process corresponding to the syntax disclosed in Fig. 18. Also, with reference to Fig. 22, a decoding process for solving the problems described in Figs. 20 to 21, etc., particularly a decoding process related to TB division, will be described.

[0200] Referring to FIG. 22, inputs to an intra block decoding process or a residual signal decoding process may include coordinates (xTb0, yTb0) indicating the position of a block, nTbW indicating the width of the block, nTbH indicating the height of the block, cIdx indicating a color component, and treeType indicating a tree structure. Here, nTbW and nTbH may be the width and height of a transform block. That is, nTbW and nTbH may be the width and height based on the color component of the current block. For example, if the chroma subsampling is 4:2:0 and the width and height of the luma block are 16 and 16, respectively, nTbW and nTbH of the decoding process disclosed in FIG. 22 may be 8 and 8, respectively, for the chroma block (when cIdx is not 0).

[0201] Referring to 8-41 of Figure 22, maxTbWidth may be determined based on cIdx and SubWidthC. For example, if cIdx is 0, maxTbWidth is MaxTbSizeY, and if cIdx is not 0, maxTbWidth may be determined based on MaxTbSizeY and SubWidthC. If cIdx is not 0, maxTbWidth may be set to MaxTbSizeY / SubWidthC.

[0202] Referring to 8-42 of FIG. 22, maxTbHeight may be determined based on cIdx and SubHeightC. For example, if cIdx is 0, maxTbHeight is MaxTbSizeY, and if cIdx is not 0, maxTbHeight may be determined based on MaxTbSizeY and SubHeightC. If cIdx is not 0, maxTbHeight may be set to MaxTbSizeY / SubHeightC.

[0203] If nTbW is greater than maxTbWidth or nTbH is greater than maxTbHeight, the decoding process disclosed in FIG. 22 may be invoked again using a different input. For example, the process may be invoked twice. Also, recursive invocation may occur. The reinvocation of the decoding process disclosed in FIG. 22 may occur when the TB is divided.

[0204] According to an embodiment of the present invention, when a TB is split, it may be split based on nTbW, nTbH, MaxTbSizeY, cIdx, SubWidthC, and SubHeightC, or when a TB is split, it may be split based on nTbW, nTbH, maxTbWidth, cIdx, SubWidthC, and SubHeightC, or when a TB is split, it may be split based on the verSplitFirst value.

[0205] The verSplitFirst value may be determined based on cIdx. For example, when cIdx is 0, the verSplitFirst value may be determined based on nTbW, nTbH, and maxTbWidth. When cIdx is 0, the verSplitFirst value may be determined regardless of SubWidthC and SubHeightC. On the other hand, when cIdx is not 0, that is, when cIdx is 1 or 2, the verSplitFirst value may be determined based on nTbW, nTbH, maxTbWidth, SubWidthC, and SubHeightC.

[0206] Furthermore, the verSplitFirst value may be determined based on one or more conditions. For example, verSplitFirst may be determined based on whether the block width is greater than the maximum transform size. verSplitFirst may be determined based on whether the block height is greater than the maximum transform size. In this case, the result of whether the block width or height is greater than the maximum transform size may be based on either the luma block or the chroma block. In other words, the result is not affected by which color component is used as the reference. Therefore, referring to FIG. 22, the above conditions are checked using input based on each color component. This may be to omit calculations for converting to a luma-based value.

[0207] Furthermore, the one or more conditions for determining the verSplitFirst value may be based on the width and height of the block. For example, the verSplitFirst value may be determined depending on whether the width of the block is greater than the height of the block. In this case, the width and height of the block may be values ​​of a block having a luma component. In other words, the decoder may determine the verSplitFist value by comparing the width and height of the block based on values ​​based on the luma pixels and the luma component. That is, if cIdx is 0 (a luma block), nTbW and nTbH may be used for the one or more conditions. If cIdx is not 0 (a chroma block), nTbW*SubWidthC and nTbH*SubHeightC may be used. Referring to FIG. 22, if cIdx is 0, it is determined whether nTbW is greater than nTbH, and if cIdx is not 0, it is determined whether nTbW*SubWidthC is greater than nTbH*SubHeightC.

[0208] In this case, if one or more of the above conditions are met, the verSplitFirst value may be set to 1; otherwise (if at least one of the one or more conditions is not met), the verSplitFirst value may be set to 0.

[0209] In other words, when comparing the block width with the maximum transform size, the decoder can use a value that takes into account the color components and chroma format, and when comparing the block width with the block height, it can use a value based on the luma component.

[0210] Referring to FIG. 22, the condition for determining the above-mentioned verSplitFirst value can be expressed as the following Equation 2.

[0211]

number

[0212] Referring again to Equation 2, if cIdx is 0, verSplitFirst may be determined as in Equation 3 below.

[0213]

number

[0214] Referring again to Equation 2, if cIdx is not 0 (for example, if cIdx is 1 or 2), verSplitFirst may be determined as in Equation 4 below.

[0215]

number

[0216] An equal sign (=) may be included when comparing sizes in equations 2 to 4. In other words, it can be confirmed whether nTbW is greater than or equal to maxTbWidth, and if cIdx is 0, it can be confirmed whether nTbW is greater than or equal to nTbH, and if cIdx is not 0, it can be confirmed whether nTbW*SubWidthC is greater than or equal to nTbH*SubHeightC. In this case, the equal sign (=) may be included when comparing sizes in the syntax of FIG. 18 as well.

[0217] 22, newTbW and newTbH may be determined based on the verSplitFirst value. For example, if verSplitFirst is 1, newTbW may be determined as nTbW / 2 and newTbH may be determined as nTbH. If verSplitFirst is 0, newTbW may be determined as nTbW and newTbH may be determined as nTbH / 2.

[0218] Referring to FIG. 22, based on verSplitFirst, the decoding process may be re-invoked in steps 2 and 3 of FIG. 22, or the decoding process may be re-invoked in steps 2 and 4.

[0219] In step 2 of Figure 22, the decoding process may be invoked again using the block position (xTb0, yTb0), newTbW, and newTbH, which may be for the first (left or upper) TU of the division, such as the left TU(1) portion of Figure 19.

[0220] In step 3 of Figure 22, the decoding process may be invoked again using block positions (xTb0+newTbW, yTb0), newTbW, and newTbH, which may be for the second (right) TU of the division, such as the right TU(2) portion of Figure 19.

[0221] In step 4 of Figure 22, the decoding process may be invoked again using block positions (xTb0, yTb0+newTbH), newTbW, and newTbH, which may be for the second (lower) TU of the division such as the right TU(2) portion of Figure 19.

[0222] FIG. 23 is a diagram illustrating a high-level syntax according to one embodiment of the present invention.

[0223] The syntax element indicating the maximum transform size may be based on the syntax element indicating the CTU size, CtbSizeY, or CtbSizeY. For example, a maximum transform size larger than the size indicated by the syntax element indicating the CTU size, CtbSizeY, or CtbSizeY may be excluded from the candidates. If the size indicated by the syntax element indicating the CTU size, CtbSizeY, or CtbSizeY is smaller than 64, values ​​equal to or greater than 64 may be excluded from the maximum transform size candidates. When there are two possible values ​​for the maximum transform size, the maximum transform size may be determined based on the size indicated by the syntax element indicating the CTU size, CtbSizeY, or CtbSizeY without signaling the maximum transform size, and the value may be determined. The CTU size refers to the width and height of a coding tree unit, and CtbSizeY refers to the size of a luma coding tree block and the width and height of a chroma coding tree block.

[0224] Referring to FIG. 23 , a syntax element indicating the maximum transform size may be sps_max_luma_transform_size_64_flag. The syntax element indicating the maximum transform size may indicate the maximum transform size as 64 or a value smaller than 64. If CtbSizeY is smaller than 64, sps_max_luma_transform_size_64_flag may be inferred rather than signaled. For example, if the value of sps_max_luma_transform_size_64_flag is 1, indicating that the maximum transform size is 64, if CtbSizeY is smaller than 64, the value of sps_max_luma_transform_size_64_flag may be inferred as 0. Alternatively, the value of MaxTbLog2SizeY may be determined as 5, or the value of MaxTbSizeY may be determined as 32.

[0225] If the minimum CtbSizeY is 32, the above-mentioned cases where CtbSizeY is smaller than 64 may be the same as when CtbSizeY is 32. For example, if CtbsizeY is 32, the value of sps_max_luma_transform_size_64_flag may be inferred as 0, and therefore the maximum transform size (MaxTbSizeY) value may be determined as 32.

[0226] FIG. 24 is a diagram illustrating a high-level syntax according to one embodiment of the present invention.

[0227] If the maximum transform size is restrictive, then the maximum size for which a subblock transform (SBT) may be used may also be restrictive. For example, the maximum size for which an SBT may be used may be less than or equal to the maximum transform size. Accordingly, the syntax element indicating the maximum size for which an SBT may be used may vary. For example, the syntax element indicating the maximum size for which an SBT may be used may be signaled based on the maximum transform size or the syntax element indicating the maximum transform size.

[0228] 24, if the maximum transform size is smaller than 64, the syntax element indicating whether the maximum size for which SBT may be used is 64 is not signaled, and the maximum size for which SBT may be used may be inferred. The syntax element indicating that the maximum size for which SBT may be used is 64 may be sps_sbt_max_size_64_flag. Referring to FIG. 24, if the value of sps_sbt_enabled_flag is 1 and the value of sps_max_luma_transform_size_64_flag is 1 (i.e., sps_sbt_enabled_flag && sps_max_luma_transform_size_64_flag), sps_sbt_max_size_64_flag is signaled, and if not, sps_sbt_max_size_64_flag is not signaled. Also, if sps_sbt_max_size_64_flag is not present, the value of sps_sbt_max_size_64_flag may be inferred to be 0. Alternatively, if sps_sbt_max_size_64_flag is not present, its value may be inferred to be the value of sps_max_luma_transform_size_64_flag. In this case, MaxSbtSize may be set to 64 if sps_sbt_max_size_64_flag is 1, or to 32 if sps_sbt_max_size_64_flag is 0, as disclosed in 7-31 of FIG.

[0229] FIG. 25 is a diagram illustrating a transform tree syntax according to one embodiment of the present invention.

[0230] In FIG. 25, the conditions for determining the verSplitFirst value described with reference to the syntax in FIG. 18 have been changed, and other similar descriptions will be omitted.

[0231] The TU splitting method may differ depending on the tree type. For example, if the tree type is DUAL_TREE_CHROMA, TU splitting may be performed based on the width and height of a block having each color component, i.e., a chroma component. In the embodiment of FIG. 18, verSplitFirst is determined using the condition disclosed in (3) of FIG. 18. However, if the tree type is DUAL_TREE_CHROMA, verSplitFirst may be determined using the condition disclosed in (2) of FIG. 25.

[0232] When determining the width and maximum transform size of a block, it may be based on luma or each color component, and the input of the transform tree syntax 'transform_tree()' may use a luma-based value. However, when comparing the width and height of a block, it may use a chroma-based value. That is, it is possible to compare tbWidth / SubWidthC with tbHeight / SubHeightC. Specifically, it is possible to check whether tbWidth / SubWidthC is greater than tbHeight / SubHeightC.

[0233] Thus, when the tree type is a dual tree, TU division for the chroma components may be performed according to the same criteria as for the luma component.

[0234] Referring to Figure 25, if the tree type is SINGLE_TREE or DUAL_TREE_LUMA, the decoder may determine verSplitFirst by performing step (1) of Figure 25. That is, the split may be determined using a value based on the luma component. If the tree type is DUAL_TREE_CHROMA, the decoder may determine verSplitFirst by performing step (2) of Figure 25. That is, the split may be determined using a value based on the chroma component.

[0235] FIG. 26 illustrates a decoding process according to one embodiment of the present invention.

[0236] An embodiment of the decoding processor disclosed in Figure 26 may be a decoding process corresponding to the syntax disclosed in Figure 25. As mentioned above, TU division described in this specification may be equivalent to dividing a TB.

[0237] The method for determining TB split or verSplitFirst may be determined based on cIdx, tree type, etc. For example, if cIdx is 0, verSplitFirst may be determined using the block width and block height based on each color component. If the tree type is DUAL_TREE_CHROMA, verSplitFirst may be determined using the block width and block height based on each color component. If cIdx is not 0 and the tree type is not DUAL_TREE_CHROMA (i.e., if cIdx is not 0 and the tree type is SINGLE_TREE), verSplitFirst may be determined using the block width and block height based on the luma component.

[0238] That is, if cIdx is 0 or the tree type is DUAL_TREE_CHROMA (if cIdx==0||treeType==DUAL_TREE_CHROMA), verSplitFirst may be determined by comparing whether nTbW is greater than nTbH. That is, verSplitFirst may be determined without using SubWidthC and SubHeightC. If cIdx is not 0 and the tree type is not DUAL_TREE_CHROMA (if cIdx!=0&&treeType!=DUAL_TREE_CHROMA), verSplitFirst may be determined by comparing whether nTbW / SubWidthC is greater than nTbH / SubHeightC.

[0239] The maximum transform skip size may be smaller than the maximum transform size. For example, if the maximum transform size is variable, the maximum transform skip size may vary accordingly. Therefore, if the maximum transform size is variable, the method for signaling the maximum transform skip size may vary accordingly.

[0240] The maximum transform size and the maximum transform skip size may be the same. In this case, when the size of a CU or PU is larger than the maximum transform size, whether a transform skip is used for a divided TU may be shared. In other words, when the size of a CU or PU is larger than the maximum transform size, signaling of a syntax element indicating whether a transform skip is used for a divided TU may be partially omitted. This is because the residual signal form of a divided TU may be similar when the size of a CU or PU is larger than the maximum transform size. Sharing whether a transform skip is used for a divided TU or omitting signaling of a related syntax element may be limited to when a variable maximum transform size or a variable maximum transform skip size is used and the maximum transform size and the maximum transform skip size are the same. Furthermore, sharing whether a transform skip is used for a divided TU may be limited to when a transform skip is used for a reference TU, for example, the first TU. In other words, if a transform skip is not used for the reference TU, whether a transform skip is used for other divided TUs may be signaled. In addition, whether or not transform skip is used for a TU that has already been split in a set order is signaled, and once it is signaled that transform skip is used for a particular TU, thereafter, a syntax element indicating whether transform skip is used for the TU is not signaled, and it may be determined that transform skip is used.

[0241] If whether transform skip is used for a split TU is shared or signaling of related syntax elements is omitted, signaling of syntax elements for whether transform skip is used at the CU or PU level is possible.

[0242] FIG. 27 illustrates a method for performing BDPCM according to one embodiment of the present invention.

[0243] BDPCM (Block-Based Delta Pulse Code Modulation) may be an (intra) prediction method or a coding method. BDPCM may have unique features in its prediction method and residual signal generation method. That is, BDPCM may be a method of coding and signaling a value based on the difference of a specific value (e.g., a residual signal, a prediction signal, a picture sample, or a reconstructed sample). For example, an encoder signals a value based on the difference of a specific value, and a decoder can reconstruct the specific value based on the signaling. In this case, the decoder's reconstruction process must reverse the process of calculating the difference of the specific value and perform an addition process based on the signaled value to reconstruct the specific value. BDPCM may also be referred to as RDPCM (Quantized Residual Differential Pulse Coded Modulation).

[0244] A syntax element may exist that indicates whether BDPCM is used. For example, the syntax element may be BdpcmFlag or intra_bdpcm_flag. Signaling of the syntax element indicating whether BDPCM is used may be performed at the CU level. Also, a syntax element may exist at a higher level that indicates whether BDPCM is used. For example, a syntax element at a higher level that indicates whether BDPCM is used may be sps_bdpcm_enabled_flag. Also, the higher level at which the syntax element is signaled may be the SPS level, slice level, tile level, or tile group level. If signaling of a syntax element at a higher level that indicates whether BDPCM is used is possible, signaling of a syntax element that indicates whether BDCPM is used may not be performed. Furthermore, if it is not possible to signal a syntax element at a higher level that indicates whether BDCPM is used, then signaling of a syntax element that indicates whether BDCPM is used may not be performed.

[0245] The prediction mode of BDPCM may be restrictive. A syntax element indicating the prediction mode of BDPCM may be BdpcmDir or intra_bdpcm_dir_flag. When BDPCM is used, the prediction mode may be an angular mode. Specifically, when BDPCM is used, the prediction mode may be a horizontal mode (mode18; INTRA_ANGULAR18) or a vertical mode (mode50; INTRA_ANGULAR50). Therefore, when BDPCM is used, a predicted sample value at a certain position may be the same as a reference sample corresponding to the left of the certain position in horizontal mode. Also, when BDPCM is used and in horizontal mode, predicted samples corresponding to the same row (i.e., predicted samples with the same y-coordinate) may have the same value. Also, when BDPCM is used, a predicted sample value at a certain position may be the same as a reference sample corresponding to the above of the certain position in vertical mode. Also, when BDPCM is used and the vertical mode is used, predicted samples corresponding to the same column (ie, predicted samples with the same x coordinate) may have the same value.

[0246] FIG. 27(a) is a diagram showing prediction mode derivation of BDPCM. Referring to FIG. 27(a), prediction mode derivation of BDPCM may be based on BdpcmDir. In FIG. 27(a), a value of 1 for BdpcmFlag may indicate the use of BDPCM. IntraPredModeY may be a value indicating a prediction mode. Specifically, IntraPredModeY may be a value indicating a prediction mode for the luma component. For example, based on BdpcmDir, IntraPredModeY may be set to INTRA_ANGULAR50 or INTRA_ANGULAR18. When the value of BdpcmDir is 1, IntraPredModeY may be set to INTRA_ANGULAR50, which indicates a vertical mode. When the value of BdpcmDir is 0, IntraPredModeY may be set to INTRA_ANGULAR18, which indicates a horizontal mode. A prediction operation may be performed based on IntraPredModeY.

[0247] There may be a method of generating a residual signal or a scaling and transformation (transform) method for BDPCM. As described above, when BDPCM is used, a value based on a difference between specific values ​​may be coded and signaled. For example, when BDPCM is used, a residual signal or a value based on a difference between values ​​based on a residual signal may be coded and signaled. The signaled value corresponding to a sample at a first position may be the difference between a value at a second position relative to the first position and the value at the first position. Specifically, the signaled value corresponding to a sample at a first position may be the difference between a value at a second position, which is a position adjacent to the first position, and the value at the first position. The signaled value corresponding to a sample at a first position (x, y) may be the difference between a value at a second position (x-1, y) and the value at the first position in horizontal mode. Also, the signaled value corresponding to a sample at a first position (x, y) may be the difference between a value at a second position (x, y-1) and the value at the first position in vertical mode. In this case, the value of the second position and the value of the first position may be a residual signal or a value based on the residual signal.

[0248] FIG. 27(b) illustrates the operation of the decoder when BDPCM is used. Referring to FIG. 27(b), dz may be an array created based on values ​​signaled by a syntax element. In addition, in horizontal mode, the dz[x][y] value may be set based on dz[x][y] and dz[x-1][y]. For example, in horizontal mode, the dz[x][y] value may be set based on (dz[x-1][y] + dz[x][y]) (8-961 in FIG. 27(b)). This setting may be performed when x is greater than 0 (when not bordering the left boundary of the block). When x is 0, dz[x][y] may remain unchanged. In vertical mode, the dz[x][y] value may be set based on dz[x][y] and dz[x][y-1]. In vertical mode, the dz[x][y] value may be set based on (dz[x][y-1] + dz[x][y]) (8-962 in FIG. 27(b)). This setting may be performed when y is greater than 0 (when the block does not touch the top boundary), and when y is 0, dz[x][y] may remain as dz[x][y]. The reason dz is calculated based on the sum (+) operation is because the signaled signal is based on the difference (-) operation. For example, the signaled signal dz[x][y] may be set to (dz[x][y] - dz[x-1][y]) in horizontal mode, and may be set to (dz[x][y] - dz[x][y-1]) in vertical mode. Therefore, to restore this, the decoder can perform a calculation based on the sum operation. Furthermore, dnc[x][y] may be derived based on the dz[x][y] value, and d[x][y] may be derived (8-963, 8-964 in FIG. 27(b)).

[0249] In one embodiment of the present invention, the transform may be performed based on d[x][y]. At this time, performing the transform may include performing a transform skip mode. That is, performing the transform may include not performing an operation based on a transformation matrix. When BDPCM is used, the transform skip mode may always be used. When BDPCM is used, the value of transform_skip_flag, which is a syntax element indicating whether the transform skip mode is used, may always be 1. When the transform skip mode is used, the residual signal may be determined without multiplying a vector or a matrix by the d[x][y]. When the transform skip mode is used, the residual signal may be determined without performing an operation other than bit shift or rounding on the d[x][y]. For example, when the transform skip mode is used, the value of (d[x][y] << tsShift) may be the residual sample array value r[x][y]. Here, tsShift may be a value determined based on the width and height of the transform block. Also, the intermediate residual sample and the residual sample may be determined based on r[x][y]. Also, BDPCM may be available only when the transform skip mode is applied. This is because the transform skip mode is available when BDPCM is used. For example, signaling of a syntax element at a higher level indicating that BDPCM is available may be performed only when a syntax element signaled at a higher level indicates that the transform skip mode is available.

[0250] FIG. 28 is a diagram showing syntax related to BDPCM according to an embodiment of the present invention.

[0251] If a syntax element signaled at a higher level indicating whether BDPCM is usable indicates that BDPCM is usable, then BDPCM may be used. Referring to Figure 28, whether intra_bdpcm_flag is parsed may be determined based on sps_bdpcm_enabled_flag.

[0252] In addition, the block size for which transform skip may be used may be limited. For example, the maximum value of the width or height of a block for which transform skip may be used may be MaxTsSize. Therefore, if the width of a block is equal to or less than MaxTsSize and the height of the block is equal to or less than MaxTsSize, transform skip may be used. On the other hand, if the width of a block is greater than MaxTsSize or the height of a block is greater than MaxTsSize, transform skip may not be used. Since transform is performed at the TU level, the width and height of a block may be the width and height of a transform block. In this case, the width of a transform block may be represented as tbWidth, and the height of a transform block may be represented as tbHeight. Since BDPCM uses transform skip, whether BDPCM can be used may be determined based on MaxTsSize. Furthermore, whether BDPCM can be used may be signaled at the CU level. Therefore, whether BDPCM can be used may be determined based on the width and height (which may be written as cbWidth and cbHeight) of the coding block (CB) and MaxTsSize. For example, if cbWidth is equal to or less than MaxTsSize and cbHeight is equal to or less than MaxTsSize, BDPCM may be usable. If cbWidth is greater than MaxTsSize or cbHeight is greater than MaxTsSize, BDPCM may not be usable. Referring to FIG. 28, if cbWidth<=MaxTsSize and cbHeight<=MaxTsSize, intra_bdpcm_flag may be parsed, and if cbWidth>MaxTsSize or cbHeight>MaxTsSize, intra_bdpcm_flag may not be parsed. In this case, if intra_bdpcm_flag is not present, its value may be inferred to be 0.

[0253] According to an embodiment of the present invention, MaxTsSize may be selected from a plurality of values. For example, MaxTsSize may be a value equal to or less than 32. Alternatively, MaxTsSize may be a value equal to or less than MaxTbSizeY. Alternatively, MaxTsSize may be one of 32, 16, 8, and 4. A syntax element for determining MaxTsSize may exist. For example, a value based on Log2(MaxTsSize) may be signaled. log2_transform_skip_max_size_minusN may be signaled, and MaxTsSize may be (1<<(log2_transform_skip_max_size_minusN+N)). Specifically, N may be 2, in which case log2_transform_skip_max_size_minus2 may be signaled, and MaxTsSize may be (1<<(log2_transform_skip_max_size_minus2+2)). In this case, log2_transform_skip_max_size_minus2 may be a value ranging from 0 to 3, and in this case, MaxTsSize may be any one of 4, 8, 16, and 32. A syntax element for determining MaxTsSize may be signaled at a higher level, for example, at the picture parameter set or slice level.

[0254] FIG. 29 is a diagram showing conditions under which BDPCM can be used according to one embodiment of the present invention.

[0255] Referring to FIG. 28, BDPCM is usable when the width (cbWidth) and height (cbHeight) of a coding block are equal to or less than MaxTsSize. If MaxTbSizeY is greater than MaxTsSize and the width and height of a coding block are equal to or less than MaxTsSize, the width and height of the coding block may be equal to the width and height of a transform block. In this case, TU division does not occur. Specifically, when MaxTbSizeY is 64 and MaxTsSize is 32 or less, if cbWidth is equal to or less than MaxTsSize and cbHeight is equal to or less than MaxTsSize, cbWidth may be equal to tbWidth and cbHeight may be equal to tbHeight. Therefore, the statement that BDPCM is usable when cbWidth and cbHeight are equal to or less than MaxTsSize may be the same as the statement that BDPCM is usable when tbWidth and tbHeight are equal to or less than MaxTsSize.

[0256] However, according to one embodiment of the present invention, MaxTbSizeY may be equal to or smaller than MaxTsSize. In this case, if cbWidth is larger than MaxTsSize or cbHeight is larger than MaxTsSize, BDPCM can be used. In this case, TU division may occur, and the width and height of the transform block after TU division may be equal to or smaller than MaxTsSize. When MaxTbSizeY is equal to MaxTsSize, if cbWidth is larger than MaxTsSize or cbHeight is larger than MaxTsSize, TU division may occur, and the width and height of the transform block after TU division may be equal to MaxTbSizeY. Therefore, transform skip mode, which is a mode used in BDPCM, can be performed. This is because transform skip mode is performed at the TU level. When BDPCM is available, intra_bdpcm_flag may be parsed.

[0257] Therefore, BDPCM can be used even if MaxTbSizeY and MaxTsSize are the same. Alternatively, if a syntax element signaled at a higher level indicating whether BDPCM can be used indicates that BDPCM can be used and MaxTbSizeY and MaxTsSize are the same, BDPCM can be used. Alternatively, if MaxTbSizeY and MaxTsSize are different, BDPCM can be used if cbWidth is less than or equal to MaxTsSize and cbHeight is less than or equal to MaxTsSize. Alternatively, if a syntax element signaled at a higher level indicating whether BDPCM can be used indicates that BDPCM can be used and MaxTbSizeY and MaxTsSize are different, BDPCM can be used if cbWidth is less than or equal to MaxTsSize and cbHeight is less than or equal to MaxTsSize. On the other hand, if MaxTbSizeY and MaxTsSize are different, or if cbWidth is larger than MaxTsSize or cbHeight is larger than MaxTsSize, BDPCM cannot be used.

[0258] When BDPCM is available, intra_bdpcm_flag, a syntax element indicating whether BDPCM can be used, may be parsed.

[0259] As described above, MaxTbSizeY may have a value of 32 or greater. Specifically, MaxTbSizeY may have a value of 32 or 64. Furthermore, MaxTsSize may have a value of 32 or less. Specifically, MaxTsSize may have a value of 4, 8, 16, or 32. Therefore, if MaxTbSizeY and MaxTsSize are the same, MaxTbSizeY may be 32 and MaxTsSize may be 32.

[0260] 29(a) and (b) are diagrams showing syntax structures related to the above-described embodiment.

[0261] Referring to FIG. 29(a), intra_bdpcm_flag may be parsed when the value of sps_bdpcm_enabled_flag is 1 and at least one of the following two conditions is met:

[0262] Condition a-1)cbWidth<=MaxTsSize&&cbHeight<=MaxTsSize

[0263] Condition a-2) MaxTbSizeY==32&&MaxTsSize==32

[0264] On the other hand, if both conditions a-1 and a-2 are not met, intra_bdpcm_flag may not be parsed. On the other hand, if intra_bdpcm_flag does not exist, the value of intra_bdpcm_flag may be inferred to be 0.

[0265] Referring to FIG. 29(b), intra_bdpcm_flag may be parsed when the value of sps_bdpcm_enabled_flag is 1 and at least one of the following two conditions is met:

[0266] Condition b-1)cbWidth<=MaxTsSize&&cbHeight<=MaxTsSize

[0267] Condition b-2) MaxTbSizeY==MaxTsSize

[0268] On the other hand, if both conditions b-1 and b-2 are not satisfied, intra_bdpcm_flag may not be parsed. On the other hand, if intra_bdpcm_flag does not exist, the value of intra_bdpcm_flag may be inferred to be 0.

[0269] FIG. 30 is a diagram illustrating CIIP and intra prediction according to one embodiment of the present invention.

[0270] CIIP is an abbreviation for combined inter- and intra-prediction or combined inter-picture merge and intra-picture prediction. CIIP refers to a method of combining an intra prediction signal and an inter prediction signal when generating a prediction signal. When CIIP is used, the intra prediction method or inter prediction method may be limited. For example, when CIIP is used, only planar mode (MODE_PLANAR) or merge mode may be used as the intra prediction mode. When CIIP is used for a coding block (CB) or a coding unit (CU), intra prediction may be performed on the entire coding block. That is, when CIIP is used for a CB or a CU, intra prediction may be performed on a block having a size of (cbWidth x cbHeight). In other words, when CIIP is used for CB or CU, intra prediction may be performed without TU division. Even if CB is larger than the maximum transform size, intra prediction may be performed without TU division when CIIP is used.

[0271] The block size for which CIIP may be used may be restricted. In this case, the restricted block size may be a fixed value. The maximum value of the block size for which CIIP may be used may be predetermined. For example, if the width (cbWidth) or height (cbHeight) of a block is 128 or greater than or equal to 128, CIIP may not be used. If cbWidth is less than 128, cbHeight is less than 128, and cbWidth*cbHeight is greater than or equal to 64, CIIP may be used.

[0272] Figure 30 shows the CIIP mode and intra prediction mode when the CB or CU is 64x64. When the CIIP mode is used, inter prediction for a 64x64 size block and intra prediction for a 64x64 size block may be performed. Furthermore, a 64x64 size predicted block (predicted block, "Combined inter and intra predicted block" in Figure 30) may be generated based on the inter prediction and the intra prediction.

[0273] When an intra prediction mode is not used (i.e., when only the current picture is used, or when no reference picture is used, or when CuPredMode is MODE_INTRA), the TBs divided from the 64x64 size CB may be determined based on MaxTbSizeY. For example, when MaxTbSizeY is smaller than 64 (e.g., 32), the 64x64 size CB may be divided into 32x32 size TUs, and intra prediction may be performed on each of the divided TUs. Therefore, four 32x32 size predicted blocks may be generated.

[0274] In this case, there may be a problem that intra prediction in the CIIP mode and intra prediction in the intra prediction mode are not aligned with each other. In other words, when the CIIP mode is used, intra prediction may be performed on blocks larger than 32×32, and intra prediction in the intra prediction mode may be performed on blocks equal to or smaller than 32×32. Therefore, the intra prediction mode requires hardware and software capable of processing intra prediction for blocks equal to or smaller than 32×32, while the CIIP mode requires hardware and software capable of processing intra prediction for blocks larger than 32×32. This may impose a significant burden on implementation. For example, an encoder may want to reduce the burden on hardware and software by limiting the maximum transform size to 32 instead of 64 and performing intra prediction on smaller blocks, but may need to prepare intra prediction for blocks larger than 32 to use the CIIP mode.

[0275] FIG. 31 is a diagram illustrating merge data syntax according to an embodiment of the present invention.

[0276] According to one embodiment of the present invention, a grouping method may be used as a merge mode signaling method. For example, group_1_flag may be signaled, and a decoder may determine whether a selected mode belongs to group 1 based on group_1_flag. If group_1_flag indicates that the selected mode does not belong to group 1, group_2_flag may be signaled. Furthermore, a decoder may determine whether a selected mode belongs to group 2 based on group_2_flag. This operation may also be performed when multiple groups exist. Furthermore, signaling may exist to indicate a mode within a group. The grouping method may reduce the signaling depth compared to the sequential signaling method. Furthermore, the maximum length of signaling (e.g., the maximum length of a codeword) may be reduced.

[0277] The grouping method will be specifically described below.

[0278] First, assume that there are three groups. A specific group may include one or more modes. For example, group 1 may include one mode. Group 2 and group 3 may each include two modes. Group 1 may include a subblock merge mode, group 2 may include a regular merge mode and MMVD (Merge with Motion Vector Difference), and group 3 may include CIIP and triangle merge mode. group_1_flag may be merge_subblock_flag, and group_2_flag may be regular_merge_flag. Syntax elements indicating the mode within group may include ciip_flag and mmvd_merge_flag. In one embodiment, merge_subblock_flag may be signaled, and whether the current mode is the subblock merge mode may be determined based on merge_subblock_flag. If the current mode is not the subblock merge mode, regular_merge_flag may be signaled. The decoder can determine whether the mode is included in group 2 (regular merge mode or MMVD) or group 3 (CIIP or triangular merge mode) based on regular_merge_flag. In this case, if regular_merge_flag indicates group 2, the decoder can determine whether the current mode is regular merge mode or MMVD based on mmvd_merge_flag. On the other hand, if regular_merge_flag indicates group 3, the decoder can determine whether the current mode is CIIP or triangular merge mode based on ciip_flag.

[0279] Referring to FIG. 31 , when a merge mode is used, merge_subblock_flag may be signaled. An example of when the merge mode is used may be as described above, or when general_merge_flag is 1. The present invention may also be applied when CuPredMode is not MODE_IBC or when CuPredMode is MODE_INTER. A decoder can determine whether to parse merge_subblock_flag based on MaxNumSubblockMergeCand and block size. When the value of merge_subblock_flag is 1, the decoder can determine to use the subblock merge mode and further determine the candidate index based on merge_subblock_idx. When the value of merge_subblock_flag is 0, the decoder can parse regular_merge_flag. In this case, there may be a condition for parsing regular_merge_flag. For example, there may be a condition based on block size. In addition, there may be a condition based on a syntax element signaled at a higher level indicating whether a mode is enabled. In this case, the syntax elements signaled at a higher level indicating whether a mode is enabled may be sps_ciip_enabled_flag and sps_triangle_enabled_flag. In this case, sps_triangle_enabled_flag may be a syntax element signaled at a higher level indicating whether a decoder can use triangle mode, and may be signaled in a sequence parameter set. In addition, there may be a condition based on the slice type. In addition, there may be a condition based on cu_skip_flag. In this case, cu_skip_flag may be a syntax element indicating whether skip mode is enabled.When skip mode is used, the residual signal does not need to be signaled, so that when skip mode is used, the decoder can reconstruct the block from the prediction signal without the residual signal (or transform coefficients).

[0280] Conditions related to block size for which CIIP may be used may be that block width * block height is 64 or greater, block width is less than 128, and block height is less than 128. Also, a block size condition for which triangular merge mode may be used may be that block width * block height is 64 or greater. Referring to FIG. 31, if the condition that block width * block height is 64 or greater is not met, the decoder does not need to parse regular_merge_flag. Also, if the block width is equal to (or greater than) 128 or the block height is equal to (or greater than) 128, the decoder can parse regular_merge_flag.

[0281] Specifically, a decoder can parse regular_merge_flag if the following conditions are met: i) when the value of sps_ciip_enabled_flag is 1, the value of cu_skip_flag is 0, the block width is less than 128, and the block height is less than 128, the block width * block height is greater than or equal to 64. Or, ii) when the value of sps_triangle_enabled_flag is 1, the value of MaxNumTriangleMergeCand is greater than 1, and slice_type is B, the decoder can parse regular_merge_flag if the following conditions are met:

[0282] Meanwhile, if the above-mentioned conditions for parsing regular_merge_flag are not satisfied, i.e., if the following conditions are not satisfied: i) sps_ciip_enabled_flag is 1, cu_skip_flag is 0, the block width is less than 128, and the block height is less than 128; or ii) sps_triangle_enabled_flag is 1, MaxNumTriangleMergeCand is greater than 1, and slice_type is B, the decoder does not need to parse regular_merge_flag. In this case, MaxNumTriangleMergeCand may be the maximum number of candidates available for the triangle (merge) mode. In addition, slice_type may be signaling indicating a slice type. If slice_type is B, it indicates that bi-prediction may be used. When slice_type is P, it indicates that bi-prediction is not used and uni-prediction may be used. When slice_type is P or B, it indicates that inter-prediction may be used. When slice_type is I, it indicates that inter-prediction may not be used.

[0283] Also, referring to FIG. 31, a condition based on the block size may be used when the decoder determines whether to parse ciip_flag. For example, if the block width is less than 128 and the block height is less than 128, the decoder can parse ciip_flag. On the other hand, if the block width is 128 (or is greater than or equal to 128) or the block height is 128 (or is greater than or equal to 128), the decoder does not need to parse ciip_flag. This is because if the block width or block height is 128 (or is greater than or equal to 128), only one of CIIP and triangle merge mode can be used. For example, CIIP cannot be used, and only triangle merge mode can be used.

[0284] In the present invention, when ciip_flag is parsed, it can mean that CIIP is used, or when ciip_flag is parsed, it can mean that CIIP or triangular merge mode is used.

[0285] Conditions under which CIIP may be used include when the value of sps_ciip_enabled_flag is 1 and the value of cu_skip_flag is 0. In addition, conditions related to block size under which CIIP may be used include when block width * block height is 64 or more, block width is less than 128, and block height is less than 128.

[0286] Conditions under which the triangle merge mode may be used include when the value of sps_triangle_enabled_flag is 1, the value of MaxNumTriangleMergeCand is greater than 1, and slice_type is B. In addition, conditions related to block size under which the triangle merge mode may be used include when the block width * block height is 64 or greater.

[0287] If the above-mentioned conditions for which CIIP may be used or the above-mentioned conditions for which triangular merge mode may be used are met, the decoder can parse regular_merge_flag. On the other hand, if neither the conditions for which CIIP may be used nor the conditions for which triangular merge mode may be used are met, the decoder does not need to parse regular_merge_flag.

[0288] If regular_merge_flag is not present, the value of regular_merge_flag may be inferred to be 1. In the present invention, if the value of regular_merge_flag is 1, the regular merge mode or MMVD may be used. Therefore, if both the conditions related to the block size for which the above-mentioned CIIP may be used and the conditions related to the block size for which the above-mentioned triangular merge mode may be used are not met, the usable modes may be the regular merge mode and MMVD, and in this case, regular_merge_flag may not be parsed and may be determined to be 1.

[0289] Also, if both the conditions under which the above-mentioned CIIP may be used and the conditions under which the above-mentioned triangular merge mode may be used are not met, the available modes may be regular merge mode or MMVD, so regular_merge_flag may not be parsed and may be inferred to 1.

[0290] Referring to Figure 31, if the value of regular_merge_flag is 1, syntax elements may be parsed based on the sps_mmvd_enabled_flag value. sps_mmvd_enabled_flag may be a syntax element signaled at a higher level that indicates whether the MMVD is enabled or not. If the value of sps_mmvd_enabled_flag is 0, the MMVD may not be used. Referring to Figure 31, if the value of sps_mmvd_enabled_flag is 0, mmvd_merge_flag, mmvd_cand_flag, mmvd_distance_idx, and mmvd_direction_idx may not be parsed. If mmvd_merge_flag is not present, the value of mmvd_merge_flag may be inferred to be 0.

[0291] Also, referring to Figure 31, if the value of regular_merge_flag is 0, and both the above-mentioned conditions for using CIIP and the above-mentioned conditions for using triangular merge mode are met, the decoder can parse ciip_flag. In this case, if the value of ciip_flag is 1, CIIP is used, and if the value of ciip_flag is 0, triangular merge mode may be used. A value of ciip_flag of 0 may mean that CIIP is not used. On the other hand, if the above-mentioned conditions for using CIIP or the above-mentioned conditions for using triangular merge mode are not met, the decoder does not need to parse ciip_flag.

[0292] If ciip_flag is not present, the value of ciip_flag may be inferred to be 1 if all of the following conditions are met. Conversely, the value of ciip_flag may be inferred to be 0 if any of the following conditions are not met:

[0293] Condition c-1) sps_ciip_enabled_flag==1

[0294] Condition c-2) general_merge_flag==1

[0295] Condition c-3) merge_subblock_flag==0

[0296] Condition c-4) regular_merge_flag==0

[0297] Condition c-5)cbWidth<128

[0298] Condition c-6)cbHeight<128

[0299] Condition c-7)cbWidth*cbHeight>=64

[0300] Condition c-8) cu_skip_flag==0

[0301] The sps_ciip_enabled_flag may be a syntax element signaled at a higher level indicating whether CIIP is used. The sps_ciip_enabled_flag may be signaled in a sequence parameter set. The general_merge_flag may be a syntax element indicating whether a merge mode is used. The merge_subblock_flag may be a syntax element indicating whether a subblock merge mode is used. In this case, the subblock merge mode may be an affine merge mode or subblock-based temporal motion vector prediction (SbTMVP). The regular_merge_flag may be a syntax element indicating whether an existing merge mode (e.g., regular merge mode) or MMVD is used.

[0302] FIG. 32 is a diagram illustrating merge data syntax according to one embodiment of the present invention.

[0303] As described above, the block size that may be used in CIIP is limited, and in this case, the block size may be a fixed value. Also, if the maximum transform size is variable, there is a problem that intra prediction in the CIIP mode and intra prediction in the intra prediction mode are not aligned with each other.

[0304] A method for solving this problem will be described below with reference to FIG. 32. Referring to FIG. 32, the block size for which the CIIP mode may be used may be variable. Specifically, the block size for which the CIIP mode may be used may be based on MaxTbSizeY. For example, if the block width is equal to or less than MaxTbSizeY and the block height is equal to or less than MaxTbSizeY, the CIIP mode may be used. Also, if the block width is greater than MaxTbSizeY or the block height is greater than MaxTbSizeY, the CIIP may not be used. In this case, the block width and block height may be the width and height of the coding block (unit). Since the block width and height are determined based on MaxTbSizeY, the intra prediction size in the CIIP mode is limited to or less than MaxTbSizeY, and the existing intra prediction size is also limited to or less than MaxTbSizeY, so that intra prediction can be performed using a unified method, hardware, and software. This has the effect of reducing the resources required for hardware and software. Even when MaxTbSizeY is 32, both intra prediction in CIIP mode and conventional intra prediction may be performed on blocks of 32x32 or smaller size.

[0305] 32, conditions for using the CIIP mode may include when the value of sps_ciip_enabled_flag is 1, cbWidth is less than or equal to MaxTbSizeY, cbHeight is less than or equal to MaxTbSizeY, cbWidth*cbHeight is greater than or equal to 64, and the value of cu_skip_flag is 0. Therefore, the CIIP mode is not used when the value of sps_ciip_enabled_flag is 0, cbWidth is greater than MaxTbSizeY, cbHeight is greater than MaxTbSizeY, cbWidth*cbHeight is less than 64, or the value of cu_skip_flag is not 0. A decoder can parse ciip_flag if the conditions for using the CIIP mode are met. Furthermore, a decoder can parse regular_merge_flag if the conditions for using the CIIP mode are met. Additionally, decoders may consider additional conditions when parsing ciip_flag or regular_merge_flag, and may not parse ciip_flag if CIIP mode may not be used.

[0306] Conditions for triangle(merge) mode to be used include when the value of sps_triangle_enabled_flag is 1, the value of MaxNumTriangleMergeCand is greater than 1, slice_type is B, and cbWidth*cbHeight is 64 or greater.

[0307] In this case, if both the conditions for using the CIIP mode and the conditions for using the triangular (merge) mode are satisfied, the decoder may parse ciip_flag. If either the conditions for using the CIIP mode or the conditions for using the triangular (merge) mode are not satisfied, the decoder may not parse ciip_flag. Also, if ciip_flag is not present and the conditions for using the CIIP mode are not satisfied, the value of ciip_flag may be inferred as 0. Also, if ciip_flag is not present, the conditions for using the CIIP mode are satisfied, the value of general_merge_flag is 1, the value of merge_subblock_flag is 0, and the value of regular_merge_flag is 0, the value of ciip_flag may be inferred as 1.

[0308] If either the condition for using the CIIP mode or the condition for using the triangular (merge) mode is satisfied, the decoder may parse regular_merge_flag. If neither the condition for using the CIIP mode nor the condition for using the triangular (merge) mode is satisfied, the decoder may not parse regular_merge_flag. In this case, if regular_merge_flag does not exist, the value of regular_merge_flag may be inferred as (general_merge_flag && !merge_subblock_flag).

[0309] 32, if cbWidth is less than or equal to MaxTbSizeY and cbHeight is less than or equal to MaxTbSizeY, the decoder can parse ciip_flag. On the other hand, if cbWidth is greater than MaxTbSizeY or cbHeight is greater than MaxTbSizeY, the decoder does not need to parse ciip_flag. If cbWidth is greater than MaxTbSizeY or cbHeight is greater than MaxTbSizeY, the value of ciip_flag may be inferred to be 0.

[0310] If cbWidth is less than or equal to MaxTbSizeY and cbHeight is less than or equal to MaxTbSizeY, the decoder can parse regular_merge_flag, whereas if i) cbWidth is greater than MaxTbSizeY or cbHeight is greater than MaxTbSizeY and ii) the conditions for the triangle (merge) mode to be used are not met, regular_merge_flag may not be parsed.

[0311] If the condition of the following formula 5 is satisfied, the decoder can parse ciip_flag.

[0312]

number

[0313] If ciip_flag is not present, the value of ciip_flag may be inferred to be 1 if all of the following conditions are met. On the other hand, if any of the following conditions are not met, the value of ciip_flag may be inferred to be 0:

[0314] Condition d-1) sps_ciip_enabled_flag==1

[0315] Condition d-2) general_merge_flag==1

[0316] Condition d-3) merge_subblock_flag==0

[0317] Condition d-4) regular_merge_flag==0

[0318] Condition d-5)cbWidth<=MaxTbSizeY

[0319] Condition d-6)cbHeight<=MaxTbSizeY

[0320] Condition d-7)cbWidth*cbHeight>=64

[0321] Condition d-8) cu_skip_flag==0

[0322] If the condition of the following equation 6 is satisfied, the decoder can parse regular_merge_flag.

[0323]

number

[0324] If regular_merge_flag is not present, the value of regular_merge_flag may be inferred as (general_merge_flag && !merge_subblock_flag). That is, if the value of general_merge_flag is 1 and the value of merge_subblock_flag is 0, the value of regular_merge_flag may be inferred as 1. On the other hand, if the value of general_merge_flag is 0 or the value of merge_subblock_flag is 1, regular_merge_flag may be inferred as 0.

[0325] FIG. 33 is a diagram illustrating a method for executing the CIIP mode according to one embodiment of the present invention.

[0326] FIG. 33 may be a diagram showing an embodiment for solving the problem described in FIG.

[0327] In one embodiment of the present invention, intra prediction in CIIP mode may be performed in units of transform blocks (units). That is, when CIIP mode is used, TU partitioning may be performed. For example, if cbWidth is larger than MaxTbSizeY or cbHeight is larger than MaxTbSizeY, CIIP mode may be used. In this case, TU partitioning is performed, and intra prediction may be performed on a block of (tbWidth x tbHeight) in units of (MaxTbSizeY x MaxTbSizeY) blocks. This makes it possible to perform intra prediction in CIIP mode using the same resources as existing intra prediction.

[0328] FIG. 33 shows a prediction method when the CIIP mode is used for a 64×64 CU and MaxTbSizeY is 32. Since the CIIP mode is used, a prediction signal may be generated based on a prediction signal using inter prediction and a prediction signal using intra prediction. In this case, inter prediction may be performed on the 64×64 CU. Furthermore, since a 64×64 block exceeds MaxTbSizeY, TU division may be performed before intra prediction is performed. The block after TU division may be a block of MaxTbSizeY×MaxTbSizeY size. That is, after TU division, multiple 32×32 size blocks may be generated. Furthermore, intra prediction may be performed on each of the blocks generated after TU division.

[0329] Hereinafter, the intra prediction method will be described when the CIIP mode is used and TU division is performed.

[0330] Intra prediction after TU division can use a reference sample located adjacent to each TU after division. Using a reference sample adjacent to the block provides advantages in terms of prediction performance and coding efficiency. For example, the reference sample may be a reconstructed sample. However, in this case, intra prediction for a specific TU must wait until the adjacent TU (i.e., the TU corresponding to the position of the reference sample) is reconstructed, which may result in additional latency. Alternatively, the reference sample may be a predicted sample. In this case, prediction performance may be reduced compared to using a reconstructed sample. However, prediction for the current TU may begin when prediction is completed even if the adjacent TU is not completely reconstructed. Therefore, latency can be reduced compared to using a reconstructed sample as a reference sample. However, using a predicted sample as a reference sample may still result in latency issues.

[0331] Intra prediction after TU division can use reference samples located adjacent to the CU before the TU division. In this case, the latency problem described above can be solved. However, since non-adjacent samples are used, prediction performance may be reduced. Furthermore, since intra prediction is performed on some of the divided TUs using reference samples that are not adjacent to the TU, reference samples located at different positions from existing intra prediction are required, and a different process from existing intra prediction is required.

[0332] When TU partitioning is performed when the CIIP mode is used, prediction in the CIIP mode may be performed even if the CU size is large. This is because intra prediction included in the CIIP mode may be performed on a large-sized CU, and intra prediction included in the CIIP mode may be performed on smaller blocks after TU partitioning. Therefore, there may be no upper limit to the condition related to the block size for which the CIIP mode can be used. That is, the condition that cbWidth is smaller than 128 and cbHeight is smaller than 128 described in Figures 31 and 32 may not exist. Therefore, if the condition that (cbWidth * cbHeight) is greater than or equal to 64 for the block size is met, the decoder can parse ciip_flag or regular_merge_flag. In other words, a decoder can parse ciip_flag or regular_merge_flag even if cbWidth is greater than 64, cbHeight is greater than 64 (see Figure 31), cbWidth is greater than MaxTbSizeY, or cbHeight is greater than MaxTbSizeY (see Figure 32).

[0333] Specifically, if the following conditions are met, ciip_flag may be parsed. On the other hand, if any one of the following conditions is not met, ciip_flag may not be parsed.

[0334] Condition e-1) sps_ciip_enabled_flag==1

[0335] Condition e-2) sps_triangle_enabled_flag==1

[0336] Condition e-3) MaxNumTriangleMergeCand>1

[0337] Condition e-4) slice_type==B

[0338] Condition e-5) cu_skip_flag==0

[0339] Condition e-6)cbWidth*cbHeight>=64

[0340] If ciip_flag is not present, ciip_flag may be inferred to 1 if all of the following conditions are met, and ciip_flag may be inferred to 0 if any of the following conditions are not met:

[0341] Condition f-1) sps_ciip_enabled_flag==1

[0342] Condition f-2) general_merge_flag==1

[0343] Condition f-3) merge_subblock_flag==0

[0344] Condition f-4) regular_merge_flag==0

[0345] Condition f-5)cbWidth*cbHeight>=64

[0346] Condition f-6) cu_skip_flag==0

[0347] If all of the following conditions are met, regular_merge_flag may be parsed. On the other hand, if any one of the following conditions is not met, regular_merge_flag may not be parsed.

[0348] Condition g-1)cbWidth*cbHeight>=64

[0349] Condition g-2)

[0350] (sps_ciip_enabled_flag&&cu_skip_flag==0)||(sps_triangle_enabled_flag&&MaxNumTriangleMergeCand>1&&slice_type==B)

[0351] If regular_merge_flag is not present, the value of regular_merge_flag may be inferred, but this is the same as that described in Figures 31 and 32 and will be omitted.

[0352] FIG. 34 is a diagram showing a chroma BDPCM syntax structure according to one embodiment of the present invention.

[0353] The BDPCM described in Figures 27 to 29 may be performed on chroma components. By performing BDPCM on chroma components, compression performance for specific video contents can be improved. In the present invention, application of BDPCM to chroma blocks is referred to as chroma BDPCM.

[0354] A separate signaling method is required for BDPCM to be performed on the chroma components, which is illustrated in Figure 34. Also, the syntax disclosed in Figure 34 may be included in a coding unit syntax.

[0355] If the tree type (treeType) value is SINGLE_TREE or DUAL_TREE_CHROMA, the syntax elements disclosed in FIG. 34 may be parsed. Also, if ChromaArrayType is not 0, the syntax elements disclosed in FIG. 34 may be parsed. ChromaArrayType may be set to the value of chroma_format_idc if the value of separate_colour_plane_flag is 0. ChromaArrayType may be set to 0 if the value of separate_colour_plane_flag is 1. In this case, separate_colour_plane_flag may indicate whether color components of a 4:4:4 chroma format are coded separately. For example, if the value of separate_colour_plane_flag is 0, it may indicate that color components are not coded separately. If the value of separate_colour_plane_flag is 0 and not Monochrome, ChromaArrayType may not be 0.

[0356] If the value of pred_mode_plt_flag is 1 and the tree type (treeType) is DUAL_TREE_CHROMA, 'palette_coding()' may be performed. pred_mode_plt_flag is a syntax element indicating whether palette mode is used, and 'palette_coding()' may be a part that parses syntax elements related to palette mode. If the value of pred_mode_plt_flag is 0 or the tree type value is not DUAL_TREE_CHROMA, the decoder may perform steps (1) and following in Figure 34.

[0357] Furthermore, steps (1) and subsequent steps in FIG. 34 may be performed based on cu_act_enabled_flag. cu_act_enabled_flag may be a syntax element indicating whether an adaptive color transform is applied. If the value of cu_act_enabled_flag is 1, the residual signal may be coded into another color space. If the value of cu_act_enabled_flag is 0, the residual signal may be coded into the original color space. The original color space may be the YUV color space or the YCbCr color space. The other color space may be the YCgCo color space or the RGB color space. Referring to FIG. 34, if the value of cu_act_enabled_flag is 0, steps (1) and subsequent steps in FIG. 34 may be performed. On the other hand, if the value of cu_act_enabled_flag is 1, steps (1) and subsequent steps in FIG. 34 may not be performed. That is, if the value of cu_act_enabled_flag is 0, the decoder can parse syntax elements related to chroma intra prediction, and if the value of cu_act_enabled_flag is not 0, the decoder does not have to parse syntax elements related to chroma intra prediction.

[0358] Referring to FIG. 34, the decoder can parse intra_bdpcm_chroma_flag if the condition in Equation 7 below is satisfied.

[0359]

number

[0360] The intra_bdpcm_chroma_flag may be a syntax element indicating whether BDPCM is applied to the current chroma coding block. For example, if the value of intra_bdpcm_chroma_flag is 1, it indicates that BDPCM is applied to the current chroma coding block, and if the value of intra_bdpcm_chroma_flag is 0, it indicates that BDPCM is not applied to the current chroma coding block. Referring to FIG. 34, there may be a condition for parsing the intra_bdpcm_chroma_flag. Alternatively, there may be a condition for using chroma BDPCM. The condition for using chroma BDPCM may be the same as the condition for parsing the intra_bdpcm_chroma_flag. The condition for parsing the intra_bdpcm_chroma_flag is the same as Equation 7, and will be described in detail as follows.

[0361] Condition h-1)cbWidth<=MaxTsSize

[0362] Condition h-2) cbHeight<=MaxTsSize

[0363] Condition h-3) sps_bdpcm_chroma_enable_flag==1

[0364] If any one of the above conditions is not met, the decoder does not need to parse intra_bdpcm_chroma_flag. If intra_bdpcm_chroma_flag is not present, the value of intra_bdpcm_chroma_flag may be inferred to be 0. If the value of intra_bdpcm_chroma_flag is 1, the decoder can parse syntax related to chroma BDPCM. In this case, the syntax related to chroma BDPCM may include intra_bdpcm_chroma_dir_flag. intra_bdpcm_chroma_dir_flag may be a flag indicating the prediction direction of chroma BDPCM. For example, intra_bdpcm_chroma_dir_flag may indicate whether the prediction direction of chroma BDPCM is horizontal or vertical. sps_bdpcm_chroma_enable_flag may be a syntax element signaled at a higher level that indicates whether chroma BDPCM is enabled. For example, sps_bdpcm_chroma_enable_flag may be signaled at a scope that includes the current coding unit (e.g., at the sequence, picture, slice, etc. level). If the value of sps_bdpcm_chroma_enable_flag is 1, chroma BDPCM may be used, and there may be an additional syntax element that indicates whether chroma BDPCM is used. If the value of sps_bdpcm_chroma_enable_flag is 0, chroma BDPCM is not used.

[0365] Referring to FIG. 34, when the decoder parses intra_bdpcm_chroma_flag and the parsing result indicates that the value of intra_bdpcm_chroma_flag is 0, the decoder does not parse syntax related to chroma intra prediction. In this case, syntax related to chroma intra prediction may include cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, etc. In this case, cclm_mode_flag may be a syntax element indicating whether a cross component linear model (CCLM) is used as the chroma intra prediction mode. cclm_mode_flag may be a syntax element indicating whether the chroma intra prediction mode is one of INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM. CclmEnabled may be a value indicating whether CCLM is available. Alternatively, CclmEnabled may be a value indicating whether a syntax element indicating whether CCLM is available is parsed. CCLM is a chroma prediction method based on luma samples. cclm_mode_idx may be parsed if CCLM is used. cclm_mode_idx may be a syntax element indicating which of multiple CCLM methods is used. If CCLM is not used, the decoder can parse intra_chroma_pred_mode. In this case, intra_chroma_pred_mode may be a syntax element indicating the intra prediction mode of a chroma sample.Specifically, intra_chroma_pred_mode may be a syntax element indicating which mode is used as the prediction mode for a chroma component: planar mode (mode index 0), DC mode (mode index 1), vertical mode (mode index 50), horizontal mode (mode index 18), diagonal mode (mode index × 66), or DM mode (the same mode as luma mode).

[0366] Referring to Figure 34, even if the conditions for intra_bdpcm_chroma_flag to be parsed or the conditions for chroma BDPCM to be used are met, if a syntax element signals that chroma BDPCM will not be used, a problem may occur in which the chroma prediction mode is not determined because the syntax related to the above-mentioned chroma intra prediction is not parsed.

[0367] FIG. 35 is a diagram showing a chroma BDPCM syntax structure according to one embodiment of the present invention.

[0368] The embodiment of FIG. 35 is an embodiment for solving the problem explained in FIG. 34, and overlapping content will be omitted.

[0369] Referring to Figure 35, if the conditions under which intra_bdpcm_chroma_flag may be parsed or the conditions under which chroma BDPCM may be used are met, the decoder can parse intra_bdpcm_chroma_flag. The conditions under which intra_bdpcm_chroma_flag may be parsed are the same as (1) of Figure 35, as shown in Equation 7 above. That is, if all of the following conditions are met, chroma BDPCM may be used, and if any one of the following conditions is not met, chroma BDPCM may not be used. Also, if any one of the following conditions is not met, intra_bdpcm_chroma_flag may not be present. In this case, if intra_bdpcm_chroma_flag is not present, the value of intra_bdpcm_chroma_flag may be inferred to be 0.

[0370] Condition i-1)cbWidth<=MaxTsSize

[0371] Condition i-2) cbHeight<=MaxTsSize

[0372] Condition i-3) sps_bdpcm_chroma_enable_flag==1

[0373] The BDPCM application method described in Figure 29 may also be applied to chroma BDPCM. That is, even if the coding block size (cbWidth, cbHeight) is larger than MaxTsSize, chroma BDPCM may be used as long as the divided TU or TB size is equal to or smaller than MaxTsSize. Therefore, chroma BDPCM may be used if all of the following conditions are met, but chroma BDPCM may not be used if any one of the following conditions is not met.

[0374] Condition j-1)

[0375] (cbWidth<=MaxTsSize&&cbHeight<=MaxTsSize)||(MaxTbSizeY==MaxTsSize)

[0376] Condition j-2) sps_bdpcm_chroma_enable_flag==1

[0377] If the value of intra_bdpcm_chroma_flag is 1, the decoder can parse syntax related to chroma BDPCM. In this case, the syntax related to chroma BDPCM may be intra_bdpcm_chroma_dir_flag, sps_bdpcm_chroma_enable_flag, etc. The intra_bdpcm_chroma_dir_flag, sps_bdpcm_chroma_enable_flag, etc. may be the same as those described in FIG. 34.

[0378] Referring to Figure 35, the decoder parses intra_bdpcm_chroma_flag, and if the value of intra_bdpcm_chroma_flag is 0 as a result of parsing (i.e., chroma BDPCM is not used), it can perform steps (2) and after in Figure 35. That is, the decoder can parse syntax related to other chroma intra prediction. The syntax related to other chroma intra prediction may be the same as that described in Figure 34. The syntax related to other chroma intra prediction may include cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, etc.

[0379] The decoder can parse cclm_mode_flag if the value of intra_bdpcm_chroma_flag is 0 and the value of CclmEnabled is 1. Also, if the value of cclm_mode_flag is 1, the decoder can parse cclm_mode_idx, and if the value of cclm_mode_flag is not 1, the decoder can parse intra_chroma_pred_mode.

[0380] Referring to Figure 35, even if intra_bdpcm_chroma_flag satisfies the conditions for parsing and a syntax element indicating that chroma BDPCM is not used is signaled as a result of parsing intra_bdpcm_chroma_flag, a syntax element determining another chroma prediction mode may be parsed, unlike in Figure 34, so the decoder can determine the chroma prediction mode. Specifically, if the block width and block height are equal to or less than the maximum transform skip size and a syntax element signaled at a higher level indicating whether chroma BDPCM is used is used, the decoder can parse the syntax element indicating whether chroma BDPCM is used. In this case, if the parsing result indicates that chroma BDPCM is not used, the decoder can determine the chroma intra prediction mode based on a syntax element (e.g., cclm_mode_flag, intra_chroma_pred_mode) indicating which chroma intra prediction mode should be used.

[0381] FIG. 36 is a diagram illustrating high-level syntax related to BDPCM according to one embodiment of the present invention.

[0382] As described above, there may be a higher-level syntax including a syntax element indicating whether BDPCM is used. For example, syntax elements signaled at a higher level indicating whether BDPCM is used may include the above-mentioned sps_bdpcm_enabled_flag and sps_bdpcm_chroma_enabled_flag. Specifically, sps_bdpcm_enabled_flag is a syntax element signaled at a higher level indicating whether BDPCM is used for a luma component. Also, sps_bdpcm_chroma_enabled_flag is a syntax element signaled at a higher level indicating whether BDPCM is used for a chroma component. In this case, the higher levels at which syntax elements indicating whether BDPCM is used may be signaled include the sequence level, sequence parameter set level (SPS level), slice level, picture level, and picture parameter set level (PPS level). If a syntax element signaled at a higher level indicating whether BDPCM can be used indicates that BDPCM can be used (e.g., has a value of 1), a syntax element indicating whether BDPCM is used may also be present. For example, a syntax element indicating whether BDPCM is used may be present at the block level or the coding unit (block) level. On the other hand, if a syntax element signaled at a higher level indicating whether BDPCM can be used indicates that BDPCM cannot be used (e.g., has a value of 0), no syntax element indicating whether BDPCM is used may also be present. Furthermore, if there is no syntax element signaled at a higher level indicating whether BDPCM can be used, the value of the syntax element signaled at the higher level may be inferred to be 0.Furthermore, the syntax element related to whether sps_bdpcm_enabled_flag is available may be intra_bdpcm_flag described in Figures 28 and 29. Intra_bdpcm_flag may be the same as intra_bdpcm_luma_flag. Furthermore, the syntax element related to whether sps_bdpcm_chroma_enabled_flag is available may be intra_bdpcm_chroma_flag described in Figures 34 and 35.

[0383] There may be a syntax element signaled at a higher level indicating whether a transform skip is enabled. Referring to FIG. 36, the syntax element signaled at a higher level indicating whether a transform skip is enabled may be sps_transform_skip_enalbed_flag. In this case, the higher level at which the syntax element indicating whether a transform skip is enabled may be signaled may be the sequence level, sequence parameter set level (SPS level), slice level, picture level, or picture parameter set level (PPS level). If the syntax element signaled at a higher level indicating whether a transform skip is enabled indicates that a transform skip is enabled (e.g., has a value of 1), there may be an additional syntax element indicating whether a transform skip is enabled. For example, the syntax element indicating whether a transform skip is enabled may be present at the block level or the coding unit (block) level. On the other hand, if a syntax element signaled at a higher level indicating whether a transform skip is enabled indicates that the transform skip is disabled (for example, if the value is 0), there is no further syntax element indicating whether a transform skip is enabled. If there is no syntax element signaled at a higher level indicating whether a transform skip is enabled, the value of the syntax element signaled at the higher level may be inferred to be 0. The syntax element related to whether sps_transform_skip_enabled_flag is enabled may be transform_skip_flag described in FIGS. 27 and 28.

[0384] As described above, in order to use BDPCM, transform skip must be used. Referring to Figure 36, if a syntax element signaled at a higher level indicating whether transform skip is available indicates that transform skip can be used, a decoder can parse the syntax element signaled at a higher level indicating whether BDPCM is available. On the other hand, if a syntax element signaled at a higher level indicating whether transform skip is available indicates that transform skip cannot be used, a decoder does not need to parse the syntax element signaled at a higher level indicating whether BDPCM is available. In this case, the syntax element signaled at a higher level indicating whether BDPCM is available may include both information about luma components and information about chroma components.

[0385] A decoder can parse sps_bdpcm_chroma_enabled_flag if the value of sps_bdpcm_enabled_flag is 1. On the other hand, a decoder does not need to parse sps_bdpcm_chroma_enabled_flag if the value of sps_bdpcm_enabled_flag is 0. That is, BDPCM for chroma components can be used only if BDPCM for luma components can be used.

[0386] 36, the decoder parses sps_transform_skip_enabled_flag, and as a result of parsing, if the value of sps_transform_skip_enabled_flag is 1, the decoder can parse sps_bdpcm_enabled_flag. If the value of sps_bdpcm_enabled_flag is 1, the decoder can parse sps_bdpcm_chroma_enabled_flag.

[0387] FIG. 37 is a diagram illustrating syntax elements signaled at a higher level for BDPCM according to one embodiment of the present invention.

[0388] In the embodiment of FIG. 37, the contents that overlap with those of FIG. 36 will be omitted.

[0389] Referring to FIG. 37, whether chroma BDPCM can be used may be determined based on the chroma format. Information related to the color format may include chroma_format_idc, separate_colour_planance_flag, Chroma format, SubWidthC, SubHeightC, etc. Specifically, if the color format is 4:4:4, chroma BDPCM may be usable. On the other hand, if the color format is not 4:4:4, chroma BDPCM may not be usable. Therefore, whether chroma BDPCM can be used may be based on chroma_format_idc. For example, if the value of chroma_format_idc is 3, the decoder may parse the syntax element (sps_bdpcm_chroma_enabled_flag) indicating whether chroma BDPCM can be used; otherwise, the decoder does not need to parse the syntax element (sps_bdpcm_chroma_enabled_flag) indicating whether chroma BDPCM can be used. In the present invention, the term color format may be used synonymously with the term chroma format.

[0390] FIG. 38 is a diagram showing syntax related to chroma BDPCM according to one embodiment of the present invention.

[0391] A syntax element signaled at a higher level indicating whether BDPCM can be used for the luma component and a syntax element signaled at a higher level indicating whether BDPCM can be used for the chroma component do not need to exist separately. That is, a single syntax element may indicate whether BDPCM can be used for both the luma component and the chroma component. For example, if a syntax element signaled at a higher level indicating whether BDPCM can be used indicates that BDPCM can be used, BDPCM for the luma component or BDPCM for the chroma component may be used. In this case, an additional syntax element may be present to indicate whether BDPCM is used. For example, the additional syntax element may be the above-mentioned intra_bdpcm_flag or intra_bdpcm_chroma_flag. On the other hand, if a syntax element signaled at a higher level indicating whether BDPCM can be used indicates that BDPCM cannot be used, BDPCM may not be used for both the luma component and the chroma component.

[0392] The syntax elements indicating whether BDPCM for the luma component is used and the syntax elements indicating whether BDPCM for the chroma components is used may be parsed based on a syntax element signaled at a higher level indicating whether the same BDPCM can be used for both the luma component and the chroma component. For example, if the syntax element indicating whether the same BDPCM can be used is sps_intra_bdpcm_flag, the decoder can parse the syntax element indicating whether BDPCM for the luma component is used, as described with reference to Figures 28 and 29. That is, if the value of sps_bdpcm_enabled_flag is 1, the decoder can parse intra_bdpcm_flag (additional conditions may be considered at this time), and if the value of sps_bdpcm_enabled_flag is not 1, the decoder does not need to parse intra_bdpcm_flag.

[0393] 38, a syntax element indicating whether BDPCM for a chroma component is used may be determined by the value of sps_bdpcm_enabled_flag. For example, if the value of sps_bdpcm_enabled_flag is 1, the decoder may parse intra_bdpcm_chroma_flag (additional conditions may be considered at this time), and if the value of sps_bdpcm_enabled_flag is not 1, the decoder may not parse intra_bdpcm_chroma_flag.

[0394] A syntax element indicating whether BDPCM is used at the coding unit (block) level does not have to be separate for the luma component and the chroma component. That is, if a syntax element indicating whether BDPCM is used indicates that BDPCM is used, BDPCM may be used for both the luma component and the chroma component. On the other hand, if a syntax element indicating whether BDPCM is used indicates that BDPCM is not used, BDPCM may not be used for both the luma component and the chroma component.

[0395] FIG. 39 is a diagram illustrating syntax related to intra prediction according to an embodiment of the present invention.

[0396] Referring to FIG. 39, syntax elements related to multiple intra predictions may be signaled according to a pre-set order.

[0397] Syntax elements may be grouped and signaled for each color component. For example, syntax elements related to luma components may be grouped and signaled. Syntax elements related to chroma components may be grouped and signaled. Furthermore, a syntax element group related to a luma component and a syntax element group related to a chroma component may be signaled in sequence. Conversely, a syntax element group related to a chroma component and a syntax element group related to a luma component may be signaled in sequence.

[0398] With reference to FIG. 39, a structure in which a syntax element group related to a luma component and a syntax element group related to a chroma component are signaled in order will be described.

[0399] The syntax element group associated with the luma component may include the following syntax elements:

[0400] i) BDPCM related syntax elements for the luma component:

[0401] These may be syntax elements indicating whether BDPCM can be used and syntax elements indicating the prediction direction, such as intra_bdpcm_luma_flag and intra_bdpcm_luma_dir_flag shown in FIG.

[0402] ii) MIP (matrix-based intra prediction) related syntax elements:

[0403] The syntax elements refer to syntax elements indicating whether MIP prediction is used, whether an MIP input vector is transposed, and the syntax elements indicating an MIP mode, for example, intra_mip_flag, intra_mip_transposed, and intra_mip_mode shown in FIG.

[0404] iii) A syntax element indicating the reference line used for prediction:

[0405] It may be a syntax element indicating the position of a reference line used for intra prediction, for example, intra_luma_ref_idx disclosed in FIG.

[0406] iv) ISP (intra sub-partition) related syntax elements:

[0407] The syntax element may be a syntax element indicating whether ISP is used or a syntax element indicating an ISP split direction. For example, the intra_subpartitions_mode_flag and intra_subpartitions_split_flag shown in FIG. 39 may correspond to this. In this case, ISP is an intra subpartition mode or a method of predicting by dividing a block into subpartitions.

[0408] v) Syntax element indicating intra prediction mode:

[0409] The syntax element may be a syntax element indicating whether an MPM list (candidate list) is used, a syntax element indicating whether a planar mode is used, a syntax element indicating an MPM index, or a syntax element indicating a mode not included in the MPM list. For example, the syntax elements may be intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, and intra_luma_mpm_remainder shown in FIG. 39.

[0410] The syntax element group associated with a chroma component may contain the following syntax elements:

[0411] i) Chroma component BDPCM related syntax elements:

[0412] The syntax element may be a syntax element indicating whether BDPCM is used or a syntax element indicating the prediction direction, such as intra_bdpcm_chroma_flag and intra_bdpcm_chroma_dir_flag shown in FIG.

[0413] ii) CCLM (cross component linear model) related syntax elements:

[0414] The syntax element may be a syntax element indicating whether CCLM is used or a syntax element indicating a CCLM mode used for prediction. For example, cclm_mode_flag and cclm_mode_idx shown in Fig. 39 may be such elements. CCLM is a method of prediction based on another color component value, and specifically, may be a method of predicting a chroma component based on a luma component value.

[0415] iii) Syntax elements related to chroma intra prediction mode:

[0416] It may be a syntax element used to determine an intra-prediction mode index for a chroma component, such as intra_chroma_pred_mode disclosed in FIG.

[0417] 39, if the tree type (treeType) is SINGLE_TREE or DUAL_TREE_LUMA, the decoder parses syntax elements related to the luma component, and if the tree type (treeType) is SINGLE_TREE or DUAL_TREE_CHROMA, the decoder can parse syntax elements related to the chroma component. Thus, the decoder can consecutively parse syntax element groups related to the luma component and parse syntax groups related to the chroma component.

[0418] 39, syntax elements related to the chroma components, intra_bdpcm_chroma_flag and intra_bdpcm_chroma_dir_flag, may be located after the syntax element group related to the luma component. Therefore, when the tree type is SINGLE_TREE, syntax elements such as intra_bdpcm_chroma_flag and intra_bdpcm_chroma_dir_flag located after the syntax element group related to the luma component may be parsed.

[0419] This allows syntax elements related to the luma component and syntax elements related to the chroma component to be consecutively located (parsed), which is advantageous in terms of memory management, i.e., can be effective in terms of implementation.

[0420] FIG. 40 is a diagram illustrating syntax related to intra prediction according to an embodiment of the present invention.

[0421] Referring to FIG. 39, the syntax element group related to the luma component and the syntax element group related to the chroma component do not have to be parsed in order. For example, the order of some of the syntax element groups related to the luma component and the chroma component described with reference to FIG. 39 may be changed. Specifically, the BDPCM-related syntax elements for the luma component and the BDPCM-related syntax elements for the chroma component may be parsed consecutively. Furthermore, a syntax element group of syntax elements included in the luma component-related syntax element group, excluding the BDPCM-related syntax elements for the luma component, and a syntax element group of syntax elements included in the chroma component-related syntax element group, excluding the BDPCM-related syntax elements for the chroma component, may be parsed consecutively. Furthermore, the BDPCM-related syntax elements may be parsed before other syntax element groups.

[0422] One example of the order in which syntax elements are parsed is as follows:

[0423] First, syntax elements related to the BDPCM for the luma component may be parsed, and then syntax elements related to the BDPCM for the chroma components may be parsed. Then, among the syntax elements included in the syntax element group related to the luma component, a syntax element group excluding the syntax elements related to the BDPCM for the luma component may be parsed. Then, among the syntax elements included in the syntax element group related to the chroma components, a syntax element group excluding the syntax elements related to the BDPCM for the chroma components may be parsed.

[0424] Referring to Figure 40, intra_bdpcm_luma_flag, intra_bdpcm_luma_dir_flag, intra_bdpcm_chroma_flag, and intra_bdpcm_chroma_dir_flag may be located before intra_mip_flag, intra_mip_transposed, intra_mip_mode, intra_luma_ref_idx, intra_subpartitions_mode_flag, intra_subpartitions_split_flag, intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder, cclm_mode_flag, cclm_mode_idx, and intra_chroma_pred_mode.

[0425] Alternatively, intra_bdpcm_luma_flag, intra_bdpcm_luma_dir_flag, intra_bdpcm_chroma_flag, and intra_bdpcm_chroma_dir_flag may be located before at least one of intra_mip_flag, intra_mip_transposed, intra_mip_mode, intra_luma_ref_idx, intra_subpartitions_mode_flag, intra_subpartitions_split_flag, intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder, cclm_mode_flag, cclm_mode_idx, and intra_chroma_pred_mode.

[0426] 40, syntax elements related to BDPCM for chroma components may precede syntax elements related to luma components, which has the effect of reducing the operations / calculations required to determine whether to parse a syntax element when chroma BDPCM is frequently used.

[0427] Luma BDPCM and chroma BDPCM may share the same prediction direction. Therefore, as shown in FIG. 40, intra_bdpcm_luma_dir_flag and intra_bdpcm_chroma_dir_flag do not exist separately, and the prediction direction of luma BDPCM and the prediction direction of chroma BDPCM may be indicated by a single syntax element. In this case, whether luma BDPCM is used and whether chroma BDPCM is used may not be independent. For example, in order for chroma BDPCM to be used, luma BDPCM must also be used. Therefore, the syntax element indicating whether luma BDPCM is used and the syntax element indicating whether chroma BDPCM is used may be dependent. Only when the syntax element indicating whether luma BDPCM is used indicates that luma BDPCM is used, the syntax element indicating whether chroma BDPCM is used may be parsed.

[0428] FIG. 41 is a diagram showing a sequence parameter set syntax according to one embodiment of the present invention.

[0429] A sequence parameter set (SPS) syntax may be syntax that applies to a coded video sequence (CVS). Whether the SPS syntax applies to a CVS may be determined by the value of a picture parameter set (PPS) syntax element referenced by a slice header syntax element.

[0430] The syntax elements disclosed in Figure 41 may be part of the SPS syntax elements. Referring to Figure 41, the SPS syntax may include syntax elements such as pic_width_max_in_luma_samples, pic_height_max_in_luma_samples, sps_log2_ctu_size_minus5, subpics_present_flag, sps_num_subpics_minus1, subpic_ctu_top_left_x, subpic_ctu_top_left_y, subpic_width_minus1, subpic_height_minus1, subpic_treated_as_pic_flag, loop_filter_across_subpic_enabled_flag, sps_subpic_id_present_flag, sps_subpic_id_signalling_present_flag, sps_subpic_id_len_minus1, and sps_subpic_id. In addition, some of the syntax elements included in the SPS syntax may exist as many times as the number of subpictures. For example, the syntax elements subpic_ctu_top_left_x, subpic_ctu_top_left_y, subpic_width_minus1, subpic_height_minus1, subpic_treated_as_pic_flag, loop_filter_across_subpic_enabled_flag, and sps_subpic_id may exist as many times as the number of subpictures. Specifically, such syntax elements may be represented as syntaxElement[I], where i ranges from 0 to (the number of subpictures minus 1). In this case, syntaxElement may exist as many times as the number of subpictures.

[0431] A sub-picture may be a smaller unit than a picture or a frame. For example, a picture or a frame may include one or more sub-pictures. In this case, a sub-picture may be a rectangular region. Specifically, a sub-picture may refer to a rectangular region consisting of one or more slices in a picture. Furthermore, a sub-picture may be independently decoded. Therefore, even if a decoder receives only information about a certain sub-picture in a picture, the decoder can decode and restore the received certain sub-picture. Furthermore, multiple sub-pictures in a picture may not overlap each other.

[0432] 41, when the value of subpics_present_flag is 1, the decoder can parse sps_num_subpics_minus1, subpic_ctu_top_left_x, subpic_ctu_top_left_y, subpic_width_minus1, subpic_height_minus1, subpic_treated_as_pic_flag, and loop_filter_across_subpic_enabled_flag. Also, only (sps_num_subpics_minus1+1) of each of subpic_ctu_top_left_x, subpic_ctu_top_left_y, subpic_width_minus1, subpic_height_minus1, subpic_treated_as_pic_flag, and loop_filter_across_subpic_enabled_flag may be parsed.

[0433] The syntax elements of the SPS syntax and the sub-picture signaling method described above will be explained with reference to FIG.

[0434] FIG. 42 is a diagram showing syntax elements related to sub-pictures according to one embodiment of the present invention.

[0435] The pic_width_max_in_luma_samples syntax element shown in Figure 42 indicates the maximum picture width, which may be expressed in units of luma samples. The value of pic_width_max_in_luma_samples may not be 0, but may be an integer multiple of a pre-set value. The pre-set value may be the larger of 8 and the minimum coding block size. In this case, the minimum coding block size may be determined based on the luma sample and may be represented as MinCbSizeY.

[0436] Furthermore, pic_height_max_in_luma_samples is a syntax element indicating the maximum height of a picture, and the maximum height of a picture may be expressed in units of luma samples. The value of pic_height_max_in_luma_samples may not be 0, but may be an integer multiple of a preset value. The preset value may be the larger of 8 and the minimum coding block size. The minimum coding block size may be determined based on the luma samples and may be represented as MinCbSizeY.

[0437] If a picture uses subpictures, pic_width_max_in_luma_samples and pic_height_max_in_luma_samples indicate the width and height of the picture, respectively. In this case, the maximum width and maximum height of the picture may be equal to the picture width and picture height, respectively.

[0438] sps_log_2_ctu_size_minus5 may be a syntax element indicating the size of a coding tree block (CTB) of a coding tree unit (CTU). Specifically, sps_log_2_ctu_size_minus5 may indicate the size of a luma coding tree block. Also, sps_log_2_ctu_size_minus5 may have a value obtained by taking log2 of the CTB size in luma sample units and subtracting a preset value. If the size of the luma coding tree block is CtbSizeY, CtbSizeY may be (1<<(sps_log2_ctu_size_minus5+preset value)). The preset value may be 5. That is, when sps_log2_ctu_size_minus5 is 0, 1, or 2, the CtbSizeY value may be 32, 64, or 128, respectively. Additionally, the sps_log2_ctu_size_minus5 value may be a value of 2 or less.

[0439] The subpics_present_flag is a syntax element that indicates whether subpicture parameters are present. The subpics_present_flag indicates whether subpictures can be used and whether the number of subpictures can be signaled as a value greater than 1. In this case, the subpicture parameters can include sps_num_subpics_minus1, subpic_ctu_top_left_x, subpic_ctu_top_left_y, subpic_width_minus1, subpic_height_minus1, subpic_treated_as_pic_flag, loop_filter_across_subpic_enabled_flag, etc.

[0440] sps_num_subpics_minus1 may be a syntax element indicating the number of subpictures. For example, the number of subpictures may be the value of sps_num_subpics_minus1 plus a previously set value. In this case, the previously set value may be 1. In this case, the number of subpictures may be signaled as a value greater than or equal to 1. Alternatively, the previously set value may be 2. In this case, the number of subpictures may be signaled as a value greater than or equal to 2. The value of sps_num_subpics_minus1 may be between 0 and 254, inclusive, and may be expressed in 8 bits. On the other hand, if the sps_num_subpics_minus1 value does not exist, the value of sps_num_subpics_minus1 may be inferred as 0.

[0441] 42, subpic_ctu_top_left_x, subpic_ctu_top_left_y, subpic_width_minus1, and subpic_height_minus1 are syntax elements that indicate the position and size of each subpicture. subpic_ctu_top_left_x[i], subpic_ctu_top_left_y[i], subpic_width_minus1[i], and subpic_height_minus1[I] indicate values ​​corresponding to the i-th subpicture. In this case, the value of i may be greater than or equal to 0 and less than or equal to the value of sps_num_subpics_minus1.

[0442] subpic_ctu_top_left_x may indicate the x-coordinate (horizontal position) of the top left corner of the subpicture. Specifically, subpic_ctu_top_left_x may indicate the x-coordinate of the CTU of the top left corner of the subpicture. In this case, the coordinate may be expressed in CTU units or CTB units. For example, the coordinate may be expressed in CtbSizeY units. Also, subpic_ctu_top_left_x may be signaled as an unsigned integer value, and in this case, the number of bits may be Ceil(Log2(pic_width_max_in_luma_samples / CtbSizeY)). Meanwhile, if the value of subpic_ctu_top_left_x does not exist, the value of subpic_ctu_top_left_x may be inferred to be 0.

[0443] subpic_ctu_top_left_y may indicate the y coordinate (vertical position) of the top left corner of the subpicture. Specifically, subpic_ctu_top_left_y may indicate the y coordinate of the CTU of the top left corner of the subpicture. In this case, the coordinate may be expressed in CTU units or CTB units. For example, the coordinate may be expressed in CtbSizeY units. Also, subpic_ctu_top_left_y may be signaled as an unsigned integer value, and in this case, the number of bits may be Ceil(Log2(pic_height_max_in_luma_samples / CtbSizeY)). Meanwhile, if the value of subpic_ctu_top_left_y does not exist, the value of subpic_ctu_top_left_y may be inferred to be 0.

[0444] subpic_width_minus1 may indicate the width of a subpicture. For example, the width of the subpicture may be the value of subpic_width_minus1 plus a previously set value. In this case, the previously set value may be 1. The width of a subpicture may be expressed in CTU units or CTB units. For example, the width of a subpicture may be expressed in CtbSizeY units. subpic_width_minus1 may be signaled as an unsigned integer value, and in this case, the number of bits may be Ceil(Log2(pic_width_max_in_luma_samples / CtbSizeY)). On the other hand, if the value of subpic_width_minus1 does not exist, the value of subpic_width_minus1 may be inferred as (Ceil(pic_width_max_in_luma_samples / CtbSizeY)-1).

[0445] subpic_height_minus1 may indicate the height of a subpicture. For example, the height of the subpicture may be the value of subpic_height_minus1 plus a previously set value. In this case, the previously set value may be 1. The height of a subpicture may be expressed in CTU units or CTB units. For example, the height of a subpicture may be expressed in CtbSizeY units. subpic_height_minus1 may be signaled as an unsigned integer value, and in this case, the number of bits may be Ceil(Log2(pic_height_max_in_luma_samples / CtbSizeY)). On the other hand, if the subpic_height_minus1 value does not exist, the value of subpic_height_minus1 may be inferred as (Ceil(pic_height_max_in_luma_samples / CtbSizeY)-1).

[0446] The Ceil(x) value described in the present invention may be the smallest integer greater than or equal to x. In the bit calculation described above, an operation such as Ceil(Log2(x)) is performed to calculate the number of bits required to represent the x value, which is an integer greater than or equal to 0, in binary notation.

[0447] Furthermore, by determining the position and size of the subpicture, the subpicture boundary position may be calculated, thereby determining the position inside the subpicture.

[0448] FIG. 43 is a diagram illustrating operators according to one embodiment of the present invention.

[0449] Referring to Figure 43, multiple division operations may be defined.

[0450] " / " may represent integer division. That is, the result value of " / " may be an integer. Specifically, when the result value of the " / " operation is converted to an integer, truncation toward zero may be performed. For example, the values ​​of 7 / 4 and (-7) / (-4) are 1. Also, the values ​​of (-7) / 4 and 7 / (-4) are -1. Integer division may be used in operations on bit numbers or inferring bit numbers, as described in FIG. 42.

[0451] "÷" is a division operation that does not involve truncation or rounding. Therefore, the resulting value of a "÷" operation may or may not be an integer. For example, the values ​​of 7÷4 and (-7)÷(-4) may be greater than 1. Also, the values ​​of (-7)÷4 and 7÷(-4) may be less than -1.

[0452] In Figure 43

number

[0453] FIG. 44 is a diagram showing pictures and sub-pictures according to one embodiment of the present invention.

[0454] As described above, a picture may be divided into multiple sub-pictures. The division and configuration of the sub-pictures may be determined according to the signaling shown in FIG. 42. However, according to the embodiments described in FIG. 42 and FIG. 43, there may be a range that cannot be expressed by the signaling. For example, if the picture width or height is not divisible by CtbSizeY, there may be a sub-picture structure that cannot be expressed. Specifically, if the picture width is not divisible by CtbSizeY, the pic_width_max_in_luma_samples / CtbSizeY value is truncated toward 0, and therefore the position of the rightmost CTB of the picture cannot be expressed. Also, if the picture height is not divisible by CtbSizeY, the pic_height_max_in_luma_samples / CtbSizeY value is truncated toward 0, and therefore the position of the bottommost CTB of the picture cannot be expressed. Therefore, if the picture width is not divisible by CtbSizeY and the sub-picture width is the same as the picture width, the above signaling cannot represent the sub-picture width.Furthermore, if the picture width is not divisible by CtbSizeY and the sub-picture horizontal position is the rightmost CTB, the above signaling cannot represent the x-coordinate of the upper left corner of the sub-picture.

[0455] Specifically, referring to FIG. 44, the picture width may be 1032 luma samples. Also, CtbSizeY may be 128. As in Subpicture0 in FIG. 44, the width of a subpicture may be the same as the picture width. In this case, since the width of Subpicture0 is 9 in CtbSizeY units, the subpic_width_minus1 value should represent 8. However, since the pic_width_max_in_luma_samples / CtbSizeY (1032 / 128) value is 8, the Ceil(Log2(pic_width_max_in_luma_samples / CtbSizeY)) value is 3. Therefore, subpic_width_minus1 is 3 bits, and can only represent values ​​0 to 7, but cannot represent 8. Also, there may be cases where the value of subpic_width_minus1 does not exist and is inferred. In this case, the width of the subpicture should be inferred to the picture width as if the picture were composed of one subpicture. However, as mentioned above, if the picture width is not divisible by CtbSizeY, the subpicture width cannot be inferred.

[0456] Referring to FIG. 44, like Subpicrue 2, the x coordinate of the top left corner of the subpicture may be the rightmost CTB. In this case, the x coordinate of the top left corner of the subpicture must indicate the 9th value in CtbSizeY units, or the value of 8 if the coordinate starts from 0. However, since the value of pic_width_max_in_luma_samples / CtbSizeY is 8, the value of Ceil(Log2(pic_width_max_in_luma_samples / CtbSizeY)) is 3. Therefore, there is a problem in that the value of subpic_ctu_top_left_x is 3 bits, and can only represent values ​​0 to 7, but cannot represent 8.

[0457] FIG. 45 is a diagram showing syntax elements related to sub-pictures according to one embodiment of the present invention.

[0458] As explained in Figure 44, if pic_width_max_in_luma_samples is not divisible by CtbSizeY, there is a problem in that pic_width_max_in_luma_samples / CtbSizeY is truncated (floored), thereby reducing the representation range. Similarly, if pic_height_max_in_luma_samples is not divisible by CtbSizeY, pic_height_max_in_luma_samples / CtbSizeY is truncated (floored), thereby reducing the representation range. Therefore, the present invention proposes a calculation method that does not cause truncation.

[0459] For example, the x-coordinate, y-coordinate of the upper left corner of the subpicture, the width of the subpicture, and the height of the subpicture are expressed in CtbSizeY units, and therefore must be divisible by CtbSizeY. In this case, the "÷" operation described in Figure 43 may be used.

[0460] subpic_ctu_top_left_x may indicate the x-coordinate (horizontal position) of the top left corner of the subpicture. Specifically, subpic_ctu_top_left_x may indicate the x-coordinate of the CTU of the top left corner of the subpicture. In this case, the coordinate may be expressed in CTU units or CTB units. For example, it may be expressed in CtbSizeY units. subpic_ctu_top_left_x may be signaled as an unsigned integer value, and the number of bits of subpic_ctu_top_left_x may be Ceil(Log2(pic_width_max_in_luma_samples÷CtbSizeY)). Meanwhile, if there is no value for subpic_ctu_top_left_x, the value of subpic_ctu_top_left_x may be inferred to be 0. In this case, the number of bits of subpic_ctu_top_left_x may be determined as Ceil(Log2(Ceil(pic_width_max_in_luma_samples÷CtbSizeY))).

[0461] subpic_ctu_top_left_y may indicate the y coordinate (vertical position) of the top left corner of the subpicture. Specifically, subpic_ctu_top_left_y may indicate the y coordinate of the CTU of the top left corner of the subpicture. In this case, the coordinate may be expressed in CTU units or CTB units. For example, the coordinate may be expressed in CtbSizeY units. subpic_ctu_top_left_y may be signaled as an unsigned integer value, and the number of bits of subpic_ctu_top_left_y may be Ceil(Log2(pic_height_max_in_luma_samples÷CtbSizeY)). On the other hand, if the value of subpic_ctu_top_left_y does not exist, the value of subpic_ctu_top_left_y may be inferred to be 0. In this case, the number of bits of subpic_ctu_top_left_y may be determined as Ceil(Log2(Ceil(pic_height_max_in_luma_samples÷CtbSizeY))).

[0462] subpic_width_minus1 may indicate the width of a subpicture. For example, the value of subpic_width_minus1 plus a previously set value may indicate the width of the subpicture. In this case, the previously set value may be 1. The width of a subpicture may be expressed in CTU units or CTB units. For example, the width of a subpicture may be expressed in CtbSizeY units. subpic_width_minus1 may be signaled as an unsigned integer value, and the number of bits of subpic_width_minus1 may be Ceil(Log2(pic_width_max_in_luma_samples÷CtbSizeY)). On the other hand, if the value of subpic_width_minus1 does not exist, the value of subpic_width_minus1 may be inferred as (Ceil(pic_width_max_in_luma_samples÷CtbSizeY)-1). In this case, the number of bits of subpic_width_minus1 may be determined as Ceil(Log2(Ceil(pic_width_max_in_luma_samples÷CtbSizeY))).

[0463] subpic_height_minus1 may indicate the height of a subpicture. For example, the value of subpic_height_minus1 plus a previously set value may indicate the height of the subpicture. In this case, the previously set value may be 1. The height of a subpicture may be expressed in CTU units or CTB units. For example, the height of a subpicture may be expressed in CtbSizeY units. subpic_height_minus1 may be signaled as an unsigned integer value, and the number of bits of subpic_height_minus1 may be Ceil(Log2(pic_height_max_in_luma_samples÷CtbSizeY)). On the other hand, if the value of subpic_height_minus1 does not exist, the value of subpic_height_minus1 may be inferred as (Ceil(pic_height_max_in_luma_samples÷CtbSizeY)-1). In this case, the number of bits of subpic_height_minus1 may be determined as Ceil(Log2(Ceil(pic_height_max_in_luma_samples÷CtbSizeY))).

[0464] The expression range for the position and size of subpictures can be expanded using the syntax elements disclosed in FIG. 45. As described above, when a syntax element is not present and the value of the syntax element is inferred, the number of bits is calculated as Ceil(Log2(Ceil(x))), which is advantageous in terms of implementing a device (decoder / encoder) that can accept only integers for y in Log2(y). The values ​​of (pic_width_max_in_luma_samples÷CtbSizeY) and (pic_height_max_in_luma_samples÷CtbSizeY) indicate the number of CtbSizeY units in the picture width and picture height, respectively. When using the syntax elements disclosed in FIG. 45, the width of Subpicture 0 and the x-coordinate of Subpicture 2 disclosed in FIG. 44 can be expressed.

[0465] FIG. 46 is a flowchart illustrating a method for dividing a transform block according to one embodiment of the present invention.

[0466] The following describes a method and apparatus for dividing a transform block based on the embodiment described with reference to FIGS.

[0467] The video signal decoding apparatus may include a processor that performs a method for dividing a transform block. First, the video signal decoding apparatus may receive a bitstream including information (e.g., syntax elements) about transform blocks. The processor may determine a result value indicating a division direction of a current transform block (TB) based on a preset condition (S4601). The processor may divide the current transform block into a plurality of transform blocks based on the result value (S4602). The processor may decode a video signal using the plurality of transform blocks (S4603).

[0468] The video signal encoding device may also include a processor that determines a result value indicating a division direction of a current transform block (TB) based on a pre-set condition, divides the current transform block into a plurality of transform blocks based on the result value, and generates a bitstream including information about the plurality of transform blocks.

[0469] In this case, the pre-set conditions may include conditions related to color components of the current transform block.

[0470] In this case, the pre-set conditions may further include conditions related to the result of comparing the width of the current transform block with the maximum transform block width, and the maximum transform block width may be determined based on a chroma format associated with the current transform block, the color components of the current transform block, and the maximum transform size.

[0471] In this case, the pre-set conditions further include a condition related to the result of comparing a first width value, which is the width of the current transformation block multiplied by a first value, with a first height value, which is the height of the current transformation block multiplied by a second value, and the first value and the second value are values ​​related to the width and height of the current transformation block, respectively, and may be set to 1 if the color component of the current transformation block is luma, and may be determined based on the chroma format related to the current transformation block if the color component is chroma.

[0472] If the width of the current transform block is greater than the maximum transform block width and the first width value is greater than the first height value, the result value may be determined to be 1, which indicates that the division direction is vertical. In this case, the width of each of the plurality of transform blocks may be a value obtained by dividing the width of the transform block by 2, and the height of each of the plurality of transform blocks may be the same value as the height of the transform block.

[0473] If the width of the current transform block is equal to or smaller than the maximum transform block width or the first width value is equal to or smaller than the first height value, the result value may be determined to be 0, which indicates that the division direction is horizontal. In this case, the width of each of the plurality of transform blocks may be the same as the width of the transform block, and the height of each of the plurality of transform blocks may be a value obtained by dividing the height of the transform block by 2.

[0474] At this time, the already set conditions may be the conditions explained in Equations 2 to 4 above.

[0475] The maximum transform size may be determined based on the size of a coding tree block (CTB) having a luma component included in a coding tree unit (CTU) associated with the current transform block. If the size of the coding tree block is 32, the maximum transform size may be 32.

[0476] If the color component of the current transform block is chroma, the processor may parse a syntax element indicating whether a prediction method of a coding block associated with the current transform block is block-based delta pulse code modulation (BDPCM). If the parsing result indicates that the prediction method of the coding block is not BDPCM, the processor may further parse syntax elements related to the prediction method of the coding block and determine the prediction method of the coding block based on the parsing result. In this case, the syntax element related to the prediction method of the coding block may be a syntax element indicating at least one of a cross component linear model (CCLM), a planar mode, a DC mode, a vertical mode, a horizontal mode, a diagonal mode, and a DM mode.

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

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

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

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

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

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

Claims

1. 1. A video signal decoding apparatus including a processor, The processor: determining a result value indicating whether the division direction of the current transform block is vertical or horizontal; Dividing the current transformation block into a plurality of transformation blocks based on the resultant value; Decoding the current transformation block based on the plurality of transformation blocks. It is configured as follows: the result value is determined based on a result of comparing a width of the current transform block with a maximum transform block width and a result of comparing a first value with a second value; the maximum transform block width is determined based on a chroma format associated with the current transform block, color components of the current transform block, and a maximum transform size; i) if the color component of the current transform block is a luma component, the first value is obtained by multiplying the width of the current transformation block by 1; the second value is obtained by multiplying the height of the current transformation block by 1; ii) if the color components of the current transform block are chroma components, the first value is obtained by multiplying the width of the current transform block by SubWidthC; the second value is obtained by multiplying the height of the current transformation block by SubHeightC; Each of the SubWidthC and the SubHeightC is a variable determined based on the chroma format associated with the current transform block. Video signal decoding device.

2. If the color component of the current transform block is a luma component, the maximum transform block width is the maximum transform size; If the color components of the current transform block are chroma components, the maximum transform block width is the maximum transform size divided by the SubWidthC.

2. A video signal decoding device according to claim 1.

3. If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:2:0, then the SubWidthC is 2 and the SubHeightC is 2; If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:2:2, then SubWidthC is 2 and SubHeightC is 1; If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:4:4, then SubWidthC is 1 and SubHeightC is 1.

2. A video signal decoding device according to claim 1.

4. If the width of the current transform block is equal to or smaller than the maximum transform block width or the first value is equal to or smaller than the second value, the result value is determined to be 0, which is a value indicating that the division direction is the horizontal direction; If the width of the current transform block is greater than the maximum transform block width and the first value is greater than the second value, the result value is determined to be 1, which indicates that the division direction is the vertical direction.

2. A video signal decoding device according to claim 1.

5. If the result value is determined to be 0, a width of each of the plurality of transformation blocks is the same as the width of the current transformation block; a height of each of the plurality of transformation blocks is the height of the current transformation block divided by two; If the result value is determined to be 1, a width of each of the plurality of transformation blocks is the width of the current transformation block divided by two; a height of each of the plurality of transformation blocks is the same as the height of the current transformation block; 5. A video signal decoding apparatus according to claim 4.

6. 1. A video signal encoding device including a processor, The processor: configured to obtain a bitstream to be decoded by a decoder using a decoding method; The decoding method comprises: determining a result value indicating whether the division direction of the current transformation block is vertical or horizontal; dividing the current transformation block into a plurality of transformation blocks based on the resultant value; decoding the current transformation block based on the plurality of transformation blocks; Including, the result value is determined based on a result of comparing a width of the current transform block with a maximum transform block width and a result of comparing a first value with a second value; the maximum transform block width is determined based on a chroma format associated with the current transform block, color components of the current transform block, and a maximum transform size; i) if the color component of the current transform block is a luma component, the first value is obtained by multiplying the width of the current transformation block by 1; the second value is obtained by multiplying the height of the current transformation block by 1; ii) if the color components of the current transform block are chroma components, the first value is obtained by multiplying the width of the current transform block by SubWidthC; the second value is obtained by multiplying the height of the current transformation block by SubHeightC; Each of the SubWidthC and the SubHeightC is a variable determined based on the chroma format associated with the current transform block. Video signal encoding device.

7. If the color component of the current transform block is a luma component, the maximum transform block width is the maximum transform size; If the color components of the current transform block are chroma components, the maximum transform block width is the maximum transform size divided by the SubWidthC.

7. A video signal encoding device according to claim 6.

8. If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:2:0, then the SubWidthC is 2 and the SubHeightC is 2; If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:2:2, then SubWidthC is 2 and SubHeightC is 1; If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:4:4, then SubWidthC is 1 and SubHeightC is 1.

7. A video signal encoding device according to claim 6.

9. If the width of the current transform block is equal to or smaller than the maximum transform block width or the first value is equal to or smaller than the second value, the result value is determined to be 0, which is a value indicating that the division direction is the horizontal direction; If the width of the current transform block is greater than the maximum transform block width and the first value is greater than the second value, the result value is determined to be 1, which indicates that the division direction is the vertical direction.

7. A video signal encoding device according to claim 6.

10. If the result value is determined to be 0, a width of each of the plurality of transformation blocks is the same as the width of the current transformation block; a height of each of the plurality of transformation blocks is the height of the current transformation block divided by two; If the result value is determined to be 1, a width of each of the plurality of transformation blocks is the width of the current transformation block divided by two; a height of each of the plurality of transformation blocks is the same as the height of the current transformation block; 10. A video signal encoding device according to claim 9.

11. 1. A method for obtaining a bitstream, comprising: determining a result value indicating whether the division direction of the current transformation block is vertical or horizontal; dividing the current transformation block into a plurality of transformation blocks based on the resultant value; obtaining a bitstream by encoding information for the plurality of transform blocks; Including, the result value is determined based on a result of comparing a width of the current transform block with a maximum transform block width and a result of comparing a first value with a second value; the maximum transform block width is determined based on a chroma format associated with the current transform block, color components of the current transform block, and a maximum transform size; i) if the color component of the current transform block is a luma component, the first value is obtained by multiplying the width of the current transformation block by 1; the second value is obtained by multiplying the height of the current transformation block by 1; ii) if the color components of the current transform block are chroma components, the first value is obtained by multiplying the width of the current transform block by SubWidthC; the second value is obtained by multiplying the height of the current transformation block by SubHeightC; Each of the SubWidthC and the SubHeightC is a variable determined based on the chroma format associated with the current transform block. method.

12. If the color component of the current transform block is a luma component, the maximum transform block width is the maximum transform size; If the color components of the current transform block are chroma components, the maximum transform block width is the maximum transform size divided by the SubWidthC. The method of claim 11.

13. If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:2:0, then the SubWidthC is 2 and the SubHeightC is 2; If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:2:2, then SubWidthC is 2 and SubHeightC is 1; If the color components of the current transform block are chroma components and the chroma format associated with the current transform block is 4:4:4, then SubWidthC is 1 and SubHeightC is 1. The method of claim 11.

14. If the width of the current transform block is equal to or smaller than the maximum transform block width or the first value is equal to or smaller than the second value, the result value is determined to be 0, which is a value indicating that the division direction is the horizontal direction; If the width of the current transform block is greater than the maximum transform block width and the first value is greater than the second value, the result value is determined to be 1, which indicates that the division direction is the vertical direction. The method of claim 11.

15. If the result value is determined to be 0, a width of each of the plurality of transformation blocks is the same as the width of the current transformation block; a height of each of the plurality of transformation blocks is the height of the current transformation block divided by two; If the result value is determined to be 1, a width of each of the plurality of transformation blocks is the width of the current transformation block divided by two; a height of each of the plurality of transformation blocks is the same as the height of the current transformation block; 15. The method of claim 14.

16. 1. A method for processing a video signal, comprising: determining a result value indicating whether the division direction of the current transformation block is vertical or horizontal; dividing the current transformation block into a plurality of transformation blocks based on the resultant value; decoding the current transformation block based on the plurality of transformation blocks; Including, the result value is determined based on a result of comparing a width of the current transform block with a maximum transform block width and a result of comparing a first value with a second value; the maximum transform block width is determined based on a chroma format associated with the current transform block, color components of the current transform block, and a maximum transform size; i) if the color component of the current transform block is a luma component, the first value is obtained by multiplying the width of the current transformation block by 1; the second value is obtained by multiplying the height of the current transformation block by 1; ii) if the color components of the current transform block are chroma components, the first value is obtained by multiplying the width of the current transform block by SubWidthC; the second value is obtained by multiplying the height of the current transformation block by SubHeightC; Each of the SubWidthC and the SubHeightC is a variable determined based on the chroma format associated with the current transform block. method.

Citation Information

Patent Citations

  • Video signal processing method and apparatus

    JP7740764B2

  • Method, apparatus and system for de-blocking video data

    US20140192904A1

  • Method and apparatus of video data processing with restricted block size in video coding

    US20190075328A1

  • Video encoding / decoding method and apparatus, and recording medium in which bit stream is stored

    WO2018080122A1