Method and apparatus for encoding / decoding image signals

By partitioning the picture into multiple parallel blocks or strips and adopting the parallel block index and difference information partitioning method, the video signal encoding/decoding is optimized, which solves the problem of low encoding/decoding efficiency in high-definition video services and realizes a more efficient encoding/decoding process.

CN112789860BActive Publication Date: 2025-09-09APPLE INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080005504.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-04-23
Filing Date
2020-04-16
Publication Date
2025-09-09
Estimated Expiration
2040-04-16

AI Technical Summary

Technical Problem

As display panels become larger and the amount of data for high-definition video services increases, the compression performance of the existing video coding standard HEVC has gradually shown its limitations, resulting in low encoding/decoding efficiency.

Method used

The picture is partitioned into multiple parallel blocks or strips, and the encoding/decoding process of the video signal is optimized by partitioning based on the parallel block index and the difference information with the previous strip, using raster scanning or rectangular shape definition methods.

Benefits of technology

The encoding/decoding efficiency of the video signal is improved. By partitioning the picture into multiple parallel blocks or strips and performing partitioning based on parallel block index and difference information, the encoding/decoding efficiency is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112789860B_ABST
    Figure CN112789860B_ABST
Patent Text Reader

Abstract

An image decoding method according to the present invention includes: a step for dividing a current picture into a plurality of tiles; a step for decoding partition information indicating a slice definition method; and a step for determining a first slice based on the partition information.
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 apparatus thereof. Background Art

[0002] As display panels become larger, higher quality video services are required. The biggest problem with high-definition video services is the greatly increased amount of data. To solve the above problems, research on improving video compression rates is being actively conducted. As a representative example, the Joint Task Force on Video Coding (JCT-VC) was established in 2009 by the Moving Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) under the International Telecommunication Union Telecommunication Standardization Division (ITU-T). JCT-VC proposed a video compression standard: High Efficiency Video Coding (HEVC), which has a compression performance approximately twice that of H.264 / AVC and was approved as a standard on January 25, 2013. However, with the rapid development of high-definition video services, the performance of HEVC has gradually shown its limitations. Summary of the Invention

[0003] Technical Purpose

[0004] An object of the present disclosure is to provide a method for partitioning a picture into a plurality of tiles or a plurality of slices when encoding / decoding a video signal and an apparatus for performing the method.

[0005] An object of the present disclosure is to provide a method for partitioning a slice based on a tile index when partitioning a picture into a plurality of tiles, and an apparatus for performing the method.

[0006] An object of the present disclosure is to provide a method for partitioning a slice based on difference information from a previous slice when partitioning a picture into a plurality of slices, and an apparatus for performing the method.

[0007] Technical objectives obtainable from the present disclosure are not limited to the above-mentioned technical objectives, and other unmentioned technical objectives can be clearly understood from the following description by those skilled in the art in the technical field to which the present disclosure pertains.

[0008] Technical Solution

[0009] A video signal decoding method according to the present disclosure may include partitioning a current picture into a plurality of tiles, decoding partition information indicating a slice definition method, and determining a first tile based on the partition information. In this case, the partition information indicates a first definition method based on raster scanning or a second definition method based on a rectangular shape. Furthermore, when the partition information indicates the second definition method, the first tile may be determined based on difference information indicating an index difference between a first tile in the first tile and a first tile in the second tile.

[0010] A video signal encoding method according to the present disclosure may include partitioning a current picture into a plurality of tiles, determining a slice definition method, and determining a first tile based on the slice definition method. In this case, the slice definition method may be a first raster scan-based definition method or a second rectangular shape-based definition method. Furthermore, when the slice definition method is the second raster scan-based definition method, difference information indicating an index difference between a first tile in the first tile and a first tile in the second tile may be encoded.

[0011] In the video signal decoding method according to the present disclosure, for the first slice or the last slice in the slices in the current picture, signal transmission of the difference information may be omitted.

[0012] In the video signal decoding method according to the present disclosure, the size of the first slice may be determined based on width information of the first slice and height information of the first slice.

[0013] In the video signal decoding method according to the present disclosure, when the first slice is not adjacent to the left boundary in the current picture, the height information may be set to be the same as the height information of a previous slice of the first slice.

[0014] In the video signal decoding method according to the present disclosure, when the partition information indicates the first definition method, the first slice may be determined based on information indicating the number of tiles included in the first slice.

[0015] It will be understood that the foregoing summarized features are exemplary aspects of the following detailed description of the disclosure and do not limit the scope of the disclosure.

[0016] Technical Effects

[0017] According to the present disclosure, encoding / decoding efficiency may be improved by partitioning a picture into a plurality of tiles or slices.

[0018] According to the present disclosure, encoding / decoding efficiency may be improved by partitioning slices based on parallel block indices.

[0019] According to the present disclosure, encoding / decoding efficiency may be improved by partitioning a slice based on difference information from a previous slice.

[0020] Effects obtainable from the present disclosure may not be limited to the above-mentioned effects, and other unmentioned effects may be clearly understood from the following description by those having ordinary skill in the technical field to which the present disclosure pertains. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1is a diagram illustrating a block diagram of a video encoding device (encoder) according to an embodiment of the present disclosure.

[0022] Figure 2 is a diagram illustrating a block diagram of a video decoding device (decoder) according to an embodiment of the present disclosure.

[0023] Figure 3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.

[0024] Figure 4 is a diagram illustrating various partition types of a coding block.

[0025] Figure 5 is a diagram illustrating an example of one aspect of partitioning a CTU.

[0026] Figure 6 is a flowchart of an inter-frame prediction method according to an embodiment of the present disclosure.

[0027] Figure 7 is a diagram illustrating non-linear motion of an object.

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

[0029] Figure 9 is a diagram showing an affine seed vector for each affine motion model.

[0030] Figure 10 is a diagram showing affine vectors of sub-blocks in a 4-parameter motion model.

[0031] Figure 11 is a diagram illustrating candidate blocks used to derive merge candidates.

[0032] Figure 12 2 is a diagram for explaining the updating aspect of the motion information table.

[0033] Figure 13 2 is a diagram for explaining the updating aspect of the motion information table.

[0034] Figure 14 is a diagram illustrating an update aspect of a motion information table.

[0035] Figure 15 : is a diagram illustrating an example of updating the index of the stored motion information candidate.

[0036] Figure 16 is a diagram illustrating an example in which a redundancy check is performed only on a part of merging candidates.

[0037] Figure 17is a diagram illustrating an example of omitting a redundant check with a specific merge candidate.

[0038] Figure 18 : is a diagram illustrating an example in which a candidate block included in the same merge processing region as a current block is set to be unusable as a merge candidate.

[0039] Figure 19 is a diagram illustrating an example of deriving a merge candidate for a current block when the current block is included in a merge processing region.

[0040] Figure 20 is a diagram showing a temporary motion information table.

[0041] Figure 21 is a diagram illustrating an example in which a motion information table and a temporary motion information table are unified.

[0042] Figure 22 is a flowchart of an intra-frame prediction method according to an embodiment of the present disclosure.

[0043] Figure 23 is a diagram illustrating an intra prediction mode.

[0044] Figure 24 and Figure 25 is a diagram illustrating an example of a one-dimensional array in which reference spots are arranged in a row.

[0045] Figure 26 is a diagram showing angles formed by directional intra prediction modes and a straight line parallel to the x-axis.

[0046] Figure 27 is a diagram illustrating an aspect of obtaining prediction samples when a current block has a non-square shape.

[0047] Figure 28 is a diagram illustrating a wide-angle intra prediction mode.

[0048] Figure 29 is a diagram illustrating an example of determining whether to perform transform skip for each subblock.

[0049] Figure 30 is a diagram illustrating an example in which subblocks use the same transform type.

[0050] Figure 31 is a flow chart illustrating a process for determining block strength.

[0051] Figure 32 Predefined filter candidates are shown.

[0052] Figure 33 is a diagram illustrating a screen partitioning method according to an embodiment of the present disclosure.

[0053] Figure 34 An example of partitioning a screen into a plurality of tiles is shown.

[0054] Figure 35 It is a diagram for explaining the generation of blocks.

[0055] Figure 36 and Figure 37 is a diagram illustrating an example of defining stripes based on a raster order.

[0056] Figure 38 is a diagram showing an example in which only stripes of a rectangular shape are allowed. DETAILED DESCRIPTION

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

[0058] Image encoding and decoding are performed on a block basis. In an example, encoding / decoding processes such as transform, quantization, prediction, in-loop filtering, reconstruction, etc. may be performed on a coding block, a transform block, or a prediction block.

[0059] Hereinafter, the encoding / decoding target block is referred to as a “current block.” In an example, the current block may refer to a coding block, a transform block, or a prediction block according to a current encoding / decoding process.

[0060] In addition, the term "unit" used in this specification refers to a basic unit for performing a specific encoding / decoding process, and "block" can be understood to mean a sample array of a predetermined size. Unless otherwise specified, "block" and "unit" are used interchangeably. In the examples described later, the coding block and the coding unit can be understood to have the same meaning.

[0061] Figure 1 is a diagram illustrating a block diagram of an image encoding device (encoder) according to an embodiment of the present disclosure.

[0062] Reference Figure 1 The image encoding apparatus may include a picture partition unit 110, a prediction unit 120 and a prediction unit 125, a transform unit 130, a quantization unit 135, a rearrangement 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.

[0063] Figure 1The components described in the figure are shown separately to illustrate different characteristic functions of the image encoding device, and the figure does not mean that each component is composed of separate hardware or a software unit. That is, each component is listed only for the convenience of explanation, and at least two of the components may constitute a single component, or a single component may be partitioned into multiple components that can perform their functions. Even embodiments that integrate the components and embodiments that partition the components are included within the scope of the present disclosure unless they depart from the spirit of the present disclosure.

[0064] In addition, some components are not essential components for performing the essential functions of the present disclosure, but are optional components used only to improve performance. The present disclosure can be implemented using essential components for implementing the spirit of the present disclosure other than components used only to improve performance, and a structure including only essential components other than optional components used only to improve performance is also included in the scope of the present disclosure.

[0065] The picture partition unit 110 may partition an input picture into at least one processing unit. In this regard, a processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). In the picture partition unit 110, a single picture may be partitioned into a plurality of combinations of coding units, prediction units, and transform units, and the picture may be encoded by selecting a combination of coding units, prediction units, and transform units according to a predetermined condition (e.g., a cost function).

[0066] For example, a single picture can be partitioned into multiple coding units. To partition a picture into coding units, a recursive tree structure such as a quadtree structure can be used, and a coding unit derived from a root such as a single image or a maximum coding unit can be partitioned into other coding units and can have as many child nodes as the partitioned coding units. Coding units that are no longer partitioned according to specific restrictions become leaf nodes. That is, when it is assumed that only square partitions are available for a single coding unit, a single coding unit can be partitioned into up to four other coding units.

[0067] Hereinafter, in an embodiment of the present disclosure, a coding unit may be used as a unit for encoding, or may be used as a unit for decoding.

[0068] The prediction units may be obtained by partitioning a single coding unit into at least one square or rectangle having the same size, or may be partitioned into prediction units in such a manner that one prediction unit may be different in shape and / or size from another prediction unit.

[0069] When a prediction unit is generated based on a coding block on which intra prediction is being performed, when the coding unit is not a minimum coding unit, intra prediction may be performed without performing partitioning into a plurality of N×N prediction units.

[0070] Prediction units 120 and 125 may include an inter-frame prediction unit 120 for performing inter-frame prediction and an intra-frame prediction unit 125 for performing intra-frame prediction. Whether inter-frame prediction or intra-frame prediction is performed on a prediction unit may be determined, and detailed information based on each prediction method (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) may be determined. In this regard, the processing unit for which prediction is performed may be different from the prediction unit for which the prediction method and its details are determined. For example, the prediction method, prediction mode, etc. may be determined based on the prediction unit, and prediction may be performed based on the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130. Furthermore, prediction mode information, motion vector information, etc. used for prediction may be encoded using the residual value by the entropy encoding unit 165 and transmitted to the decoder. When a specific encoding mode is used, the original block is encoded as is, without generating a prediction block by the prediction unit 120 or prediction unit 125, and transmitted to the decoding unit.

[0071] The inter-frame prediction unit 120 may predict a prediction unit based on information about at least one of a previous picture and a subsequent picture of the current picture, or in some cases, may predict a prediction unit based on information about some encoded regions in the current picture. The inter-frame prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0072] The reference picture interpolation unit may receive reference picture information from the memory 155 and may generate pixel information of integer pixels or smaller pixels from the reference picture. In the case of luma pixels, an 8-tap DCT-based interpolation filter with different coefficients may be used to generate pixel information about integer pixels or smaller pixels in units of 1 / 4 pixels. In the case of chroma pixels, a 4-tap DCT-based interpolation filter with different filter coefficients may be used to generate pixel information about integer pixels or smaller pixels in units of 1 / 8 pixels.

[0073] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods such as a full search based matching algorithm (FBMA), a three-step search (TSS) algorithm, and a new three-step search (NTS) algorithm may be used as a method for calculating a motion vector. The motion vector may have a motion vector value in units of 1 / 2 pixels or 1 / 4 pixels based on the interpolated pixels. The motion prediction unit may predict the current prediction unit by changing the motion prediction method. Various methods such as a skip method, a merge method, an advanced motion vector prediction (AMVP) method, and an intra-block copy method may be used as the motion prediction method.

[0074] The intra-frame prediction unit 125 can generate a prediction unit based on information about reference pixels surrounding the current block, which is pixel information in the current picture. When the neighboring block of the current prediction unit is a partition subjected to inter-frame prediction, and therefore the reference pixel is a pixel subjected to inter-frame prediction, the reference pixel included in the partition subjected to inter-frame prediction can be replaced with information about the reference pixel of the neighboring block subjected to intra-frame prediction. In other words, when the reference pixel is unavailable, at least one reference pixel among the available reference pixels can be used to replace the unavailable reference pixel information.

[0075] The prediction mode for intra prediction may include a directional prediction mode that uses reference pixel information according to a prediction direction when performing prediction, and a non-directional mode that does not use directional information when performing prediction. The mode for predicting luma information may be different from the mode for predicting chroma information. To predict chroma information, information about the intra prediction mode for predicting luma information or information about the predicted luma signal may be used.

[0076] When performing intra prediction, if the size of the prediction unit is the same as the size of the transformation unit, intra prediction can be performed on the prediction unit based on pixels located to the left, above the left, and top of the prediction unit. However, when performing intra prediction, if the size of the prediction unit is different from the size of the transformation unit, intra prediction can be performed using reference pixels based on the transformation unit. In addition, intra prediction using N×N partitions can be used only for the smallest coding unit.

[0077] In the intra prediction method, a prediction block may be generated after applying an adaptive intra smoothing (AIS) filter to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels may vary. In order to perform the intra prediction method, an intra prediction mode for the current prediction unit may be predicted from the intra prediction modes of prediction units existing around the current prediction unit. When the prediction mode for the current prediction unit is predicted by using mode information predicted from neighboring prediction units, when the intra prediction mode for the current prediction unit is the same as the intra prediction mode of the neighboring prediction unit, information indicating that the current prediction unit and the neighboring prediction unit have the same prediction mode may be transmitted by using predetermined flag information. When the prediction mode for the current prediction unit is different from the prediction mode of the neighboring prediction unit, entropy coding may be performed to encode information about the prediction mode for the current block.

[0078] In addition, a residual block including information on a residual value, which is a difference value between a prediction unit predicted by prediction unit 120 or 125 and its original block, may be generated. The generated residual block may be input to transform unit 130.

[0079] Transform unit 130 may transform the residual block using a transform method such as discrete cosine transform (DCT) or discrete sine transform (DST), wherein the residual block includes information about residual values ​​between the original block and the prediction unit generated by prediction unit 120 or prediction unit 125. In this regard, the DCT transform kernel includes at least one of DCT2 or DCT8, and the DST transform kernel includes DST7. Whether to apply DCT or DST to transform the residual block may be determined based on information about the intra prediction mode of the prediction unit used to generate the residual block. Transformation may be skipped for the residual block. A flag indicating whether to skip transformation for the residual block may be encoded. Transform skipping may be permitted for residual blocks whose size is less than or equal to a threshold, residual blocks of luma components in a 4:4:4 format, or residual blocks of chroma components.

[0080] The quantization unit 135 may quantize the value transformed into the frequency domain by the transform unit 130. The quantization coefficient may vary according to the importance or block of the image. The value calculated in the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.

[0081] The rearrangement unit 160 may perform rearrangement on the transform coefficients with respect to the quantized residual values.

[0082] The rearrangement unit 160 may convert the coefficients in the two-dimensional block form into coefficients in the one-dimensional vector form using a coefficient scanning method. For example, the rearrangement unit 160 may scan from the DC coefficient to the coefficients in the high frequency domain using a zigzag scanning method to convert the coefficients into the one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical scanning, which scans the coefficients in the two-dimensional block form along the column direction, or horizontal scanning, which scans the coefficients in the two-dimensional block form along the row direction, may be used instead of the zigzag scanning. In other words, which scanning method to use, zigzag scanning, vertical scanning, or horizontal scanning, may be determined based on the size of the transform unit and the intra-frame prediction mode.

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

[0084] The entropy coding unit 165 may encode various types of information obtained from the rearrangement unit 160 and the prediction units 120 and 125 (such as information about residual value coefficients and information about the blocking type of the coding unit, information about the prediction mode, information about the partition unit, information about the prediction unit and information about the transformation unit, information about the motion vector, information about the reference frame, information about block interpolation, filtering information, etc.).

[0085] The entropy encoding unit 165 may entropy encode the coefficients of the coding unit input from the rearrangement unit 160 .

[0086] The inverse quantization unit 140 may perform inverse quantization on the value quantized in the quantization unit 135, and the inverse transform unit 145 may perform inverse transform on the value transformed in the transform unit 130. Residual values ​​generated by the inverse quantization unit 140 and the inverse transform unit 145 may be added to a prediction unit predicted by a motion estimation unit, a motion compensation unit, or an intra prediction unit included in the prediction units 120 and 125 to generate a reconstructed block.

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

[0088] A deblocking filter removes blocking distortion caused by boundaries between blocks in a reconstructed image. Whether to perform deblocking is determined based on the number of rows or columns of pixels in the block. When a deblocking filter is applied to a block, a strong or weak filter is applied depending on the desired deblocking filter strength. Furthermore, when applying a deblocking filter, horizontal and vertical filtering can be performed in parallel.

[0089] The offset correction unit may correct the original image with an offset in pixel units relative to the deblocked image. To perform offset correction on a specific picture, a method of applying an offset to a region determined after partitioning the pixels of the image into a predetermined number of regions, or a method of applying an offset based on edge information of each pixel may be used.

[0090] Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing a filtered reconstructed image with an original image. Pixels included in an image can be partitioned into predetermined groups, a filter to be applied to each group can be determined, and filtering can be performed separately for each group. Information on whether ALF is applied can be transmitted for each coding unit (CU) for a luma signal, and the shape and filter coefficients of the ALF filter to be applied can vary based on each block. Alternatively, an ALF filter having the same shape (fixed shape) can be applied regardless of the characteristics of the block to which the filter is applied.

[0091] In the memory 155, a reconstructed block or a reconstructed picture calculated by the filter unit 150 may be stored. When inter prediction is performed, the stored reconstructed block or the reconstructed picture may be provided to the prediction unit 120 or the prediction unit 125.

[0092] Figure 2 is a diagram illustrating a block diagram of an image decoding device (decoder) according to an embodiment of the present disclosure.

[0093] Reference Figure 2 , the image decoding apparatus may include an entropy decoding unit 210 , a rearrangement 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 .

[0094] When an image bitstream is input from an encoder, the input bitstream may be decoded according to an inverse process of the image encoding apparatus.

[0095] The entropy decoding unit 210 may perform entropy decoding according to the inverse process of the entropy encoding performed by the entropy encoding unit of the image encoder. For example, various methods such as exponential Golomb coding, context-adaptive variable length coding (CAVLC), or context-adaptive binary arithmetic coding (CABAC) may be applied in association with the method performed by the image encoder device.

[0096] The entropy decoding unit 210 may decode information about intra prediction and inter prediction performed by the encoder.

[0097] The rearrangement unit 215 can rearrange the bitstream entropy-decoded by the entropy decoding unit 210 based on the rearrangement method used in the encoder. The coefficients represented in the one-dimensional vector form can be reconstructed and rearranged into coefficients in the form of two-dimensional blocks. The rearrangement unit 215 can perform the rearrangement by receiving information related to the coefficient scanning performed in the encoder and performing an inverse scanning method based on the scanning order performed in the encoder.

[0098] The inverse quantization unit 220 may perform inverse quantization based on the quantization parameter received from the encoder and the coefficient values ​​of the rearranged partitions.

[0099] The inverse transform unit 225 may perform an inverse transform (i.e., inverse DCT or inverse DST) on the quantization result of the transform unit in the image encoder. In this regard, the DCT transform core may include at least one of DCT2 or DCT8, and the DST transform core may include DST7. Optionally, when the transform is skipped in the image encoder, the inverse transform unit 225 also does not perform the inverse transform. The inverse transform may be performed based on the transform unit determined by the image encoder. The inverse transform unit 225 of the image decoder may selectively perform a transform method (e.g., DCT or DST) based on multiple pieces of information (e.g., prediction method, current block size, prediction direction, etc.).

[0100] The prediction unit 230 or the prediction unit 235 may generate a prediction block based on the information related to the prediction block received from the entropy decoding unit 210 and the information about the previously decoded block or picture received from the memory 245 .

[0101] As described above, as in the operation of the image encoder, when performing intra-frame prediction, when the size of the prediction unit is the same as the size of the transformation unit, intra-frame prediction can be performed on the prediction unit based on the pixels located to the left, above the left, and top of the prediction unit. However, when performing intra-frame prediction, when the size of the prediction unit is different from the size of the transformation unit, intra-frame prediction can be performed based on the transformation unit by using reference pixels. In addition, intra-frame prediction using N×N partitions can be used only for the smallest coding unit.

[0102] Prediction units 230 and 235 may include a PU determination module, an inter-frame prediction unit, and an intra-frame prediction unit. The PU determination unit may receive various types of information input from the entropy decoding unit 210 (such as information about the prediction unit, information about the prediction mode of the intra-frame prediction method, information about the motion prediction of the inter-frame prediction method, etc.), may divide the prediction unit in the current coding unit, and may determine whether to perform inter-frame prediction or intra-frame prediction on the prediction unit. By using the information required for inter-frame prediction of the current prediction unit received from the image encoder, the inter-frame prediction unit 230 may perform inter-frame prediction on the current prediction unit based on information about at least one of a previous picture and a subsequent picture of the current picture including the current prediction unit. Alternatively, inter-frame prediction may be performed based on information about some pre-reconstructed areas in the current picture including the current prediction unit.

[0103] In order to perform inter prediction, which method of skip mode, merge mode, AMVP mode, or intra block copy mode is used as a motion prediction method for a prediction unit included in the coding unit may be determined based on the coding unit.

[0104] The intra-frame prediction unit 235 can generate a prediction block based on information about pixels within the current picture. When the prediction unit is a prediction unit that has already been intra-frame predicted, intra-frame prediction can be performed based on information about the intra-frame prediction mode of the prediction unit received from the image encoder. The intra-frame prediction unit 235 may include an adaptive intra-frame smoothing (AIS) filter, a reference pixel interpolation module, or a DC filter. The AIS filter can filter the reference pixels of the current block, and whether to apply the filter can be determined based on the prediction mode used for the current prediction unit. When AIS filtering is performed on the reference pixels of the current block, the prediction mode of the prediction unit received from the image encoder and information about the AIS filter can be used. When the prediction mode used for the current block is a mode to which AIS filtering is not applied, the AIS filter may not be applied.

[0105] When the prediction mode of the prediction unit is a prediction mode for performing intra-frame prediction based on pixel values ​​obtained by interpolating reference pixels, the reference pixel interpolation unit may interpolate the reference pixels to generate reference pixels having integer units or smaller units. When the prediction mode for the current prediction unit is a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode for the current block is the DC mode, the DC filter may generate a prediction block through filtering.

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

[0107] Information on whether a deblocking filter has been applied to a corresponding block or picture and information on whether a strong filter or a weak filter is applied when the deblocking filter is applied may be received from the image encoder. A deblocking filter of the image decoder may receive information on the deblocking filter from the image encoder, and the image decoder may perform deblocking filtering on the corresponding block.

[0108] The offset correction unit may perform offset correction on the reconstructed image based on the type of offset correction applied to the image when encoding is performed, information about the offset value, and the like.

[0109] ALF may be applied to the coding unit based on information on whether ALF is applied, information on an ALF coefficient, etc. received from the encoder. The above ALF information may be provided by being included in a specific parameter set.

[0110] In the memory 245 , the reconstructed picture or the reconstructed block may be stored so as to be used as a reference picture or a reference block, and the reconstructed picture may be provided to the output unit.

[0111] Figure 3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.

[0112] The largest coding block may be defined as a coding tree block. A single picture may be partitioned into multiple coding tree units (CTUs). A CTU may be a coding unit of the largest size and may be referred to as a largest coding unit (LCU). Figure 3 is a diagram illustrating an example in which a single picture is partitioned into a plurality of CTUs.

[0113] The size of a CTU can be defined at the picture level or the sequence level. Similarly, information indicating the size of a CTU can be signaled via a picture parameter set or a sequence parameter set.

[0114] In an example, the size of a CTU for an entire picture within a sequence may be set to 128×128. Alternatively, either 128×128 or 256×256 may be determined as the size of the CTU at a picture level. In an example, a CTU may be set to have a size of 128×128 in a first picture, and a CTU may be set to have a size of 256×256 in a second picture.

[0115] Coding blocks can be generated by partitioning the CTU. A coding block represents a basic unit for performing encoding / decoding. In an example, prediction or transformation can be performed for each coding block, and optionally, a prediction coding mode can be determined for each coding block. In this regard, the prediction coding mode represents a method for generating a predicted image. In an example, the prediction coding mode may include intra-frame prediction, inter-frame prediction, current picture reference (CPR), intra-frame block copy (IBC), or combined prediction. For a coding block, a prediction block of the coding block can be generated by using a prediction coding mode of at least one of intra-frame prediction, inter-frame prediction, current picture reference, or combined prediction.

[0116] Information indicating the prediction coding mode for the current block may be signaled in the bitstream. In an example, the information may be a 1-bit flag indicating whether the prediction coding mode is intra mode or inter mode. When the prediction coding mode for the current block is determined to be inter mode, current picture reference or combined prediction may be available.

[0117] The current picture reference is a prediction block for the current block obtained by setting the current picture as the reference picture and obtaining the prediction block for the current block from an already encoded / decoded area within the current picture. In this regard, the current picture refers to the picture that includes the current block. Information indicating whether the current picture reference is applied to the current block can be signaled in the bitstream. In an example, the information can be a 1-bit flag. When the flag is true (TRUE), the prediction coding mode for the current block can be determined to be current picture reference. When the flag is false (FALSE), the prediction coding mode for the current block can be determined to be inter-frame prediction.

[0118] Alternatively, the prediction coding mode for the current block may be determined based on a reference picture index. In this example, when the reference picture index indicates the current picture, the prediction coding mode for the current block may be determined as current picture reference. When the reference picture index indicates a picture other than the current picture, the prediction coding mode for the current block may be determined as inter-frame prediction. In other words, current picture reference is a prediction method that uses information about an already encoded / decoded area within the current picture, while inter-frame prediction is a prediction method that uses information about another already encoded / decoded picture.

[0119] Combined prediction refers to a combined coding mode that combines at least two of intra-frame prediction, inter-frame prediction, and current picture reference. In an example, when combined prediction is applied, a first prediction block may be generated based on any one of intra-frame prediction, inter-frame prediction, or current picture reference, and a second prediction block may be generated based on the other of intra-frame prediction, inter-frame prediction, or current picture reference. Once the first prediction block and the second prediction block are generated, a final prediction block may be generated by calculating an average or weighted sum of the first prediction block and the second prediction block. Information indicating whether combined prediction is applied to the current block may be signaled in the bitstream. This information may be a 1-bit flag.

[0120] Figure 4 is a diagram illustrating various partition types of a coding block.

[0121] The coding block may be partitioned into multiple coding blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning. The partitioned coding block may be further partitioned into multiple coding blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning.

[0122] Quadtree partitioning represents a method of partitioning the current block into four blocks. As a result of quadtree partitioning, the current block can be partitioned into four square partitions (refer to Figure 4 (a) "SPLIT_QT").

[0123] Binary tree partitioning refers to a method for partitioning a current block into two blocks. The operation of partitioning the current block into two blocks along the vertical direction (that is, using a vertical line passing through the current block) can be referred to as vertical binary tree partitioning, and the operation of partitioning the current block into two blocks along the horizontal direction (that is, using a horizontal line passing through the current block) can be referred to as horizontal binary tree partitioning. As a result of binary tree partitioning, the current block can be partitioned into two non-square partitions. Figure 4 "SPLIT_BT_VER" of (b) is a diagram showing the result of vertical binary tree partitioning. Figure 4 "SPLIT_BT_HOR" of (c) is a diagram showing the result of horizontal binary tree partitioning.

[0124] Ternary tree partitioning refers to a method for partitioning a current block into three blocks. The operation of partitioning the current block into three blocks along the vertical direction (i.e., using two vertical lines passing through the current block) is referred to as vertical ternary tree partitioning, and the operation of partitioning the current block into three blocks along the horizontal direction (i.e., using two horizontal lines passing through the current block) is referred to as horizontal ternary tree partitioning. As a result of ternary tree partitioning, the current block can be partitioned into three non-square partitions. In this regard, the width / height of the partition located at the center of the current block can be twice the width / height of the other partitions. Figure 4"SPLIT_TT_VER" of (d) is a diagram showing the result of vertical ternary tree partitioning. Figure 4 "SPLIT_TT_HOR" of (e) is a diagram showing the result of ternary tree partitioning in the horizontal direction.

[0125] The number of partitions of a CTU can be defined as the partition depth. The maximum partition depth of a CTU can be determined at the sequence level or the picture level. Therefore, the maximum partition depth of a CTU can vary based on the sequence or picture.

[0126] Alternatively, the maximum partition depth may be determined independently for each partitioning method. In an example, the maximum partition depth allowed for quadtree partitioning may be different from the maximum partition depth allowed for binary tree partitioning and / or ternary tree partitioning.

[0127] The encoder may signal information indicating at least one of a partition type and a partition depth of the current block in a bitstream, and the decoder may determine the partition type and partition depth of the CTU based on the information obtained by parsing the bitstream.

[0128] Figure 5 is a diagram illustrating an example of one aspect of partitioning a CTU.

[0129] An operation of partitioning a coding block by using quadtree partitioning, binary tree partitioning, and / or ternary tree partitioning may be referred to as multitree partitioning.

[0130] A coding block generated by partitioning a coding block by applying multi-tree partitioning may be referred to as a sub-coding block. When the partition depth of the coding block is k, the partition depth of the sub-coding block is set to k+1.

[0131] In contrast, for a coding block with a partition depth of k+1, the coding block with a partition depth of k can be referred to as a parent coding block.

[0132] The partition type of the current coding block may be determined based on at least one of the partition type of the parent coding block and the partition type of the adjacent coding block. In this regard, the adjacent coding block may be a partition adjacent to the current coding block and may include at least one of a top adjacent block, a left adjacent block, or a adjacent block adjacent to the upper left corner of the current coding block. In this regard, the partition type may include whether quadtree partitioning is applied, whether binary tree partitioning is applied, the direction of the binary tree partitioning, whether ternary tree partitioning is applied, or the direction of the ternary tree partitioning.

[0133] In order to determine the partition type of the coding block, information indicating whether the coding block is partitioned can be signaled in the bitstream. The information can be a 1-bit flag "split_cu_flag", and when the flag is true, it can indicate that the coding block is partitioned by the multi-tree partitioning method.

[0134] When split_cu_flag is true, information indicating whether the coding block is partitioned by quadtree partitioning can be signaled in the bitstream. The information is a 1-bit flag split_qt_flag, and when this flag is true, the coding block can be partitioned into four blocks.

[0135] In the example, Figure 5 In the example shown in FIG, a CTU is partitioned by quadtree partitioning, and thus four coding blocks with a partition depth of 1 are generated. In addition, quadtree partitioning is again applied to the first and fourth coding blocks of the four coding blocks generated by quadtree partitioning. As a result, four coding blocks with a partition depth of 2 can be generated.

[0136] In addition, by applying quadtree partitioning again to the coding block with a partition depth of 2, a coding block with a partition depth of 3 may be generated.

[0137] When quadtree partitioning is not applied to a coding block, whether binary or ternary tree partitioning is performed on the coding block may be determined based on at least one of the size of the coding block, whether the coding block is located at a picture boundary, the maximum partition depth, or the partition type of the neighboring blocks. When it is determined that binary or ternary tree partitioning is performed on the coding block, information indicating the partitioning direction may be signaled in the bitstream. This information may be a 1-bit flag, mtt_split_cu_vertical_flag. Based on this flag, it may be determined whether the partitioning direction is vertical or horizontal. In addition, information indicating which of binary or ternary tree partitioning is applied to the coding block may be signaled in the bitstream. This information may be a 1-bit flag, mtt_split_cu_binary_flag. Based on this flag, it may be determined whether binary or ternary tree partitioning is applied to the coding block.

[0138] In the example, Figure 5 In the example shown in , vertical binary tree partitioning is applied to a coding block with a partition depth of 1, vertical ternary tree partitioning is applied to a left coding block among the coding blocks generated by the vertical binary tree partitioning, and vertical binary tree partitioning is applied to a right coding block.

[0139] Inter-frame prediction is a predictive coding mode that predicts the current block using information about the previous picture. In this example, a block in the previous picture that is co-located with the current block (hereinafter referred to as a co-located block) can be set as the prediction block for the current block. Hereinafter, a prediction block generated based on the co-located block of the current block may be referred to as a co-located prediction block.

[0140] In contrast, when an object present in a previous picture has moved to another location in the current picture, the current block can be effectively predicted by using the motion of the object. For example, when the direction and size of the object's motion are determined by comparing the previous picture with the current picture, a prediction block (or predicted image) for the current block can be generated based on the object's motion information. Hereinafter, a prediction block generated by using motion information may be referred to as a motion prediction block.

[0141] A residual block may be generated by subtracting a prediction block from a current block. In this regard, when an object moves, the energy of the residual block may be reduced by using a motion prediction block instead of a co-located prediction block, thereby improving compression performance of the residual block.

[0142] As above, the operation of generating a prediction block by using motion information may be referred to as motion estimation prediction. In most inter predictions, a prediction block may be generated based on motion compensation prediction.

[0143] The motion information may include at least one of a motion vector, a reference picture index, a prediction direction, and a bidirectional weighting factor index. The motion vector indicates the direction and magnitude of motion of an object. The reference picture index specifies the reference picture of the current block among the reference pictures included in the reference picture list. The prediction direction indicates any one of unidirectional L0 prediction, unidirectional L1 prediction, or bidirectional prediction (L0 prediction and L1 prediction). At least one of the L0 direction motion information and the L1 direction motion information may be used depending on the prediction direction of the current block. The bidirectional weighting factor index specifies the weighting factor applied to the L0 prediction block and the weighting factor applied to the L1 prediction block.

[0144] Figure 6 is a flowchart of an inter-frame prediction method according to an embodiment of the present disclosure.

[0145] Reference Figure 6 The inter-frame prediction method includes: determining an inter-frame prediction mode for a current block (S601), obtaining motion information of the current block according to the determined inter-frame prediction mode (S602), and performing motion compensated prediction for the current block based on the obtained motion information (S603).

[0146] In this regard, the inter-frame prediction mode may represent various methods for determining the motion information of the current block, and may include an inter-frame prediction mode using translational motion information, an inter-frame prediction mode using affine motion information. In an example, the inter-frame prediction mode using translational motion information may include a merge mode and a motion vector prediction mode, and the inter-frame prediction mode using affine motion information may include an affine merge mode and an affine motion vector prediction mode. The motion information about the current block may be determined based on a neighboring block adjacent to the current block or information obtained by parsing the bitstream. The motion information of the current block may be derived from the motion information of another block. In this regard, the other block may be a partition that is encoded / decoded by inter-frame prediction before the current block. The operation of setting the motion information of the current block to be the same as the motion information of the other block may be defined as a merge mode. In addition, the operation of setting the motion vector of the other block to the predicted value of the motion vector of the current block may be defined as a motion vector prediction mode.

[0147] Hereinafter, an inter prediction method using affine motion information is described in detail.

[0148] Figure 7 is a diagram illustrating non-linear motion of an object.

[0149] In a video, non-linear motion of an object may occur. In the example, Figure 7 In the example shown in , non-linear motion of the object may occur, such as camera zooming in, zooming out, rotating, or affine transformation. For non-linear motion of the object, the translational motion vector may not be able to effectively express the object's motion. Therefore, for areas where non-linear motion of the object occurs, encoding efficiency can be improved by using affine motion instead of translational motion.

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

[0151] Whether to apply the affine motion-based inter prediction method to the current block may be determined based on information parsed from the bitstream. Specifically, whether to apply the affine motion-based inter prediction method to the current block may be determined based on at least one of a flag indicating whether to apply the affine merge mode to the current block or a flag indicating whether to apply the affine motion vector prediction mode to the current block.

[0152] When an inter-frame prediction method based on affine motion is applied to a current block, an affine motion model of the current block may be determined (S801). The affine motion model may be determined as at least one of a 6-parameter affine motion model or a 4-parameter affine motion model. The 6-parameter affine motion model expresses affine motion using 6 parameters, while the 4-parameter affine motion model expresses affine motion using 4 parameters.

[0153] Equation 1 expresses the affine motion by using 6 parameters. The affine motion represents a translation motion with respect to a predetermined area determined by an affine seed vector.

[0154] [Equation 1]

[0155] v x =ax-by+e

[0156] v y =cx+dy+f

[0157] When expressing affine motion using six parameters, complex motion can be expressed, but since more bits are required to encode each parameter, encoding efficiency may decrease. Therefore, affine motion can be expressed using four parameters. Equation 2 expresses affine motion using four parameters.

[0158] Equation 2

[0159] v x =ax-by+e

[0160] v y =bx+ay+f

[0161] Information used to determine the affine motion model for the current block may be encoded and signaled in the bitstream. In an example, the information may be a 1-bit flag, affine_type_flag. If the flag value is 0, it may indicate that a 4-parameter affine motion model is applied, and if the flag value is 1, it may indicate that a 6-parameter affine motion model is applied. The flag may be encoded per slice, tile, or block (e.g., coding block or coding tree unit). When the flag is signaled at the slice level, the affine motion model determined at the slice level may be applied to all blocks belonging to the slice.

[0162] Optionally, an affine motion model for the current block may be determined based on an affine inter prediction mode for the current block. In an example, when affine merge mode is applied, the affine motion model for the current block may be determined as a 4-parameter motion model. On the other hand, when affine motion vector prediction mode is applied, information for determining the affine motion model for the current block may be encoded and signaled in the bitstream. In an example, when affine motion vector prediction mode is applied to the current block, the affine motion model for the current block may be determined based on a 1-bit flag, "affine_type_flag."

[0163] Next, an affine seed vector for the current block may be derived (S802). When a 4-parameter affine motion model is selected, motion vectors at two control points of the current block may be derived. On the other hand, when a 6-parameter affine motion model is selected, motion vectors at three control points of the current block may be derived. The motion vectors at the control points may be referred to as affine seed vectors. The control points may include at least one of the upper left corner, upper right corner, or lower left corner of the current block.

[0164] Figure 9 is a diagram showing an affine seed vector for each affine motion model.

[0165] In a 4-parameter affine motion model, affine seed vectors for two of the top left corner, top right corner, or bottom left corner can be derived. In an example, as in Figure 9 In the example shown in (a), when the 4-parameter affine motion model is selected, the affine vector can be derived by using the affine seed vector sv0 of the upper left corner of the current block (e.g., the upper left sample point (x1, y1)) and the affine seed vector sv1 of the upper right corner of the current block (e.g., the upper right sample point (x1, y1)). The affine seed vector of the lower left corner can be used instead of the affine seed vector of the upper left corner, or the affine seed vector of the lower left corner can be used instead of the affine seed vector of the upper right corner.

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

[0167] In the embodiment described later, under the 4-parameter affine motion model, the affine seed vectors at the upper left control point and the upper right control point are respectively referred to as the first affine seed vector and the second affine seed vector. In the embodiment described later using the first affine seed vector and the second affine seed vector, at least one of the first affine seed vector and the second affine seed vector may be replaced by the affine seed vector at the lower left control point (the third affine seed vector) or the affine seed vector at the lower right control point (the fourth affine seed vector).

[0168] In addition, under the 6-parameter affine motion model, the affine seed vectors at the upper left control point, the upper right control point, and the lower left control point are respectively referred to as the first affine seed vector, the second affine seed vector, and the third affine seed vector. In the embodiment described later using the first affine seed vector, the second affine seed vector, and the third affine seed vector, the affine seed vector at the lower right control point (the fourth affine seed vector) may be used to replace at least one of the first affine seed vector, the second affine seed vector, and the third affine seed vector.

[0169] An affine vector may be derived for each sub-block using an affine seed vector S803. In this regard, the affine vector represents a translation motion vector derived based on the affine seed vector. The affine vector of the sub-block may be referred to as an affine sub-block motion vector or a sub-block motion vector.

[0170] Figure 10 is a diagram showing affine vectors of sub-blocks under a 4-parameter motion model.

[0171] The affine vector of the sub-block may be derived based on the position of the control point, the position of the sub-block, and the affine seed vector. In an example, Equation 3 represents an example of deriving an affine sub-block motion vector.

[0172] Equation 3

[0173]

[0174]

[0175] In Equation 3, (x, y) represents the position of the sub-block. In this regard, the position of the sub-block represents the position of the basic sample point included in the sub-block. The basic sample point may be a sample point located at the upper left corner of the sub-block or a sample point at the center position of at least one of the x-axis or y-axis coordinates. (x0, y0) represents the position of the first control point, and (sv 0x ,sv 0y ) represents the first affine seed vector. In addition, (x1, y1) represents the position of the second control point, and (sv 1x ,sv 1y ) represents the second affine seed vector.

[0176] When the first control point and the second control point correspond to the upper left corner and the upper right corner of the current block, respectively, x1-x0 may be set to the same value as the width of the current block.

[0177] Afterwards, motion compensation prediction for each sub-block may be performed using the affine vector of each sub-block (S804). As a result of performing motion compensation prediction, a prediction block for each sub-block may be generated. The prediction block of the sub-block may be set as the prediction block of the current block.

[0178] The affine seed vector of the current block may be derived based on the affine seed vectors of neighboring blocks adjacent to the current block. When the inter prediction mode of the current block is affine merge mode, the affine seed vector of the merge candidate included in the merge candidate list may be determined as the affine seed vector of the current block. In addition, when the inter prediction mode of the current block is affine merge mode, the motion information including at least one of the reference picture index, the specific direction prediction flag, or the bidirectional weight of the current block may also be set to be the same as that of the merge candidate.

[0179] Next, an inter prediction method using translational motion information will be described in detail.

[0180] The motion information of the current block can be derived from the motion information of another block. In this regard, the other block may be a block that was encoded / decoded using inter-frame prediction before the current block. Setting the motion information of the current block to be the same as the motion information of the other block can be defined as merge mode. Furthermore, setting the motion vector of the other block to be the predicted value of the motion vector of the current block can be defined as motion vector prediction mode.

[0181] Figure 11 is a flow chart of a process for deriving motion information of a current block in merge mode.

[0182] A merging candidate of the current block may be derived S1101. The merging candidate of the current block may be derived from a partition that was encoded / decoded by inter-frame prediction before the current block.

[0183] Figure 12 is a diagram illustrating candidate blocks used to derive merge candidates.

[0184] The candidate block may include at least one of a neighboring block or a non-neighboring block, wherein the neighboring block includes samples adjacent to the current block and the non-neighboring block includes samples not adjacent to the current block. Hereinafter, samples used to determine the candidate block are defined as basic samples. Furthermore, basic samples adjacent to the current block are referred to as neighboring basic samples, and basic samples not adjacent to the current block are referred to as non-neighboring basic samples.

[0185] Neighboring basic samples may be included in adjacent columns of the leftmost column of the current block or adjacent rows of the top row of the current block. In an example, when the coordinates of the top left sample of the current block are (0, 0), at least one of the blocks including basic samples at positions (-1, H-1), (W-1, -1), (W, -1), (-1, H), or (-1, -1) may be used as candidate blocks. Referring to the diagram, neighboring blocks with indices 0 to 4 may be used as candidate blocks.

[0186] A non-neighboring basic sample indicates a sample whose x-axis distance or y-axis distance from a basic sample adjacent to the current block is a predefined value. In this example, at least one of a block including a basic sample whose x-axis distance from the left basic sample is a predefined value, a block including a non-neighboring sample whose y-axis distance from the top basic sample is a predefined value, or a block including a non-neighboring sample whose x-axis distance and y-axis distance from the top left basic sample are predefined values ​​can be used as a candidate block. The predefined value can be a natural number such as 4, 8, 12, 16, etc. Referring to the drawings, at least one block among the blocks indexed 5 to 26 can be used as a candidate block.

[0187] Sample points that are not located on the same vertical line, horizontal line, or diagonal line as adjacent basic sample points may be set as non-adjacent basic sample points.

[0188] The motion information of the merge candidate may be set to be the same as the motion information of the candidate block. In an example, at least one of a motion vector, a reference picture index, a prediction direction, or a bidirectional weight index of the candidate block may be set as the motion information of the merge candidate.

[0189] A merge candidate list including merge candidates may be generated S1102 .

[0190] The indexes of the merge candidates in the merge candidate list may be assigned according to a predetermined order. In an example, the indexes may be assigned in the order of a merge candidate derived from a left neighboring block, a merge candidate derived from a top neighboring block, a merge candidate derived from an upper right neighboring block, a merge candidate derived from a lower left neighboring block, a merge candidate derived from an upper left neighboring block, and a merge candidate derived from a temporal neighboring block.

[0191] When multiple merge candidates are included in the merge candidate list, at least one of the multiple merge candidates may be selected ( S1103 ). Specifically, information for specifying any one of the multiple merge candidates may be signaled in the bitstream. In an example, information merge_idx indicating an index of any one of the merge candidates included in the merge candidate list may be signaled in the bitstream.

[0192] When the number of merge candidates included in the merge candidate list is less than a threshold, the motion information candidate included in the motion information table may be added to the merge candidate list as a merge candidate. In this regard, the threshold may be the maximum number of merge candidates that can be included in the merge candidate list or a value obtained by subtracting an offset from the maximum number of merge candidates. The offset may be a natural number such as 1 or 2.

[0193] The motion information table includes motion information candidates derived from a partition encoded / decoded based on inter-frame prediction in the current picture. In an example, the motion information of the motion information candidate included in the motion information table may be set to be the same as the motion information of the partition encoded / decoded based on inter-frame prediction. In this regard, the motion information may include at least one of a motion vector, a reference picture index, a prediction direction, or a bidirectional weight index.

[0194] The motion information candidates included in the motion information table may also be referred to as inter region merging candidates or prediction region merging candidates.

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

[0196] Optionally, information indicating the maximum number of motion information candidates that can be included in a motion information table may be signaled in the bitstream. The information may be signaled at the sequence, picture, or slice level. The information may indicate the maximum number of motion information candidates that can be included in the motion information table. Alternatively, the information may indicate the difference between the maximum number of motion information candidates that can be included in the motion information table and the maximum number of merge candidates that can be included in the merge candidate list.

[0197] Alternatively, the maximum number of motion information candidates that can be included in the motion information table may be determined according to a picture size, a slice size, or a coding tree unit size.

[0198] The motion information table may be initialized per picture, slice, tile, partition, coding tree unit, or coding tree unit line (row or column). In this example, when a slice is initialized, the motion information table is also initialized, and therefore, the motion information table may not include any motion information candidates.

[0199] Alternatively, information indicating whether the motion information table is to be initialized may be signaled in the bitstream. This information may be signaled at the slice, tile, partition, or block level. Before the information indicates initialization of the motion information table, a pre-configured motion information table may be used.

[0200] Alternatively, information about the initial motion information candidate can be signaled in a picture parameter set or slice header. Even when a slice is initialized, the motion information table can include the initial motion information candidate. Therefore, the initial motion information candidate can be used for the partition that is the first encoding / decoding target in the slice.

[0201] Optionally, the motion information candidate included in the motion information table of the previous coding tree unit may be set as the initial motion information candidate. In an example, the motion information candidate with the smallest index or 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.

[0202] The blocks are encoded / decoded in the order of encoding / decoding, and partitions encoded / decoded based on inter-prediction may be sequentially set as motion information candidates in the order of encoding / decoding.

[0203] Figure 13 2 is a diagram for explaining the updating aspect of the motion information table.

[0204] When inter prediction is performed on a current block ( S1301 ), a motion information candidate may be derived based on the current block ( S1302 ). The motion information of the motion information candidate may be set to be the same as the motion information of the current block.

[0205] When the motion information table is empty S1303 , the motion information candidate derived based on the current block may be added to the motion information table S1304 .

[0206] When the motion information table already includes motion information candidates ( S1303 ), a redundancy check ( S1305 ) may be performed on the motion information of the current block (or a motion information candidate derived based on the current block). The redundancy check is used to determine whether the motion information of a pre-stored motion information candidate in the motion information table is the same as the motion information of the current block. The redundancy check may be performed on all pre-stored motion information candidates in the motion information table. Alternatively, the redundancy check may be performed on motion information candidates with indexes exceeding or below a threshold among the pre-stored motion information candidates in the motion information table. Alternatively, the redundancy check may be performed on a predefined number of motion information candidates. In an example, the two motion information candidates with the smallest index or the two with the largest index may be determined as targets for the redundancy check.

[0207] When a motion information candidate having the same motion information as the current block is not included, a motion information candidate derived based on the current block may be added to the motion information table S1308. Whether the motion information candidates are the same may be determined based on whether their motion information (e.g., motion vector / reference picture index, etc.) is the same.

[0208] In this regard, when the maximum number of motion information candidates is already stored in the motion information table ( S1306 ), the oldest motion information candidate may be deleted ( S1307 ), and a motion information candidate derived based on the current block may be added to the motion information table ( S1308 ). In this regard, the oldest motion information candidate may be a motion information candidate with the largest or smallest index.

[0209] The motion information candidates may be identified by respective indexes. When a motion information candidate derived from the current block is added to the motion information table, the minimum index (e.g., 0) may be assigned to the motion information candidate, and the index of the pre-stored motion information candidate may be increased by 1. In this regard, when the maximum number of motion information candidates is already stored in the motion information table, the motion information candidate with the largest index is removed.

[0210] Optionally, when adding a motion information candidate derived from the current block to the motion information table, the maximum index may be assigned to the motion information candidate. In an example, when the number of pre-stored motion information candidates in the motion information table is less than the maximum value, an index having the same value as the number of pre-stored motion information candidates may be assigned to the motion information candidate. Alternatively, when the number of pre-stored motion information candidates in the motion information table is equal to the maximum value, an index obtained by subtracting 1 from the maximum value may be assigned to the motion information candidate. Optionally, the motion information candidate with the smallest index is removed, and the indices of the remaining pre-stored motion information candidates are decreased by 1.

[0211] Figure 14 is a diagram illustrating an update aspect of a motion information table.

[0212] It is assumed that when 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. In addition, it is assumed that the maximum number of motion information candidates are already stored in the motion information table.

[0213] When the motion information candidate HmvpCand[n+1] derived from the current block is added to the motion information table HmvpCandList, the motion information candidate HmvpCand[0] having the smallest index among the pre-stored motion information candidates may be deleted, and the indexes of the remaining motion information candidates may be reduced by 1. In addition, the index of the motion information candidate HmvpCand[n+1] derived from the current block may be set to the maximum value (for example, Figure 14 n) shown in .

[0214] When the same motion information candidate as the motion information candidate derived based on the current block is pre-stored S1305 , the motion information candidate derived based on the current block may not be added to the motion information table S1309 .

[0215] Alternatively, when adding a motion information candidate derived based on the current block to the motion information table, the pre-stored motion information candidate identical to the motion information candidate may be removed. In this case, the same effect as when the index of the pre-stored motion information candidate is newly updated is produced.

[0216] Figure 15is a diagram illustrating an example of updating an index of a pre-stored motion information candidate.

[0217] When the index of the pre-stored motion information candidate that is the same as the motion information candidate mvCand derived from the current block is hIdx, the pre-stored motion information candidate may be removed, and the index of the motion information candidate with an index greater than hIdx may be reduced by 1. In an example, Figure 15 The example shown in shows that HmvpCand[2], which is the same as mvCand, is deleted in the motion information table HvmpCandList, and the indexes from HmvpCand[3] to HmvpCand[n] are decreased by 1.

[0218] Also, the motion information candidate mvCand derived based on the current block may be added to the end of the motion information table.

[0219] Alternatively, an index assigned to the same pre-stored motion information candidate as the motion information candidate derived based on the current block may be updated. For example, the index of the pre-stored motion information candidate may be changed to a minimum value or a maximum value.

[0220] The motion information of the partitions included in a predetermined area may be set not to be added to the motion information table. In this example, motion information candidates derived based on the motion information of the partitions included in the merge processing area may not be added to the motion information table. Since the encoding / decoding order for the partitions included in the merge processing area is undefined, it is inappropriate to use the motion information of any one of the partitions included in the merge processing area for inter-frame prediction of another block therein. Therefore, the motion information candidates derived based on the partitions included in the merge processing area may not be added to the motion information table.

[0221] Optionally, the motion information of a block smaller than a preset size may be set not to be added to the motion information table. In an example, motion information candidates derived based on the motion information of a coding block with a width or height less than 4 or 8 or the motion information of a coding block with a size of 4×4 may not be added to the motion information table.

[0222] Based on the inter prediction mode of the current block, it can be determined whether the current block will be used as a motion information candidate. In this example, a partition encoded / decoded based on an affine motion model can be set to be ineligible for use as a motion information candidate. Therefore, even though 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.

[0223] Motion information candidates may be configured to include additional information in addition to motion information. In an example, at least one of the size, shape, or partition information of a block may be additionally stored in the motion information candidate. When configuring a merge candidate list for a current block, only motion information candidates whose size, shape, or partition information is the same as or similar to that of the current block may be used, or motion information candidates whose size, shape, or partition information is the same as or similar to that of the current block may be pre-added to the merge candidate list.

[0224] When the number of merge candidates included in the merge candidate list of the current block is less than a threshold, the motion information candidates included in the motion information table may be added to the merge candidate list as merge candidates. The additional processing is performed in an order reflecting the order of the indices of the motion information candidates arranged in ascending or descending order. In this example, the motion information candidate with the largest index may be added to the merge candidate list of the current block first.

[0225] When adding a motion information candidate included in the motion information table to a merge candidate list, a redundancy check may be performed between the motion information candidate and pre-stored merge candidates in the merge candidate list. As a result of the redundancy check, a motion information candidate having the same motion information as the pre-stored merge candidate may not be added to the merge candidate list.

[0226] The redundancy check may be performed only on a portion of the motion information candidates included in the motion information table. In an example, the redundancy check may be performed only on motion information candidates having an index exceeding or below a threshold. Alternatively, the redundancy check may be performed only on the N motion information candidates having the largest index or the smallest index.

[0227] Alternatively, a redundancy check may be performed only on a portion of the pre-stored merge candidates in the merge candidate list. In an example, a redundancy check may be performed only on merge candidates whose index exceeds or falls below a threshold, or on merge candidates derived from a partition at a specific location. In this regard, the specific location may include at least one of a left neighboring block, a top neighboring block, an upper right neighboring block, or a lower left neighboring block of the current block.

[0228] Figure 16 is a diagram illustrating an example in which a redundancy check is performed on only a part of merge candidates.

[0229] When adding a motion information candidate HmvpCand[j] to the merge candidate list, a redundancy check with the two merge candidates mergeCandList[NumMerge-2] and mergeCandList[NumMerge-1] with the largest index may be performed for the motion information candidate. In this regard, NumMerge may indicate the number of available spatial merge candidates and temporal merge candidates.

[0230] Unlike the example shown, when adding a motion information candidate HmvpCand[j] to a merge candidate list, a redundancy check with the two merge candidates with the smallest index may be performed for the motion information candidate. For example, a check may be performed to see if mergeCandList[0] and mergeCandList[1] are identical to HmvpCand[j].

[0231] Alternatively, a redundancy check may be performed only for merge candidates derived from a specific position. In an example, a redundancy check may be performed for at least one of the merge candidates derived from a neighboring block located to the left of the current block or at the top of the current block. If no merge candidate derived from a specific position exists in the merge candidate list, the motion information candidate may be added to the merge candidate list without performing a redundancy check.

[0232] When adding a motion information candidate HmvpCand[j] to the merge candidate list, a redundancy check with the two merge candidates mergeCandList[NumMerge-2] and mergeCandList[NumMerge-1] with the largest index may be performed for the motion information candidate. In this regard, NumMerge may indicate the number of available spatial merge candidates and temporal merge candidates.

[0233] A redundancy check with merge candidates may be performed only for a portion of the motion information candidates. In an example, a redundancy check may be performed only for N motion information candidates with large or small indexes among the motion information candidates included in the motion information table. In an example, a redundancy check may be performed only for motion information candidates with indices where the difference between the number of motion information candidates included in the motion information table and the motion information candidate is less than a threshold. When the threshold is 2, a redundancy check may be performed only for 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 aforementioned motion information candidates. When the redundancy check is omitted, the motion information candidate may be added to the merge candidate list regardless of whether the same motion information as the merge candidate exists.

[0234] In contrast, the redundancy check is set to be performed only for motion information candidates having indices for which the difference between the number of motion information candidates included in the motion information table and the motion information candidate exceeds a threshold value.

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

[0236] Alternatively, the threshold may 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.

[0237] When the same merge candidate as the first motion information candidate is found, redundant checking of the same merge candidate as the first motion information candidate may be omitted in redundant checking for the second motion information candidate.

[0238] Figure 17 is a diagram illustrating an example of omitting a redundant check with a specific merge candidate.

[0239] When a motion information candidate HmvpCand[i] indexed as i is added to a merge candidate list, a redundancy check is performed between the motion information candidate and pre-stored merge candidates in the merge candidate list. In this regard, when it is found that the merge candidate mergeCandlist[j] is the same as the motion information candidate HmvpCand[i], a redundancy check between the motion information candidate HmvpCand[i-1] (where its index is i-1) and the merge candidate may be performed without adding the motion information candidate HmvpCand[i] to the merge candidate list. In this regard, the redundancy check between the motion information candidate HmvpCand[i-1] and the merge candidate mergeCandList[j] may be omitted.

[0240] In the example, Figure 17 In the example shown, HmvpCand[i] has been determined to be identical to mergeCandList[2]. Therefore, a redundancy check for HmvpCand[i-1] can be performed without adding HmvpCand[i] to the merge candidate list. In this regard, a redundancy check between HmvpCand[i-1] and mergeCandList[2] can be omitted.

[0241] When the number of merge candidates included in the merge candidate list of the current block is less than a threshold value, in addition to the motion information candidates, at least one of a paired merge candidate or a zero merge candidate may be further included. A paired merge candidate indicates a merge candidate having a motion vector obtained by averaging motion vectors of more than two merge candidates, and a zero merge candidate indicates a merge candidate having a motion vector of 0.

[0242] For the merge candidate list of the current block, merge candidates can be added in the following order.

[0243] Spatial merging candidate - Temporal merging candidate - Motion information candidate - (Affine motion information candidate) - Pairwise merging candidate - Zero merging candidate

[0244] A spatial merge candidate is a merge candidate derived from at least one of a neighboring block or a non-neighboring block, a temporal merge candidate is a merge candidate derived from a previous reference picture, and an affine motion information candidate is a motion information candidate derived from a partition encoded / decoded using an affine motion model.

[0245] The motion information table can also be used in motion vector prediction mode. In this example, when 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 candidate included in the motion information table can be set as the motion vector prediction candidate for the current block. Specifically, the motion vector of the motion information candidate can be set as the motion vector prediction candidate.

[0246] If any one of the motion vector prediction candidates included in the motion vector prediction candidate list of the current block is selected, the selected candidate may be set as a motion vector predictor of the current block. Then, after decoding the motion vector residual value of the current block, the motion vector of the current block may be obtained by adding the motion vector predictor and the motion vector residual value.

[0247] The motion vector prediction candidate list of the current block may be configured in the following order.

[0248] Spatial motion vector prediction candidate - temporal motion vector prediction candidate - motion information candidate - (affine motion information candidate) - zero motion vector prediction candidate

[0249] A spatial motion vector prediction candidate represents a motion vector prediction candidate derived from at least one of a neighboring block or a non-neighboring block, and a temporal motion vector prediction candidate represents a motion vector prediction candidate derived from a previous reference picture. An affine motion information candidate represents a motion information candidate derived from a partition encoded / decoded using an affine motion model. A zero motion vector prediction candidate represents a candidate whose motion vector value is 0.

[0250] A merge processing region larger than a coding block can be defined. Coding blocks included in the merge processing region can be processed in parallel without sequential encoding / decoding. In this regard, not being encoded / decoded sequentially means that the order of encoding / decoding is undefined. Therefore, the encoding / decoding processing of the blocks included in the merge processing region can be processed independently. Optionally, the blocks included in the merge processing region can share merge candidates. In this regard, merge candidates can be derived based on the merge processing region.

[0251] According to the above features, the merged processing region may be referred to as a parallel processing region, a shared merge region (SMR), or a merged estimation region (MER).

[0252] Merge candidates for the current block may be derived based on the coding block. However, when the current block is included in a merge processing region larger than the current block, candidate blocks included in the same merge processing region as the current block may be set to be unavailable as merge candidates.

[0253] Figure 18 : is a diagram illustrating an example in which a candidate block included in the same merge processing area as the current block is set to be unusable as a merge candidate.

[0254] exist Figure 18 In the example shown in (a), when decoding CU5, a partition including basic samples adjacent to CU5 can be set as a candidate block. In this regard, candidate blocks x3 and x4 included in the same merge processing area as CU5 can be set to be unavailable as merge candidates for CU5. However, candidate blocks x0, x1, and x2 not included in the same merge processing area as CU5 can be set to be available as merge candidates.

[0255] exist Figure 18 In the example shown in (b), when decoding CU8, a partition including basic samples adjacent to CU8 can be set as a candidate block. In this regard, candidate blocks x6, x7, and x8 included in the same merge processing area as CU8 can be set to be unavailable as merge candidates. However, candidate blocks x5 and x9 not included in the same merge processing area as CU8 can be set to be available as merge candidates.

[0256] Alternatively, when the current block is included in the merge processing region, neighboring blocks adjacent to the current block and the merge processing region may be set as candidate blocks.

[0257] Figure 19 is a diagram illustrating an example of deriving a merge candidate of a current block when the current block is included in a merge processing region.

[0258] As in Figure 19 In the example shown in (a) of FIG, neighboring blocks adjacent to the current block can be set as candidate blocks for deriving a merge candidate for the current block. In this regard, candidate blocks included in the same merge processing region as the current block can be set to be unavailable as merge candidates. In this example, when deriving a merge candidate for coding block CU3, the top neighboring block y3 and the upper right neighboring block y4 included in the same merge processing region as coding block CU3 can be set to be unavailable as merge candidates for coding block CU3.

[0259] By scanning neighboring blocks adjacent to the current block in a predefined order, merge candidates can be derived. In an example, the predefined order can be the order of y1, y3, y4, y0 and y2.

[0260] When the number of merge candidates that can be derived from neighboring blocks adjacent to the current block is less than a value obtained by subtracting an offset from the maximum number of merge candidates or the maximum number, as in Figure 19 In the example shown in (b) of FIG, a merge candidate of the current block can be derived by using neighboring blocks adjacent to the merge processing area. In this example, a neighboring block adjacent to the merge processing area including the coding block CU3 can be set as a candidate block of the coding block CU3. In this regard, the neighboring block adjacent to the merge processing area may include at least one of the left neighboring block x1, the top neighboring block x3, the lower left neighboring block x0, the upper right neighboring block x4, or the upper left neighboring block x2.

[0261] Merge candidates may be derived by scanning neighboring blocks adjacent to the merge processing area in a predefined order. In an example, the predefined order may be the order of x1, x3, x4, x0, and x2.

[0262] In summary, a merge candidate regarding the coding block CU3 included in the merge processing region can be derived by scanning candidate blocks in the following scanning order.

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

[0264] However, the scanning order of the candidate blocks described above is merely an example of the present disclosure, and the candidate blocks may be scanned in an order different from the above example. Alternatively, the scanning order may be adaptively determined based on at least one of the size or shape of the current block or the merge processing area.

[0265] The merge processing region may be square or non-square. Information for determining the merge processing region may be signaled in 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. When the merge processing region is non-square, at least one of information indicating the size of the merge processing region, information indicating the width 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 in the bitstream.

[0266] The size of the merge processing area may be determined based on at least one of information signaled in a bitstream, a picture resolution, a size of a slice, or a size of a tile.

[0267] If motion compensation prediction is performed on a partition included in the merge processing region, motion information candidates derived based on motion information of the partition on which motion compensation prediction is performed may be added to the motion information table.

[0268] However, if motion information candidates derived from a partition included in the merge processing area are added to the motion information table, it is possible that the motion information candidates derived from that block are used for encoding / decoding of other blocks in the merge processing area that are actually slower than encoding / decoding of that block. In other words, even though dependencies between blocks should be eliminated when encoding / decoding the partition included in the merge processing area, motion prediction compensation may be performed using motion information from other blocks included in the merge processing area. To address this issue, even though encoding / decoding of the partition included in the merge processing area is complete, the motion information of the partition for which encoding / decoding has been completed may not be added to the motion information table.

[0269] Alternatively, the motion information table may be updated using only blocks at predefined positions within the merge processing region. Examples of predefined positions may include at least one of a block located at the upper left of the merge processing region, a block located at the upper right of the merge processing region, a block located at the lower left of the merge processing region, a block located at the lower right of the merge processing region, a block located at the center of the merge processing region, a block adjacent to the right boundary of the merge processing region, and a block adjacent to the bottom boundary of the merge processing region. As an example, the motion information table may be updated using only the motion information of the block adjacent to the lower right corner of the merge processing region, and the motion information of other blocks may not be used to update the motion information table.

[0270] Alternatively, after decoding of all blocks included in the merge processing area is completed, the motion information candidate derived from the block may be added to the motion information table. That is, although the blocks included in the merge processing area are encoded / decoded, the motion information table may not be updated.

[0271] In an example, if motion-compensated prediction is performed on a partition included in a merge processing region, motion information candidates derived from the partition may be added to a motion information table in a predefined order. In this regard, the predefined order may be determined based on a scanning order of coding blocks in the merge processing region or coding tree unit. The scanning order may be at least one of a raster scan, a horizontal scan, a vertical scan, or a zigzag scan. Alternatively, the predefined order may be determined based on the motion information of each block or the number of partitions having the same motion information.

[0272] Alternatively, a motion information candidate including unidirectional motion information may be added to the motion information table before a motion information candidate including bidirectional motion information. Conversely, a motion information candidate including bidirectional motion information may be added to the motion information table before a motion information candidate including unidirectional motion information.

[0273] Alternatively, the motion information candidates may be added to the motion information table in order of high usage frequency or low usage frequency in the merge processing region or the coding tree unit.

[0274] When the current block is included in the merge processing region and the number of merge candidates included in the merge candidate list of the current block is less than the maximum number, the motion information candidate included in the motion information table may be added to the merge candidate list. In this regard, the motion information candidate derived from the partition included in the same merge processing region as the current block may be set not to be added to the merge candidate list of the current block.

[0275] Alternatively, when the current block is included in the merge processing region, it may be configured not to use the motion information candidates included in the motion information table. In other words, 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 may not be added to the merge candidate list.

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

[0277] Figure 20 is a diagram showing a temporary motion information table.

[0278] A temporary motion information table can be configured for a coding tree unit or merge processing region. When motion compensated prediction is performed for a current block included in the coding tree unit or 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. In other words, temporary motion information candidates added to the temporary motion information table may not be added to the motion information table. Therefore, the motion information table may not include motion information candidates derived based on the motion information of partitions included in the coding tree unit or merge processing region including the current block.

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

[0280] The maximum number of temporary motion information candidates that can be included in the temporary motion information table can be set to be equal to the maximum number of motion information candidates that can be included in the motion information table. Alternatively, the maximum number of temporary motion information candidates that can be included in the temporary motion information table can be determined according to the size of the coding tree unit or the merge processing region. Alternatively, the maximum number of temporary motion information candidates that can be included in the temporary motion information table can be set to be smaller than the maximum number of motion information candidates that can be included in the motion information table.

[0281] The current block included in a coding tree unit or merge processing region may be set to not use the temporary motion information table for the corresponding coding tree unit or merge processing region. In other words, when the number of merge candidates included in the merge candidate list of the current block is less than a threshold, the motion information candidates included in the motion information table may be added to the merge candidate list, and the temporary motion information candidates included in the temporary motion information table may not be added to the merge candidate list. Therefore, the motion information of other blocks included in the same coding tree unit or the same merge processing region as the current block may not be used for motion compensation prediction of the current block.

[0282] If encoding / decoding of all blocks included in the coding tree unit or the merge processing region is completed, the motion information table and the temporary motion information table may be unified.

[0283] Figure 21 is a diagram illustrating an example of a unified motion information table and a temporary motion information table.

[0284] If encoding / decoding of all blocks included in the coding tree unit or the merge processing area is completed, Figure 21 As shown in the example shown in , the temporary motion information candidates included in the temporary motion information table may be updated in the motion information table.

[0285] In this regard, the temporary motion information candidates included in the temporary motion information table may be added to the motion information table in the order of being inserted in the temporary motion information table (in other words, in ascending or descending order of index values).

[0286] In 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. In this regard, the predefined order may be determined based on the scanning order of coding blocks in the merge processing region or coding tree unit. The scanning order may be at least one of raster scanning, horizontal scanning, vertical scanning, or zigzag scanning. 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.

[0287] Alternatively, a temporary motion information candidate including unidirectional motion information may be added to the motion information table before a temporary motion information candidate including bidirectional motion information. Conversely, a temporary motion information candidate including bidirectional motion information may be added to the motion information table before a temporary motion information candidate including unidirectional motion information.

[0288] Alternatively, the temporary motion information candidates may be added to the motion information table in order of high usage frequency or low usage frequency in the merge processing region or the coding tree unit.

[0289] When a temporary motion information candidate included in the temporary motion information table is added to the motion information table, a redundancy check may be performed for the temporary motion information candidate. In an example, if a motion information candidate identical to the temporary motion information candidate included in the temporary motion information table is pre-stored in the motion information table, the temporary motion information candidate may not be added to the motion information table. In this regard, a redundancy check may be performed for a portion of the motion information candidates included in the motion information table. In an example, a redundancy check may be performed for motion information candidates having an index exceeding or falling below a threshold. In an example, if the temporary motion information candidate is equal to a motion information candidate having an index exceeding a predefined value, the temporary motion information candidate may not be added to the motion information table.

[0290] This can limit the use of motion information candidates derived from partitions included in the same coding tree unit or the same merge processing region as the current block as merge candidates for the current block. To this end, block address information can be additionally stored for use with motion information candidates. The block address information can include at least one of the position of the block, the address of the block, the index of the block, the position of the merge processing region including the block, the address of the merge processing region including the block, the index of the merge processing region including the block, the position of the coding tree region including the block, the address of the coding tree region including the block, or the index of the coding tree region including the block.

[0291] Intra-frame prediction predicts a current block by using reconstructed samples that have been encoded / decoded and are around the current block. In this regard, the reconstructed samples before applying the in-loop filter can be used for intra-frame prediction of the current block.

[0292] Intra-frame prediction methods include matrix-based intra-frame prediction and intra-frame prediction based on the direction of adjacent reconstructed samples. Information indicating the intra-frame prediction method for the current block can be signaled in the bitstream. This information can be a 1-bit flag. Alternatively, the intra-frame prediction for the current block can be determined based on at least one of the position of the current block, the size of the current block, the shape of the current block, or the intra-frame prediction method of a neighboring block. In one example, when the current block crosses a picture boundary, it can be configured so that the matrix-based intra-frame prediction method is not applied to the current block.

[0293] Matrix-based intra prediction methods use a matrix product of matrices stored in the encoder and decoder with the matrix of reconstructed samples surrounding the current block to obtain a prediction block for the current block. Information specifying any one of multiple pre-stored matrices can be signaled in the bitstream. The decoder can determine the matrix used to perform intra prediction on the current block based on this information and the size of the current block.

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

[0295] Figure 22 is a flowchart of an intra-frame prediction method according to an embodiment of the present disclosure.

[0296] A reference sample line of the current block may be determined ( S2201 ). A reference sample line refers to a set of reference samples included in a kth line away from the top and / or left side of the current block. The reference samples may be derived from reconstructed samples encoded / decoded around the current block.

[0297] Index information identifying a reference sample line for a current block among a plurality of reference sample lines may be signaled in a bitstream. In an example, index information intra_luma_ref_idx for specifying a reference sample line for the current block may be signaled in a bitstream. The index information may be signaled for each coding block.

[0298] The plurality of reference sample lines may include at least one of a first line, a second line, or a third line at the top and / or left of the current block. Reference sample lines consisting of rows adjacent to the top of the current block and columns adjacent to the left of the current block among the plurality of reference sample lines may be referred to as adjacent reference sample lines, and the other reference sample lines may be referred to as non-adjacent reference sample lines.

[0299] Table 1 shows the index assigned to each candidate reference point line.

[0300]

Table 1

[0301] Index (intra_luma_ref_idx) Reference sample line 0 Adjacent reference sample point lines 1 The first non-adjacent reference sample line 2 The second non-adjacent reference sample point line

[0302] A reference sample line for the current block may be determined based on at least one of a position, size, shape of the current block, or a prediction coding mode of a neighboring block. In one example, when the current block is adjacent to a boundary of a picture, tile, slice, or coding tree unit, the neighboring reference sample line may be determined as the reference sample line for the current block.

[0303] The reference sample line may include a top reference sample located at the top of the current block and a left reference sample located at 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.

[0304] Next, an intra prediction mode for the current block may be determined (S2202). For the intra prediction mode of the current block, at least one of a non-directional intra prediction mode or a directional intra prediction mode may be determined as the intra prediction mode for the current block. The non-directional intra prediction modes include planar and DC, and the directional intra prediction modes include 33 or 65 modes from the lower left diagonal direction to the upper right diagonal direction.

[0305] Figure 23 is a diagram illustrating an intra prediction mode.

[0306] Figure 23 (a) shows 35 intra prediction modes, Figure 23 (b) shows 67 intra prediction modes.

[0307] Definable ratio Figure 23 A greater or lesser number of intra prediction modes than those shown in .

[0308] Based on the intra prediction mode of the neighboring blocks adjacent to the current block, the MPM (most probable mode) can be set. In this regard, the neighboring blocks may include a left neighboring block adjacent to the left side of the current block and a top neighboring block adjacent to the top of the current block.

[0309] The number of MPMs included in the MPM list can be pre-set in the encoder and decoder. In an example, the number of MPMs can be 3, 4, 5, or 6. Alternatively, information indicating the number of MPMs can be signaled in the bitstream. Alternatively, the number of MPMs can be determined based on at least one of the prediction coding mode of a neighboring block, the size or shape of the current block, or the reference sample line index. In one example, while N MPMs can be used when an adjacent reference sample line is determined as the reference sample line of the current block, M MPMs can also be used when a non-adjacent reference sample line is determined as the reference sample line of the current block. Since M is a natural number smaller than N, in an example, N can be 6 and M can be 5, 4, or 3. Therefore, while the intra-frame prediction mode of the current block can be determined as any of the six candidate intra-frame prediction modes when the reference sample line index of the current block is 0 and the MPM flag is true, the intra-frame prediction mode of the current block can also be determined as any of the five candidate intra-frame prediction modes when the reference sample line index of the current block is greater than 0 and the MPM flag is true.

[0310] Alternatively, a fixed number (eg, 6 or 5) of MPM candidates may be used regardless of the index of the reference sample line of the current block.

[0311] An MPM list including multiple MPMs may be generated, and information indicating whether the MPM identical to the intra-frame prediction mode of the current block is included in the MPM list may be signaled in the bitstream. Since the information is a 1-bit flag, it may be referred to as an MPM flag. When the MPM flag indicates that the MPM identical to the current block is included in the MPM list, index information identifying one of the MPMs may be signaled in the bitstream. In an example, index information mpm_idx specifying any one of the multiple MPMs may be signaled in the bitstream. The MPM specified by the index information may be set as the intra-frame prediction mode of the current block. When the MPM flag indicates that the MPM identical to the current block is not included in the MPM list, remaining mode information indicating any one of the remaining intra-frame prediction modes other than the MPM may be signaled in the bitstream. The remaining mode information represents the index value corresponding to the intra-frame prediction mode of the current block when the index is reassigned to the remaining intra-frame prediction modes other than the MPM. The decoder can determine the intra-frame prediction mode of the current block by arranging the MPMs in ascending order and comparing the remaining mode information with the MPM. In an example, when the remaining mode information is equal to or less than the MPM, the intra prediction mode of the current block may be derived by adding 1 to the remaining mode information.

[0312] When deriving the intra prediction mode for the current block, comparison of a portion of the MPM with the remaining mode information may be omitted. In this example, the MPMs in the non-directional intra prediction mode among the MPMs may be excluded from the comparison target. When the non-directional intra prediction mode is set as the MPM, the remaining mode information clearly indicates the directional intra prediction mode, so the intra prediction mode of the current block can be derived by comparing the remaining MPMs excluding the non-directional intra prediction mode with the remaining mode information. Instead of excluding the non-directional intra prediction mode from the comparison target, the number of non-directional intra prediction modes may be added to the remaining mode information and the resulting value may be compared with the remaining MPMs.

[0313] Information indicating whether the intra-frame prediction mode of the current block is the default mode may be signaled in the bitstream instead of setting the default mode to the MPM. 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 when the MPM flag indicates that the same MPM as the current block is included in the MPM list. As described above, the default mode may include at least one of plane, DC, vertical direction mode, or horizontal direction mode. In an example, when plane is set as the default mode, the default mode flag may indicate whether the intra-frame prediction mode of the current block is plane. When the default mode flag indicates that the intra-frame 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-frame prediction mode of the current block.

[0314] When the default mode flag is used, the intra prediction mode that is the same as the default mode may be set as the MPM. In this example, when 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 derived using five MPMs excluding the MPM corresponding to planar.

[0315] When a plurality of intra prediction modes are set as a default mode, index information indicating any one of the default modes may also be signaled.The intra prediction mode of the current block may be set to the default mode indicated by the index information.

[0316] When the index of the reference sample line of the current block is not 0, it can be set to not use the default mode. In an example, when a non-adjacent reference sample line is determined as the reference sample line of the current block, it can be set to not use a non-directional intra prediction mode (such as DC mode or planar mode). Therefore, when 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 inferred to be a predefined value (i.e., false).

[0317] When the intra prediction mode of the current block is determined, prediction samples for the current block may be obtained based on the determined intra prediction mode ( S2203 ).

[0318] When the DC mode is selected, prediction samples for the current block may be generated based on the average of the reference samples. Specifically, the values ​​of all samples within the prediction block may be generated based on the average of the reference samples. The average may be derived using at least one of the top reference sample adjacent to the top of the current block and the left reference sample adjacent to the left of the current block.

[0319] The number or range of reference samples used when deriving the average value may vary based on the shape of the current block. In one example, when the current block is a non-square block with a width greater than its height, the average value may be calculated using the top reference samples. Conversely, when the current block is a non-square block with a width less than its height, the average value may be calculated using the left reference samples. In other words, when the width and height of the current block are different, the average value may be calculated using reference samples adjacent to the larger length. Alternatively, whether to calculate the average value using the top reference samples or the left reference samples may be determined based on the ratio between the width and height of the current block.

[0320] When planar mode is selected, prediction samples are obtained using horizontal and vertical prediction samples. The horizontal prediction sample is obtained based on the left and right reference samples located on the same horizontal line as the prediction sample, and the vertical prediction sample is obtained based on the top and bottom reference samples located on the same vertical line as the prediction sample. The right reference sample is generated by copying the reference sample adjacent to the upper right corner of the current block, and the bottom reference sample is generated by copying the reference sample adjacent to the lower left corner of the current block. The horizontal prediction sample is obtained based on a weighted sum of the left and right reference samples, and the vertical prediction sample is obtained based on a weighted sum of the top and bottom reference samples. The weighting factor assigned to each reference sample is determined based on the position of the prediction sample. The prediction sample is obtained based on the average or weighted sum of the horizontal and vertical prediction samples. When the weighted sum is used, weighting factors assigned to the horizontal direction prediction samples and the vertical direction prediction samples may be determined based on the positions of the prediction samples.

[0321] When a directional prediction mode is selected, a parameter representing a prediction direction (or prediction angle) of the selected directional prediction mode may be determined. Table 2 below represents an intra-directional parameter intraPredAng for each intra-prediction mode.

[0322]

Table 2

[0323] PredModeIntra 1 2 3 4 5 6 7 IntraPredAng - 32 26 21 17 13 9 PredModeIntra 8 9 10 11 12 13 14 IntraPredAng 5 2 0 -2 -5 -9 -13 PredModeIntra 15 16 17 18 19 20 21 IntraPredAng -17 -21 -26 -32 -26 -21 -17 PredModeIntra 22 23 24 25 26 27 28 IntraPredAng -13 -9 -5 -2 0 2 5 PredModeIntra 29 30 31 32 33 34 IntraPredAng 9 13 17 21 26 32

[0324] Table 2 shows the intra-frame direction parameters of each intra-frame prediction mode, where, when 35 intra-frame prediction modes are defined, their indexes are one of 2 to 34. When more than 33 directional intra-frame prediction modes are defined, the intra-frame direction parameters of each intra-frame prediction mode can be set by subdividing Table 2.

[0325] The top reference sample and the left reference sample for the current block are arranged in a line, and then the prediction sample can be obtained based on the value of the intra direction parameter. In this regard, when the value of the intra direction parameter is a negative value, the left reference sample and the top reference sample can be arranged in a line.

[0326] Figure 24 and Figure 25 are diagrams each showing an example of a one-dimensional arrangement in which reference spots are arranged in a line.

[0327] Figure 24 is a diagram showing a one-dimensional arrangement in the vertical direction in which reference samples are arranged in the vertical direction, Figure 25 It is a diagram showing a horizontal one-dimensional arrangement of reference samples arranged in the horizontal direction. It is assumed that 35 intra prediction modes are defined to describe Figure 24 and Figure 25 .

[0328] When the intra prediction mode index is any one of 11 to 18, a horizontal one-dimensional arrangement may be applied, wherein the top reference sample is rotated counterclockwise, and when the intra prediction mode index is any one of 19 to 25, a vertical one-dimensional arrangement may be applied, wherein the left reference sample is rotated clockwise. When the reference samples are arranged in a line, the intra prediction mode angle may be considered.

[0329] The reference sample determination parameters may be determined based on the intra direction parameters. The reference sample determination parameters may include a reference sample index for specifying a sample and a weighting factor parameter for determining a weighting factor applied to the reference sample.

[0330] The reference sample index iIdx and the weighting factor parameter i can be obtained by the following equations 4 and 5 respectively. fact .

[0331] Equation 4

[0332] iIdx=(y+1)*P ang / 32

[0333] Equation 5

[0334] i fact =[(y+1)*P ang ]&31

[0335] In Equation 4 and Equation 5, Pang Indicates the intra-frame direction parameter. The reference sample specified by the reference sample index iIdx corresponds to an integer pixel.

[0336] To derive a prediction sample, at least one reference sample may be specified. Specifically, based on the slope of the prediction mode, the position of the reference sample used to derive the prediction sample may be specified. In this example, the reference sample used to derive the prediction sample may be specified using a reference sample index iIdx.

[0337] In this regard, when the slope of the intra-frame prediction mode is not represented by a single reference sample, the prediction sample may be generated by interpolating multiple reference samples. In this example, when the slope of the intra-frame prediction mode is a value between the slope between the prediction sample and the first reference sample and the slope between the prediction sample and the second reference sample, the prediction sample may be obtained by interpolating the first reference sample and the second reference sample. In other words, when an angle line according to the intra-frame prediction angle does not pass through a reference sample located at an integer pixel, the prediction sample may be obtained by interpolating reference samples located to the left and right, or to the top and bottom, of the position where the angle line passes.

[0338] The following Equation 6 represents an example of obtaining a predicted sample point based on a reference sample point.

[0339] Equation 6

[0340] P(x, y) = ((32-i fact ) / 32)*Ref_1D(x+iIdx+1)+(i fact / 32)*Ref_1D(x+iIdx+2)

[0341] In Equation 6, P represents a prediction point, and Ref_1D represents any one of the reference points arranged in a line. In this regard, the position of the reference point can be determined by the position (x, y) of the prediction point and the reference point index ildx.

[0342] When the slope of the intra prediction mode can be represented by a reference sample, the weighting factor parameter i fact is set to 0. Therefore, Equation 6 can be simplified to the following Equation 7.

[0343] Equation 7

[0344] P(x, y) = Ref_1D(x+iIdx+1)

[0345] Intra prediction for the current block may be performed based on multiple intra prediction modes. In an example, an intra prediction mode may be derived for each prediction sample, and a prediction sample may be derived based on the intra prediction mode assigned to each prediction sample.

[0346] Alternatively, an intra-frame prediction mode may be derived for each region, and intra-frame prediction may be performed for each region based on the intra-frame prediction mode assigned to each region. In this regard, a region may include at least one sample. At least one of the size and shape of the region may be adaptively determined based on at least one of the size of the current block, the shape of the current block, and the intra-frame prediction mode of the current block. Alternatively, at least one of the size and shape of the region may be predefined in the encoder and decoder independently of the size or shape of the current block.

[0347] Figure 26 is a diagram illustrating an angle formed between a directional intra prediction mode and a straight line parallel to the x-axis.

[0348] like Figure 26 In the example shown in , the directional prediction mode may exist between the lower left diagonal direction and the upper right diagonal direction. When describing the angle formed between the x-axis and the directional prediction mode, the directional prediction mode may exist from 45 degrees (lower left diagonal direction) to -135 degrees (upper right diagonal direction).

[0349] When the current block is non-square, there may be a case where a prediction sample is derived by using a reference sample located at an angle line according to an intra prediction angle that is located farther than a reference sample close to a prediction sample according to an intra prediction mode of the current block.

[0350] Figure 27 is a diagram illustrating an aspect of obtaining prediction samples when the current block is non-square.

[0351] In the example, Figure 27 In the example shown in (a) of FIG. 1 , it is assumed that the current block is a non-square having a width greater than a height, and the intra prediction mode of the current block is a directional intra prediction mode having an angle of 0 to 45 degrees. In this case, when the prediction samples A around the right column of the current block are derived from the reference samples located at the angular mode according to the above angle, there may be a case where the left reference sample L far from the prediction sample is used instead of the top reference sample T close to the prediction sample.

[0352] In another example, Figure 27 In the example shown in (b) of FIG. 1 , it is assumed that the current block is a non-square block whose height is greater than its width, and the intra prediction mode of the current block is a directional intra prediction mode from -90 degrees to -135 degrees. In the above case, when the prediction samples A around the bottom row of the current block are derived from the reference samples located at the angular mode according to the above angle, there may be a case where the top reference sample T far from the prediction sample is used instead of the left reference sample L close to the prediction sample.

[0353] In order to solve the above problem, when the current block is non-square, the intra prediction mode of the current block can be replaced by the intra prediction mode in the opposite direction. Figure 23 The directional prediction mode shown in FIG. 4 is a directional prediction mode of an angle. The directional intra prediction mode may be defined as a wide-angle intra prediction mode. The wide-angle intra prediction mode indicates a directional intra prediction mode that does not fall within the range of 45 degrees to -135 degrees.

[0354] Figure 28 is a diagram illustrating a wide-angle intra prediction mode.

[0355] exist Figure 28 In the example shown in , the intra prediction modes having indices from -1 to -14 and the intra prediction modes having indices from 67 to 80 represent the wide-angle intra prediction mode.

[0356] exist Figure 28 , 14 wide-angle intra prediction modes (from -1 to -14) with angles greater than 45 degrees and 4 wide-angle intra prediction modes (from 67 to 80) with angles less than -135 degrees are shown. However, a greater or lesser number of wide-angle intra prediction modes may be defined.

[0357] When the 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.

[0358] By using the wide-angle intra prediction mode, the reference sample T can be used to predict Figure 27 The sample point A shown in (a) can be predicted by the reference sample point L Figure 27 Sample point A shown in (b).

[0359] In addition to the conventional intra prediction mode and the N wide-angle intra prediction modes, a total of 67+N intra prediction modes can be used. In this example, Table 3 shows intra direction parameters for the intra prediction modes when 20 wide-angle intra prediction modes are defined.

[0360]

Table 3

[0361]

[0362]

[0363] If the current block is non-square and the intra prediction mode of the current block obtained in step S2202 falls within the 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 a size, a shape, or a ratio of the current block. In this regard, the ratio may represent a ratio between a width and a height of the current block.

[0364] When the current block is non-square with a width greater than a height, the transform range may be set from the intra prediction mode index in the upper right diagonal direction (e.g., 66) to (intra prediction mode index in the upper right diagonal direction - N). In this regard, N may be determined based on the scale of the current block. When the intra prediction mode of the current block falls within the transform range, the intra prediction mode may be transformed into the wide-angle intra prediction mode. The transformation may be performed by subtracting a predefined value from the intra prediction mode, and the predefined value may be the total number of intra prediction modes excluding the wide-angle intra prediction mode (e.g., 67).

[0365] In the above example, the intra prediction modes from number 66 to number 53 may be transformed into wide-angle intra prediction modes from number -1 to number -14, respectively.

[0366] When the current block is a non-square block with a height greater than its width, the transform range may be set from the intra prediction mode index in the lower left diagonal direction (e.g., 2) to (the intra prediction mode index in the lower left diagonal direction + M). In this regard, M may be determined based on the scale of the current block. When the intra prediction mode of the current block falls within the transform range, the intra prediction mode may be transformed into the 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 (e.g., 65) excluding the wide-angle intra prediction mode.

[0367] In the above example, the intra prediction modes from number 2 to number 15 may be transformed into wide-angle intra prediction modes from number 67 to number 80, respectively.

[0368] Hereinafter, the intra prediction mode belonging to the transform range is referred to as a wide-angle intra prediction alternative mode.

[0369] The transformation range may be determined based on the scale of the current block. In this example, Table 4 and Table 5 respectively show the transformation ranges when 35 intra prediction modes other than the wide intra prediction mode are defined and when 67 intra prediction modes other than the wide intra prediction mode are defined.

[0370]

Table 4

[0371]

[0372]

[0373]

Table 5

[0374]

[0375] As shown in the examples of Table 4 and Table 5, the number of wide-angle intra prediction alternative modes included in the transform range may vary according to the scale of the current block.

[0376] The scale of the current block may also be subdivided to set a transform range as shown in Table 6 below.

[0377]

Table 6

[0378]

[0379] When a non-adjacent reference sample line is determined as a reference sample line for the current block, or when a multi-line intra-frame prediction encoding method for selecting one of a plurality of reference sample lines is used, the prediction method may be configured not to use the wide-angle intra-frame prediction mode. That is, even though the current block has a non-square shape and the intra-frame prediction mode of the current block falls within the transformation range, the intra-frame prediction mode of the current block may not be transformed into the wide-angle intra-frame prediction mode.

[0380] Alternatively, when the intra prediction mode of the current block is determined to be the wide-angle intra prediction mode, the prediction method may be configured so that non-adjacent reference sample lines cannot be used as reference sample lines for the current block, or may be configured so that one of the multiple reference sample lines is not selected using the multi-line intra prediction encoding method. When the multi-line intra prediction encoding method is not used, the adjacent reference sample lines may be determined as the reference sample lines for the current block.

[0381] When wide-angle intra prediction mode is not used, each of refW and refH can be set to the sum of nTbW and nTbH. Therefore, in addition to the top left reference sample, a non-adjacent reference sample line spaced i from the current block may also include (nTbW + nTbH + offsetX[i]) top reference samples and (nTbW + nTbH + offsetY[i]) left reference samples. That is, a non-adjacent reference sample line spaced i from the current block may include (2nTbW + 2nTbH + offsetX[i] + offsetY[i] + 1) reference samples. For example, when the value of whRatio is greater than 1, the value of offsetX can be set to a value greater than offsetY. In one example, when the value of offsetX can be set to 1, the value of offsetY can be set to 0. Conversely, when the value of whRatio is less than 1, the value of offsetY can be set to a value greater than offsetX. In one example, the value of offsetX can be set to 0, and the value of offsetY can be set to 1.

[0382] Since the Wide-angle intra-frame prediction mode is used in addition to the conventional intra-frame prediction mode, the resources used to encode the Wide-angle intra-frame prediction mode may increase, thereby reducing encoding efficiency. Therefore, instead of encoding the Wide-angle intra-frame prediction mode as it is, an alternative intra-frame prediction mode of the Wide-angle intra-frame prediction mode is encoded to improve encoding efficiency.

[0383] In this example, when the current block is encoded by using the Wide intra prediction mode number 67, number 2 as the Wide alternative intra prediction mode number 67 may be encoded as the intra prediction mode of the current block. In addition, when the current block is encoded by using the Wide intra prediction mode number -1, number 66 as the Wide alternative intra prediction mode number -1 may be encoded as the intra prediction mode of the current block.

[0384] The decoder may decode the intra prediction mode of the current block and determine whether the decoded intra prediction mode belongs to the transformation range. When the decoded intra prediction mode is the wide-angle replacement intra prediction mode, the intra prediction mode may be transformed into the wide-angle intra prediction mode.

[0385] Alternatively, when the current block is encoded by the wide-angle intra prediction mode, the wide-angle intra prediction mode may be encoded as it is.

[0386] The intra prediction mode encoding may be performed based on the above-mentioned MPM list. Specifically, when the neighboring block is encoded in the wide-angle intra prediction mode, the MPM may be set based on the wide-angle replacement intra prediction mode corresponding to the wide-angle intra prediction mode.

[0387] The residual image can be derived by subtracting the predicted image from the original image. In this regard, when the residual image is converted to the frequency domain, the subjective image quality of the image does not significantly decrease even if the high-frequency components are removed from the frequency components. Therefore, when the value of the high-frequency component is transformed to a small value, or when the value of the high-frequency component is set to 0, the compression efficiency can be improved without causing significant visual distortion. Reflecting the above characteristics, a transformation can be performed on the current block to decompose the residual image into two-dimensional frequency components. The transformation can be performed by using a transformation method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), etc.

[0388] DCT decomposes (or transforms) the residual image into two-dimensional frequency components by using cosine transform, while DST synthesizes (or transforms) the residual image into two-dimensional frequency components by using sine transform. As a result of transforming the residual image, the frequency components can be represented as a basic image. In this example, when DCT transform is performed on a block of N×N size, N 2The size of each of the basic pattern components included in the N×N sized block can be obtained by transformation. Depending on the transformation method used, the size of the basic pattern component can be referred to as a DCT coefficient or a DST coefficient.

[0389] The DCT transform method is mainly used to transform images with many non-zero low-frequency components, while the DST transform method is mainly used to transform images with many high-frequency components.

[0390] It is also possible to transform the residual image by using a transform method other than DCT or DST.

[0391] Hereinafter, transforming the residual image into two-dimensional frequency components is referred to as two-dimensional image transformation. Furthermore, the magnitude of the basic pattern components obtained by the transformation is referred to as transform coefficients. In this example, transform coefficients may refer to DCT coefficients or DST coefficients. When both the first transform and the second transform described below are applied, the transform coefficients may represent the basic pattern components resulting from the second transform. Furthermore, residual samples skipped during the transformation are also referred to as transform coefficients.

[0392] The transformation method may be determined in units of blocks. The transformation method may be determined based on at least one of a prediction coding mode of the current block, a size of the current block, or a shape of the current block. In an example, when the current block is encoded using an intra prediction mode and the size of the current block is less than N×N, the transformation may be performed using a DST transformation method. On the other hand, when the conditions are not met, the transformation may be performed using a DCT transformation method.

[0393] A two-dimensional image transform may not be performed on some blocks of the residual image. Not performing a two-dimensional image transform may be referred to as transform skipping. Transform skipping means not applying the first transform and the second transform to the current block. When transform skipping is applied, quantization may be applied to the residual values ​​for which the transform is not performed.

[0394] Whether transform skipping is allowed for the current block may be determined based on at least one of the size or shape of the current block. In an example, transform skipping may be applied only when the size of the current block is less than a threshold. The threshold is related to at least one of the width, height, or number of samples of the current block and may be defined as 32×32, for example. Alternatively, transform skipping may be allowed only for square blocks. In an example, transform skipping may be allowed for square blocks of 32×32, 16×16, 8×8, or 4×4 sizes. Alternatively, transform skipping may be allowed only when a sub-partition intra coding method is not used.

[0395] Alternatively, when the subpartition intra encoding method is applied to the current block, whether to apply transform skip may be determined for each subblock.

[0396] Figure 29is a diagram illustrating an example of determining whether to perform transform skip for each subblock.

[0397] Transform skipping may be applied to only a portion of the plurality of sub-blocks. In an example, as in Figure 29 In the example output in , it can be set to skip applying the transform to the sub-block at the top position of the current block and not skip applying the transform to the sub-block at the bottom position.

[0398] The transform type of a subblock for which transform skipping is not allowed may be determined based on information signaled in a bitstream. In an example, the transform type may be determined based on tu_mts_idx, which will be described below.

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

[0400] After the current block is transformed using DCT or DST, the transformed current block may be transformed again. In this regard, the DCT or DST-based transform may be defined as a first transform, and performing the transform again on the block to which the first transform is applied may be defined as a second transform.

[0401] The first transform may be performed by using any one of a plurality of transform kernel candidates. In an example, the first transform may be performed by using any one of DCT2, DCT8, or DST7.

[0402] Different transform kernels may be used for the horizontal and vertical directions. Information indicating the combination of the transform kernel for the horizontal direction and the transform kernel for the vertical direction may be signaled in the bitstream.

[0403] The processing unit for the first transform may be different from that for the second transform. In an example, the first transform may be performed on an 8×8 block, and the second transform may be performed on a 4×4 sub-block within the transformed 8×8 block. Alternatively, the second transform may be performed on transform coefficients belonging to three 4×4 sub-blocks. The three sub-blocks may include a sub-block located to the upper left of the current block, a sub-block adjacent to the right of the sub-block, and a sub-block adjacent to the bottom of the sub-block. Alternatively, the second transform may be performed on an 8×8 block.

[0404] The transform coefficients in the remaining regions where the second transform is not performed may also be set to 0.

[0405] Alternatively, the first transform may be performed on a 4×4 block, and the second transform may be performed on an 8×8 sized region including the transformed 4×4 block.

[0406] Information indicating whether to perform the second transform may be signaled in the bitstream. In an example, a flag indicating whether to perform the second transform may be signaled, or index information specifying whether to perform the second transform and a transform core to use for the second transform may be signaled. In an example, when the index information is 0, it indicates that the second transform is not performed on the current block. On the other hand, when the index information is greater than 0, the transform core to use for the second transform may be determined by the index information.

[0407] Alternatively, whether to perform the second transform may be determined based on whether the horizontal transform kernel and the vertical transform kernel are identical. In one example, the second transform may be performed only when the horizontal transform kernel and the vertical transform kernel are identical. Alternatively, the second transform may be performed only when the horizontal transform kernel and the vertical transform kernel are different.

[0408] Alternatively, the second transform may be allowed only when a predefined transform kernel is used for the horizontal transform and the vertical transform. In one example, the second transform may be allowed when a DCT2 transform kernel is used for the horizontal transform and the vertical transform. Alternatively, when a sub-partition intra encoding method is applied to the current block, the second transform may be allowed only when a DCT2 transform kernel is used for the horizontal transform and the vertical transform.

[0409] Alternatively, whether to perform the second transform may be determined based on the number of non-zero transform coefficients of the current block. In one example, when the number of non-zero transform coefficients of the current block is less than or equal to a threshold, the prediction method may be configured not to use the second transform. When the number of non-zero transform coefficients of the current block is greater than the threshold, the prediction method may be configured to use the second transform. As long as the current block is encoded using intra-frame prediction, the prediction method may be configured to use the second transform.

[0410] 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. In an example, the second transform may not be performed if at least one of the x-axis coordinate or the 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 the y-axis coordinate of the subblock to which the last non-zero transform coefficient of the current block belongs is greater than a threshold. In this case, the threshold may be predefined in the encoding and decoding devices. Alternatively, the threshold may be determined based on the size or shape of the current block.

[0411] Alternatively, when only a transform coefficient of a DC component exists in the current block, it may be configured not to perform the second transform. In this case, the DC component represents a transform coefficient at the upper left position in the current block.

[0412] Optionally, when matrix-based intra prediction is applied to the current block, it may be configured not to perform the second transform.

[0413] Information indicating a transform type of a current block may be signaled in a bitstream, and may be index information tu_mts_idx indicating one of a combination of a transform type for a horizontal direction and a transform type for a vertical direction.

[0414] Based on the transform type candidates specified by the index information tu_mts_idx, a transform kernel for a vertical direction and a transform kernel for a horizontal direction may be determined. Table 7 shows transform type combinations according to tu_mts_idx.

[0415]

Table 7

[0416]

[0417] The transform type may be determined to be one of DCT2, DST7, or DCT8. Optionally, transform skip may be inserted into the transform type candidate.

[0418] When Table 7 is used, when tu_mts_idx is 0, DCT2 may be applied in the horizontal direction and DCT2 may be applied in the vertical direction. When tu_mts_idx is 2, DCT8 may be applied in the horizontal direction and DCT7 may be applied in the vertical direction.

[0419] When applying the sub-partition intra-frame coding method, the transform kernel of each sub-block can be determined independently. In an example, information for specifying transform type combination candidates can be encoded and signaled for each sub-block. Therefore, the transform kernel can be different between sub-blocks.

[0420] Alternatively, the subblocks may use the same transform type. In this case, tu_mts_idx specifying a transform type combination candidate may be signaled only for the first subblock. Alternatively, tu_mts_idx may be signaled at the coding block level, and the transform type of the subblock may be determined by referring to the 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 subblocks, and the determined transform type may be set for all subblocks.

[0421] Figure 30 is a diagram illustrating an example in which subblocks use the same transform type.

[0422] When the coding block is partitioned in the horizontal direction, the transform type of the sub-block (Sub-CU0) at the top position of the coding block can be set to be the same as the transform type of the sub-block (Sub-CU1) at the bottom position. Figure 30In the example shown in (a) of FIG. 5 , when the horizontal transform type and the vertical transform type are determined based on tu_mts_idx signaled for the top subblock, the determined transform type may also be applied to the bottom subblock.

[0423] When the coding block is partitioned in the vertical direction, the transform type of the sub-block (Sub-CU0) at the left position of the coding block can be set to be the same as the transform type of the sub-block (Sub-CU1) at the right position. Figure 30 In the example shown in (b) of FIG. 2 , when the horizontal transform type and the vertical transform type are determined based on tu_mts_idx signaled for the left subblock, the determined transform type may also be applied to the right subblock.

[0424] Whether to encode the index information may be determined based on at least one of the size or shape of the current block, the number of non-zero coefficients, whether a second transform is performed, or whether a sub-partition intra encoding method is applied. In an example, when the sub-partition intra encoding method is applied to the current block, or when the number of non-zero coefficients is equal to or less than a threshold, signaling of the index information may be omitted. When signaling of the index information is omitted, a default transform type may be applied to the current block.

[0425] The default transform type may include at least one of DCT2 and DST7. When multiple default transform types exist, one of the multiple default transform types may be selected based on whether a second transform is performed, whether a subpartitioned intra coding method is applied, or at least one of the size, shape, or intra prediction mode of the current block. In an example, one of the multiple transform types may be determined as a horizontal transform type based on whether the width of the current block is within a preset 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 is within a preset range. Alternatively, the default mode may be determined differently depending on the size, shape, or intra prediction mode of the current block, or whether a second transform is performed.

[0426] Optionally, when only the transform coefficient of the DC component exists in the current block, the horizontal transform type and the vertical transform type may be set to the default transform type. In an example, when only the transform coefficient of the DC component exists in the current block, the horizontal transform type and the vertical transform type may be set to DCT2.

[0427] The threshold value may be determined based on the size or shape of the current block. In an example, when the size of the current block is equal to or less than 32×32, the threshold value may be set to 2, and when the current block is larger than 32×32 (e.g., when the current block is a coding block of 32×64 or 64×32 size), the threshold value may be set to 4.

[0428] Multiple lookup tables may be pre-stored in the encoding device / decoding device. At least one of an index value assigned to a transform type combination candidate, a type of the transform type combination candidate, or the number of transform type combination candidates may be different for each of the multiple lookup tables.

[0429] A lookup table for the current block may be selected based on at least one of a size, shape, or intra prediction mode of the current block, whether a second transform is applied, or whether a transform is skipped for application to neighboring blocks.

[0430] In an example, when the size of the current block is equal to or less than 4×4 or when the current block is encoded by inter-frame prediction, a first lookup table may be used, and when the size of the current block is greater than 4×4 or when the current block is encoded by intra-frame prediction, a second lookup table may be used.

[0431] Alternatively, information indicating one of a plurality of lookup tables may be signaled in the bitstream, and the decoding device may select a lookup table for the current block based on the information.

[0432] In another example, the index assigned to the transform type combination candidate may be adaptively determined based on at least one of the size, shape, prediction coding mode or intra-frame prediction mode of the current block, whether a second transform is applied, or whether transform skipping is applied to a neighboring block. In an example, the index assigned to transform skipping when the size of the current block is 4×4 may be smaller than the index assigned to transform skipping when the size of the current block is greater than 4×4. Specifically, when the size of the current block is 4×4, index 0 may be assigned to transform skipping, and when the current block is greater than 4×4 and equal to or less than 16×16, an index greater than 0 (e.g., index 1) may be assigned to transform skipping. When the current block is greater than 16×16, a maximum value (e.g., 5) may be assigned to the index of transform skipping.

[0433] Alternatively, when the current block is encoded by inter prediction, transform skip may be assigned an index of 0. When the current block is encoded by intra prediction, an index greater than 0 (eg, index 1) may be assigned to transform skip.

[0434] Alternatively, when the current block is a 4×4 block coded by inter-frame prediction, transform skip may be assigned an index of 0. On the other hand, when the current block is not coded by inter-frame prediction, or when the current block is larger than 4×4, an index greater than 0 (e.g., index 1) may be assigned to transform skip.

[0435] Transform type combination candidates other than those listed in Table 7 may also be used. In an example, a transform type combination candidate consisting of a transform skip applied to one of a horizontal transform or a vertical transform and a transform kernel (e.g., DCT2, DCT8, or DST7, etc.) applied to the other may be used. In this case, whether the transform skip is used as a transform type candidate for the horizontal direction or the vertical direction may be determined based on at least one of the size (e.g., width and / or height), shape, prediction coding mode, or intra prediction mode of the current block.

[0436] Information indicating whether index information for determining the transform type of the current block is explicitly signaled in the bitstream may be signaled. In an example, sps_explicit_intra_mts_flag (i.e., information indicating whether explicit transform type determination is allowed for blocks encoded using intra prediction) and / or sps_explicit_intra_mts_flag (i.e., information indicating whether explicit transform type determination is allowed for blocks encoded using inter prediction) may be signaled at the sequence level.

[0437] When explicit transform type determination is allowed, the transform type of the current block can be determined based on index information tu_mts_idx signaled in the bitstream. On the other hand, when explicit transform type determination is not allowed, the transform type can be determined based on at least one of whether transforms are allowed in subblock units, the location of subblocks containing non-zero transform coefficients, whether a second transform is performed, whether a subpartitioned intra coding method is applied, or the size or shape of the current block. In an example, the horizontal transform type of the current block can be determined based on the width of the current block, and the vertical transform type of the current block can be determined based on the height of the current block. For example, when the width of the current block is less than 4 or greater than 16, the horizontal transform type can be determined as DCT2. Otherwise, the horizontal transform type can be determined as DST7. When the height of the current block is less than 4 or greater than 16, the vertical transform type can be determined as DCT2. Otherwise, the vertical transform type can be determined as DST7. In this case, the thresholds to be compared with the width and height to determine the horizontal and vertical transform types can be determined based on at least one of the size, shape, or intra prediction mode of the current block.

[0438] Alternatively, when the current block has a square shape with the same height and width, the horizontal transform type and the vertical transform type may be set to be the same. However, when the current block has a non-square shape with different height and width, the horizontal transform type and the vertical transform type may be set to be different. In this example, when the width of the current block is greater than the height, the horizontal transform type may be determined to be DST7, and the vertical transform type may be determined to be DCT2. When the height of the current block is greater than the width, the vertical transform type may be determined to be DST7, and the horizontal transform type may be determined to be DCT2.

[0439] The number and / or types of transform type candidates, or the number and / or types of transform type combination candidates, may vary depending on whether explicit transform type determination is permitted. In an example, when explicit transform type determination is permitted, DCT2, DST7, and DCT8 may be used as transform type candidates. Therefore, each of the horizontal transform type and the vertical transform type may be set to DCT2, DST7, or DCT8. When explicit transform type determination is not permitted, only DCT2 and DST7 may be used as transform type candidates. Therefore, each of the horizontal transform type and the vertical transform type may be determined to be DCT2 or DST7.

[0440] The decoder may perform inverse transform on the second transform (second inverse transform) and may perform inverse transform on the first transform result from the second inverse transform (first inverse transform). As a result of performing the second inverse transform and the first inverse transform, a residual signal of the current block may be obtained.

[0441] When the encoder performs transformation and quantization, the decoder can obtain a residual block through inverse quantization and inverse transformation. The decoder can add the prediction block and the residual block to each other to obtain a reconstructed block of the current block.

[0442] When obtaining a reconstructed block of the current block, information loss that occurs during quantization and encoding processes may be reduced through 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 applying the in-loop filter is referred to as a first reconstructed block, and the reconstructed block after applying the in-loop filter is referred to as a second reconstructed block.

[0443] The second reconstructed block may be obtained by applying at least one of a deblocking filter, SAO, or ALF to the first reconstructed block. In this regard, the SAO or ALF may be applied after the deblocking filter is applied.

[0444] The deblocking filter is used to mitigate quality degradation (eg, blocking artifacts) at block boundaries, which occurs when quantization is performed on each block. To apply the deblocking filter, a block strength (BS) between a first reconstructed block and adjacent reconstructed blocks may be determined.

[0445] Figure 31 is a flow chart illustrating a process for determining block strength.

[0446] exist Figure 31 In the example shown in , P represents a first reconstructed block, and Q represents a neighboring reconstructed block. In this regard, the neighboring reconstructed block may be adjacent to the left or top of the current block.

[0447] Figure 31 The illustrated example shows that block strength is determined considering prediction encoding modes of P and Q, whether transform coefficients other than 0 are included, whether inter prediction is performed by using the same reference picture, or whether a difference in motion vectors is equal to or greater than a threshold.

[0448] Based on the block strength, it may be determined whether to apply a deblocking filter. In an example, when the block strength is 0, no filtering may be performed.

[0449] SAO is intended to mitigate ring artifacts that occur when quantization is performed in the frequency domain. SAO can be performed by adding or subtracting an offset determined by considering the pattern of the first reconstructed image. The offset determination method includes edge offset (EO) or band offset (BO). EO represents a method of determining the offset of the current sample based on the pattern of neighboring pixels. BO represents a method of applying a common offset to a group of pixels with similar brightness values ​​in an area. Specifically, the pixel brightness can be partitioned into 32 uniform parts, and pixels with similar brightness values ​​can be set as a group. In the example, 4 adjacent bands out of 32 bands can be set as a group, and the same offset value can be applied to the samples belonging to the 4 bands.

[0450] ALF is a method of generating a second reconstructed image by applying a filter having a predefined size / shape to a first reconstructed image or a reconstructed image to which a deblocking filter is applied. The following Equation 8 represents an example of applying ALF.

[0451] Equation 8

[0452]

[0453] Any one of the predefined filter candidates may be selected based on a picture, a coding tree unit, a coding block, a prediction block, or a transform block. At least one of a size or a shape of each filter candidate may be different.

[0454] Figure 32 Represents a predefined filter candidate.

[0455] As in Figure 32 In the illustrated example, at least any one of diamond shapes of 5×5, 7×7, or 9×9 sizes may be selected.

[0456] Only diamond shapes of 5×5 size may be used for chroma components.

[0457] For real-time or low-latency encoding of high-resolution images such as panoramic videos, 360-degree videos, or 4K / 8K UHD (ultra-high definition), a method of partitioning a picture into multiple regions and encoding / decoding these regions in parallel can be considered. Specifically, depending on the processing purpose, the picture can be partitioned into tiles or slices (or groups of tiles).

[0458] A parallel block represents the basic unit for parallel encoding / decoding. Each parallel block can be processed in parallel. A parallel block can have a rectangular shape. Alternatively, non-rectangular parallel blocks can be allowed.

[0459] Information indicating whether non-rectangular tiles are allowed or present may be signaled in the bitstream.

[0460] When encoding / decoding a parallel block, it can be set to not use the data of other parallel blocks. Parallel processing of parallel blocks can be supported by removing the encoding / decoding dependencies between parallel blocks. Specifically, the probability table of the CABAC (context adaptive binary arithmetic coding) context can be initialized for each parallel block, and the loop filter can be set to not be applied to the boundary of the parallel block. In addition, the data in other parallel blocks may not be used as candidates for deriving motion vectors. For example, the data in other parallel blocks can be set to not be used as merge candidates, motion vector prediction candidates (AMVP candidates) or motion information candidates. In addition, the data in another parallel block can be set to not be used for context calculation of symbols.

[0461] Information about video encoding / decoding may be signaled through a slice header. The information signaled through a slice header may be commonly applied to coding tree units or tiles included in a slice. A slice may also be referred to as a tile group.

[0462] Figure 33 is a diagram illustrating a screen partitioning method according to an embodiment of the present disclosure.

[0463] First, a determination may be made as to whether the current picture is partitioned into a plurality of processing units (S3301). In this regard, the processing units may include at least one of a tile or a slice. In an example, a syntax "no_pic_partition_flag" indicating whether the current picture is partitioned into a plurality of tiles or slices may be signaled in the bitstream. If the value of the syntax "no_pic_partition_flag" is 0, this indicates that the current picture is partitioned into at least one tile or at least one slice. On the other hand, if the value of the syntax "no_pic_partition_flag" is 1, this indicates that the current picture is not partitioned into a plurality of tiles or slices.

[0464] When it is determined not to partition the current picture into a plurality of processing units, the partitioning process of the current picture may be ended. In this regard, it may be understood that the current picture is composed of a single tile and a single slice (or a single tile group).

[0465] Alternatively, information indicating whether multiple tiles exist in a picture may be signaled in the bitstream. The information may include at least one of a 1-bit flag indicating whether multiple tiles exist in the picture or information specifying the number of tiles in the picture.

[0466] When it is determined to partition the current picture into a plurality of processing units, tile partition information may be signaled in the bitstream.The picture may be partitioned into at least one tile based on the signaled tile partition information (S3302).

[0467] When the current picture is partitioned into a plurality of tiles, a slice may be determined by combining the plurality of tiles or partitioning the tiles ( S3303 ).

[0468] Hereinafter, according to the present disclosure, a parallel block partitioning method and a stripe determination method will be described in detail.

[0469] Figure 34 This shows an example of partitioning a screen into multiple parallel blocks.

[0470] A tile may include at least one coding tree unit. The boundaries of a tile may be set to match the boundaries of a coding tree unit. In other words, partitioning a coding tree unit into multiple partition types may not be allowed.

[0471] When a picture is partitioned into a plurality of tiles, heights of adjacent tiles or widths of adjacent tiles may be set to have the same value.

[0472] In the example, as in Figure 34In the example shown, the heights of tiles in the same tile row and / or the widths of tiles in the same tile column can be set to be the same. Tiles in the same tile row can be referred to as a horizontal tile set, and tiles in the same tile column can be referred to as a vertical tile set.

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

[0474] Information indicating the partition shape of a picture may be signaled in a bitstream and may be encoded and signaled via a picture parameter set, a sequence parameter set, or a slice header.

[0475] The information indicating the partition shape of the picture may include at least one of information indicating whether the tiles are partitioned into uniform sizes, information indicating the number of tiles columns, or information indicating the number of tiles rows. In this case, the number of tiles columns indicates the number of tiles in the vertical direction, and the number of tiles rows indicates the number of tiles in the horizontal direction.

[0476] The information indicating whether the tiles are partitioned in a uniform size may be a 1-bit flag uniform_spacing_flag. When it is determined to partition the picture in a uniform size, the remaining tiles except for tiles adjacent to the right and / or bottom boundaries of the picture may have the same size.

[0477] When a picture is partitioned using at least one of a vertical line or a horizontal line passing through the picture, each tile belongs to a different column and / or row. To determine the partition shape of the picture, information indicating the number of tile columns and / or tile rows may be transmitted by a signal. In an example, information num_tile_row_minus1 indicating the number of tile rows and information num_tile_column_minus1 indicating the number of tile columns generated by partitioning the picture may be transmitted by a signal in 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.

[0478] exist Figure 34 In the illustrated example, the number of tile columns is 4, and the number of tile rows is 3. Therefore, num_tile_columns_minus1 may represent 3, and num_tile_rows_minus1 may represent 2.

[0479] When the value of the syntax uniform_tile_spacing_flag is 0, the syntax num_tile_column_minus1 indicating the number of tile columns and / or the syntax num_tile_rows_minus1 indicating the number of tile rows may be signaled. In other words, when it is determined not to partition the current picture into tiles having uniform height and width, the syntax num_tile_column_minus1 indicating the number of tile columns and / or the syntax num_tile_rows_minus1 indicating the number of tile rows may be signaled.

[0480] The syntax indicating the width of each tile column and the syntax indicating the height of each tile row may be signaled in the bitstream. In an example, tile_cols_width_minus1[i] may indicate the width of the i-th tile column, and tile_rows_height_minus1[j] may indicate the height of the j-th tile row.

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

[0482] The syntax tile_rows_height_minus1[j] represents the value obtained by subtracting 1 from the number of coding tree unit rows that make up the j-th tile row. Signaling of the syntax tile_rows_height_minus1[j] can be omitted for the last tile row. 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.

[0483] The last tile row may have a height equal to or less than the value specified by the syntax tile_cols_width_minus1. In this example, when the index of the last tile row is n, the height of the last tile row may be set to the value obtained by subtracting the heights of the 0th to (n-1)th tile rows from the height of the current block. In other words, the height of a tile located at the bottom boundary of the current picture may be less than or equal to the height of another tile.

[0484] In addition, information indicating the size of the coding tree unit may be signaled through a sequence parameter set or through a picture parameter set.

[0485] A tile can be configured with at least one coding tree unit. Except for tiles adjacent to the right or bottom border of the picture, the remaining tiles can be set to be unconfigured by including an area smaller than the coding tree unit. In other words, the boundaries of the tile match the boundaries of the coding tree unit.

[0486] Depending on the partition shape of the picture, the tiles may have the same size in all areas except for the picture boundaries. Alternatively, the heights of horizontally adjacent tiles may be set to be the same, or the widths of vertically adjacent tiles may be set to be the same.

[0487] Information indicating whether the current picture is partitioned into multiple tiles can be signaled in the bitstream. In an example, the syntax single_tile_in_pic_flag can be signaled in the bitstream. When the syntax single_tile_in_pic_flag is 1, it indicates that the current picture is not partitioned into multiple tiles. On the other hand, when single_tile_in_pic_flag is 0, it indicates that the current picture is partitioned into multiple tiles.

[0488] When the current picture is determined to be partitioned into a plurality of parallel blocks, at least one of information for determining the number of parallel block columns and parallel block rows, information indicating whether the parallel blocks are evenly partitioned, or information for determining the sizes of the parallel block columns and parallel block rows may be encoded.

[0489]

Table 8

[0490]

[0491] Information for determining tile size may be encoded and signaled. In an example, a syntax element tile_width_minus1[i] representing the width of the i-th tile column and a syntax element tile_height_minus1[i] representing the height of the i-th tile row may be encoded in the bitstream.

[0492] Information for specifying the number of tile columns whose widths are explicitly signaled in the current picture may be signaled in the bitstream. In an example, the syntax num_exp_tile_columns_minus1 for determining the number of tile columns whose widths are signaled may be signaled in the bitstream. The syntax num_exp_tile_columns_minus1 may be a value obtained by subtracting 1 from the number of tile columns whose widths are signaled.

[0493] As many syntaxes for specifying the width of tile columns as the number determined based on the syntax num_exp_tile_columns_minus1 may be encoded and signaled. In an example, the syntax tile_width_minus1[i] indicating the width of the i-th tile column may be signaled in the bitstream.

[0494] When the index i of a tile column is less than the number of tile columns whose widths are explicitly signaled, the width of the corresponding tile column may be determined based on syntax tile_width_minus1[i] signaled in the bitstream.

[0495] On the other hand, when the index j of a tile column is equal to or greater than the number of tile columns whose widths are explicitly signaled, the width of the corresponding tile column may be determined based on the last signaled syntax tile_width_minus1[1]. In this case, l may represent the index of the last signaled tile column whose width is signaled, and may be an integer less than j. In this example, when the value obtained by subtracting the width of the previous tile column from the width of the current picture is equal to or greater than the value obtained by adding 1 to the syntax tile_width_minus1[1], the width of tile column j may be set to the value obtained by adding 1 to the syntax tile_width_minus1[1]. On the other hand, when the value obtained by subtracting the width of the previous tile column from the width of the current picture is less than the value obtained by adding 1 to the syntax tile_width_minus1[1], the difference obtained by subtracting the width of the previous tile column from the width of the current picture may be set as the width of tile column j.

[0496] In other words, the widths of the remaining tile blocks columns excluding the tile block column whose width is explicitly signaled may have values ​​less than or equal to the width of the last tile block column among the tile block columns whose width is explicitly signaled.

[0497] Information for specifying the number of tile columns whose widths are explicitly signaled in the current picture may be signaled in the bitstream. In an example, the syntax num_exp_tile_columns_minus1 for determining the number of tile columns whose widths are signaled may be signaled in the bitstream. The syntax num_exp_tile_columns_minus1 may be a value obtained by subtracting 1 from the number of tile columns whose widths are signaled.

[0498] As many syntaxes for specifying the height of tile rows as the number determined based on the syntax num_exp_tile_rows_minus1 may be encoded and signaled. In an example, the syntax tile_height_minus1[i] indicating the height of the i-th tile row may be signaled in the bitstream.

[0499] When the index i of a tile row is less than the number of tile rows whose heights are explicitly signaled, the height of the corresponding tile row may be determined based on the syntax tile_height_minus1[i] signaled in the bitstream.

[0500] On the other hand, when the index j of a tile row is equal to or greater than the number of tile rows whose heights are explicitly signaled, the height of the corresponding tile row may be determined based on the last signaled syntax tile_height_minus1[l]. In this case, l may represent the index of the tile row whose height was last signaled and may be an integer less than j.

[0501] In this example, when the value obtained by subtracting the height of the previous tile row from the height of the current picture is equal to or greater than the value obtained by adding 1 to the syntax tile_height_minus1[1], the height of tile row j may be set to the value obtained by adding 1 to the syntax tile_height_minus1[1]. On the other hand, when the value obtained by subtracting the height of the previous tile row from the height of the current picture is less than the value obtained by adding 1 to the syntax tile_height_minus1[1], the difference obtained by subtracting the height of the previous tile row from the height of the current picture may be set to the height of tile row j.

[0502] In other words, the heights of the remaining tile block rows excluding the tile block row whose height is explicitly signaled may have a value less than or equal to the width of the last tile block row among the tile block rows whose height is explicitly signaled.

[0503] The parallel blocks can be recursively partitioned. In an example, one parallel block can be partitioned into multiple parallel blocks.

[0504] Each of the multiple parallel blocks generated by partitioning the parallel block may be referred to as a sub-parallel block or a partition. A partition may be a unit of parallel processing. In an example, the partitions may be encoded / decoded independently of each other. When encoding / decoding a block included in a partition, it may be set to not use the data of another block. In one example, the samples included in another partition may be set to not be used as reference samples for intra prediction. Optionally, the data in another partition may be set to not be used as a merge candidate, a motion vector prediction candidate (AMVP candidate), or a motion information candidate. Optionally, the data in other partitions may not be used for context calculation of symbols.

[0505] Figure 35 It is a diagram for explaining the generation of blocks.

[0506] The blocks can be generated by partitioning the parallel blocks in the horizontal direction. Figure 35 The example shown in shows that the tile belonging to the last tile column in the current picture is partitioned into 2 partitions.

[0507] When raster scanning is applied to a tile, raster scanning may be applied between partitions. In this example, after scanning all blocks included in a particular tile, subsequent tiles may be scanned. In other words, the partitions may have the same state as the tile.

[0508] The boundaries of a partition may match the boundaries of a coding tree unit. In other words, at least one coding tree unit row in a tile may be defined as a partition.

[0509] Information indicating whether a tile is partitioned into a plurality of partitions may be signaled in a bitstream. Table 9 shows a syntax table including information for determining whether a tile is partitioned.

[0510]

Table 9

[0511]

[0512]

[0513] The information related to the block partitioning may include at least one of information indicating whether there is at least one block partitioned into blocks, information indicating whether the block is partitioned into blocks, information indicating the number of blocks in a parallel block, or information indicating the size of the block.

[0514] In an example, a syntax brick_splitting_present_flag indicating whether there is at least one tile partitioned into partitions may be signaled in the bitstream.

[0515] When the syntax brick_splitting_present_flag is 1, at least one or more tiles may be partitioned into a plurality of tiles. When the syntax brick_splitting_present_flag is 1, brick_split_flag indicating whether the tile is partitioned into a plurality of tiles may be additionally signaled.

[0516] When the syntax brick_splitting_present_flag is 0, it indicates that no tile partitioned into multiple partitions exists in one or more current pictures referencing the PPS. When the syntax brick_splitting_present_flag is 0, encoding of brick_split_flag indicating whether the tile is partitioned into multiple partitions may be omitted.

[0517] When it is determined that a tile partitioned into multiple partitions exists in the current picture, a syntax brick_split_flag[i] indicating whether the i-th tile is partitioned into multiple partitions may be signaled. In this example, when the value of the syntax brick_split_flag[i] is 1, it indicates that the tile with tile index i is partitioned into two or more partitions. When the value of the syntax brick_split_flag[i] is 0, it indicates that the tile with tile index i is not partitioned.

[0518] When a tile is partitioned into multiple tiles, information determining the tile's partitioning can be signaled in the bitstream. In one example, the syntax uniform_brick_spacing_flag can be signaled in the bitstream. When the syntax uniform_brick_spacing_flag is 1, it indicates that the tiles in the tile are uniform in height. When the value of uniform_brick_spacing_flag is 1, the syntax brick_height_minus1 indicating the base height of the tiles can be signaled. The syntax brick_height_minus1 indicates a value obtained by subtracting 1 from the number of coding tree units that make up the tile.

[0519] The remaining tiles except the last tile in the tile may have a base height determined by the syntax brick_height_minus 1. The last tile in the tile may be set to not include the remaining area of ​​other tiles.

[0520] When the value of the syntax uniform_brick_spacing_flag is 0, the syntax num_brick_rows_minus1[i] indicating the number of tiles in the i-th tile and the syntax brick_row_height_minus1[i][j] indicating the height of the j-th tile in the i-th tile may be signaled. The syntax num_brick_rows_minus1[i] indicates a value obtained by subtracting 1 from the number of tiles included in the i-th tile.

[0521] For the last tile in a tile, the signaling of the syntax brick_row_height_minus1[i] may be omitted. The height of the last tile in a tile may be derived by subtracting the sum of the heights of the previous tiles from the height of the tile.

[0522] The syntax brick_height_minus1[i] indicating the height of a tile may have a value smaller than the value obtained by subtracting 1 from the height of the tile including the tile. In an example, when the height of the tile is rowHeight, the syntax brick_height_minus1[i] may have a value between 0 and rowHeight-2. In this case, rowHeight indicates the number of coding tree unit rows included in the tile.

[0523] Alternatively, the partitioning aspect of the tile may be determined by omitting encoding of a flag indicating whether the tile is uniformly partitioned and using at least one of information indicating the number of tiles and information indicating the height of the tile.

[0524] Alternatively, the partitioning of the tile can be determined using information specifying the number of tiles whose heights are explicitly signaled. In an example, the syntax num_exp_brick_minus1 for determining the number of tiles whose heights are signaled can be signaled in the bitstream. The syntax num_exp_brick_minus1 can have a value obtained by subtracting 1 from the number of tiles whose heights are explicitly signaled.

[0525] As many syntaxes for specifying the height of a tile as the number determined based on the syntax num_exp_brick_minus1 may be encoded and signaled. In an example, brick_height_minus1[i] represents the height of the i-th tile.

[0526] When the index i of the block is less than the number of blocks whose heights are signaled, the height of the corresponding block may be determined based on brick_height_minus1[i] signaled in the bitstream. On the other hand, when the index j of the block is equal to or greater than the number of blocks whose heights are signaled, the height of the corresponding block may be set to be the same as the last signaled syntax brick_height_minus1[l]. In this case, l may represent the index of the last signaled block and may be an integer less than j.

[0527] Parallel blocks and partitions can be identified by parallel block indices. Parallel block indices can be assigned to each parallel block and partition in raster scan order. When a parallel block is partitioned into multiple partitions, a parallel block index can be assigned to each of the multiple partitions.

[0528] In the later-mentioned embodiments, the term "tile" may include a tile and a tile generated by partitioning the tile (ie, a sub-tile or a partition).

[0529] At least one or more parallel blocks may be defined as a processing unit. In an example, multiple parallel blocks may be defined as a stripe. A stripe may be referred to as a parallel block group.

[0530] Optionally, a tile can be partitioned into multiple processing units. In an example, a tile can be partitioned into multiple slices. In this regard, a slice can include at least one coding tree unit column. When a tile is partitioned into multiple slices, information indicating the height of each slice can be signaled in the bitstream.

[0531] Image encoding / decoding information may be signaled through a slice header. Information signaled through a slice header may be commonly applied to tiles and / or partitions belonging to a slice.

[0532] The information indicating the slice type indicates a definition method of slices in the current picture. In an example, a syntax rect_slice_flag indicating the slice type may be signaled in a bitstream.

[0533] The syntax rect_slice_flag indicates whether the slice is defined based on the raster scan order of the tile or whether the slice is defined in a rectangular shape. In this example, when rect_slice_flag is 0, it indicates that the slice is defined based on the raster scan order of the tile. On the other hand, when rect_slice_flag is 1, it indicates that the slice is defined in a rectangular shape.

[0534] Hereinafter, two methods for determining the bands will be described in detail.

[0535] The raster scan-based definition method defines stripes based on the raster scan order of the tiles. Under this raster scan-based definition method, one or more consecutive tiles can be defined as a stripe. In this case, the order between consecutive tiles can be determined based on the raster scan order. When raster scanning stripes is applied, non-rectangular stripes can be generated.

[0536] Figure 36 and Figure 37 is a diagram illustrating an example of defining stripes based on a raster order.

[0537] In the example, Figure 36 In the example shown, when it is assumed that the first slice (slice0) includes 3 tiles, the first slice slice0 may be defined as including tile block 0 to tile block 2 according to the raster scan order. When it is assumed that the second slice slice1 includes 6 tiles, the second slice slice1 may be defined as including tile block 3 to tile block 8 according to the raster scan order. According to the raster scan order, the last slice slice2 may include the remaining tile blocks (tile block 9 to tile block 11).

[0538] When slices are defined based on a raster scan order, information on the number of tiles included in each slice may be transmitted by a signal. For the last slice, signal transmission of information indicating the number of tiles included in the slice may be omitted.

[0539] When a slice includes a plurality of tiles, the widths or heights of the tiles included in the slice may be different. In this example, it is shown that the height of tile 3 among the tiles included in the second slice slice1 is different from that of the other tiles.

[0540] The rectangular stripe definition method is a partitioning method that allows only rectangular stripes. When the rectangular stripe definition method is applied, tiles located at the four corners of the stripe belong to the same row or column.

[0541] Figure 38 is a diagram showing an example in which only stripes of a rectangular shape are allowed.

[0542] As in Figure 38 In the example shown, the fourth slice slice3 includes tile 5, tile 6, tile 9, and tile 10. As in the example shown, when a slice includes multiple tiles, a rectangle having an upper left tile and a lower right tile as its two vertices may be defined as one slice.

[0543] The border of the slice can match the border of the picture and / or the border of the tile. In an example, the left border or top border of the slice can be set as the border of the picture, or the left border or top border of the slice can be set as the border of the tile.

[0544] When a method for defining rectangular stripes is used, information identifying the tiles included in each stripe may be transmitted by a signal to determine the tiles included in each stripe. This information may be used to specify at least one of the first tile or the last tile in the stripe. The order of the tiles may be determined according to a predetermined scan order. In an example, when a raster scan order is used, the first tile indicates the tile at the upper left position of the stripe, and the last tile indicates the tile at the lower right position of the stripe.

[0545] Information for identifying at least one of an index of a tile at the top left of a slice or an index of a tile at the bottom right of a slice may be signaled in a bitstream. In an example, at least one of a syntax for identifying an index of a tile at the top left of a slice, top_left_tile_idx, or a syntax for identifying an index of a tile at the bottom right of a slice, bottom_right_tile_idx, may be signaled in the bitstream. For the last slice, encoding of at least one of the syntax for identifying an index of a tile at the top left of a slice or the syntax for identifying an index of a tile at the bottom right of a slice may be omitted. The remaining area of ​​the current picture, excluding the area occupied by the previous slice, may be set as the last slice.

[0546] In the example, Figure 38 In the example shown, top_left_tile_idx, which indicates the index of the tile at the top left position of the slice, and bottom_right_tile_idx, which indicates the index of the tile at the bottom right position of the slice, may be signaled for each of slice0, slice1, and slice2. On the other hand, encoding of top_left_tile_idx and bottom_right_tile_idx may be omitted for slice3, the last slice in the picture. The index of the top left tile of slice3, the last slice in the picture, may be set to the index of the top left tile in the remaining area of ​​the picture excluding slice0, slice1, and slice2, and the index of the bottom right tile of slice3 may be set to the index of the bottom right tile in the remaining area (or the bottom right tile of the picture).

[0547] Optionally, difference information for specifying the index of a tile included in a slice may be encoded and signaled. In an example, information indicating the difference between the index of a tile at the top left position of the slice and the index of a tile at the bottom right position of the slice may be signaled in the bitstream. In an example, syntax top_left_tile_idx[i] for identifying the index of the tile at the top left position of the slice and syntax bottom_right_tile_idx_delta[i] indicating the difference between the index of the tile at the top left position of the slice and the index of the tile at the bottom right position of the slice may be signaled for the i-th slice. The index of the bottom right tile of the i-th slice may be derived by summing top_left_tile_idx[i] and bottom_right_tile_idx_delta[i]. For the last slice, encoding of at least one of a syntax indicating an index of a tile located at the upper left position of the slice or a syntax indicating a difference between an index of the tile located at the upper left position of the slice and an index of a tile located at the lower right position of the slice may be omitted. The remaining area in the current picture excluding the area occupied by the previous slice may be set as the last slice.

[0548] Alternatively, at least one of horizontal tile index difference information or vertical tile index difference information may be encoded and signaled. The horizontal tile index difference information may indicate the difference between the index of the first tile and the index of the rightmost tile in the same tile row as the first tile. The vertical tile index difference information may indicate the difference between the index of the first tile and the index of the lowest tile in the same tile column as the first tile.

[0549] The type of difference information to be encoded can be determined based on the position of the slice. In this example, horizontal tile index difference information or vertical tile index difference information can be encoded and signaled for slices adjacent to the right or bottom border of the picture. By encoding the horizontal tile index difference information or vertical tile index difference information instead of encoding information indicating the index difference between the upper left tile and the lower right tile, the bit count can be reduced.

[0550] Alternatively, when the picture is partitioned into at least one or more slice rows, information indicating the index difference between the upper left tile and the lower right tile may be encoded for a slice adjacent to the left boundary of the picture. Slices belonging to the same row may be set to have the same height.

[0551] Difference information between the index of the tile included in the first slice and the index of the tile included in the second slice may be encoded and signaled. In this case, the first slice and the second slice may be determined based on a scanning order, and each slice may be occupied by a different tile.

[0552] In an example, when the tiles constituting the first slice and the tiles constituting the second slice are different, the index of the second slice may be obtained by adding 1 to the index i of the first slice.

[0553] Alternatively, when the first tile is partitioned to include a plurality of slices, difference information may be encoded between a first slice included in the first tile and a second slice included in a second tile, or between the first slice included in the first tile and the second slice included in the second tile, where the second tile is the next tile of the first tile in the scanning order. In this case, the difference information may be encoded only for the first slice or the last slice among the plurality of slices included in the first tile.

[0554] The tile used to derive difference information between the first slice and the second slice may be located at the upper left, upper right, lower right, lower left, or center of the slice.

[0555] Table 10 shows a syntax table including difference information.

[0556]

Form 10

[0557]

[0558]

[0559] In an example, a syntax top_left_brick_idx_delta[i] representing the index difference between the top left tile of the i-th slice and the top left tile of the previous slice (ie, the (i-1)-th slice) may be signaled in a bitstream.

[0560] Based on the difference information, the position of the top-left tile in the i-th slice can be determined. Specifically, the index of the top-left tile in the i-th slice can be derived by adding the index of the top-left tile in the (i-1)-th slice to the syntax top_left_brick_idx_delta[i]. Equation 9 shows an example of deriving the index of the top-left tile in the i-th slice.

[0561] Equation 9

[0562] TopLeftBrickIdx[i]=TopLeftBrickIdx[i-1]+top_left_brick_idx_delta[i]

[0563] In Equation 9, TopLeftBrickIdx[i-1] represents the index of the top left tile of the (i-1)th slice.

[0564] For the first slice (i.e., the slice with index i being 0), encoding of the syntax top_left_brick_idx_delta[i] indicating difference information from the previous slice may be omitted. For the first slice, the syntax bottom_right_brick_idx_delta[i] indicating the index difference between the top left tile and the bottom right tile of the slice may be encoded and signaled.

[0565] Table 11 shows an example of a process of specifying a slice to which each tile belongs by using difference information.

[0566]

Table 11

[0567]

[0568] NumBricksInSlice[i] represents the number of tiles included in slice i. TopLeftBrickIdx[i] represents the index of the top-left tile of slice i. BotRightBkIdx represents the index of the bottom-right tile. BrickColBd[j] represents the index of the tile column to which tile j belongs. BrickRowBd[j] represents the index of the tile row to which tile j belongs. BricksToSliceMap[j] = i indicates that tile j is added to slice i.

[0569] Alternatively, a slice may be defined using information specifying at least one of a width or a height of the slice. In an example, at least one of the syntax slice_width_in_tiles_minus1[i] indicating the width of the i-th slice or the syntax slice_height_in_tiles_minus1[i] indicating the height of the i-th slice may be signaled in the bitstream.

[0570] The syntax slice_width_in_tiles_minus1[i] represents a value obtained by subtracting 1 from the number of tile columns included in the i-th slice. The syntax slice_height_in_tiles_minus1[i] represents a value obtained by subtracting 1 from the number of tile rows included in the i-th slice.

[0571] The i-th slice may be composed of as many tile columns as determined based on the syntax slice_width_in_tiles_minus1[i] and as many tile rows as determined based on the syntax slice_height_in_tiles_minus1[i]. In this case, the top left tile of the i-th tile column may have an index value determined based on top_left_brick_idx_delta[i].

[0572] Alternatively, the syntax slice_height_in_tiles_minus1[i] indicating the height of a slice may be signaled only for a slice adjacent to the left boundary of a picture, and encoding of the syntax slice_height_in_tiles_minus1[i] may be omitted for other slices. The height of a slice for which encoding of the syntax slice_height_in_tiles_minus1[i] is omitted may be set to the same height as that of a slice adjacent to the left boundary of the current picture among the slices included in the same row.

[0573] The index TopLeftBrickIdx[0] of the top left tile of the first slice may be set to 0. Therefore, for the second slice (i.e., the slice with index i being 1), the syntax top_left_brick_idx_delta[i] has substantially the same value as the index of the top left tile. Therefore, the syntax top_left_brick_idx[i] may be signaled for the second slice instead of the syntax top_left_brick_idx_delta[i]. In this case, top_left_brick_idx[i] represents the index of the top left tile of the i-th slice.

[0574] In another example, the syntax top_left_brick_idx_delta[i] may be set to the difference between the first tile of the i-th slice and the first tile of the (i+1)-th slice. In other words, the index of the top-left tile of the (i+1)-th slice may be derived by summing the index of the top-left tile of the i-th slice with the syntax top_left_brick_idx_delta[i] signaled for the i-th slice. When the syntax top_left_brick_idx_delta[i] represents the difference information between the i-th slice and the (i+1)-th slice, encoding of the syntax top_left_brick_idx_delta[i] may be omitted for the last slice.

[0575] A tile can be partitioned into multiple stripes. In an example, multiple stripes can be generated by partitioning the tile horizontally or vertically.

[0576] When it is determined that a slice does not include multiple tiles, it may be determined whether the tile is to be partitioned into multiple slices. In an example, when both the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] are 0, it indicates that the slice consists of only a single tile or the tile is partitioned into multiple slices.

[0577] When both the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] are 0, information indicating whether a tile is partitioned into multiple tiles may be signaled. In an example, the syntax num_exp_slices_in_tile[i] indicating information about the number of slice heights that should be explicitly signaled may be signaled in the bitstream. The syntax num_exp_slices_in_tile[i] may have a value that is the same as or less than the number of slices included in the tile.

[0578] When the syntax num_exp_slices_in_tile[i] is 0, it indicates that the tile is not partitioned into multiple slices. When the syntax num_exp_slices_in_tile[i] is greater than 0, it indicates that the tile can be partitioned into multiple slices.

[0579] Information indicating the height of as many slices as the value indicated by the syntax num_exp_slices_in_tile[i] may be signaled. In an example, when the syntax num_exp_slices_in_tile[i] is greater than 1, the syntax exp_slice_height_in_ctu_minus1[j] indicating the height of the j-th slice in the tile may be signaled.

[0580] When the slice index j is less than the number of slices whose heights are explicitly signaled, the width of slice j may be determined based on the syntax exp_slice_height_in_ctu_minus1[j] signaled in the bitstream. On the other hand, when the slice index k is equal to or greater than the number of slices whose heights are explicitly signaled, the height of slice k may be determined based on the last signaled syntax exp_slice_height_in_ctu_minus1[l]. In this case, l may represent the index of the slice whose height is last signaled and may be an integer less than k.

[0581] In an example, when the value obtained by subtracting the height of the previous slice from the height of the tile is equal to or greater than the value obtained by adding 1 to the syntax exp_slice_height_in_ctu_minus1[1], the height of the slice k may be set to the value obtained by adding 1 to the syntax exp_slice_height_in_ctu_minus1[1]. On the other hand, when the value obtained by subtracting the height of the previous slice from the height of the tile is less than the value obtained by adding 1 to the syntax exp_slice_height_in_ctu_minus1[1], the difference obtained by subtracting the height of the previous slice from the height of the tile may be set to the height of the slice k.

[0582] In other words, the heights of the remaining slices excluding the slice whose height is explicitly signaled may have values ​​less than or the same as the height of the last slice among the slices whose height is explicitly signaled.

[0583] When the number of tile columns in the current picture is 1, encoding of the syntax slice_width_in_tiles_minus1 can be omitted. In addition, when the number of tile rows in the current picture is 1, encoding of the syntax slice_height_in_tiles_minus1 can be omitted.

[0584] Alternatively, encoding of at least one of the information indicating the width of the stripe or the information indicating the height of the stripe may be omitted.

[0585] In an example, encoding of the syntax slice_width_in_tiles_minus1 indicating the width of a slice may be omitted, and the distance from a tile at a predetermined position in an adjacent slice may be set as the width of the slice. Specifically, the top left tile of the (i+1)th slice adjacent to the right side of the i-th slice may be specified using the syntax top_left_brick_idx_delta[i]. The width of the i-th slice may be derived from the difference between the x-coordinate of the top left tile in the i-th slice (e.g., the x-coordinate of the top left sample) and the x-coordinate of the top left tile in the (i+1)th slice (e.g., the x-coordinate of the top left sample).

[0586] Alternatively, encoding of the syntax slice_height_in_tiles_minus1 indicating the height of a slice may be omitted, and the distance from a slice at a predetermined position in an adjacent slice may be set as the height of the slice. Specifically, the top left tile of the jth slice located at the bottom of the i-th slice may be specified by the syntax top_left_brick_idx_delta[j-1]. The height of the i-th slice may be derived by the difference between the y coordinate of the top left tile in the i-th slice (e.g., the y coordinate of the top left sample) and the y coordinate of the top left tile in the j-th slice (e.g., the y coordinate of the top left sample).

[0587] Optionally, when a slice is defined in a rectangular shape, information indicating whether difference information is used may be signaled in the bitstream. In an example, delta_present_flag indicating whether difference information is used may be signaled in the bitstream. When the value of the syntax delta_present_flag is 1, it indicates that syntax indicating a difference of a tile index is encoded and signaled. In an example, when the value of the syntax delta_present_flag is 1, the i-th slice may be defined by syntax slice_width_in_tiles_minus1[i] and syntax slice_height_in_tiles_minus1[i] indicating the size of the slice and difference information (e.g., top_left_brick_idx_delta[i-1] or bottom_right_brick_idx_delta[i]) used to determine the position of the top left tile or the position of the bottom right tile in the slice.

[0588] When the value of the syntax delta_present_flag is 0, the i-th slice may be defined by the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] indicating the size of the slice. When the value of the syntax delta_prsent_flag is 0, the slices adjacent to the right of the slice adjacent to the left boundary of the current picture may be set to have the same height as each other. Therefore, information indicating the height of the slice may be signaled only for the slice adjacent to the left boundary of the current picture, and signaling of information indicating the height of the slice may be omitted for slices not adjacent to the left boundary of the current picture.

[0589] Slices may be defined based on the index of a coding tree unit instead of the index of a tile.

[0590] In the above example, it is assumed that a stripe is defined by giving an order of tiles according to a raster scan order. In another example, a stripe may be defined by giving an order of tiles according to a vertical scan, a horizontal scan, or a diagonal scan.

[0591] It is within the scope of the present disclosure to apply the embodiments described with respect to the decoding process or encoding process to the encoding process or decoding process, respectively. It is within the scope of the present disclosure to modify embodiments that operate in a predetermined order to embodiments that operate in a different order than the predetermined order.

[0592] Although the above embodiments are described based on a series of operations or flow charts, the embodiments do not limit the time sequence order of the operations of the method to this. In another example, the operations can be performed simultaneously or in a different order as needed. In addition, in the above embodiments, each of the components constituting the block diagram (e.g., units, modules, etc.) can be implemented in the form of hardware devices or software. Multiple components can be combined into a single component, wherein the single component can be implemented using a single hardware device or software. The above embodiments can be implemented using program instructions that can be executed via various computer components. Instructions can be recorded in a computer-readable storage medium. The computer-readable storage medium can include program instructions, data files, data structures, etc., individually or in combination therewith. Examples of computer-readable storage media include magnetic media (such as hard disks, floppy disks, and magnetic tapes), optical storage media (such as CD-ROMs, DVDs), and magneto-optical media (such as optical floppy disks), as well as hardware devices (such as ROMs, RAMs, flash memories, etc.), which are specifically configured to store and execute program instructions therein. The hardware device can be configured to operate as one or more software modules to perform the processing according to the present disclosure, and vice versa.

[0593] [Industrial Applicability]

[0594] The present disclosure may be applied to an electronic device that encodes / decodes a video.

Claims

1. A method for decoding a video, the method comprising: Partition the current screen into multiple parallel blocks; as well as decoding slice partition information specifying a slice definition method from a bitstream, the slice definition method being determined to be a raster scan slice definition method or a rectangular slice definition method, Wherein, under the rectangular strip definition method, the method further includes: determining a width of the first rectangular strip based on width information of the first rectangular strip; determining the height of the first rectangular strip based on the height information of the first rectangular strip, wherein the height information of the first rectangular strip is decoded from the bitstream only when the first rectangular strip is adjacent to the left boundary of the current picture, wherein, when the height information of the first rectangular strip is decoded from the bitstream, the height of the first rectangular strip is determined based on the height information decoded from the bitstream, and When the height information of the first rectangular slice is not decoded from the bitstream, the height information of the first rectangular slice is inferred to be the same as that of another rectangular slice adjacent to the left boundary of the current picture.

2. The method according to claim 1, in, In response to the width information and the height information both being equal to 0, the method further comprises decoding slice quantity information from the bitstream, When the stripe quantity information indicates a first value, the first rectangular stripe occupies the entire area of ​​the tile, and When the stripe quantity information indicates a value other than the first value, the first rectangular stripe is one of a plurality of rectangular stripes generated by partitioning the tile.

3. A method for encoding a video, the method comprising: Partition the current screen into multiple parallel blocks; as well as encoding slice partition information specifying a slice definition method into a bitstream, the slice definition method being determined to be a raster scan definition method or a rectangular slice definition method, Wherein, under the rectangular strip definition method, the method further includes: selectively encoding width information specifying a width of the first rectangular strip into the bitstream; and selectively encoding into the bitstream height information specifying a height of the first rectangular strip, wherein the height information of the first rectangular strip is encoded into the bitstream only when the first rectangular strip is adjacent to the left boundary of the current picture, When the first rectangular strip is adjacent to the left boundary of the current picture, height information of the first rectangular strip is encoded into the bitstream, and a value of the height information is determined by referring to the height of the first rectangular strip, and When the first rectangular strip is not adjacent to the left boundary of the current picture, height information of the first rectangular strip is not encoded into the bitstream, and the height of the first rectangular strip is the same as that of another rectangular strip adjacent to the left boundary of the current picture.

4. The method according to claim 3, in, In response to the width information and the height information both being equal to 0, the method further comprises encoding slice quantity information into the bitstream, When the first rectangular strip occupies the entire area of ​​the tile, the strip quantity information is set to have a first value, and When the first rectangular stripe is one of a plurality of rectangular stripes generated by partitioning the tile, the stripe quantity information is set to have a value other than the first value.