Method and device for processing video signal

The video signal processing method enhances coding efficiency by dividing transform blocks based on preset conditions and optimizing prediction modes, addressing inefficiencies in existing methods.

JP2025010445AActive Publication Date: 2025-01-20WILUS INSTITUTE OF STANDARDS & TECHNOLOGY INC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024194448
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-12-19
Filing Date
2024-11-06
Publication Date
2025-01-20
Estimated Expiration
2040-07-20

AI Technical Summary

Technical Problem

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

Method used

A video signal processing method that utilizes quadratic transform to divide current transform blocks into multiple blocks based on preset conditions, including comparisons with maximum block widths and chroma formats, to enhance coding efficiency and prediction mode selection.

Benefits of technology

The method increases coding efficiency by optimizing the division of transform blocks and prediction modes, leading to improved video signal processing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025010445000001_ABST
    Figure 2025010445000001_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 via a communication line or storing it in a form suitable for a storage medium. The objects of compression coding include voice, video, text, etc., and the technology for compressing and coding video in particular is called video compression. Compression coding of video signals is performed by removing redundant information by considering spatial correlation, temporal correlation, probabilistic correlation, etc. However, with the recent development of various media and data transmission media, there is a demand for more efficient video signal processing methods and devices. Summary of the Invention [Problem to be solved by the invention]

[0003] An object of the present invention is to increase the efficiency of coding of video signals.

[0004] An object of the present invention is to increase the coding efficiency of a video signal by using a division of 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 transformation.

[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] Also, in this specification, the pre-set conditions further include a condition related to a 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 associated with the current transform block, color components of the current transform block, and a maximum transform size.

[0009] In addition, in this specification, the already-set condition further includes 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, and 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 characterized in that if the color component of the current transformation block is luma, they are set to 1, and if it is chroma, they are determined based on a chroma format related to the current transformation block.

[0010] Also, in this specification, when the width of the current transformation block is greater than the maximum transformation 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 transformation blocks is a value obtained by dividing the width of the transformation block by 2, and the height of each of the plurality of transformation blocks is the same value as the height of the transformation block.

[0011] Also, in this specification, when the width of the current transformation block is equal to or smaller than the maximum transformation block width or the first width value is equal to or smaller 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 transformation blocks is the same value as the width of the transformation block, and the height of each of the plurality of transformation blocks is a value obtained by dividing the height of the transformation 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) associated with 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 the present specification, a video signal encoding 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 generates a bitstream including information on the plurality of transform blocks, wherein the pre-set condition includes a condition related to a color component of the current transform block.

[0016] Also, in this specification, the pre-set conditions further include a condition related to a 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 associated with the current transform block, color components of the current transform block, and a maximum transform size.

[0017] In addition, in this specification, the already-set condition further includes 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, and 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 characterized in that if the color component of the current transformation block is luma, they are set to 1, and if it is chroma, they are determined based on a chroma format related to the current transformation block.

[0018] Also, in this specification, when the width of the current transformation block is greater than the maximum transformation 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 transformation blocks is a value obtained by dividing the width of the transformation block by 2, and the height of each of the plurality of transformation blocks is the same value as the height of the transformation block.

[0019] Also, in this specification, when the width of the transformation block is equal to or less than the maximum transformation 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 transformation blocks is the same value as the width of the transformation block, and the height of each of the plurality of transformation blocks is a value obtained by dividing the height of the transformation 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) associated with 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 the present specification, in a non-transitory computer-readable medium storing 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] Also, in this specification, the pre-set conditions further include a condition related to a 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 associated with the current transform block, color components of the current transform block, and a maximum transform size.

[0025] Also, in this specification, the pre-set condition further includes 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 characterized in that if the color component of the current transformation block is luma, they are set to 1, respectively, and if it is chroma, they are determined based on a chroma format related to the current transformation block.

[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) associated with the current transform block. Effect 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 description 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; [Diagram 2] 1 is a schematic block diagram of a video signal decoding device according to an embodiment of the present invention; [Diagram 3] FIG. 2 shows 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 splits of quad trees and multi-type trees. [Diagram 5] FIG. 2 illustrates in more detail an intra-prediction method according to an embodiment of the present invention; [Figure 6] FIG. 2 illustrates 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] 4 illustrates how a motion vector of a current block is signaled according to one embodiment of the present invention. [Figure 9]4 illustrates how motion vector difference values ​​for a current block are signaled according to one embodiment of the present invention. [Figure 10] A diagram showing a coding unit and a transform unit according to one embodiment of the present invention. [Figure 11] FIG. 2 is a diagram illustrating a transform tree syntax according to one embodiment of the present invention.

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

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

[0032] The terms used in this specification are selected from currently widely used general terms as much as possible while taking into consideration the functions in the present invention, but this may vary depending on the intentions of the engineers in this field, customs, or the emergence of new technologies. In addition, in certain cases, the applicant may arbitrarily select terms, and in this case, the meanings of the terms will be described in the corresponding embodiment of the invention. Therefore, it is made clear that the terms used in this specification should be interpreted based on the substantial meanings of the terms and the contents of this specification as a whole, rather than simply the names of the terms.

[0033] In this specification, some terms are interpreted as follows. Coding may be interpreted as encoding or decoding depending on the circumstances. In this specification, an apparatus for encoding a video signal to generate a video signal bitstream is referred to as an encoding apparatus or encoder, and an apparatus for decoding a video signal bitstream to restore a video signal is referred to as a decoding apparatus or decoder. In this specification, a video signal processing apparatus is used as a term including both an encoder and a decoder. Information is a term including values, parameters, coefficients, elements, etc., and may be interpreted differently depending on the circumstances, so the present invention is not limited thereto. A 'unit' is used to mean a basic unit of image processing or a specific position of a picture, and refers to an image area including at least one of a luma component and a chroma component. In addition, a 'block' refers to an image area 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 'area' may be used interchangeably. In this specification, a unit is used as a concept including a coding unit, a prediction unit, and a transform unit, and a picture refers to a field or a frame, and the terms are 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 a difference between an input video signal and a 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 is used. The discrete cosine transform and the discrete sine transform divide the input picture signal into blocks and perform the transform. In the transform, the coding efficiency may vary depending on the distribution and characteristics of values ​​in the transform domain. The quantizer 115 quantizes the values ​​of the transform coefficients output from the transform unit 110.

[0036] In order to improve coding efficiency, instead of coding the picture signal as it is, a method is used in which a picture is predicted using a pre-coded area through the prediction unit 150, and a residual value between the original picture and the predicted picture is added to the predicted picture to obtain a reconstructed picture. In order to prevent mismatch between the encoder and the decoder, when the encoder performs prediction, information that can also be used by the decoder should be used. For this purpose, the encoder performs a process of further reconstructing the current block that has been coded. 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 a filtering operation 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, and the like. The filtered picture is stored in a decoded picture buffer (DPB) 156 to be output or used as a reference picture.

[0037] In order to improve coding efficiency, a method is used in which a picture signal is not coded as it is, but a picture is predicted using an already coded area in the prediction unit 150, and a residual value between the original picture and the predicted picture is added to the predicted picture to obtain a restored 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 restored area in the current picture, and transmits 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 of the current area by referring to a specific restored area. The motion estimation unit 154a transmits position information (reference frame, motion vector, etc.) of the reference area 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 a current picture, and the inter prediction unit 154 performs inter prediction to predict the current picture using a reference buffer stored in a 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, a Most Probable Mode (MPM) flag, and an MPM index. The intra coding information may include information about a reference sample. The intra coding information may include information about a reference sample. 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 of a current region by referring to a specific region of a 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 value 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] When the above-mentioned picture prediction is performed, the transform unit 110 converts residual values ​​between the original picture and the predicted picture to obtain transform coefficient values. At this time, the transform is performed in units of specific blocks within the picture, and the size of the specific blocks varies within a preset range. The quantization unit 115 quantizes the transform coefficient values ​​generated by the transform unit 110 and transfers the quantized values ​​to the entropy coding unit 160.

[0041] The entropy coding unit 160 generates a video signal bit stream 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) method, an arithmetic coding method, and the like. The variable length coding (VLC) method converts input symbols into consecutive code words, but the length of the code words is variable. For example, frequently occurring symbols are represented by short code words, and infrequently occurring symbols are represented by long code words. As the variable length coding method, a context-based adaptive variable length coding (CAVLC) method is used. In arithmetic coding, consecutive data symbols are converted into one prime number, and arithmetic coding obtains optimal prime number bits required to represent each symbol. As the arithmetic coding, a context-based adaptive binary arithmetic coding (CABAC) method is used. For example, the entropy coding unit 160 may binarize information indicating the quantized transform coefficients, and may arithmetically code the binarized information to generate a bitstream.

[0042] The generated bitstream is encapsulated in a basic unit of Network Abstraction Layer (NAL) 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 should first be separated into NAL units and then each separated NAL unit should be decoded. Meanwhile, information required for decoding the video signal bitstream may be transmitted in a Raw Byte Sequence Payload (RBSP) of a higher level set 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 apparatus 100 according to one embodiment of the present invention, with separate blocks illustrating logically distinct elements of encoding apparatus 100. Thus, the elements of encoding apparatus 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 of the elements of encoding apparatus 100 described above is performed by a processor (not shown).

[0044] 2 is a schematic block diagram of a video signal decoding device 200 according to an embodiment of the present invention. Referring to FIG. 2, the decoding device 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 inverse quantizes the quantized transform coefficients, and the inverse transform unit 225 restores residual values ​​using the inverse quantized transform coefficients. The video signal processing device 200 combines the residual values ​​obtained from the inverse transform unit 225 with the predicted values ​​obtained from the prediction unit 250 to restore original pixel values.

[0046] Meanwhile, the filtering unit 230 performs filtering on the picture to improve image quality, including a deblocking filter for reducing block distortion and / or an adaptive loop filter for removing distortion of the entire picture, etc. The filtered picture is output or stored in a 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, the transform coefficient for each region, the intra / inter coding information, etc., decoded through 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 ​​of 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, the reference samples, and the samples of the current block refer to pixels. Also, a sample value refers to a pixel value.

[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. Also, the reference samples are samples located on a line within a preset distance from the left boundary of the current block and / or samples located on a line within a preset distance from the top boundary of the current block among samples of neighboring blocks of the current block. In this case, the neighboring blocks of the current block include at least one of a left (L) block, an upper (A) block, a below left (BL) block, an above right (AR) block, or an above left (AL) block adjacent to the current block.

[0050] The inter prediction unit 254 generates a prediction block using the reference picture and inter coding information stored in the decoded picture buffer 256. The inter coding information includes a motion information set (reference picture index, motion vector, etc.) of a current block with respect to a reference block. Inter prediction includes L0 prediction, L1 prediction, and bi-prediction. L0 prediction means a prediction using one reference picture included in an L0 picture list, and L1 prediction means a prediction using one reference picture included in an L1 picture list. For this purpose, one set of motion information (e.g., motion vector and reference picture index) is required. In the bi-prediction method, a maximum of two reference regions are used, and the two reference regions may exist in the same reference picture or may exist in different pictures. That is, in the bi-prediction method, a maximum of two sets of motion information (e.g., motion vector and reference picture index) are used, and the two motion vectors may correspond to the same reference picture index or may correspond to different reference picture indexes. In this case, the reference picture may be displayed (or output) either before or after the current picture in terms of time. According to one embodiment, in a bi-prediction 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. In addition, a sample value of a block identified by the motion vector or an interpolated value thereof is used as a predictor of the current block. For motion prediction with pixel accuracy in sub-pel units, for example, an 8-tab interpolation filter is used for a luminance signal, and a 4-tab interpolation filter is used for a chrominance signal. However, the interpolation filter for sub-pel unit motion prediction is not limited thereto. In this way, the inter prediction unit 254 performs motion compensation to predict the texture of the current unit from a previously restored picture. In this case, the inter prediction unit uses a motion information set.

[0052] According to a further embodiment, the prediction unit 250 may include an intra BC prediction unit (not shown). The intra BC prediction unit may reconstruct the current region by referring to a specific region including reconstructed samples in the current picture. The intra BC prediction unit obtains intra BC coding information for the current region from the entropy decoding unit 210. The intra BC prediction unit obtains block vector values ​​of the current region indicating the specific region in the current picture. The intra BC prediction unit 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 summing the predicted value output from the intra prediction unit 252 or the inter prediction unit 254 and the residual value output from the inverse transformation 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 obtained from the inverse transformation unit 225.

[0054] 2 shows a block diagram of a decoding apparatus 200 according to an embodiment of the present invention, with separate blocks illustrating the logical separation of elements of the decoding apparatus 200. Thus, the elements of the decoding apparatus 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 apparatus 200 described above is performed by a processor (not shown).

[0055] FIG. 3 illustrates an embodiment in which a coding tree unit (CTU) is divided into coding units (CUs) in a picture. In the process of coding a video signal, a picture is divided into a sequence of coding tree units (CTUs). A coding tree unit consists of two blocks, an NXN block of luma samples and a corresponding chroma sample. A coding tree unit is divided into a plurality of 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 in the above-mentioned video signal processing process, i.e., in the process of intra / inter prediction, transformation, quantization, and / or entropy coding. In one picture, the size and pattern of the coding units are not constant. The coding units have a square or rectangular pattern. 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, a non-square block refers to a rectangular block, but the present invention is not limited to this.

[0056] Referring to Figure 3, the 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, the quad tree is also referred to as a quaternary tree. The quad tree division is performed recursively, and it is not necessary that all nodes are 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, the Multi-Type Tree structure has four division structures, namely, 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 divided into two 2N×N nodes by horizontal binary division. In addition, in a Ternary Tree (TT) structure, a node of size 2N x 2N is divided into (N / 2) x 2N, N x 2N, and (N / 2) x 2N nodes by vertical ternary division, and into 2N x (N / 2), 2N x N, and 2N x (N / 2) nodes by horizontal ternary division. Such multi-type tree division is performed recursively.

[0058] Leaf nodes of a multi-type tree can 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 the 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 quad tree, 2) MinQtSize: the size of the smallest QT leaf node allowed, 3) MaxBtSize: the size of the largest BT root node allowed, 4) MaxTtSize: the size of the largest TT root node allowed, 5) MaxMttDepth: the maximum allowed depth of MTT split from a QT leaf node, 6) MinBtSize: the size of the smallest BT leaf node allowed, 7) MinTT size: the size of the smallest TT leaf node allowed.

[0059] 4 shows an embodiment of a method for signaling the split of a quadtree and a multitype tree. In order to signal the split of a quadtree and a multitype tree as described above, 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 form 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 or not 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 includes 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 a quadtree or a multitype tree node according to the value of 'split_qt_flag'. The coding tree unit is the root node of the 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, and 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, the quadtree split may be restricted according to the type of the current node. If the current node is a coding tree unit (root node of the quadtree) or a quadtree node, the quadtree split may be allowed, and if the current node is a multitype tree node, the quadtree split may not be allowed. Each quad tree leaf node 'QT leaf node' may be further split into a multi-type tree structure. As described above, if 'split_qt_flag' is 0, the current node may be split into a multi-type node. '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' has a value of 1, it indicates a vertical split of the node 'MTT node', and if 'mtt_split_cu_vertical_flag' has a value of 0, it indicates a horizontal split of the node 'MTT node'. Also, if 'mtt_split_cu_binary_flag' has a value of 1, the node 'MTT node' is split into two rectangular nodes, and if 'mtt_split_cu_binary_flag' has a value of 0, the node 'MTT node' 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 a coding unit tree). The basic unit for performing such 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 in a broader sense, the term "unit" is understood as a concept including the coding unit.

[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 a current block using reconstructed samples located to the left and / or above the current block as reference samples.

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

[0066] Also, 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. Also, the intra prediction unit performs a reference sample filtering process to reduce an error in intra prediction. That is, filtering is performed on the 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, the neighboring samples may include samples on at least one reference line. For example, the neighboring samples may include neighboring samples on lines adjacent to the boundary of the current block.

[0067] Next, FIG. 6 illustrates an embodiment of a prediction mode used in intra prediction. For intra prediction, intra prediction mode information indicating an 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. The 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 (e.g., a total of 67 intra prediction modes) used in intra prediction. 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 preset index (i.e., intra prediction mode index). For example, as shown in FIG. 6, an intra prediction mode index 0 indicates a planar mode, and an intra prediction mode index 1 indicates a DC mode. In addition, intra prediction mode indexes 2 to 66 indicate different angle modes. The angle modes indicate different angles within a preset angle range. For example, the angle modes may indicate angles within an angle range of 45° to −135° in a clockwise direction (i.e., a first angle range). The angle modes may be defined based on a 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 previously set angle range may be set individually 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 further 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 further 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 further used. According to an embodiment of the present invention, the values ​​of offset 1 and offset 2 may be determined individually according to a ratio between the width and 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, where the extended angle mode may be determined based on the base angle mode.

[0071] According to an 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 any one of intra prediction modes {2, 4, 6, ..., 66}, and the extended angle mode may be an angle mode corresponding to any one of intra prediction modes {3, 5, 7, ..., 65}. That is, the extended angle mode may be an angle mode between the basic angle modes within the 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 basic angle mode may be a mode corresponding to an angle within a first angle range that has already been set, and the extension angle mode may be a wide angle mode outside the first angle range. That is, the basic angle mode may be an angle mode corresponding to any one of intra prediction modes {2, 3, 4, ..., 66}, and the extension angle mode may be an angle mode corresponding to any one of intra prediction modes {-10, -9, ..., -1} and {67, 68, ..., 76}. An angle indicated by the extension angle mode may be determined as an angle opposite to an angle indicated by the corresponding basic angle mode. Thus, an angle indicated by the extension angle mode may be determined based on an angle indicated by the basic angle mode. Meanwhile, the number of extension angle modes is not limited thereto, and further extension angles may be defined according to the size and / or shape of the current block. For example, the extension angle mode may be defined as an angle mode corresponding to any one of 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 base angle mode and the extended angle mode.

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

[0074] According to an embodiment of the present invention, the extension angle mode may be signaled based on the basic angle mode. For example, the wide angle mode (i.e., the extension angle mode) may replace at least one angle mode (i.e., the basic angle mode) within the first angle range. The replaced basic angle mode may be an angle mode corresponding to the opposite side of the wide angle mode. That is, the replaced basic angle mode is an angle mode corresponding to an angle in the opposite direction of the angle indicated by the wide angle mode or an angle having a difference from the opposite angle by the offset index already set. According to an embodiment of the present invention, the offset index already set is 1. The intra prediction mode index corresponding to the replaced basic angle mode may be remapped to the wide angle mode to signal the wide angle mode. For example, the wide angle modes {-10, -9, ..., -1} may be signaled by intra prediction mode indexes {57, 58, ..., 66}, respectively, and the wide angle modes {67, 68, ..., 76} may be signaled by intra prediction mode indexes {2, 3, ..., 11}, respectively. By signaling the extended angular mode with the intra prediction mode index for the base angular mode in this manner, 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 for signaling the intra prediction mode, thereby minimizing signaling overhead due to changes in the intra prediction mode configuration.

[0075] Meanwhile, whether or not 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 pre-set size, the extended angle mode may be used for intra prediction of the current block, otherwise, 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 block other than a square, 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] Hereinafter, an inter prediction method according to an embodiment of the present invention will be described with reference to Fig. 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 according to the general inter prediction method and a control point motion vector for affine motion compensation.

[0077] FIG. 7 is a diagram illustrating an inter prediction method according to an embodiment of the present invention. As described above, the decoder can predict a current block by referring to a reconstructed sample 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. At this time, the motion information set may include a reference picture index and a motion vector 703. The reference picture index indicates a reference picture 720 including a reference block for inter prediction of the current block in a reference picture list. According to an embodiment, the reference picture list may include at least one of the above-mentioned L0 picture list or L1 picture list. The motion vector 703 represents an offset between a coordinate value of the current block 701 in the current picture 710 and a coordinate value of the reference block 702 in the reference picture 720. The decoder obtains a predictor of the current block 701 based on a sample value 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 is earlier 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 previously set search area. In this case, 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, the SAD may be a value obtained by adding up all absolute values ​​of differences between sample values ​​included in both blocks. Also, the SATD may be a value obtained by adding up all absolute values ​​of Hadamard transform coefficients obtained by performing Hadamard transform on differences 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 by a bi-prediction scheme using two or more reference regions. According to an embodiment, the decoder may obtain two reference blocks based on two motion information sets of the current block. Also, the decoder may obtain a first predictor and a second predictor of the current block based on respective sample values ​​of the obtained two reference blocks. Also, the decoder may 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 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 in which the motion information set of the current block is signaled 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 an embodiment, the MVP candidate list may include at least one of spatial candidates and temporal candidates. The spatial candidates may be a motion information set used for predicting a neighboring block within a certain range from the current block in the current picture. The spatial candidates may be configured based on available neighboring blocks of the current block. Also, the temporal candidates may be a motion information set used for predicting a block in the current picture and another picture. For example, the temporal candidates may be configured 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 a further embodiment, the MVP candidate list may include a zero motion vector. According to a further embodiment, a rounding process may be performed on the MVP candidates included in the MVP candidate list of the current block. In this case, a resolution of a motion vector difference value of the current block, which will be described later, may be used. For example, each MVP candidate of 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 an embodiment, the encoder 810 and the decoder 820 may configure an MVP candidate list for motion compensation of the current block. For example, among samples reconstructed prior to 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 configure 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 configure the MVP candidate list according to a rule predefined between the encoder 810 and the decoder 820. That is, the MVP candidate lists configured in the encoder 810 and the decoder 820 may be the same as each other.

[0085] Also, the predefined rule may vary according to the prediction mode of the current block. For example, when the prediction mode of the current block is an affine prediction mode based on an affine model, the encoder and decoder may configure the MVP candidate list of 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, when the prediction mode of the current block is a general inter prediction mode not based on the affine model, the encoder and decoder may configure the MVP candidate list of the current block using a second method not based on the affine model. In this case, the first method and the second method may be different methods.

[0086] The decoder 820 may derive a motion vector of the current block based on any one of at least one MVP candidates included in the MVP candidate list of 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 of the current block. The decoder 820 may obtain a motion vector predictor of the current block based on the signaled MVP index. The decoder 820 may derive a motion vector of the current block using the motion vector predictor. According to an embodiment, the decoder 820 may use the motion vector predictor obtained from the MVP candidate list as the motion vector of the current block without a separate motion vector difference 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 of the current block without a separate motion vector difference value may be referred to as a merge mode.

[0087] According to another embodiment, the decoder 820 may obtain another 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 of 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 restore the current block based on the motion vector of the current block.

[0088] Further, 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 a 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. At this time, 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 scale the MVP to obtain an MVP'. At this time, 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. Also, the decoder 820 may use the MVP' as a motion vector predictor of the current block.

[0089] As described above, the motion vector of the current block may be obtained by adding 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, generate information indicating the motion vector differential value, and signal the information. Hereinafter, a method for signaling the motion vector differential value according to an embodiment of the present invention will 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] According to one embodiment, the absolute value of the motion vector difference value may be signaled by the value itself. The encoder may reduce the size of the signaled value using at least one flag that indicates a characteristic of the absolute value of the motion vector difference value. The decoder may derive the absolute value of the motion vector difference value from the signaled value using the 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 size of 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 the activated first flag. In this case, the activated flag may indicate that the size of 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 difference 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 difference value is greater than '0', the absolute value of the motion vector difference value may be '0'. Also, if the second flag (abs_mvd_greater0_flag) indicates that the absolute value of the motion vector difference value is greater than '0', the decoder may obtain the absolute value of the motion vector difference value using other information on the motion vector difference 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 difference value is greater than '1', the decoder can obtain the absolute value of the motion vector difference value using further information related to the motion vector difference value. For example, a value (absolute value of the motion vector difference value - 2) (abs_mvd_minus2) may be signaled. This is because if the absolute value of the motion vector difference value is greater than '1', the absolute value of the motion vector difference value may be a value of 2 or more.

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

[0097] Alternatively, the sign of the motion vector difference value may be signaled by the sign flag (mvd_sign_flag), or alternatively, the sign of the motion vector difference value may be signaled implicitly 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 a 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 a precision or granularity in 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 a sample unit such as ¼ (quarter), ½ (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 higher the precision of the motion vector differential value of the current block may be.

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

[0100] According to an 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 the first block may be in units of 1 / 4 samples. In this case, '64', which is a value obtained by dividing the absolute value '16' of the motion vector differential value by the first resolution, may be signaled. Also, the second resolution of the motion vector differential value of the second block may be in units of integer samples. In this case, '16', which is a value obtained by dividing the absolute value '16' of the second motion vector differential value 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 may signal information indicating a motion vector differential value based on the resolution of the motion vector differential value. The decoder may obtain a modified motion vector differential value from the signaled motion vector differential value. The decoder may 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 as 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 a value before being modified by resolution.

[0102]

number

[0103] In Equation 1, resolution represents the resolution of the motion vector difference value of the current block. That is, the decoder may multiply the signaled motion vector difference value of the current block by the resolution to obtain a modified motion vector difference value. Then, the decoder may obtain the motion vector of the current block based on the modified motion vector difference value. Also, the decoder may 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 easy to indicate the motion vector differential value of the current block more precisely. However, in this case, the signaled value itself becomes large, and the signaling overhead for the motion vector differential value of the current block may increase. 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, and the signaling overhead for the motion vector differential value can be reduced. 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 a smaller number of 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 in detail.

[0105] Thus, the encoder and the decoder can select an advantageous resolution for signaling a motion vector differential value from among a plurality of resolutions depending on the situation. For example, the encoder can signal a selected resolution depending on the situation. Also, the decoder can obtain a motion vector differential value of a current block based on the signaled resolution. Hereinafter, 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. According to an embodiment of the present invention, the resolution of a motion vector differential value of a current block may be any 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. Also, the type and number of available resolutions included in a 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, there may be a block unit in which a transform is performed. For example, the block unit in 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 in which a prediction is performed. In addition, a size of the block unit in which a transform is performed may be limited by a maximum transform size. For example, a width or height of the block unit in which a transform is performed may be limited by the maximum transform size. Specifically, the width or height of the block unit in which a transform is performed may be equal to or smaller than the maximum transform size. In addition, the maximum transform size may differ depending on a color difference component, i.e., a luma component or a chroma component, of the transform block. In this case, the block unit in which a transform is performed may be expressed 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 divided to generate a plurality of transform units. A transform unit larger than the maximum transform size among the plurality of transform units may be divided to generate a plurality of transform units. The sizes of the multiple transform units generated in this process may be equal to or smaller than the maximum transform size. In the present invention, the size of a unit (block) 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, the size of a unit (block) equal to or smaller than the maximum transform size may mean that both the width and height of the unit (block) are equal to or smaller than the maximum transform size. According to an embodiment of the present invention, the operation of dividing the transform unit based on the maximum transform size may be performed in a situation such as when intra prediction is performed or when a residual signal is processed. The operation of dividing the transform unit based on the maximum transform size may be performed recursively, and may be performed until the size of the transform unit is equal to or smaller 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 a luma component. If a transform unit must be split because the size of the transform unit 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 FIG. 10(b), since tbWidth is larger than MaxTbSizeY, the TU may be split into transform unit 1 and transform unit 2. At this time, 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. In addition, the term "unit" may refer to a concept including one or more blocks of color difference components. For example, the term "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 as 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. In this case, tbWidth and tbHeight, which are input values ​​of the transform tree syntax, may be cbWidth and cbHeight described in FIG. 10. The decoder may then check whether tbWidth is greater than a 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. If not, the transform unit syntax may be called. In this case, 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. The 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 of the process 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 pre-set order, and the pre-set order may be the order according to the syntax disclosed in FIG. 11.

[0115] Also, when the transform tree syntax of FIG. 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 16×16, the size of a chroma block according to a chroma format may be 8×8. 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 from each other. 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 from each other, and in this case, the tree type may indicate that it is a tree 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 is a diagram illustrating 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: The width of the current transformation block.

[0122] nTbH: Height of the current transformation block

[0123] Section 8.4.1 disclosed in Figure 12 illustrates a decoding process of a luma block and a decoding process of a chroma block of a coding unit. The decoding process of a chroma block may include a decoding process of a Cb block and a decoding process of a Cr block. Referring to Section 8.4.1 of Figure 12, different inputs may be used in the decoding process of a luma block and the decoding process of a chroma block, and a 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 16×16, the chroma block size may be 8×8 according to 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 FIG. 12, if the tree type is SINGLE_TREE or DUAL_TREE_LUMA, the decoder may perform a decoding process for the luma block. In this case, section 8.4.5.1 disclosed in FIG. 12 may be invoked, and 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 indicating 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 block. 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. In this case, the sample location input may be (xCb / SubWidthC, yCb / SubHeightC), and the width and height of the block may be cbWidth / SubWidthC and cbHeight / SubHeightC, respectively. In this case, 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 already set 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 in a transformed state 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 partitioning 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 the color components, and may be values ​​corresponding to the width and height, respectively. As described above, MaxTbSizeY may be the maximum transform size for the luma block. Thus, for chroma blocks (i.e., when cIdx is not 0), maxTbWidth may be MaxTbSizeY / SubWidthC, and maxTbHeight may be MaxTbSizeY / SubHeightC. For luma blocks, maxTbWidth and maxTbHeight may both be MaxTbSizeY.

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

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

[0131] In section 8.4.5.1 of FIG. 12, if nTbW is greater than maxTbWidth or nTbH is greater than maxTbHeight, steps 1 to 5 disclosed in 8.4.5.1 of FIG. 12 may be performed. Referring to step 1 of FIG. 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 Fig. 12, section 8.4.5.1 of Fig. 12 may be invoked again with the coordinates (xTb0, yTb0), newTbW, and newTbH as inputs. Referring to step 3 of Fig. 12, if nTbW is greater than maxTbWidth, section 8.4.5.1 of Fig. 12 may be invoked again with the coordinates (xTb0+newTbW, yTb0), newTbW, and newTbH as inputs. Referring to step 4 of Fig. 12, if nTbH is greater than maxTbHeight, section 8.4.5.1 of Fig. 12 may be invoked again with the coordinates (xTb0, yTb0+newTbH), newTbW, and newTbH as inputs. 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 inputs. 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 Fig. 12 may be performed. In this case, the processes other than steps 1 to 5 in Fig. 12 may be processes related to actual 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 contents described above will be omitted.

[0135] The decoding process disclosed in Fig. 13 may be performed when inter prediction, intra block copy (IBC) prediction, etc. are applied. Fig. 13 may also disclose the above-mentioned TU partitioning.

[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, as described with reference to Figure 12, the decoding process of section 8.5.8 of Figure 13 may be performed using inputs corresponding to each color component. The coordinates (xTb0, yTb0) of the sample location, the width (nTbW) of the block, and the height (nTbH) of the block, which are inputs of the decoding process of section 8.5.8 of Figure 13, may be (xCb, yCb), cbWidth, and cbHeight for the luma block, and may be (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 the cIdx value may be set to 2 if the block is a Cr component.

[0137] When the decoding process of section 8.5.8 of FIG. 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 FIG. 13, a maximum transform size may be calculated for each color component. Also, referring to 8-852 and 8-853 of FIG. 13, the block width or block height may be updated and written as newTbW or newTbH depending on whether nTbW or nTbH is larger than the maximum transform size. Steps 2 to 5 of section 8.5.8 of FIG. 13 disclose a process of re-invoking section 8.5.8, which may be the same as the content described above with reference to FIG. 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 Fig. 13 may be performed. In this case, the processes other than steps 1 to 5 in Fig. 13 may be processes related to actual residual signal decoding, transform, etc.

[0140] FIG. 14 is a diagram showing the relationship of 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, separate_colour_plane_flag, etc.

[0142] For example, when the chroma format is monochrome, there may be only one sample array, and SubWidthC and SubHeightC may both be 1. When 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. When 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. When 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] Meanwhile, when the chroma format is 4:4:4 sampling, the processes performed based on separate_colour_plane_flag may be different. When separate_colour_plane_flag is 0, the chroma array may have the same width and height as the luma array. When separate_colour_plane_flag is 1, the processes for the three color planes, i.e., luma, Cb, and Cr, may be performed separately. When separate_colour_plane_flag is 1, only one color component may exist in one slice. On the other hand, when separate_colour_plane_flag is 0, multiple color components may exist in one slice. As shown in FIG. 14, when the chroma format is 4:4:4 sampling, both SubWidthC and SubHeightC may be 1 regardless of separate_colour_plane_flag.

[0144] SubWidthC and SubHeightC may indicate what size the chroma array is relative to the luma array; if the chroma array width or height is half the luma array, then SubWidthC or SubHeightC may be 2, and if the chroma array width or height is the same size as the luma array, then SubWidthC or SubHeightC may 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 of color components according to one embodiment of the present invention.

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

[0148] 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] 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] 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 the 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 a 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 possible values ​​of the maximum transform size may be limited, for example, the maximum transform size may be limited to one of two values, where the two values ​​may be 32, 64, and the size of the luma base.

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

[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 the luma sample.

[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 is 64. If the value of MaxTbLog2SizeY is 5, shift the bits 5 digits to the left, and the value of MaxTbSizeY is 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] 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 a part of the samples of a CU or a PU. sps_sbt_max_size_64_flag may be a flag indicating the maximum size at 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 does not need to 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 less than or equal to the maximum size at 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 to the maximum size for which SBT may be used (MaxSbtSize).

[0167] The syntax structure in Fig. 17 may include sps_transform_skip_enabled_flag. The sps_transform_skip_enabled_flag may be a flag indicating whether or not a transform skip is available. In this case, the 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 divided because a CU or PU is larger than the maximum transform size, the TU may be divided into two or four. The division may be up to two in each of 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 larger than twice the maximum transform size, the TU needs to be divided into two or more parts in the horizontal and vertical directions, respectively. However, the syntax and process described in FIG. 11 to FIG. 13 have a problem in that they do not support such division.

[0172] Therefore, in order 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 larger than MaxTbSizeY or tbHeight is larger 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 according to 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, tbHeight are the width and height of the block, and MaxTbSizeY is the maximum transform size.

[0173] Referring to (3) of 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 width and height of the block, 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. That is, 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] As one embodiment of the present invention, if tbWidth is greater than or equal to MaxTbSizeY and tbWidth is greater than or equal to tbHeight, then 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 FIG. 18. In this case, the updated width and height of the block may be trafoWidth and trafoHeight. In (6) of FIG. 18, i.e., trafoWidth and trafoHeight may be used as inputs of 'transform_tree()' which is called again. In (6) of FIG. 18, 'transform_tree()' 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 width of the updated block (i.e., trafoWidth) or the height of the updated block (i.e., trafoHeight) as inputs.

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

[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. Based on chroma samples, even if the width and height of a transform block (unit) are the same, a case may occur in which tbWidth of a chroma block is larger than tbHeight. For example, when the chroma format is 4:2:2 sampling, a situation may occur in which tbWidth is larger than tbHeight and tbWidth / SubWidthC is the same as tbHeight / SubHeightC.

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

[0183] The division of TUs shown in FIG. 19 may show division according to the syntax of FIG. 18. For example, when the width (tbWidth) of a block is larger than the maximum transform size (MaxTbSizeY) and the width (tbWidth) of a block is larger than the height (tbHeight) of a block, a vertical split may be applied to divide the block into one TU on the left side and two TUs on the right side as shown in FIG. 19. As described in FIG. 18, when the value of verSplitFirst is 1, the block may be divided into two TUs, one on the left side and one on the right side, 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 larger than the maximum transform size (MaxTbSizeY). A division may be performed inside TU(1) on the left side of Fig. 19, and a division may be performed inside TU(2) on the right side of Fig. 19, but according to the syntax of Fig. 18, since 'transform_tree()' is called recursively, the operations related to the division performed in TU(1) on the left side may be parsed or performed after all the 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 embodiment described with reference to FIG. 11 to FIG. 13. For example, when the width (tbWidth) of a block is larger than the maximum transform size (MaxTbSizeY) and the height (tbHeight) of a block is larger than MaxTbSizeY, one TU may be divided into four TUs at once as shown in FIG. 20. Also, with reference to the embodiment of FIG. 11 to FIG. 13, there may be a preset order for performing a decoding process on the divided TUs. As an example of the preset 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 order of the decoding process for the divided TUs in Figure 19 and Figure 20 is different from each other. In addition, when the syntax order and the decoding process order are different, if the block order of the syntax and the block order of the decoding process are different, there is a problem that the implementation complexity increases. This is because in the decoding process of a certain block, it is necessary to apply syntax corresponding to the decoding process applied to each block.

[0187] The case where the decoding process order of blocks is changed as in the embodiments of Figures 19 and 20 may be when tbWidth is greater than MaxTbSizeY and tbWidth is greater than tbHeight. Specifically, the case may be 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 decoding process order of blocks may be changed.

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

[0189] Although the disclosure of FIG. 21 is related to intra blocks, it is not limited thereto and can also be applied to other embodiments for 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] In order to solve the above-mentioned problems in the embodiment of FIG. 20, etc., the decoding process related to TU division needs to be modified. As described above, TU division described in this specification may mean the same as 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, a 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 the embodiment of FIG. 12. Also, 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 maximum 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, when verSplitFirst is defined differently in the syntax disclosed in Figure 18, verSplitFirst in Figure 21 may be defined differently. For example, if verSplitFirst is set to 1 if tbWidth is greater than MaxTbSizeY and tbWidth is greater than or equal to tbHeight in Figure 18, and verSplitFirst is set to 0 otherwise, 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 may be set to 0 otherwise.

[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 (xTb0, yTb0), newTbH, and newTbH of the sample location 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, in process 3 or 4 of FIG. 21, section 8.4.5.1 of FIG. 21 may be invoked again. This may be for the second (right or lower) TU when a TU is split, such as the right TU(2) part of FIG. 19. When section 8.4.5.1 of FIG. 21 is invoked in process 3 of FIG. 21, the input may be coordinates (xTb0+newTbW, yTb0), newTbH, and newTbH. When section 8.4.5.1 of FIG. 21 is invoked in process 4 of FIG. 21, the input may be coordinates (xTb0, yTb0+newTbH), newTbH, and newTbH.

[0196] As described above, in FIG. 18, tbWidth and tbHeight may be values ​​based on the luma, and in FIG. 21, nTbW and nTbH 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 mismatch may occur between the syntax of FIG. 18 and the decoding process of FIG. 21. For example, the relationship between tbWdith 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 blocks to determine verSplit as disclosed in Figure 18 may differ from the result of comparing the width and height of blocks 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 causes a problem that the verSplitFirst values ​​in Figures 18 and 21 differ.

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

[0198] Although the contents disclosed in FIG. 22 relate to intra blocks, they are not limited thereto and may be applied to other embodiments for TB division, such as a residual signal decoding process, etc. Among the contents disclosed in FIG. 22, the same contents as those 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, the inputs of 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 a block, nTbH indicating the height of a block, cIdx indicating a color component, treeType indicating a tree structure, etc. In this case, 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 a current block. For example, when the chroma subsampling is 4:2:0, if the width and height of a 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 a chroma block (when cIdx is not 0).

[0201] 22, 8-41, 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 another input. For example, the process may be invoked twice. Also, a recursive invoke may occur. The decoding process disclosed in FIG. 22 may be invoked again 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] Also, the verSplitFirst value may be determined based on one or more conditions. For example, verSplitFirst may be determined based on whether the width of the block is greater than the maximum transform size. verSplitFirst may be determined based on whether the height of the block is greater than the maximum transform size. In this case, the result of whether the width and height of the block are greater than the maximum transform size may be based on the luma block or the chroma block. In other words, the result is not affected by any color component. 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] Also, 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 a value based on the luma pixel and the luma component. That is, when cIdx is 0 (when it is a luma block), nTbW and nTbH may be used as the one or more conditions for determining the verSplitFist value, and when cIdx is not 0 (when it is a chroma block), nTbW*SubWidthC and nTbH*SubHeightC may be used. Referring to FIG. 22, when cIdx is 0, it is determined whether nTbW is greater than nTbH, and when 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, and if not (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, the decoder 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] Reexplaining Equation 2, if cIdx is 0, verSplitFirst may be determined as Equation 3 below.

[0213]

number

[0214] Referring again to Equation 2, if cIdx is not 0 (eg, 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 formulas 2 to 4. In other words, it can be confirmed whether nTbW is equal to or greater than maxTbWidth, and if cIdx is 0, it can be confirmed whether nTbW is equal to or greater than nTbH, and if cIdx is not 0, it can be confirmed whether nTbW*SubWidthC is equal to or greater than nTbH*SubHeightC. In this case, an 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, when verSplitFirst is 1, newTbW may be determined as nTbW / 2 and newTbH may be determined as nTbH. When 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. This may be for the first (left or upper) TU of the division such as the left TU(1) part 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. This may be for the second (right) TU of the split, 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. This may be for the second (lower) TU of the split, such as the right-hand 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 CTU size or CtbSizeY or a syntax element indicating CtbSizeY. For example, a maximum transform size larger than the size indicated by the syntax element indicating the CTU size or CtbSizeY or CtbSizeY may be excluded from the candidates. If the size indicated by the syntax element indicating the CTU size or CtbSizeY or CtbSizeY is smaller than 64, values ​​equal to or greater than 64 may be excluded from the maximum transform size candidates. If 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 or CtbSizeY or CtbSizeY without signaling to notify 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, the 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 and a value smaller than 64. If CtbSizeY is smaller than 64, sps_max_luma_transform_size_64_flag may not be signaled and may be inferred. For example, when 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 to 0. Alternatively, the value of MaxTbLog2SizeY may be determined to be 5, or the value of MaxTbSizeY may be determined to be 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 to be 0, and thus the maximum transform size (MaxTbSizeY) value may be determined to be 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 at which a subblock transform (SBT) may be used may also be restrictive. For example, the maximum size at which an SBT may be used may be less than or equal to the maximum transform size. Thus, the syntax element indicating the maximum size at which an SBT may be used may vary. For example, a syntax element indicating the maximum size at which an SBT may be used may be signaled based on the maximum transform size or a syntax element indicating the maximum transform size.

[0228] Referring to FIG. 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 or not may be 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_tranform_size_64_flag is 1 (i.e., sps_sbt_enabled_flag && sps_max_luma_tranform_size_64_flag), sps_sbt_max_size_64_flag is signaled, otherwise 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 0. Alternatively, if sps_sbt_max_size_64_flag is not present, the value may be inferred to the value of sps_max_luma_tranform_size_64_flag. In this case, MaxSbtSize may be set to 64 if sps_sbt_max_size_64_flag is 1, and 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 condition for determining the verSplitFirst value described with reference to the syntax in FIG. 18 has been changed, and other similar descriptions will be omitted.

[0231] The TU splitting method may differ depending on the tree type. For example, when 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 FIG. 18(3), but when the tree type is DUAL_TREE_CHROMA, verSplitFirst may be determined using the condition disclosed in FIG. 25(2).

[0232] When determining the width and maximum transform size of a block, it may be based on luma or on 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, a chroma-based value may be used. 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, the TU division described in this specification may be the same as dividing the TB.

[0237] A 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 (cIdx==0||treeType==DUAL_TREE_CHROMA), nTbW may be compared to determine whether it is greater than nTbH, and verSplitFirst may be determined. 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 (cIdx!=0&&treeType!=DUAL_TREE_CHROMA), nTbW / SubWidthC may be compared to determine whether it is greater than nTbH / SubHeightC, and verSplitFirst may be determined.

[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. Thus, if the maximum transform size is variable, the manner in which the maximum transform skip size is signaled 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 or not a transform skip is used in a divided TU may be shared. In other words, when the size of a CU or PU is larger than the maximum transform size, the signaling of a syntax element indicating whether or not a transform skip is used in 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. Whether or not a transform skip is used in a divided TU may be shared, or the signaling of a related syntax element may be omitted, only when a variable maximum transform size and a variable maximum transform skip size are used, and the maximum transform size and the maximum transform skip size are the same. Furthermore, whether or not a transform skip is used in a divided TU may be shared only when a transform skip is used in a reference TU, for example, the first TU. In other words, when a transform skip is not used in a reference TU, whether or not a transform skip is used in other divided TUs may be signaled. In addition, when it is signaled whether or not transform skip is to be used for a TU that has already been split in a set order, and it is signaled that transform skip is to be used for a particular TU, thereafter, a syntax element indicating whether transform skip is to be used for the TU is not signaled, and it may be determined that transform skip is to be used.

[0241] When whether transform skip is used for a segmented 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 of 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 the prediction method and the 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 or a prediction signal or a picture sample or a reconstructed sample). For example, an encoder may signal a value based on the difference of a specific value, and a decoder may restore the specific value based on the signaling. In this case, in the reconstruction process of the decoder, the process of calculating the difference of a specific value must be reversed, and the specific value can be restored by performing an addition process based on the signaled value. BDPCM may be described as quantized residual differential pulse coded modulation (RDPCM).

[0244] There may be a syntax element indicating 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, there may be a syntax element at a higher level indicating whether BDPCM is used. For example, the syntax element at a higher level indicating 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 the syntax element at a higher level indicating whether BDPCM is used is possible, signaling of the syntax element indicating whether BDCPM is used may not be performed. Furthermore, if signaling of a syntax element at a higher level indicating whether BDCPM is used is not possible, signaling of a syntax element indicating 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). Thus, 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 the horizontal mode. Also, when BDPCM is used and in the horizontal mode, predicted samples corresponding to the same row (i.e., predicted samples having 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 upper side of the certain position in the vertical mode. Also, when BDPCM is used and the vertical mode is used, predicted samples corresponding to the same column (ie, predicted samples having 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), the prediction mode derivation of BDPCM may be based on BdpcmDir. In FIG. 27(a), when the value of BdpcmFlag is 1, it may mean that BDPCM is used. IntraPredModeY may be a value indicating a prediction mode. Specifically, IntraPredModeY may be a value indicating a prediction mode for a 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 may be a vertical mode. Also, when the value of BdpcmDir is 0, IntraPredModeY may be set to INTRA_ANGULAR18, which may be a horizontal mode. A prediction operation may be performed based on IntraPredModeY.

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

[0248] FIG. 27(b) is a diagram showing the operation of the decoder when BDPCM is used. Referring to FIG. 27(b), dz may be an array created based on values ​​signaled in a syntax element. Also, in the case of a horizontal mode, the dz[x][y] value may be set based on dz[x][y] and dz[x-1][y]. For example, in the case of a 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)). Such setting may be performed when x is greater than 0 (when not bordering the left boundary of the block), and when x is 0, dz[x][y] may remain as dz[x][y]. In the case of a vertical mode, the dz[x][y] value may be set based on dz[x][y] and dz[x][y-1]. In the 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)). Such setting may be performed when y is greater than 0 (when not bordering the top boundary of the block), and when y is 0, dz[x][y] may remain dz[x][y]. The reason that dz is calculated based on a sum (+) operation is because the signaled signal is based on a difference (-) operation. For example, the signaled signal dz[x][y] may be set to (dz[x][y]-dz[x-1][y]) in the horizontal mode, and may be set to (dz[x][y]-dz[x][y-1]) in the vertical mode. Therefore, to restore this, the decoder can perform a calculation based on a 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 a 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 become r[x][y], which is a residual sample array value. Here, tsShift may be a value determined based on the width and height of the transform block. Also, an intermediate residual sample and a 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 can be used indicates that BDPCM is enabled, 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] Also, 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. Thus, 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 the transform block may be written as tbWidth and the height of the transform block may be written as tbHeight. Since BDPCM uses transform skip, whether or not BDPCM can be used may be determined based on MaxTsSize. Also, whether or not BDPCM can be used may be signaled at the CU level. Therefore, whether or not BDPCM can be used may be determined based on the width and height (which may be written as cbWidth and cbHeight) of a 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 does not exist, its value may be inferred to 0.

[0253] According to an embodiment of the present invention, any one of a plurality of values ​​may be selected and used for MaxTsSize. For example, MaxTsSize may be a value equal to or less than 32. Or, MaxTsSize may be a value equal to or less than MaxTbSizeY. Or, MaxTsSize may be any one of 32, 16, 8, and 4. Also, a syntax element may exist for determining MaxTsSize. 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 the values ​​4, 8, 16, and 32. A syntax element for determining MaxTsSize may be signaled at a higher level, for example, at a 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, when the width (cbWidth) and height (cbHeight) of the coding block are equal to or less than MaxTsSize, BDPCM is usable. When MaxTbSizeY is greater than MaxTsSize and the width and height of the 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 the transform block. In this case, TU division does not occur. Specifically, when MaxTbSizeY is 64 and MaxTsSize is equal to or less than 32, 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, being able to use BDPCM when cbWidth and cbHeight are equal to or less than MaxTsSize may mean the same as being able to use BDPCM when tbWidth and tbHeight are equal to or less than MaxTsSize.

[0256] However, according to an 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. If 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, it is possible to perform a transform skip mode, which is a mode used in the case of BDPCM. This is because the transform skip mode is performed at the TU level. If BDPCM is available, intra_bdpcm_flag may be parsed.

[0257] Thus, BDPCM can be used even if MaxTbSizeY and MaxTsSize are the same. Alternatively, BDPCM can be used 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. Alternatively, BDPCM can be used even if MaxTbSizeY and MaxTsSize are different, but if cbWidth is less than or equal to MaxTsSize and cbHeight is less than or equal to MaxTsSize. Alternatively, BDPCM can be used 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, but 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 more. Specifically, MaxTbSizeY may have a value of 32 or 64. Also, MaxTsSize may have a value of 32 or less. Specifically, MaxTsSize may have a value of 4, 8, 16, or 32. Therefore, when MaxTbSizeY and MaxTsSize are the same, it may be the case that MaxTbSizeY is 32 and MaxTsSize is 32.

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

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

[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 of combined inter-and intra-prediction or combined inter-picture merge and intra-picture prediction. CIIP means a method of combining an intra prediction signal and an inter prediction signal when a prediction signal is generated. When CIIP is used, the intra prediction method or the inter prediction method may be limited. For example, when CIIP is used, only a planar mode (MODE_PLANAR) or only a merge mode may be used as an 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 xcbHeight). 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 is 128 or more, CIIP may not be used. If cbWidth is smaller than 128, cbHeight is smaller than 128, and cbWidth*cbHeight is 64 or more, 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 block of 64x64 size and intra prediction for a block of 64x64 size may be performed. In addition, a predicted block of 64x64 size (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 to be divided from the 64×64 size CB may be determined based on MaxTbSizeY. For example, when MaxTbSizeY is smaller than 64 (e.g., 32), the 64×64 size CB may be divided into 32×32 size TUs, and intra prediction may be performed on each of the divided TUs. Thus, four predicted blocks of 32×32 size may be generated.

[0274] At this time, 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 a block larger than 32×32, and intra prediction in the intra prediction mode may be performed on a block equal to or smaller than 32×32. Therefore, in the case of the intra prediction mode, hardware and software having the capability to process intra prediction for a block equal to or smaller than 32×32 is required, whereas in the case of the CIIP mode, hardware and software having the capability to process intra prediction for a block larger than 32×32 is required. This may be a large burden in terms of 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 a block of a small size, but may need to prepare intra prediction for a block of a size larger than 32 to use the CIIP mode.

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

[0276] According to an 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 is not group 1, group_2_flag may be signaled. Also, a decoder may determine whether a selected mode belongs to group 2 based on group_2_flag. This operation may be performed even when there are multiple groups. Also, there may be signaling indicating a mode within a group. The grouping method may reduce the signaling depth compared to the sequential signaling method. Also, 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, it is assumed that there are three groups. A particular group may include one or more modes. For example, group 1 may include one mode. Also, group 2 and group 3 may include two modes each. 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 a CIIP and a triangle merge mode. group_1_flag may be merge_subblock_flag, and group_2_flag may be regular_merge_flag. Also, ciip_flag and mmvd_merge_flag may exist as syntax elements indicating a mode in group. In one embodiment, merge_subblock_flag may be signaled, and it may be determined whether the current mode is the subblock merge mode based on merge_subblock_flag. In this case, 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 a merge mode is used may be as described above, and may be 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. The decoder may determine whether to parse merge_subblock_flag based on MaxNumSubblockMergeCand and block size. When the value of merge_subblock_flag is 1, the decoder may determine to use a subblock merge mode, and may further determine a candidate index based on merge_subblock_idx. When the value of merge_subblock_flag is 0, the decoder may parse regular_merge_flag. At this time, there may be a condition for regular_merge_flag to be parsed. 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 available. In this case, the syntax elements signaled at a higher level indicating whether a mode is available 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 a triangle mode, and may be signaled in a sequence parameter set. In addition, there may be a condition based on a 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 a skip mode is available.When the skip mode is used, the residual signal does not need to be signaled. Thus, when the skip mode is used, the decoder can reconstruct the block from the prediction signal without the residual signal (or transform coefficients).

[0280] A condition related to a block size for which CIIP may be used may be that the block width * block height is equal to or greater than 64, the block width is smaller than 128, and the block height is smaller than 128. Also, a block size condition for which triangular merge mode may be used may be that the block width * block height is equal to or greater than 64. Referring to FIG. 31, if the condition that the block width * block height is equal to or greater than 64 is not met, the decoder may not 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 may parse regular_merge_flag.

[0281] Specifically, the 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, when the above-mentioned conditions for parsing regular_merge_flag are not satisfied, that is, when i) 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, or ii) the value of sps_triangle_enabled_flag is 1, the value of 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. When 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, when the decoder decides whether to parse ciip_flag, a condition based on the block size may be used. For example, if the block width is less than 128 and the block height is less than 128, the decoder may parse ciip_flag. On the other hand, if the block width is 128 (or is 128 or more) or the block height is 128 (or is 128 or more), the decoder may not parse ciip_flag. This is because, if the block width or the block height is 128 (or is 128 or more), only one of CIIP and triangle merge mode may be used. For example, CIIP may not be used and only triangle merge mode may be used.

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

[0285] Conditions under which CIIP may be used may include when sps_ciip_enabled_flag has a value of 1 and cu_skip_flag has a value of 0. In addition, conditions related to block size under which CIIP may be used may 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 may include when the value of sps_triangle_enabled_flag is 1, the value of MaxNumTriangleMergeCand is greater than 1, and slice_type is B. Additionally, conditions related to block size under which the triangle merge mode may be used may include when 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 the triangular merge mode may be used are met, the decoder can parse regular_merge_flag, whereas if neither the conditions for which CIIP may be used nor the conditions for which the triangular merge mode may be used are met, the decoder does not have 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 above-mentioned conditions related to the block size for which CIIP may be used and the above-mentioned conditions related to the block size for which triangular merge mode may be used are not satisfied, the available 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] In addition, 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 indicating whether MMVD is enabled or not. If the value of sps_mmvd_enabled_flag is 0, 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 FIG. 31, if the value of regular_merge_flag is 0, and both the above-mentioned conditions for which CIIP may be used and the above-mentioned conditions for which the triangular merge mode may be used are met, the decoder may parse ciip_flag. In this case, if the value of ciip_flag is 1, CIIP may be used, and if the value of ciip_flag is 0, the triangular merge mode may be used. If the value of ciip_flag is 0, this may mean that CIIP is not used. On the other hand, if the above-mentioned conditions for which CIIP may be used or the above-mentioned conditions for which the triangular merge mode may be used are not met, the decoder may not 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, or 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 a 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 available.

[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 for which CIIP may be used 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] Hereinafter, a method for solving such a problem will be described 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 width of a block is equal to or less than MaxTbSizeY and the height of a block is equal to or less than MaxTbSizeY, the CIIP mode may be used. Also, if the width of a block is greater than MaxTbSizeY or the height of a block is greater than MaxTbSizeY, the CIIP may not be used. In this case, the width and height of a block may be the width and height of a coding block (unit). Since the width and height of a block 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 resources required for hardware and software. Even when MaxTbSizeY is 32, both intra prediction in CIIP mode and existing intra prediction may be performed on blocks of size 32×32 or less.

[0305] Referring to FIG. 32, conditions for using the CIIP mode may include a case where 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. Thus, if 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, the CIIP mode is not used. If the decoder meets the conditions for using the CIIP mode, it may parse ciip_flag. Also, if the decoder meets the conditions for using the CIIP mode, it may parse regular_merge_flag. Also, a decoder may take additional conditions into account when parsing ciip_flag or regular_merge_flag, and may not parse ciip_flag if CIIP mode may not be used.

[0306] Conditions for the triangle (merge) mode to be used may 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 any one of the conditions for using the CIIP mode or the conditions for using the triangular (merge) mode is not satisfied, the decoder may not parse ciip_flag. Also, if ciip_flag does not exist and the conditions for using the CIIP mode are not satisfied, the value of ciip_flag may be inferred to be 0. Also, if ciip_flag does not exist and 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 to be 1.

[0308] If any one of the conditions for using the CIIP mode and the conditions for using the triangular (merge) mode is satisfied, the decoder may parse regular_merge_flag. If both the conditions for using the CIIP mode and the conditions for using the triangular (merge) mode are not 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 may parse ciip_flag. On the other hand, if cbWidth is greater than MaxTbSizeY or cbHeight is greater than MaxTbSizeY, the decoder may not 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 may 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 in 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, or the value of ciip_flag may be inferred to be 0 if any of the following conditions are not met:

[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] A decoder can parse regular_merge_flag if the condition in Equation 6 below is satisfied.

[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 of executing the CIIP mode in 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 the CIIP mode may be performed in units of transform blocks (units). That is, when the CIIP mode is used, TU partitioning may be performed. For example, when cbWidth is larger than MaxTbSizeY or cbHeight is larger than MaxTbSizeY, the CIIP mode may be used, and in this case, TU partitioning is performed, and intra prediction may be performed in units of (MaxTbSizeY×MaxTbSizeY) blocks for a block of (tbWidth xtbHeight). This allows intra prediction in the CIIP mode to be performed using the same resources as existing intra prediction.

[0328] FIG. 33 illustrates a prediction method when the CIIP mode is used for a CU of 64×64 size 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. At this time, inter prediction may be performed on a CU of 64×64 size. Also, since a block of 64×64 size 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, a plurality of blocks of 32×32 size may be generated. Also, 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 at a position adjacent to each TU after division. Since a reference sample adjacent to a block is used, there is an advantage in terms of prediction performance and coding efficiency. For example, the reference sample may be a reconstructed sample. However, in this case, in order to perform intra prediction on a specific TU, it is necessary to wait until an adjacent TU (i.e., a TU corresponding to the position of the reference sample) is reconstructed, and an extra latency may occur. Also, the reference sample may be a predicted sample. In this case, prediction performance may be lower than when a reconstructed sample is used, but prediction for the current TU may start when prediction is completed even if the adjacent TU is not completely reconstructed. Therefore, the latency can be reduced compared to when a reconstructed sample is used as a reference sample. However, even if a predicted sample is used as a reference sample, there may be a problem regarding latency.

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

[0332] When TU division is performed when the CIIP mode is used, prediction in the CIIP mode may be performed even if the size of the CU 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 a block that is divided and made smaller after the TU division. 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 FIG. 31 and FIG. 32 may not exist. Therefore, when the condition that (cbWidth*cbHeight) is 64 or more for the block size is satisfied, 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, or cbHeight is greater than 64 (see Figure 31), or 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 does not need to 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, then 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 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 may 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 or not 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 the color components are not coded separately. If the value of separate_colour_plane_flag is 0 and is not Monochrome, ChromaArrayType may not be 0.

[0356] If the value of pred_mode_plt_flag is 1 and the tree type is DUAL_TREE_CHROMA, 'palette_coding()' may be performed. pred_mode_plt_flag is a syntax element indicating whether or not palette mode is used, and 'palette_coding()' may be a part that parses syntax elements related to the 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 following (1) in Figure 34.

[0357] Also, based on cu_act_enabled_flag, steps (1) and after in FIG. 34 may be performed. 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 in another color space, and if the value of cu_act_enabled_flag is 0, the residual signal may be coded in an original color space. The original color space may be a YUV color space or a YCbCr color space. The other color space may be a YCgCo color space or a RGB color space. Referring to FIG. 34, if the value of cu_act_enabled_flag is 0, steps (1) and after in FIG. 34 may be performed. On the other hand, if the value of cu_act_enabled_flag is 1, steps (1) and after 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 may not 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 a current chroma coding block. For example, when the value of intra_bdpcm_chroma_flag is 1, it may indicate that BDPCM is applied to a current chroma coding block, and when the value of intra_bdpcm_chroma_flag is 0, it may indicate that BDPCM is not applied to a current chroma coding block. Referring to FIG. 34, there may be a condition for parsing intra_bdpcm_chroma_flag. Or, there may be a condition for using chroma BDPCM. The condition for using chroma BDPCM may be the same as the condition for parsing intra_bdpcm_chroma_flag. The condition for parsing intra_bdpcm_chroma_flag is the same as Equation 7 described above, 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 satisfied, the decoder may not 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 may 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 indicating 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., 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 indicating 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 value of intra_bdpcm_chroma_flag is 0 as a result of parsing, the decoder does not parse syntax related to chroma intra prediction. In this case, syntax related to chroma intra prediction may be cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, etc. In this case, cclm_mode_flag may be a syntax element indicating whether or not a cross component linear model (CCLM) is used as a chroma intra prediction mode. cclm_mode_flag may be a syntax element indicating whether or not 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 or not CCLM is available. Alternatively, CclmEnabled may be a value indicating whether or not a syntax element indicating whether or not CCLM is used is parsed. CCLM is a chroma prediction method based on a luma sample. 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 may parse intra_chroma_pred_mode. In this case, intra_chroma_pred_mode may be a syntax element indicating an intra prediction mode of a chroma sample.Specifically, intra_chroma_pred_mode may be a syntax element indicating which of the following modes 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 (same mode as luma mode).

[0366] Referring to Figure 34, if the conditions for intra_bdpcm_chroma_flag to be parsed or the conditions for chroma BDPCM to be used are met, but 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 in FIG. 35 is an embodiment for solving the problem described in FIG. 34, and overlapping content will be omitted.

[0369] Referring to FIG. 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 may parse intra_bdpcm_chroma_flag. The conditions under which intra_bdpcm_chroma_flag may be parsed are the same as (1) of FIG. 35, which is as shown in the above-mentioned formula 7. 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 exist. In this case, if intra_bdpcm_chroma_flag does not exist, 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 if 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, and 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 FIG. 35, the decoder parses intra_bdpcm_chroma_flag, and if the value of intra_bdpcm_chroma_flag is 0 as a result of parsing (chroma BDPCM is not used), the decoder may perform steps (2) and after in FIG. 35. That is, the decoder may parse syntax related to other chroma intra prediction. The syntax related to other chroma intra prediction may be the same as that described in FIG. 34. The syntax related to other chroma intra prediction may be 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 FIG. 35, even if intra_bdpcm_chroma_flag satisfies the condition that it may be parsed 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 FIG. 34, so that the decoder can determine the chroma prediction mode. Specifically, when a block width and a block height are equal to or less than a maximum transform skip size and a syntax element signaled at a higher level indicating whether or not chroma BDPCM is used, the decoder can parse a syntax element indicating whether or not 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 in one embodiment of the present invention.

[0382] As described above, there may be a higher level syntax including a syntax element indicating whether BDPCM can be used. For example, the syntax elements signaled at a higher level indicating whether BDPCM can be used may be the above-mentioned sps_bdpcm_enabled_flag, sps_bdpcm_chroma_enabled_flag, etc. Specifically, sps_bdpcm_enabled_flag is a syntax element signaled at a higher level indicating whether BDPCM can be used for a luma component. Also, sps_bdpcm_chroma_enabled_flag is a syntax element signaled at a higher level indicating whether BDPCM can be used for a chroma component. In this case, the higher level at which the syntax element indicating whether BDPCM can be used may be a sequence level, a sequence parameter set level (SPS level), a slice level, a picture level, or a 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., the value is 1), a syntax element indicating whether BDPCM is used may be further 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., the value is 0), no syntax element indicating whether BDPCM is used may be further present. Also, 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 can be used 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 can be used 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 or not a transform skip is used. Referring to FIG. 36, the syntax element signaled at a higher level indicating whether or not a transform skip is used may be sps_transform_skip_enalbed_flag. In this case, the higher level at which the syntax element indicating whether or not a transform skip is used may be a sequence level, a sequence parameter set level (SPS level), a slice level, a picture level, or a picture parameter set level (PPS level). If the syntax element signaled at a higher level indicating whether or not a transform skip is used indicates that a transform skip can be used (e.g., the value is 1), there may be a syntax element indicating whether or not a transform skip is used. For example, the syntax element indicating whether or not a transform skip is used may be present at a block level or a coding unit (block) level. On the other hand, if a syntax element signaled at a higher level indicating whether or not transform skip is enabled indicates that transform skip is disabled (e.g., the value is 0), there is no further syntax element indicating whether transform skip is enabled. If there is no syntax element signaled at a higher level indicating whether or not 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 FIG. 27 and FIG. 28.

[0384] As described above, in order for BDPCM to be used, transform skip needs to be used. Referring to FIG. 36, if a syntax element signaled at a higher level indicating whether or not transform skip can be used indicates that transform skip can be used, a decoder may parse a syntax element signaled at a higher level indicating whether or not BDPCM can be used. On the other hand, if a syntax element signaled at a higher level indicating whether or not transform skip can be used indicates that transform skip cannot be used, a decoder may not need to parse a syntax element signaled at a higher level indicating whether or not BDPCM can be used. In this case, a syntax element signaled at a higher level indicating whether or not BDPCM can be used may include both information on a luma component and information on a chroma component.

[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 the 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 showing syntax elements signaled at a higher level for BDPCM in accordance with 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 or not chroma BDPCM can be used may be determined based on a chroma format. Information related to a color format may include chroma_format_idc, separate_colour_planance_flag, Chroma format, SubWidthC, SubHeightC, and the like. 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 or not 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 a syntax element (sps_bdpcm_chroma_enabled_flag) indicating whether or not chroma BDPCM can be used, and if not, the decoder may not parse a syntax element (sps_bdpcm_chroma_enabled_flag) indicating whether or not chroma BDPCM can be used. In the present invention, color format may be used synonymously with 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 a luma component and a syntax element signaled at a higher level indicating whether BDPCM can be used for a chroma component may not exist separately. That is, one 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 components may be used. In addition, in this case, an additional syntax element indicating whether BDPCM is used may exist. For example, the additional syntax element may be the above-mentioned intra_bdpcm_flag or intra_bdpcm_chroma_flag. Meanwhile, 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 element indicating whether BDPCM for the luma component is used and the syntax element indicating whether BDPCM for the chroma component 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 may parse the syntax element indicating whether BDPCM for the luma component is used, as described in Figures 28 and 29. That is, if the value of sps_bdpcm_enabled_flag is 1, the decoder may parse intra_bdpcm_flag (additional conditions may be taken into consideration at this time), and if the value of sps_bdpcm_enabled_flag is not 1, the decoder may not 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 previously set order.

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

[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 sequence 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] The syntax element may be a syntax element indicating whether BDPCM can be used and a syntax element indicating a prediction direction. For example, 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 a syntax element indicating whether MIP prediction is used, a syntax element indicating whether an MIP input vector is transposed, and a syntax element 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 shown 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 not, 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 the syntax element. 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 an intra prediction mode:

[0409] It 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, intra_luma_mpm_flag, intra_luma_not_planar_flag, intra_luma_mpm_idx, and intra_luma_mpm_remainder disclosed in FIG. 39 may correspond to this.

[0410] The syntax element group related to the chroma component may contain the following syntax elements:

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

[0412] It may be a syntax element indicating whether BDPCM is used or not, or a syntax element indicating a prediction direction, for example, intra_bdpcm_chroma_flag and intra_bdpcm_chroma_dir_flag disclosed in Fig. 39 may correspond to it.

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

[0414] It may be a syntax element indicating whether CCLM is used or not, or a syntax element indicating a CCLM mode used for prediction. For example, cclm_mode_flag and cclm_mode_idx disclosed in Fig. 39 may correspond to it. CCLM is a method of predicting based on another color component value, and specifically, it may be a method of predicting a chroma component based on a luma component value.

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

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

[0417] 39, if the tree type is SINGLE_TREE or DUAL_TREE_LUMA, the decoder may parse syntax elements related to the luma component, and if the tree type is SINGLE_TREE or DUAL_TREE_CHROMA, the decoder may parse syntax elements related to the chroma component. Thus, the decoder may parse syntax element groups related to the luma component in succession, and parse syntax element groups related to the chroma components in succession.

[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, intra_bdpcm_chroma_flag, intra_bdpcm_chroma_dir_flag, etc. located after the syntax element group related to the luma component may be parsed.

[0419] As a result, since syntax elements related to the luma component and syntax elements related to the chroma component are consecutively located (parsed), it is advantageous in terms of memory management, i.e., it may 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, a syntax element group related to a luma component and a syntax element group related to a chroma component may not be parsed in order. For example, the order of some of the syntax element groups related to the luma component and the syntax element groups related to the chroma components described with reference to FIG. 39 may be changed. Specifically, the syntax elements related to the BDPCM for the luma component and the syntax elements related to the BDPCM for the chroma components may be parsed consecutively. Also, a syntax element group of syntax elements included in the syntax element group related to the luma component, excluding the syntax elements related to the BDPCM for the luma component, and a syntax element group of syntax elements included in the syntax element group related to the chroma components, excluding the syntax elements related to the BDPCM for the chroma components, may be parsed consecutively. Also, the syntax elements related to the BDPCM 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, the syntax elements related to the BDPCM for the chroma component may precede the syntax elements related to the luma component, which has the effect of reducing the operations / calculations for determining whether to parse the syntax elements when the chroma BDPCM is used frequently.

[0427] The luma BDPCM and the chroma BDPCM may share a prediction direction. Therefore, as disclosed in FIG. 40, intra_bdpcm_luma_dir_flag and intra_bdpcm_chroma_dir_flag do not exist separately, and the prediction direction of the luma BDPCM and the prediction direction of the chroma BDPCM may be indicated by one syntax element. In this case, whether or not the luma BDPCM is used and whether or not the chroma BDPCM is used may not be independent. For example, in order for the chroma BDPCM to be used, the luma BDPCM needs to be used. Therefore, the syntax element indicating whether or not the luma BDPCM is used and the syntax element indicating whether or not the chroma BDPCM is used may be dependent. Only when the syntax element indicating whether or not the luma BDPCM is used indicates that the luma BDPCM is used, the syntax element indicating whether or not the 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 an SPS syntax applies to a CVS may be determined by a syntax element value of a picture parameter set (PPS) referenced by a syntax element of a slice header.

[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. Also, some of the syntax elements included in the SPS syntax may exist as many times as the number of subpictures. For example, 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-1). In this case, syntaxElement may be a syntax element that exists 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 mean a rectangular region composed of one or more slices in a picture. Also, a sub-picture may be decoded independently. 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. Also, 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 above-mentioned SPS syntax and the sub-picture signaling method will be described with reference to FIG.

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

[0435] pic_width_max_in_luma_samples shown in FIG. 42 is a syntax element indicating the maximum width of a picture, and the maximum width of a picture may be indicated in units of luma samples. The value of pic_width_max_in_luma_samples may not be 0, and may be an integer multiple of a previously set value. The previously set value may be the larger of 8 and a minimum coding block size. In this case, the minimum coding block size may be determined based on the luma sample and may be described as MinCbSizeY.

[0436] Also, pic_height_max_in_luma_samples is a syntax element indicating the maximum height of a picture, and in this case, the maximum height of a picture may be indicated in units of luma samples. Also, the value of pic_height_max_in_luma_samples may not be 0, and may be an integer multiple of a preset value. The preset value may be the larger of 8 and a minimum coding block size. In this case, the minimum coding block size may be determined based on the luma samples, and may be described 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 previously set value. If the size of the luma coding tree block is CtbSizeY, CtbSizeY may be (1<<(sps_log2_ctu_size_minus5+previously set value)). The previously set 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 less than or equal to 2.

[0439] The subpics_present_flag is a syntax element indicating whether or not a subpicture parameter exists. The subpics_present_flag indicates whether or not a subpicture can be used, and whether or not the number of subpictures can be signaled as a value greater than 1. In this case, the subpicture parameters may 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 value of sps_num_subpics_minus1 plus a previously set value may be the number of subpictures. In this case, the previously set value may be 1. In this case, the number of subpictures may be signaled as a value of 1 or more. Also, the previously set value may be 2. In this case, the number of subpictures may be signaled as a value of 2 or more. The sps_num_subpics_minus1 value may be 0 to 254 inclusive and may be expressed in 8-bit. Meanwhile, if the sps_num_subpics_minus1 value does not exist, the value of sps_num_subpics_minus1 may be inferred as 0.

[0441] In Fig. 42, subpic_ctu_top_left_x, subpic_ctu_top_left_y, subpic_width_minus1, and subpic_height_minus1 are syntax elements indicating 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 0 or more and the value of sps_num_subpics_minus1 or less.

[0442] subpic_ctu_top_left_x may indicate the x coordinate (horizontal position) of the position of the upper left corner of the subpicture. Specifically, subpic_ctu_top_left_x may indicate the x coordinate of the CTU of the upper 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 there is no value for subpic_ctu_top_left_x, 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 the subpicture. For example, the value of subpic_width_minus1 plus a previously set value may be the width of the subpicture. In this case, the previously set value may be 1. The width of the subpicture may be expressed in CTU units or CTB units. For example, the width of the 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 value of subpic_height_minus1 plus a previously set value may be 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 in this case, the number of bits may be Ceil(Log2(pic_height_max_in_luma_samples / CtbSizeY)). Meanwhile, 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 number calculation described above, an operation such as Ceil(Log2(x)) is performed to calculate the number of bits required to express the x value, which is an integer equal to or greater than 0, in binary notation.

[0447] In addition, by determining the position and size of the subpicture, the subpicture boundary position may be calculated, so that a position existing inside the subpicture can be determined.

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

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

[0450] " / " may represent integer division. That is, a result value of " / " may be an integer. Specifically, when a result value of the " / " operation is converted to an integer, it may be truncation toward zero. 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 operations to infer bit numbers as described in FIG. 42.

[0451] "÷" is a division operation that does not involve truncation or rounding. Therefore, the result 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 a plurality of sub-pictures. In this case, how the sub-pictures are divided or configured may be according to the signaling disclosed 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, when the picture width is not divisible by CtbSizeY or the picture height is not divisible by CtbSizeY, there may be a sub-picture structure that cannot be expressed. Specifically, when the picture width is not divisible by CtbSizeY, the pic_width_max_in_luma_samples / CtbSizeY value is truncated toward 0, so that the position of the rightmost CTB of the picture cannot be expressed. Also, when the picture height is not divisible by CtbSizeY, the pic_height_max_in_luma_samples / CtbSizeY value is truncated toward 0, so that 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, and 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 the case of Subpicture0 in FIG. 44, the width of the subpicture may be the same as the width of the picture. 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, there is a problem that subpic_width_minus1 is 3 bits and can only represent values ​​from 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 subpicture width should be inferred to the picture width as if the picture were composed of one subpicture, but 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 upper left corner of the subpicture may be the rightmost CTB. In this case, the x coordinate of the upper 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 pic_width_max_in_luma_samples / CtbSizeY value is 8, the Ceil(Log2(pic_width_max_in_luma_samples / CtbSizeY)) value is 3. Therefore, there is a problem that the value of subpic_ctu_top_left_x is 3 bits, and can only represent values ​​from 0 to 7, and cannot represent 8.

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

[0458] As described in Fig. 44, when pic_width_max_in_luma_samples is not divisible by CtbSizeY, there is a problem that pic_width_max_in_luma_samples / CtbSizeY is truncated (flooring) and the representation range is reduced. Similarly, when pic_height_max_in_luma_samples is not divisible by CtbSizeY, pic_height_max_in_luma_samples / CtbSizeY is truncated (flooring) and the representation range is reduced. 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 subpicture width, and the subpicture height are expressed in CtbSizeY units and 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 position of the upper left corner of the subpicture. Specifically, subpic_ctu_top_left_x may indicate the x coordinate of the CTU of the upper 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 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. 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 position of the upper left corner of the subpicture. Specifically, subpic_ctu_top_left_y may indicate the y coordinate of the CTU of the upper 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)). 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. 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 the subpicture. For example, a value obtained by adding a previously set value to the value of subpic_width_minus1 may indicate the width of the subpicture. In this case, the previously set value may be 1. Also, the width of the subpicture may be expressed in CTU units or CTB units. For example, the width of the 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 the subpicture. For example, a value obtained by adding a previously set value to the value of subpic_height_minus1 may indicate the height of the subpicture. In this case, the previously set value may be 1. Also, the height of the subpicture may be expressed in CTU units or CTB units. For example, the height of the 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 a subpicture can be expanded using the syntax elements disclosed in FIG. 45. As described above, when the syntax elements are not present and the values ​​of the syntax elements are inferred, the calculation of the number of bits is as follows: Ceil(Log2(Ceil(x))), which is advantageous in terms of implementing a device (decoder / encoder) that can take in Log2(y) with y as only an integer. The above values ​​of (pic_width_max_in_luma_samples÷CtbSizeY) and (pic_height_max_in_luma_samples÷CtbSizeY) indicate how many CtbSizeY units the picture width and picture height are configured in, 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 may 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] A method and device for dividing a transform block based on the embodiment described with reference to FIGS. 1 to 45 will be described below.

[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 a transform block. The processor may determine a result value indicating a division direction of a current transform block (TB) based on a pre-set 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 a color component of the current transform block.

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

[0471] In this case, the already-set condition further includes 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 may be set to 1 if the color component of the current transformation block is luma, and may be determined based on a 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 resultant 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 equal to 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 equal to the width of the transform block, and the height of each of the plurality of transform blocks may be equal to the height of the transform block divided 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 a 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 related to the current transform block is block-based delta pulse code modulation (BDPCM). If the prediction method of the coding block is not BDPCM as a result of the parsing, the processor may further parse a syntax element related to a 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 a variety of ways, for example, in hardware, firmware, software, or a combination thereof.

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

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

[0480] Some embodiments may be embodied in the form of a recording medium including computer executable instructions such as program modules executed by a computer. Computer readable media is any available medium that can be accessed by a computer, including both volatile and non-volatile media, and both separate and non-separate media. Computer readable media also includes both storage media and communication media. Computer storage media includes both volatile and non-volatile media, and both separate and non-separate 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 includes computer readable instructions, data structures, or other data in a modulated data signal such as a program module, or other transmission mechanism, and includes 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 idea 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 type may be implemented in a distributed form, and each component described as a distributed form may be implemented in a combined form.

[0482] The scope of the present invention is indicated by the claims set forth below rather than by the above detailed description, and all modifications and variations derived from the meaning and scope of the claims and their equivalent concepts should be interpreted as being included in 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 comparison between a width of the current transform block and a maximum transform block width and a comparison between a first value and a second value; 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 a chroma format associated with the current transform block. Video signal decoding device.

2. the maximum transform block width is determined based on the chroma format associated with the current transform block, the color components of the current transform block, and a maximum transform size.

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

3. 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.

3. A video signal decoding apparatus according to claim 2.

4. 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 the SubWidthC is 2 and the 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, the SubWidthC is 1 and the SubHeightC is 1; 2. A video signal decoding apparatus according to claim 1.

5. 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 is a value indicating that the division direction is the vertical direction.

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

6. If the result value is determined to be zero, a width of each of the plurality of transformation blocks is equal to 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 one, 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; 6. A video signal decoding apparatus according to claim 5.

7. 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 includes: determining a result value indicating whether a 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 comparison between a width of the current transform block and a maximum transform block width and a comparison between a first value and a second value; 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 a chroma format associated with the current transform block. Video signal encoding device.

8. the maximum transform block width is determined based on the chroma format associated with the current transform block, the color components of the current transform block, and a maximum transform size.

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

9. 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.

9. A video signal encoding device according to claim 8.

10. 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 the SubWidthC is 2 and the 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, the SubWidthC is 1 and the SubHeightC is 1; 8. A video signal encoding device according to claim 7.

11. 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 is a value indicating that the division direction is the vertical direction.

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

12. If the result value is determined to be zero, a width of each of the plurality of transformation blocks is equal to 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 one, 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; 12. A video signal encoding device according to claim 11.

13. 1. A method for obtaining a bitstream, the method comprising: determining a result value indicative of whether a division direction of a 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 transformation blocks; Including, the result value is determined based on a comparison between a width of the current transform block and a maximum transform block width and a comparison between a first value and a second value; 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 a chroma format associated with the current transform block. method.

14. the maximum transform block width is determined based on the chroma format associated with the current transform block, the color components of the current transform block, and a maximum transform size. The method of claim 13.

15. 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 14.

16. 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 the SubWidthC is 2 and the 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, the SubWidthC is 1 and the SubHeightC is 1; The method of claim 13.

17. 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 is a value indicating that the division direction is the vertical direction. The method of claim 13.

18. If the result value is determined to be zero, a width of each of the plurality of transformation blocks is equal to 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 one, 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; 20. The method of claim 17.

19. 1. A method for processing a video signal, the method comprising: determining a result value indicative of whether a division direction of a 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 comparison between a width of the current transform block and a maximum transform block width and a comparison between a first value and a second value; 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 a chroma format associated with the current transform block. method.

Citation Information

Patent Citations

  • 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