Image signal encoding / decoding method and apparatus therefor

By dividing pictures into tiles and determining slice structures, the method addresses the data volume challenge in high-quality video services, improving encoding/decoding efficiency and video compression.

JP2025116269AInactive Publication Date: 2025-08-07KONINKLIJKE PHILIPS NV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2025094562
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-12-31
Filing Date
2025-06-06
Publication Date
2025-08-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The increasing demand for high-quality video services has led to a significant increase in data volume, and existing video compression standards like HEVC are reaching their performance limits, necessitating improved methods for dividing and encoding/decoding video signals.

Method used

A method for dividing a picture into tiles and determining a slice division structure during encoding/decoding, involving parsing tile column and row number information, and optionally signaling slice count information to enhance encoding/decoding efficiency.

Benefits of technology

This approach improves encoding/decoding efficiency by allowing pictures to be divided into multiple tiles and sub-pictures, enhancing the overall video compression process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025116269000001_ABST
    Figure 2025116269000001_ABST
Patent Text Reader

Abstract

To solve the problem that the performance of high efficiency video coding (HEVC) gradually shows its limitation caused by the rapid evolution of a high-image-quality video service.SOLUTION: A video decoding method according to the present disclosure includes the steps of: parsing tile column number information indicating a value obtained by subtracting 1 from the number of tile columns included in an i-th slice; parsing tile row number information indicating a value obtained by subtracting 1 from the number of tile rows included in the i-th slice; and when both the tile column number information and the tile row number information are 0, further parsing number information on the number of slices in which height information in a tile including the i-th slice is explicitly signaled.SELECTED DRAWING: Figure 40
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to a video signal encoding / decoding method and an apparatus therefor. [Background technology]

[0002] As display panels continue to grow larger, higher-quality video services are becoming increasingly popular. The biggest problem with high-quality video services is the large increase in data volume. To address this issue, active research is underway to improve video compression rates. A key example is the formation of the Joint Collaborative Team on Video Coding (JCT-VC) in 2009, jointly with the Motion Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) of the International Telecommunication Union-Telecommunication (ITU-T). JCT-VC proposed High Efficiency Video Coding (HEVC), a video compression standard with approximately twice the compression performance of H.264 / AVC, and it was approved as a standard on January 25, 2013. With the rapid growth of high-quality video services, HEVC's performance is gradually reaching its limits. Summary of the Invention [Problem to be solved by the invention]

[0003] The present disclosure aims to provide a method for dividing a picture into tiles when encoding / decoding a video signal, and an apparatus for performing the method.

[0004] The present disclosure aims to provide a method for determining a slice division structure based on a tile division structure when encoding / decoding a video signal, and an apparatus for performing the method.

[0005] The present disclosure aims to provide a method for dividing a picture into multiple sub-pictures when encoding / decoding a video signal, and an apparatus for performing the method.

[0006] The technical problems to be achieved by the present disclosure are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by a person having ordinary skill in the art to which the present disclosure pertains from the following description. [Means for solving the problem]

[0007] The video signal decoding method according to the present disclosure includes a step of parsing tile column number information indicating a value obtained by subtracting 1 from the number of tile columns included in the i-th slice, a step of parsing tile row number information indicating a value obtained by subtracting 1 from the number of tile rows included in the i-th slice, and, if the tile column number information and the tile row number information are both 0, a step of further parsing count information regarding the number of slices for which height information within a tile including the i-th slice is explicitly signaled.

[0008] In the video signal decoding method according to the present disclosure, if the order of the first slice within the tile is smaller than the number of slices, first height information about the height of the first slice can be further parsed.

[0009] In the video signal decoding method according to the present disclosure, if the order of the second slice within the tile is equal to or greater than the number of the slices, the height information for the second slice may not be parsed.

[0010] In the video signal decoding method according to the present disclosure, the height of the second slice can be set to the minimum value among the first height value derived based on the last signaled height information and the second height value excluding the area occupied by the previous slice within the tile.

[0011] In the video signal decoding method according to the present disclosure, the variable i can be updated to a value obtained by adding a value obtained by subtracting 1 from the number of slices.

[0012] The above briefly summarized features of the present disclosure are merely exemplary aspects of the detailed description of the present disclosure that follows and are not intended to limit the scope of the present disclosure. [Effects of the Invention]

[0013] According to the present disclosure, a picture can be divided into multiple tiles to improve encoding / decoding efficiency.

[0014] According to the present disclosure, it is possible to improve encoding / decoding efficiency by determining a slice division structure based on a tile division structure.

[0015] According to the present disclosure, a picture can be divided into multiple sub-pictures to improve encoding / decoding efficiency.

[0016] The effects obtained by the present disclosure are not limited to those mentioned above, and other effects not mentioned will be clearly understood by those having ordinary skill in the art to which the present disclosure pertains from the following description. [Brief explanation of the drawings]

[0017] [Figure 1] FIG. 1 is a block diagram of a video encoder according to an embodiment of the present disclosure.

[0018] [Figure 2] FIG. 1 is a block diagram of a video decoder according to one embodiment of the present disclosure.

[0019] [Figure 3] FIG. 2 illustrates a basic coding tree unit according to one embodiment of the present disclosure.

[0020] [Figure 4] 1A and 1B are diagrams illustrating various division forms of a coding block.

[0021] [Figure 5] FIG. 10 is a diagram illustrating an example of division of a coding tree unit.

[0022] [Figure 6] 1 is a flowchart of an inter prediction method according to one embodiment of the present disclosure.

[0023] [Figure 7] 10 is a flowchart of a process of deriving motion information of a current block under a merge mode.

[0024] [Figure 8] FIG. 10 illustrates example candidate blocks used to derive merge candidates.

[0025] [Figure 9] FIG. 10 illustrates example candidate blocks used to derive merge candidates.

[0026] [Figure 10] FIG. 10 is a diagram illustrating an update aspect of the motion information table.

[0027] [Figure 11] FIG. 10 is a diagram showing an update state of the motion information table.

[0028] [Figure 12] FIG. 10 is a diagram illustrating an example of updating indexes of already-saved motion information candidates.

[0029] [Figure 13] FIG. 10 is a diagram showing the position of a representative sub-block.

[0030] [Figure 14] FIG. 10 illustrates an example of performing overlap checking on only a portion of merge candidates.

[0031] [Figure 15] FIG. 10 is a diagram illustrating an example in which overlap checks with specific merge candidates are omitted.

[0032] [Figure 16] FIG. 10 is a diagram illustrating an example in which a candidate block included in the same merge processing area as the current block is set as an unusable merge candidate.

[0033] [Figure 17] 10A and 10B are diagrams illustrating an example of deriving merge candidates for a current block when the current block is included in a merge processing area;

[0034] [Figure 18] FIG. 10 is a diagram showing a temporary motion information table.

[0035] [Figure 19] FIG. 10 is a diagram illustrating an example of merging a motion information table and a temporary motion information table.

[0036] [Figure 20] 1 is a flowchart of an intra prediction method according to one embodiment of the present disclosure.

[0037] [Figure 21] FIG. 10 is a diagram illustrating intra-prediction modes.

[0038] [Figure 22-23] FIG. 10 is a diagram illustrating an example of a one-dimensional array in which reference samples are arranged in a row.

[0039] [Figure 24] FIG. 10 is a diagram illustrating angles formed by directional intra prediction modes with respect to a line parallel to the x-axis.

[0040] [Figure 25] 10 illustrates how predicted samples are obtained when the current block is non-square.

[0041] [Figure 26] FIG. 10 is a diagram illustrating a wide-angle intra prediction mode.

[0042] [Figure 27] FIG. 10 is a diagram illustrating an example of vertical partitioning and horizontal partitioning.

[0043] [Figure 28] FIG. 10 is a diagram illustrating an example of determining a division form of a coding block.

[0044] [Figure 29] FIG. 10 is a diagram illustrating an example of determining a division form of a coding block.

[0045] [Figure 30] FIG. 10 is a diagram illustrating an example of determining whether or not to perform a transform skip for each sub-block.

[0046] [Figure 31] FIG. 10 is a diagram illustrating an example in which sub-blocks use the same transform type.

[0047] [Figure 32-33] FIG. 1 illustrates an application aspect of the sub-transform block coding method.

[0048] [Figure 34-35] FIG. 10 is a diagram showing horizontal transformation types and vertical transformation types according to the position of the sub-block to be transformed.

[0049] [Figure 36] FIG. 1 illustrates how transform coefficients are coded when the reduction factor is 16.

[0050] [Figure 37-38] FIG. 10 is a diagram illustrating an example of an application area of a second transformation.

[0051] [Figure 39]10A and 10B are diagrams illustrating examples of various non-separable transformation matrix candidates.

[0052] [Figure 40] FIG. 2 illustrates a picture division method according to an embodiment of the present disclosure.

[0053] [Figure 41] FIG. 1 is a diagram showing an example in which a picture is divided into multiple tiles.

[0054] [Figure 42] FIG. 10 is a diagram illustrating how slice size information is signaled.

[0055] [Figure 43-44] FIG. 10 is a diagram for explaining the coding aspect of slice height information.

[0056] [Figure 45] FIG. 10 is a diagram illustrating a division form that can be applied to a picture.

[0057] [Figure 46] 1 is a flowchart of a method for dividing a picture into at least one sub-picture according to one embodiment of the present disclosure. DETAILED DESCRIPTION OF THE INVENTION

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

[0059] Image encoding and decoding is performed on a block basis. For example, encoding / decoding processes such as transform, quantization, prediction, in-loop filtering, and restoration may be performed on a coding block, a transform block, or a prediction block.

[0060] Hereinafter, a block to be encoded / decoded is referred to as a 'current block.' For example, the current block may indicate a coding block, a transform block, or a prediction block depending on the current encoding / decoding process step.

[0061] Additionally, the term "unit" as used herein refers to a basic unit for performing a specific encoding / decoding process, and "block" refers to a sample array of a predetermined size. Unless otherwise specified, "block" and "unit" may be used interchangeably. For example, in the following embodiments, a coding block and a coding unit may be used interchangeably.

[0062] FIG. 1 is a block diagram of a video encoder according to one embodiment of the present disclosure.

[0063] Referring to FIG. 1, the video encoding device 100 may include a picture division unit 110, a prediction unit 120, 125, a transform unit 130, a quantization unit 135, a realignment unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse transform unit 145, a filter unit 150, and a memory 155.

[0064] 1 are shown independently to illustrate different characteristic functions of the video encoding device, and do not mean that each component is composed of separate hardware or a single software component. That is, each component is included as a separate component for the sake of convenience of explanation, and at least two components among each component may be combined into a single component, or one component may be divided into multiple components to perform its function. Such integrated and separated embodiments of each component are also within the scope of the present disclosure as long as they do not deviate from the essence of the present disclosure.

[0065] Furthermore, some components may not be essential components that perform essential functions in the present disclosure, but may be optional components that are only used to improve performance. The present disclosure may be embodied by including only components that are essential for embodying the essence of the present disclosure, excluding components used to improve performance, and a structure that includes only essential components, excluding optional components used to improve performance, is also included in the scope of the present disclosure.

[0066] The picture division unit 110 can divide an input picture into at least one processing unit. Here, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture division unit 110 can divide one picture into a plurality of combinations of coding units, prediction units, and transform units, and select one combination of coding units, prediction units, and transform units based on a predetermined criterion (e.g., a cost function) to encode the picture.

[0067] For example, a picture can be divided into multiple coding units. A recursive tree structure such as a quad tree structure can be used to divide a picture into coding units. A coding unit that is divided into other coding units with one image or largest coding unit as the root can be divided into child nodes equal to the number of divided coding units. A coding unit that cannot be divided further due to a certain restriction becomes a leaf node. In other words, assuming that only square division is possible for a coding unit, one coding unit can be divided into a maximum of four other coding units.

[0068] Hereinafter, in the embodiments of the present disclosure, a coding unit may refer to a unit for performing encoding or a unit for performing decoding.

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

[0070] When generating a prediction unit for performing intra prediction based on a coding unit, if the coding unit is not the minimum coding unit, intra prediction can be performed without dividing the coding unit into a plurality of NxN prediction units.

[0071] The prediction units 120 and 125 may include an inter prediction unit 120 that performs inter prediction and an intra prediction unit 125 that performs intra prediction. The prediction units 120 and 125 may determine whether to perform inter prediction or intra prediction for a prediction unit, and may determine specific information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method. Here, the processing unit in which prediction is performed may differ from the processing unit in which the prediction method and specific content are determined. For example, the prediction method and prediction mode may be determined for each prediction unit, and prediction may be performed for each transform unit. Residual values (residual blocks) between the generated prediction block and the original block may be input to the transform unit 130. In addition, prediction mode information, motion vector information, etc. used for prediction may be coded by the entropy coding unit 165 along with the residual values and transmitted to the decoder. When a specific coding mode is used, the prediction units 120 and 125 may not generate a prediction block, but may instead code the original block as is and transmit it to the decoder.

[0072] The inter prediction unit 120 may predict a prediction unit based on information of at least one picture preceding or following the current picture, and in some cases, may predict a prediction unit based on information of a partial region in the current picture for which encoding has been completed. The inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0073] The reference picture interpolator receives reference picture information from memory 155 and generates sub-integer pixel information from the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter with different filter coefficients can be used to generate sub-integer pixel information in 1 / 4 pixel units. In the case of color difference signals, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate sub-integer pixel information in 1 / 8 pixel units.

[0074] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolator. A variety of methods, such as a full search-based block matching algorithm (FBMA), a three-step search algorithm (TSS), or a new three-step search algorithm (NTS), may be used to calculate a motion vector. The motion vector may have a motion vector value in half or quarter pixel units based on the interpolated pixel. The motion prediction unit may predict the current prediction unit using different motion prediction methods. A variety of motion prediction methods, such as a skip method, a merge method, an advanced motion vector prediction method (AMVP), or an intra block copy method, may be used.

[0075] The intra prediction unit 125 may generate a prediction unit based on reference pixel information surrounding a current block, which is pixel information within a current picture. Since neighboring blocks of the current prediction unit are blocks on which inter prediction has been performed, if the reference pixels are pixels on which inter prediction has been performed, the reference pixels included in the blocks on which inter prediction has been performed may be used instead of reference pixel information of neighboring blocks on which intra prediction has been performed. That is, if the reference pixels are unavailable, the unavailable reference pixel information may be used instead of at least one reference pixel of the available reference pixels.

[0076] In intra prediction, prediction modes may include a directional prediction mode that uses reference pixel information according to a prediction direction, and a non-directional mode that does not use directional information when performing prediction. A mode for predicting luma information and a mode for predicting chroma information may be different from each other, and intra prediction mode information used to predict luma information or predicted luma signal information may be used to predict chroma information.

[0077] When performing intra prediction, if the size of the prediction unit is the same as the size of the transform unit, intra prediction for the prediction unit can be performed based on the pixel located on the left side, the pixel located on the top left corner, and the pixel located on the top corner of the prediction unit. However, when performing intra prediction, if the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed using reference pixels based on the transform unit. Also, intra prediction using NxN division can be used only for the minimum coding unit.

[0078] The intra prediction method may generate a predicted block after applying an adaptive intra smoothing (AIS) filter to reference pixels according to a prediction mode. The types of AIS filters applied to the reference pixels may differ. To perform the intra prediction method, the intra prediction mode of a current prediction unit may be predicted from the intra prediction mode of prediction units surrounding the current prediction unit. When predicting the prediction mode of the current prediction unit using mode information predicted from surrounding prediction units, if the intra prediction modes of the current prediction unit and the surrounding prediction units are the same, information indicating that the prediction modes of the current prediction unit and the surrounding prediction units are the same may be transmitted using predetermined flag information. If the prediction modes of the current prediction unit and the surrounding prediction units are different, entropy coding may be performed to encode the prediction mode information of the current block.

[0079] In addition, a residual block including residual information, which is a difference between a prediction unit predicted based on the prediction unit generated by the prediction units 120 and 125 and an original block of the prediction unit, may be generated. The generated residual block may be input to the conversion unit 130.

[0080] The transform unit 130 may transform the original block and the residual block containing residual value information of the prediction unit generated by the prediction units 120 and 125 using a transform method such as a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST). Here, the DCT transform core includes at least one of DCT2 or DCT8, and the DST transform core includes DST7. Whether to apply DCT or DST to transform the residual block may be determined based on intra-prediction mode information of the prediction unit used to generate the residual block. Transform skipping for the residual block may also be performed. A flag indicating whether to skip transform for the residual block may be coded. Transform skipping may be permitted for residual blocks whose size is equal to or smaller than a threshold, luma components, or chroma components under the 4:4:4 format.

[0081] The quantization unit 135 quantizes the values transformed into the frequency domain by the transform unit 130. The quantization coefficients may vary depending on the block or the importance of the image. The values calculated by the quantization unit 135 may be provided to the inverse quantization unit 140 and the reordering unit 160.

[0082] The reordering unit 160 may perform reordering of coefficient values for the quantized residual values.

[0083] The reordering unit 160 may convert two-dimensional block configuration coefficients into one-dimensional vector forms using a coefficient scanning method. For example, the reordering unit 160 may convert two-dimensional block configuration coefficients into one-dimensional vector forms by scanning from DC coefficients to high-frequency coefficients using a zigzag scan method. Instead of zigzag scan, vertical scan, in which two-dimensional block configuration coefficients are scanned in the column direction, or horizontal scan, in which two-dimensional block configuration coefficients are scanned in the row direction, may be used depending on the size of the transform unit and the intra prediction mode. That is, the scan method to be used may be determined from zigzag scan, vertical scan, or horizontal scan depending on the size of the transform unit and the intra prediction mode.

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

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

[0086] The entropy coding unit 165 can entropy code the coefficient values of the coding unit input from the reordering unit 160 .

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

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

[0089] A deblocking filter can remove block artifacts caused by boundaries between blocks in a reconstructed picture. To determine whether to perform deblocking, it can determine whether to apply a deblocking filter to a current block based on pixels included in several columns or rows included in the block. When applying a deblocking filter to a block, a strong filter or a weak filter can be applied depending on the required deblocking filtering strength. In addition, when performing vertical filtering and horizontal filtering in applying a deblocking filter, horizontal filtering and vertical filtering can be processed in parallel.

[0090] The offset correction unit may correct an offset between the deblocked image and the original image on a pixel-by-pixel basis. To perform offset correction for a specific picture, pixels included in the image may be divided into a certain number of regions, and then regions to which offset should be performed may be determined and an offset may be applied to the determined regions. Alternatively, an offset may be applied taking into account edge information of each pixel.

[0091] Adaptive Loop Filtering (ALF) can be performed based on the value obtained by comparing the filtered restored image with the original image. After dividing the pixels contained in the image into predetermined groups, a filter to be applied to each group is determined, and differential filtering can be performed for each group. Information on whether to apply ALF can be transmitted for each coding unit (CU) of the luminance signal, and the shape and filter coefficients of the ALF filter applied to each block can vary. It is also possible to apply the same type (fixed type) of ALF filter regardless of the characteristics of the target block.

[0092] The memory 155 can store the reconstructed block or picture calculated through the filter unit 150, and the stored reconstructed block or picture can be provided to the prediction units 120 and 125 during inter prediction.

[0093] FIG. 2 is a block diagram of a video decoder according to one embodiment of the present disclosure.

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

[0095] When a video bitstream is input from a video encoder, the input bitstream can be decoded in the reverse order of the video encoder.

[0096] The entropy decoding unit 210 may perform entropy decoding in a procedure opposite to that performed by the entropy encoding unit of the video encoder. For example, various methods such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) may be applied in correspondence with the methods performed by the video encoder.

[0097] The entropy decoding unit 210 can decode information about intra-prediction and inter-prediction performed in the encoder.

[0098] The rearrangement unit 215 may perform rearrangement on the bitstream entropy decoded by the entropy decoding unit 210 based on the method used by the encoder. Coefficients expressed in a one-dimensional vector format may be restored to coefficients in a two-dimensional block format and rearranged. The rearrangement unit 215 may receive information about coefficient scanning performed by the encoder and perform rearrangement by scanning in reverse based on the scanning order performed by the encoder.

[0099] The inverse quantization unit 220 may perform inverse quantization based on the quantization parameters provided by the encoder and the coefficient values of the reordered blocks.

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

[0101] The prediction units 230 and 235 can generate a prediction block based on information related to prediction block generation provided from the entropy decoding unit 210 and previously decoded block or picture information provided from the memory 245.

[0102] As described above, when performing intra prediction, similar to the operation in a video encoder, if the size of the prediction unit and the size of the transform unit are the same, intra prediction for the prediction unit is performed based on the pixel located to the left, the pixel located at the top left, and the pixel located at the top. However, when performing intra prediction, if the size of the prediction unit and the size of the transform unit are different, intra prediction can be performed using reference pixels based on the transform unit. Also, intra prediction using NxN division can be used only for the minimum coding unit.

[0103] The prediction units 230 and 235 may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit receives various information, such as prediction unit information input from the entropy decoding unit 210, prediction mode information of the intra prediction method, and motion prediction-related information of the inter prediction method, to classify prediction units by the current coding unit and determine whether inter prediction or intra prediction is performed for the prediction unit. The inter prediction unit 230 may perform inter prediction on the current prediction unit based on information included in at least one picture that is a previous picture or a subsequent picture of the current picture including the current prediction unit, using information necessary for inter prediction of the current prediction unit provided from the video encoder. Alternatively, the inter prediction may be performed based on information of a partial region that has already been restored within the current picture including the current prediction unit.

[0104] To perform inter prediction, it is possible to determine, based on a coding unit, which of the motion prediction methods of the prediction units included in the coding unit is skip mode, merge mode, motion vector prediction mode (AMVP mode), or intra block copy mode.

[0105] The intra prediction unit 235 may generate a prediction block based on pixel information within the current picture. If the prediction unit is a prediction unit for which intra prediction has been performed, the intra prediction may be performed based on intra prediction mode information of the prediction unit provided from the video encoder. The intra prediction unit 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolator, and a DC filter. The AIS filter performs filtering on reference pixels of the current block and may determine whether to apply a filter depending on the prediction mode of the current prediction unit and apply the filter. The AIS filtering may be performed on reference pixels of the current block using the prediction mode of the prediction unit and AIS filter information provided from the video encoder. If the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.

[0106] The reference pixel interpolator may generate reference pixels in units of pixels smaller than an integer value by interpolating reference pixels when the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on pixel values obtained by interpolating reference pixels. When the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.

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

[0108] The video decoder may receive information on whether a deblocking filter has been applied to a corresponding block or picture from the video encoder, and information on whether a strong filter or a weak filter has been applied if a deblocking filter has been applied. The deblocking filter of the video decoder may receive deblocking filter-related information provided from the video encoder and perform deblocking filtering on the corresponding block in the video decoder.

[0109] The offset correction unit may perform offset correction on the restored image based on the type of offset correction applied to the image during encoding and offset value information.

[0110] The ALF can be applied to a coding unit based on ALF applicability information, ALF coefficient information, etc. provided from the encoder. Such ALF information can be provided by being included in a specific parameter set.

[0111] The memory 245 can store the reconstructed pictures or blocks to be used as reference pictures or blocks, and can provide the reconstructed pictures to an output.

[0112]

[0113] FIG. 3 is a diagram illustrating a basic coding tree unit according to one embodiment of the present disclosure.

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

[0115] The size of the coding tree unit can be defined at the picture level or the sequence level, and for this purpose, information indicating the size of the coding tree unit can be signaled via a picture parameter set or a sequence parameter set.

[0116] For example, the coding tree unit size for all pictures in a sequence can be set to 128x128. Alternatively, the coding tree unit size can be determined at the picture level as either 128x128 or 256x256. For example, the coding tree unit size for the first picture can be set to 128x128, and the coding tree unit size for the second picture can be set to 256x256.

[0117] Coding blocks may be generated by dividing a coding tree unit. A coding block represents a basic unit for encoding / decoding processing. For example, prediction or transformation may be performed for each coding block, or a predictive coding mode may be determined for each coding block. Here, the predictive coding mode represents a method for generating a predicted image. For example, the predictive coding mode may include intra prediction (intra prediction), inter prediction (inter prediction), current picture referencing (CPR or intra block copy (IBC)), or combined prediction. A predictive block for a coding block may be generated using at least one predictive coding mode of intra prediction, inter prediction, current picture referencing, or combined prediction for the coding block.

[0118] Information indicating the predictive coding mode of the current block may be signaled by a bitstream. For example, the information may be a 1-bit flag indicating whether the predictive coding mode is intra-mode or inter-mode. Only when the predictive coding mode of the current block is determined to be inter-mode, can current picture reference or hybrid prediction be used.

[0119] Current picture reference is used to set the current picture as a reference picture and obtain a prediction block for the current block from an area in the current picture that has already been coded / decoded. Here, the current picture refers to a picture including the current block. Information indicating whether current picture reference is applied to the current block can be signaled by a bitstream. For example, the information can be a 1-bit flag. If the flag is true, the predictive coding mode of the current block can be determined to be current picture reference, and if the flag is false, the prediction mode of the current block can be determined to be inter prediction.

[0120] Alternatively, the predictive coding mode of the current block may be determined based on the reference picture index. For example, if the reference picture index indicates the current picture, the predictive coding mode of the current block may be determined to be current picture reference. If the reference picture index indicates a picture other than the current picture, the predictive coding mode of the current block may be determined to be inter prediction. That is, the current picture reference is a prediction method that uses information on an area in the current picture that has been completely coded / decoded, and the inter prediction is a prediction method that uses information on another picture that has been completely coded / decoded.

[0121] Hybrid prediction refers to a coding mode that combines two or more of intra prediction, inter prediction, and current picture reference. For example, when hybrid prediction is applied, a first predicted block may be generated based on one of intra prediction, inter prediction, or current picture reference, and a second predicted block may be generated based on the other. Once the first predicted block and the second predicted block are generated, a final predicted block may be generated by performing an average or weighted sum operation on the first predicted block and the second predicted block. Information indicating whether hybrid prediction is applied may be signaled by a bitstream. The information may be a 1-bit flag.

[0122] FIG. 4 illustrates various division patterns of coding blocks.

[0123] A coding block may be divided into multiple coding blocks based on quad-tree, binary-tree, or triple-tree partitioning, and the divided coding block may be further divided into multiple coding blocks by quad-tree, binary-tree, or triple-tree partitioning.

[0124] Quadtree partitioning refers to a partitioning technique that divides the current block into four blocks. As a result of quadtree partitioning, the current block can be divided into four square partitions (see 'SPLIT_QT' in Figure 4(a)).

[0125] Binary tree splitting refers to a splitting technique that splits the current block into two blocks. Splitting the current block into two blocks along the vertical direction (i.e., using a vertical line crossing the current block) can be called vertical binary tree splitting, and splitting the current block into two blocks along the horizontal direction (i.e., using a horizontal line crossing the current block) can be called horizontal binary tree splitting. As a result of binary tree splitting, the current block can be split into two non-square partitions. 'SPLIT_BT_VER' in Figure 4(b) indicates the result of vertical binary tree splitting, and 'SPLIT_BT_HOR' in Figure 4(c) indicates the result of horizontal binary tree splitting.

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

[0127] The number of times a coding tree unit is divided can be defined as a partitioning depth. The maximum partitioning depth of a coding tree unit can be determined at the sequence or picture level. This allows the maximum partitioning depth of a coding tree unit to differ for each sequence or picture.

[0128] Alternatively, the maximum partitioning depth for each partitioning technique can be determined individually. As an example, the maximum partitioning depth allowed for quad-tree partitioning can be different from the maximum partitioning depth allowed for binary-tree and / or triple-tree partitioning.

[0129] The encoder may signal information indicating at least one of the partitioning type and the partitioning depth of the current block through a bitstream, and the decoder may determine the partitioning type and the partitioning depth of the coding tree unit based on the information parsed from the bitstream.

[0130] FIG. 5 is a diagram illustrating an example of division of a coding tree unit.

[0131] Partitioning a coding block using a partitioning technique such as quad tree partitioning, binary tree partitioning, and / or triple tree partitioning is called multi-tree partitioning.

[0132] A coding block generated by applying multi-tree partitioning to a coding block is called a sub-coding block. If the partitioning depth of a coding block is k, the partitioning depth of the sub-coding block is set to k+1.

[0133] Conversely, a coding block with a division depth of k can be called a higher coding block than a coding block with a division depth of k+1.

[0134] The partition type of the current coding block may be determined based on at least one of the partition form of an upper coding block or the partition type of a neighboring coding block. Here, the neighboring coding block is a block adjacent to the current coding block and may include at least one of the top neighboring block, the left neighboring block, or the neighboring block adjacent to the upper left corner of the current coding block. Here, the partition type may include at least one of whether quad tree partitioning is possible, whether binary tree partitioning is possible, the binary tree partitioning direction, whether triple tree partitioning is possible, or the triple tree partitioning direction.

[0135] To determine the division form of a coding block, information indicating whether the coding block is to be split can be signaled by the bitstream. The information is a 1-bit flag 'split_cu_flag', and if the flag is true, it indicates that the coding block is to be split using the head tree splitting technique.

[0136] If split_cu_flag is true, information indicating whether a coding block is quadtree split can be signaled by the bitstream. The information is a 1-bit flag split_qt_flag, and if the flag is true, the coding block can be split into four blocks.

[0137] 5 shows an example in which a coding tree unit is quadtree-divided to generate four coding blocks with a division depth of 1. Also, among the four coding blocks generated as a result of the quadtree division, further quadtree division is applied to the first and fourth coding blocks. As a result, four coding blocks with a division depth of 2 can be generated.

[0138] Furthermore, by further applying quadtree division to a coding block with a division depth of 2, a coding block with a division depth of 3 can be generated.

[0139] If quad-tree partitioning is not applied to a coding block, it may be determined whether to perform binary tree partitioning or triple tree partitioning on the coding block, taking into account at least one of the size of the coding block, whether the coding block is located on a picture boundary, the maximum partition depth, or the partition type of neighboring blocks. If it is determined to perform binary tree partitioning or triple tree partitioning on the coding block, information indicating the partitioning direction may be signaled by the bitstream. The information may be a 1-bit flag mtt_split_cu_vertical_flag. Based on the flag, it may be determined whether the partitioning direction is vertical or horizontal. Additionally, information indicating whether binary tree partitioning or triple tree partitioning is applied to the coding block may be signaled by the bitstream. The information may be a 1-bit flag mtt_split_cu_binary_flag. Based on the flag, it may be determined whether binary tree partitioning or triple tree partitioning is applied to the coding block.

[0140] As an example, in the example shown in Figure 5, vertical binary tree partitioning is applied to a coding block with a partitioning depth of 1, and among the coding blocks generated as a result of the partitioning, vertical triple tree partitioning is applied to the left coding block and vertical binary tree partitioning is applied to the right coding block.

[0141]

[0142] Inter-prediction is a predictive coding mode that predicts a current block using information from a previous picture. For example, a block at the same position as the current block in the previous picture (hereinafter referred to as a collocated block) can be set as a prediction block for the current block. Hereinafter, a prediction block generated based on a block at the same position as the current block is referred to as a collocated prediction block.

[0143] On the other hand, if an object that existed in a previous picture has moved to a different position in the current picture, the current block can be effectively predicted using the object's motion. For example, if the direction and size of the object's movement are determined by comparing the previous picture with the current picture, a predicted block (or predicted image) of the current block can be generated taking into account the object's motion information. Hereinafter, a predicted block generated using motion information will be referred to as a motion predicted block.

[0144] A residual block can be generated by subtracting a predicted block from a current block. Here, if there is object motion, the energy of the residual block can be reduced by using a motion prediction block instead of a co-located prediction block, thereby improving the compression performance of the residual block.

[0145] In this way, generating a prediction block using motion information is called motion compensated prediction. In most inter predictions, a prediction block can be generated based on motion compensated prediction.

[0146] The motion information may include at least one of a motion vector, a reference picture index, a prediction direction, or a bidirectional weight index. The motion vector indicates the direction and size of an object's movement. The reference picture index identifies the reference picture of the current block among the reference pictures included in the reference picture list. The prediction direction indicates one of unidirectional L0 prediction, unidirectional L1 prediction, or bidirectional prediction (L0 prediction and L1 prediction). Depending on the prediction direction of the current block, at least one of L0 motion information or L1 motion information can be used. The bidirectional weight index identifies the weight applied to the L0 prediction block and the weight applied to the L1 prediction block.

[0147] FIG. 6 is a flowchart of an inter prediction method according to one embodiment of the present disclosure.

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

[0149] Here, the inter prediction mode indicates various techniques for determining motion information of the current block, and may include an inter prediction mode using translation motion information and an inter prediction mode using affine motion information. For example, the inter prediction mode using translation motion information may include a merge mode and a motion vector prediction mode, and the inter prediction mode using affine motion information may include an affine merge mode and an affine motion vector prediction mode. The motion information of the current block may be determined based on information parsed from a neighboring block adjacent to the current block or a bitstream, depending on the inter prediction mode.

[0150] The motion information of the current block can be derived from the motion information of another block of the current block. Here, the other block can be a block that has been coded / decoded by inter prediction prior to the current block. Setting the motion information of the current block to the same as the motion information of another block can be defined as a merge mode. Also, setting the motion vector of another block as a predicted value of the motion vector of the current block can be defined as a motion vector prediction mode.

[0151] FIG. 7 is a flowchart of a process for deriving motion information of a current block under the merge mode.

[0152] Merge candidates for a current block can be derived (S701). The merge candidates for the current block can be derived from blocks that have been coded / decoded using inter prediction prior to the current block.

[0153] FIG. 8 is a diagram illustrating candidate blocks used to derive merge candidates.

[0154] The candidate block may include at least one of a neighboring block including samples neighboring the current block or a non-neighboring block including samples not neighboring the current block. Hereinafter, samples used to determine the candidate block are defined as reference samples. Also, a reference sample neighboring the current block is referred to as a neighboring reference sample, and a reference sample not neighboring the current block is referred to as a non-neighboring reference sample.

[0155] The adjacent reference sample may be included in the column adjacent to the leftmost column of the current block or the row adjacent to the topmost row of the current block. For example, when the coordinates of the top left sample of the current block are (0, 0), at least one of the block including the reference sample at (-1, H-1), the block including the reference sample at (W-1, -1), the block including the reference sample at (W, -1), the block including the reference sample at (-1, H), or the block including the reference sample at (-1, -1) can be used as a candidate block. Referring to the drawing, the adjacent blocks with indexes 0 to 4 can be used as candidate blocks.

[0156] A non-adjacent reference sample refers to a sample in which at least one of the x-axis distance or y-axis distance from a reference sample adjacent to the current block has a predefined value. For example, at least one of a block including a reference sample whose x-axis distance from the left reference sample is a predefined value, a block including a non-adjacent sample whose y-axis distance from the top reference sample is a predefined value, or a block including a non-adjacent sample whose x-axis distance and y-axis distance from the top left reference sample are predefined values can be used as a candidate block. The predefined value can be a natural number such as 4, 8, 12, or 16. Referring to the drawing, at least one of blocks with indexes 5 to 26 can be used as a candidate block.

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

[0158] Hereinafter, among the candidate blocks, a candidate block containing adjacent reference samples will be referred to as an adjacent block, and a block containing non-adjacent reference samples will be referred to as a non-adjacent block.

[0159] If the distance between the current block and the candidate block is equal to or greater than a threshold, the candidate block may be set as unavailable as a merge candidate. The threshold may be determined based on the size of the coding tree unit. For example, the threshold may be set to the height of the coding tree unit (ctu_height) or a value obtained by adding or subtracting an offset from the height of the coding tree unit (e.g., ctu_height±N). The offset N is a value predefined in the encoder and decoder and may be set to 4, 8, 16, 32, or ctu_height.

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

[0161] Alternatively, a candidate block that does not belong to the same coding tree unit as the current block may be set as unavailable as a merge candidate. For example, if a reference sample exceeds the upper boundary of the coding tree unit to which the current block belongs, a candidate block including the reference sample may be set as unavailable as a merge candidate.

[0162] If the top boundary of the current block is adjacent to the top boundary of a coding tree unit, many candidate blocks may be determined to be unavailable as merge candidates, thereby reducing the encoding / decoding efficiency of the current block. To solve this problem, candidate blocks may be set so that the number of candidate blocks located to the left of the current block is greater than the number of candidate blocks located at the top of the current block.

[0163] FIG. 9 is a diagram illustrating candidate blocks used to derive merge candidates.

[0164] As shown in the example of Figure 9, the top block in the row of N blocks above the current block and the left block in the row of M blocks to the left of the current block can be set as candidate blocks. Here, M can be set to be larger than N, so that the number of left candidate blocks can be set to be larger than the number of top candidate blocks.

[0165] For example, the difference between the y-axis coordinate of a reference sample in the current block and the y-axis coordinate of an uppermost block that can be used as a candidate block may be set to not exceed N times the height of the current block, and the difference between the x-axis coordinate of a reference sample in the current block and the x-axis coordinate of a leftmost block that can be used as a candidate block may be set to not exceed M times the width of the current block.

[0166] For example, in the example shown in FIG. 9, the blocks belonging to the top two block columns of the current block and the blocks belonging to the five block columns to the left of the current block are set as candidate blocks.

[0167] Merge candidates can also be derived from temporally adjacent blocks included in a picture different from the current block. For example, merge candidates can be derived from co-located blocks included in a co-located picture. One of the reference pictures included in the reference picture list can be set as the co-located picture. Index information identifying the co-located picture among the reference pictures can be signaled via the bitstream. Alternatively, a reference picture having a predefined index among the reference pictures can be determined as the co-located picture.

[0168] The motion information of the merge candidate may be set in the same manner as the motion information of the candidate block. For example, at least one of the motion vector, reference picture index, prediction direction, or bidirectional weight index of the candidate block may be set as the motion information of the merge candidate.

[0169] A merge candidate list containing merge candidates may be generated (S702).

[0170] The indices of the merge candidates in the merge candidate list may be assigned in a predetermined order. For example, the indices may be assigned in the order of the merge candidate derived from the left neighboring block, the merge candidate derived from the top neighboring block, the merge candidate derived from the top right neighboring block, the merge candidate derived from the bottom left neighboring block, the merge candidate derived from the top left neighboring block, and the merge candidate derived from the temporal neighboring block.

[0171] If the merge candidate list includes multiple merge candidates, at least one of the multiple merge candidates can be selected (S703). Specifically, information for identifying one of the multiple merge candidates can be signaled via the bitstream. As an example, information "merge_idx" indicating the index of one of the merge candidates included in the merge candidate list can be signaled via the bitstream.

[0172]

[0173] If the number of merge candidates included in the merge candidate list is less than a threshold, motion information candidates included in the motion information table can be added to the merge candidate list as merge candidates. Here, the threshold can be the maximum number of merge candidates that the merge candidate list can contain or the maximum number of merge candidates minus an offset. The offset can be a natural number such as 1 or 2.

[0174] The motion information table includes motion information candidates derived from blocks encoded / decoded based on inter prediction within the current picture. For example, the motion information of the motion information candidates included in the motion information table may be set to be the same as the motion information of blocks encoded / decoded based on inter prediction. Here, the motion information may include at least one of a motion vector, a reference picture index, a prediction direction, or a bidirectional weight index.

[0175] The motion information candidates included in the motion information table can also be called inter region merge candidates or prediction region merge candidates.

[0176] The maximum number of motion information candidates that the motion information table can include may be predefined in the encoder and decoder. For example, the maximum number of motion information candidates that the motion information table can include may be 1, 2, 3, 4, 5, 6, 7, 8, or more (e.g., 16).

[0177] Alternatively, information indicating the maximum number of motion information candidates that the motion information table can include can be signaled by the bitstream. The information can be signaled at the sequence, picture, or slice level. The information can indicate the maximum number of motion information candidates that the motion information table can include. Alternatively, the information can indicate the difference between the maximum number of motion information candidates that the motion information table can include and the maximum number of merge candidates that the merge candidate list can include.

[0178] Alternatively, the maximum number of motion information candidates that the motion information table can include can be determined by the size of the picture, the size of the slice, or the size of the coding tree unit.

[0179] The motion information table may be initialized in units of pictures, slices, tiles, bricks, coding tree units, or coding tree unit lines (rows or columns). For example, when a slice is initialized, the motion information table may also be initialized, and the motion information table may not include any motion information candidates.

[0180] Alternatively, information indicating whether to initialize the motion information table can be signaled by the bitstream. The information can be signaled at the slice, tile, brick, or block level. The already configured motion information table can be used until the information indicates that the motion information table should be initialized.

[0181] Alternatively, information about initial motion information candidates can be signaled by the picture parameter set or slice header. Even when a slice is initialized, the motion information table can include the initial motion information candidates. This allows the initial motion information candidates to be used for the first block to be coded / decoded in the slice.

[0182] Alternatively, a motion information candidate included in the motion information table of the previous coding tree unit may be set as the initial motion information candidate. For example, a motion information candidate with the smallest index or a motion information candidate with the largest index among the motion information candidates included in the motion information table of the previous coding tree unit may be set as the initial motion information candidate.

[0183] Blocks are coded / decoded in the coding / decoding order, and the blocks coded / decoded based on inter prediction can be set as motion information candidates in the coding / decoding order.

[0184] FIG. 10 is a diagram for explaining the update state of the motion information table.

[0185] When inter-prediction is performed on a current block (S1001), motion information candidates can be derived based on the current block (S1002). The motion information of the motion information candidates can be set to be the same as the motion information of the current block.

[0186] If the motion information table is empty (S1003), motion information candidates derived based on the current block can be added to the motion information table (S1004).

[0187] If the motion information table already includes motion information candidates (S1003), a redundancy check may be performed on the motion information of the current block (or motion information candidates derived thereby) (S1005). The redundancy check is performed to determine whether the motion information of the motion information candidates already stored in the motion information table is the same as the motion information of the current block. The redundancy check may be performed on all motion information candidates already stored in the motion information table. Alternatively, the redundancy check may be performed on motion information candidates with indices greater than or less than a threshold value among the motion information candidates already stored in the motion information table. Alternatively, the redundancy check may be performed on a predefined number of motion information candidates. For example, two motion information candidates with small indices or two motion information candidates with large indices may be determined as the targets for the redundancy check.

[0188] If no motion information candidate having the same motion information as the motion information of the current block is included, a motion information candidate derived based on the current block may be added to the motion information table (S1008). Whether the motion information candidates are identical may be determined based on whether the motion information (e.g., motion vectors and / or reference picture indexes, etc.) of the motion information candidates are identical.

[0189] If the maximum number of motion information candidates is already stored in the motion information table (S1006), the oldest motion information candidate is deleted (S1007), and a motion information candidate derived based on the current block can be added to the motion information table (S1008). Here, the oldest motion information candidate can be the motion information candidate with the largest index or the motion information candidate with the smallest index.

[0190] Each motion information candidate can be identified by an index. When a motion information candidate derived from the current block is added to the motion information table, the lowest index (e.g., 0) can be assigned to the motion information candidate, and the indexes of previously stored motion information candidates can be incremented by 1. Here, if the maximum number of motion information candidates is already stored in the motion information table, the motion information candidate with the highest index is removed.

[0191] Alternatively, when a motion information candidate derived from the current block is added to the motion information table, the motion information candidate may be assigned the largest index. For example, if the number of motion information candidates already stored in the motion information table is less than the maximum value, the motion information candidate may be assigned an index equal to the number of already-stored motion information candidates. Alternatively, if the number of motion information candidates already stored in the motion information table is the same as the maximum value, the motion information candidate may be assigned an index equal to the maximum value minus 1. Furthermore, the motion information candidate with the smallest index is removed, and the indexes of the remaining already-stored motion information candidates are decremented by 1.

[0192] FIG. 11 is a diagram showing how the motion information table is updated.

[0193] It is assumed that a motion information candidate derived from the current block is added to the motion information table, the maximum index is assigned to the motion information candidate, and the maximum number of motion information candidates is already stored in the motion information table.

[0194] When adding the motion information candidate HmvpCand[n+1] derived from the current block to the motion information table HmvpCandList, the motion information candidate HmvpCand[0] with the smallest index among the already stored motion information candidates can be deleted, and the indexes of the remaining motion information candidates can be decremented by 1. In addition, the index of the motion information candidate HmvpCand[n+1] derived from the current block can be set to the maximum value (n in the example shown in FIG. 11).

[0195] If a motion information candidate identical to the motion information candidate derived based on the current block has already been stored (S1005), the motion information candidate derived based on the current block may not be added to the motion information table (S1009).

[0196] Alternatively, while adding a motion information candidate derived based on the current block to the motion information table, previously stored motion information candidates that are the same as the motion information candidate can be removed, which has the same effect as updating the index of the previously stored motion information candidate.

[0197] FIG. 12 is a diagram showing an example of updating the index of the motion information candidate that has already been saved.

[0198] If the index of a stored motion information candidate that is the same as the motion information candidate mvCand derived based on the current block is hIdx, the stored motion information candidate is deleted, and the index of a motion information candidate whose index is greater than hIdx is decremented by 1. For example, in the example shown in FIG. 12, HmvpCand[2] that is the same as mvCand is deleted from the motion information table HvmpCandList, and the indices from HmvpCand[3] to HmvpCand[n] are decremented by 1.

[0199] Then, the motion information candidate mvCand derived based on the current block can be added to the end of the motion information table.

[0200] Alternatively, the index assigned to the previously stored motion information candidate that is the same as the motion information candidate derived based on the current block may be updated. For example, the index of the previously stored motion information candidate may be changed to the minimum or maximum value.

[0201] The motion information of blocks included in a predetermined region may be set not to be added to the motion information table. For example, motion information candidates derived based on the motion information of blocks included in the merge processing region may not be added to the motion information table. Because no encoding / decoding procedure is defined for blocks included in the merge processing region, it is not appropriate to use any one of the motion information of these blocks when inter-predicting another block. Therefore, motion information candidates derived based on blocks included in the merge processing region may not be added to the motion information table.

[0202] Alternatively, the motion information of blocks smaller than a preset size may be set not to be added to the motion information table. For example, motion information of coding blocks whose width or height is smaller than 4 or 8, or motion information candidates derived based on motion information of coding blocks of 4x4 size may not be added to the motion information table.

[0203] When motion compensation prediction is performed in units of sub-blocks, motion information candidates can be derived based on motion information of a representative sub-block among a plurality of sub-blocks included in the current block. For example, when a sub-block merging candidate is used for the current block, motion information candidates can be derived based on motion information of a representative sub-block among the sub-blocks.

[0204] The motion vector of a sub-block can be derived in the following order. First, one of the merge candidates included in the merge candidate list of the current block is selected, and an initial shift vector (shVector) can be derived based on the motion vector of the selected merge candidate. Then, the initial shift vector can be added to the position (xSb, ySb) of the reference sample (e.g., the upper left sample or the middle sample) of each sub-block in the coding block to derive a shifted sub-block whose reference sample position is (xColSb, yColSb). The following Equation 1 shows an equation for deriving the shifted sub-block.

[0205]

number

[0206] Then, the motion vector of the collocated block corresponding to the center position of the sub-block containing (xColSb, yColSb) can be set to the motion vector of the sub-block containing (xSb, ySb).

[0207] The representative sub-block may refer to a sub-block including the top left sample, the center sample, the bottom right sample, the top right sample, or the bottom left sample of the current block.

[0208] FIG. 13 is a diagram showing the positions of the representative sub-blocks.

[0209] 13(a) shows an example in which a sub-block located at the top left of a current block is set as a representative sub-block, and FIG. 13(b) shows an example in which a sub-block located at the center of the current block is set as a representative sub-block. When motion compensation prediction is performed in sub-block units, motion information candidates for the current block can be derived based on the motion vector of the sub-block including the top left sample of the current block or the sub-block including the center sample of the current block.

[0210] Whether to use the current block as a motion information candidate may be determined based on the inter prediction mode of the current block. For example, a block encoded / decoded based on an affine motion model may be set as one that cannot be used as a motion information candidate. Thus, even if the current block is encoded / decoded using inter prediction, if the inter prediction mode of the current block is an affine prediction mode, the motion information table may not be updated based on the current block.

[0211] Alternatively, whether to use the current block as a motion information candidate may be determined based on at least one of the motion vector resolution of the current block, whether a merge offset encoding method is applied, whether joint prediction is applied, and whether triangular partitioning is applied. For example, if the motion information resolution of the current block is an integer multiple of 2 or more, if joint prediction is applied to the current block, if triangular partitioning is applied to the current block, or if a merge offset encoding method is applied to the current block, the current block may be set as unavailable as a motion information candidate.

[0212] Alternatively, a motion information candidate may be derived based on at least one sub-block vector among sub-blocks included in a block encoded / decoded based on an affine motion model. For example, a motion information candidate may be derived using a sub-block located at the top left, center, or top right of the current block. Alternatively, an average value of sub-block vectors of multiple sub-blocks may be set as the motion vector of the motion information candidate.

[0213] If the number of merge candidates included in the merge candidate list for the current block is less than a threshold, motion information candidates included in the motion information table may be added to the merge candidate list as merge candidates. The addition process may be performed in a procedure where the motion information candidate indices are sorted in ascending or descending order. For example, the motion information candidate with the largest index may be added to the merge candidate list for the current block.

[0214] When adding a motion information candidate included in the motion information table to the merge candidate list, a duplication check can be performed between the motion information candidate and merge candidates already stored in the merge candidate list. As a result of the duplication check, a motion information candidate having the same motion information as an already stored merge candidate can be prevented from being added to the merge candidate list.

[0215] The redundancy check may be performed only on a portion of the motion information candidates included in the motion information table. For example, the redundancy check may be performed only on motion information candidates whose indexes are greater than or less than a threshold. Alternatively, the redundancy check may be performed only on the N motion information candidates with the largest indexes or the N motion information candidates with the smallest indexes. Alternatively, the redundancy check may be performed only on a portion of the merge candidates already stored in the merge candidate list. For example, the redundancy check may be performed only on merge candidates whose indexes are greater than or less than a threshold or on merge candidates derived from blocks at a specific position. Here, the specific position may include at least one of the left neighboring block, the top neighboring block, the top right neighboring block, or the bottom left neighboring block of the current block.

[0216] FIG. 14 shows an example of performing overlap checking on only a portion of the merge candidates.

[0217] When adding a motion information candidate HmvpCand[j] to the merge candidate list, a check for overlap with the two merge candidates with the highest indices, mergeCandList[NumMerge-2] and mergeCandList[NumMerge-1], can be performed, where NumMerge indicates the number of available spatial and temporal merge candidates.

[0218] Unlike the illustrated example, when adding a motion information candidate HmvpCand[j] to the merge candidate list, the motion information candidate can be checked for overlap with at most two merge candidates with the largest indexes. For example, mergeCandList[0] and mergeCandList[1] can be checked for identity with HmvpCand[j].

[0219] Alternatively, the overlapping check may be performed only on merge candidates derived at a specific position. For example, the overlapping check may be performed on at least one of merge candidates derived from neighboring blocks located to the left of the current block or merge candidates derived from neighboring blocks located above the current block. If there is no merge candidate derived at a specific position in the merge candidate list, the motion information candidate may be added to the merge candidate list without the overlapping check.

[0220] When adding a motion information candidate HmvpCand[j] to the merge candidate list, a check for overlap with the two merge candidates with the highest indices, mergeCandList[NumMerge-2] and mergeCandList[NumMerge-1], can be performed, where NumMerge indicates the number of available spatial and temporal merge candidates.

[0221] A redundancy check with the merge candidate may be performed on only some of the motion information candidates. For example, a redundancy check may be performed on only N motion information candidates with larger indexes or N motion information candidates with smaller indexes among the motion information candidates included in the motion information table. For example, a redundancy check may be performed on only motion information candidates having indexes whose difference from the number of motion information candidates included in the motion information table is equal to or less than a threshold. If the threshold is 2, a redundancy check may be performed on only the three motion information candidates with the largest index values among the motion information candidates included in the motion information table. The redundancy check may be omitted for motion information candidates other than the three motion information candidates. When the redundancy check is omitted, a motion information candidate may be added to the merge candidate list regardless of whether it has the same motion information as the merge candidate.

[0222] Conversely, it may be set so that the duplication check is performed only on motion information candidates having indices whose difference from the number of motion information candidates included in the motion information table is equal to or greater than a threshold value.

[0223] The number of motion information candidates for which the redundancy check is performed may be predefined in the encoder and decoder. For example, the threshold may be an integer such as 0, 1, or 2.

[0224] Alternatively, the threshold value can be determined based on at least one of the number of merge candidates included in the merge candidate list or the number of motion information candidates included in the motion information table.

[0225] When a merge candidate identical to the first motion information candidate is found, the overlapping check with the merge candidate identical to the first motion information candidate can be omitted when checking for overlapping with the second motion information candidate.

[0226] FIG. 15 shows an example in which overlap checks with specific merge candidates are omitted.

[0227] When adding a motion information candidate HmvpCand[i] with index i to the merge candidate list, an overlap check is performed between the motion information candidate and merge candidates already stored in the merge candidate list. Here, if a merge candidate mergeCandList[j] that is the same as the motion information candidate HmvpCand[i] is found, the motion information candidate HmvpCand[i] is not added to the merge candidate list, and an overlap check is performed between the motion information candidate HmvpCand[i-1] with index i-1 and the merge candidate. Here, the overlap check between the motion information candidate HmvpCand[i-1] and the merge candidate mergeCandList[j] can be omitted.

[0228] For example, in the example shown in Figure 15, it is determined that HmvpCand[i] and mergeCandList[2] are the same. Therefore, it is possible to perform a duplication check on HmvpCand[i-1] without adding HmvpCand[i] to the merge candidate list. Here, the duplication check between HmvpCand[i-1] and mergeCandList[2] can be omitted.

[0229] If the number of merge candidates included in the merge candidate list for the current block is less than a threshold, the list may further include at least one of pairwise merge candidates or zero merge candidates in addition to motion information candidates. A pairwise merge candidate is a merge candidate whose motion vector is the average value of the motion vectors of two or more merge candidates, and a zero merge candidate is a merge candidate whose motion vector is zero.

[0230] Merge candidates can be added to the merge candidate list of the current block in the following order:

[0231] Spatial merge candidate - Temporal merge candidate - Motion information candidate - (Affine motion information candidate) - Pairwise merge candidate - Zero merge candidate

[0232] The spatial merge candidate refers to a merge candidate derived from at least one of adjacent or non-adjacent blocks, the temporal merge candidate refers to a merge candidate derived from a previous reference picture, and the affine motion information candidate refers to a motion information candidate derived from a block coded / decoded according to an affine motion model.

[0233] The motion information table can also be used in the motion vector prediction mode. For example, if the number of motion vector prediction candidates included in the motion vector prediction candidate list for the current block is less than a threshold, the motion information candidates included in the motion information table can be set as motion vector prediction candidates for the current block. Specifically, the motion vectors of the motion information candidates can be set as motion vector prediction candidates.

[0234] If one of the motion vector prediction candidates included in the motion vector prediction candidate list of the current block is selected, the selected candidate can be set as the motion vector predictor of the current block. Then, after decoding the motion vector residual value of the current block, the motion vector predictor and the motion vector residual value can be combined to obtain the motion vector of the current block.

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

[0236] Spatial motion vector prediction candidate - Temporal motion vector prediction candidate - Motion information candidate - (Affine motion information candidate) - Zero motion vector prediction candidate

[0237] A spatial motion vector prediction candidate is a motion vector prediction candidate derived from at least one of adjacent or non-adjacent blocks, and a temporal motion vector prediction candidate is a motion vector prediction candidate derived from a previous reference picture. An affine motion information candidate is a motion information candidate derived from a block coded / decoded according to an affine motion model. A zero motion vector prediction candidate is a candidate whose motion vector value is 0.

[0238]

[0239] A merge processing region larger than a coding block can be defined. The coding blocks included in the merge processing region can be processed in parallel rather than sequentially encoded / decoded. Here, "not sequentially encoded / decoded" means that the encoding / decoding procedure is not defined. As a result, the encoding / decoding processes of the blocks included in the merge processing region can be processed independently. Alternatively, the blocks included in the merge processing region can share merge candidates. Here, the merge candidates can be derived based on the merge processing region.

[0240] Due to the above characteristics, the merge processing region can also be called a parallel processing region, a shared merge region (SMR), or a merge estimation region (MER).

[0241] Merge candidates for the current block may be derived based on coding blocks. However, if the current block is included in a merge processing area larger than the current block, candidate blocks included in the same merge processing area as the current block may be set as ineligible for use as merge candidates.

[0242] FIG. 16 is a diagram showing an example in which a candidate block included in the same merge processing area as the current block is set as an unusable merge candidate.

[0243] In the example shown in (a) of Figure 18, when encoding / decoding CU5, blocks including reference samples adjacent to CU5 can be set as candidate blocks. Here, candidate blocks X3 and X4 included in the same merge processing area as CU5 can be set as ineligible for merge candidates for CU5. On the other hand, candidate blocks X0, X1, and X2 not included in the same merge processing area as CU5 can be set as ineligible for merge candidates.

[0244] In the example shown in (b) of Figure 18, when encoding / decoding CU8, blocks including reference samples adjacent to CU8 can be set as candidate blocks. Here, candidate blocks X6, X7, and X8 included in the same merge processing area as CU8 can be set as ineligible for merge candidates. On the other hand, candidate blocks X5 and X9 not included in the same merge area as CU8 can be set as ineligible for merge candidates.

[0245] Alternatively, if the current block is included in the merge processing area, adjacent blocks adjacent to the current block and adjacent blocks adjacent to the merge processing area can be set as candidate blocks.

[0246] FIG. 17 is a diagram illustrating an example of deriving merge candidates for a current block when the current block is included in a merge processing area.

[0247] As shown in the example of (a) of Figure 17, neighboring blocks of a current block can be set as candidate blocks for deriving merge candidates for the current block. Here, candidate blocks included in the same merge processing area as the current block can be set as ineligible for use as merge candidates. For example, when deriving merge candidates for coding block CU3, the top neighboring block y3 and the top right neighboring block y4 included in the same merge processing area as coding block CU3 can be set as ineligible for use as merge candidates for coding block CU3.

[0248] Neighboring blocks adjacent to the current block may be scanned in a predefined order to derive merge candidates, for example, y1, y3, y4, y0, and y2.

[0249] If the number of merging candidates that can be derived from neighboring blocks adjacent to the current block is less than the maximum number of merging candidates or a value obtained by subtracting an offset from the maximum number of merging candidates, merging candidates for the current block may be derived using neighboring blocks adjacent to the merge processing region, as shown in (b) of Figure 17. As an example, neighboring blocks adjacent to the merge processing region including the coding block CU3 may be set as candidate blocks for the coding block CU3. Here, the neighboring blocks adjacent to the merge processing region may include at least one of the left neighboring block x1, the top neighboring block x3, the bottom left neighboring block x0, the top right neighboring block x4, or the top left neighboring block x2.

[0250] Neighboring blocks adjacent to the merge processing area may be scanned in a predefined order to derive merge candidates, for example, x1, x3, x4, x0, and x2.

[0251] In summary, the merge candidates for the coding block CU3 included in the merge processing area can be derived by scanning the candidate blocks in the following scan order.

[0252] (y1, y3, y4, y0, y2, x1, x3, x4, x0, x2)

[0253] However, the exemplary candidate block scan order is merely an example of the present disclosure, and the candidate blocks may be scanned in an order different from the exemplary order, or the scan order may be adaptively determined based on at least one of the size and shape of the current block or the merging region.

[0254] The merge processing region may be square or non-square. Information for determining the merge processing region may be signaled by the bitstream. The information may include at least one of information indicating the shape of the merge processing region or information indicating the size of the merge processing region. If the merge processing region is non-square, at least one of information indicating the size of the merge processing region, information indicating the width and / or height of the merge processing region, or information indicating the ratio between the width and height of the merge processing region may be signaled by the bitstream.

[0255] The size of the merging processing region can be determined based on at least one of information signaled by the bitstream, picture resolution, slice size, or tile size.

[0256] If motion compensation prediction is performed on a block included in the merge processing area, motion information candidates derived based on the motion information of the block on which motion compensation prediction is performed can be added to the motion information table.

[0257] However, when adding motion information candidates derived from a block included in the merge processing area to the motion information table, there may be cases where the motion information candidates derived from the block are used when encoding / decoding other blocks in the merge processing area that are actually slower to encode / decode than the block. That is, there may be cases where motion prediction compensation is performed using motion information of other blocks included in the merge processing area, even though inter-block dependency should be eliminated when encoding / decoding a block included in the merge processing area. To solve this problem, even if encoding / decoding of a block included in the merge processing area is completed, the motion information of the block whose encoding / decoding is completed may not be added to the motion information table.

[0258] Alternatively, the motion information table may be updated using only blocks at predefined positions within the merge processing region. The predefined positions may include at least one of the block located at the upper left corner, the block located at the upper right corner, the block located at the lower left corner, the block located at the lower right corner, the block located in the center, the block adjacent to the right boundary, or the block adjacent to the bottom boundary within the merge processing region. For example, only the motion information of the block adjacent to the lower right corner within the merge processing region may be updated in the motion information table, and the motion information of other blocks may not be updated in the motion information table.

[0259] Alternatively, after the decoding of all blocks included in the merge processing region is completed, motion information candidates derived from the blocks can be added to the motion information table. That is, the motion information table can be not updated while the blocks included in the merge processing region are being encoded / decoded.

[0260] For example, if motion compensation prediction is performed on a block included in a merge processing region, motion information candidates derived from the block may be added to a motion information table in a predefined order. Here, the predefined order may be determined based on the scan order of coding blocks in the merge processing region or a coding tree unit. The scan order may be at least one of raster scan, horizontal scan, vertical scan, and zigzag scan. Alternatively, the predefined order may be determined based on the motion information of each block or the number of blocks having the same motion information.

[0261] Alternatively, motion information candidates including unidirectional motion information may be added to the motion information table before motion information candidates including bidirectional motion information, or conversely, motion information candidates including bidirectional motion information may be added to the motion information table before motion information candidates including unidirectional motion information.

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

[0263] If the current block is included in the merge processing area and the number of merge candidates included in the merge candidate list of the current block is less than the maximum number, motion information candidates included in the motion information table may be added to the merge candidate list. Here, motion information candidates derived from blocks included in the same merge processing area as the current block may be set not to be added to the merge candidate list of the current block.

[0264] Alternatively, if the current block is included in the merge processing area, it is possible to set the motion information candidates included in the motion information table not to be used. That is, even if the number of merge candidates included in the merge candidate list of the current block is less than the maximum number, the motion information candidates included in the motion information table can be not added to the merge candidate list.

[0265] As another example, a motion information table for a merge processing region or a coding tree unit may be configured. This motion information table serves to temporarily store motion information of blocks included in the merge processing region. To distinguish between a general motion information table and a motion information table for a merge processing region or a coding tree unit, the motion information table for a merge processing region or a coding tree unit is referred to as a temporary motion information table. Furthermore, motion information candidates stored in the temporary motion information table are referred to as temporary motion information candidates.

[0266] FIG. 18 is a diagram showing a temporary motion information table.

[0267] A temporary motion information table may be configured for a coding tree unit or a merge processing region. When motion compensation prediction is performed on a current block included in a coding tree unit or a merge processing region, the motion information of the block may not be added to the motion information table HmvpCandList. Instead, temporary motion information candidates derived from the block may be added to the temporary motion information table HmvpMERCandList. That is, temporary motion information candidates added to the temporary motion information table may not be added to the motion information table. As a result, the motion information table may not include motion information candidates derived based on the motion information of blocks included in the coding tree unit or merge processing region including the current block.

[0268] Alternatively, only the motion information of some of the blocks included in the head processing region can be added to the temporary motion information table. As an example, only blocks at predefined positions within the merge processing region can be used to update the motion information table. The predefined positions can include at least one of the block located in the upper left corner, the block located in the upper right corner, the block located in the lower left corner, the block located in the lower right corner, the block located in the center, the block adjacent to the right boundary, or the block adjacent to the bottom boundary within the merge processing region. As an example, only the motion information of the block adjacent to the bottom right corner within the merge processing region can be added to the temporary motion information table, and the motion information of other blocks can be not added to the temporary motion information table.

[0269] The maximum number of temporary motion information candidates that the temporary motion information table can include may be set to be equal to the maximum number of motion information candidates that the motion information table can include, or may be determined based on the size of a coding tree unit or a merge processing area, or may be set to be less than the maximum number of motion information candidates that the motion information table can include.

[0270] A current block included in a coding tree unit or a merge processing region may be set not to use the temporary motion information table for the coding tree unit or the merge processing region. That is, if the number of merge candidates included in the merge candidate list for the current block is less than a threshold, motion information candidates included in the motion information table may be added to the merge candidate list, and temporary motion information candidates included in the temporary motion information table may not be added to the merge candidate list. This prevents motion information of other blocks included in the same coding tree unit or the same merge processing region as the current block from being used for motion compensation prediction of the current block.

[0271] Once the encoding / decoding of all blocks included in the coding tree unit or the merge processing area is completed, the motion information table and the temporary motion information table can be merged.

[0272] FIG. 19 is a diagram showing an example of merging a motion information table and a temporary motion information table.

[0273] Once the encoding / decoding of all blocks included in the coding tree unit or merge processing area is completed, the temporary motion information candidates included in the temporary motion information table can be updated to the motion information table, as shown in the example of Figure 19.

[0274] Here, the temporary motion information candidates included in the temporary motion information table may be added to the motion information table in the order in which they were inserted into the temporary motion information table (ie, in ascending or descending order of index values).

[0275] As another example, the temporary motion information candidates included in the temporary motion information table may be added to the motion information table in a predefined order. Here, the predefined order may be determined based on the scan order of coding blocks in a merge processing region or a coding tree unit. The scan order may be at least one of raster scan, horizontal scan, vertical scan, or zigzag scan. Alternatively, the predefined order may be determined based on the motion information of each block or the number of blocks having the same motion information.

[0276] Alternatively, temporary motion information candidates containing unidirectional motion information may be added to the motion information table before temporary motion information candidates containing bidirectional motion information, or conversely, temporary motion information candidates containing bidirectional motion information may be added to the motion information table before temporary motion information candidates containing unidirectional motion information.

[0277] Alternatively, the temporary motion information candidates can be added to the motion information table in order of most frequently used or least frequently used within the merge processing region or coding tree unit.

[0278] When adding a temporary motion information candidate included in the temporary motion information table to the motion information table, a duplication check may be performed on the temporary motion information candidate. For example, if a motion information candidate identical to a temporary motion information candidate included in the temporary motion information table is already stored in the motion information table, the temporary motion information candidate may not be added to the motion information table. Here, the duplication check may be performed on some of the motion information candidates included in the motion information table. For example, the duplication check may be performed on motion information candidates whose indexes are equal to or greater than a threshold value. For example, if a temporary motion information candidate is identical to a motion information candidate whose index is equal to or greater than a predetermined value, the temporary motion information candidate may not be added to the motion information table.

[0279] It is possible to restrict motion information candidates derived from blocks included in the same coding tree unit or the same merge processing region as the current block from being used as merge candidates for the current block. To this end, block address information can be further stored for the motion information candidates. The block address information can include at least one of a block position, a block address, a block index, a position of a merge processing region including the block, an address of a merge processing region including the block, an index of a merge processing region including the block, a position of a coding tree region including the block, an address of a coding tree region including the block, or an index of a coding tree region including the block.

[0280]

[0281] Intra prediction is a method of predicting a current block using reconstructed samples that have been completely coded / decoded around the current block, where reconstructed samples before an in-loop filter is applied can be used for intra prediction of the current block.

[0282] Intra prediction techniques include matrix-based intra prediction and general intra prediction that takes into account the directionality of surrounding reconstructed samples. Information indicating the intra prediction technique for the current block may be signaled by a bitstream. The information may be a 1-bit flag. Alternatively, the intra prediction technique for the current block may be determined based on at least one of the position, size, shape, or intra prediction techniques of neighboring blocks. For example, if the current block spans a picture boundary, it may be set so that matrix-based intra prediction is not applied to the current block.

[0283] Matrix-based intra prediction is a method for obtaining a prediction block of a current block based on matrix multiplication between a matrix already stored in an encoder and a decoder and reconstructed samples around the current block. Information for identifying one of a plurality of already stored matrices can be signaled via a bitstream. The decoder can determine a matrix for intra prediction of the current block based on the information and the size of the current block.

[0284] General intra prediction is a method of obtaining a predicted block for a current block based on a non-directional intra prediction mode or a directional intra prediction mode. Hereinafter, a process of performing intra prediction based on general intra prediction will be described in more detail with reference to the accompanying drawings.

[0285] FIG. 20 is a flowchart of an intra prediction method according to an embodiment of the present invention.

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

[0287] Index information for identifying a reference sample line of a current block among a plurality of reference sample lines may be signaled by a bitstream. For example, index information intra_luma_ref_idx for identifying a reference sample line of a current block may be signaled by a bitstream. The index information may be signaled in units of coding blocks.

[0288] The plurality of reference sample lines may include at least one of the first, second, and third lines at the top and / or left of the current block. Among the plurality of reference sample lines, a reference sample line consisting of a row adjacent to the top of the current block and a column adjacent to the left of the current block may be referred to as an adjacent reference sample line, and the other reference sample lines may be referred to as non-adjacent reference sample lines.

[0289] Table 1 shows the index assigned to each candidate reference sample line.

[0290] [Table 1]

[0291] The reference sample line of the current block may be determined based on at least one of the position, size, and shape of the current block, or the predictive coding mode of a neighboring block. For example, if the current block is adjacent to a boundary of a picture, a tile, a slice, or a coding tree unit, the neighboring reference sample line may be determined as the reference sample line of the current block. The reference sample line may include a top reference sample located at the top of the current block and a left reference sample located to the left of the current block. The top reference sample and the left reference sample may be derived from reconstructed samples around the current block. The reconstructed samples may be in a state before an in-loop filter is applied.

[0292] Next, an intra prediction mode for the current block can be determined (S2002). The intra prediction mode for the current block can be at least one of a non-directional intra prediction mode or a directional intra prediction mode. The non-directional intra prediction modes include planar and DC, and the directional intra prediction modes include 33 or 65 modes from the bottom left diagonal to the top right diagonal.

[0293] FIG. 21 is a diagram showing intra prediction modes.

[0294] FIG. 21(a) shows 35 intra prediction modes, and FIG. 21(b) shows 67 intra prediction modes.

[0295] More or fewer intra-prediction modes than those shown in FIG. 21 may be defined.

[0296] A Most Probable Mode (MPM) may be set based on the intra-prediction modes of neighboring blocks adjacent to the current block, where the neighboring blocks may include a left neighboring block adjacent to the left side of the current block and an upper neighboring block adjacent to the upper end of the current block.

[0297] The number of MPMs included in the MPM list may be pre-set in the encoder and decoder. For example, the number of MPMs may be 3, 4, 5, or 6. Alternatively, information indicating the number of MPMs may be signaled by a bitstream. Alternatively, the number of MPMs may be determined based on at least one of the predictive coding mode of a neighboring block, the size, shape, or reference sample line index of the current block. For example, when a neighboring reference sample line is determined as the reference sample line of the current block, N MPMs are used, whereas when a non-neighboring reference sample line is determined as the reference sample line of the current block, M MPMs can be used. M is a natural number smaller than N. For example, N may be 6, and M may be 5, 4, or 3. Therefore, if the index of the reference sample line of the current block is 0 and the MPM flag is true, the intra prediction mode of the current block is determined to be one of the six candidate intra prediction modes, whereas if the index of the reference sample line of the current block is greater than 0 and the MPM flag is true, the intra prediction mode of the current block can be determined to be one of the five candidate intra prediction modes.

[0298] Alternatively, a fixed number of MPM candidates (for example, 6 or 5) can be used regardless of the index of the reference sample line of the current block.

[0299] If intra prediction that is different from the matrix is applied to a neighboring block, the intra prediction mode of the neighboring block is considered to be planar, and an MPM candidate can be derived.

[0300] If intra BDPCM is applied to a neighboring block, the intra prediction mode of the neighboring block may be considered as a default mode to guide MPM candidates, where the default mode may be at least one of DC, Planar, vertical, or horizontal.

[0301] Alternatively, the intra prediction mode of the neighboring block may be determined based on the direction in which the neighboring block applies intra BDPCM. For example, if a horizontal intra BDPCM is applied to the neighboring block, the intra prediction mode of the neighboring block may be considered to be horizontal. On the other hand, if a vertical intra BDPCM is applied to the neighboring block, the intra prediction mode of the neighboring block may be considered to be vertical.

[0302] An MPM list including multiple MPMs may be generated, and information indicating whether the MPM list includes the same MPM as the intra prediction mode of the current block may be signaled via a bitstream. The information is a 1-bit flag and may be referred to as an MPM flag. If the MPM flag indicates that the same MPM as that of the current block is included in the MPM list, index information identifying one of the MPMs may be signaled via the bitstream. For example, index information mpm_idx identifying one of multiple MPMs may be signaled via the bitstream. The MPM identified by the index information may be set as the intra prediction mode of the current block. If the MPM flag indicates that the same MPM as that of the current block is not included in the MPM list, residual mode information indicating one of the residual intra prediction modes excluding the MPMs may be signaled via the bitstream. The residual mode information indicates an index value corresponding to the intra prediction mode of the current block when indexes are reallocated to residual intra prediction modes excluding the MPMs. The decoder may sort the MPMs in ascending order and compare the residual mode information with the MPM to determine the intra prediction mode of the current block. For example, if the residual mode information is equal to or smaller than the MPM, the decoder may add 1 to the residual mode information to determine the intra prediction mode of the current block.

[0303] When deriving the intra prediction mode of the current block, comparison of some of the MPMs with the residual mode information may be omitted. For example, among the MPMs, an MPM that is a non-directional intra prediction mode may be excluded from comparison. When a non-directional intra prediction mode is set to an MPM, it is clear that the residual mode information indicates a directional intra prediction mode. Therefore, the intra prediction mode of the current block may be derived by comparing the residual MPM excluding the non-directional intra prediction mode with the residual mode information. Instead of excluding the non-directional intra prediction mode from comparison, the number of non-directional intra prediction modes may be added to the residual mode information, and the resulting value may be compared with the residual MPM.

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

[0305] When the default mode flag is used, the intra prediction mode same as the default mode may be set so that it is not set as an MPM. For example, if the default mode flag indicates whether the intra prediction mode of the current block is planar, the intra prediction mode of the current block may be guided using five MPMs excluding the MPM corresponding to planar.

[0306] When multiple intra prediction modes are set as a default mode, index information indicating one of the default modes may be further signaled, and the intra prediction mode of the current block may be set to the default mode indicated by the index information.

[0307] It may be set so that the default mode cannot be used if the index of the reference sample line of the current block is not 0. For example, if a non-adjacent reference sample line is determined as the reference sample line of the current block, it may be set so that a non-directional intra prediction mode, the same as the DC mode or the planar mode, is not used. Thus, if the index of the reference sample line is not 0, the default mode flag may not be signaled, and the value of the default mode flag may be set to a predefined value (i.e., false).

[0308] Once the intra prediction mode of the current block is determined, a prediction sample for the current block can be obtained based on the determined intra prediction mode (S2003).

[0309] When the DC mode is selected, a predicted sample for the current block is generated based on the average value of the reference samples. Specifically, the values of all samples in the predicted block may be generated based on the average value of the reference samples. The average value may be derived using at least one of a top reference sample located at the top of the current block and a left reference sample located to the left of the current block.

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

[0311] When the planar mode is selected, a prediction sample may be obtained using a horizontal prediction sample and a vertical prediction sample. Here, the horizontal prediction sample is obtained based on a left reference sample and a right reference sample located on the same horizontal line as the prediction sample, and the vertical prediction sample is obtained based on a top reference sample and a bottom reference sample located on the same vertical line as the prediction sample. Here, the right reference sample may be generated by copying a reference sample adjacent to the upper right corner of the current block, and the bottom reference sample may be generated by copying a reference sample adjacent to the lower left corner of the current block. The horizontal prediction sample may be obtained by a weighted sum operation of the left reference sample and the right reference sample, and the vertical prediction sample may be obtained by a weighted sum operation of the top reference sample and the bottom reference sample. Here, a weight assigned to each reference sample may be determined depending on the position of the prediction sample. The prediction sample may be obtained by an average operation or a weighted sum operation of the horizontal prediction sample and the vertical prediction sample. When performing the weighted sum operation, weights assigned to the horizontal prediction sample and the vertical prediction sample may be determined based on the position of the prediction sample.

[0312] When a directional prediction mode is selected, a parameter indicating the prediction direction (or prediction angle) of the selected directional prediction mode can be determined. Table 2 below shows the intra direction parameter intraPredAng for each intra prediction mode.

[0313] [Table 2]

[0314] Table 2 shows the intra direction parameters of each intra prediction mode having an index of 2 to 34 when 35 intra prediction modes are defined. When more than 33 directional intra prediction modes are defined, Table 2 can be further subdivided to set the intra direction parameters of each directional intra prediction mode. After arranging the top reference sample and left reference sample of the current block in a row, a predicted sample can be obtained based on the value of the intra direction parameter. Here, if the value of the intra direction parameter is negative, the left reference sample and top reference sample can be arranged in a row.

[0315] 22 and 23 are diagrams showing examples of a one-dimensional array in which reference samples are arranged in a line.

[0316] 22 illustrates a vertical one-dimensional array in which reference samples are arranged vertically, and FIG. 23 illustrates a horizontal one-dimensional array in which reference samples are arranged horizontally. The embodiments of FIG. 22 and FIG. 23 will be described assuming that 35 intra prediction modes are defined.

[0317] If the intra prediction mode index is one of 11 to 18, a horizontal one-dimensional array in which the top reference sample is rotated counterclockwise is applied, and if the intra prediction mode index is one of 19 to 25, a vertical one-dimensional array in which the left reference sample is rotated clockwise is applied. When arranging the reference samples in a row, the intra prediction mode angle may be taken into consideration.

[0318] Reference sample determination parameters may be determined based on the intra-direction parameters, and the reference sample determination parameters may include a reference sample index for identifying the reference sample and a weight parameter for determining a weight to be applied to the reference sample.

[0319] The reference sample index iIdx and the weight parameter ifact can be obtained by the following Equations 2 and 3, respectively.

[0320]

number

[0321]

number

[0322] In Equation 2 and Equation 3, P ang denotes an intra-direction parameter. The reference sample identified by the reference sample index iIdx corresponds to an integer pel.

[0323] At least one reference sample may be identified to derive a prediction sample. Specifically, the position of the reference sample used to derive the prediction sample may be identified by taking into account the gradient of the prediction mode. For example, the reference sample index iIdx may be used to identify the reference sample used to derive the prediction sample.

[0324] Here, when the gradient of the intra prediction mode cannot be represented by one reference sample, a prediction sample may be generated by interpolating multiple reference samples. For example, when the gradient of the intra prediction mode is a value between the gradient between the prediction sample and a first reference sample and the gradient between the prediction sample and a second reference sample, the prediction sample may be obtained by interpolating the first and second reference samples. That is, when an angular line according to the intra prediction angle does not pass through a reference sample located at an integer pel, the prediction sample may be obtained by interpolating reference samples located adjacent to the left, right, top, or bottom of the position where the angular line passes.

[0325] Equation 4 below shows an example of obtaining a predicted sample based on a reference sample.

[0326]

number

[0327] In Equation 4, P represents a predicted sample, and Ref_1D represents one of the one-dimensionally arranged reference samples, where the position of the reference sample can be determined by the position (x, y) of the predicted sample and the reference sample index iIdx.

[0328] If the gradient of the intra prediction mode can be expressed by one reference sample, the weight parameter i fact is set to 0. This allows Equation 4 to be simplified to Equation 5 below.

[0329]

number

[0330] Intra prediction for the current block may be performed based on a plurality of intra prediction modes. For example, an intra prediction mode may be induced for each prediction sample, and the prediction samples may be induced based on the intra prediction mode assigned to each prediction sample.

[0331] Alternatively, an intra prediction mode may be induced for each region, and intra prediction for each region may be performed based on the intra prediction mode assigned to each region. Here, the region may include at least one sample. At least one of the size or shape of the region may be adaptively determined based on at least one of the size, shape, and intra prediction mode of the current block. Alternatively, at least one of the size or shape of the region may be predefined in the encoder and decoder, independently of the size or shape of the current block.

[0332] FIG. 24 is a diagram illustrating angles formed by directional intra prediction modes with respect to a line parallel to the x-axis.

[0333] As shown in the example of Fig. 24, the directional prediction mode can exist between the bottom left diagonal direction and the top right diagonal direction. In terms of the angle formed by the x-axis and the directional prediction mode, the directional prediction mode can exist between 45 degrees (bottom left diagonal direction) and -135 degrees (top right diagonal direction).

[0334] If the current block is non-square, depending on the intra prediction mode of the current block, it may occur that a prediction sample is derived using a reference sample farther from the prediction sample than a reference sample closer to the prediction sample among reference samples located on an angular line along the intra prediction angle.

[0335] FIG. 25 illustrates how predicted samples are obtained when the current block is non-square.

[0336] For example, assume that the current block is a non-square block with its width greater than its height, as shown in (a) of Figure 25, and the intra prediction mode of the current block is a directional intra prediction mode with an angle between 0 and 45 degrees. In this case, when deriving a prediction sample A near the right column of the current block, a case may occur in which a left reference sample L far from the prediction sample is used instead of an upper reference sample T close to the prediction sample among reference samples located in an angular mode along the angle.

[0337] As another example, assume that the current block is a non-square block with its height greater than its width, as shown in (b) of Figure 25, and that the intra prediction mode of the current block is a directional intra prediction mode between -90 degrees and -135 degrees. In this case, when deriving a prediction sample A near the bottom row of the current block, a case may occur in which the top reference sample T far from the prediction sample is used instead of the left reference sample L close to the prediction sample among reference samples located in the angular mode along the angle.

[0338] To solve this problem, if the current block is non-square, the intra prediction mode of the current block can be replaced with an intra prediction mode in the opposite direction. As a result, for non-square blocks, a directional prediction mode having an angle larger or smaller than the directional prediction mode shown in Figure 21 can be used. Such a directional intra prediction mode can be defined as a wide-angle intra prediction mode. The wide-angle intra prediction mode refers to a directional intra prediction mode that does not fall within the range from 45 degrees to -135 degrees.

[0339] FIG. 26 is a diagram showing wide-angle intra prediction modes.

[0340] In the example shown in FIG. 26, the intra prediction modes with indexes from −1 to −14 and the intra prediction modes with indexes from 67 to 80 indicate wide-angle intra prediction modes.

[0341] Figure 26 illustrates 14 wide-angle intra-prediction modes (-1 to -14) with angles greater than 45 degrees and 14 wide-angle intra-prediction modes (67 to 80) with angles less than -135 degrees, but more or less wide-angle intra-prediction modes may be defined.

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

[0343] By using the wide-angle intra prediction mode, sample A shown in (a) of Figure 26 can be predicted using reference sample T, and sample A shown in (b) of Figure 26 can be predicted using reference sample L.

[0344] A total of 67+N intra prediction modes can be used by combining the existing intra prediction modes and N wide-angle intra prediction modes. As an example, Table 3 shows intra direction parameters of the intra prediction modes when 20 wide-angle intra prediction modes are defined.

[0345] [Table 3]

[0346] If the current block is non-square and the intra prediction mode of the current block obtained in operation S2502 belongs to a transformation range, the intra prediction mode of the current block may be transformed into a wide-angle intra prediction mode. The transformation range may be determined based on at least one of the size, shape, or ratio of the current block. Here, the ratio may indicate the ratio between the width and height of the current block. If the current block is non-square, where the width is greater than the height, the transformation range may be set from the intra prediction mode index in the upper right diagonal direction (e.g., 66) to (the intra prediction mode index in the upper right diagonal direction - N), where N may be determined based on the ratio of the current block. If the intra prediction mode of the current block belongs to the transformation range, the intra prediction mode may be transformed into a wide-angle intra prediction mode. The transformation may be performed by subtracting a predetermined value from the intra prediction mode, and the predetermined value may be the total number of intra prediction modes excluding the wide-angle intra prediction mode (e.g., 67).

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

[0348] If the current block is non-square, with its height greater than its width, the transform range may be set from the bottom-left diagonal intra-prediction mode index (e.g., 2) to (bottom-left diagonal intra-prediction mode index + M), where M may be determined based on the ratio of the current block. If the intra-prediction mode of the current block belongs to the transform range, the intra-prediction mode may be transformed into a wide-angle intra-prediction mode. The transform may be performed by adding a predefined value to the intra-prediction mode, and the predefined value may be the total number of directional intra-prediction modes excluding the wide-angle intra-prediction mode (e.g., 65).

[0349] According to the above embodiment, each of the intra prediction modes between No. 2 and No. 15 can be converted into a wide-angle intra prediction mode between No. 67 and No. 80.

[0350] Hereinafter, the intra prediction modes that belong to the transform range are referred to as wide-angle intra alternative prediction modes.

[0351] The transform range may be determined based on the ratio of the current block. As an example, Tables 4 and 5 show transform ranges when 35 intra prediction modes are defined and when 67 intra prediction modes are defined, excluding the wide-angle intra prediction mode, respectively.

[0352] [Table 4]

[0353] [Table 5]

[0354] As shown in the examples of Tables 4 and 5, the number of wide-angle intra alternative prediction modes included in the transform range may vary depending on the ratio of the current block.

[0355] The ratio of the current block can be further divided to set the conversion range as shown in Table 6 below.

[0356] [Table 6]

[0357] When a non-adjacent reference sample line is determined as the reference sample line of the current block, or when a multi-line intra-prediction coding method that selects one of a plurality of reference sample lines is used, the wide-angle intra-prediction mode may be set not to be used. That is, even if the current block is non-square and the intra-prediction mode of the current block belongs to a conversion range, the intra-prediction mode of the current block may not be converted to the wide-angle intra-prediction mode. Alternatively, when the intra-prediction mode of the current block is determined as the wide-angle intra-prediction mode, the non-adjacent reference sample line may be set to be unavailable as the reference sample line of the current block, or the multi-line intra-prediction coding method that selects one of a plurality of reference sample lines may be set not to be used. When the multi-line intra-prediction coding method is not used, the adjacent reference sample line may be determined as the reference sample line of the current block.

[0358] When a wide-angle intra prediction mode is not used, refW and refH may be set to the sum of nTbW and nTbH. Thus, excluding the top left reference sample, non-adjacent reference samples that are a distance i from the current block may include (nTbW + nTbH + offsetX[i]) top reference samples and (nTbW + nTbH + offsetY[i]) left reference samples. That is, non-adjacent reference samples that are a distance i from the current block may include (2nTbW + 2nTbH + offsetX[i] + offsetY[i] + 1) reference samples. For example, if the value of whRatio is greater than 1, the value of offsetX may be set to be greater than the value of offsetY. For example, the value of offsetX may be set to 1 and the value of offsetY may be set to 0. On the other hand, if the value of whRatio is less than 1, the value of offsetY may be set to be greater than the value of offsetX. As an example, the value of offsetX can be set to 0 and the value of offsetY can be set to 1.

[0359] Using a wide-angle intra-prediction mode in addition to an existing intra-prediction mode may increase resources required to encode the wide-angle intra-prediction mode, resulting in reduced coding efficiency. Therefore, instead of directly encoding the wide-angle intra-prediction mode, an alternative intra-prediction mode to the wide-angle intra-prediction mode may be encoded to improve coding efficiency.

[0360] For example, if the current block is encoded using wide-angle intra prediction mode No. 67, the intra prediction mode of the current block may be encoded as wide-angle alternative intra prediction mode No. 2 for No. 67. Also, if the current block is encoded using wide-angle intra prediction mode No. −1, the intra prediction mode of the current block may be encoded as wide-angle alternative intra prediction mode No. 66 for No. −1.

[0361] The decoder may decode the intra prediction mode of the current block and determine whether the decoded intra prediction mode is included in the conversion range. If the decoded intra prediction mode is a wide-angle alternative intra prediction mode, the decoder may convert the intra prediction mode to a wide-angle intra prediction mode.

[0362] Alternatively, if the current block is coded in the wide-angle intra-prediction mode, the wide-angle intra-prediction mode may be coded as is.

[0363] The encoding of the intra prediction mode may be performed based on the above-mentioned MPM list. Specifically, if a neighboring block is encoded in a wide-angle intra prediction mode, the MPM may be set based on a wide-angle alternative intra prediction mode corresponding to the wide-angle intra prediction mode.

[0364]

[0365] A coding block or a transform block may be divided into a plurality of sub-blocks (or sub-partitions). When a coding block or a transform block is divided into a plurality of sub-blocks, prediction, transformation, and quantization may be performed on each of the sub-blocks. Dividing a coding block or a transform block into a plurality of sub-blocks may be defined as a sub-partition intra-coding method.

[0366] Information indicating whether a sub-partition intra-coding method is applied can be signaled by the bitstream. The information can be a 1-bit flag. For example, a syntax element 'intra_subpartitions_mode_flag' indicating whether a coding block or a transform block is divided into multiple sub-blocks can be signaled by the bitstream.

[0367] Alternatively, it may be determined whether to apply the sub-partition intra-coding method based on at least one of the size, shape, or intra-prediction mode of the coding block or transform block. For example, if the intra-prediction mode of the coding block is a non-directional intra-prediction mode (e.g., planar or DC) or a predefined directional intra-prediction mode (e.g., horizontal intra-prediction mode, vertical intra-prediction mode, or diagonal intra-prediction mode), the sub-partition intra-coding method may not be applied. Alternatively, if the size of the coding block is smaller than a threshold, it may be set so that the sub-partition intra-coding method is not used.

[0368] Alternatively, when intra prediction is performed on a sub-block based on the intra prediction mode of a coding block, whether to apply the sub-partition intra-coding method may be determined based on whether a reconstructed sample included in a neighboring sub-block must be used as a reference sample during intra prediction of the sub-block. For example, if the intra prediction mode of a coding block is a diagonal intra prediction mode or a wide-angle intra prediction mode and neighboring sub-blocks cannot be used as reference samples when intra prediction is performed on a sub-block based on the intra prediction mode, the sub-partition intra-coding method may be set not to be used.

[0369] Alternatively, if the ratio of the height and width of a coding block is above or below a threshold, the sub-partition intra-coding method may be set not to be used. Alternatively, if at least one of the height or width of a coding block is below a threshold, the sub-partition intra-coding method may not be used. For example, if the width or height of a coding block is below a threshold, or if both the height and width of a coding block are below a threshold, the sub-partition intra-coding method may not be used. Alternatively, if the number of samples included in a coding block is below a threshold, the sub-partition intra-coding method may not be used. The threshold may have a value that is predefined in the encoder and decoder. Alternatively, information for determining the threshold may be signaled by a bitstream.

[0370] Alternatively, whether to signal a flag indicating whether the sub-partition intra-coding method is applicable may be determined based on at least one of the size, shape, and intra-prediction mode of a coding block or a transform block. For example, only when both the height and width of a coding block are equal to or smaller than a threshold and / or when the size of a coding block is equal to or larger than a threshold, a flag indicating whether the sub-partition intra-coding method is applicable may be coded and signaled. If the flag indicating whether the sub-partition intra-coding method is applicable is not coded, the sub-partition intra-coding method may not be applied.

[0371] If the sub-partition intra-coding method is not used, the signaling of the syntax element intra_subpartitions_mode_flag can be omitted. If the signaling of the flag is omitted, the flag can be considered to indicate that the sub-partition intra-coding method is not applied.

[0372] When a sub-partition intra-coding method is applied, a partitioning pattern of a coding block or a transform block may be determined. Here, the partitioning pattern indicates a partitioning direction of the coding block or the transform block. For example, vertical partitioning may mean dividing the coding block or the transform block using at least one vertical line, and horizontal partitioning may mean dividing the coding block or the transform block using at least one horizontal line.

[0373] FIG. 27 is a diagram showing an example of vertical partitioning and horizontal partitioning.

[0374] FIG. 27(a) shows an example in which a coding block is divided into two sub-blocks, and FIG. 27(b) shows an example in which a coding block is divided into four sub-blocks.

[0375] Information for determining the partitioning mode of a coding block or a transform block may be signaled by a bitstream. For example, information indicating whether vertical partitioning or horizontal partitioning is applied to a coding block or a transform block may be signaled. The information may be a 1-bit flag intra_subpart_type_flag. A value of 1 in the flag indicates that the coding block or the transform block is partitioned horizontally, and a value of 0 in the flag indicates that the coding block or the transform block is partitioned vertically.

[0376] Alternatively, the partitioning form of the coding block or transform block may be determined based on the size, shape, or intra prediction mode of the coding block or transform block. As an example, the partitioning form of the coding block may be determined based on the ratio between the width and height of the coding block. For example, if the value of whRatio indicating the ratio between the height and width of the coding block is equal to or greater than a first threshold, vertical partitioning may be applied to the coding block. Otherwise, horizontal partitioning may be applied to the coding block.

[0377] FIG. 28 is a diagram showing an example of determining the division form of a coding block.

[0378] For convenience of explanation, it is assumed that the first threshold is 2. In the example shown in (a) of FIG. 28, the whRatio of the coding block is 1, which is smaller than the first threshold. This makes it possible to omit encoding information indicating the partition form of the coding block and apply horizontal partitioning to the coding block.

[0379] In the example shown in (b) of Figure 28, the whRatio of the coding block is 2, which is the same as the first threshold. This makes it possible to omit encoding information indicating the partition form of the coding block and apply vertical partitioning to the coding block.

[0380] The partitioning form of the coding block may also be determined using a second threshold having an opposite sign to the first threshold. For example, if the value of whRatio is equal to or less than the second threshold, horizontal partitioning may be applied to the coding block, and if not, vertical partitioning may be applied to the coding block. The absolute values of the first and second thresholds may be the same, and their signs may be opposite. For example, if the first threshold is N (where N is an integer such as 1, 2, or 4), the second threshold may be −N.

[0381] FIG. 29 is a diagram showing an example of determining the division form of a coding block.

[0382] For convenience of explanation, it is assumed that the second threshold is −2. In the example shown in (a) of FIG. 29, the whRatio of the coding block is −1, which is greater than the second threshold. Therefore, it is possible to omit encoding information indicating the partitioning form of the coding block and apply vertical partitioning to the coding block.

[0383] In the example shown in (b) of Figure 29, the whRatio of the coding block is -2, which is the same as the second threshold value. This makes it possible to omit encoding information indicating the partition form of the coding block and apply horizontal partitioning to the coding block.

[0384] Alternatively, the partitioning type of the coding block may be determined based on the first and second thresholds. For example, if the value of whRatio is equal to or greater than the first threshold, horizontal partitioning may be applied to the coding block, and if the value of whRatio is equal to or less than the second threshold, vertical partitioning may be applied to the coding block. If the value of whRatio is between the first and second thresholds, information may be parsed according to the bitstream to determine the partitioning type of the current block.

[0385] The first and second thresholds may be predefined in the encoder and decoder, or may be defined for each sequence, picture, or slice.

[0386] Alternatively, the partitioning pattern may be determined based on the size of the coding block or the transform block. For example, if the size of the coding block is N×n, vertical partitioning may be applied, and if the size of the coding block is n×N, horizontal partitioning may be applied. Here, n may be a natural number smaller than N. N and / or n may be values predefined in the encoder and decoder. Alternatively, information for determining N and / or n may be signaled via a bitstream. For example, N may be 32, 64, 128, or 256. Thus, if the size of the coding block is 128×n (where n is a natural number such as 16, 32, or 64), vertical partitioning may be applied, and if the size of the coding block is n×128, horizontal partitioning may be applied.

[0387] Alternatively, the partitioning form of the coding block or transform block may be determined based on the intra prediction mode of the coding block or transform block. For example, if the intra prediction mode of the coding block is horizontal or a direction similar to the horizontal direction, vertical partitioning may be applied to the coding block. Here, the intra prediction mode of the horizontal direction indicates an intra prediction mode (e.g., INTRA_ANGULAR18±N) whose index difference value from the horizontal intra prediction mode (e.g., INTRA_ANGULAR18 shown in (b) of FIG. 21) is equal to or less than a threshold. On the other hand, if the intra prediction mode of the coding block is vertical or a direction similar to the vertical direction, horizontal partitioning may be applied to the coding block. Here, the intra prediction mode of the vertical direction indicates an intra prediction mode (e.g., INTRA_ANGULAR50±N) whose index difference value from the vertical intra prediction mode (e.g., INTRA_ANGULAR50 shown in (b) of FIG. 21) is equal to or less than a threshold. Here, the threshold N may be a value previously defined in the encoder and decoder. Alternatively, the information for determining the threshold N can be signaled at the sequence, picture or slice level.

[0388] When both vertical partitioning and horizontal partitioning can be used, the division form of the coding block can be determined by parsing information indicating the division form of the coding block.

[0389] The number of sub-blocks may be determined based on at least one of the size or shape of the coding block or the transform block. For example, if either the width or height of the coding block is 8 and the other is 4, the coding block may be divided into two sub-blocks. On the other hand, if both the width and height of the coding block are 8 or more, or if either the width or height of the coding block is greater than 8, the coding block may be divided into four sub-blocks. In summary, if the coding block has a 4x4 size, the coding block may not be divided into sub-blocks. If the coding block has a 4x8 or 8x4 size, the coding block may be divided into two sub-blocks. In other cases, the coding block may be divided into four sub-blocks.

[0390] Alternatively, information indicating the size, shape, or number of sub-blocks may be signaled by a bitstream. The size or shape of the sub-blocks may be determined by the information indicating the number of sub-blocks. Alternatively, the number of sub-blocks may be determined by the information indicating the size or shape of the sub-blocks.

[0391] When a sub-partition intra-coding method is applied, sub-blocks generated by dividing a coding block or a transform block can use the same intra-prediction mode. For example, an MPM for a coding block can be derived based on the intra-prediction modes of neighboring blocks adjacent to the coding block, and the intra-prediction mode for the coding block can be determined based on the derived MPM. Once the intra-prediction mode of the coding block is determined, each sub-block can perform intra-prediction using the determined intra-prediction mode.

[0392] When a sub-partition intra-coding method is applied, one of the MPMs can be determined as the intra-prediction mode of a coding block. That is, when a sub-partition intra-coding method is applied, the MPM flag can be considered to be true even if it is not signaled.

[0393] Alternatively, when a sub-partition intra coding method is applied, one of predefined candidate intra prediction modes may be determined as the intra prediction mode of the coding block. For example, one of a horizontal intra prediction mode, a vertical intra prediction mode, a diagonal intra prediction mode (e.g., at least one of the top-left intra prediction mode, the top-right intra prediction mode, or the bottom-left intra prediction mode), or a non-directional intra prediction mode (e.g., at least one of the planar or DC) may be determined as the intra prediction mode of the coding block. Index information identifying one of the predefined candidate intra prediction modes may be signaled via a bitstream. Alternatively, the number and / or type of candidate intra prediction modes may vary depending on the division direction of the coding block. For example, when horizontal partitioning is applied to the coding block, at least one of a non-directional intra prediction mode, a vertical intra prediction mode, a top-left diagonal intra prediction mode, or a top-right diagonal intra prediction mode may be set as the candidate intra prediction mode. On the other hand, if vertical partitioning is applied to the coding block, at least one of a non-directional intra prediction mode, a horizontal intra prediction mode, a top left diagonal intra prediction mode, or a bottom left diagonal intra prediction mode can be set as the candidate intra prediction mode.

[0394] The quantization parameters of the sub-blocks can be determined individually. This allows the quantization parameter values of each sub-block to be set differently. To determine the quantization parameters of each sub-block, information indicating a difference value from the quantization parameter of the previous sub-block can be coded. For example, for the Nth sub-block, the difference value between the quantization parameter of the Nth sub-block and the quantization parameter of the (N-1)th sub-block can be coded.

[0395] Intra prediction of a sub-block may be performed using a reference sample. Here, the reference sample may be derived from a reconstructed sample of a neighboring block adjacent to the sub-block. If the neighboring block adjacent to the sub-block is another sub-block included in the same coding block as the sub-block, the reference sample of the sub-block may be derived based on the reconstructed sample of the other sub-block. For example, if a first sub-block is located to the left or top of a second sub-block, the reference sample of the second sub-block may be derived from the reconstructed sample of the first sub-block. For this reason, parallel intra prediction may not be applied between sub-blocks. That is, encoding / decoding may be performed sequentially for sub-blocks included in a coding block. Thus, intra prediction for the second sub-block may be performed after encoding / decoding of the first sub-block is completed.

[0396] When the sub-partition intra-coding method is applied, it can be set not to use the multi-line intra-prediction coding method, which selects one of multiple reference sample line candidates. When the multi-line intra-prediction coding method is not used, the adjacent reference sample line adjacent to each sub-block can be determined as the reference sample line of each sub-block. Alternatively, when the index of the reference sample line of the current block is greater than 0, coding of the syntax element intra_subpartitions_mode_flag, which indicates whether the sub-partition intra-coding method is applied, can be omitted. When coding of the syntax element intra_subpartitions_mode_flag is omitted, the sub-partition intra-coding method can be omitted.

[0397] Filtering may be performed on samples adjacent to the boundary between sub-blocks. The filter may be performed on predicted samples or reconstructed samples. For example, assuming that a second sub-block is located adjacent to the right of a first sub-block, predicted samples or reconstructed samples adjacent to the left boundary of the second sub-block may be filtered using reconstructed samples adjacent to the right boundary of the first sub-block.

[0398] Whether to apply a filter to samples adjacent to a boundary between sub-blocks may be determined based on at least one of the intra-prediction mode, the size of the sub-block, or the number of sub-blocks.

[0399]

[0400] When a prediction block is generated as a result of performing intra prediction, the prediction samples can be updated based on the positions of the prediction samples included in the prediction block. This update method is called a sample position-based intra weighted prediction method (also known as Position Dependent Prediction Combination, PDPC).

[0401] Whether to use PDPC may be determined taking into consideration the size, shape, intra prediction mode, reference sample line of the current block, size of the current block, or color component. For example, PDPC may be used when the intra prediction mode of the current block is at least one of Planar, DC, vertical, horizontal, a mode with an index value smaller than the vertical direction, or a mode with an index value larger than the horizontal direction. Alternatively, PDPC may be used only when at least one of the width or height of the current block is greater than 4. Alternatively, PDPC may be used only when the index of the reference picture line of the current block is 0. Alternatively, PDPC may be used only when the index of the reference picture line of the current block is equal to or greater than a predefined value. Alternatively, PDPC may be used only for the luminance component. Alternatively, whether to use PDPC may be determined depending on whether two or more of the above listed conditions are satisfied.

[0402] Alternatively, whether to use PDPC may be determined depending on whether a sub-partition intra-coding method is used. For example, when a sub-partition intra-coding method is applied to a coding block or a transform block, PDPC may be set not to be used. Alternatively, when a sub-partition intra-coding method is applied to a coding block or a transform block, PDPC may be applied to at least one of a plurality of sub-blocks. Here, the sub-blocks to which PDPC is applied may be determined based on at least one of the size, shape, position, intra-prediction mode, or reference sample line index of the coding block or sub-block. For example, PDPC may be applied to a sub-block adjacent to the top and / or left boundary of the coding block, or to a sub-block adjacent to the bottom and / or right boundary of the coding block. Alternatively, PDPC may be applied to all sub-blocks included in the coding block or not applied to all sub-blocks included in the coding block based on the size or shape of the sub-block. For example, if at least one of the width or height of a sub-block is smaller than a threshold, application of PDPC may be omitted. As another example, PDPC may be applied to all sub-blocks in the coding block.

[0403] Alternatively, whether or not to apply PDPC to each sub-block may be determined depending on whether at least one of the size, shape, intra prediction mode, or reference picture index of a sub-block generated by dividing a coding block or a transform block satisfies a predetermined condition. For example, if at least one of the width or height of a sub-block is greater than 4, PDPC may be applied to the sub-block.

[0404] As another example, information indicating whether PDPC is applied may be signaled by the bitstream.

[0405] Alternatively, the region to which PDPC is applied may be determined based on at least one of the size, shape, intra prediction mode, or position of the prediction sample of the current block. For example, if the intra prediction mode of the current block has a larger index in the vertical direction, prediction samples in which at least one of the x-axis coordinates or y-axis coordinates is greater than a threshold may not be corrected, and correction may be performed only on prediction samples in which the x-axis coordinate or y-axis coordinate is equal to or less than the threshold. Alternatively, if the intra prediction mode of the current block has a smaller index in the horizontal direction, prediction samples in which at least one of the x-axis coordinate or y-axis coordinate is greater than a threshold may not be corrected, and correction may be performed only on prediction samples in which the x-axis coordinate or y-axis coordinate is equal to or less than the threshold. Here, the threshold may be determined based on at least one of the size, shape, or intra prediction mode of the current block.

[0406] If a prediction sample is obtained by an intra-prediction sample, a reference sample used to correct the prediction sample can be determined based on the position of the obtained prediction sample.

[0407]

[0408] After performing intra prediction on the current block, a residual signal can be obtained by subtracting predicted samples from original samples of the current block. Here, instead of directly encoding the residual signal at a specific position, a difference between the residual signal at a specific position and an adjacent residual signal can be induced and then the induced difference can be encoded. Here, the residual signal can represent residual samples, transform coefficients generated by transforming the residual samples, or coefficients generated by skipping the transform.

[0409] For example, instead of directly encoding the residual signal belonging to the second line, the residual signal belonging to the first line may be differentiated from the residual signal belonging to the second line, and then encoding of the differentiated residual value may be performed. Here, the first line and the second line may have different x-axis coordinates or y-axis coordinates.

[0410] For example, the encoder may generate transform coefficients by transforming residual samples, and then encode the transform coefficient differentials derived by subtracting the generated transform coefficients from adjacent transform coefficients. The decoder may set the transform coefficients belonging to the first line as transform coefficient prediction values for the second residual signal, and derive second transform coefficients by adding the decoded differential transform coefficients to the transform coefficient prediction values.

[0411] This process of subtracting the residual signal and then encoding / decoding the residual difference value is called intra-BDPCM (Block-based Delta Pulse Code Modulation). Intra-BDPCM can only be used when the predictive coding mode of the current block is determined by intra-frame prediction.

[0412] When intra-BDPCM is applied, the predicted samples of the current block may be set to 0. That is, when intra-BDPCM is applied, the residual samples may be set to the reconstructed samples.

[0413] Alternatively, when intra-BDPCM is applied, predicted samples of the current block may be derived based on intra-prediction. Here, the intra-prediction mode of the current block may be determined according to the intra-BDPCM direction. For example, when the intra-BDPCM direction is horizontal, predicted samples may be obtained based on the horizontal intra-prediction mode. When the intra-BDPCM direction is vertical, predicted samples may be obtained based on the vertical intra-prediction mode.

[0414] Alternatively, the predicted samples of the current block may be derived using a default intra prediction mode. The default intra prediction mode may be one of DC, Planar, horizontal, or vertical. The default intra prediction mode may be predefined in the encoder and decoder. Information identifying one of the default intra prediction modes may be coded and signaled.

[0415] Alternatively, the intra-prediction mode can be derived from one of multiple MPM candidates.

[0416] When intra-BDPCM is applied to the current block, it is possible to force the use of adjacent reference sample lines, i.e., it is possible to omit signaling of index information identifying one of the reference sample lines and obtain a predicted sample using the adjacent reference sample line.

[0417] When the intra-BDPCM technique is applied, information for determining the intra-BDPCM direction can be signaled in the bitstream. For example, a flag intra_bdpcm_dir_flag indicating the intra-BDPCM direction can be signaled in the bitstream. When the syntax intra_bdpcm_dir_flag is 0, it indicates that horizontal BDPCM is applied, and when the syntax intra_bdpcm_dir_flag is 1, it indicates that vertical BDPCM is applied.

[0418] Alternatively, the intra-BDPCM direction can be determined based on the size or shape of the current block. For example, if the current block is non-square (i.e., the width is greater than the height), it can be determined that horizontal BDPCM is applied. On the other hand, if the current block is non-square (i.e., the height is greater than the width), it can be determined that vertical BDPCM is applied.

[0419] Alternatively, the intra BDPCM direction may be determined taking into account the intra prediction modes of adjacent blocks adjacent to the current block. For example, if at least one intra prediction mode among the left and top blocks of the current block is horizontal or a similar direction, horizontal BDPCM may be applied to the current block. Here, a direction similar to the horizontal direction refers to an intra prediction mode whose difference from the horizontal intra prediction mode is less than or equal to a threshold. Alternatively, if at least one intra prediction mode among the left and top blocks of the current block is vertical or a similar direction, vertical BDPCM may be applied to the current block. Here, a direction similar to the vertical direction refers to an intra prediction mode whose difference from the vertical intra prediction mode is less than or equal to a threshold.

[0420] When horizontal BDPCM is applied, a difference value between a residual signal and a residual signal adjacent to the upper end of the residual signal can be encoded, and the decoder can derive the residual signal by adding the upper end residual signal to the decoded difference value.

[0421] When vertical BDPCM is applied, a difference value between a residual signal and a residual signal adjacent to the left of the residual signal can be encoded, and the decoder can derive the residual signal by adding the left residual signal to the decoded difference value.

[0422] Alternatively, non-directional BDPCM can be applied. For example, DC BDPCM means encoding / decoding the difference between a residual signal at a predetermined position and the average value of neighboring residual signals at the predetermined position. Planar BDPCM means encoding / decoding the average or weighted sum of horizontal difference values, which are the difference between a residual signal at a predetermined position and a residual signal located horizontally of the residual signal at the predetermined position, and vertical difference values, which are the difference between a residual signal at the predetermined position and a residual signal located vertically of the residual signal at the predetermined position.

[0423] Information for identifying available BDPCM modes can be signaled via the bitstream, which can be information indicating whether unidirectional BDPCM is applied or information for identifying one of multiple BDPCM candidates applicable to the current block.

[0424] Information indicating whether intra BDPCM is applied to the current block can be signaled via the bitstream. For example, a flag intra_bdpcm_flag can be signaled via the bitstream. When the syntax intra_bdpcm_flag is 1, it indicates that intra BDPCM is applied to the current block. When the syntax intra_bdpcm_flag is 0, it indicates that intra BDPCM is not applied to the current block.

[0425] Information indicating the availability of intra BDPCM can be signaled at the picture or sequence level. As an example, a flag sps_intra_bdpcm_flag indicating the availability of intra BDPCM can be signaled via a sequence parameter set (SPS). When the syntax sps_intra_bdpcm_flag is set to 1, it indicates that a picture referencing the sequence parameter set can use intra BDPCM. When the syntax sps_intra_bdpcm_flag is set to 0, it indicates that a picture referencing the sequence parameter set cannot use intra BDPCM. The intra_bdpcm_flag, which indicates whether intra BDPCM is applied to the current block, can be signaled only when sps_intra_bdpcm_flag is set to 1.

[0426] If intra BDPCM is applied to the current block, it can be set not to use PDPC.

[0427] If intra BDPCM is applied to the current block, the application of transform skip can be forced. That is, if intra BDPCM is applied to the current block, the value of transform_skip_flag, which indicates whether transform skip is applied, can be considered to be 1 even if it is not signaled.

[0428]

[0429] The combined prediction mode is a method of generating a predicted image by combining two or more prediction modes. For example, when the combined prediction mode is applied, a predicted block may be generated by averaging a first prediction block generated based on a first prediction mode and a second prediction block generated based on a second prediction mode, or by performing a weighted sum operation using these. The prediction mode may include at least one of an intra prediction mode, a merge mode, an AMVP mode, a skip mode, an intra block copy mode, or a palette mode. For example, the first prediction mode may be a merge mode, and the second prediction mode may be an intra prediction mode.

[0430] When a combined prediction mode that combines a merge mode and an intra prediction mode is used, a predicted block of a current block may be generated by weighted prediction of a first predicted block obtained based on motion information and a second predicted block obtained based on a predetermined intra prediction mode. The motion information of the current block may be derived from a merge candidate identified by an index merge_idx signaled by the bitstream. The intra prediction mode of the current block may be set to a predefined intra prediction mode. The predefined intra prediction mode may be planar, DC, horizontal, or vertical mode. Alternatively, the intra prediction mode of a neighboring block may be set to the intra prediction mode of the current block.

[0431] A flag indicating whether a joint prediction mode is applied to the current block may be signaled by the bitstream. As an example, the syntax ciip_flag may be signaled by the bitstream. A value of 1 for the syntax ciip_flag indicates that a joint prediction mode is applied to the current block. A value of 0 for the syntax ciip_flag indicates that a joint prediction mode is not applied to the current block. If a joint prediction mode is not applied to the current block, at least one of a merge offset coding method or a triangular partitioning method may be applied.

[0432]

[0433] A residual image can be derived by subtracting a predicted image from an original image. Here, when the residual image is converted into the frequency domain, removing high-frequency components from the frequency components does not significantly reduce the subjective image quality of the image. Therefore, by reducing the values of the high-frequency components or setting the values of the high-frequency components to 0, it is possible to improve compression efficiency without significantly generating visual distortion. Reflecting this characteristic, the current block can be transformed to decompose the residual image into two-dimensional frequency components. The transformation can be performed using a transform technique such as a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST).

[0434] DCT decomposes (or transforms) a residual image into two-dimensional frequency components using a cosine transform, while DST decomposes (or transforms) a residual image into two-dimensional frequency components using a sine transform. As a result of the residual image transformation, the frequency components can be expressed as a basis image. For example, when performing DCT transformation on an NxN size block, N 2 basic pattern components can be obtained. The size of each basic pattern component contained in an NxN sized block can be obtained by transformation. Depending on the transformation technique used, the size of the basic pattern component can be referred to as a DCT coefficient or a DST coefficient.

[0435] The DCT transform technique is mainly used to transform images with a large distribution of non-zero low-frequency components, while the DST transform technique is mainly used for images with a large distribution of high-frequency components.

[0436] Transformation techniques other than DCT or DST can also be used to transform the residual image.

[0437] Hereinafter, converting a residual image into two-dimensional frequency components is referred to as a two-dimensional image transform. Also, the size of a basic pattern component obtained as a transform result is referred to as a transform coefficient. For example, the transform coefficient may refer to a DCT coefficient or a DST coefficient. When a first transform and a second transform (to be described later) are both applied, the transform coefficient may refer to the size of a basic pattern component generated as a result of the second transform. Also, a residual sample to which a transform skip is applied is referred to as a transform coefficient.

[0438] The transform technique may be determined on a block-by-block basis. The transform technique may be determined based on at least one of the predictive coding mode of the current block, the size of the current block, or the shape of the current block. For example, if the current block is coded in an intra prediction mode and the size of the current block is smaller than NxN, the transform may be performed using the DST transform technique. On the other hand, if the above conditions are not met, the transform may be performed using the DCT transform technique.

[0439] 2D image transform may not be performed on some blocks of the residual image. Not performing 2D image transform is called a transform skip. Transform skip means that the first and second transforms are not applied to the current block. When transform skip is applied, quantization may be applied to residual values on which transform is not performed.

[0440] Whether to allow a transform skip for the current block may be determined based on at least one of the size and shape of the current block. For example, the transform skip may be applied only if the size of the current block is smaller than a threshold. The threshold relates to at least one of the width, height, or number of samples of the current block, and may be defined as 32x32, for example. Alternatively, the transform skip may be allowed only for square blocks. For example, the transform skip may be allowed for square blocks of 32x32, 16x16, 8x8, or 4x4 size. Alternatively, the transform skip may be allowed only if a sub-partition intra-coding method is not used.

[0441] Alternatively, if a sub-partition intra-coding method is applied to the current block, it may be determined whether to apply a transform skip to each sub-partition.

[0442] FIG. 30 is a diagram showing an example of determining whether to apply transform skip for each sub-block.

[0443] It is possible to apply transform skip to only some of the sub-blocks. For example, as shown in the example of Figure 30, it is possible to set the transform skip to be applied to the sub-blocks located at the top of the current block, and not to allow the transform skip to be applied to the sub-blocks located at the bottom.

[0444] The transform type of a sub-block that does not allow transform skipping can be determined based on information signaled by the bitstream, for example, tu_mts_idx, which will be described later.

[0445] Alternatively, the transform type of a sub-block may be determined based on the size of the sub-block. For example, the horizontal transform type may be determined based on whether the width of the sub-block is greater than or equal to a threshold and / or less than or equal to a threshold, and the vertical transform type may be determined based on whether the height of the sub-block is greater than or equal to a threshold and / or less than or equal to a threshold.

[0446] Alternatively, information for determining a transform type for a coding block may be signaled, and the transform type specified by the signal may be commonly applied to sub-blocks included in the coding block, i.e., the transform types of the sub-blocks within a coding block may be set to the same type.

[0447] After transforming the current block using the DCT or DST, the transformed current block may be further transformed, where the transformation based on the DCT or DST may be defined as a first transformation, and further transforming the block to which the first transformation has been applied may be defined as a second transformation.

[0448] The first transform may be performed using any one of a plurality of candidate transform cores, for example, DCT2, DCT8, or DST7.

[0449] Different transform cores may be used for the horizontal and vertical directions. Information indicating a combination of horizontal and vertical transform cores may be signaled by the bitstream. For example, the above-mentioned tu_mts_idx may indicate one of a combination of horizontal and vertical transform cores.

[0450] The first and second transforms may be performed in different units. For example, the first transform may be performed on an 8x8 block, and the second transform may be performed on a 4x4 sub-block within the transformed 8x8 block. Alternatively, the second transform may be performed on transform coefficients belonging to three 4x4 sub-blocks. The three sub-blocks may include a sub-block located at the top left corner of the current block, a sub-block adjacent to the right of the current block, and a sub-block adjacent to the bottom of the current block. Alternatively, the second transform may be performed on an 8x8 block.

[0451] The transform coefficients of the remaining area where the second transform is not performed may be set to zero.

[0452] Alternatively, a first transform can be performed on a 4x4 block, and a second transform can be performed on an 8x8 sized region containing the transformed 4x4 block.

[0453] Information indicating the transform type of the current block can be signaled by the bitstream, and the information can be index information tu_mts_idx indicating one of a combination of a transform type for the horizontal direction and a transform type for the vertical direction.

[0454] Based on the transform type candidates identified by the index information tu_mts_idx, the transform core for the vertical direction and the transform core for the horizontal direction can be determined. Table 7 shows the combinations of transform types according to tu_mts_idx.

[0455] [Table 7]

[0456] The transform type can be determined to be one of DCT2, DST7, or DCT8, or a transform skip can be inserted into the transform type candidates.

[0457] When Table 7 is used, if tu_mts_idx is 0, DCT2 can be applied horizontally and vertically. If tu_mts_idx is 2, DCT8 can be applied horizontally and DCT7 can be applied vertically.

[0458] When a sub-partition intra-coding method is applied, the transform cores of the sub-blocks can be determined independently. For example, information for identifying a candidate transform type combination for each sub-block can be coded and signaled. Therefore, the transform cores of the sub-blocks can be different from each other.

[0459] Alternatively, sub-blocks may use the same transform type. In this case, tu_mts_idx, which identifies a candidate transform type combination, may be signaled only for the first sub-block. Alternatively, tu_mts_idx may be signaled at the coding block level, and the transform type of a sub-block may be determined by referring to tu_mts_idx signaled at the coding block level. Alternatively, the transform type may be determined based on at least one of the size, shape, or intra-prediction mode of one of the sub-blocks, and the determined transform type may be set to be used for all sub-blocks.

[0460] FIG. 31 shows an example in which sub-blocks use the same transform type.

[0461] When a coding block is divided horizontally, the transform types of the top sub-block (Sub-CU0) and the bottom sub-block (Sub-CU1) of the coding block may be set to be the same. For example, as shown in (a) of Figure 31, if the horizontal and vertical transform types are determined based on tu_mts_idx signaled for the top sub-block, the determined transform type may also be applied to the bottom sub-block.

[0462] When a coding block is divided vertically, the transform types of the sub-block (Sub-CU0) located on the left side of the coding block and the sub-block (Sub-CU1) located on the right side of the coding block can be set to be the same. For example, as shown in (b) of Figure 31, if the horizontal type and vertical transform type are determined based on tu_mts_idx signaled for the left sub-block, the determined transform type can also be applied to the right sub-block.

[0463]

[0464] Whether to encode index information may be determined based on at least one of the size, shape, number of non-zero coefficients of the current block, whether a secondary transform is performed, or whether a sub-partition intra-coding method is applied. For example, if a sub-partition intra-coding method is applied to the current block or if the number of non-zero coefficients is equal to or less than a threshold, signaling of index information may be omitted. If signaling of index information is omitted, a default transform type may be applied to the current block.

[0465] The default transform type may include at least one of DCT2 or DST7. If there are multiple default transform types, one of the multiple default transform types may be selected taking into consideration at least one of the size, shape, intra prediction mode, whether a secondary transform is performed, or whether a sub-partition intra coding method is applicable to the current block. For example, one of the multiple transform types may be determined as a horizontal transform type based on whether the width of the current block falls within a predetermined range, and one of the multiple transform types may be determined as a vertical transform type based on whether the height of the current block falls within a predetermined range. Alternatively, the default mode may be determined differently depending on the size, shape, intra prediction mode, or whether a secondary transform is performed on the current block.

[0466] Alternatively, if only DC component transform coefficients exist in the current block, the horizontal transform type and the vertical transform type may be set to the default transform type. For example, if only DC component transform coefficients exist in the current block, the horizontal transform type and the vertical transform type may be set to DCT2.

[0467] The threshold may be determined based on the size or shape of the current block. For example, if the size of the current block is smaller than or equal to 32x32, the threshold may be set to 2, and if the current block is larger than 32x32 (e.g., if the current block is a coding block of 32x64 or 64x32 size), the threshold may be set to 4.

[0468] A plurality of lookup tables may be pre-stored in the encoder / decoder, and the plurality of lookup tables may differ in at least one of index values assigned to transform type combination candidates, types of transform type combination candidates, or the number of transform type combination candidates.

[0469] A lookup table for the current block may be selected based on at least one of the size, shape, predictive coding mode, intra prediction mode, whether or not secondary transform is applied to the current block, and whether or not transform skip is applied to the neighboring block.

[0470] As an example, if the size of the current block is 4x4 or less or if the current block is coded using inter prediction, a first lookup table can be used, and if the size of the current block is greater than 4x4 or if the current block is coded using intra prediction, a second lookup table can be used.

[0471] Alternatively, information indicating one of a plurality of lookup tables can be signaled via the bitstream, and the decoder can select the lookup table for the current block based on the information.

[0472] As another example, an index to be assigned to a candidate transform type combination may be adaptively determined based on at least one of the size, shape, predictive coding mode, intra prediction mode, whether or not a secondary transform is applied to the current block, or whether a transform skip is applied to a neighboring block. For example, if the size of the current block is 4×4, an index assigned to the transform skip may have a smaller value than an index assigned to the transform skip if the size of the current block is larger than 4×4. Specifically, if the size of the current block is 4×4, an index of 0 may be assigned to the transform skip, and if the size of the current block is larger than 4×4 but smaller than or equal to 16×16, an index greater than 0 (e.g., index 1) may be assigned to the transform skip. If the current block is larger than 16×16, a maximum value (e.g., 5) may be assigned to the transform skip index.

[0473] Alternatively, if the current block is coded using inter prediction, the transform skip may be assigned an index of 0. If the current block is coded using intra prediction, the transform skip may be assigned an index greater than 0 (e.g., index 1).

[0474] Alternatively, if the current block is a 4x4 block coded using inter prediction, the transform skip may be assigned an index of 0. On the other hand, if the current block is not coded using inter prediction or is larger than 4x4, the transform skip may be assigned an index of a value larger than 0 (e.g., index 1).

[0475] It is also possible to define and use transform type combination candidates different from the transform type combination candidates listed in Table 7. As an example, a transform type combination candidate can be used in which a transform skip is applied to either a horizontal transform or a vertical transform, and a transform core such as DCT2, DCT8, or DST7 is applied to the other. Here, it is possible to determine whether to use transform skip as a transform type candidate for the horizontal or vertical direction based on at least one of the size (e.g., width and / or height), shape, predictive coding mode, or intra prediction mode of the current block.

[0476]

[0477] Information indicating whether index information for determining the transform type of the current block is explicitly signaled may be signaled by a bitstream. For example, at the sequence level, information sps_explicit_intra_mts_flag indicating whether explicit determination of the transform type is allowed for a block coded using intra prediction and / or information sps_explicit_inter_mts_flag indicating whether explicit determination of the transform type is allowed for a block coded using inter prediction may be signaled.

[0478] If explicit determination of the transform type is permitted, the transform type of the current block may be determined based on index information tu_mts_idx signaled by the bitstream. On the other hand, if explicit determination of the transform type is not permitted, the transform type may be determined based on at least one of the size and shape of the current block, whether sub-block-based transforms are permitted, the position of sub-blocks including non-zero transform coefficients, whether a second transform is performed, and whether a sub-partition intra-coding method is applicable. For example, the horizontal transform type of the current block may be determined based on the width of the current block, and the vertical transform type of the current block may be determined based on the height of the current block. For example, if the width of the current block is less than 4 or greater than 16, the horizontal transform type may be determined to be DCT2. Otherwise, the horizontal transform type may be determined to be DST7. If the height of the current block is less than 4 or greater than 16, the vertical transform type may be determined to be DCT2. Otherwise, the vertical transform type may be determined to be DST7. Here, the thresholds to be compared with the width and height to determine the horizontal transformation type and the vertical transformation type may be determined based on at least one of the size, shape, or intra prediction mode of the current block.

[0479] Alternatively, if the current block is a square with the same height and width, the horizontal and vertical transformation types can be set to the same, whereas if the current block is a non-square with different heights and widths, the horizontal and vertical transformation types can be set to different. For example, if the width of the current block is greater than the height, the horizontal transformation type can be determined to be DST7 and the vertical transformation type can be determined to be DCT2. If the height of the current block is greater than the width, the vertical transformation type can be determined to be DST7 and the horizontal transformation type can be determined to be DCT2.

[0480] The number and / or types of candidate transform types or candidate transform type combinations may differ depending on whether explicit transform type determination is permitted. As an example, if explicit transform type determination is permitted, DCT2, DST7, and DCT8 may be used as candidate transform types. This allows the horizontal transform type and the vertical transform type to be set to DCT2, DST8, or DCT8, respectively. If explicit transform type determination is not permitted, only DCT2 and DST7 may be used as candidate transform types. This allows the horizontal transform type and the vertical transform type to be set to DCT2 or DST7, respectively.

[0481]

[0482] A coding block or a transform block can be divided into a plurality of sub-blocks, and transforms can be performed on only some of the sub-blocks. Applying transforms to only some of the sub-blocks can be defined as a sub-transform block coding method.

[0483] 32 and 33 are diagrams showing application aspects of the sub-transform block coding method.

[0484] Figure 32 shows an example of performing transformation on only one of four sub-blocks, and Figure 33 shows an example of performing transformation on only one of two sub-blocks. In Figures 32 and 33, it is assumed that transformation is performed on only the sub-block marked 'Target'.

[0485] As shown in the example of Figure 32, a coding block is divided into four sub-blocks using mutually orthogonal vertical and horizontal lines, and then transformation and quantization can be performed on only one of the four sub-blocks. The transform coefficients of the sub-blocks that are not transformed can be set to 0.

[0486] Alternatively, as shown in the example of Figure 33, a coding block may be divided into two sub-blocks using a vertical or horizontal line, and then transformation and quantization may be performed on only one of the sub-blocks. The transform coefficients of the sub-block that is not transformed may be set to 0.

[0487] Information indicating whether a sub-transform block coding method is applied to a coding block can be signaled by a bitstream. The information can be a 1-bit flag cu_sbt_flag. When the flag is 1, it indicates that transformation is performed on only some of the sub-blocks generated by dividing a coding block or a transform block, and when the flag is 0, it indicates that transformation is performed on the coding block or the transform block without dividing it into sub-blocks.

[0488] Whether a sub-transform block coding method can be used for a coding block may be determined based on at least one of the size, shape, and availability of a predictive coding mode or a joint prediction mode of the coding block. For example, if at least one of the width or height of the coding block is equal to or greater than a threshold, if inter prediction is applied to the coding block, or if joint prediction mode is not applied to the coding block, the sub-transform block coding method may be used for the coding block. Here, the threshold may be a natural number such as 4, 8, or 16.

[0489] Alternatively, the sub-transform block coding method can be disallowed if the ratio of the width and height of the coding block is greater than a threshold.

[0490] If intra prediction or intra block copy mode is applied to the coding block, it may be determined that the sub-transform block coding method cannot be used.

[0491] Alternatively, it may be determined whether a sub-transform block coding method can be used for a coding block based on whether a sub-partition intra-coding method has been applied to the coding block. For example, if a sub-partition intra-coding method has been applied to the coding block, it may be determined that a sub-transform block coding method can be used.

[0492] If it is determined that a sub-transform block coding method can be used for a coding block, the syntax cu_sbt_flag can be signaled by the bitstream. Whether or not the sub-transform block coding method can be applied can be determined depending on the value of the parsed cu_sbt_flag.

[0493] On the other hand, if it is determined that the sub-transform coding method cannot be used for the coding block, the signaling of the syntax cu_sbt_flag can be omitted. If the signaling of the syntax cu_sbt_flag is omitted, it can be determined that the sub-transform block coding method is not applied to the coding block.

[0494]

[0495] When a sub-transform coding method is applied to a coding block, information indicating a division form of the coding block may be signaled by a bitstream. The information indicating the division form of the coding block may include at least one of information indicating whether the coding block is divided to include quarter-sized sub-blocks, information indicating a division direction of the coding block, or information indicating the number of sub-blocks.

[0496] As an example, when the syntax cu_sbt_flag is 1, a flag cu_sbt_quadtree_flag indicating whether the coding block is partitioned to include quarter-sized sub-blocks can be signaled.

[0497] The syntax element cu_sbt_quadtree_flag set to 1 indicates that the coding block is divided to include quarter-sized sub-blocks. For example, using one vertical or horizontal line, the coding block can be divided into a sub-block whose width is 1 / 4 of the coding block width and a sub-block whose height is 3 / 4 of the coding block width, or into a sub-block whose height is 1 / 4 of the coding block height and a sub-block whose height is 3 / 4 of the coding block height. Alternatively, the coding block can be divided to include sub-blocks whose width and height are half the width and height of the coding block, respectively. The division of the coding block to include quarter-sized sub-blocks is referred to as quad-type division. When the syntax element cu_sbt_quad_tree_flag set to 1, sub-blocks whose size is 1 / 4 of the coding block width can be set as the transformation target.

[0498] When the syntax cu_sbt_quadtree_flag is 0, it indicates that the coding block is divided to include half-sized sub-blocks. For example, a coding block can be divided into two half-sized sub-blocks using one vertical line or one horizontal line. Dividing a coding block into two half-sized sub-blocks is referred to as binary-type division. When the syntax cu_sbt_quad_tree_flag is 0, sub-blocks that are half the size of the coding block can be included in the coding block.

[0499] Furthermore, a flag indicating the division direction of a coding block can be signaled by the bitstream. As an example, a flag cu_sbt_horizontal_flag indicating whether horizontal partitioning is applied to a coding block can be coded and signaled. A value of 1 for cu_sbt_horizontal_flag indicates that horizontal partitioning using at least one division line parallel to the top and bottom edges of the coding block is applied. A value of 0 for cu_sbt_horizontal_flag indicates that vertical partitioning using at least one division line parallel to the left and right edges of the coding block is applied.

[0500] The division type of the coding block can be determined depending on the size or shape of the coding block. For example, quad-type division can be used when at least one of the width or height of the coding block is equal to or greater than a first threshold. For example, the first threshold can be a natural number such as 4, 8, or 16. The first threshold can also be referred to as a quad-type threshold.

[0501] If it is determined that quad-type partitioning can be used, the syntax cu_sbt_quadtree_flag can be signaled by the bitstream. The parsed value of cu_sbt_quadtree_flag can determine whether quad-type partitioning is applied to the coding block.

[0502] If it is determined that quad-type partitioning cannot be used, the signaling of the syntax cu_sbt_quadtree_flag can be omitted. If the signaling of the syntax cu_sbt_quadtree_flag is omitted, it can be decided to apply binary-type partitioning to the coding block.

[0503] Table 8 shows an example of a syntax structure for determining whether or not the syntax cu_sbt_quadtree_flag can be parsed.

[0504] [Table 8]

[0505] In Table 8, the variable allowSbtVerQ indicates whether vertical quad-type division is allowed, and the variable allowSbtHorQ indicates whether horizontal quad-type division is allowed. The variables allowSbtVerQ and allowSbtHorQ may be determined based on the quad-type threshold value. For example, if the quad-type threshold value is 16, allowSbtVerQ may be determined based on whether the width of the coding block is 16 or more, and allowSbtHorQ may be determined based on whether the height of the coding block is 16 or more.

[0506] As shown in the example of Table 8, when the variables allowSbtVerQ and allowSbtHorQ are both true, the syntax cu_sbt_quad_flag can be parsed by the bitstream. As an example, when the coding block is 16x8, the variable allowSbtHorQ is set to false, so parsing of the syntax cu_sbt_quad_flag can be omitted. Alternatively, when the coding block is 8x16, the variable allowSbtVerQ is set to false, so parsing of the syntax cu_sbt_quad_flag can be omitted. When parsing of the syntax cu_sbt_quad_flag is omitted, binary type division can be applied to the coding block.

[0507] Alternatively, unlike the example shown in Table 8, if either the variable allowSbtVerQ or the variable allowSbtHorQ is true, the syntax cu_sbt_quad_flag can be set to be parsed. That is, if only one of the width and height of the coding block is equal to or greater than the quad-type threshold, quad-type division can be used.

[0508] Alternatively, even if either the width or height of the coding block is equal to or greater than a first threshold, if the other of the width or height of the coding block is equal to or less than a second threshold, it may be determined that quad-type partitioning of the coding block cannot be used. Here, the second threshold may have a value smaller than the first threshold. For example, the second threshold may be a natural number such as 2, 4, or 8.

[0509] The variable allowSbtHorH indicates whether horizontal binary type partitioning can be used. Horizontal binary type partitioning can be set to be used when the height of the coding block is equal to or greater than a threshold. The variable allowSbtVerH indicates whether vertical binary type partitioning can be used. Vertical binary type partitioning can be set to be used when the width of the coding block is equal to or greater than a threshold. Here, the threshold can be a natural number such as 4, 8, or 16.

[0510] When both horizontal quad / binary type partitioning and vertical quad / binary type partitioning can be used, the syntax cu_sbt_horizontal_flag can be signaled by the bitstream. Depending on the value of the syntax cu_sbt_horizontal_flag, horizontal or vertical partitioning can be applied to the coding block.

[0511] On the other hand, if only one of horizontal quad / binary type partitioning and vertical quad / binary type partitioning can be used, the signaling of the syntax cu_sbt_horizontal_flag can be omitted. If the signaling of the syntax cu_sbt_horizontal_flag is omitted, a case in which coding blocks can be used in horizontal quad / binary type partitioning and vertical quad / binary type partitioning can be applied.

[0512] If horizontal binary type division or vertical binary type division cannot be used, the signaling of the syntax cu_sbt_horizontal_flag can be omitted.

[0513] If the signaling of the syntax cu_sbt_horizontal_flag is omitted and the variable allowSbtHorH is true, horizontal binary type splitting can be applied to the coding block.

[0514] If the signaling of the syntax cu_sbt_horizontal_flag is omitted and the variable allowSbtVerH is true, vertical binary type splitting can be applied to the coding block.

[0515] Information for identifying a sub-block to be transformed among multiple sub-blocks can be signaled by the bitstream. As an example, the syntax cu_sbt_pos_flag can be signaled by the bitstream. The syntax cu_sbt_pos_flag indicates whether the transformation target is the first sub-block in a coding block. As an example, when horizontal quad / binary type partitioning is applied to a coding block, if cu_sbt_flag is 1, the outermost sub-block is determined to be the transformation target, and if cu_sbt_flag is 0, the rightmost sub-block is determined to be the transformation target. When vertical quad / binary type partitioning is applied to a coding block, if cu_sbt_pos_flag is 1, the topmost sub-block is determined to be the transformation target, and if cu_sbt_pos_flag is 0, the bottommost sub-block is determined to be the transformation target.

[0516] The transform type of a sub-block may be determined taking into consideration the division direction of the coding block and the position of the sub-block. For example, if a coding block is divided vertically and a transform is performed on a sub-block located on the left side of the coding block, the horizontal transform type and the vertical transform type may be set to be different from each other.

[0517] 34 and 35 are diagrams showing horizontal direction transformation types and vertical direction transformation types depending on the position of the sub-block to be transformed.

[0518] In the example shown in Figure 34, if the sub-block to be transformed includes the top left sample or the bottom right sample of the coding block, the horizontal transform type and the vertical transform type may be set to the same. As an example, in the example shown in Figure 34, if the sub-block to be transformed includes the top left sample of the coding block, the horizontal transform type and the vertical transform type are set to DCT8, and if the sub-block to be transformed includes the bottom right sample of the coding block, the horizontal transform type and the vertical transform type are set to DST7.

[0519] When a sub-block to be transformed includes the top right sample or the bottom left sample of a coding block, the horizontal transform type and the vertical transform type may be set to be different from each other. For example, in the example shown in Figure 34, when a sub-block to be transformed includes the top right sample of a coding block, the horizontal transform type is set to DST7 and the vertical transform type is set to DCT8. When a sub-block to be transformed includes the bottom left sample of a coding block, the horizontal transform type is set to DCT8 and the vertical transform type is set to DST7.

[0520] Unlike the example shown in Figure 34, when a sub-block including the top left sample or a sub-block including the bottom right sample in a coding block is determined to be the transformation target, the horizontal transform type and the vertical transform type can be set to be different from each other, and when a sub-block including the top right sample or a sub-block including the bottom left sample in a coding block is determined to be the transformation target, the horizontal transform type and the vertical transform type can be set to be the same.

[0521] 34 illustrates an example in which a sub-block whose height and width are half that of a coding block is set as a transformation target. Unlike the illustrated example, a sub-block whose width is the same as that of the coding block but whose height is 1 / 4, or a sub-block whose height is the same as that of the coding block but whose width is 1 / 4, can also be set as a transformation target.

[0522] In the example shown in Figure 35, if the sub-block to be transformed includes the top left sample of the coding block, the horizontal transform type and the vertical transform type may be set to be different from each other. For example, in the example shown in Figure 35, if horizontal binary type partitioning is applied and the top sub-block is selected as the transform target, the horizontal transform type may be set to DST7 and the vertical transform type may be set to DCT7. If vertical binary type partitioning is applied and the left sub-block is selected as the transform target, the horizontal transform type may be set to DCT8 and the vertical transform type may be set to DST7.

[0523] Unlike the example shown in Figure 35, if the sub-block to be transformed includes the top left sample of the coding block, the horizontal transform type and the vertical transform type can be set to be the same, and if the sub-block to be transformed includes the bottom right sample of the coding block, the horizontal transform type and the vertical transform type can be set to be different from each other.

[0524] When the sub-block to be transformed includes the bottom right sample of the coding block, the horizontal transform type and the vertical transform type may be set to the same. For example, in the example shown in FIG. 35, when horizontal binary type partitioning is applied and the bottom sub-block is selected as the transform target, the horizontal transform type and the vertical transform type may be set to DST7. When vertical binary type partitioning is applied and the right sub-block is selected as the transform target, the horizontal transform type and the vertical transform type may be set to DST7.

[0525] As in the above example, whether the horizontal transform type and the vertical transform type are set to be the same can be determined depending on the position of the sub-block to be transformed within the coding block. Also, the horizontal transform type and the vertical transform type can be determined depending on the position of the sub-block to be transformed within the coding block.

[0526]

[0527] For sub-blocks, coding of information indicating whether a non-zero coefficient exists, for example, CBF, may be omitted. If CBF coding is omitted, it may be determined whether each sub-block includes a non-zero residual coefficient, taking into account the position of the block on which transformation is performed. For example, if a sub-block located on the right or bottom end of a coding block to which binary type division is applied is determined as a transformation target, the CBF value for the sub-block located on the left or top end may be induced to 0, and the CBF value for the sub-block located on the right or bottom end may be induced to 1. Alternatively, if a sub-block located on the left or bottom end of a coding block to which binary type division is applied is determined as a transformation target, the CBF value for the sub-block located on the left or top end may be induced to 1, and the CBF value for the sub-block located on the right or bottom end may be induced to 0.

[0528]

[0529] A second transformation may be performed on the block on which the first transformation has been performed, and the second transformation may be performed on the upper left corner of the transformation block on which the first transformation has been applied.

[0530] When the residual coefficients on which the first transform and the second transform have been performed are coded, the decoder can perform a second inverse transform, which is the inverse transform of the second transform, on the transform block, and can perform a first inverse transform, which is the inverse transform of the first transform, on the transform block on which the second inverse transform has been performed.

[0531] Whether the second transform is applied to the current block may be determined based on at least one of the size of the current block, the number of residual coefficients, the coding mode, the intra prediction mode, or whether a sub-partition intra coding method is applied. The encoder may encode and signal information indicating whether the second transform is applied to the decoder. Alternatively, the encoder and decoder may determine whether to perform the second transform based on the same condition.

[0532] For example, information indicating whether the second transformation is performed may be signaled by the bitstream. Specifically, a flag indicating whether the second transformation is performed or index information indicating whether the second transformation is performed and identifying a transformation kernel used for the second transformation may be signaled.

[0533] Table 9 shows an example of signaling the flag lfnst_flag, which indicates whether the second transformation is performed, by the bitstream. If the value of the flag lfnst_flag is 0, it indicates that the second transformation is not performed on the current block. On the other hand, if the value of the flag lfnst_flag is 1, it indicates that the second transformation is performed on the current block.

[0534] [Table 9]

[0535] Alternatively, the syntax lfnst_idx can be signaled by the bitstream. The index lfnst_idx equal to 0 indicates that the second transform is not performed on the current block. On the other hand, the index lfnst_idx equal to greater than 0 indicates that the second transform is performed on the current block. If the value of the index lfnst_idx is greater than 0, it can be used to identify a transform kernel for performing the second transform.

[0536] Alternatively, the second conversion may be performed by comparing at least one of the width and height of the current block with a threshold value. For example, if the minimum value of the width and height of the current block is smaller than the threshold value, the second conversion may not be performed. Here, the threshold value may be a natural number such as 4, 8, or 16.

[0537] Alternatively, if the current block is coded using inter prediction, the second transform may not be applied.

[0538] Alternatively, even if the current block is coded by intra prediction, if intra prediction based on a matrix is performed, the second transform may not be applied.

[0539] Alternatively, whether or not to perform the second transform may be determined based on whether the horizontal transform core and the vertical transform core are the same. For example, the second transform may be performed only if the horizontal transform core and the vertical transform core are the same. Alternatively, the second transform may be performed only if the horizontal transform core and the vertical transform core are different.

[0540] Alternatively, the second transform may be allowed only if the horizontal and vertical transforms use predefined transform cores. For example, the second transform may be allowed if the horizontal and vertical transforms use DCT2 transform cores.

[0541] Alternatively, if the sub-partition intra coding method is applied to the current block, the second transform may be allowed only if the DCT2 transform core is used for the horizontal transform and the vertical transform.

[0542] Alternatively, whether to perform the second transform may be determined based on the number of non-zero transform coefficients of the current block. For example, if the number of non-zero transform coefficients of the current block is less than or equal to a threshold, the second transform may be set not to be used, and if the number of non-zero transform coefficients of the current block is greater than the threshold, the second transform may be set to be used. The second transform may also be set to be used only if the current block is coded using intra prediction.

[0543] Alternatively, whether to perform the second transform may be determined based on the position of the last non-zero transform coefficient of the current block. For example, if at least one of the x-axis coordinate or y-axis coordinate of the last non-zero transform coefficient of the current block is greater than a threshold, or if at least one of the x-axis coordinate or y-axis coordinate of the sub-block to which the last non-zero transform coefficient of the current block belongs is greater than a threshold, the second transform may not be performed. Here, the threshold may be predefined in the encoder and decoder. Alternatively, the threshold may be determined based on the size or shape of the current block.

[0544] Alternatively, if only DC component transform coefficients exist in the current block, the second transform may be set not to be performed, where the DC component represents the transform coefficient at the top left corner of the current block.

[0545] Whether to perform the second transformation may be determined based on whether a joint predictive coding mode is applied to the current block. For example, if a joint predictive coding mode is applied to the current block, the second transformation may be set not to be performed.

[0546] Alternatively, when a joint prediction coding mode is applied, it may be determined whether to perform the second transformation based on at least one of the size, shape, intra prediction mode, and weight of the current block.

[0547] Alternatively, when the joint predictive coding mode is applied, information indicating whether to perform the second transform on the current block may be set to be signaled. For example, when the joint predictive coding mode is applied to the current block, the index lfnst_idx may be signaled.

[0548] Alternatively, it may be determined whether to perform the second conversion regardless of whether the joint predictive coding mode is applied.

[0549] Alternatively, whether or not the second transform is permissible may be determined based on whether a sub-partition intra-coding method is applied to the current block. For example, if a sub-partition intra-coding method is applied to the current block, it may be set not to apply the second transform to the current block.

[0550] Alternatively, if a sub-partition intra-coding method is applied to the current block, it may be configured to apply the second transform. For example, if vertical partitioning or horizontal partitioning is applied to the current block, index information indicating whether the second transform is applied to the current block may be signaled. Whether the second transform is applied and / or the transform kernel may be determined based on the index information. Meanwhile, if the sub-partition intra-coding method is not applied to the current block, coding of the index information may be omitted. Alternatively, if the sub-partition intra-coding method is not applied to the current block, whether to code the index information indicating whether the second transform is applied may be determined based on whether a pre-defined condition is satisfied. Here, the pre-defined condition may be related to at least one of the position of the non-zero coefficients, the number of non-zero coefficients, or the size of the current block. For example, if the number of non-zero coefficients is one or more, if there is one non-zero coefficient but it is not included in the upper left 4x4 region of the current block, or if the scan order of the non-zero coefficients that are not included in the 4x4 region of the current block is equal to or less than a threshold, the index information may be coded and signaled. In the opposite case, the encoding of the index information can be omitted.

[0551] If the index information is not signaled, the value of the index information may be set to indicate that the second transformation is not applied.

[0552] Alternatively, whether to apply the second transform may be determined based on at least one of the size, width, height, or shape of the sub-block. For example, if at least one of the size, width, or height of the sub-block is smaller than a threshold, the second transform may not be applied. Specifically, if at least one of the size, width, or height of the sub-block is smaller than a threshold, coding of the index information may be omitted. Information indicating whether to perform the second transform may be signaled at the coding block level. Whether to apply the second transform to sub-blocks belonging to the coding block may be determined based on the information signaled at the coding block level.

[0553] The threshold may have a value predefined in the encoder and decoder. For example, the threshold may be set to 2, 4, or 8. Alternatively, the threshold may be determined based on at least one of the division direction of the current block or the number of sub-blocks included in the current block.

[0554] Alternatively, the current block-related parameters for determining whether the second transform is applicable may be used to determine whether the syntax indicating whether the second transform is applicable is coded.

[0555] For example, if at least one of the size of the current block, the number of residual coefficients, the coding mode, the intra prediction mode, or the applicability of the sub-partition intra coding method does not satisfy a preset condition, coding of the syntax indicating whether the second transform is applicable may be omitted. For example, coding of lfnst_flag or lfnst_idx may be omitted and its value may be set to 0. In other words, if coding of the syntax is omitted, the second transform may not be applied.

[0556] If intra-BDPCM is applied to the current block, the second transform may not be performed. If intra-BDPCM is applied to the current block, signaling of the syntax element indicating whether the second transform has been performed may be omitted and its value may be set to 0. Table 10 shows an example of omitting signaling of lfnst_idx for a block to which intra-BDPCM is applied.

[0557] [Table 10]

[0558] Alternatively, if intra-BDPCM is applied to the current block, signaling of a syntax element indicating whether transform skipping has been performed, such as transform_skip_flag, can be omitted. If intra-BDPCM is applied to the current block, signaling of the flag transform_skip_flag can be omitted and its value can be set to 1. In other words, if intra-BDPCM is applied, no transform can be applied to the current block.

[0559] If it is determined that no transform is applied to the current block, neither the first nor the second transform may be applied. Thus, if the transform of the current block is skipped, signaling of the syntax element indicating whether the second transform has been performed may be omitted, and its value may be set to 0. Finally, if intra-BDPCM is applied to the current block, signaling of the syntax element lfnst_idx indicating whether the second transform has been performed may be omitted.

[0560] Based on the above description, the method for performing the second transform in the encoder and decoder will now be described in detail.

[0561] The second transformation can be performed on the upper left corner of the current block. The area to which the second transformation is applied can have a predefined size or shape. The area to which the second transformation is applied can have a square block shape such as 4x4 or 8x8, or a non-square block shape such as 4x8 or 8x4.

[0562] Alternatively, when the current block is equally divided into N regions, at least one of the N regions can be set as the target region, where N can be a natural number such as 2, 4, 8, or 16. The variable N can be predefined in the encoder and decoder, or can be determined based on the size and / or shape of the current block.

[0563] Alternatively, the application target region can be determined based on the number of transform coefficients. For example, a predetermined number of transform coefficients can be determined as the application target region according to a predetermined scan order.

[0564] Alternatively, information for specifying the size and / or shape of the target area may be coded and transmitted in a bitstream, and the coded information may include at least one of information indicating the size of the target area or information indicating the number of 4x4 blocks included in the target area.

[0565] Alternatively, the entire current block can be set as the target area for the second transformation. For example, if the size of the current block is the same as the minimum size of the target area (e.g., 4x4), the entire current block can be set as the target area for the second transformation.

[0566] The second transform can be applied to a non-separable form, which is why the second transform can also be called a non-separable secondary transform (NSST).

[0567] The transform coefficients in the region to which the second transform is applied may be arranged in a row. For example, when the second transform is performed on an application region of size N×N, the transform coefficients included in the application region may be arranged in a row. 2 The transform coefficients in the target area can be converted into a 16x1 input matrix. If a 4x4 block is set as the target area, the transform coefficients in the target area can be converted into a 16x1 input matrix. If an 8x8 block is set as the target area, the transform coefficients in the target area can be converted into a 64x1 input matrix.

[0568] A non-separable transformation matrix may be applied to an input matrix generated by arranging transformation coefficients included in an application target region in a row. The size of the non-separable transformation matrix may be determined to vary depending on the size of the input matrix.

[0569] As an example, if the input matrix is of size N 2 ×1, N 2 ×N 2 The second transform can be performed based on a non-separable transform matrix of a certain size, for example, if the input matrix is 16x1, a non-separable transform matrix of 16x16 size can be used, and if the input matrix is 64x1, a non-separable transform matrix of 64x64 size can be used.

[0570] A plurality of non-separable transform matrices may be stored in the encoder and decoder, and information for identifying one of the plurality of non-separable transform matrices may be signaled by the bitstream.

[0571] Alternatively, the non-separable transform matrix may be identified based on at least one of the size, shape, quantization parameter, intra prediction mode, or transform type used in the first transform of the current block.

[0572] Alternatively, a non-separable transform matrix candidate that can be used by the current block may be identified based on at least one of the size, shape, quantization parameter, intra prediction mode, or transform type used in the first transform of the current block. If there are multiple non-separable transform matrix candidates that can be used by the current block, information indicating one of the multiple non-separable transform matrix candidates may be coded and signaled.

[0573] The transformation matrix can be obtained by multiplying the non-separable transformation matrix and the input matrix. As an example, Equation 6 shows an example of obtaining the transformation matrix A'.

[0574]

number

[0575] In the above formula 6, T represents a non-separable transformation matrix, and A represents an input matrix. 2 ×N 2 and the size of matrix A is N 2 ×1, N 2 For example, if a 16x1 input matrix and a 16x16 non-separable transform matrix are used, a 16x1 transform matrix A' can be obtained. Alternatively, if a 64x1 input matrix and a 64x64 non-separable transform matrix are used, a 64x1 transform matrix A' can be obtained.

[0576] Once the transformation matrix A' is obtained, the components of the transformation matrix A' can be set to the transformation coefficients of an NxN block in the current block. The transformation coefficients in the remaining areas excluding the NxN block can be set to default values. For example, the transformation coefficients of areas where the second transformation is not performed can be set to 0.

[0577] The second transform can also be performed using a non-separable transform matrix with the number of rows less than the number of columns. 2×1) size input matrix A to (k×N 2 ) size non-separable transformation matrix, where k is N 2 In one example, k can have a value smaller than N 2 / 2, N 2 / 4 or 3N 2 / 4, etc. k can be said to be a reduction factor.

[0578] As a result, a transformation matrix smaller in size (k × 1) than the input matrix can be obtained. In this way, the secondary transform that outputs a transformation matrix smaller in size than the input matrix can also be called a reduced secondary transform.

[0579] Equation 7 shows an example of the application of the reduced second transformation.

[0580]

number

[0581] In Equation 7, R is k×N 2 Denote a non-separable transformation matrix of size k where k is the number of rows and N is the number of columns. 2 It can be said to be a non-separable transformation matrix that is a reduction of a smaller non-separable transformation matrix. A R indicates a transformation matrix of size k × 1. A transformation matrix A has a size smaller than the input matrix A. R can also be said to be a reduced transformation matrix.

[0582] Reduced transformation matrix A R Once obtained, the reduced transformation matrix A R The components in may be set to the transform coefficients of at least one M×M block in the current block, where M may be a natural number less than N. The number of M×M blocks may be determined by a reduction factor k. The transform coefficients of the remaining region excluding at least one M×M block may be set to default values. For example, the transform coefficients of the remaining region may be set to 0.

[0583] FIG. 36 shows how transform coefficients are coded when the reduction factor is 16.

[0584] The transform coefficients included in the 8x8 target area are transformed into a 64x1 input matrix, and a 16x1 transform matrix can be obtained using a 16x64 non-separable transform matrix.

[0585] A 16x1 size transformation matrix can be set to the transformation coefficients of a 4x4 block, and the transformation coefficients of other areas can be set to 0.

[0586] Although not shown, when the reduction factor k is 32, a 32×1 size transformation matrix can be set to the transformation coefficients of an 8×4 block or a 4×8 block, and the transformation coefficients of other areas can be set to 0.

[0587] When the reduction factor k is 48, a 48×1 size transformation matrix may be set as the transformation coefficients of three 4×4 blocks, and the transformation coefficients of other areas may be set to 0. Specifically, the transformation matrix may be set as the transformation coefficients of the 4×4 block located at the top left corner of the current block, the 4×4 block adjacent to the right of the top left block, and the 4×4 block adjacent to the bottom of the top left block.

[0588] The transformation matrix may be determined based on at least one of the size, shape, and intra-prediction mode of the current block. For example, a transformation matrix set may be determined based on the intra-prediction mode of the current block, and one may be selected from a plurality of transformation matrix candidates included in the transformation matrix set. Index information identifying the transformation matrix applied to the current block from the plurality of transformation matrix candidates may be coded and signaled.

[0589] If the residual transform coefficients excluding the transform coefficients generated by the second transform are set to 0, the decoder may determine whether the second transform has been performed based on the position of the last non-zero residual coefficient. For example, if the position of the last residual coefficient is located outside the block in which the transform coefficients generated by the second transform are stored, it may be determined that the second transform has not been performed. That is, the decoder may perform an inverse transform for the second transform only if the last residual coefficient is located within the block in which the transform coefficients generated by the second transform are stored.

[0590] Whether to perform the second downscaling transformation may be determined based on at least one of the size or shape of the current block. For example, if at least one of the width or height of the current block is greater than a threshold, the second downscaling transformation may be applied, and if not, the general second transformation may be applied. Here, the threshold may be a natural number such as 4, 8, or 16.

[0591] Alternatively, it may be determined whether to perform a reduced second transformation depending on the size of the target area. For example, when performing the second transformation on a 4x4 target area, a general second transformation may be applied. For example, when performing the second transformation on a 4x4 target area, a 16x16 non-separable transformation matrix may be used to perform the second transformation.

[0592] Meanwhile, when the second transform is performed on an application area of 8x8 size, a reduced second transform can be applied. For example, for an application area of 8x8 size, the second transform can be performed using a non-separable transform matrix of 48x64, 32x64, or 16x64 size.

[0593] When performing an inverse transform on the reduced second transform, the output matrix has a larger value than the input matrix. For example, if the reduction factor k is 16, an inverse transform on a 16x1 input matrix can be performed to obtain a 64x1 output matrix.

[0594] When a sub-partition intra-coding method is applied to a coding block, the coding block may be divided into a plurality of sub-blocks. When a sub-partition intra-coding method is applied to a coding block, it may be set so that the second transform is not applied.

[0595] Alternatively, whether to perform the second transform may be determined based on the shape or size of the subpartitions. For example, if a coding block is divided into subpartitions with a width or height of 4, the second transform may be applied. That is, the second transform may be applied only if the subpartitions have a 4×L or L×4 shape, where L is an integer equal to or greater than 4.

[0596] Alternatively, the second transformation can be applied only if the minimum of the width and height of the subpartition is greater than or equal to a predefined threshold, where the threshold can be an integer such as 4, 8, or 16.

[0597] As in the above example, if the type or size of a sub-partition satisfies a predefined condition, information indicating whether the second transformation is applicable can be signaled by the bitstream. For example, if the sub-partition is 4×L or L×4, or if the minimum value of the width and height of the sub-partition is equal to or greater than a threshold, the syntax lfnst_idx indicating whether the second transformation is applicable can be signaled.

[0598] On the other hand, if the shape or size of the subpartition does not satisfy the predefined conditions, encoding / decoding of the information indicating whether the second transformation is applicable can be omitted. For example, if the minimum value of the width and height of the subpartition is smaller than a threshold, encoding / decoding of the syntax lfnst_idx can be omitted. When encoding / decoding of the syntax lfnst_idx is omitted, its value can be set to 0.

[0599] If it is determined that the second transform is to be applied, the second transform may be applied to a subblock at a predetermined position within the coding block or to a subblock whose partition index is less than a threshold. Here, the partition index of the left subblock may be set to be less than the partition index of the right subblock, or the partition index of the top subblock may be set to be less than the partition index of the bottom subblock. For example, the second transform may be applied only to the first subblock within the coding block.

[0600] Alternatively, the second transform can be applied to each of all the sub-blocks.

[0601] Alternatively, if it is determined that the second transform is to be performed at the coding block level, it may be adaptively determined whether the second transform is to be applied to each sub-block based on the attributes of each sub-block, where the attributes of the sub-block may include at least one of the number of residual coefficients included in the sub-block, whether a transform skip is applied to the sub-block, and the transform core applied to the sub-block.

[0602] The size of the application area of the second transform can be determined based on the size of the sub-block. For example, a 4×4 block containing 16 samples, two 4×4 blocks containing 32 samples, three 4×4 blocks containing 48 samples, or four 4×4 blocks containing 64 samples can be set as the application area of the second transform. Depending on the size of the application area, a general second transform or a reduced second transform can be applied.

[0603] The size of the region to which the second transform is applied may be determined based on the size of the subblock. For example, if at least one of the width or height of the subblock is smaller than a threshold, a region including N samples may be set as the region to which the second transform is applied. On the other hand, if the width and height of the subblock are equal to or greater than the threshold, a region including M samples may be set as the region to which the second transform is applied. Here, M may be a natural number greater than N. For example, N may be 16 or 32, and M may be 48 or 64. The threshold may also be a natural number such as 2, 4, 8, or 16.

[0604] The second transform application area may be set so as not to exceed the boundaries of the sub-blocks, i.e., if the second transform application area spans two or more sub-blocks, the second transform may not be performed.

[0605] 37 and 38 are diagrams illustrating the application area of the second transformation.

[0606] When horizontal partitioning is applied to a coding block of 16 × 16 size, the coding block can be divided into sub-blocks of 16 × 4 size. As shown in the example, when the sub-blocks have a size of N × 4 (N is an integer greater than 4), the height of the region to which the second transform is applied can be set to not exceed 4.

[0607] That is, as in the example shown in FIG. 37(a), the area to which the second transformation is applied can be set to an area of 4×4 or 8×4 size.

[0608] On the other hand, as in the example shown in FIG. 37(b), it is possible to not allow the application area of the second transformation to be set to 4×8 or 8×8.

[0609] When vertical partitioning is applied to a coding block of 16 × 16 size, the coding block can be divided into sub-blocks of 4 × 16 size. As shown in the example, when the sub-blocks have a size of 4 × N (N is an integer greater than 4), the width of the region to which the second transform is applied can be set to not exceed 4.

[0610] That is, as in the example shown in FIG. 38(a), the area to which the second transformation is applied can be set to an area of 4×4 or 4×8 size.

[0611] On the other hand, as in the example shown in FIG. 38(b), it is possible to not allow the area to which the second transformation is applied to be set to 8×4 or 8×8.

[0612]

[0613] The decoder may decode residual coefficients from a bitstream and apply inverse quantization to the residual coefficients to derive transform coefficients. If the transform coefficients are generated by a first transform and a second transform, the decoder may perform a second inverse transform and a first inverse transform on the transform coefficients to derive residual samples.

[0614] If it is determined that a second transform is to be performed on the current block, a target region to which the second inverse transform is to be applied may be determined. If a general second transform is applied, the size of the target region to which the second inverse transform is to be applied may be set to be the same as the target region to which the second transform is to be applied. For example, if the second transform is performed on a 4x4 region using a 16x16 non-separable transform matrix, the second inverse transform may also be applied to a 4x4 region.

[0615] On the other hand, when a reduced second transform is applied, the size of the application area of the second inverse transform may be smaller than the size of the application area of the second transform. For example, when the second transform is performed using a reduced transformation matrix of 64×48 size on an 8×8 size area, the second inverse transform may be performed on an area including 48 samples (e.g., three 4×4 size blocks).

[0616] The decoder may determine an application region of the second inverse transform based on the size of the current block. Here, the current block may indicate a coding block or a transform block to which the second inverse transform is applied. For example, if at least one of the width or height of the current block is smaller than a threshold, the application region may be configured to include 16 samples. On the other hand, if the width and height of the current block are equal to or greater than the threshold, the application region may be configured to include 48 samples.

[0617] An input matrix may be generated by arranging transform coefficients included in the target region in a row. Here, when a second transform that has been reduced is applied to the current block, the input matrix may be generated based on transform coefficients equal to the reduction factor k. For example, when the reduction factor k is 16, the input matrix may be generated based on transform coefficients included in the top-left block of a 4x4 size. When the reduction factor k is 32, the input matrix may be generated based on transform coefficients included in the top-left block and adjacent 4x4 blocks adjacent to the right or bottom of the top-left block. When the reduction factor k is 48, the input matrix may be generated based on transform coefficients of the top-left block, the 4x4 adjacent block adjacent to the right of the top-left block, and the adjacent block adjacent to the bottom of the top-left block.

[0618] The reduction factor k may be predefined in the encoder and decoder, or information for determining the reduction factor k may be signaled by the bitstream, or the reduction factor k may be determined based on the size or shape of the current block.

[0619] A transformation matrix can be obtained by multiplying the input matrix by a separable invertible transformation matrix. The separable invertible transformation matrix can be a symmetric matrix of the non-separable transformation matrix shown in Equation 6 and Equation 7. Equation 8 and Equation 9 show an example of obtaining a transformation matrix using a separable invertible transformation matrix.

[0620]

number

[0621] If a general second transformation is applied to the current block, the input matrix A is converted to a separable invertible transformation matrix T T As an example, we can derive a transformation matrix by multiplying the inverse transformation matrix T T and an input matrix A of size 16×1 to derive a transformation matrix of size 16×1.

[0622] Once the transformation matrix A' is obtained, the components of the transformation matrix A' can be set to the transformation coefficients of an NxN size block in the current block. For example, a 16x1 size transformation matrix can be set to the transformation coefficients of a 4x4 block.

[0623]

number

[0624] When a reduced second transform is applied to the current block, a transform matrix A' can be derived by multiplying the reduced separable lossy transform matrix RT by the input matrix A. For example, a 64x1 transform matrix can be derived by multiplying the 64x16 reduced separable lossy transform matrix RT by the 16x1 input matrix A.

[0625] Or, a reduced separable lossy transformation matrix R of size 64x32 T and an input matrix A of size 32×1 to derive a transformation matrix of size 64×1.

[0626] Or, a reduced separable lossy transformation matrix R of size 64x48 T and an input matrix A of size 48×1 to derive a transformation matrix of size 48×1.

[0627] Once the transformation matrix A' is obtained, the components of the transformation matrix A' can be set to the transformation coefficients of an NxN size block in the current block. For example, a 64x1 size transformation matrix can be set to the transformation coefficients of an 8x8 block.

[0628] The separable lossy transform matrix may be determined based on at least one of index information signaled by a bitstream, the size of the current block, or the intra-prediction mode. For example, the size of the separable lossy transform matrix may be determined based on the size of the current block, and the separable lossy transform matrix set may be determined based on the intra-prediction mode of the current block. When the separable lossy transform matrix set is determined according to the intra-prediction mode of the current block, at least one of a plurality of separable lossy transform matrix candidates corresponding to the size of the current block included in the separable lossy transform matrix set may be identified by an index lfnst_idx.

[0629] A separable lossy transform matrix set may include a plurality of separable lossy transform matrix candidates, where at least one of the types or number of inverse transform matrix candidates may be different between separable lossy transform matrix sets having different indices.

[0630] Table 11 shows an example of determining a separable lossy transform set based on an intra prediction mode. In Table 11, predModeIntra indicates the index of the intra prediction mode, and lfnstTrSetIdx indicates the index of the separable lossy transform set.

[0631] [Table 11]

[0632] For example, if the intra prediction mode of the current block is planar, a separable lossy transform matrix set having an index of 0 may be selected. Then, a separable lossy transform matrix may be determined based on the size of the current block and the value of lfnst_idx.

[0633] The set of separable lossy transformations can also be determined by further simplifying Table 11. As an example, Table 11 can be simplified as shown in Table 12 below.

[0634] [Table 12]

[0635] Alternatively, a separable lossy transform matrix set can be selected taking into consideration only whether the intra prediction mode is directional or non-directional. Table 13 shows an example of determining a separable lossy transform matrix set based on whether the intra prediction mode is directional or non-directional.

[0636] [Table 13]

[0637] Alternatively, a plurality of lookup tables defining a mapping relationship between intra prediction modes and separable lossy transform matrix sets may be stored, and one of the plurality of lookup tables may be used to determine the separable lossy transform matrix set. For example, one of Tables 11 to 13 may be selectively used to determine the separable lossy transform matrix set.

[0638] Information identifying one of multiple lookup tables can be signaled by the bitstream, and the information can be signaled at the sequence, picture, slice, or block level.

[0639] Alternatively, one of the plurality of lookup tables may be selected based on at least one of the size, shape, or transform core applied in the first transform of the current block.

[0640] When an inverse transform matrix of a predefined size is used, it is possible to set the method of determining a set of separable lossy transform matrices based on an intra prediction mode to be omittable. For example, when an inverse transform matrix of 48x16 size is to be used, the process of determining a set of separable lossy transform matrices based on an intra prediction mode can be omitted.

[0641] As described above, one of a plurality of non-separable transformation matrix candidates can be applied to the current block, where the non-separable transformation matrix candidates may differ in at least one of their sizes or coefficients.

[0642] FIG. 39 shows an example showing various non-separable transformation matrix candidates.

[0643] Assume that a 4x4 sub-block is to be subjected to the second inverse transform.

[0644] As shown in the example of Figure 39(a), a 64x16 size separable invertible transform matrix can be used to derive a 64x1 size transform matrix, which can be set to the transform coefficients of an 8x8 size block.

[0645] As shown in the example of Figure 39(b), a 32x16 size separable invertible transform matrix can be used to derive a 32x1 size transform matrix, which can be set to a 4x8 or 8x4 size block of transform coefficients.

[0646] As shown in the example of Figure 39(c), a 48x1 size transform matrix can be derived using a 48x16 size separable invertible transform matrix. The derived transform matrix can be set to the transform coefficients of three 4x4 size blocks. Among these three 4x4 size blocks, the upper left block can have a transform coefficient that is not zero, and the other blocks can be set so that all the transform coefficients in the blocks have values of 0.

[0647] A separable lossy transform matrix to be applied to the current block may be determined based on whether a sub-partition intra-coding method is applied to the current block. For example, if a sub-partition intra-coding method is applied to the current block, a separable lossy transform matrix of 32×16 size may be set to be applied.

[0648] Alternatively, the types or number of separable lossy transform matrix candidates may be determined differently depending on whether a sub-partition intra-coding method is applied to the current block. For example, a 32x16 size separable lossy transform matrix may be used as a candidate only when a sub-partition intra-coding method is applied to the current block.

[0649] When a sub-partition intra-coding method is applied to the current block and a separable irreversible transform matrix of 32x16 size is applied, the size or shape of the block induced as a result of performing the second inverse transform may differ depending on the size or shape of the sub-partition.

[0650] For example, if vertical partitioning is applied to the current block (e.g., if the subpartitions are 4xL), the 32x1 transform matrix obtained as a result of performing the second inverse transform may be set as the transform coefficients of a 4x8 block. On the other hand, if horizontal partitioning is applied to the current block (e.g., if the subpartitions are Lx4), the 32x1 transform matrix obtained as a result of performing the second inverse transform may be set as the transform coefficients of an 8x4 block.

[0651] Even if the sub-partition intra-prediction coding method is not applied, if the current block is coded by intra-prediction and the size is 4xL or Lx4, a non-separable matrix of 32x16 size can be applied.

[0652] When the sub-partition intra-coding method is applied to the current block, the second inverse transform and the first inverse transform may be applied to each of the sub-blocks included in the current block.

[0653] Alternatively, the second inverse transform and the first inverse transform may be applied to a subblock at a predetermined position among the plurality of subblocks or a subblock whose partition index is smaller than a threshold. For example, the second transform may be applied only to a subpartition located at the top end of the current block or a subpartition located at the outermost side of the current block, and the second transform may not be applied to the remaining subpartitions.

[0654] When a sub-partition intra-coding method is applied, the size of the application area of the second inverse transform may be determined to be 4x4. Alternatively, the size of the application area may be adaptively determined depending on the size of the sub-block. For example, if the minimum value of the width and height of the sub-partition is 4, a 4x4 size area may be set as the application area.

[0655] Alternatively, for a sub-block having a 4×N or N×4 format, an area of 8×4 size can be set as the application area, where N is an integer of 8 or more.

[0656] The transform coefficients included in the application region within the sub-block may be arranged in a row to generate an input matrix. For example, if the application region is set to a 4x4 size, the transform coefficients included in the application region may be converted into an input matrix of 16x1 format. Alternatively, if the application region is set to a 4x8 or 8x4 size, the transform coefficients included in the application region may be converted into an input matrix of 32x1 format.

[0657] A transformation matrix can be derived by multiplying an input matrix by a non-separable transformation matrix. For example, a 16x16 non-separable transformation matrix can be multiplied by a 16x1 input matrix to obtain a 16x1 transformation matrix. Alternatively, a 32x32 non-separable transformation matrix can be multiplied by a 32x1 input matrix to obtain a 32x1 transformation matrix.

[0658] Once the transformation matrix is obtained, the components in the transformation matrix can be set as the transformation coefficients of the sub-block. For example, a 16x1 transformation matrix can be set as the transformation coefficients of the upper left 4x4 block. Alternatively, a 32x1 transformation matrix can be set as the transformation coefficients of the upper left 4x8 or 8x4 block.

[0659] When a second inverse transform is applied to a sub-block, a predefined transform core may be applied to the horizontal and vertical transforms of the sub-block. For example, the horizontal and vertical transform cores of the sub-block to which the second inverse transform is applied may be set to DCT2.

[0660]

[0661] Whether the second transform is permissible may be determined based on whether a sub-transform block coding method is applied to the coding block. For example, if a sub-transform block coding method is applied to the coding block, the second transform may be set not to be applied.

[0662] Alternatively, when a sub-transform block coding method is applied to a coding block, it may be configured to use the second transform only in at least one sub-block that is available among the plurality of sub-blocks, where the available sub-block may indicate a block on which the first transform has been performed among the plurality of sub-blocks.

[0663] The size of the area to which the second transform is applied within the sub-block may be determined depending on the size or shape of the sub-block. For example, if at least one of the height or width of the sub-block is smaller than a threshold, the second transform may be performed on a 4x4 area. On the other hand, if at least one of the height or width of the sub-block is equal to or greater than a threshold, the second transform may be performed on an 8x8 area.

[0664] Whether the second transform is applied to a sub-block may be determined based on at least one of the size, shape, position, or partition index of the sub-block. For example, the second transform may be applied only to a sub-block including the upper left sample of a coding block. Alternatively, the second transform may be applied only if at least one of the height or width of the sub-block is greater than a threshold.

[0665] Alternatively, information indicating whether a second transform is applied to a sub-block can be signaled by the bitstream.

[0666] When the sub-transform block coding method is applied, the downsized second transform may be set to be disallowed, or even when the sub-transform block coding method is applied, whether or not to perform the downsized second transform may be determined based on at least one of the size and shape of the sub-block.

[0667]

[0668] The reconstructed samples of a sub-block on which a transform is performed can be derived by summing predicted samples and residual samples. Meanwhile, for a sub-block on which a transform is omitted, predicted samples can be set as reconstructed samples. Quantization reduces the energy of a block, and the quantization process involves dividing transform coefficients by a specific constant value. The constant value can be derived by a quantization parameter, which can be defined as a value between 1 and 63.

[0669]

[0670] Once a reconstructed block for the current block is obtained, information loss that occurs during the quantization and encoding process can be reduced by in-loop filtering. The in-loop filter may include at least one of a deblocking filter, a sample adaptive offset filter (SAO), or an adaptive loop filter (ALF). Hereinafter, the reconstructed block before the in-loop filter is applied is referred to as the first reconstructed block, and the reconstructed block after the in-loop filter is applied is referred to as the second reconstructed block.

[0671] A second reconstructed block may be obtained by applying at least one of a deblocking filter, SAO, or ALF to the first reconstructed block, where SAO or ALF may be applied after the deblocking filter is applied.

[0672]

[0673] For real-time or low-latency encoding of high-resolution video such as panoramic video, 360-degree video, or 4K / 8K UHD (Ultra High Definition) video, a method of dividing a picture into multiple regions and encoding / decoding the multiple regions in parallel can be considered. Specifically, a picture can be divided into tiles or slices (or tile groups) depending on the processing purpose.

[0674] A tile represents the basic unit of parallel encoding / decoding. Each tile can be processed in parallel. A tile can have a rectangular shape, or non-rectangular tiles can be allowed.

[0675] Information indicating whether non-rectangular tiles are allowed or present can be signaled by the bitstream.

[0676] When encoding / decoding a tile, data from other tiles can be set not to be used. Parallel processing of tiles can be supported by removing encoding / decoding dependencies between tiles. Specifically, a CABAC (Context Adaptive Binary Arithmetic Coding) context probability table can be initialized on a tile-by-tile basis, and in-loop filtering can be set not to be applied at tile boundaries. Data from other tiles can also be set not to be used as candidates for motion vector guidance. For example, data from other tiles can be set not to be used as merge candidates, motion vector prediction candidates (AMVP candidates), or motion information candidates. Data from other tiles can also be set not to be used for symbol context calculation.

[0677] Video encoding / decoding information can be signaled via a slice header. The information signaled via the slice header can be commonly applied to coding tree units or tiles included in the slice. A slice can also be referred to as a tile group.

[0678] FIG. 40 is a diagram showing a picture division method according to one embodiment of the present invention.

[0679] First, it may be determined whether to divide the current picture into multiple processing units (S4001). Here, the processing units may include at least one of tiles or slices. As an example, a syntax element no_pic_partition_flag indicating whether the current picture is divided into multiple tiles or slices may be signaled by the bitstream. A value of 0 for the syntax element no_pic_partition_flag indicates that the current picture is divided into at least one tile or at least one slice. On the other hand, a value of 1 for the syntax element no_pic_partition_flag indicates that the current picture is not divided into multiple tiles or multiple slices.

[0680] If it is determined that the current picture is not to be divided into multiple processing units, the division process of the current picture can be terminated. In this case, the current picture can be understood as consisting of one tile and one slice (or tile group).

[0681] Alternatively, information indicating whether a picture contains multiple tiles can be signaled by the bitstream. The information can include at least one of a one-bit flag indicating whether a picture contains multiple tiles or information specifying the number of tiles in the picture. Only when it is determined that a picture contains multiple tiles, can the picture division process described below be performed.

[0682] If it is determined that the current picture is to be divided into a plurality of processing units, tile division information may be signaled by the bitstream, and the picture may be divided into at least one tile based on the signaled tile division information (S4002).

[0683] If the current picture is divided into multiple tiles, slices can be determined by merging multiple tiles or dividing one tile (S4003).

[0684] The tile division method and slice determination method according to the present invention will be described in detail below.

[0685] FIG. 41 shows an example where a picture is divided into multiple tiles.

[0686] A tile may include at least one coding tree unit, and the boundaries of the tile may be set to coincide with the boundaries of the coding tree unit, i.e., a division form in which one coding tree unit is divided into multiple parts may not be allowed.

[0687] When a picture is divided into multiple tiles, the height or width of adjacent tiles can be set to have the same value.

[0688] For example, tiles belonging to the same tile row and / or tiles belonging to the same tile column can be set to the same height and / or width, respectively, as shown in the example in Figure 41. Tiles belonging to the same tile row can also be called a horizontal tile set, and tiles belonging to the same tile column can also be called a vertical tile set.

[0689] Alternatively, information indicating whether the width and / or height of the tile to be encoded / decoded is set to be the same as the width and / or height of the previous tile may be signaled.

[0690] Information indicating the division format of a picture can be signaled by a bitstream, and the information can be coded and signaled via a picture parameter set, a sequence parameter set, or a slice header.

[0691] The information indicating the picture division format may include at least one of information indicating whether tiles are divided into equal sizes, information indicating the number of tile columns, or information indicating the number of tile rows, where the number of tile columns indicates the number of vertical tile sets, and the number of tile rows indicates the number of horizontal tile sets.

[0692] By dividing a picture using at least one vertical or horizontal line that crosses the picture, each tile belongs to a different column and / or row. To determine the picture division format, information indicating the number of tile columns and / or the number of tile rows can be signaled. For example, information num_tile_row_minus1 indicating the number of tile rows generated by dividing a picture and information num_tile_column_minus1 indicating the number of tile columns can be signaled via the bitstream. The syntax num_tile_row_minus1 indicates a value obtained by subtracting 1 from the number of tile rows, and the syntax num_tile_column_minus1 indicates a value obtained by subtracting 1 from the number of tile columns.

[0693] In the example shown in Figure 41, the number of tile columns is 4 and the number of tile rows is 3. This allows num_tile_columns_minus1 to indicate 3 and num_tile_rows_minus1 to indicate 2.

[0694] A syntax indicating the width of each tile column and a syntax indicating the height of each tile row may be signaled by the bitstream. For example, tile_cols_width_minus1[i] may indicate the width of the i-th tile column, and tile_rows_height_minus[j] may indicate the height of the j-th tile row.

[0695] The syntax tile_cols_width_minus1[i] indicates the value obtained by subtracting 1 from the number of coding tree unit columns constituting the i-th tile column. For the last tile column, the signaling of the syntax tile_cols_width_minus1[i] can be omitted. The width of the last tile column can be derived by subtracting the width of the previous tile column from the width of the current picture.

[0696] The syntax tile_rows_height_minus1[j] indicates the value obtained by subtracting 1 from the number of coding tree unit rows constituting the jth tile row. For the last tile row, the signaling of the syntax tile_rows_height_minus1[j] can be omitted. The height of the last tile row can be derived by subtracting the height of the previous tile row from the height of the current picture.

[0697] As another example, it is possible to signal information indicating the number of tile columns whose width information is explicitly signaled by the bitstream and / or information indicating the number of tile rows whose height information is explicitly signaled by the bitstream. Table 14 shows a syntax table including the information.

[0698] [Table 14]

[0699] The syntax num_exp_tile_columns_minus1, which is derived by subtracting 1 from the number of tile columns for which width information is explicitly signaled, can be signaled by the bitstream.

[0700] If the number of tile columns for which width information is explicitly signaled is determined by the syntax num_exp_tile_columns_minus1, the width information tile_column_width_minus1[i] for the determined number can be signaled, where i can have a value between 0 and num_exp_tile_columns_minus1.

[0701] The width of a tile column whose index k is less than or equal to num_exp_tile_columns_minus1 may be determined based on the syntax tile_column_width_minus1[k] signaled for the tile column. Specifically, the width of a tile column whose index k is less than or equal to num_exp_tile_columns_minus1 may be determined by adding 1 to the value of the syntax tile_column_width_minus1[k] and multiplying the derived value by the width of the coding tree unit.

[0702] Meanwhile, the width of a tile column whose index k is greater than num_exp_tile_columns_minus1 may be determined based on the last signaled width information and the number of residual coding tree unit columns in the picture. For example, if the width of a tile column guided by the last signaled width-related syntax tile_column_width_minus1[num_exp_tile_columns_minus1] is LastColWidth (i.e., tile_column_width_minus1[num_exp_tile_columns_minus1]+1) and the number of residual coding tree unit columns excluding the area occupied by previous tile columns in the current picture is remainingWidthInCtbY, the width of the kth tile column may be set to the smaller value of LastColWidth and remainingWidthInCtbY.

[0703] Table 15 is an example that describes the process for determining the width of a tile row.

[0704] [Table 15]

[0705] In Table 15, the variable PicWidthInCtbsY indicates the total number of coding tree unit columns in a picture. As an example, the variable PicWidthInCtbsY can be derived based on the following Equation 10:

[0706]

number

[0707] In Equation 10, pic_width_in_luma_samples represents the number of horizontal luma samples in a picture, and the variable CtbSizeY may represent the size of a coding tree unit.

[0708] The variable remainingWidthInCtbY can be derived by subtracting the cumulative width of the previous tile column from the variable PicWidthInCtbsY.

[0709] The syntax num_exp_tile_rows_minus1, which is derived from the number of tile rows for which height information is explicitly signaled minus 1, can be signaled by the bitstream.

[0710] If the number of tile rows for which height information is explicitly signaled is determined by the syntax num_exp_tile_rows_minus1, the height information tile_row_height_minus1[i] for the determined number can be signaled, where i can have a value between 0 and num_exp_tile_rows_minus1.

[0711] The height of a tile row whose index k is less than or equal to num_exp_tile_rows_minus1 may be determined based on the syntax tile_row_Height_minus1[k] signaled for the tile row. Specifically, the height of a tile row whose index k is less than or equal to num_exp_tile_rows_minus1 may be determined by adding 1 to the value of the syntax tile_row_Height_minus1[k] and multiplying the derived value by the height of the coding tree unit.

[0712] Meanwhile, the height of a tile row whose index k is greater than num_exp_tile_rows_minus1 may be determined based on the last signaled height information and the number of residual coding tree unit rows in the picture. For example, when the height of a tile row induced by the last signaled height-related syntax tile_row_height_minus1[num_exp_tile_rows_minus1] is LastRowHeight (i.e., tile_row_height_minus1[num_exp_tile_rows_minus1]+1) and the number of residual coding tree unit rows excluding the area occupied by the previous tile row in the current picture is remainingHeightInCtbY, the height of the kth tile row may be set to the smaller value of LastColHeight and remainingHeightInCtbY.

[0713] Table 16 is an example that describes the process for determining the height of a tile row.

[0714] [Table 16]

[0715] In Table 16, the variable PicHeightInCtbsY indicates the total number of coding tree unit rows in a picture. As an example, the variable PicHeightInCtbsY can be derived by the following Equation 11:

[0716]

number

[0717] In Equation 11, pic_height_in_luma_samples represents the number of vertical luma samples in a picture. The variable CtbSizeY may be a value representing the size of a coding tree unit.

[0718] The variable remainingheightInCtbY can be derived by subtracting the cumulative previous tile row height from the variable PicHeightInCtbsY.

[0719] 41 as an example, each of four tile columns consists of two coding tree unit columns. As a result, the syntax element tile_column_width_minus1[0] is set to 1 and signaled for only the first tile column, and the widths of the remaining tile columns can be set to the same as tile_column_width_minus1[0]. Because the number of syntax elements tile_column_width_minus1 signaled is 1, the value of the syntax element num_exp_tile_columns_minus1 can be set to 0.

[0720] In Figure 41, the first tile row consists of three coding tree unit rows, and the second and third tile rows consist of two coding tree unit rows. Since the height of the third tile row can be derived based on the height information of the second tile row, height information can be signaled only for the first and second tile rows. As an example, the syntax tile_row_height_minus1[0] for the first tile row can be signaled by setting it to 2, and the syntax tile_row_height_minus1[1] for the second tile row can be signaled by setting it to 1. Since the number of syntax tile_row_width_minus1 to be signaled is 2, the value of the syntax num_exp_tile_rows_minus1 can be set to 1.

[0721] Meanwhile, information indicating the size of the coding tree unit can be signaled by a sequence parameter set or a picture parameter set.

[0722] A tile may consist of at least one coding tree unit. The remaining tiles, excluding tiles adjacent to the right or bottom boundary of a picture, may be set so as not to include an area smaller than a coding tree unit. That is, the boundaries of the tiles coincide with the boundaries of the coding tree units.

[0723] On the other hand, the syntax element loop_filter_across_tiles_enabled_flag indicates whether to allow application of in-loop filters at tile boundaries within a picture that references the picture parameter set. Here, the in-loop filters can include at least one of a deblocking filter, an ALF, or an SAO. A value of 1 for the flag loop_filter_across_tiles_enabled_flag indicates that application of in-loop filters across tile boundaries within a picture that references the picture parameter set is allowed. On the other hand, a value of 0 for the flag loop_filter_across_tiles_enabled_flag indicates that application of in-loop filters at tile boundaries within a picture that references the picture parameter set is not allowed.

[0724] The syntax element loop_filter_across_slices_enabled_flag indicates whether to allow application of in-loop filters at slice boundaries in a picture that references the picture parameter set. Here, the in-loop filters can include at least one of a deblocking filter, an ALF, or an SAO. A value of 1 for the flag loop_filter_across_slices_enabled_flag indicates that application of in-loop filters across slice boundaries in a picture that references the picture parameter set is allowed. On the other hand, a value of 0 for the flag loop_filter_across_slices_enabled_flag indicates that application of in-loop filters at slice boundaries in a picture that references the picture parameter set is not allowed.

[0725] Table 17 illustrates a syntax table that includes a flag no_pic_partition_flag that indicates whether a picture is partitioned into multiple regions.

[0726] [Table 17]

[0727] The flag no_pic_partition_flag set to 1 indicates that the picture or subpicture is not divided into multiple tiles or multiple slices. If the flag no_pic_partition_flag has a value of 1, coding of syntax related to the tile partition structure and / or slice partition structure can be omitted.

[0728] On the other hand, if no_pic_partition_flag is 0, it indicates that the picture or subpicture can be divided into multiple tiles or multiple slices. If the value of the flag no_pic_partition_flag is 0, the syntax pps_log2_ctu_size_minus5 for determining the size of the coding tree unit can be signaled.

[0729] A rectangular area composed of multiple coding tree units can be defined as one tile. That is, one coding tree unit can be set not to be defined in one tile. In this way, when multiple coding tree units are set to be defined in one tile, the range of the syntax tile_row_height_minus1 can be determined by the value of the syntax tile_column_width_minus1, or the range of the syntax tile_column_width_minus1 can be determined by the value of the syntax tile_row_height_minus1.

[0730] As an example, a value of 0 for the syntax element tile_column_width_minus1 indicates that one coding tree unit column is included in the tile. As described above, since one tile is composed of multiple coding tree units, the value of tile_row_height_minus1, which indicates the height of the tile, must be greater than 0. That is, if the syntax element tile_column_width_minus1 is coded and signaled before the syntax element tile_row_height_minus1 and the value of the syntax element tile_column_width_minus1 is 0, the value of the syntax element tile_row_height_minus1 must be set to 1 or greater.

[0731] On the other hand, if the syntax tile_row_height_minus1 is coded and signaled before the syntax tile_column_width_minus1 and the value of the syntax tile_row_height_minus1 is 0, the syntax tile_column_width_minus1 must be set to a value of 1 or greater.

[0732] As in the example described above, if one tile is composed of one coding tree unit column, the tile must include multiple coding tree rows. That is, if the value of the syntax tile_column_width_minus1[i] indicating the width of the i-th tile is 0, the value of the syntax tile_row_height_minus1[i] indicating the height of the i-th tile must be set to 1 or more.

[0733] In addition, if one tile is composed of one coding tree unit row, the tile must include multiple coding tree columns. That is, if the value of the syntax element tile_row_height_minus1[i] indicating the height of the i-th tile is 0, the value of the syntax element tile_row_height_minus1[i] indicating the width of the i-th tile must be set to 1 or more.

[0734] As a result, when the syntax tile_column_width_minus1[i] is coded before the syntax tile_row_height_minus1[i], each syntax can be defined as shown in Table 18 below.

[0735] [Table 18]

[0736] Conversely, if the syntax tile_row_height_minus1[i] is coded before the syntax tile_column_width_minus1[i], the respective syntaxes can be defined as shown in Table 19 below.

[0737] [Table 19]

[0738] As another example, if the value of the syntax tile_column_width_minus1[i] is 0, the syntax tile_row_height_minus2[i] can be coded instead of the syntax tile_row_height_minus1[i]. The syntax tile_row_height_minus2[i] can be derived by subtracting 2 from the number of coding tree unit rows included in the i-th tile.

[0739] Alternatively, if the value of the syntax tile_row_height_minus1[i] is 0, the syntax tile_column_width_minus2[i] can be coded instead of the syntax tile_column_width_minus1[i]. The syntax tile_column_width_minus2[i] can be derived by subtracting 2 from the number of coding tree unit columns included in the i-th tile.

[0740]

[0741] At least one tile can be defined as one processing unit. For example, multiple tiles can be defined as one slice. A slice can also be called a tile group.

[0742] Alternatively, one tile may be divided into multiple processing units. For example, one tile may be divided into multiple slices. Here, one slice may include at least one coding tree unit sequence. When one tile is divided into multiple slices, information indicating the height of each slice may be signaled by a bitstream.

[0743] At least one of the four sides of a slice may coincide with a picture boundary and / or a tile boundary. For example, the left or top boundary of a slice may be set to coincide with the left or top boundary of a picture. Alternatively, at least one of the four sides of a slice may be located on a tile boundary.

[0744] Video encoding / decoding information can be signaled via a slice header, and the information signaled via the slice header can be commonly applied to tiles and / or blocks belonging to the slice.

[0745] Information indicating a slice type may be signaled by a bitstream, which indicates how a slice in a current picture is defined. For example, a syntax element rect_slice_flag indicating a slice type may be signaled by a bitstream.

[0746] The syntax rec_slice_flag indicates whether slices are defined in raster scan order of tiles or in rectangular shapes. For example, when rec_slice_flag is 0, slices are defined in raster scan order of tiles. On the other hand, when rec_slice_flag is 1, slices are defined in rectangular shapes.

[0747] The two methods for determining the slices are described in detail below.

[0748] The raster scan-based definition method identifies at least one tile in raster scan order, and then defines the identified at least one tile as a slice. When using the raster scan-based definition method, one or more consecutive tiles (etc.) can be defined as a slice. Here, consecutive tiles can be determined in raster scan order. When applying raster scan slicing, non-rectangular slices can also be generated.

[0749] When defining slices in raster scan order, it is possible to signal information indicating the number of tiles each slice contains, and for the last slice, it is possible to omit signaling information indicating the number of tiles the slice contains.

[0750] When a slice includes multiple tiles, the tiles included in the slice may have different widths or heights.

[0751] The rectangular slice definition method is a division method that allows only rectangular slices. When the rectangular slice definition method is applied, tiles located on the square of the slice belong to the same row or the same column.

[0752]

[0753] Alternatively, if a rectangular slice definition method is applied, a tile can be divided into multiple rectangular slices.

[0754] When the rectangular slice definition method is applied, information indicating whether a picture consists of a single slice can be signaled. As an example, a syntax element "one_slice_in_pic_flag" indicating whether the number of slices in a picture is one can be signaled by the bitstream. When the flag "one_slice_in_pic_flag" is set to 1, it indicates that the picture consists of one slice. On the other hand, when the flag "one_slice_in_pic_flag" is set to 0, it indicates that the picture consists of at least two slices.

[0755] Alternatively, information indicating whether each subpicture is composed of one slice can be signaled. As an example, a flag "single_slice_per_subpic" indicating whether each subpicture is composed of one slice can be signaled. When the flag "single_slice_per_subpic" is set to 1, it indicates that each subpicture is composed of a single slice. In this case, the slice partitioning structure can be determined in the same manner as the subpicture partitioning structure determined with reference to the sequence parameter set. On the other hand, when the flag "single_slice_per_subpic" is set to 0, it indicates that the subpicture partitioning structure and the slice partitioning structure are different. When the value of the flag "single_slice_per_subpic" is set to 0, information for determining the slice partitioning structure can be additionally signaled.

[0756]

[0757] The size of a slice may be determined based on the number of tile columns and / or the number of tile rows included in the slice. Referring to Table 14, a syntax element slice_height_in_tiles_minus1[i] indicating the height of the i-th slice may be signaled by a bitstream. The syntax element slice_height_in_tiles_minus1[i] may indicate a value obtained by subtracting 1 from the number of tile rows included in the i-th slice. Here, the height of the i-th slice may be derived by adding up the heights of the tile rows included in the i-th slice.

[0758] The syntax slice_width_in_tiles_minus1[i] indicating the width of the i-th slice can be signaled by the bitstream. The syntax slice_width_in_tiles_minus1[i] can indicate a value obtained by subtracting 1 from the number of tile columns included in the i-th slice. Here, the width of the i-th slice can be derived by adding up the heights of the tile columns included in the i-th slice.

[0759] FIG. 42 is a diagram for explaining how slice size information is signaled.

[0760] In the example shown in Fig. 42, a slice (slice4) with an index of 4 is composed of two tile columns and two tile rows. As a result, the syntax element slice_width_in_tiles_minus1[4] indicating the slice width for slice 4 and the syntax element slice_height_in_tiles_minus1[4] indicating the slice height can each be set to 1.

[0761] A tile can be divided into multiple slices. As an example, a tile can be divided into multiple slices using at least one vertical line.

[0762] When one tile is divided into multiple slices, the width information and height information for the i-th slice may each be set to 0. As an example, when the syntax slice_width_in_tiles_minus1[i] indicating the width of the i-th slice and the syntax slice_slice_in_tiles_minus1[i] indicating the height of the i-th slice are both 0, the syntax num_slices_in_tiles_minus1[i] indicating the number of slices included in the tile may be signaled. The syntax num_slices_in_tiles_minus1[i] indicates a value obtained by subtracting 1 from the number of slices included in the tile.

[0763] A value of 0 for the syntax num_slices_in_tiles_minus1[i] indicates that the i-th slice consists of one tile. On the other hand, a value greater than 0 for the syntax num_slices_in_tiles_minus1[i] indicates that the tile containing the i-th slice is divided into multiple slices. When the value of the syntax num_slices_in_tiles_minus1[i] is greater than 0, information indicating the height of each tile can be additionally signaled.

[0764] For example, the syntax element slice_height_in_ctu_minus1[i][j] may be derived by subtracting 1 from the number of coding tree unit rows included in the j-th slice in the tile. For the last slice in the tile, coding of the syntax element slice_height_in_ctu_minus1 may be omitted. The height of the last slice may be determined based on the height of the remaining coding tree unit rows in the tile.

[0765] Information can be signaled to identify the tiles that each slice contains.

[0766] Specifically, differential information for identifying the index of a tile included in a slice may be coded and signaled. For example, a syntax tile_idx_delta[i] indicating a value obtained by subtracting the index of a tile at a predetermined position in the (i+1)th slice from the index of a tile at a predetermined position in the i-th slice may be coded. Here, the predetermined tile may be the upper left tile or the lower right tile in the slice.

[0767] For the last slice, encoding of the difference information can be omitted.

[0768] Along with the differential information, information indicating the sign of the differential information can also be further coded and signaled. As an example, the syntax tile_idx_delta_sign[i] indicating whether the value of the syntax tile_idx_delta[i] is positive or negative can be signaled by the bitstream. Here, since the differential value between the first slice (i.e., the slice where i is 0) and the second slice (i.e., the slice where i is 1) is always positive, coding of the syntax tile_idx_delta_sign[i] for the first slice can be omitted.

[0769] If the i-th slice and the i+1-th slice are not included in one tile, the absolute value of the tile index difference between the i-th slice and the i+1-th slice is always greater than 1. Therefore, it is also possible to code and signal the syntax tile_idx_delta_minus1[i], which is derived by subtracting 1 from the absolute value of the tile index difference between the i-th slice and the i+1-th slice.

[0770] Table 20 shows an example of a syntax table that includes differential information.

[0771] [Table 20]

[0772] When one tile includes multiple slices, the multiple slices are all included in the same tile, so the tile index difference value between the multiple slices is 0. This allows the coding of the difference value between multiple slices included in one tile to be omitted. Since the coding of difference information between slices belonging to the same tile is omitted, the syntax tile_idx_delta_minus1[i] can always be set to a value greater than or equal to 0.

[0773] Also, when one tile includes multiple slices, differential information may be coded for only one of the slices. For example, the syntax tile_idx_delta_minus1[i] may be coded for only the first or last slice of the multiple slices included in one tile. For example, the i-th slice identified by the syntax tile_idx_delta_minus1[i] indicates the first or last slice of the multiple slices belonging to the first tile, and the (i+1)-th slice indicates a slice including a second tile different from the first tile.

[0774] The syntax tile_idx_delta_sign[i] indicates the sign of the tile index differential value. As an example, the sign of the tile index differential value, TileIdxDeltaSign, can be determined by the following Equation 12.

[0775]

number

[0776] As illustrated in Equation 12, a value of 1 in the syntax tile_idx_delta_sign[i] indicates that the tile index difference value induced by the syntax tile_idx_delta_minus1[i] is a positive number. A value of 0 in the syntax tile_idx_delta_sign[i] indicates that the tile index difference value induced by the syntax tile_idx_delta_minus1[i] is a negative number.

[0777] The tile index differential can be derived by multiplying the tile index differential absolute value (e.g., tile_idx_delta_minus1[i]+1) derived by the syntax tile_idx_delta_minus1[i] by the sign value derived by the syntax tile_idx_delta_sign[i].

[0778] For at least one of the first slice (e.g., the slice where i is 0), the last slice (e.g., the slice where i is num_slices_in_pic_minus1), or the slice before the last slice (e.g., the slice where i is num_slices_in_pic_minus1-1), coding of the syntax tile_idx_delta_sign[i] can be omitted. If coding of the syntax tile_idx_delta_sign[i] is omitted, its value can be considered to be 1.

[0779] Alternatively, the encoding of the sign information of the tile index difference value may be omitted, and the tile index difference value may always be set to have a positive value.

[0780]

[0781] Whether to encode the tile index difference information can be determined based on the slice position. Table 21 illustrates an example of determining whether to parse the tile index difference information based on the slice position.

[0782] [Table 21]

[0783] In Table 21, the variable tileIdx indicates the index of the top left tile within the ith tile.

[0784] If the top left tile in the i-th slice belongs to the last tile row in the picture, the encoding / decoding of the syntax tile_idx_delta_minus1[i] indicating the tile index difference value can be omitted. In other words, the syntax tile_idx_delta_minus1[i] can be encoded only if the top left tile in the i-th slice does not belong to the last tile row in the picture.

[0785] If the encoding of the syntax element tile_idx_delta_minus1[i] is omitted, the value of the syntax element tile_idx_delta_minus1[i] can be considered to be the same as the value of the syntax element slice_width_in_tiles_minus1[i].

[0786] If the top left tile contained in the i-th slice belongs to the last tile column in the picture, or if the top left tile contained in the i-th slice belongs to the last tile row in the picture, the encoding / decoding of the syntax tile_idx_delta_sign[i], which indicates the sign of the tile index differential value, can be omitted.

[0787] If the encoding of the syntax tile_idx_delta_sign[i] is omitted, the value of the syntax tile_idx_delta_sign[i] can be considered to be 1.

[0788]

[0789] In the above example, when the tile to which the i-th slice belongs includes multiple slices, information indicating the number of slices belonging to the tile and height information of each of the slices are signaled.

[0790] As another example, if the tile to which the i-th slice belongs includes multiple slices, information on the number of slices for which height information is explicitly signaled may be signaled, and then height information for the number indicated by the number information may be signaled. Table 22 illustrates a syntax table including information on the number of slices for which height information must be explicitly signaled.

[0791] [Table 22]

[0792] In Table 22, the syntax exp_num_slices_in_tile_minus1[i] indicates the number of slices for which height information is explicitly signaled in a tile including the i-th slice. Specifically, the syntax exp_num_slices_in_tile_minus1[i] can be derived by subtracting 1 from the number of slices for which height information is explicitly signaled.

[0793] The variable numExpSlicesInTile indicates the explicit number derived by adding 1 to the value of the syntax exp_num_slices_in_tile_minus1[i].

[0794] If the number of slices for which height information is explicitly signaled is determined, the slice height information can be coded and signaled for the determined number of slices. For example, the syntax element slice_height_in_ctu_minus1[i][j] indicates a value obtained by subtracting 1 from the number of coding tree unit rows included in the j-th slice in a tile including the i-th slice. Here, the variable i is a value calculated based on the number of slices in a picture, and the variable j is a value calculated based on the number of slices in a tile.

[0795] The height of slices with index k less than the explicit number can be determined based on the syntax slice_height_in_ctu_minus1[k] signaled by the bitstream.

[0796] The height of a slice whose index k is equal to or greater than the explicit number may be determined based on the last signaled height information and the number of residual coding tree unit rows in the tile. For example, if the width of a slice induced by the last signaled height-related syntax slice_height_in_ctu_minus1[exp_num_slices_in_tile_minus1] is LastSliceHeight and the number of residual coding tree unit rows excluding the area occupied by the previous slice in the tile is remainingHeightInCtbY, the height of the kth slice may be set to the smaller value of LastSliceHeight and remainingHeightInCtbY.

[0797] Table 22 shows an example of encoding / decoding using the syntax num_exp_slices_in_tile_minus1[i], which is derived by subtracting 1 from the number of slices for which height information is explicitly signaled. In this case, the explicit number determined by the syntax num_exp_slices_in_tile_minus1[i] is at least 1. This can cause a problem where the height of a tile must be explicitly signaled even when one tile is composed of one slice.

[0798] To solve this problem, it is also possible to encode / decode the syntax num_exp_slices_in_tile[i], which is explicitly set to the number of slices for which height information is signaled. Table 23 shows an example of a syntax table including the syntax num_exp_slices_in_tile[i].

[0799] [Table 23]

[0800] Only when the explicit number (i.e., numExpSlicesInTile) is greater than 0, the syntax slice_height_in_ctu_minus1 indicating the slice height can be coded / decoded.

[0801] If the explicit number is 0, the tile can be determined to consist of one slice.

[0802] 43 and 44 are diagrams for explaining the coding aspects of slice height information.

[0803] 43 shows an example in which one tile is divided into four slices. In the illustrated example, all three slices except the first slice have the same height (i.e., three coding tree unit rows).

[0804] In this case, the syntax slice_height_in_ctu_minus1[0] indicating the height of the first slice (slice0) in the tile can be coded by setting it to 2, and the syntax slice_height_in_ctu_minus1[1] indicating the height of the second slice (slice1) can be coded by setting it to 1. The third slice (slice2) and the fourth slice (slice3) have the same height value as that induced by the last coded syntax slice_height_in_ctu_minus1[1], so their height information does not need to be coded separately.

[0805] This allows the number of slices for which height information is explicitly signaled to be determined to be 2. For example, the value of the syntax num_exp_slices_in_tile[i] can be set to 2.

[0806] 44 shows an example in which one tile is divided into five slices. In the example shown, the first slice is composed of three coding tree unit rows, the second to fourth slices are composed of two coding tree unit rows, and the last slice is composed of one coding tree unit row.

[0807] In this case, the syntax element slice_height_in_ctu_minus1[0] indicating the height of the first slice (slice0) in the tile can be coded as 2, and the syntax element slice_height_in_ctu_minus1[1] indicating the height of the second slice (slice1) can be coded as 1. The third slice (slice2) and the fourth slice (slice3) have the same height value as the height induced by the last coded syntax element slice_height_in_ctu_minus1[1]. Also, for the last slice (slice4), the remaining height remainingHeightInCtbY excluding the area occupied by the previous slices in the tile is smaller than the height value LastSliceHeight induced by the last coded syntax element slice_height_in_ctu_minus1[1]. This allows the heights of the third, fourth, and fifth slices to be derived without having to code their height information separately.

[0808] This allows the number of slices for which height information is explicitly signaled to be determined to be 2. For example, the value of the syntax num_exp_slices_in_tile[i] can be set to 2.

[0809] In the examples of Tables 22 and 23, the variable i is set between 0 and the number of slices in the picture minus 1, and the variable j is set between 0 and the number of slices in the tile minus 1.

[0810] Since the variable i represents the total number of slices in a picture, once the partitioning structure for N slices in a given tile is determined, when determining the slice size for the next tile, the variable i must be incremented by (n-1).

[0811] Thus, if multiple slices within a given tile are determined to be included, the height of each of the multiple slices can be determined, and then the variable i can be changed to the index of the last slice within the given tile.

[0812] As an example, in Table 23, the variable RemNumSlicesMinus1 may be derived by subtracting 1 from the explicit number determined by the syntax num_exp_slices_in_tile from the total number of slices in a given tile. Specifically, the variable RemNumSlicesMinus1 may be derived as follows: First, the number of residual coding tree unit rows (RemHeight) may be derived by subtracting the sum of the heights of slices whose height information is explicitly signaled from the height of the given tile. Then, the value obtained by subtracting 1 from Ceil(RemHeight / LastSliceHeight), which is calculated based on the number of residual coding tree unit rows RemHeight and the last signaled height LastSliceHeight, may be set as the value of the variable RemNumSlicesMinus1.

[0813] As an example, in the example of Figure 43, the tile height is 9 (9 CTUs), and the sum of the heights of the slices whose height information is explicitly signaled is 5. Therefore, the number of residual coding tree rows, RemHeight, is set to 4. Also, the height of the last slice whose height information is signaled, LastSliceHeight, is 2. As a result, the value of the variable RemNumSliceMinus1 can be derived to 1 by subtracting 1 from the value obtained by dividing the variable RemHeight by the variable LastSliceHeight.

[0814] If the variable RemHeight is not a multiple of the variable LastSliceHeight, the quotient derived as a result of the division can be set to the variable RemNumSliceMinus1. For example, in the example of Figure 44, the variable RemHeight is 5 and the variable LastSliceHeight is 2. Thus, the variable RemNumSlice can be set to 2, which is the quotient when the variable RemHeight is divided by the variable LastSliceHeight.

[0815] Table 24 shows an example of deriving the variable RemNumSlicesMinus1.

[0816] [Table 24]

[0817] Alternatively, the variable RemNumSlicesMinus1 can be derived as in the example in Table 25.

[0818] [Table 25]

[0819]

[0820] A picture can be divided into one or more sub-pictures, each of which can be a rectangular area containing at least one slice.

[0821] Encoding or decoding can be performed in units of subpictures. Alternatively, a partial bitstream can be generated for each subpicture. A decoder can parse only a portion of the multiplexed partial bitstream. For example, a partial bitstream that fits the user's viewing area can be parsed and an image can be rendered based on the parsed partial bitstream.

[0822] Alternatively, a picture parameter set can be coded / decoded for each sub-picture, which allows each sub-picture to refer to a different picture parameter set, or tile partitioning can be performed independently for each sub-picture.

[0823] A subpicture can be composed of contiguous regions. This means that two slices that are not spatially adjacent cannot form a single subpicture. For example, adjacent slices can be defined as a single subpicture, but non-adjacent slices cannot be defined as a single subpicture.

[0824] A sub-picture can be defined as a rectangle containing one or more slices, i.e., sub-pictures with non-rectangular divisions are not allowed.

[0825] FIG. 45 is a diagram for explaining division patterns that can be applied to pictures.

[0826] In (a) to (c) of Figure 45, each rectangle represents a slice, and the number assigned to each slice represents the index of the sub-picture to which the slice belongs.

[0827] The index of the sub-picture to which each slice belongs can be signaled via the slice header. In the example of Figure 45, slices assigned the same index can be understood to be included in the same sub-picture.

[0828] Referring to (a) of Figure 45, it can be seen that each sub-picture is defined as a rectangle, and therefore, a division form such as the example shown in (a) of Figure 45 can be applied to a picture.

[0829] On the other hand, in (b) of Figure 45, it can be seen that subpicture 3 is defined as non-rectangular. Since it is not permissible to define a subpicture as non-rectangular, the division form shown in (b) of Figure 45 cannot be applied to the picture.

[0830] In Figure 45(c), it can be seen that subpicture 0 is defined as two spatially separated regions. One subpicture is not permitted to contain multiple regions that are not spatially contiguous. Therefore, the division form shown in Figure 45(c) cannot be applied to a picture.

[0831] Based on the above description, a method for dividing a picture into at least one sub-picture according to one embodiment of the present disclosure will now be described in detail.

[0832] FIG. 46 is a flowchart of a method for dividing a picture into at least one sub-picture according to one embodiment of the present disclosure.

[0833] The sub-picture related information can be signaled at the sequence level. For example, at least one of syntax indicating whether sub-pictures can be split, picture split information related syntax, or sub-picture independence related syntax (to be described later) can be included in the sequence parameter set.

[0834] The sub-picture related information can be commonly applied to pictures that refer to the sequence parameter set, so that the division format of pictures that refer to one sequence parameter set can be the same.

[0835] Alternatively, some of the sub-picture-related information may be signaled at the sequence level, and the other part may be signaled at the picture level. For example, a syntax indicating whether a sub-picture can be partitioned may be included in a sequence parameter set, while a picture partition information-related syntax and a sub-picture independence-related syntax may be included in a picture parameter set. Alternatively, a syntax indicating whether a sub-picture can be partitioned and a picture partition information-related syntax may be included in a sequence parameter set, while a sub-picture independence-related syntax may be included in a picture parameter set. In this case, at least one of the partition type or the sub-picture independence may differ for each picture.

[0836] In the examples described below, it is assumed that sub-picture related information is signaled via a sequence parameter set.

[0837] Referring to FIG. 46, first, it may be determined whether a picture is to be divided into at least one subpicture (S4601). Information indicating whether a picture is to be divided into at least one subpicture may be signaled via the bitstream. As an example, the syntax element subpics_present_flag may be signaled via the bitstream. When the syntax element subpics_present_flag is 1, it indicates that the picture can be divided into at least one subpicture. When the syntax element subpics_present_flag is 1, subpicture parameters may be included in the bitstream, for example, in a sequence parameter set. On the other hand, when the syntax element subpics_present_flag is 0, it indicates that the picture is not divided into subpictures. When the syntax element subpics_present_flag is 0, it indicates that the bitstream, for example, in a sequence parameter set, does not include subpicture parameters. Here, the subpicture parameters may include at least one of information indicating the number of subpictures (e.g., max_subpics_minus1), information indicating a subpicture size (e.g., subpic_grid_col_width_minus1, subpic_grid_row_height_minus1), information indicating a subpicture index (e.g., subpic_grid_idx), information indicating whether a subpicture is treated like a picture (e.g., subpic_treated_as_pic_flag), or information indicating whether an in-loop filter is allowed to be applied at a subpicture boundary (e.g., loop_filter_across_subpic_enabled_flag). The subpicture parameters will be described in detail below.

[0838] If a picture can be divided into at least one sub-picture, sub-picture division information can be acquired (S4602). The picture division information can include at least one of information indicating the number of sub-pictures included in the picture, information indicating the position of each sub-picture, or information indicating the size of each sub-picture.

[0839] As an example, a syntax element sps_num_subpics_minus1 indicating the number of subpictures may be signaled by the bitstream. The syntax element sps_num_subpics_minus1 may indicate a value obtained by subtracting 1 from the number of subp...

Claims

1. 1. A method of decoding video, comprising: parsing width information for the first slice from the bitstream, the width information indicating the number of tile columns contained in the first slice minus one; parsing first height information for the first slice from the bitstream, the first height information indicating the number of tile rows included in the first slice minus one; parsing explicit number information from the bitstream if the width information and the first height information are both zero; and the explicit number information represents the number of slices for which the second height information is explicitly coded; the second height information indicates a value obtained by subtracting 1 from the number of rows of coding tree units included in a slice; If the explicit number information is 0, the height of the first slice is equal to the height of the first tile; A method wherein, if the explicit number information is greater than 0, the height of the first slice is determined to be less than or equal to the height of the first tile based on the second height information parsed for the first slice.

2. 2. The method of claim 1, wherein whether to parse the second height information for a second slice among a plurality of slices included in the first tile is determined by comparing an index of the second slice with the explicit number information.

3. When it is determined to parse the second height information for the second slice, a height of the second slice is derived based on the second height information parsed for the second slice; 3. The method of claim 2, wherein if it is determined not to parse the second height information for the second slice, the height of the second slice is derived based on the second height information last parsed for another slice.

4. If the index of the second slice is less than the explicit number information, the second height information is parsed for the second slice; The method of claim 2 , wherein if the index of the second slice is greater than or equal to the explicit number information, the second height information is not parsed for the second slice.

5. After parsing the width information and the first height information for the first slice having a first index, the width information and the first height information are further parsed for a second slice having a second index; When the first tile is divided into a plurality of slices, the second index is greater than the first index by the number of slices; The method of claim 1 , wherein if the first tile is not divided into multiple slices, the second index is one greater than the first index.

6. 1. A method for encoding video, comprising: encoding width information of the first slice, which indicates a value obtained by subtracting 1 from the number of tile columns included in the first slice, into a bitstream; encoding first height information of the first slice, which indicates a value obtained by subtracting 1 from the number of tile rows included in the first slice, into the bitstream, and setting the first height information to 0 if the height of the first slice is equal to or less than a first tile height; encoding explicit number information into the bitstream if the width information and the first height information are both zero; and the explicit number information represents the number of slices for which the second height information is explicitly coded; the second height information indicates a value obtained by subtracting 1 from the number of rows of the coding tree unit included in the slice; If the explicit number information is coded to a value of 0, the first slice is set to be the same as the first tile; A method, wherein if the first slice is one of multiple slices generated by partitioning the first tile, the explicit numeric information is coded to a value greater than 0.

7. If the index of a second slice is smaller than the explicit number information, the second height information is encoded for the second slice; The method of claim 6 , wherein if the index of the second slice is equal to or greater than the explicit number information, the second height information is not coded for the second slice.

8. 8. The method of claim 7, wherein if the second height information is not coded for the second slice, the height of the second slice has the smallest height among the height of another slice for which the second height information was last coded and the remaining height excluding the area occupied by the previous slice in the first tile.

Citation Information

Patent Citations

  • Image / video coding method and apparatus

    WO2021107622A1

  • Method and device for signaling information related to slice in image / video encoding / decoding system

    WO2021107626A1