Coding / decoding method of video image signal, and device for them

By splitting video pictures into tiles or slices based on a tile index or differential information, the method addresses the limitations of existing video compression standards, enhancing efficiency and performance.

JP2025037965AActive Publication Date: 2025-03-18APPLE INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024206509
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-10-11
Filing Date
2024-11-27
Publication Date
2025-03-18
Estimated Expiration
2040-10-08

AI Technical Summary

Technical Problem

The existing video compression standards, such as HEVC, have reached their performance limits as demand for high-quality video services with larger display panels increases, leading to inefficiencies in data volume and compression rates.

Method used

The method involves splitting a video picture into multiple tiles or slices during encoding and decoding, allowing for flexible slicing based on a tile index or differential information from previous slices, which improves encoding and decoding efficiency.

Benefits of technology

This approach enhances coding and decoding efficiency by allowing for more flexible and adaptive slicing strategies, thereby improving the overall performance of video compression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025037965000001_ABST
    Figure 2025037965000001_ABST
Patent Text Reader

Abstract

To provide a video image decoding method for improving a coding / decoding efficiency, and provide a video image coding method.SOLUTION: A video decoding method includes steps of: dividing the current picture into a plurality of tiles; decoding division information indicating a slice type indicating whether or not a square shape slice is adopted; and decoding first width information and first height information of the slice in the case that the division information indicates that the square shape slice is adopted. In the case where the first width information indicates one tile column, and the first height information indicates one tile raw, a parsing is made for number information on the basis of a height of a tile in which the slice is contained.SELECTED DRAWING: Figure 33
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

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

[0002] As display panels continue to get larger, there is a growing demand for video services with higher image quality. The biggest problem with high-definition video services is the large increase in data volume, and in order to solve this problem, active research is being conducted to improve video compression rates. As a representative example, in 2009, MPEG (Motion Picture Experts Group) and VCEG (Video Coding Experts Group) under ITU-T (International Telecommunication Union-Telecommunication) formed JCT-VC (Joint Collaborative Team on Video Coding). JCT-VC proposed HEVC (High Efficiency Video Coding), a video compression standard with approximately twice the compression performance of H.264 / AVC, and it was approved as a standard on January 25, 2013. With the rapid development of high-definition video services, HEVC's performance is gradually showing its limits. Summary of the Invention [Problem to be solved by the invention]

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

[0004] SUMMARY OF THE PRESENT EMBODIMENT An object of the present invention is to provide a method for partitioning slices based on tile indexes when dividing a picture into a number of tiles, and an apparatus for performing the method.

[0005] An object of the present invention is to provide a method for dividing a picture into a plurality of slices based on difference information from the previous slice, and an apparatus for carrying out the method.

[0006] The technical problems that the present invention aims to solve are not limited to the technical problems mentioned above, and other technical problems not mentioned can be clearly understood by a person having ordinary skill in the technical field to which the present invention belongs from the following description. [Means for solving the problem]

[0007] A video signal decoding method according to the present invention includes: dividing a current picture into a plurality of tiles; decoding partition information indicating a slice type, the partition information indicating whether a rectangular slice is applied; and decoding first width information and first height information of the slice when the partition information indicates that a rectangular slice is applied. Here, when the first width information indicates one tile column and the first height information indicates one tile row, it may be determined whether or not the number information is parsed based on the height of the tile including the slice.

[0008] The video signal encoding method according to the present invention may include dividing a current picture into a plurality of tiles, determining whether or not to apply a rectangular slice, and encoding first width information and first height information of the slice if the rectangular slice is applied. Here, if the first width information indicates one tile column and the first height information indicates one tile row, it may be determined whether or not to encode the number information based on the height of the tile including the slice.

[0009] In the video signal decoding method according to the present invention, when a tile is configured in one coding tree unit row, parsing of the number information may be omitted.

[0010] In the video signal decoding method according to the present invention, when a tile is composed of multiple coding tree unit rows, number information is parsed, and the number information can indicate the number of slices for which slice height information needs to be explicitly signaled.

[0011] In the video signal decoding method according to the present invention, the second height information may be parsed for a first slice having an index smaller than the number indicated by the number information among at least one slice included in a tile.

[0012] In the video signal decoding method according to the present invention, the second height information may not be parsed for a second slice in which the number indicated by the number information is equal to or greater than the index.

[0013] In the video signal decoding method according to the present invention, the height of the second slice may be set to the smaller of the height of the third slice from which the second height information was last parsed or the remaining height in the tile.

[0014] The above briefly summarized features of the present invention are illustrative aspects of the detailed description of the invention that follows and are not intended to limit the scope of the present invention. Effect of the Invention

[0015] According to the present invention, the coding / decoding efficiency can be improved by dividing a picture into multiple tiles or slices.

[0016] According to the present invention, the encoding / decoding efficiency can be improved by dividing slices based on tile indexes.

[0017] According to the present invention, the efficiency of encoding / decoding can be improved by dividing a slice based on difference information from the previous slice.

[0018] The effects obtained by the present invention are not limited to those mentioned above, and other effects not mentioned can be clearly understood by a person having ordinary skill in the art to which the present invention pertains from the following description. [Brief description of the drawings]

[0019] [Figure 1] 1 is a block diagram of a video encoder according to an embodiment of the present invention;

[0020] [Diagram 2] FIG. 2 is a block diagram of a video decoder (decoder) according to one embodiment of the present invention;

[0021] [Diagram 3] FIG. 2 illustrates a basic coding tree unit according to an embodiment of the present invention.

[0022] [Figure 4] 1A to 1C are diagrams illustrating various partition shapes of coding blocks.

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

[0024] [Figure 6] 2 is a flowchart of an inter-prediction method according to an embodiment of the present invention.

[0025] [Figure 7] FIG. 2 is a diagram illustrating non-linear movement of an object.

[0026] [Figure 8] 3 is a flowchart of an affine motion based inter-prediction method according to an embodiment of the present invention.

[0027] [Figure 9] 11A and 11B are diagrams illustrating affine seed vectors for different affine motion models.

[0028] [Figure 10] FIG. 13 is a diagram illustrating affine vectors of sub-blocks under a four-parameter motion model.

[0029] [Figure 11] 13 is a flowchart of a process of deriving motion information of a current block under a merge mode.

[0030] [Figure 12] FIG. 1 illustrates example candidate blocks used to derive merge candidates.

[0031] [Figure 13] 11 is a diagram illustrating an update aspect of a motion information table. FIG.

[0032] [Figure 14] FIG. 13 is a diagram showing an update aspect of the motion information table.

[0033] [Figure 15] FIG. 13 is a diagram showing an example in which indices of pre-stored motion information candidates are updated.

[0034] [Figure 16] FIG. 13 illustrates an example in which overlap checking is performed on only a portion of merge candidates.

[0035] [Figure 17] FIG. 13 illustrates an example in which overlap checking with a particular merging candidate is omitted.

[0036] [Figure 18] FIG. 13 is a diagram showing an example in which a candidate block included in the same merge processing area as the current block is set as unavailable as a merge candidate;

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

[0038] [Figure 20] FIG. 13 is a diagram showing a temporary motion information table.

[0039] [Figure 21] 13 is a diagram showing an example of merging a motion information table and a temporary motion information table.

[0040] [Figure 22] 2 is a flowchart of an intra prediction method according to an embodiment of the present invention.

[0041] [Diagram 23] FIG. 13 is a diagram illustrating intra-prediction modes.

[0042] [Figure 24] FIG. 13 is a diagram showing an example of a one-dimensional array in which reference samples are arranged in a row. [Diagram 25] FIG. 13 is a diagram showing an example of a one-dimensional array in which reference samples are arranged in a row.

[0043] [Figure 26] 11 is a diagram illustrating angles that directional intra prediction modes form with a line parallel to the x-axis.

[0044] [Figure 27] FIG. 13 illustrates how predicted samples are obtained when the current block is non-square.

[0045] [Figure 28] FIG. 13 is a diagram illustrating a wide-angle intra prediction mode.

[0046] [Figure 29] FIG. 13 is a diagram illustrating an example in which whether or not transform skip is possible is determined for each sub-block.

[0047] [Diagram 30] FIG. 13 is a diagram showing an example in which sub-blocks use the same transform type.

[0048] [Diagram 31] 10 is a flowchart showing a process of determining a block strength.

[0049] [Diagram 32] 3 shows predefined filter candidates.

[0050] [Diagram 33] FIG. 2 illustrates a picture partitioning method according to an embodiment of the present invention.

[0051] [Diagram 34] 1 shows an example in which a picture is divided into multiple tiles.

[0052] [Diagram 35] FIG. 1 is a diagram for explaining the generation aspect of bricks.

[0053] [Diagram 36] FIG. 13 is a diagram showing an example in which slices are defined based on the raster order. [Figure 37] FIG. 13 is a diagram showing an example in which slices are defined based on the raster order.

[0054] [Figure 38] FIG. 13 shows an example in which only rectangular slices are allowed. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0055] Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.

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

[0057] Hereinafter, a block to be encoded / decoded is referred to as a “current block.” As an example, the current block may indicate a coding block, a transformation block, or a prediction block depending on a current encoding / decoding process step.

[0058] As used herein, the term "unit" may be understood to refer to a basic unit for performing a particular encoding / decoding process, and "block" may be understood to refer to a sample array of a given size. Unless otherwise specified, "block" and "unit" may be used with the same meaning. As an example, in the embodiments described below, a coding block and a coding unit may be understood to have the same meaning.

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

[0060] Referring to FIG. 1, the video encoding device 100 may include a picture division unit 110, prediction units 120, 125, a transformation unit 130, a quantization unit 135, a reordering 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.

[0061] 1 are illustrated independently to show different characteristic functions in the video encoding device, and do not mean that each component is composed of separate hardware or a single software unit. That is, each component is included side by side as a respective component for convenience of explanation, and at least two of each component may be combined into one component, or one component may be divided into multiple components to perform a function, and such integrated and separated embodiments of each component are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0062] In addition, some components may not be essential components that perform essential functions in the present invention, but may be optional components simply for improving performance. The present invention may be realized by including only components that are essential for realizing the essence of the present invention other than components used simply for improving performance, and a structure including only essential components other than optional components used simply for improving performance is also included in the scope of the present invention.

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

[0064] For example, one picture may be divided into a plurality of coding units. In order to divide the coding units in a picture, a recursive tree structure such as a quad tree structure may be used, and a coding unit that is divided into other coding units with one image or a largest coding unit as a root may be divided with child nodes equal to the number of divided coding units. A coding unit that is not further divided due to a certain restriction becomes a leaf node. That is, assuming that only square division is possible for one coding unit, one coding unit may be divided into a maximum of four different coding units.

[0065] Hereinafter, in the embodiments of the present invention, the coding unit can be used to mean a unit for performing coding, or a unit for performing decoding.

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

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

[0068] The prediction units 120 and 125 may include an inter prediction unit 120 for performing inter prediction and an intra prediction unit 125 for performing intra prediction. It may be determined whether to use inter prediction or intra prediction for a prediction unit, and specific information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. Here, a processing unit in which prediction is performed may be different from a processing unit in which a prediction method and specific contents are determined. For example, a prediction method and a prediction mode may be determined in a prediction unit, and prediction may be performed in a transform unit. A residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130. In addition, prediction mode information, motion vector information, etc. used for prediction may be coded by the entropy coding unit 165 together with the residual value and transmitted to the decoder. When a specific coding mode is used, it is also possible to code the original block as it is and transmit it to the decoder without generating a prediction block through the prediction units 120 and 125.

[0069] The inter prediction unit 120 may predict a prediction unit based on information of at least one of a picture before or after the current picture, and in some cases, may predict a prediction unit based on information of a part of an area in the current picture that has been completely coded. The inter prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0070] The reference picture interpolation unit receives reference picture information from the memory 155 and can generate pixel information of less than integer pixels in the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter having different filter coefficients may be used to generate pixel information of less than integer pixels in 1 / 4 pixel units. In the case of chrominance signals, a DCT-based 4-tap interpolation filter having different filter coefficients may be used to generate pixel information of less than integer pixels in 1 / 8 pixel units.

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

[0072] The intra prediction unit 125 may generate a prediction unit based on reference pixel information surrounding a current block, which is pixel information in a current picture. Since a surrounding block of the current prediction unit is an inter-predicted block, if the reference pixel is an inter-predicted pixel, the reference pixel included in the inter-predicted block may be used instead of reference pixel information of a surrounding intra-predicted block. In other words, if the reference pixel is unavailable, the unavailable reference pixel information may be used instead of at least one of the available reference pixels.

[0073] In the intra prediction, the prediction mode may include a directional prediction mode that uses reference pixel information according to the prediction direction, and a non-directional mode that does not use directional information when performing prediction. A mode for predicting luminance information and a mode for predicting chrominance information may be different, and intra prediction mode information used for predicting luminance information or predicted luminance signal information may be used to predict chrominance information.

[0074] When performing intra prediction, if the size of the prediction unit and the size of the transform unit are the same, intra prediction for the prediction unit can be performed based on the pixel on the left side, the pixel on the top left, and the pixel on the top end of the prediction unit. However, when performing intra prediction, if the size of the prediction unit and the size of the transform unit are different, intra prediction can be performed using reference pixels based on the transform unit. Also, intra prediction using N×N division can be used only for the minimum coding unit.

[0075] The intra prediction method may generate a prediction block after applying an AIS (Adaptive Intra Smoothing) filter to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels may be different. To perform the intra prediction method, the intra prediction mode of the current prediction unit may be predicted from the intra prediction mode of a prediction unit existing around the current prediction unit. When predicting the prediction mode of the current prediction unit using mode information predicted from the surrounding prediction units, if the intra prediction modes of the current prediction unit and the surrounding prediction units are the same, information that the prediction modes of the current prediction unit and the surrounding prediction units are the same may be transmitted using predetermined flag information, and if the prediction modes of the current prediction unit and the surrounding prediction units are different, entropy coding may be performed to encode prediction mode information of the current block.

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

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

[0078] The quantization unit 135 may quantize the values ​​transformed into the frequency domain by the transformation unit 130. The quantization coefficient may vary depending on the block or the importance of the image. The values ​​calculated by the quantization unit 135 may be provided to the inverse quantization unit 140 and the reordering unit 160.

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

[0080] The reordering unit 160 may change the two-dimensional block shape coefficients into one-dimensional vector shapes by a coefficient scanning method. For example, the reordering unit 160 may use a zig-zag scan method to scan from DC coefficients to coefficients in a high frequency region and change the shape into one-dimensional vector shapes. Depending on the size of the transform unit and the intra prediction mode, instead of the zig-zag scan, a vertical scan that scans the two-dimensional block shape coefficients in the column direction and a horizontal scan that scans the two-dimensional block shape coefficients in the row direction may be used. That is, depending on the size of the transform unit and the intra prediction mode, it may be determined which of the zig-zag scan, vertical scan, and horizontal scan methods is used.

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

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

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

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

[0085] The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an ALF (Adaptive Loop Filter).

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

[0087] The offset correction unit may correct the offset between the deblocked image and the original image on a pixel-by-pixel basis. In order to perform offset correction for a specific picture, the offset correction unit may use a method of dividing pixels included in the image into a predetermined number of regions, determining a region to be offset, and applying an offset to the determined region, or a method of applying an offset by considering edge information of each pixel.

[0088] ALF (Adaptive Loop Filtering) may be performed based on a value obtained by comparing the filtered restored image with the original image. After dividing the pixels in the image into predetermined groups, a filter to be applied to each group is determined, and filtering can be performed differentially for each group. Information regarding whether to apply ALF may be transmitted for each coding unit (CU) of the luminance signal, and the shape and filter coefficient of the ALF filter applied to each block may differ. In addition, an ALF filter of the same shape (fixed shape) may be applied regardless of the characteristics of the block to which it is applied.

[0089] The memory 155 may store the reconstructed block or picture calculated via the filter unit 150, and the stored reconstructed block or picture may be provided to the prediction units 120 and 125 when performing inter-prediction.

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

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

[0092] When a video bitstream is input from a video encoder, the input bitstream may be decoded in a reverse procedure to that of the video encoder.

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

[0094] The entropy decoding unit 210 can decode information related to the intra prediction and inter prediction performed in the encoder.

[0095] The reordering unit 215 may reorder the bitstream entropy decoded by the entropy decoding unit 210 based on the method used by the encoding unit to reorder the bitstream. The reordering unit 215 may restore coefficients expressed in a one-dimensional vector shape to two-dimensional block-shaped coefficients and reorder the coefficients. The reordering unit 215 may receive information on coefficient scanning performed in the encoding unit and perform reordering by a method of scanning in reverse based on the scanning order performed in the encoding unit.

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

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

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

[0099] As described above, when performing intra prediction, similar to the operation of a video encoder, if the size of the prediction unit and the size of the transform unit are the same, intra prediction for the prediction unit is performed based on the pixel on the left side, the pixel on the top left corner, and the pixel on the top corner, but if the size of the prediction unit and the size of the transform unit are different, intra prediction can be performed using reference pixels based on the transform unit. Also, intra prediction using N×N division can be used only for the minimum coding unit.

[0100] The prediction unit 230, 235 may include a prediction unit discrimination unit, an inter prediction unit, and an intra prediction unit. The prediction unit discrimination unit may receive various information such as prediction unit information input from the entropy decoding unit 210, prediction mode information of the intra prediction method, and motion prediction related information of the inter prediction method, classify a prediction unit from a current coding unit, and determine whether the prediction unit performs inter prediction or intra prediction. The inter prediction unit 230 may perform inter prediction on the current prediction unit based on information included in at least one of a picture before or after the current picture including the current prediction unit, using information required for inter prediction of the current prediction unit provided from the video encoder. Alternatively, the inter prediction may be performed based on information of a part of a region previously restored in the current picture including the current prediction unit.

[0101] To perform inter prediction, it is possible to determine, based on a coding unit, whether the motion prediction method of the prediction unit included in the coding unit is one of skip mode, merge mode, motion vector prediction mode (AMVP mode), and intra block copy mode.

[0102] The intra prediction unit 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit in which intra prediction has been performed, intra prediction can be performed based on intra prediction mode information of the prediction unit provided from the video encoder. The intra prediction unit 235 may include an AIS (Adaptive Intra Smoothing) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter, as a part that performs filtering on the reference pixels of the current block, can determine whether or not to apply a filter according to the prediction mode of the current prediction unit and apply the filter. AIS filtering can be performed on the reference pixels of the current block using the prediction mode and AIS filter information of the prediction unit provided from the video encoder. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.

[0103] The reference pixel interpolation unit may generate reference pixels in pixel units of integer values ​​or less by interpolating the reference pixels when the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on pixel values ​​obtained by interpolating the reference pixels. When the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.

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

[0105] The video encoder may provide information on whether a deblocking filter is applied to the block or picture, and information on whether a strong or weak filter is applied if a deblocking filter is applied. The deblocking filter of the video decoder may receive deblocking filter-related information provided by the video encoder and perform deblocking filtering on the block or picture.

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

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

[0108] The memory 245 can store the reconstructed pictures or blocks to make them available as reference pictures or blocks, and can provide the reconstructed pictures to an output.

[0109]

[0110] FIG. 3 illustrates a basic coding tree unit according to an embodiment of the present invention.

[0111] A coding block of a maximum size can be defined as a coding tree block. One picture is divided into a plurality of coding tree units (CTUs). A coding tree unit is a coding unit of a maximum size and can also be called an LCU (Largest Coding Unit). Figure 3 is a diagram showing an example in which one picture is divided into a plurality of coding tree units.

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

[0113] As an example, the coding tree unit size for all pictures in a sequence may be set to 128×128. Or, at the picture level, the coding tree unit size may be determined to be either 128×128 or 256×256. As an example, the coding tree unit size for a first picture may be set to 128×128, and the coding tree unit size for a second picture may be set to 256×256.

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

[0115] Information indicating the predictive coding mode of the current block may be signaled via a bitstream. As an example, the information may be a one-bit flag indicating whether the predictive coding mode is intra mode or inter mode. Only if the predictive coding mode of the current block is determined to be inter mode, can current picture reference or hybrid prediction be used.

[0116] The current picture reference is for setting the current picture as a reference picture and obtaining a prediction block of the current block from an area in the current picture that has already been coded / decoded. Here, the current picture means a picture including the current block. Information indicating whether the current picture reference is applied to the current block may be signaled via a bitstream. As an example, the information may be a 1-bit flag. If the flag is true, the prediction coding mode of the current block may be determined as the current picture reference, and if the flag is false, the prediction mode of the current block may be determined as inter prediction.

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

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

[0119] FIG. 4 is a diagram showing various division shapes of a coding block.

[0120] A coding block may be partitioned into multiple coding blocks based on a quad tree partition, a binary tree partition, or a triple tree partition. The partitioned coding block may also be partitioned into multiple coding blocks based on a quad tree partition, a binary tree partition, or a triple tree partition.

[0121] Quadtree partitioning refers to a partitioning technique that divides a current block into four blocks. As a result of the quadtree partitioning, the current block may be divided into four square partitions (see “SPLIT_QT” in (a) of FIG. 4).

[0122] Binary tree splitting refers to a splitting technique for splitting a current block into two blocks. Splitting the current block into two blocks along the vertical direction (i.e., using a vertical line crossing the current block) can be referred to as vertical binary tree splitting, and splitting the current block into two blocks along the horizontal direction (i.e., using a horizontal line crossing the current block) can be referred to as horizontal binary tree splitting. As a result of the binary tree splitting, the current block may be split into two non-square partitions. (b) "SPLIT_BT_VER" in FIG. 4 shows the result of a vertical binary tree split, and (c) "SPLIT_BT_HOR" in FIG. 4 shows the result of a horizontal binary tree split.

[0123] Triple tree partitioning refers to a partitioning technique for partitioning the current block into three blocks. Partitioning the current block into three blocks along the vertical direction (i.e., using two vertical lines crossing the current block) can be referred to as vertical triple tree partitioning, and partitioning the current block into three blocks along the horizontal direction (i.e., using two horizontal lines crossing the current block) can be referred to as horizontal triple tree partitioning. As a result of triple tree partitioning, the current block may be partitioned into three non-square partitions. Here, the width / height of the partition located in the center of the current block may be twice as large as the width / height of the other partitions. (d) "SPLIT_TT_VER" in FIG. 4 illustrates the result of vertical triple tree partitioning, and (e) "SPLIT_TT_HOR" in FIG. 4 illustrates the result of horizontal triple tree partitioning.

[0124] The number of times a coding tree unit is divided may be defined as a partitioning depth. The maximum partitioning depth of a coding tree unit may be determined at a sequence or picture level. Thus, the maximum partitioning depth of a coding tree unit may differ for each sequence or picture.

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

[0126] The encoder may signal information indicating at least one of the partition shape and partition depth of the current block via a bitstream, and the decoder may determine the partition shape and partition depth of the coding tree unit based on information parsed from the bitstream.

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

[0128] Partitioning a coding block using partitioning techniques such as quad tree partitioning, binary tree partitioning, and / or triple tree partitioning may be referred to as multi-tree partitioning.

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

[0130] Conversely, with respect to a coding block with a partition depth of k+1, a coding block with a partition depth of k may be referred to as a superior coding block.

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

[0132] To determine the partition shape of the coding block, information indicating whether the coding block is partitioned may be signaled via the bitstream. The information is a 1-bit flag "split_cu_flag", and the flag being true indicates that the coding block is partitioned by the merge tree partitioning technique.

[0133] If split_cu_flag is true, information indicating whether the coding block is quadtree split or not may be signaled via the bitstream. The information is a 1-bit flag split_qt_flag, and if the flag is true, the coding block may be split into four blocks.

[0134] 5, a coding tree unit is partitioned into quad trees to generate four coding blocks having a partition depth of 1. Also, quad tree partitioning is applied to the first and fourth coding blocks among the four coding blocks generated as a result of the quad tree partitioning. As a result, four coding blocks having a partition depth of 2 may be generated.

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

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

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

[0138]

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

[0140] Meanwhile, if an object that existed in the previous picture moves to another position in the current picture, the current block can be effectively predicted using the motion of the object. For example, if the moving direction and size of the object can be known by comparing the previous picture with the current picture, a predicted block (or predicted image) of the current block can be generated taking into account the motion information of the object. Hereinafter, the predicted block generated using the motion information can be referred to as a motion predicted block.

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

[0142] As described above, using motion information to generate a predictive block may be referred to as motion compensated prediction. In most inter predictions, a predictive block may be generated based on motion compensated prediction.

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

[0144] FIG. 6 is a flowchart of an inter-prediction method according to an embodiment of the present invention.

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

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

[0147] The inter-prediction method using affine motion information will now be described in detail.

[0148] FIG. 7 is a diagram illustrating the non-linear movement of an object.

[0149] The movement of an object in an image may be non-linear. For example, as shown in FIG. 7, non-linear movement of an object may occur, such as camera zoom-in, zoom-out, rotation, or affine transformation. When non-linear movement of an object occurs, the translational motion vector cannot effectively express the movement of the object. Therefore, in a portion where non-linear movement of an object occurs, affine motion instead of translational motion may be used to improve coding efficiency.

[0150] FIG. 8 is a flowchart of an affine motion based inter-prediction method according to an embodiment of the present invention.

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

[0152] When an inter-prediction technique based on affine motion is applied to a current block, an affine motion model of the current block can be determined (S801). The affine motion model may be determined to be at least one of a six-parameter affine motion model or a four-parameter affine motion model. The six-parameter affine motion model represents affine motion using six parameters, and the four-parameter affine motion model represents affine motion using four parameters.

[0153] Equation 1 expresses affine motion using six parameters. Affine motion indicates translational movement relative to a given region as determined by an affine seed vector.

[0154]

number

[0155] When affine motion is expressed using six parameters, complex motion can be expressed, but the number of bits required to encode each parameter increases, which may reduce encoding efficiency. Therefore, affine motion can also be expressed using four parameters. Equation 2 expresses affine motion using four parameters.

[0156]

number

[0157] Information for determining an affine motion model of a current block may be coded and signaled via a bitstream. As an example, the information may be a 1-bit flag "affine_type_flag". A value of 0 of the flag may indicate that a 4-parameter affine motion model is applied, and a value of 1 of the flag may indicate that a 6-parameter affine motion model is applied. The flag may be coded on a slice, tile or block (e.g., coding block or coding tree unit) basis. If the flag is signaled at the slice level, the affine motion model determined at the slice level may be applied to all of the blocks belonging to the slice.

[0158] Alternatively, the affine motion model of the current block may be determined based on the affine inter prediction mode of the current block. For example, when the affine merge mode is applied, the affine motion model of the current block may be determined to be a four-parameter motion model. On the other hand, when the affine motion vector prediction mode is applied, information for determining the affine motion model of the current block may be encoded and signaled via a bitstream. For example, when the affine motion vector prediction mode is applied to the current block, the affine motion model of the current block may be determined based on a 1-bit flag "affine_type_flag".

[0159] Next, an affine seed vector for the current block can be derived (S802). If a four-parameter affine motion model is selected, motion vectors at two control points of the current block can be derived. On the other hand, if a six-parameter affine motion model is selected, motion vectors at three control points of the current block can be derived. The motion vectors at the control points can be referred to as affine seed vectors. The control points can include at least one of the top left corner, the top right corner, or the bottom left corner of the current block.

[0160] FIG. 9 is a diagram illustrating affine seed vectors for different affine motion models.

[0161] In the four-parameter affine motion model, affine seed vectors for two of the top left corner, the top right corner, or the bottom left corner can be derived. As an example, as shown in FIG. 9(a), when the four-parameter affine motion model is selected, an affine vector can be derived using an affine seed vector sv0 for the top left corner (e.g., top left sample (x1, y1)) of the current block and an affine seed vector sv1 for the top right corner (e.g., top right sample (x1, y1)) of the current block. It is also possible to use an affine seed vector for the bottom left corner instead of the affine seed vector for the top left corner, or to use an affine seed vector for the bottom left corner instead of the affine seed vector for the top right corner.

[0162] In the six-parameter affine motion model, affine seed vectors for the top left corner, the top right corner, and the bottom left corner can be derived. As an example, as shown in FIG. 9B, when the six-parameter affine motion model is selected, affine vectors can be derived using an affine seed vector sv0 for the top left corner of the current block (e.g., top left sample (x1, y1)), an affine seed vector sv1 for the top right corner of the current block (e.g., top left sample (x1, y1)), and an affine seed vector sv2 for the top left corner of the current block (e.g., top left sample (x2, y2)).

[0163] In the embodiment described later, under the four-parameter affine motion model, the affine seed vectors of the top-left control point and the top-right control point are referred to as the first affine seed vector and the second affine seed vector, respectively. In the embodiment described later using the first affine seed vector and the second affine seed vector, the affine seed vector of the bottom-left control point (third affine seed vector) or the affine seed vector of the bottom-right control point (fourth affine seed vector) can be used instead of at least one of the first affine seed vector and the second affine seed vector.

[0164] Moreover, under the six-parameter affine motion model, the affine seed vectors of the top-left control point, the top-right control point, and the bottom-left control point are referred to as the first affine seed vector, the second affine seed vector, and the third affine seed vector, respectively. In an embodiment using the first affine seed vector, the second affine seed vector, and the third affine seed vector described below, the affine seed vector of the bottom-right control point (fourth affine seed vector) can be used instead of at least one of the first affine seed vector, the second affine seed vector, and the third affine seed vector.

[0165] An affine vector can be derived for each sub-block using the affine seed vector (S803). Here, the affine vector indicates a translational motion vector derived based on the affine seed vector. The affine vector of a sub-block can be called an affine sub-block motion vector or a sub-block motion vector.

[0166] FIG. 10 is a diagram illustrating affine vectors of sub-blocks under a four-parameter motion model.

[0167] 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. As an example, Equation 3 shows an example of deriving an affine sub-block motion vector.

[0168]

number

[0169] In Equation 3, (x, y) indicates the position of a sub-block. Here, the position of the sub-block indicates the position of a reference sample included in the sub-block. The reference sample may be a sample located at the upper left corner of the sub-block, or a sample whose x-axis or y-axis coordinate is at the center. (x0, y0) indicates the position of a first control point, and (sv0x, sv0y) indicates the first affine seed vector. Also, (x1, y1) indicates the position of a second control point, and (sv1x, sv1y) indicates the second affine seed vector.

[0170] If the first and second control points correspond to the top-left and top-right corners of the current block, respectively, x1-x0 may be set to a value equal to the width of the current block.

[0171] Next, a motion compensated prediction may be performed for each subblock using the affine vector for each subblock (S804). The motion compensated prediction may result in a prediction block for each subblock. The prediction block for the subblock may be set to the prediction block for the current block.

[0172] The affine seed vector of the current block may be derived based on the affine seed vector of a neighboring block adjacent to the current block. If the inter prediction mode of the current block is an affine merge mode, the affine seed vector of a merge candidate included in the merge candidate list may be determined as the affine seed vector of the current block. In addition, if the inter prediction mode of the current block is an affine merge mode, motion information including at least one of a reference picture index, a specific direction prediction flag, or a bidirectional weighting value of the current block may also be set similarly to the merge candidate.

[0173]

[0174] Next, the inter-prediction method using translational motion information will be described in detail.

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

[0176] FIG. 11 is a flowchart of a process of deriving motion information of a current block in a merge mode.

[0177] Merge candidates for a current block may be derived (S1101). The merging candidates for the current block may be derived from blocks that have been encoded / decoded using inter prediction prior to the current block.

[0178] FIG. 12 is a diagram illustrating candidate blocks used to derive merge candidates.

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

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

[0181] The non-neighboring reference sample indicates a sample having at least one of the x-axis distance or y-axis distance from a reference sample adjacent to the current block having a predefined value. As an example, at least one of a block including a reference sample having a predefined x-axis distance from the left reference sample, a block including a non-neighboring sample having a predefined y-axis distance from the top reference sample, or a block including a non-neighboring sample having predefined x-axis and y-axis distances from the top left reference sample may be used as a candidate block. The predefined value may be a natural number such as 4, 8, 12, or 16. Referring to the drawing, at least one of blocks with indexes 5 to 26 may be used as a candidate block.

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

[0183] The motion information of the merging candidate may be set similarly to the motion information of the candidate block. For example, at least one of a motion vector, a reference picture index, a prediction direction, or a bidirectional weighted index of the candidate block may be set as the motion information of the merging candidate.

[0184] A merge candidate list may be generated that includes the merge candidates (S1102).

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

[0186] When the merging candidate list includes multiple merging candidates, at least one of the multiple merging candidates can be selected (S1103). Specifically, information for identifying one of the multiple merging candidates may be signaled via the bitstream. As an example, information merge_idx indicating an index of one of the merging candidates included in the merging candidate list may be signaled via the bitstream.

[0187]

[0188] If the number of merge candidates included in the merge candidate list 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. Here, the threshold may be the maximum number of merge candidates that the merge candidate list may include, 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.

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

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

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

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

[0193] Alternatively, the maximum number of motion information candidates that the motion information table may include may be determined depending on the size of the picture, the size of the slice, or the size of the coding tree unit.

[0194] The motion information table may be initialized per picture, slice, tile, brick, coding tree unit, or coding tree unit line (row or column). As an example, when a slice is initialized, the motion information table is also initialized, and the motion information table may not include any motion information candidates.

[0195] Alternatively, information indicating whether to initialize the motion information table may be signaled via a bitstream. The information may be signaled at a slice, tile, brick, or block level. A pre-configured motion information table may be used until the information indicates to initialize the motion information table.

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

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

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

[0199] FIG. 13 is a diagram for explaining an update aspect of the motion information table.

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

[0201] If the motion information table is empty (S1303), motion information candidates derived based on the current block can be added to the motion information table (S1304).

[0202] If the motion information table already includes motion information candidates (S1303), a redundancy check may be performed on the motion information of the current block (or a motion information candidate induced based on the motion information) (S1305). The redundancy check is performed to determine whether the motion information of the motion information candidates pre-stored in the motion information table is the same as the motion information of the current block. The redundancy check may be performed on all motion information candidates pre-stored in the motion information table. Alternatively, the redundancy check may be performed on motion information candidates having an index greater than or equal to a threshold value among the motion information candidates pre-stored in the motion information table. Alternatively, the redundancy check may be performed on a predefined number of motion information candidates. As an example, two motion information candidates with small indexes or two motion information candidates with large indexes may be determined as targets for the redundancy check.

[0203] If the motion information candidate having the same motion information as the motion information of the current block is not included, the 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 the motion information (e.g., motion vectors and / or reference picture indexes, etc.) of the motion information candidates are the same.

[0204] Here, if the maximum number of motion information candidates are already stored in the motion information table (S1306), the oldest motion information candidate is deleted (S1307), and the motion information candidate derived based on the current block can be added to the motion information table (S1308). Here, the oldest motion information candidate can be the motion information candidate with the largest index or the motion information candidate with the smallest index.

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

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

[0207] FIG. 14 is a diagram showing an update aspect of the motion information table.

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

[0209] When adding the motion information candidate HmvpCand[n+1] derived from the current block to the motion information table HmvpCandList, the motion information candidate HmvpCand[0] with the smallest index among the pre-stored motion information candidates may be deleted, and the indexes of the remaining motion information candidates may be decremented 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 (n in the example shown in FIG. 14).

[0210] If the same motion information candidate as the motion information candidate induced based on the current block is pre-stored (S1305), the motion information candidate induced based on the current block may not be added to the motion information table (S1309).

[0211] Alternatively, the motion information candidate derived based on the current block may be added to the motion information table, and the previously stored motion information candidate that is the same as the motion information candidate may be removed, which has the same effect as updating the index of the previously stored motion information candidate.

[0212] FIG. 15 is a diagram showing an example in which the indices of pre-stored motion information candidates are updated.

[0213] When the index of a pre-stored motion information candidate identical to the motion information candidate mvCand derived based on the current block is hIdx, the pre-stored motion information candidate is deleted, and the index of a motion information candidate having an index greater than hIdx is decremented by 1. As an example, in the example shown in FIG 15, HmvpCand[2] identical to mvCand is deleted from the motion information table HvmpCandList, and the indexes from HmvpCand[3] to HmvpCand[n] are decremented by 1.

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

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

[0216] The motion information of a block included in a predetermined area may be set not to be added to the motion information table. As an example, a motion information candidate derived based on the motion information of a block included in the merge processing area may not be added to the motion information table. Since the encoding / decoding order is not defined for the block included in the merge processing area, it is inappropriate to use any one of the motion information when inter-predicting another block. Therefore, the motion information candidate derived based on the block included in the merge processing area may not be added to the motion information table.

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

[0218] It may also be determined whether or not to use the current block as a motion information candidate based on the inter prediction mode of the current block. For example, a block encoded / decoded based on an affine motion model may be set as unavailable as a motion information candidate. As a result, even if the current block is encoded / decoded by 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.

[0219] A motion information candidate may be set to include additional information other than motion information. For example, at least one of block size, shape, or block partition information may be further stored for the motion information candidate. When constructing a merge candidate list for a current block, only motion information candidates having size, shape, or partition information identical or similar to that of the current block may be used, or motion information candidates having size, shape, or partition information identical or similar to that of the current block may be added to the merge candidate list first.

[0220] If 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 addition process may be performed according to the order in which the motion information candidates are sorted in ascending or descending order. For example, the motion information candidate with the largest index may be added to the merge candidate list of the current block.

[0221] When adding a motion information candidate included in the motion information table to the merge candidate list, a check for overlap between the motion information candidate and a merge candidate previously stored in the merge candidate list may be performed. As a result of the overlap check, a motion information candidate having the same motion information as a previously stored merge candidate may not be added to the merge candidate list.

[0222] The duplication check may be performed only on some of the motion information candidates included in the motion information table. For example, the duplication check may be performed only on the motion information candidates whose indexes are greater than or equal to a threshold value or less than or equal to a threshold value. Alternatively, the duplication check may be performed only on the N motion information candidates whose indexes are the largest or the N motion information candidates whose indexes are the smallest.

[0223] Alternatively, the overlap check may be performed only on some of the merging candidates pre-stored in the merging candidate list. For example, the overlap check may be performed only on merging candidates whose index is greater than or equal to a threshold or less than a threshold, or on merging candidates derived from a block at a specific position. Here, the specific position may include at least one of a left neighboring block, an upper neighboring block, an upper right neighboring block, or a lower left neighboring block of the current block.

[0224] FIG. 16 illustrates an example in which overlap checking is performed on only a portion of the merge candidates.

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

[0226] Unlike the illustrated example, when adding a motion information candidate HmvpCand[j] to the merge candidate list, the motion information candidate can be checked for overlap with up to two merge candidates with the smallest indexes. For example, it can be checked whether mergeCandList[0] and mergeCandList[1] are the same as HmvpCand[j].

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

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

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

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

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

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

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

[0234] FIG. 17 is a diagram showing an example in which overlap checking with a specific merging candidate is omitted.

[0235] When adding a motion information candidate HmvpCand[i] with index i to the merge candidate list, a check is performed for overlap between the motion information candidate and merge candidates previously stored in the merge candidate list. If a merge candidate mergeCandList[j] identical to the motion information candidate HmvpCand[i] is found, the motion information candidate HmvpCand[i] is not added to the merge candidate list, and an overlap check can be performed between the motion information candidate HmvpCand[i-1] with index i-1 and the merge candidate. The check for overlap between the motion information candidate HmvpCand[i-1] and the merge candidate mergeCandList[j] can be omitted.

[0236] For example, in the example shown in Figure 17, HmvpCand[i] and mergeCandList[2] are determined to be the same. As a result, HmvpCand[i] is not added to the merge candidate list, and a duplication check may be performed on HmvpCand[i-1]. Here, the duplication check between HmvpCand[i-1] and mergeCandList[2] may be omitted.

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

[0238] The current block's merge candidate list may be populated with merge candidates in the following order:

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

[0240] The spatial merge candidate refers to a merge candidate derived from at least one of a neighboring block or a non-neighboring block, the temporal merge candidate refers to a merge candidate derived from a previous reference picture, and the affine motion information candidate refers to a motion information candidate derived from a block encoded / decoded with an affine motion model.

[0241]

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

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

[0244] The motion vector prediction candidate list for the current block may be constructed according to the following order:

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

[0246] The spatial motion vector prediction candidate refers to a motion vector prediction candidate derived from at least one of a neighboring block or a non-neighboring block, and the temporal motion vector prediction candidate refers to a motion vector prediction candidate derived from a previous reference picture. The affine motion information candidate refers to a motion information candidate derived from a block encoded / decoded with an affine motion model. The zero motion vector prediction candidate refers to a candidate whose motion vector value is 0.

[0247]

[0248] A merge processing area having a size larger than that of a coding block may be defined. The coding blocks included in the merge processing area may be processed in parallel, not sequentially encoded / decoded. Here, not sequentially encoded / decoded means that the encoding / decoding order is not defined. Thus, the encoding / decoding process of the blocks included in the merge processing area may be processed independently. Alternatively, the blocks included in the merge processing area may share merge candidates. Here, the merge candidates may be derived based on the merge processing area.

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

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

[0251] FIG. 18 is a diagram showing an example in which a candidate block included in the same merge processing area as the current block is set as unavailable as a merge candidate.

[0252] In the example shown on the left side of Fig. 18, when encoding / decoding CU5, a block including a reference sample adjacent to CU5 may be set as a candidate block. Here, candidate blocks X3 and X4 included in the same merge processing area as CU5 may be set as unavailable as merge candidates for CU5. On the other hand, candidate blocks X0, X1, and X2 not included in the same merge processing area as CU5 may be set as available as merge candidates.

[0253] In the example shown on the right side of Fig. 18, when encoding / decoding CU8, a block including a reference sample adjacent to CU8 may be set as a candidate block. Here, candidate blocks X6, X7, and X8 included in the same merge processing area as CU8 may be set as unavailable as merge candidates. On the other hand, candidate blocks X5 and X9 not included in the same merge area as CU8 may be set as available as merge candidates.

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

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

[0256] As shown in the example of FIG. 19(a), neighboring blocks adjacent to the current block may be set as candidate blocks for deriving merge candidates for the current block. Here, candidate blocks included in the same merge processing area as the current block may be set as unavailable as merge candidates. As an example, when deriving merge candidates for the coding block CU3, the top neighboring block y3 and the top right neighboring block y4 included in the same merge processing area as the coding block CU3 may be set as unavailable as merge candidates for the coding block CU3.

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

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

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

[0260] In summary, merging candidates for coding block CU3 included in the merging processing region may be derived by scanning the candidate blocks according to the following scan order:

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

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

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

[0264] The size of the merging region may be determined based on at least one of the following: information signaled via the bitstream, the picture resolution, the size of a slice, or the size of a tile.

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

[0266] However, when a motion information candidate derived from a block included in the merge processing area is added to the motion information table, the motion information candidate derived from the block may be used when encoding / decoding another block in the merge processing area that is actually slower than the block in encoding / decoding. That is, when encoding / decoding a block included in the merge processing area, although it is necessary to eliminate the dependency between blocks, motion prediction compensation may be performed using motion information of another block included in the merge processing area. To solve this problem, even if encoding / decoding of a block included in the merge processing area is completed, the motion information of the block that has been encoded / decoded may not be added to the motion information table.

[0267] Alternatively, the motion information table may be updated using only blocks at predefined positions within the merge processing area. The predefined positions may include at least one of a block located at the top left corner, a block located at the top right corner, a block located at the bottom left corner, a block located at the bottom right corner, a block located in the center, a block adjacent to the right boundary, or a block adjacent to the bottom boundary within the merge processing area. As an example, only the motion information of a block adjacent to the bottom right corner within the merge processing area may be updated to the motion information table, and the motion information of other blocks may not be updated to the motion information table.

[0268] Alternatively, after all blocks included in the merge processing area have been decoded, the motion information candidates derived from the blocks may be added to the motion information table. That is, the motion information table may not be updated while the blocks included in the merge processing area are being encoded / decoded.

[0269] For example, when motion compensation prediction is performed on a block included in the merge processing region, motion information candidates derived from the block may be added to the motion information table in a predefined order. Here, the predefined order may be determined according to a scan order of coding blocks in the merge processing region or a coding tree unit. The scan 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 blocks having the same motion information.

[0270] 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, or 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.

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

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

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

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

[0275] FIG. 20 is a diagram showing a temporary motion information table.

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

[0277] Alternatively, only motion information of some blocks included in the merge processing area may be added to the temporary motion information table. As an example, only blocks at predefined positions in 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 corner, a block located at the upper right corner, a block located at the lower left corner, a block located at the lower right corner, a block located in the center, a block adjacent to the right boundary, or a block adjacent to the bottom boundary in the merge processing area. As an example, only motion information of a block adjacent to the lower right corner in the merge processing area may be added to the temporary motion information table, and motion information of other blocks may not be added to the temporary motion information table.

[0278] The maximum number of temporary motion information candidates that the temporary motion information table may include may be set to be the same as the maximum number of motion information candidates that the motion information table may include, or may be determined according to the size of a coding tree unit or a merge processing area, or may be set to be smaller than the maximum number of motion information candidates that the motion information table may include.

[0279] A current block included in a coding tree unit or a merge processing area may be set not to use a temporary motion information table for the coding tree unit or the merge processing area. That is, when the number of merge candidates included in the merge candidate list of the current block is less than a threshold, a motion information candidate included in the motion information table may be added to the merge candidate list, and a temporary motion information candidate included in the temporary motion information table may not be added to the merge candidate list. As a result, motion information of another block included in the same coding tree unit or the same merge processing area as the current block may not be used for motion compensation prediction of the current block.

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

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

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

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

[0284] As another example, the temporary motion information candidates included in the temporary motion information table may be added to the motion information table according to a predefined order. Here, the predefined order may be determined according to a scan order of coding blocks in a merge processing region or a coding tree unit. The scan 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 blocks having the same motion information.

[0285] 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, or 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.

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

[0287] When adding a temporary motion information candidate included in the temporary motion information table to the motion information table, a duplication check may be performed on the temporary motion information candidate. For example, if a motion information candidate identical to 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. Here, the duplication check may be performed on some of the motion information candidates included in the motion information table. For example, the duplication check may be performed on motion information candidates having an index equal to or greater than a threshold value or equal to or less than a threshold value. For example, if the temporary motion information candidate is identical to a motion information candidate having an index equal to or greater than a predefined value, the temporary motion information candidate may not be added to the motion information table.

[0288] A motion information candidate derived from a block included in the same coding tree unit or the same merge processing area as the current block may be restricted from being used as a merge candidate for the current block. For this purpose, block address information may be further stored for the motion information candidate. The block address information may include at least one of a position of a block, an address of a block, an index of a block, a position of a merge processing area including a block, an address of a merge processing area including a block, an index of a merge processing area including a block, a position of a coding tree area including a block, an address of a coding tree area including a block, or an index of a coding tree area including a block.

[0289]

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

[0291] The intra prediction technique includes intra prediction based on a matrix and general intra prediction considering the direction with respect to the surrounding reconstruction samples. Information indicating the intra prediction technique of the current block may be signaled through a bitstream. The information may be a 1-bit flag. Alternatively, the intra prediction technique of the current block may be determined based on at least one of the position, size, shape, or intra prediction technique of a neighboring block of the current block. As an example, if the current block is located across a picture boundary, it may be set that the intra prediction based on a matrix is ​​not applied to the current block.

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

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

[0294] FIG. 22 is a flowchart of an intra prediction method according to one embodiment of the present invention.

[0295] A reference sample line of a current block may be determined (S2201). The reference sample line refers to a set of reference samples included in a line k-th away from the top and / or left side of the current block. The reference samples may be derived from reconstructed samples for which encoding / decoding around the current block has been completed.

[0296] Index information for identifying a reference sample line of a current block among a plurality of reference sample lines may be signaled through a bitstream. For example, index information intra_luma_ref_idx for identifying a reference sample line of a current block may be signaled through a bitstream. The index information may be signaled on a coding block basis.

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

[0298] Table 1 shows the indexes assigned to each candidate reference sample line.

[0299] [Table 1]

[0300] The reference sample line of the current block may be determined based on at least one of the position, size, shape, or predictive coding mode of the neighboring block of the current block. For example, if the current block borders a boundary of a picture, a tile, a slice, or a coding tree unit, the neighboring reference sample line may be determined as the reference sample line of the current block.

[0301] The reference sample line may include a top reference sample located at the top of the current block and a left reference sample located to the left of the current block. The top reference sample and the left reference sample may be derived from reconstructed samples around the current block. The reconstructed samples may be in a state before an in-loop filter is applied.

[0302] Next, an intra-prediction mode of the current block may be determined (S2202). At least one of a non-directional intra-prediction mode and a directional intra-prediction mode may be determined as the intra-prediction mode of 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 bottom left diagonal to the top right diagonal.

[0303] FIG. 23 is a diagram showing intra prediction modes.

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

[0305] A greater or lesser number of intra prediction modes than those illustrated in FIG. 23 may also be defined.

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

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

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

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

[0310] When deriving the intra prediction mode of the current block, the comparison of some of the MPMs with the remaining mode information may be omitted. As an example, an MPM that is a non-directional intra prediction mode among the MPMs may be excluded from the comparison. When the non-directional intra prediction mode is set to the MPM, it is clear that the remaining mode information indicates a directional intra prediction mode, so the intra prediction mode of the current block can be derived by comparing the remaining MPMs other than the non-directional intra prediction mode with the remaining mode information. Instead of excluding the non-directional intra prediction mode from the comparison, 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 MPM.

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

[0312] When the default mode flag is used, the intra prediction mode that is the same as the default mode may be set not to be set in the MPM. For example, when the default mode flag indicates whether the intra prediction mode of the current block is planner, the intra prediction mode of the current block may be induced using five MPMs other than the MPM corresponding to planner.

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

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

[0315] Once the intra-prediction mode of the current block has been determined, a prediction sample for the current block can be obtained based on the determined intra-prediction mode (S2203).

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

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

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

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

[0320] [Table 2]

[0321] Table 2 shows intra direction parameters for each intra prediction mode having an index of 2 to 34 when 35 intra prediction modes are defined. When more than 33 directional intra prediction modes are defined, Table 2 may be further subdivided to set intra direction parameters for each directional intra prediction mode.

[0322] After aligning the top reference sample and the left reference sample of the current block, a predicted sample can be obtained based on the value of the intra direction parameter, where, if the value of the intra direction parameter is a negative number, the left reference sample and the top reference sample can be aligned.

[0323] 24 and 25 are diagrams showing examples of a one-dimensional array in which reference samples are arranged in a row.

[0324] Fig. 24 shows an example of a vertical one-dimensional array in which reference samples are arranged in the vertical direction, and Fig. 25 shows an example of a horizontal one-dimensional array in which reference samples are arranged in the horizontal direction. The embodiments of Fig. 24 and Fig. 25 will be described assuming that 35 intra prediction modes are defined.

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

[0326] Based on the intra-direction parameters, reference sample decision parameters may be determined, which may include a reference sample index for identifying the reference sample and a weight parameter for determining a weight to be applied to the reference sample.

[0327] The reference sample index iIdx and the weight parameter ifact may be obtained by the following Equations 4 and 5, respectively.

[0328]

number

[0329]

number

[0330] In Equation 4 and Equation 5, Pang denotes an intra direction parameter. The reference sample identified by the reference sample index iIdx corresponds to an integer pel.

[0331] In order to derive a prediction sample, at least one reference sample may be identified. Specifically, the position of the reference sample used to derive the prediction sample may be identified by considering the gradient of the prediction mode. As an example, the reference sample used to derive the prediction sample may be identified using a reference sample index iIdx.

[0332] Here, when the gradient of the intra prediction mode is not expressed by one reference sample, a prediction sample can be generated by interpolating a plurality of reference samples. For example, when the gradient of the intra prediction mode is a value between the gradient between the prediction sample and a first reference sample and the gradient between the prediction sample and a second reference sample, the prediction sample can be obtained by interpolating the first and second reference samples. That is, when an angular line along the intra prediction angle does not pass through a reference sample located at an integer pel, the prediction sample can be obtained by interpolating reference samples located adjacent to the left and right or above and below the position where the angular line passes.

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

[0334]

number

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

[0336] When the gradient of the intra prediction mode can be expressed by one reference sample, the weight parameter ifact is set to 0. As a result, Equation 6 may be simplified as Equation 7 below.

[0337]

number

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

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

[0340] FIG. 26 is a diagram illustrating angles that directional intra prediction modes form with a line parallel to the x-axis.

[0341] As shown in the example of Fig. 26, the directional prediction modes may exist between the lower left diagonal direction and the upper right diagonal direction. In terms of the angle formed by the x-axis and the directional prediction modes, the directional prediction modes may exist between 45 degrees (lower left diagonal direction) and -135 degrees (upper right diagonal direction).

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

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

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

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

[0346] To solve the above problem, if the current block is non-square, the intra prediction mode of the current block may be replaced with a backward intra prediction mode. Thus, for non-square blocks, a directional prediction mode having an angle larger or smaller than the directional prediction mode illustrated in FIG. 23 may be used. Such a directional intra prediction mode may be defined as a wide-angle intra prediction mode. The wide-angle intra prediction mode refers to a directional intra prediction mode that does not fall within the range of 45 degrees to -135 degrees.

[0347] FIG. 28 is a diagram illustrating the wide-angle intra prediction mode.

[0348] In the example shown in FIG. 28, intra prediction modes with indices from −1 to −14 and intra prediction modes with indices between 67 and 80 indicate wide angle intra prediction modes.

[0349] FIG. 28 illustrates 14 wide angle intra prediction modes (-1 to -14) with angles greater than 45 degrees and 14 wide angle intra prediction modes (67 to 80) with angles less than -135 degrees, although a greater or lesser number of wide angle intra prediction modes may be defined.

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

[0351] When using a wide-angle intra-prediction mode, sample A shown in (a) of FIG. 28 may be predicted using reference sample T, and sample A shown in (b) of FIG. 28 may be predicted using reference sample L.

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

[0353] [Table 3]

[0354] If the current block is non-square and the intra prediction mode of the current block obtained in step S2502 belongs to a transformation range, the intra prediction mode of the current block may be transformed to a wide-angle intra prediction mode. The transformation range may be determined based on at least one of the size, shape, and ratio of the current block. Here, the ratio may indicate the ratio between the width and height of the current block.

[0355] If the current block is a non-square block with width greater than height, the transform range may be set from the upper right diagonal intra prediction mode index (e.g., 66) to (the upper right diagonal intra prediction mode index -N), where N may be determined based on the ratio of the current block. If the intra prediction mode of the current block belongs to the transform range, the intra prediction mode may be transformed to a wide-angle intra prediction mode. The transform may be a subtraction of a predefined value from the intra prediction mode, and the predefined value may be the total number of intra prediction modes other than the wide-angle intra prediction mode (e.g., 67).

[0356] In some embodiments, intra prediction modes between 66 and 53 may be converted to wide angle intra prediction modes between −1 and −14, respectively.

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

[0358] Depending on the embodiment, each of the intra prediction modes between number 2 and number 15 may be converted to a wide-angle intra prediction mode between number 67 and number 80.

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

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

[0361] [Table 4]

[0362] [Table 5]

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

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

[0365] [Table 6]

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

[0367] Alternatively, when the intra prediction mode of the current block is determined to be a wide angle intra prediction mode, the non-adjacent reference sample line may be set to be unavailable as a reference sample line of the current block, or a multi-line intra prediction coding method for selecting one of a plurality of reference sample lines may be set not to be used. When the multi-line intra prediction coding method is not used, an adjacent reference sample line may be determined to be a reference sample line of the current block.

[0368] When the wide-angle intra prediction mode is not used, refW and refH may be set to the sum of nTbW and nTbH. Thus, except for the top left reference sample, the non-adjacent reference sample having a distance i from the current block may include (nTbW+nTbH+offsetX[i]) top reference samples and (nTbW+nTbH+offsetY[i]) left reference samples. That is, the non-adjacent reference sample having a distance 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 may be set to be greater than the value of offsetY. As an example, the value of offsetX may be set to 1, and the value of offsetY may be set to 0. On the other hand, when the value of whRatio is less than 1, the value of offsetY may be set to be greater than the value of offsetX. As an example, the value of offsetX may be set to 0 and the value of offsetY may be set to 1.

[0369] When a wide-angle intra prediction mode is used in addition to an existing intra prediction mode, resources required for encoding the wide-angle intra prediction mode may increase, resulting in reduced encoding efficiency. Therefore, instead of encoding the wide-angle intra prediction mode as is, an alternative intra prediction mode for the wide-angle intra prediction mode may be encoded to improve encoding efficiency.

[0370] For example, if the current block is encoded using wide-angle intra prediction mode 67, then the intra prediction mode of the current block may be 2, which is a wide-angle alternative intra prediction mode of 67. Also, if the current block is encoded in wide-angle intra prediction mode −1, then the intra prediction mode of the current block may be 66, which is a wide-angle alternative intra prediction mode of −1.

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

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

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

[0374]

[0375] A residual image can be derived by subtracting a predicted image from an original image. Here, when the residual image is converted to the frequency domain, even if high frequency components among the frequency components are removed, the subjective image quality of the image does not deteriorate significantly. Therefore, by converting the value of the high frequency components to a smaller value or setting the value of the high frequency components to 0, visual distortion is not generated so much and compression efficiency can be increased. Reflecting the above characteristics, the current block can be transformed to decompose the residual image into two-dimensional frequency components. The transformation may be performed using a transformation technique such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform).

[0376] DCT is a method of decomposing (or transforming) a residual image into two-dimensional frequency components using a cosine transform, while DST is a method of decomposing (or transforming) a residual image into two-dimensional frequency components using a sine transform. As a result of transforming the residual image, the frequency components may be represented by basis images. As an example, when performing DCT transform on a block of size N×N, N2 basic pattern components may be obtained. The size of each basic pattern component included in the block of size N×N may be obtained by the transform. Depending on the transform technique used, the size of the basic pattern components may be referred to as DCT coefficients or DST coefficients.

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

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

[0379] Hereinafter, converting a residual image into two-dimensional frequency components is referred to as two-dimensional image conversion. The size of a basic pattern component obtained as a result of conversion is referred to as a transform coefficient. As an example, the transform coefficient may refer to a DCT coefficient or a DST coefficient. When both a first transform and a second transform described below are applied, the transform coefficient may refer to the size of a basic pattern component generated as a result of the second transform. In addition, a residual sample to which a transform skip is applied is also referred to as a transform coefficient.

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

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

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

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

[0384] FIG. 29 is a diagram showing an example in which whether or not transform skip is possible is determined for each sub-block.

[0385] The transform skip may be applied to only some of the sub-blocks. For example, as shown in FIG 29, the transform skip may be applied to the sub-blocks located at the top of the current block, and the transform skip may not be allowed for the sub-blocks located at the bottom.

[0386] The transform type of a sub-block for which transform skip is not allowed may be determined based on information signaled from a bitstream. As an example, the transform type may be determined based on tu_mts_idx, which will be described later.

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

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

[0389] The first transform may be performed using any one of a number of possible transform cores. As an example, the first transform may be performed using any one of DCT2, DCT8, or DST7.

[0390] Different transform cores can also be used for the horizontal and vertical directions. Information indicating the combination of horizontal and vertical transform cores can also be signaled via the bitstream.

[0391] The first transform and the second transform may be performed in different units. For 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 of 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 at the top left corner of the current block, a sub-block adjacent to the right side of the sub-block, and a sub-block adjacent to the bottom side of the sub-block. Alternatively, the second transform may be performed on an 8×8 block.

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

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

[0394] Information indicating whether or not to perform the second transform may be signaled via the bitstream. As an example, a flag indicating whether or not to perform the second transform, or index information specifying whether or not to perform the second transform and a transform kernel used for the second transform may be signaled. As an example, index information being 0 indicates that the second transform is not performed on the current block. On the other hand, if the index information is greater than 0, the transform kernel for performing the second transform may be determined by the index information.

[0395] Alternatively, whether to perform the second transform may be determined based on whether the horizontal transform core and the vertical transform core are the same. As an example, the second transform may be performed only if the horizontal transform core and the vertical transform core are the same. Alternatively, the second transform may be performed only if the horizontal transform core and the vertical transform core are different.

[0396] Alternatively, the second transform may be allowed only when the horizontal transform and the vertical transform use a predefined transform core. For example, the second transform may be allowed only when the DCT2 transform core is used for the horizontal transform and the vertical transform. Alternatively, when a sub-partition intra coding method is applied to the current block, the second transform may be allowed only when the DCT2 transform core is used for the horizontal transform and the vertical transform.

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

[0398] Alternatively, it may be determined whether to perform the second transform based on the position of the last non-zero transform coefficient of the current block. As an example, 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 sub-block to which the last non-zero transform coefficient of the current block belongs is greater than a threshold, the second transform may not be performed. Here, the threshold may be predefined in the encoder and the decoder. Alternatively, the threshold may be determined based on the size or shape of the current block.

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

[0400] Alternatively, when matrix-based intra prediction is applied to the current block, the second transformation may be set not to be performed.

[0401]

[0402] Information indicating the transform type of the current block may be signaled via a bitstream. The information may be index information tu_mts_idx indicating one of a combination of a transform type for the horizontal direction and a transform type for the vertical direction.

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

[0404] [Table 7]

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

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

[0407] When a sub-partition intra-coding method is applied, the transform cores of the sub-blocks may be determined independently. For example, information for identifying a transform type combination candidate for each sub-block may be coded and signaled. This allows the transform cores between the sub-blocks to be different.

[0408] Alternatively, the sub-blocks 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 sub-block. Alternatively, tu_mts_idx may be signaled at a coding block level, and the transform type of the sub-block may be determined by referring to tu_mts_idx signaled at the coding block level. Alternatively, the transform type may be determined based on at least one of the size, shape, or intra prediction mode of one of the sub-blocks, and the determined transform type may be set to be used for all the sub-blocks.

[0409] FIG. 30 is a diagram showing an example in which sub-blocks use the same transform type.

[0410] When a coding block is divided horizontally, the transform types of the sub-block (Sub-CU0) located at the top of the coding block and the sub-block (Sub-CU1) located at the bottom of the coding block can be set in the same way. As an example, as shown in (a) of Figure 30, when the horizontal type and vertical transform type are determined based on tu_mts_idx signaled for the top sub-block, the determined transform type can also be applied to the bottom sub-block.

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

[0412]

[0413] Whether or not to code index information may be determined based on at least one of the size, shape, and number of nonzero coefficients of the current block, whether or not to perform secondary transformation, and whether or not to apply a sub-partition intra-coding method. As an example, if a sub-partition intra-coding method is applied to the current block, or if the number of nonzero coefficients is equal to or smaller than a threshold, signaling of index information may be omitted. If signaling of index information is omitted, a default transformation type may be applied to the current block.

[0414] The default transform type may include at least one of DCT2 or DST7. When there are multiple default transform types, one of the multiple default transform types may be selected in consideration of at least one of the size, shape, intra prediction mode, whether or not a secondary transform is performed, or whether or not a sub-partition intra coding method is applied to the current block. As an example, one of the multiple transform types may be determined as a horizontal transform type based on whether or not the width of the current block belongs to a preset range, and one of the multiple transform types may be determined as a vertical transform type based on whether or not the height of the current block belongs to a preset range. Alternatively, the default mode may be determined to be different depending on the size, shape, intra prediction mode, or whether or not a secondary transform is performed on the current block.

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

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

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

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

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

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

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

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

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

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

[0425]

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

[0427] If explicit transform type determination is allowed, the transform type of the current block may be determined based on index information tu_mts_idx signaled from the bitstream. On the other hand, if explicit transform type determination is not allowed, the transform type may be determined based on at least one of the size and shape of the current block, whether subblock-based transform is allowed, the position of a subblock including a non-zero transform coefficient, whether a second transform is performed, or whether a subpartition intra-coding method is applied. As an example, the horizontal transform type of the current block may be determined based on the width of the current block, and the vertical transform type of the current block may be determined based on the height of the current block. For example, if the width of the current block is smaller than 4 or larger than 16, the horizontal transform type may be determined to be DCT2. Otherwise, the horizontal transform type may be determined to be DST7. If the height of the current block is smaller than 4 or larger than 16, the vertical transform type may be determined to be DCT2. Otherwise, the vertical transform type may be determined to be DST7. Here, the thresholds compared with the width and height to determine the horizontal transform type and the vertical transform type may be determined based on at least one of the size, shape, or intra prediction mode of the current block.

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

[0429] The number and / or type of the transformation type candidates or the number and / or type of the transformation type combination candidates may differ depending on whether explicit transformation type determination is allowed or not. As an example, if explicit transformation type determination is allowed, DCT2, DST7, and DCT8 may be used as transformation type candidates. Thus, the horizontal transformation type and the vertical transformation type may be set to DCT2, DST8, or DCT8, respectively. If explicit transformation type determination is not allowed, only DCT2 and DST7 may be used as transformation type candidates. Thus, the horizontal transformation type and the vertical transformation type may be determined to DCT2 or DST7, respectively.

[0430]

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

[0432] After the transform and quantization are performed at the encoder, the decoder can obtain the residual block by inverse quantization and inverse transform. At the decoder, the prediction block and the residual block can be added to obtain a reconstructed block for the current block.

[0433]

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

[0435] At least one of a deblocking filter, SAO, or ALF may be applied to the first reconstructed block to obtain a second reconstructed block, where SAO or ALF may be applied after the deblocking filter is applied.

[0436] The deblocking filter is used to reduce image quality degradation (blocking artifacts) at block boundaries that occur due to block-based quantization. To apply the deblocking filter, the blocking strength (BS) between the first restored block and neighboring restored blocks can be determined.

[0437] FIG. 31 is a flowchart showing the process of determining the block strength.

[0438] In the example shown in Figure 31, P denotes a first reconstruction block, and Q denotes a neighboring reconstruction block, where the neighboring reconstruction block may be adjacent to the left or top edge of the current block.

[0439] In the example shown in Figure 31, the block strength is determined taking into account the predictive coding modes of P and Q, whether or not they contain non-zero transform coefficients, whether or not they are inter-predicted using the same reference picture, and whether or not the difference value of the motion vector is greater than or equal to a threshold value.

[0440] Based on the block strength, it may be determined whether or not to apply a deblocking filter. For example, if the block strength is 0, no filtering may be performed.

[0441] SAO is intended to mitigate ringing artifacts that occur when quantization is performed in the frequency domain. SAO may be performed by adding or subtracting an offset that is determined in consideration of the pattern of the first restored image. Methods for determining the offset include edge offset (EO) and band offset. EO refers to a method of determining the offset of a current sample according to the pattern of surrounding pixels. BO refers to a method of applying a common offset to a set of pixels having similar brightness values ​​within a region. Specifically, the brightness of pixels may be divided into 32 equal intervals, and pixels having similar brightness values ​​may be set as one set. As an example, four adjacent bands out of the 32 bands may be set as one group, and the same offset value may be applied to samples belonging to the four bands.

[0442] The ALF is a method of generating a second restored image by applying a filter of a predefined size / shape to a first restored image or a restored image to which a deblocking filter has been applied. Equation 8 below shows an application example of the ALF.

[0443]

number

[0444] One of predefined filter candidates may be selected for each picture, coding tree unit, coding block, prediction block, or transform block, and each filter candidate may differ in either size or shape.

[0445] FIG. 32 shows predefined filter candidates.

[0446] As an example shown in FIG. 32, at least one of diamond shapes of 5×5, 7×7 or 9×9 size can be selected.

[0447] For the chroma components, only diamond shapes of size 5x5 may be used.

[0448]

[0449] 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) images, a method of dividing one picture into multiple regions and encoding / decoding the multiple regions in parallel can be considered. Specifically, a picture can be divided into tiles or slices (or tile groups) according to the processing purpose.

[0450] A tile represents the basic unit of parallel encoding / decoding. Each tile may be processed in parallel. The tiles may have a rectangular shape. Alternatively, non-rectangular tiles may be allowed.

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

[0452] When encoding / decoding a tile, data of other tiles may be set not to be used. It is possible to remove encoding / decoding dependencies between tiles and support parallel processing of tiles. Specifically, a probability table of a CABAC (Context adaptive Binary Arithmetic Coding) context may be initialized on a tile basis, and an in-loop filter may be set not to be applied at the boundary of the tile. In addition, data in other tiles may not be used as a candidate for motion vector induction. For example, data in other tiles may be set not to be used as a merge candidate, a motion vector prediction candidate (AMVP candidate), or a motion information candidate. In addition, it is possible to set data in other tiles not to be used for symbol context calculation.

[0453]

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

[0455] FIG. 33 is a diagram illustrating a picture division method according to one embodiment of the present invention.

[0456] First, it may be determined whether the current picture is to be divided into a plurality of processing units (S3310). Here, the processing unit may include at least one of a tile or a slice. As an example, a syntax element no_pic_partition_flag indicating whether the current picture is to be divided into a plurality of tiles or slices may be signaled via a bitstream. A value of 0 for the syntax element no_pic_partition_flag indicates that the current picture is to be divided into at least one tile or at least one slice. Meanwhile, a value of 1 for the syntax element no_pic_partition_flag indicates that the current picture is not to be divided into a plurality of tiles or slices.

[0457] If it is determined that the current picture is not to be divided into multiple processing units, the division process of the current picture may be terminated. In this case, the current picture may be considered to be composed of one tile and one slice (or tile group).

[0458] Alternatively, information indicating whether multiple tiles are present in a picture may be signaled via the bitstream, which may include at least one of a one-bit flag indicating whether multiple tiles are present in a picture or information specifying the number of tiles in the picture.

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

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

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

[0462] FIG. 34 shows an example in which a picture is divided into multiple tiles.

[0463] A tile may include at least one coding tree unit. The boundaries of the tile may be set to coincide with the boundaries of the coding tree unit. In other words, a partition shape in which one coding tree unit is partitioned into multiple pieces may not be allowed.

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

[0465] As an example, the heights of tiles belonging to the same tile row and / or the widths of tiles belonging to the same tile column may be set to be the same, as in the example shown in Figure 34. Tiles belonging to the same tile row may also be referred to as a horizontal tile set, and tiles belonging to the same tile column may also be referred to as a vertical tile set.

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

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

[0468] Information for determining the size of the tiles may be coded and signaled. As an example, a syntax element tile_width_minus1[i] indicating the width of the i-th tile column and a syntax element tile_height_minus1[i] indicating the height of the i-th tile row may be coded into the bitstream.

[0469] If consecutive tile columns have the same size, it is possible to signal width information for only one of the consecutive tile columns and omit encoding / decoding of width information for the remaining tile columns.

[0470] As an example, if the width of the i-th tile column to the last tile column in a picture is the same, the syntax tile_width_minus1[i] can be signaled only for the i-th tile column, and the remaining tile columns can be set to the same width as the i-th tile column.

[0471] Information indicating whether the widths of consecutive tile columns are the same may be coded and signaled. For example, syntax element rem_tile_col_equal_flag[i] indicates whether the widths of the tile column with index i to the tile column with index N-1 are the same. Here, N may indicate the number of tile columns. That is, the tile column with index N-1 may indicate the last tile column in the picture.

[0472] When the syntax rem_tile_col_equal_flag[i] is 1, the syntax tile_width_minus1[i] indicating the width is signaled for the tile column with index i, while the encoding / decoding of the syntax indicating the width of the tile column can be omitted for tile columns with index greater than i.

[0473] When the encoding / decoding of the syntax indicating the width of a tile column is omitted, the minimum value of the width of the i-th tile column and the width of the remaining area can be set as the width of the next tile column. As an example, if the width of the i-th tile column is set to the variable PrevTileColWidth and the width of the remaining area in the picture is set to the variable RemainingColWidth, the size of tile columns with indexes greater than i may be set to the smaller value of the variables PrevTileColWidth and RemainingColWidth.

[0474] As another example, the syntax rem_tile_col_equal_flag[i] can be set to indicate whether the widths from the tile column with index 0 to the tile column with index i are the same.

[0475] If consecutive tile rows have the same size, height information may be signaled for only one of the consecutive tile rows, and encoding / decoding of height information may be omitted for the remaining tile rows.

[0476] As an example, if the height from the i-th tile row to the last tile row in a picture is the same, the syntax tile_height_minus1[i] can be signaled only for the i-th tile row, and the remaining tile rows can be set to the same height as the i-th tile row.

[0477] Information indicating whether the heights of consecutive tile rows are the same may be coded and signaled. For example, syntax element rem_tile_row_equal_flag[i] indicates whether the heights of a tile row with index i to a tile row with index N-1 are the same. Here, N may indicate the number of tile rows. That is, the tile row with index N-1 may indicate the last tile row in the picture.

[0478] When the syntax rem_tile_row_equal_flag[i] is 1, for a tile row with index i, the syntax tile_height_minus1[i] indicating the height is signaled, while for tile rows with index greater than i, the encoding / decoding of the syntax indicating the height of the tile row can be omitted.

[0479] If the encoding / decoding of the syntax indicating the height of a tile row is omitted, the minimum value of the height of the i-th tile row and the height of the remaining area can be set as the height of the next tile row. As an example, if the height of the i-th tile row is set to the variable PrevTileRowHeight and the height of the remaining area in the picture is set to the variable RemainingRowHeight, the size of tile rows with an index greater than i may be set to the smaller value of the variables PrevTileRowHeight and RemainingRowHeight.

[0480] As another example, the syntax rem_tile_row_equal_flag[i] can be set to indicate whether the heights of the tile row with index 0 to the tile row with index i are the same.

[0481] Table 8 illustrates a syntax structure including the syntax element rem_tile_col_equal_flag[i] and the syntax element rem_tile_row_equal_flag[i].

[0482] [Table 8]

[0483] Information for specifying the number of tile columns in the current picture for which the width of the tile column is explicitly signaled may also be signaled via a bitstream. As an example, a syntax num_exp_tile_columns_minus1 for determining the number of tile columns for which the width of the tile column is signaled may be signaled via a bitstream. The syntax num_exp_tile_columns_minus1 may be a value obtained by subtracting 1 from the number of tile columns for which the width of the tile column is signaled.

[0484] The number of syntaxes for specifying the width of the tile columns determined based on the syntax num_exp_tile_columns_minus1 may be coded and signaled. As an example, the syntax tile_width_minus1[i] indicating the width of the i-th tile column may be signaled via a bitstream. The syntax tile_width_minus1[i] may be obtained by subtracting 1 from the number of coding tree unit columns included in the tile column.

[0485] If the tile column index i is smaller than the number of tile columns whose width is explicitly signaled, the width of the tile column may be determined based on the syntax tile_width_minus1[i] signaled via the bitstream.

[0486] On the other hand, if 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 tile column may be determined based on the syntax tile_width_minus1[l] signaled last. Here, l indicates the index of the tile column whose width was last signaled, and may be an integer smaller than j. As an example, if 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[l], the width of the tile column j may be set to the value obtained by adding 1 to the syntax tile_width_minus1[l]. On the other hand, if the value obtained by subtracting the width of the previous tile column from the width of the current picture is smaller than the value obtained by adding 1 to the syntax tile_width_minus1[l], the difference value obtained by subtracting the width of the previous tile column from the width of the current picture may be set to the width of the tile column j.

[0487] Table 9 shows the process for determining the width of a tile column.

[0488] [Table 9]

[0489] In Table 9, the variable PicWidthInCtbsY indicates the number of coding tree unit sequences included in the current picture. As an example, the variable PicWidthInCtbsY may be derived as shown in the following Equation 9.

[0490]

number

[0491] The variable remainingWidthInCtbsY indicates the difference between the variable PicWidthInCtbsY and the accumulated tile column width. As an example, for a tile column with index i, remainingWidthInCtbsY may be derived from PicWidthInCtbsY by subtracting the sum of the widths of tiles 0 through i-1.

[0492] As shown in the example in Table 9, the variable uniformTileColWidth may be derived by adding 1 to the width of the last explicitly signaled tile column, tile_column_width_minus1 [num_exp_tile_columns_minus1]. Here, if the variable remainingWidthInCtbY indicating the number of remaining coding tree unit columns in the current picture is equal to or greater than the variable uniformTileColWidth, the remaining area may be divided into the size of the variable uniformTileColWidth.

[0493] On the other hand, if the variable remainingWidthInCtbY indicating the number of remaining coding tree unit columns in the current picture is smaller than the variable uniformTileColWidth, the remaining area may be set as the last tile column as it is.

[0494] On the other hand, if the tile column index j is greater than or equal to the number of tile columns whose widths are explicitly signaled, then the width of that tile column may be set to the smaller of the variables uniformTileColWidth and remainingWidthInCtbY.

[0495] That is, the widths of the remaining tile columns other than the tile column whose width is explicitly signaled may have a value smaller than or equal to the width of the last tile column among the tile columns whose width is explicitly signaled.

[0496] Alternatively, information for specifying the number of tile rows for which the height of a tile row in a current picture is signaled may be signaled via a bitstream. As an example, a syntax num_exp_tile_rows_minus1 for determining the number of tile rows for which the height of a tile row is signaled may be signaled via a bitstream. The syntax num_exp_tile_rows_minus1 may be a value obtained by subtracting 1 from the number of tile rows for which the height of a tile row is signaled.

[0497] The number of syntaxes for specifying the height of the tile rows determined based on the syntax num_exp_tile_rows_minus1 may be coded and signaled. As an example, the syntax tile_height_minus1[i] indicating the height of the i-th tile row may be signaled via a bitstream. The syntax tile_height_minus1[i] may be obtained by subtracting 1 from the number of coding tree unit rows included in the tile row.

[0498] If the tile row index i is smaller than the number of tile rows whose height is explicitly signaled, the height of that tile row may be determined based on the syntax tile_height_minus1[i] signaled via the bitstream.

[0499] On the other hand, if the tile row index j is equal to or greater than the number of tile rows whose heights are explicitly signaled, the height of the tile row may be determined based on the last signaled syntax tile_height_minus1[l], where l indicates the index of the tile row whose height was last signaled and may be an integer less than j.

[0500] As an example, if 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[l], the height of tile row j may be set to the value obtained by adding 1 to the syntax tile_height_minus1[l]. On the other hand, if 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[l], the difference value 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.

[0501] Table 10 shows the process for determining the height of a row of tiles.

[0502] [Table 10]

[0503] In Table 10, the variable PicHeightInCtbsY indicates the number of coding tree unit rows included in the current picture. As an example, the variable PicWidthInCtbsY may be derived as shown in the following Equation 10.

[0504]

number

[0505] The variable remainingHeightInCtbsY indicates the variable PicHeightInCtbsY minus the accumulated tile row height. As an example, for a tile row with index i, remainingHeightInCtbsY may be derived from PicHeightInCtbsY minus the sum of the heights of tile rows 0 through i-1.

[0506] As shown in the example in Table 10, the variable uniformTileRowHeight may be derived by adding 1 to the height of the last explicitly signaled tile row, tile_row_height_minus1 [num_exp_tile_rows_minus1]. Here, if the variable remainingHeightInCtbY indicating the number of remaining coding tree unit rows in the current picture is equal to or greater than the variable uniformTileRowHeight, the remaining area may be divided into the size of the variable uniformTileRowHeight.

[0507] On the other hand, if the variable remainingHeightInCtbY indicating the number of remaining coding tree unit rows in the current picture is smaller than the variable uniformTileRowHeight, the remaining area may be set as the last tile row as it is.

[0508] On the other hand, if the tile row index j is greater than or equal to the number of tile rows whose heights are explicitly signaled, then the height of that tile row may be set to the smaller of the variables uniformTileRowHeight and remainingHeightInCtbY.

[0509] That is, the heights of the remaining tile rows other than the tile row whose height is explicitly signaled may be less than or equal to the width of the last tile row among the tile rows whose height is explicitly signaled.

[0510] Table 11 illustrates an example syntax table that includes syntax indicating the number of tile columns whose widths are explicitly signaled and syntax indicating the number of tile rows whose heights are explicitly signaled.

[0511] [Table 11]

[0512] Meanwhile, the syntax loop_filter_across_tiles_enabled_flag indicates whether or not it is permitted to apply an in-loop filter at a boundary of tiles in a picture that references a picture parameter set. Here, the in-loop filter may include at least one of a deblocking filter, an ALF, or an SAO. The flag loop_filter_across_tiles_enabled_flag having a value of 1 indicates that an in-loop filter across a boundary of tiles in a picture that references a picture parameter set is applicable. Meanwhile, the flag loop_filter_across_tiles_enabled_flag having a value of 0 indicates that it is not permitted to apply an in-loop filter at a boundary of tiles in a picture that references a picture parameter set.

[0513] The syntax loop_filter_across_slices_enabled_flag indicates whether or not it is permitted to apply an in-loop filter at a boundary of a slice in a picture that references a picture parameter set. Here, the in-loop filter may include at least one of a deblocking filter, an ALF, or an SAO. The flag loop_filter_across_slices_enabled_flag having a value of 1 indicates that an in-loop filter across a boundary of a slice in a picture that references a picture parameter set is applicable. On the other hand, the flag loop_filter_across_slices_enabled_flag having a value of 0 indicates that it is not permitted to apply an in-loop filter at a boundary of a slice in a picture that references a picture parameter set.

[0514]

[0515] Tiles can be split recursively, for example a single tile can be split into multiple tiles.

[0516] Each of the tiles generated by dividing a tile may be referred to as a subtile or a brick. The brick may be a unit of parallel processing. For example, the bricks may be encoded / decoded independently of each other. When encoding / decoding a block included in a brick, data of other blocks may be set not to be used. For example, samples included in other bricks may be set to be unavailable as reference samples for intra prediction. Alternatively, data in other bricks may be set not to be used as merge candidates, motion vector prediction candidates (AMVP candidates), or motion information candidates. Alternatively, data in other bricks may not be used for symbol context calculation.

[0517] FIG. 35 is a diagram for explaining the generation aspect of bricks.

[0518] Tiles can be split horizontally to generate bricks. For example, in the example shown in Figure 35, tiles belonging to the last column of tiles in the current picture are shown to be split into two bricks.

[0519] Assuming that raster scanning is applied to tiles, raster scanning may also be applied between bricks. For example, after all bricks included in a particular tile are scanned, the next tile may be scanned. That is, a brick may have the same status as a tile.

[0520] The boundaries of a brick may coincide with the boundaries of a coding tree unit, i.e., at least one coding tree unit row in a tile may be defined as a brick.

[0521] Tiles and bricks may be identified by a tile index. A tile index may be assigned to each tile and brick according to the raster scan order. If a tile is divided into multiple bricks, each of the multiple bricks may be assigned a tile index.

[0522] In the embodiments described below, the term "tile" may include not only tiles but also tiles generated by dividing tiles (i.e., subtiles or bricks).

[0523]

[0524] At least one tile may be defined as one processing unit. For example, a plurality of tiles may be defined as one slice. A slice may also be called a tile group.

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

[0526] Video encoding / decoding information may be signaled via a slice header, which may apply commonly to tiles and / or blocks that belong to the slice.

[0527] Information indicating a slice type may be signaled via a bitstream. The information indicates how a slice in a current picture is defined. As an example, a syntax rect_slice_flag indicating a slice type may be signaled via a bitstream.

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

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

[0530] The raster scan-based definition method is for identifying at least one tile according to a raster scan order, and then defining the identified at least one tile as a slice. In the raster scan-based definition method, one or more consecutive tiles may be defined as a slice. Here, the consecutive tiles may be determined according to the raster scan order. When the raster scan slice is applied, a non-rectangular slice may also be generated.

[0531] 36 and 37 are diagrams showing examples of slices defined based on the raster order.

[0532] As an example, in the example shown in FIG. 36, when the first slice slice0 includes three tiles, the first slice slice0 may be defined as including Tile0 to Tile2 according to the raster scan order. When the second slice slice1 includes six tiles, the second slice slice1 may be defined as including Tile3 to Tile8 according to the raster scan order. The last slice slice2 may include the remaining tiles Tile9 to Tile11 according to the raster scan order.

[0533] When slices are defined based on the raster scan order, information indicating the number of tiles each slice contains may be signaled, and for the last slice, the signaling of information indicating the number of tiles the slice contains may be omitted.

[0534] When a slice includes multiple tiles, the tiles may have different widths or heights. For example, the height of Tile3 included in the second slice slice1 is illustrated as being different from the remaining tiles.

[0535] The quadrilateral slice definition method is a division method that allows only rectangular slices. When the quadrilateral slice definition method is applied, tiles located at the four corners of a slice belong to the same row or the same column.

[0536] FIG. 38 shows an example in which only rectangular slices are permitted.

[0537] 38, the fourth slice, slice3, includes Tile5, Tile6, Tile9, and Tile10. When a slice includes multiple tiles, like the example shown, a rectangle with the upper left tile and lower right tile constituting the slice as its two vertices can be defined as one slice.

[0538] The boundaries of a slice may coincide with picture boundaries and / or tile boundaries. As an example, the left or top boundary of a slice may be set to a picture boundary, or the left or top boundary of a slice may be set to a tile boundary.

[0539] Alternatively, when a method for defining rectangular slices is applied, one tile can be divided into a plurality of rectangular slices.

[0540] When a rectangular slice definition method is applied (e.g., when rect_slice_flag is 1), information indicating whether or not a picture is composed of a single slice may be signaled. As an example, a syntax element one_slice_in_pic_flag indicating whether or not the number of slices in a picture is one may be signaled via a bitstream. When the flag one_slice_in_pic_flag is 1, it indicates that the picture is composed of one slice. On the other hand, when the flag one_slice_in_pic_flag is 0, it indicates that the picture is composed of at least two slices. When the value of the flag one_slice_in_pic_flag is 0, slice configuration information may be further signaled. As an example, Table 12 illustrates a syntax table including the syntax element one_slice_in_pic_flag.

[0541] [Table 12]

[0542] As illustrated, when one_slice_in_pic_flag is 1, coding of information about the configuration of a slice (for example, syntax top_left_brick_idx[i] indicating the index of a tile included in the slice and / or syntax bottom_right_brick_idx_delta[i] indicating the index difference between a tile included in the first slice and a tile included in the second slice) may be omitted. That is, one_slice_in_pic_flag may be used to determine whether information about the configuration of the slice is coded.

[0543] A picture may also indicate sub-pictures. A picture may be divided into at least one sub-picture. Sub-picture partition related information may be signaled at a sequence level. As an example, sub-picture partition related information signaled via a sequence parameter set may be commonly applied to all pictures that refer to the sequence parameter set.

[0544] The sub-picture division related information may include information indicating whether a picture is divided into multiple sub-pictures, information indicating the number of sub-pictures, information indicating the size of the sub-pictures, or information indicating whether the sub-pictures function as independent pictures.

[0545] For each subpicture, the syntax one_slice_in_pic_flag may be signaled to indicate whether or not it is composed of a single slice.

[0546] Alternatively, at the sequence or picture level, a syntax element one_slice_in_pic_flag may be signaled indicating whether each subpicture is composed of a single slice. As an example, the flag one_slice_in_pic_flag being 1 indicates that all subpictures in the current picture are composed of a single slice. In this case, the coding of slice configuration information may be omitted, and slices may be defined based on the division information of the subpictures.

[0547] On the other hand, the flag one_slice_in_pic_flag being 0 indicates that at least one subpicture in the current picture is composed of multiple slices. In this case, slice configuration information may be coded separately from the subpicture partition information.

[0548] When it is determined that a picture is composed of multiple slices, a syntax indicating the number of slices in the picture may be coded and signaled. As an example, a syntax num_slices_in_pic_minus2 indicating the number of slices in the picture may be signaled via a bitstream. The syntax num_slices_in_pic_minus2 may indicate a value obtained by subtracting 2 from the number of slices in the picture. This allows the decoder to determine the total number of slices by adding 2 to the value indicated by the syntax num_slices_in_pic_minus2.

[0549] Instead of the syntax num_slices_in_pic_minus2, it is also possible to code the syntax num_slices_in_pic_minus1, which indicates a value obtained by subtracting 1 from the number of slices in a picture.

[0550] When a rectangular slice definition method is applied, information for identifying tiles included in each slice may be signaled to determine tiles included in each slice. The information may be used to identify at least one of the first tile or the last tile of the slice. The order between tiles may be determined according to a predetermined scan order. As an example, in the case of a raster scan order, the first tile refers to a tile located at the top left corner of the slice, and the last tile refers to a tile located at the bottom right corner of the slice.

[0551] Information for identifying at least one of an index of a tile located at the top left corner of a slice or an index of a tile located at the bottom right corner of a slice may be signaled via a bitstream. As an example, at least one of syntax top_left_tile_idx for identifying an index of a tile located at the top left corner of a slice or syntax bottom_right_tile_idx for identifying an index of a tile located at the bottom right corner of a slice may be signaled via a bitstream. For the last slice, coding of at least one of syntax for identifying an index of a tile located at the top left corner of a slice or syntax for identifying an index of a tile located at the bottom right corner of a slice may be omitted. A remaining area other than an area occupied by a previous slice in a current picture may be set as the last slice.

[0552] As an example, in the example illustrated in FIG. 38, for slice0, slice1, and slice2, the index of the tile located at the upper left corner of each slice, top_left_tile_idx, and the index of the tile located at the lower right corner of each slice, bottom_right_tile_idx, may be signaled. On the other hand, for slice3, which is the last slice in the picture, the coding of top_left_tile_idx and bottom_right_tile_idx may be omitted. The index of the upper left tile of slice3, which is the last slice in the picture, may be set to the index of the tile located at the upper left corner in the remaining area other than slice0, slice1, and slice2 in the picture, and the index of the lower right tile of slice3 may be set to the index of the tile located at the lower right corner in the remaining area (or the tile located at the lower right corner of the picture).

[0553] Alternatively, differential information for identifying the index of a tile included in a slice may be coded and signaled. As an example, information indicating a differential value between an index of a tile located at the upper left end of a slice and an index of a tile located at the lower right end of the slice may be signaled via a bitstream. As an example, for the i-th slice, a syntax for identifying an index of a tile located at the upper left end of the slice and a syntax for indicating a difference between an index of a tile located at the upper left end of the slice and an index of a tile located at the lower right end of the slice may be signaled. The index of the lower right tile of the i-th slice may be derived by adding up top_left_tile_idx[i] and bottom_right_tile_idx_delta[i]. For the last slice, coding of at least one of the syntax indicating an index of a tile located at the upper left end of the slice or the syntax indicating a difference between an index of a tile located at the upper left end of the slice and an index of a tile located at the lower right end of the slice may be omitted. The remaining area other than the area occupied by the previous slice in the current picture may be set as the last slice.

[0554] Alternatively, at least one of horizontal tile index difference information or vertical tile index difference information may be coded and signaled. The horizontal tile index difference information may indicate a difference between an index of a first tile and an index of a rightmost tile included in the same tile row as the first tile. The vertical tile index difference information may indicate a difference between an index of a first tile and an index of a bottommost tile included in the same tile column as the first tile.

[0555] Depending on the position of the slice, the type of difference information to be coded may be determined. For example, for a slice adjacent to the right or bottom boundary of a picture, horizontal tile index difference information or vertical index difference information may be coded and signaled. By coding horizontal tile index difference information or vertical index difference information instead of information indicating the index difference between the top left tile and the top right tile, the amount of bits can be reduced.

[0556] Alternatively, when a picture is divided into at least one slice row, for a slice adjacent to the left boundary of the picture, information indicating an index difference between the top left tile and the bottom right tile may be encoded. Slices belonging to the same row may be set to have the same height.

[0557] It is also possible to code and signal difference information between the index of a tile included in the first slice and the index of a tile included in the second slice, where the first slice and the second slice are determined based on the scan order, and the tiles occupied by each slice may be different.

[0558] As an example, when the tiles constituting the first slice are different from the tiles constituting the second slice, the index of the second slice may be the index i of the first slice plus 1.

[0559] Alternatively, when a first tile is divided to include multiple slices, differential information between a first slice included in the first tile and a second slice including a second tile that is the next tile to the first tile in the scanning order or a second slice included in the second tile may be encoded. Here, differential information may be encoded only for the first slice or the last slice among the multiple slices included in the first tile.

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

[0561] Table 13 illustrates an example syntax table that includes differential information.

[0562] [Table 13]

[0563] As an example, syntax top_left_brick_idx_delta[i] indicating the index difference between the top left tile of the i-th slice and the top left tile of the previous slice (i.e., the i-1-th slice) may be signaled via the bitstream.

[0564] Based on the difference information, the position of the top left tile in the i-th slice may be determined. Specifically, the index of the top left tile of the i-th slice may be derived by summing the index of the top left tile of the i-1-th slice and the syntax top_left_brick_idx_delta[i]. Equation 11 shows an example of deriving the index of the top left tile of the i-th slice.

[0565]

number

[0566] In Expression 11, TopLeftBrickIdx[i-1] indicates the index of the top left tile of the i-1th slice.

[0567] For the first slice (i.e., the slice with index i=0), coding of the syntax top_left_brick_idx_delta[i] indicating differential information from the previous slice can 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 top-right tile of the slice can be coded and signaled.

[0568] Table 14 is an example showing a process for using difference information to identify the slice to which each tile belongs.

[0569] [Table 14]

[0570] NumBricksInSlice[i] indicates the number of tiles contained in slice i. TopLeftBrickIdx[i] indicates the index of the top left tile in slice i. botRightBkIdx indicates the index of the top right tile. BrickColBd[j] indicates the index of the tile column to which tile j belongs. BrickRowBd[j] indicates the index of the tile row to which tile j belongs. BricksToSliceMap[j]=i indicates that tile j is to be added to slice i.

[0571] Instead of the syntax top_left_brick_idx_delta[i], the syntax bottom_right_brick_idx_delta[i] indicating the index difference between the bottom right tile of the i-th slice and the bottom right tile of the previous slice (i.e., the i-1-th slice) may be signaled via the bitstream. In this case, the index of the bottom right tile of the i-th slice may be derived by adding the syntax bottom_right_brick_idx_delta[i] to the index of the bottom right tile of the previous slice.

[0572] The bottom_right_brick_idx_delta[0] for the first slice may be set equal to the index of the bottom-right tile of the first slice, i.e., the index of the bottom-right tile of the first slice may be set equal to the syntax bottom_right_brick_idx_delta[0].

[0573] Information indicating whether an index of a tile included in an i-th slice in a picture has a value greater than an index of a tile included in an i-1-th slice may be coded and signaled via a bitstream. As an example, syntax bottom_right_increasing_order_flag may be signaled via a bitstream. When the flag bottom_right_increasing_order_flag is 1, it indicates that an index of a tile included in an i-th slice in a picture always has a value greater than an index of a tile included in an i-1-th slice. On the other hand, when the flag bottom_right_increasing_order_flag is 0, it indicates that an index of a tile included in at least one slice in a picture may have a value less than an index of a tile included in a previous slice.

[0574] A slice may be defined using information specifying at least one of the index of the top-left tile in the slice and the width or height of the slice. As 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 via the bitstream.

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

[0576] The i-th slice may consist of a number of tile columns determined based on the syntax slice_width_in_tiles_minus1[i] and a number of tile rows determined based on the syntax slice_height_in_tiles_minus1[i], where the top left tile of the i-th tile column may have an index value determined based on top_left_brick_idx_delta[i].

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

[0578]

[0579] The index of the top-left tile of the first slice, TopLeftBrickIdx[0], may be set to 0. This causes the syntax top_left_brick_idx_delta[i] to have substantially the same value as the index of the top-left tile in the second slice (i.e., the slice with index i equal to 1). This allows the syntax top_left_brick_idx[i] to be signaled for the second slice instead of the syntax top_left_brick_idx_delta[i], where top_left_brick_idx[i] indicates the index of the top-left tile of the i-th slice.

[0580] As 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. That is, the index of the top left tile of the i+1-th slice may be derived by adding the index of the top left tile of the i-th slice and the syntax top_left_brick_idx_delta[i] signaled for the i-th slice. When the syntax top_left_brick_idx_delta[i] indicates difference information between the i-th slice and the i+1-th slice, coding of the syntax top_left_brick_idx_delta[i] may be omitted for the last slice.

[0581] Slices can also be determined using a syntax table such as Table 15 below.

[0582] [Table 15-1] [Table 15-2]

[0583] A flag rect_slice_flag indicating the slice type is coded, and if the flag rect_slice_flag is 1, a syntax element num_slices_in_pic_minus1 indicating the number of slices in a picture can be coded.

[0584] If it is determined that a picture includes multiple slices, the syntax slice_width_in_tiles_minus1[i] indicating the width of each slice and the syntax slice_height_in_tiles_minus1[i] indicating the height of each slice can be coded and signaled.

[0585] Also, a syntax tile_idx_delta[i] indicating a difference between an index of a tile included in the i-th slice and an index of a tile included in the i+1-th slice may be signaled. For the last tile, coding of the syntax tile_idx_delta[i] may be omitted.

[0586] It is also possible to code a syntax derived by subtracting an offset from the tile index difference between two slices. The offset may be a natural number such as 1 or 2. As an example, the syntax tile_idx_delta_minus1[i] may be signaled via a bitstream. The difference between the index of a tile included in the i-th slice and the index of a tile included in the i+1-th slice may be derived by adding 1 to the syntax tile_idx_delta_minus1[i].

[0587] The tile index difference information may be coded / decoded when the current picture includes multiple slices. That is, when the current picture is composed of a single slice, the signaling of the syntax tile_idx_delta[i] indicating the difference of the tile index may be omitted. For example, when a flag one_slice_in_pic_flag indicating whether the current picture is composed of a single slice is 1, the signaling of the syntax tile_idx_delta[i] may be omitted.

[0588] Alternatively, the encoder can determine whether or not the syntax tile_idx_delta[i] indicating the difference between tile indexes can be encoded, and can encode the flag tile_idx_delta_present_flag indicating whether or not the syntax tile_idx_delta[i] is encoded according to the determination. The value of the flag tile_idx_delta_present_flag being 0 indicates that the syntax tile_idx_delta[i] is not encoded / decoded. When the value of the flag tile_idx_delta_present_flag is 1, the syntax tile_idx_delta[i] may be encoded / decoded for at least one slice.

[0589] A tile can also be divided into multiple slices. For example, a tile can be divided horizontally to generate multiple slices.

[0590] If it is determined that the slice does not include multiple tiles, it may be determined whether to divide the tile into multiple slices. As an example, when the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] are both 0, it indicates that the slice is composed of only one tile or that one tile is divided into multiple slices.

[0591] If the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] are both 0, information indicating whether a tile is divided into multiple slices may be signaled.

[0592] As an example, a syntax element num_slices_in_tile_minus1[i] indicating the number of slices included in a tile may be signaled. The syntax element num_slices_in_tile_minus1[i] indicates a value obtained by subtracting 1 from the number of slices included in the i-th tile.

[0593] When a tile including an i-th slice is composed of multiple slices, a syntax indicating the height of each slice in the tile may be coded. As an example, a syntax slice_height_in_ctu_minus1[i][j] indicating the height of a j-th slice (i.e., an i+j-th slice) in a tile including an i-th slice may be signaled. The syntax slice_height_in_ctu_minus1[i][j] may indicate the number of coding tree unit rows included in the j-th slice in the tile including the i-th slice. Table 16 illustrates an example of a syntax structure including the syntax slice_height_in_ctu_minus1[i][j] indicating the height of a slice.

[0594] [Table 16-1] [Table 16-2]

[0595] Here, whether or not the syntax indicating the number of slices in the tile can be coded / decoded may be determined based on the height of the tile. As an example, when the tile including the i-th slice is configured with a single coding tree unit row, coding / decoding of the syntax num_slices_in_tile_minus1 indicating the number of slices in the tile may be omitted. When coding / decoding of the syntax num_slices_in_tile_minus1 is omitted, its value may be regarded as 0. That is, the i-th slice and the tile including the i-th slice may be set to have the same size and shape. In Table 16, the variable TileIdx[i] indicates the index of the tile including the i-th slice, and the variable NumTileColumn indicates the number of tile columns. TileIdx[i] / NumTileColumn returns the row including the tile including the i-th slice. The variable RowHeight[TileIdx[i] / NumTileColumn] indicates the height of the tile or tile row including the i-th slice.

[0596] Here, since tiles belonging to the same tile row have the same height, it can also be understood that whether or not to encode / decode the syntax indicating the number of slices in a tile is determined based on the height of the tile row.

[0597] It is possible to determine whether or not the syntax indicating the height of a slice can be coded / decoded based on the height of a tile or a tile row. As an example, when a tile including an i-th slice is configured with a single coding tree unit row, or when a tile including an i-th slice is configured with two coding tree unit rows, coding / decoding of the syntax slice_height_in_ctu_minus1[i][j] indicating the height of the slice can be omitted. The height of the syntax slice_height_in_ctu_minus1[i][j] may be adaptively determined according to the number of slices in the tile. As an example, when the number of slices in the tile is one, the height of the slice may be set to the same as the height of the tile. Alternatively, when the number of slices in the tile is two and the height of the tile is two, the height of each slice may be set to one. In Table 16, the variable TileIdx[i] indicates the index of the tile including the i-th slice, and the variable NumTileColumn indicates the number of tile columns. TileIdx[i] / NumTileColumn returns the row that contains the tile with the i-th slice. The variable RowHeight[TileIdx[i] / NumTileColumn] gives the height of the tile or tile row that contains the i-th slice.

[0598] Instead of the syntax num_slices_in_tile_minus1 indicating the number of slices described above, a syntax num_exp_slices_in_tile[i] indicating information indicating the number of slice heights that need to be explicitly signaled can also be coded. The syntax num_exp_slices_in_tile[i] may have a value equal to or smaller than the number of slices that the tile contains.

[0599] The syntax num_exp_slices_in_tile[i] being 0 indicates that the tile is not divided into multiple slices. The syntax num_exp_slices_in_tile[i] being greater than 0 indicates that the tile may be divided into multiple slices.

[0600] Information indicating the height of slices may be signaled in the number of syntax elements num_exp_slices_in_tile[i]. As an example, when the syntax element num_exp_slices_in_tile is greater than 1, the syntax element exp_slice_height_in_ctu_minus1[j] indicating the height of the j-th slice in the tile may be signaled.

[0601] As in the above embodiment, the possibility of encoding / decoding the number information exp_slice_height_in_ctu_minus1[j] may be determined based on the height of the tile or tile row. As an example, when the tile including the i-th slice is configured with a single coding tree unit row, the encoding / decoding of the syntax exp_slice_height_in_ctu_minus1[j] may be omitted. When the encoding / decoding of the syntax exp_slice_height_in_ctu_minus1[j] is omitted, the value may be regarded as 0.

[0602] If slice index j is smaller 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 via the bitstream, whereas if slice index k is equal to or larger 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], where l indicates the index of the slice whose height was last signaled and may be an integer smaller than k.

[0603] As an example, if 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[l], the height of slice k may be set to the value obtained by adding 1 to the syntax exp_slice_height_in_ctu_minus1[l]. On the other hand, if the value obtained by subtracting the height of the previous slice from the height of the tile is smaller than the value obtained by adding 1 to the syntax exp_slice_height_in_ctu_minus1[l], the difference value obtained by subtracting the height of the previous slice from the height of the tile may be set to the height of slice k.

[0604] That is, the heights of the remaining slices other than the slice whose height is explicitly signaled may have a value less than or equal to the height of the last slice among the slices whose height is explicitly signaled.

[0605] In the above example, it is illustrated that only when a rectangular slice definition method is applied, whether or not the syntax one_slice_in_pic_flag indicating whether or not a picture is composed of a single slice is determined. Conversely to the illustrated example, it is also possible to first code the syntax one_slice_in_pic_flag, and then determine whether or not the syntax rect_slice_flag is coded according to the value of the flag one_slice_in_pic_flag. As an example, when the value of one_slice_in_pic_flag is 1, coding of rect_slice_flag can be omitted.

[0606]

[0607] If the number of tile columns in the current picture is 1, coding of the syntax element slice_width_in_tiles_minus1 may be omitted. Also, if the number of tile rows in the current picture is 1, coding of the syntax element slice_height_in_tiles_minus1 may be omitted.

[0608] Alternatively, coding of at least one of the information indicating the slice width and the information indicating the slice height can be omitted.

[0609] As an example, the coding of the syntax slice_width_in_tiles_minus1 indicating the width of the 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 syntax top_left_brick_idx_delta[i] may specify the top left tile of the i+1th slice adjacent to the right side of the i-th slice. The width of the i-th slice may be derived as 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+1th slice (e.g., the x coordinate of the top left sample).

[0610] Alternatively, the coding of the syntax slice_height_in_tiles_minus1 indicating the height of the 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 syntax top_left_brick_idx_delta[j-1] may specify the top left tile of the jth slice located at the bottom end of the ith slice. The height of the ith slice may be derived as the difference between the y coordinate of the top left tile in the ith slice (e.g., the y coordinate of the top left sample) and the y coordinate of the top left tile in the jth slice (e.g., the y coordinate of the top left sample).

[0611] Alternatively, when defining a rectangular slice, information indicating whether or not differential value information is used may be signaled via a bitstream. As an example, tile_idx_delta_present_flag indicating whether or not differential value information is used may be signaled via a bitstream. The value of the syntax tile_idx_delta_present_flag being 1 indicates that the syntax indicating the differential value of the tile index is coded and signaled. As an example, when the value of the syntax tile_idx_delta_present_flag is 1, 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, and differential value information for determining the position of the top left tile or the position of the top right tile in the slice (for example, top_left_brick_idx_delta[i-1] or bottom_right_brick_idx_delta[i]).

[0612] When the value of the syntax tile_idx_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 tile_idx_delta_prsent_flag is 0, a slice located to the right of a slice that contacts the left boundary of the current picture may be set to have the same height as the slice that contacts the left boundary. This allows information indicating the height of a slice to be signaled only for slices that contact the left boundary of the current picture, and allows the signaling of information indicating the height of a slice to be omitted for slices that do not contact the left boundary of the current picture.

[0613] The syntax tile_idx_delta_present_flag indicating whether information indicating a difference between tile indexes is coded may be coded / decoded if the number of slices included in the current picture is equal to or greater than a threshold. Here, the threshold may be set to an integer such as 0, 1, or 2. As an example, the syntax tile_idx_delta_present_flag may be coded / decoded only if the number of slices included in the current picture is equal to or greater than 1 or equal to or greater than 2. If the number of slices included in the current picture is less than the threshold, coding / decoding of tile_idx_delta_present_flag may be omitted and its value may be set to 0. It is also possible to define slices based on coding tree unit indexes instead of tile indexes.

[0614] In the above examples, it has been assumed that slices are defined by ordering tiles according to a raster scan order, but alternatively, slices may be defined by ordering tiles according to a vertical, horizontal or diagonal scan.

[0615] If a tile is composed of multiple slices, slice size information and / or tile index difference information may be signaled only for the first slice, where the slice size information may include at least one of the syntax slice_width_in_tiles_minus1[i] indicating the slice width and the syntax slice_height_in_tiles_minus1[i] indicating the slice height.

[0616] Table 17 provides an example of this.

[0617] [Table 17-1] [Table 17-2]

[0618] A variable isFirstSliceInTile[i] may be set to indicate whether the slice is the first slice in a tile. A value of 1 for the variable isFirstSliceInTile[i] indicates that the slice is the first slice in the tile, while a value of 0 for the variable isFirstSliceInTile[i] indicates that the slice is not the first slice in the tile.

[0619] The variable isFirstSliceInTile[i] may be initialized to 1. This means that the value of the variable isFirstSliceInTile[i] for the i-th tile may be set to 1 if the i-th slice is not part of any tile and is composed of at least one more tile.

[0620] If the value of the variable isFirstSliceInTile[i] is 1, the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] indicating the size of the slice may be encoded / decoded.

[0621] Here, when both the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] are 0, number information indicating the number of slices in the tile may be signaled. When a tile includes multiple slices, height information regarding at least one of the multiple slices may be encoded / decoded. Here, after decoding the height information of the second slice, the value of the variable isFirstTileInTile[i++] may be converted to 0.

[0622] As a result, coding of the syntax element slice_width_in_tiles_minus1[i] indicating the slice width and the syntax element slice_height_in_tiles_minus1[i] indicating the slice height may be omitted from the second slice onwards.

[0623] The syntax tile_idx_delta[i] indicating the tile index delta can be coded / decoded only for the first tile. As an example, the syntax tile_idx_delta[i] may be signaled when at least one of the syntax slice_width_in_tiles_minus1[i] is not 0, the syntax slice_height_in_tiles_minus1[i] is not 0, or the variable isFirstSliceInTile[i] is 1.

[0624] If a tile is divided into multiple slices (i.e., the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] are both 0), the variable isFirstSliceInTile has a value of 1 only for the first slice, and the variable isFirstSliceInTile has a value of 0 from the second slice onwards. This means that the syntax tile_idx_delta[i] may be coded only for the first slice. If the last tile in a picture is composed of multiple slices, tile_idx_delta[i] may not be signaled.

[0625]

[0626] It is within the scope of the present invention to apply the embodiments described in the context of a decoding or encoding process to an encoding or decoding process. It is also within the scope of the present invention to change the embodiments described in a given order into an order different from that described.

[0627] The above-described embodiments are described based on a series of steps or flow charts, but this does not limit the chronological order of the invention, and steps may be performed simultaneously or in a different order as necessary. In the above-described embodiments, each of the components (e.g., units, modules, etc.) constituting the block diagrams may be realized by a hardware device or software, or a plurality of components may be combined and realized by a single hardware device or software. The above-described embodiments may be realized in the form of program instructions that may be executed by various computer components and may be recorded on a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, and the like, alone or in combination. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program instructions, such as ROMs, RAMs, and flash memories. The hardware devices may be configured to operate as one or more software modules to perform processing according to the present invention, and vice versa. [Industrial Applicability]

[0628] The present invention may be applied to electronic devices that encode / decode video.

Claims

1. Dividing the current picture into a number of tiles; Decoding partition information indicating a slice type, the partition information indicating whether a quadrilateral slice is applied; If the partitioning information indicates that the rectangular slice is applied, decoding first width information and first height information of a slice; A video decoding method, wherein, when the first width information indicates one tile column and the first height information indicates one tile row, it is determined whether or not number information is parsed based on a height of a tile including the slice.

2. The video decoding method of claim 1 , wherein parsing of the number information is omitted when the tile is configured with one coding tree unit row.

3. The video decoding method of claim 2, wherein when the tile is composed of multiple coding tree unit rows, the number information is parsed, and the number information indicates the number of slices for which slice height information needs to be explicitly signaled.

4. The method of claim 3 , wherein second height information is parsed for a first slice having an index smaller than a number indicated by the number information among at least one slice included in the tile.

5. The video decoding method of claim 4 , wherein second height information is not parsed for a second slice in which the number indicated by the number information is equal to or greater than an index.

6. The video decoding method of claim 5 , wherein the height of the second slice is set to a smaller value of a height of a third slice from which second height information was parsed last or a remaining height in the tile.

7. Dividing the current picture into a number of tiles; determining whether to apply a rectangular slice; If the rectangular slice is applied, encoding first width information and first height information of the slice; A video encoding method, wherein, when the first width information indicates one tile column and the first height information indicates one tile row, it is determined whether or not number information is encoded based on a height of a tile including the slice.

8. The video encoding method of claim 7 , wherein, when the tile is configured in one coding tree unit row, encoding of the number information is omitted.

9. The video encoding method of claim 8, wherein when the tile is composed of multiple coding tree unit rows, the number information is encoded, and the number information indicates the number of slices for which slice height information needs to be explicitly signaled.

10. The image encoding method of claim 9 , wherein second height information is encoded for a first slice having an index smaller than a number indicated by the number information among at least one slice included in the tile.

11. The video encoding method of claim 10 , wherein second height information is not encoded for a second slice in which the number indicated by the number information is equal to or greater than an index.

12. The video encoding method of claim 11 , wherein the height of the second slice has a smaller value among a height of a third slice from which the second height information was parsed last or a remaining height within the tile.

Citation Information

Patent Citations

  • Video signal encoding / decoding method and device therefor

    JP7596567B2