Method for encoding / decoding image signal and apparatus therefor

By partitioning the video picture into parallel blocks or strips and using index difference information for partitioning, the problem of low encoding efficiency of video signals in the prior art is solved, and higher compression performance and adaptability are achieved.

CN119676451APending Publication Date: 2025-03-21KONINKLIJKE PHILIPS NV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510056409.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-10-18
Filing Date
2020-06-19
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing video encoding technology has problems such as large amount of data and limited compression performance in high-definition video services, especially the performance of the HEVC standard at high resolution.

Method used

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

Benefits of technology

It improves the encoding/decoding efficiency of video signals, improves compression performance, and is suitable for high-resolution video services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676451A_ABST
    Figure CN119676451A_ABST
Patent Text Reader

Abstract

A method for encoding / decoding an image signal and an apparatus therefor are provided. An image decoding method according to the present invention may comprise the steps of: partitioning a current picture into a plurality of parallel blocks; decoding partition information indicating a slice type, the partition information indicating whether or not a square slice is applied; and determining a slice based on parallel block index difference information if the partition information indicates that a square slice is applied.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of an invention patent application with an application date of June 19, 2020, application number "202080005985.0", and invention name "Method and device for encoding / decoding image signals". Technical Field

[0002] The present disclosure relates to a method for encoding / decoding a video signal and an apparatus thereof. Background Art

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

[0004] Technical issues

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

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

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

[0008] Technical objectives obtainable from the present disclosure are not limited to the above-mentioned technical objectives, and other unmentioned technical objectives can be clearly understood from the following description by a person of ordinary skill in the technical field to which the present disclosure belongs.

[0009] Technical Solution

[0010] The video signal decoding method according to the present disclosure may include: partitioning a current picture into a plurality of parallel blocks; decoding partition information indicating a stripe type, wherein the partition information indicates whether a rectangular stripe is applied; and when the partition information indicates that a rectangular stripe is applied, determining the stripe based on parallel block index difference information. In this case, the parallel block index difference information may indicate an index difference between an upper left parallel block included in the stripe and an upper left parallel block of a subsequent stripe.

[0011] The video signal encoding method according to the present disclosure may include: partitioning a current picture into a plurality of parallel blocks; determining whether to apply a rectangular strip; when applying a rectangular strip, partitioning the current picture into a plurality of rectangular strips; and encoding parallel block index difference information of at least one of the plurality of strips. In this case, the parallel block index difference information may represent an index difference between an upper left parallel block included in the strip and an upper left parallel block of a subsequent strip.

[0012] In the video signal decoding method according to the present disclosure, the method may further include: decoding a difference information existence flag indicating whether parallel block index difference information exists. In this case, whether the difference information existence flag is to be decoded may be determined based on whether the number of slices included in the current picture is equal to or greater than a threshold.

[0013] In the video signal decoding method according to the present disclosure, when the number of slices included in the current picture is equal to or less than the threshold, decoding of the difference information existence flag may be omitted and the value of the difference information existence flag may be inferred to be 0.

[0014] In the video signal decoding method according to the present disclosure, the method may further include: decoding information indicating the size of the strip. The information indicating the size of the strip may include: width information indicating the width of the strip and height information indicating the height of the strip, and whether to decode the height information for the strip may be determined based on whether the strip is adjacent to the left boundary of the current picture.

[0015] In the video signal decoding method according to the present disclosure, when the slice is not adjacent to the left boundary of the current picture, decoding of the height information can be omitted and the height of the slice can be set to be the same as the height of other slices adjacent to the left boundary of the current picture.

[0016] In the video signal decoding method according to the present disclosure, partitioning the current image into a plurality of parallel blocks may include: decoding width information indicating the width of at least one parallel block column among a plurality of parallel block columns included in the current picture; and partitioning the current picture into the plurality of parallel block columns based on the width information. In this case, when the decoding of the width information is omitted for a first parallel block column among the plurality of parallel block columns, the width of the first parallel block column may be determined based on the width information of a second parallel block column that is decoded last.

[0017] It will be appreciated that the features summarized above are exemplary aspects of the following detailed description of the present disclosure and do not limit the scope of the present disclosure.

[0018] Technical Effects

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

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

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

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

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

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

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

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

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

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

[0029] Figure 7 is a diagram illustrating nonlinear motion of an object.

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

[0031] Fig. 9 is a diagram showing the affine seed vector of each affine motion model.

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

[0033] Fig.11 is a diagram illustrating candidate blocks for deriving merge candidates.

[0034] Fig.12 is a diagram for explaining the updating aspect of the motion information table.

[0035] Fig.13 is a diagram for explaining the updating aspect of the motion information table.

[0036] Fig.14 is a diagram illustrating an updating aspect of a motion information table.

[0037] Fig.15 is a diagram showing an example in which the index of the stored motion information candidate is updated.

[0038] Fig.16 is a diagram illustrating an example of performing redundancy check on only a part of merge candidates.

[0039] Fig.17 is a diagram showing an example in which a redundancy check on a specific merge candidate is omitted.

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

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

[0042] Fig. 20 is a diagram showing a temporary motion information table.

[0043] Fig.21 is a diagram showing an example in which a motion information table and a temporary motion information table are unified.

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

[0045] Fig.23 is a diagram showing an intra prediction mode.

[0046] Fig.24 and Fig.25 is a diagram showing an example of a one-dimensional array in which reference samples are arranged in rows.

[0047] Fig.26 is a diagram showing an angle formed by a directional intra prediction mode and a straight line parallel to the x-axis.

[0048] Fig. 27 is a diagram illustrating an aspect in which prediction samples are obtained if a current block has a non-square shape.

[0049] Fig.28 is a diagram illustrating a wide-angle intra prediction mode.

[0050] Fig.29 is a diagram illustrating an example of determining whether to perform transform skipping per subblock.

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

[0052] Fig.31 is a flow chart illustrating a process for determining block strength.

[0053] Fig.32 Predefined filter candidates are shown.

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

[0055] Fig.34 An example in which a screen is partitioned into a plurality of tiles is shown.

[0056] Fig.35 It is a diagram for explaining the generation aspect of the blocks.

[0057] Fig.36 and Fig.37 is a diagram showing an example of defining stripes based on a raster order.

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

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

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

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

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

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

[0064] Reference Figure 1 , the image encoding apparatus 100 may include a picture partition unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse transform unit 145, a filter unit 150, and a memory 155.

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

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

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

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

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

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

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

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

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

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

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

[0076] The motion prediction unit 125 may generate a prediction unit based on information of reference pixels around the current block as pixel information in the current picture. When a neighboring block of the current prediction unit is a block on which inter-frame prediction is performed, and thus the reference pixel is a pixel on which inter-frame prediction is performed, the reference pixel included in the block on which inter-frame prediction is performed may be replaced with information about the reference pixel of the neighboring block on which intra-frame prediction is performed. In other words, when a reference pixel is unavailable, at least one reference pixel among available reference pixels may be used to replace the unavailable reference pixel information.

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

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

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

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

[0081] The transform unit 130 may perform a transform on the residual block by using a transform method such as discrete cosine transform (DCT) or discrete sine transform (DST), wherein the residual block includes information about a residual value between the original block and the prediction unit generated by the prediction unit 120 or 125. In this regard, the DCT transform kernel includes at least one of DCT2 or DCT8, and the DST transform kernel includes DST7. Whether to apply DCT or DST to perform a transform on the residual block may be determined based on information about an intra-frame prediction mode of the prediction unit used to generate the residual block. The transform for the residual block may be skipped. A flag indicating whether to skip the transform for the residual block may be encoded. Transform skipping may be allowed for a residual block whose size is less than or equal to a threshold, a residual block of a luminance component in a 4:4:4 format, or a residual block of a chrominance component.

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

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

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

[0085] The entropy encoding unit 165 may perform entropy encoding based on the value calculated by the rearrangement unit 160. The entropy encoding may use various encoding methods, for example, exponential Golomb encoding, context-adaptive variable length coding (CAVLC), or context-adaptive binary arithmetic coding (CABAC).

[0086] The entropy coding unit 165 may encode various types of information obtained from the rearrangement unit 160 and the prediction units 120 and 125 (such as information about residual value coefficients and information about block types of coding units, information about prediction modes, information about partition units, information about prediction units and information about transform units, information about motion vectors, information about reference frames, information about block interpolation, filtering information, and the like).

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

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

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

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

[0091] The offset correction unit can correct the original image with an offset in pixels for the image on which the deblocking operation is performed. In order to perform offset correction on a specific picture, a method of applying an offset to an area determined after partitioning the pixels of the image into a predetermined number of areas, or a method of applying an offset according to edge information of each pixel can be used.

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

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

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

[0095] Reference Figure 2 , the image decoding apparatus 200 includes an entropy decoding unit 210 , a rearrangement unit 215 , an inverse quantization unit 220 , an inverse transform unit 225 , prediction units 230 and 235 , a filter unit 240 , and a memory 245 .

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

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

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

[0099] The rearrangement unit 215 may perform rearrangement on the bit stream entropy-decoded by the entropy decoding unit 210 based on the rearrangement method used in the encoder. The coefficients represented in the form of a one-dimensional vector may be reconstructed, and the coefficients represented in the form of a one-dimensional vector may be rearranged into coefficients in the form of a two-dimensional block. The rearrangement unit 215 may perform rearrangement by receiving information related to coefficient scanning performed in the encoder and performing inverse scanning based on the scanning order performed in the encoder.

[0100] The inverse quantization unit 220 may perform inverse quantization based on the quantization parameter received from the encoder and the coefficient value of the rearranged block.

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

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

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

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

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

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

[0107] When the prediction mode of the prediction unit is a prediction mode for performing intra prediction based on a pixel value obtained by interpolating reference pixels, the reference pixel interpolation unit may interpolate the reference pixels so as to generate reference pixels having an integer or smaller unit. When the prediction mode for the current prediction unit is a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode for the current block is a DC mode, the DC filter may generate a prediction block by filtering.

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

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

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

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

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

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

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

[0115] The size of the CTU may be defined at a picture level or a sequence level. Similarly, information indicating the size of the CTU may be signaled through a picture parameter set or a sequence parameter set.

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

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

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

[0119] The current picture reference is to set the current picture as the reference picture and obtain the prediction block of the current block from the area in the current picture that has been encoded / decoded. In this regard, the current picture represents the picture including the current block. Information indicating whether the current picture reference is applied to the current block can be sent by signal in the bitstream. In an example, the information can be a 1-bit flag. When the flag is true (TRUE), the prediction coding mode for the current block can be determined as the current picture reference, and when the flag is false (FALSE), the prediction coding mode for the current block can be determined as inter-frame prediction.

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

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

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

[0123] The coding block may be partitioned into a plurality of coding blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning. The partitioned coding block may be partitioned into a plurality of coding blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning.

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

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

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

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

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

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

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

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

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

[0133] In contrast, for a coding block whose partition depth is k+1, the coding block whose partition depth is k may be referred to as a parent coding block.

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

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

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

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

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

[0139] When quadtree partitioning is not applied to a coding block, it may be determined whether to perform binary tree partitioning or ternary tree partitioning on the coding block according to at least one of the size of the coding block, whether the coding block is located at a picture boundary, the maximum partition depth, or the partition type of the neighboring block. When it is determined that binary tree partitioning or ternary tree partitioning is performed on the coding block, information indicating the partition direction may be sent by signal in 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 partition direction is vertical or horizontal. In addition, information indicating which of binary tree partitioning or ternary tree partitioning is applied to the coding block may be sent by signal in 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 is applied to the coding block or ternary tree partitioning is applied to the coding block.

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

[0141] Inter prediction is a prediction coding mode that predicts a current block by using information about a previous picture. In an example, a block in a previous picture that is located at the same position as the current block (hereinafter referred to as a co-located block) may be set as a prediction block of the current block. Hereinafter, a prediction block generated based on the co-located block of the current block may be referred to as a co-located prediction block.

[0142] In contrast, when an object existing in a previous picture has moved to another position in a current picture, the current block can be effectively predicted by using the motion of the object. For example, when the moving direction and size of the object are determined by comparing the previous picture with the current picture, a prediction block (or a prediction image) of the current block can be generated according to the motion information of the object. Hereinafter, the prediction block generated by using the motion information may be referred to as a motion prediction block.

[0143] The residual block may be generated by subtracting the prediction block from the current block. In this regard, in the case where the object moves, the energy of the residual block may be reduced by using the motion prediction block instead of using the co-located prediction block, and thus the compression performance of the residual block may be improved.

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

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

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

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

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

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

[0150] Figure 7 is a diagram illustrating nonlinear motion of an object.

[0151] In videos, nonlinear motion of objects may occur. In the example, Figure 7 In the example shown, nonlinear motion of the object may occur (such as camera zooming in, zooming out, rotating, or affine transformation, etc.). For nonlinear motion of the object, the translation motion vector may not be able to effectively represent the motion of the object. Therefore, for areas where nonlinear motion of the object occurs, the encoding efficiency can be improved by using affine motion instead of translation motion.

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

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

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

[0155] Equation 1 represents the affine motion by using 6 parameters. The affine motion represents the translational motion of a predetermined area determined by the affine seed vector.

[0156] [Equation 1]

[0157] v x =ax-by+e

[0158] v y =cx+dy+f

[0159] In the case of expressing affine motion by using 6 parameters, complex motion can be expressed, but since more bits are required to encode each parameter, encoding efficiency is reduced. Therefore, affine motion can be expressed by using 4 parameters. Equation 2 expresses affine motion by using 4 parameters.

[0160] [Equation 2]

[0161] v x =ax-by+e

[0162] v y =bx+ay+f

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

[0164] Optionally, based on the affine inter prediction mode of the current block, the affine motion model of the current block may be determined. In an example, when the affine merge mode is applied, the affine motion model of the current block may be determined as a 4-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 in the bitstream and signaled. In an 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".

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

[0166] Fig. 9 is a diagram showing the affine seed vector of each affine motion model.

[0167] In a 4-parameter affine motion model, an affine seed vector may be derived for both the upper left corner, the upper right corner, or the lower left corner. Fig. 9 In the example shown in (a), when the 4-parameter affine motion model is selected, the affine seed vector sv of the upper left corner of the current block (eg, the upper left sample point (x1, y1)) can be used. 0 and the affine seed vector sv of the upper right corner of the current block (e.g., the upper right sample point (x1, y1)) 1 Derive the affine vector. You can use the lower left affine seed vector instead of the upper left affine seed vector, or use the lower left affine seed vector instead of the upper right affine seed vector.

[0168] In the 6-parameter affine motion model, affine seed vectors for the upper left corner, upper right corner, and lower left corner can be derived. In the example, as in Fig. 9 In the example shown in (b), when the 6-parameter affine motion model is selected, the affine seed vector sv of the upper left corner of the current block (eg, the upper left sample point (x1, y1)) can be used. 0 , the affine seed vector sv of the upper right corner of the current block (e.g., the upper right sample point (x1, y1)) 1 and the affine seed vector sv of the upper left corner of the current block (e.g., the upper left sample point (x2, y2)) 2 To derive the affine vector.

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

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

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

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

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

[0174] [Equation 3]

[0175]

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

[0177] When the first control point and the second control point correspond to the upper left corner and the upper right corner of the current block respectively, x 1 -x 0 Can be set to the same value as the width of the current block.

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

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

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

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

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

[0183] A merge candidate of a current block may be derived (S1101). The merge candidate of the current block may be derived from a block encoded / decoded by inter prediction before the current block.

[0184] Fig.12 is a diagram illustrating candidate blocks for deriving merge candidates.

[0185] 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, samples for determining the candidate block are defined as basic samples. In addition, basic samples adjacent to the current block are referred to as neighboring basic samples, and basic samples not adjacent to the current block are referred to as non-neighboring basic samples.

[0186] The neighboring basic sample points may be included in the neighboring columns of the leftmost column of the current block or the neighboring rows of the uppermost row of the current block. In an example, when the coordinates of the upper left sample point of the current block are (0,0), at least one block among the blocks including the basic sample points at positions (-1,H-1), (W-1,-1), (W,-1), (-1,H) or (-1,1) may be used as a candidate block. Referring to the diagram, neighboring blocks of index 0 to index 4 may be used as candidate blocks.

[0187] The non-neighboring basic sample points represent samples having at least one of an x-axis distance or a y-axis distance with respect to the basic sample points adjacent to the current block having a predefined value. In an example, at least one of a block including a basic sample point having an x-axis distance with respect to the left basic sample point having a predefined value, a block including a non-neighboring sample point having a y-axis distance with respect to the upper basic sample point having a predefined value, or a block including a non-neighboring sample point having an x-axis distance and a y-axis distance with respect to the upper left basic sample point having predefined values ​​may be used as a candidate block. The predefined value may be a natural number such as 4, 8, 12, 16, etc. Referring to the diagram, at least one block of index 5 to index 26 may be used as a candidate block.

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

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

[0190] A merge candidate list including merge candidates may be generated ( S1102 ).

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

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

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

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

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

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

[0197] Optionally, information indicating the maximum number of motion information candidates that can be included in the motion information table may be signaled in the 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 can be included in the motion information table. Optionally, the information may indicate the difference between the maximum number of motion information candidates that can be included in the motion information table and the maximum number of merge candidates that can be included in the merge candidate list.

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

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

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

[0201] Alternatively, information about the initial motion information candidate may be signaled in a picture parameter set or a slice header. Although the slice is initialized, the motion information table may include the initial motion information candidate. Therefore, the initial motion information candidate may be used for a block of the first encoding / decoding target in the slice.

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

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

[0204] Fig.13 is a diagram for explaining the updating aspect of the motion information table.

[0205] For the current block, when inter prediction is performed (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.

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

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

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

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

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

[0211] Optionally, when a motion information candidate derived from the current block is added to the motion information table, the maximum index may be assigned to the motion information candidate. In an example, when the number of pre-stored motion information candidates in the motion information table is less than the maximum value, an index having the same value as the number of pre-stored motion information candidates may be assigned to the motion information candidate. Optionally, when the number of pre-stored motion information candidates in the motion information table is equal to the maximum value, an index obtained by subtracting 1 from the maximum value may be assigned to the motion information candidate. Optionally, the motion information candidate having the smallest index is removed, and the index of the residual pre-stored motion information candidate is reduced by 1.

[0212] Fig.14 is a diagram illustrating an updating aspect of a motion information table.

[0213] It is assumed that when a motion information candidate derived from the current block is added to the motion information table, a maximum index is assigned to the motion information candidate. In addition, it is assumed that the maximum number of motion information candidates has been stored in the motion information table.

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

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

[0216] Optionally, when the motion information candidate derived based on the current block is added to the motion information table, the pre-stored motion information candidate identical to the motion information candidate may be removed. In this case, it produces the same effect as when the index of the pre-stored motion information candidate is newly updated.

[0217] Fig.15 is a diagram showing an example in which indexes of pre-stored motion information candidates are updated.

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

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

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

[0221] The motion information of the blocks included in the predetermined area may be set not to be added to the motion information table. In an example, the motion information candidates derived based on the motion information of the blocks included in the merge processing area may not be added to the motion information table. Since the encoding / decoding order of the blocks included in the merge processing area is not defined, it is inappropriate to use the motion information of any one of them for inter-frame prediction of another one of them. Therefore, the motion information candidates derived based on the blocks included in the merge processing area may not be added to the motion information table.

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

[0223] Based on the inter prediction mode of the current block, it may be determined whether the current block will be used as a motion information candidate. In an example, a block encoded / decoded based on an affine motion model may be set to be unusable as a motion information candidate. Therefore, although the current block is encoded / decoded by inter prediction, when 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.

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

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

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

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

[0228] Optionally, redundancy check may be performed only on a portion of the pre-stored merge candidates in the merge candidate list. In an example, redundancy check may be performed only on merge candidates whose index exceeds or is below a threshold or merge candidates derived from a block at a specific position. In this regard, 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.

[0229] Fig.16 is a diagram illustrating an example of performing redundancy check on only a part of merge candidates.

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

[0231] Unlike the example shown, when the motion information candidate HmvpCand[j] is added to the merge candidate list, a redundancy check with two merge candidates with the smallest index may be performed for the motion information candidate. For example, it may be checked whether mergeCandList[0] and mergeCandList[1] are the same as HmvpCand[j].

[0232] Optionally, a redundancy check may be performed only on merge candidates derived from a specific position. In an example, a redundancy check may be performed on at least one of merge candidates derived from a neighboring block located to the left of the current block or above the current block. When 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 a redundancy check.

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

[0234] A redundancy check with merge candidates may be performed only on a portion of the motion information candidates. In an example, a redundancy check may be performed only on N motion information candidates having large indexes or small indexes among the motion information candidates included in the motion information table. In an example, a redundancy check may be performed only on motion information candidates having indexes whose difference between the number of motion information candidates and the index is lower than a threshold among the motion information candidates included in the motion information table. When the threshold is 2, a redundancy check may be performed only on 3 motion information candidates having the largest index value among the motion information candidates included in the motion information table. For motion information candidates other than the above 3 motion information candidates, the redundancy check may be omitted. When the redundancy check is omitted, the motion information candidate may be added to the merge candidate list regardless of whether there is the same motion information as the merge candidate.

[0235] In contrast, the redundancy check is set to be performed only on the motion information candidates having the index whose difference between the number of motion information candidates and the index exceeds the threshold value among the motion information candidates included in the motion information table.

[0236] The number of motion information candidates for performing redundancy check may be redefined in the encoder and the decoder. In an example, the threshold may be an integer (such as 0, 1, or 2).

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

[0238] When the merge candidate identical to the first motion information candidate is found, redundant checking of the merge candidate identical to the first motion information candidate may be omitted in redundant checking of the second motion information candidate.

[0239] Fig.17 is a diagram showing an example in which a redundancy check on a specific merge candidate is omitted.

[0240] When the motion information candidate HmvpCand[i] with index i is added to the merge candidate list, a redundant check is performed between the motion information candidate and the pre-stored merge candidates in the merge candidate list. In this regard, when a merge candidate mergeCandlist[j] identical to the motion information candidate HmvpCand[i] is found, a redundant check can be performed between the motion information candidate HmvpCand[i-1] with index i-1 and the merge candidate without adding the motion information candidate HmvpCand[i] to the merge candidate list. In this regard, the redundant check between the motion information candidate HmvpCand[i-1] and the merge candidate mergeCandList[j] can be omitted.

[0241] In the example, Fig.17 In the example shown, it is determined that HmvpCand[1] and mergeCandList[2] are the same. Therefore, a redundancy check of HmvpCand[i-1] may be performed without HmvpCand[i] being added to the merge candidate list. In this regard, a redundancy check between HmvpCand[i-1] and mergeCandList[2] may be omitted.

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

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

[0244] Spatial merging candidate - Temporal merging candidate - Motion information candidate - (affine motion information candidate) - Paired merging candidate - Zero merging candidate

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

[0246] The motion information table may also be used in the motion vector prediction mode. In an example, when the number of motion vector prediction candidates included in the motion vector prediction candidate list of the current block is less than a threshold value, the motion information candidate included in the motion information table may be set as the motion vector prediction candidate of the current block. Specifically, the motion vector of the motion information candidate may be set as the motion vector prediction candidate.

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

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

[0249] Spatial motion vector prediction candidate - Temporal motion vector prediction candidate - Motion information candidate - (affine motion information candidate) - Zero motion vector prediction candidate

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

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

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

[0253] A merge candidate of the current block may be derived based on the coding block. However, when the current block is included in a merge processing region larger than the current block, a candidate block included in the same merge processing region as the current block may be set to be unavailable as a merge candidate.

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

[0255] exist Fig.18 In the example shown in (a), in the encoding / decoding of CU5, a block including basic samples adjacent to CU5 may be set as a candidate block. In this regard, candidate blocks X3 and X4 included in the same merge processing region as CU5 may be set to be unusable as merge candidates for CU5. However, candidate blocks X0, X1, and X2 not included in the same merge processing region as CU5 may be set to be usable as merge candidates.

[0256] exist Fig.18 In the example shown in (b), in the encoding / decoding of CU8, a block including basic samples adjacent to CU8 may be set as a candidate block. In this regard, candidate blocks X6, X7, and X8 included in the same merge processing region as CU8 may be set to be unusable as merge candidates. However, candidate blocks X5 and X9 not included in the same merge processing region as CU8 may be set to be usable as merge candidates.

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

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

[0259] As in Fig.19In the example shown in (a), a neighboring block adjacent to the current block may be set as a candidate block for deriving a merge candidate of the current block. In this regard, a candidate block included in the same merge processing area as the current block may be set to be unusable as a merge candidate. In the example, when deriving a merge candidate for coding block CU3, an upper neighboring block y3 and an upper right neighboring block y4 included in the same merge processing area as coding block CU3 may be set to be unusable as a merge candidate for coding block CU3.

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

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

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

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

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

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

[0266] The merged processing area may be square or non-square. Information for determining the merged processing area may be signaled in the bitstream. The information may include at least one of information indicating the shape of the merged processing area or information indicating the size of the merged processing area. When the merged processing area is non-square, at least one of information indicating the size of the merged processing area, information indicating the width or height of the merged processing area, or information indicating the ratio between the width and height of the merged processing area may be signaled in the bitstream.

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

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

[0269] However, if the motion information candidate derived from the block included in the merge processing area is added to the motion information table, a situation may occur where the motion information candidate derived from the block is used for encoding / decoding of other blocks in the merge processing area whose encoding / decoding is actually slower than that of the block. In other words, although the dependency between blocks should be excluded in encoding / decoding of the block included in the merge processing area, a situation may occur where motion prediction compensation is performed by using motion information of other blocks included in the merge processing area. In order to solve such a problem, although encoding / decoding of the block included in the merge processing area is completed, the motion information of the encoding / decoding completed block may not be added to the motion information table.

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

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

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

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

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

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

[0276] Optionally, when the current block is included in the merge processing region, it may be set not to use the motion information candidates included in the motion information table. In other words, although 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.

[0277] In another example, a motion information table for a merge processing region or a coding tree unit may be configured. The motion information table serves to temporarily store motion information of blocks included in the merge processing region. In order to distinguish a general motion information table from a motion information table for a merge processing region or a coding tree unit, the motion information table for the merge processing region or the coding tree unit is referred to as a temporary motion information table. And, the motion information candidates stored in the temporary motion information table are referred to as temporary motion information candidates.

[0278] Fig. 20 is a diagram showing a temporary motion information table.

[0279] A temporary motion information table for a coding tree unit or a merge processing area may be configured. When motion compensation prediction is performed on a current block included in a coding tree unit or a merge processing area, the motion information of the block may not be added to the motion information table HmvpCandList. Optionally, a temporary motion information candidate derived from the block may be added to the temporary motion information table HmvpMERCandList. In other words, the temporary motion information candidate added to the temporary motion information table may not be added to the motion information table. Therefore, the motion information table may not include a motion information candidate derived based on the motion information of a block included in the coding tree unit or the merge processing area containing the current block.

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

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

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

[0283] If 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 may be unified.

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

[0285] As in Fig.21 In the example shown in , if encoding / decoding of all blocks included in a coding tree unit or a merge processing region is completed, the temporary motion information candidates included in the temporary motion information table may be updated in the motion information table.

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

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

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

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

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

[0291] The use of motion information candidates derived from blocks included in the same coding tree unit or the same merge processing region as the current block as the merge candidate of the current block may be limited. To this end, address information of the block may be additionally stored for the motion information candidate. The address information of the block may include at least one of the position of the block, the address of the block, the index of the block, the position of the merge processing region including the block, the address of the merge processing region including the block, the index of the merge processing region including the block, the position of the coding tree region including the block, the address of the coding tree region including the block, or the index of the coding tree region including the block.

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

[0293] The intra prediction method includes matrix-based intra prediction and intra prediction according to a direction with adjacent reconstruction samples. Information indicating the intra prediction method of the current block can be sent by signal in the bit stream. The information can be a 1-bit flag. Optionally, the intra prediction of the current block can be determined based on at least one of the position of the current block, the size of the current block, the shape of the current block, or the intra prediction method of the neighboring block. In the example, when there is a current block across the picture boundary, it can be set so that the matrix-based intra prediction method is not applied to the current block.

[0294] The matrix-based intra prediction method is a method for obtaining a prediction block of a current block based on the matrix product of the matrix stored in the encoder and the decoder and the reconstructed samples around the current block. Information for specifying any one of a plurality of pre-stored matrices can be signaled in the bitstream. The decoder can determine the matrix for performing intra prediction on the current block based on the above information and the size of the current block.

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

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

[0297] A reference sample line of the current block may be determined (S2201). The reference sample line refers to a set of reference samples included in a k-th line far above and / or to the left of the current block. The reference samples may be derived from reconstructed samples encoded / decoded around the current block.

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

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

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

[0301] [Table 1]

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

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

[0304] The reference sample line may include an upper reference sample located above the current block and a left reference sample located on the left side of the current block. The upper 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.

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

[0306] Fig.23 is a diagram showing an intra prediction mode.

[0307] Fig.23 (a) shows 35 intra prediction modes, Fig.23 (b) shows 67 intra prediction modes.

[0308] Can define the ratio Fig.23 A greater or lesser number of intra prediction modes is shown.

[0309] Based on the intra prediction mode of the neighboring blocks adjacent to the current block, the MPM (Most Probable Mode) may be set. In this regard, 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 side of the current block.

[0310] The number of MPMs included in the MPM list may be preset in the encoder and the decoder. In an example, the number of MPMs may be 3, 4, 5, or 6. Optionally, information indicating the number of MPMs may be signaled in the bitstream. Optionally, the number of MPMs may be determined based on at least one of the prediction coding mode of the neighboring block, the size, shape, or reference sample line index of the current block. In an example, although N MPMs may be used when an adjacent reference sample line is determined as a reference sample line of the current block, M MPMs may be used when a non-adjacent reference sample line is determined as a reference sample line of the current block. Since M is a natural number less than N, in an example, N may be 6 and M may be 5, 4, or 3. Therefore, although the intra prediction mode of the current block may be determined as any one of the 6 candidate intra prediction modes when 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 may be determined as any one of the 5 candidate intra prediction modes when the index of the reference sample line of the current block is greater than 0 and the MPM flag is true.

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

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

[0313] When deriving the intra prediction mode of the current block, the process of comparing a part of the MPM with the remaining mode information can be omitted. In the example, the MPM of the non-directional intra prediction mode in the MPM can be excluded from the comparison target. When the non-directional intra prediction mode is set to the MPM, the remaining mode information clearly indicates the directional intra prediction mode, so the intra prediction mode of the current block can be derived by comparing the remaining MPMs except the non-directional intra prediction mode with the remaining mode information. Instead of excluding the non-directional intra prediction mode from the comparison target, the resulting value can be compared with the remaining MPMs after adding the number of the non-directional intra prediction mode to the remaining mode information.

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

[0315] When the default mode flag is used, it can be set so that the intra prediction mode that is the same as the default mode is not set to MPM. In the example, when the default mode flag indicates whether the intra prediction mode of the current block is plane, the intra prediction mode of the current block can be derived by using 5 MPMs that do not include the MPM corresponding to the plane.

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

[0317] When the index of the reference sample line of the current block is not 0, it may be set not to use the default mode. In an example, when a non-adjacent reference sample line is determined as the reference sample line of the current block, it may be set not to use a non-directional intra prediction mode (such as a DC mode or a planar mode). Therefore, when the index of the reference sample line is not 0, the default mode flag may not be signaled, and the value of the default mode flag may be inferred to be a predefined value (i.e., false).

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

[0319] When the DC mode is selected, the prediction sample of the current block may be generated based on the average value of the reference samples. In detail, the values ​​of all samples in the prediction block may be generated based on the average value of the reference samples. The average value may be derived using at least one of the upper reference sample adjacent to the upper side of the current block and the left reference sample adjacent to the left side of the current block.

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

[0321] When the planar mode is selected, the prediction sample can be obtained by using the horizontal prediction sample and the vertical prediction sample. In this regard, the horizontal prediction sample can be obtained based on the left reference sample and the right reference sample located on the same horizontal line as the prediction sample, and the vertical prediction sample can be obtained based on the upper reference sample and the lower reference sample located on the same vertical line as the prediction sample. In this regard, the right reference sample can be generated by copying the reference sample adjacent to the upper right corner of the current block, and the lower reference sample can be generated by copying the reference sample adjacent to the lower left corner of the current block. The horizontal prediction sample can be obtained based on the weighted sum of the left reference sample and the right reference sample, and the vertical prediction sample can be obtained based on the weighted sum of the upper reference sample and the lower reference sample. In this regard, the weighting factor assigned to each reference sample can be determined according to the position of the prediction sample. The prediction sample can be obtained based on the average or weighted sum of the horizontal prediction sample and the vertical prediction sample. When the weighted sum is used, the weighting factor assigned to the horizontal prediction sample and the vertical prediction sample can be determined based on the position of the prediction sample.

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

[0323] [Table 2]

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

[0325] Table 2 represents the intra-frame direction parameter of each intra-frame prediction mode, where, when 35 intra-frame prediction modes are defined, the index of the intra-frame prediction mode is one of 2 to 34. When the directional intra-frame prediction mode is defined to be greater than 33, the intra-frame direction parameter of each intra-frame prediction mode can be set by subdividing Table 2.

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

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

[0328] Fig.24 is a diagram showing a one-dimensional arrangement of reference samples in the vertical direction, and Fig.25 is a diagram showing a horizontal one-dimensional arrangement of reference samples arranged in the horizontal direction. Assuming that 35 intra prediction modes are defined, the following description will be made. Fig.24 and Fig.25 .

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

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

[0331] The reference sample index iIdx and the weighting factor parameter ifact may be obtained by the following Equation 4 and Equation 5, respectively.

[0332] [Equation 4]

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

[0334] [Equation 5]

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

[0336] In Equation 4 and Equation 5, P ang Indicates intra-frame direction parameters. The reference sample specified by the reference sample index iIdx corresponds to the integer pel.

[0337] In order to derive the prediction sample, at least one reference sample may be specified. Specifically, according to the slope of the prediction mode, the position of the reference sample used to derive the prediction sample may be specified. In an example, the reference sample used to derive the prediction sample may be specified by using the reference sample index iIdx.

[0338] In this regard, when the slope of the intra-frame prediction mode is not represented by one reference sample, the prediction sample can be generated by performing interpolation on multiple reference samples. In the example, when the slope of the intra-frame prediction mode is a value between the slope between the prediction sample and the first reference sample and the slope between the prediction sample and the second reference sample, the prediction sample can be obtained by performing interpolation on the first reference sample and the second reference sample. In other words, when the angle line according to the intra-frame prediction angle does not pass through the reference sample located at the integer pixel, the prediction sample can be obtained by performing interpolation on the reference samples located near the left and right sides or above and below the position where the angle line passes.

[0339] The following Equation 6 represents an example of obtaining a prediction sample based on a reference sample.

[0340] [Equation 6]

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

[0342] In Equation 6, P represents a prediction sample, and Ref_1D represents any one of the reference samples arranged in a line. In this regard, the position of the reference sample may be determined by the position (x, y) of the prediction sample and the reference sample index iIdx.

[0343] When the slope of the intra prediction mode may be represented by one reference sample, the weighting factor parameter ifact is set to 0. Therefore, Equation 6 can be simplified to the following Equation 7.

[0344] [Equation 7]

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

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

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

[0348] Fig.26 is a diagram showing the number of angles formed between a directional intra prediction mode and a straight line parallel to the x-axis.

[0349] As Fig.26 In the example shown in , the directional prediction mode can exist between the lower left diagonal direction and the upper right diagonal direction. Describes the angle formed between the x-axis and the directional prediction mode, and the directional prediction mode can exist from 45 degrees (lower left diagonal direction) to -135 degrees (upper right diagonal direction).

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

[0351] Fig. 27 is a diagram showing an aspect of obtaining prediction samples when the current block is non-square.

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

[0353] In another example, as Fig. 27In the example shown in (b), it is assumed that the current block is a non-square with a height greater than a width, and the intra prediction mode of the current block is a directional intra prediction mode from -90 degrees to -135 degrees. In the above case, when the prediction sample A around the lower row of the current block is derived from the reference sample located in the angular mode according to the above angle number, there may be a case where the upper reference sample T far away from the prediction sample is used instead of the left reference sample L close to the prediction sample.

[0354] To solve the above problem, when the current block is non-square, the intra prediction mode of the current block can be replaced with the intra prediction mode in the opposite direction. Therefore, for non-square blocks, angles greater than or less than Fig.23 The directional prediction mode of the angle of the directional prediction mode shown in . The above directional intra prediction mode can be defined as a wide-angle intra prediction mode. The wide-angle intra prediction mode represents a directional intra prediction mode that does not belong to the range of 45 degrees to -135 degrees.

[0355] Fig.28 is a diagram illustrating a wide-angle intra prediction mode.

[0356] exist Fig.28 In the illustrated example, the intra prediction modes having indices from -1 to -14 and the intra prediction modes having indices from 67 to 80 represent the wide-angle intra prediction modes.

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

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

[0359] By using the wide-angle intra prediction mode, it is possible to predict Fig. 27 The sample point A shown in (a) can be predicted by the reference sample point L Fig. 27 Sample point A shown in (b).

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

[0361] [Table 3]

[0362]

[0363]

[0364] When the current block is non-square and the intra prediction mode of the current block obtained in S2502 belongs to the transformation range, the intra prediction mode of the current block may be transformed into a wide-angle intra prediction mode. The transformation range may be determined based on at least one of a size, a shape, or a ratio of the current block. In this regard, the ratio may represent a ratio between a width and a height of the current block.

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

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

[0367] When the current block is a non-square with a height greater than a width, the transformation range may be set to be from the intra prediction mode index in the lower left diagonal direction (e.g., 2) to (the intra prediction mode index in the lower left diagonal direction + M). In this regard, M may be determined based on the ratio of the current block. When the intra prediction mode of the current block belongs to the transformation range, the intra prediction mode may be transformed into a wide-angle intra prediction mode. The transformation may be to add a predefined value to the intra prediction mode, and the predefined value may be the total number of directional intra prediction modes (e.g., 65) other than the wide-angle intra prediction mode.

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

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

[0370] The transform range may be determined based on the ratio of the current block. In an example, Tables 4 and 5 show transform ranges for a case where 35 intra prediction modes other than the wide intra prediction mode are defined and a case where 67 intra prediction modes other than the wide intra prediction mode are defined, respectively.

[0371] [Table 4]

[0372] condition Alternative intra prediction modes W / H=2 Mode 2, 3, 4 W / H>2 Mode 2,3,4,5,6 W / H=1 none H / W=1 / 2 Mode 32,33,34 H / W<1 / 2 Mode 30,31,32,33,34

[0373] [Table 5]

[0374] condition Alternative intra prediction modes W / H=2 Mode 2,3,4,5,6,7 W / H>2 Mode 2,3,4,5,6,7,8,9,10,11 W / H=1 none H / W=1 / 2 Mode 61,62,63,64,65,66 H / W<1 / 2 Mode 57,58,59,60,61,62,63,64,65,66

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

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

[0377] [Table 6]

[0378]

[0379]

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

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

[0382] When the wide-angle intra prediction mode is not used, each of refW and refH may be set to the sum of nTbW and nTbH. Therefore, in addition to the upper left reference sample, the non-adjacent reference sample line with an interval of i from the current block may include (nTbW+nTbH+offsetX[i]) upper reference samples and (nTbW+nTbH+offsetY[i]) left reference samples. That is, the non-adjacent reference sample line with an interval of 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 a value greater than offsetY. In one example, when the value of offsetX may be set to 1, the value of offsetY may be set to 0. Conversely, when the value of whRatio is less than 1, the value of offsetY may be set to a value greater than offsetX. In one example, the value of offsetX may be set to 0, and the value of offsetY may be set to 1.

[0383] Since the wide-angle intra-prediction mode is used in addition to the conventional intra-prediction mode, resources used to encode the wide-angle intra-prediction mode may be increased, thereby reducing encoding efficiency. Therefore, instead of encoding the wide-angle intra-prediction mode as is, an alternative intra-prediction mode of the wide-angle intra-prediction mode is encoded to improve encoding efficiency.

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

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

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

[0387] The encoding of the intra prediction mode may be performed based on the MPM list described above. Specifically, when encoding a neighboring block in the wide-angle intra prediction mode, the MPM may be set based on the wide-angle alternative intra prediction mode corresponding to the wide-angle intra prediction mode.

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

[0389] DCT is to decompose (or transform) the residual image into two-dimensional frequency components by using cosine transform, while DST is to synthesize (or transform) the residual image into two-dimensional frequency components by using sine transform. As a result of transforming the residual image, the frequency components can be represented as a basic image. In the example, when DCT transform is performed on a block of size N×N, N 2 The size of each basic mode component included in the N×N size block can be obtained by transformation. The size of the basic mode component can be called a DCT coefficient or a DST coefficient according to the transformation method used.

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

[0391] The residual image may also be transformed by using a transform method other than DCT or DST.

[0392] Hereinafter, transforming the residual image into two-dimensional frequency components is referred to as two-dimensional image transform. In addition, the size of the basic mode component obtained by the transform is referred to as a transform coefficient. In an example, the transform coefficient may represent a DCT coefficient or a DST coefficient. When both the first transform and the second transform described below are applied, the transform coefficient may represent the basic mode component generated by the result of the second transform. In addition, the residual sample points skipped by applying the transform are also referred to as transform coefficients.

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

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

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

[0396] Optionally, when the sub-partition intra encoding method is applied to the current block, whether to apply transform skip may be determined for each sub-block.

[0397] Fig.29 is a diagram illustrating an example of determining whether to perform transform skipping per subblock.

[0398] Transform skipping may be applied to only a portion of the plurality of sub-blocks. Fig.29 In the example shown in , it can be set to skip applying the transform to the sub-block at the upper position of the current block and not skip applying the transform to the sub-block at the lower position.

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

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

[0401] After the current block is transformed by using DCT or DST, the transformed current block can be transformed again. In this regard, the transformation based on DCT or DST can be defined as a first transformation, and the transformation performed on the block using the first transformation again can be defined as a second transformation.

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

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

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

[0405] The transform coefficients in the remaining region where the second transform is not performed may also be set to zero.

[0406] Alternatively, the first transform may be performed on the 4×4 block, and the second transform may be performed on a region having a size of 8×8 including the transformed 4×4 block.

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

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

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

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

[0411] 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. In an example, when 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 when 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. In this case, the threshold may be predefined in the encoding device and the decoding device. Alternatively, the threshold may be determined based on the size or shape of the current block.

[0412] Optionally, when there is only a transform coefficient of a DC component in the current block, it may be set not to perform the second transform. In this case, the DC component represents the transform coefficient of the upper left position in the current block.

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

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

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

[0416] [Table 7]

[0417]

[0418] The transform type may be determined as one of DCT2, DST7, or DCT 8. Optionally, transform skip may be inserted into the transform type candidate.

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

[0420] When the sub-partition intra coding method is applied, the transform kernel of the sub-block can be determined independently. In an example, information for specifying the transform type combination candidate can be encoded and signaled per sub-block. Therefore, the transform kernel between sub-blocks can be different.

[0421] Optionally, the subblocks may use the same transform type. In this case, tu_mts_idx specifying the transform type combination candidate may be signaled only for the first subblock. Optionally, tu_mts_idx may be signaled at a coding block level, and the transform type of the subblock may be determined by referring to the tu_mts_idx signaled at the coding block level. Optionally, the transform type may be determined based on at least one of a size, a shape, or an intra prediction mode of one of the subblocks, and the determined transform type may be set for all subblocks.

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

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

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

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

[0426] 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 by considering at least one of the size, shape, or intra-frame prediction mode of the current block, whether the second transform is performed, or whether the sub-partition intra-frame coding method is applied. In an example, one of the multiple transform types may be determined as a horizontal transform type based on whether the width of the current block is within a preset range, and one of the multiple transform types may be determined as a vertical transform type based on whether the height of the current block is within a preset range. Optionally, the default mode may be determined differently according to the size, shape, or intra-frame prediction mode of the current block or whether the second transform is performed.

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

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

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

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

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

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

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

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

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

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

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

[0438] When explicit transform type determination is allowed, the transform type of the current block may be determined based on the index information tu_mts_idx signaled in the bitstream. On the other hand, when explicit transform type determination is not allowed, the transform type may be determined based on at least one of the size or shape of the current block, whether transform is allowed to be performed in units of subblocks, the position of the subblock including the non-zero transform coefficient, whether the second transform is performed, or whether the sub-partition intra coding method is applied. In 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, when the width of the current block is less than 4 or greater than 16, the horizontal transform type may be determined as DCT2. Otherwise, the horizontal transform type may be determined as DST7. When the height of the current block is less than 4 or greater than 16, the vertical transform type may be determined as DCT2. Otherwise, the vertical transform type may be determined as DST7. In this case, a threshold to be compared with the width and height may be determined based on at least one of the size, shape, or intra prediction mode of the current block to determine the horizontal transform type and the vertical transform type.

[0439] Alternatively, when the current block has a square shape with the same height and width, the horizontal direction transform type and the vertical direction transform type may be set to be the same, but when the current block has a non-square shape with a height and a width different from each other, the horizontal direction transform type and the vertical direction transform type may be set to be different. In the example, when the width of the current block is greater than the height, the horizontal direction transform type may be determined as DST7, and the vertical direction transform type may be determined as DCT2. When the height of the current block is greater than the width, the vertical direction transform type may be determined as DST7, and the horizontal direction transform type may be determined as DCT2.

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

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

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

[0443] When obtaining a reconstructed block of the current block, information loss occurring in the quantization and encoding process can be reduced via 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 in-loop filter (ALF). Hereinafter, the reconstructed block before applying the in-loop filter is referred to as a first reconstructed block, and the reconstructed block after applying the in-loop filter is referred to as a second reconstructed block.

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

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

[0446] Fig.31 is a flow chart illustrating a process for determining block strength.

[0447] exist Fig.31 In the example shown, P represents the first reconstructed block, and Q represents the adjacent reconstructed block. In this regard, the adjacent reconstructed block may be adjacent to the left or above the current block.

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

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

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

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

[0452] [Equation 8]

[0453]

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

[0455] Fig.32 Represents a predefined filter candidate.

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

[0457] Only diamond shapes of 5×5 size are available for chroma components.

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

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

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

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

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

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

[0464] First, it may be determined whether the current picture is partitioned into a plurality of processing units (S3310). In this regard, the processing unit may include at least one of a parallel block or a slice. In an example, a syntax no_pic_partition_flag indicating whether the current picture is partitioned into a plurality of parallel blocks or slices may be signaled in a bitstream. If the value of the syntax no_pic_partition_flag is 0, it indicates that the current picture is partitioned into at least one parallel block or at least one slice. On the other hand, if the value of the syntax no_pic_partition_flag is 1, it indicates that the current picture is not partitioned into a plurality of parallel blocks or slices.

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

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

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

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

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

[0470] Fig.34 This shows an example where a screen is partitioned into multiple parallel blocks.

[0471] A tile may include at least one coding tree unit. The boundary of the tile may be set to match the boundary of the coding tree unit. In other words, a partition type that partitions a coding tree unit into multiple coding tree units may not be allowed.

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

[0473] In the example, as in Fig.34 In the example shown, the height of the parallel blocks belonging to the same parallel block row and / or the width of the parallel blocks belonging to the same parallel block column can be set to be the same. The parallel blocks belonging to the same parallel block row can be referred to as a horizontal parallel block set, and the parallel blocks belonging to the same parallel block column can be referred to as a vertical parallel block set.

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

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

[0476] The information indicating the partition shape of the picture may include at least one of information indicating whether the parallel blocks are partitioned in a uniform size, information indicating the number of parallel block columns, or information indicating the number of parallel block rows. In this case, the number of parallel block columns indicates the number of parallel block sets in the vertical direction, and the number of parallel block rows indicates the number of parallel block sets in the horizontal direction.

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

[0478] When it is determined that the tile is partitioned in a uniform size, a syntax tile_cols_width_minus1 indicating the width of the tile and a syntax tile_rows_height_minus1 indicating the height of the tile may be signaled.

[0479] The syntax tile_cols_width_minus1 indicates a value obtained by subtracting 1 from the number of coding tree unit columns included in a tile of uniform size. The syntax tile_rows_height_minus1 indicates a value obtained by subtracting 1 from the number of coding tree unit rows included in a tile of uniform size.

[0480] The last parallel block column may have a width value specified by the syntax tile_cols_width_minus1 or a value less than it. In addition, the last parallel block row may have a height value specified by the syntax tile_rows_height_minus1 or a value less than it. In the example, when the index of the last parallel block column is m, the value of the sum of the widths of the 0th to (m-1)th parallel block columns subtracted from the width of the current picture may be set to the width of the last parallel block column. In the example, when the index of the last parallel block row is n, the value of the height of the 0th to (n-1)th parallel block rows subtracted from the height of the current picture may be set to the height of the last parallel block row. In other words, the width of the parallel block located on the right boundary of the current picture and / or the height of the parallel block located on the lower boundary of the current picture may be less than or equal to the width and / or height of other parallel blocks, respectively.

[0481] When a picture is partitioned by using at least one of a vertical line or a horizontal line across the picture, each parallel block belongs to a different column and / or row. In order to determine the partition shape of the picture, information indicating the number of parallel block columns and / or parallel block rows may be sent by a signal. In an example, information num_tile_row_minus1 indicating the number of parallel block rows and information num_tile_column_minus1 indicating the number of parallel block columns generated by partitioning the picture may be sent by a signal in a bitstream. The syntax num_tile_row_minus1 indicates a value minus 1 from the number of parallel block rows, and the syntax num_tile_column_minus1 indicates a value minus 1 from the number of parallel block columns.

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

[0483] When the value of the syntax uniform_tile_spacing_flag is 0, the syntax num_tile_column_minus1 indicating the number of parallel block columns and / or the syntax num_tile_rows_minus1 indicating the number of parallel block rows may be signaled. In other words, when it is determined that the current picture is not partitioned into parallel blocks of uniform height and width, the syntax num_tile_column_minus1 indicating the number of parallel block columns and / or the syntax num_tile_rows_minus1 indicating the number of parallel block rows may be signaled.

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

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

[0486] The syntax tile_rows_height_minus1[j] represents a value minus 1 from the number of coding tree unit rows constituting the jth tile row. For the last tile row, the signaling syntax tile_rows_height_minus1[j] may be omitted. The height of the last tile row may be derived by subtracting the height of the previous tile row from the height of the current picture.

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

[0488] A tile may be configured with at least one coding tree unit. The remaining tiles except for the tile adjacent to the right boundary or the lower boundary of the picture may be set not to be configured by including an area smaller than the coding tree unit. In other words, the boundary of the tile matches the boundary of the coding tree unit.

[0489] According to the partition shape of the picture, the tile may have the same size in all regions except the picture boundary. Alternatively, the heights of horizontally adjacent tiles may be set to be the same, or the widths of vertically adjacent tiles may be set to be the same.

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

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

[0492] [Table 8]

[0493]

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

[0495] When the sizes of consecutive tile columns are the same, width information may be signaled only for one of the consecutive tile columns, and encoding / decoding of the width information may be omitted for the remaining tile columns.

[0496] In an example, when the widths of the i-th to last tile columns in a picture are the same as each other, the syntax tile_width_minus1[i] may be signaled only for the i-th tile column, and the width of each remaining tile column may be set to be the same as the width of the i-th tile column.

[0497] Information indicating whether the widths of multiple consecutive parallel block columns are the same can be encoded and sent with a signal. In the example, the syntax rem_tile_col_equal_flag[i] indicates whether the widths from the parallel block column indexed as i to the parallel block column indexed as N-1 are the same as each other. In this case, N can represent the number of parallel block columns. In other words, the parallel block column indexed as N-1 can represent the last parallel block column in the picture.

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

[0499] When encoding / decoding of the syntax representing the width of a parallel block column is omitted, the minimum value of the width of the i-th parallel block column and the width of the remaining area can be set as the width of the subsequent parallel block column. In the example, when the width of the i-th parallel block 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 the parallel block column with an index greater than i can be set to the smaller value of the variable PrevTileColWidth and the variable RemainingColWidth.

[0500] In another example, the syntax rem_tile_col_equal_flag[i] may be set to indicate whether the widths of a tile column with an index of 0 to a tile column with an index of i are the same as each other.

[0501] When the sizes of consecutive parallel block lines are the same, height information may be signaled only for one of the consecutive parallel block lines, and encoding / decoding of the height information may be omitted for the remaining parallel block lines.

[0502] In an example, when the heights from the i-th tile line to the last tile line in the picture are the same as each other, the syntax tile_height_minus1[i] may be signaled only for the i-th tile line, and the remaining tile lines may be set to the same height as the i-th tile line.

[0503] Information indicating whether the heights of multiple consecutive parallel block rows are the same can be encoded and sent with a signal. In an example, the syntax rem_tile_row_equal_flag[i] indicates whether the heights from the parallel block row indexed as i to the parallel block row indexed as N-1 are the same as each other. In this case, N can represent the number of parallel block rows. In other words, the parallel block row indexed as N-1 can represent the last parallel block row in the picture.

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

[0505] When encoding / decoding of the syntax representing 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 may be set as the height of the subsequent tile row. In the example, when 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 the tile row with an index greater than i may be set to the smaller value of the variable PrevTileRowHeight and the variable RemainingRowHeight.

[0506] In another example, the syntax rem_tile_row_equal_flag[i] may be set to indicate whether the heights from a tile row with an index of 0 to a tile row with an index of i are the same as each other.

[0507] Table 9 shows a syntax structure including the syntax rem_tile_col_equal_flag[i] and the syntax rem_tile_row_equal_flag[i].

[0508] [Table 9]

[0509]

[0510]

[0511] Information for specifying the number of parallel block columns whose width is explicitly signaled in the current picture may be signaled in the bitstream. In an example, the syntax num_exp_tile_columns_minus1 for determining the number of parallel block columns whose width is signaled may be signaled in the bitstream. The syntax num_exp_tile_columns_minus1 may be a value minus 1 from the number of parallel block columns whose width is signaled.

[0512] As many syntaxes for specifying the width of a tile column as the number determined based on the syntax num_exp_tile_columns_minus1 may be encoded and signaled. In an example, the syntax tile_width_minus1[i] indicating the width of the i-th tile column may be signaled in the bitstream. The syntax tile_width_minus1[i] may represent a value minus 1 from the number of coding tree unit columns included in a tile row.

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

[0514] On the other hand, when the index j of the parallel block column is equal to or greater than the number of parallel block columns whose widths are explicitly signaled, the width of the corresponding parallel block column may be determined based on the syntax tile_width_minus1[1] that was last signaled. In this case, l may represent the index of the parallel block column whose width was last signaled, and may be an integer less than j. In an example, when the value of the width of the previous parallel block column subtracted from the width of the current picture is equal to or greater than the value of the syntax tile_width_minus1[1] plus 1, the width of the parallel block column j may be set to the value of the syntax tile_width_minus1[1] plus 1. On the other hand, when the value of the width of the previous parallel block column subtracted from the width of the current picture is less than the value of the syntax tile_width_minus1[1] plus 1, the difference value of the width of the previous parallel block column subtracted from the width of the current picture may be set as the width of the parallel block column j.

[0515] Table 10 shows the process of determining the width of a tile column.

[0516] [Table 10]

[0517]

[0518]

[0519] In Table 10, the variable PicWidthInCtbsY represents the number of coding tree unit columns included in the current picture. In an example, the variable PicWidthInCtbsY may be derived as in Equation 9 below.

[0520] [Equation 9]

[0521] PicWidthInCtbsY=Ceil(pic_width_in_luma_samples / CtbSizeY)

[0522] The variable remingWidthinCtbsy represents the value of the cumulative width of the parallel block column subtracted from the variable PicWidthInCtbsY. In the example, for the parallel block column indexed i, remingWidthinCtbsy can be derived by subtracting the sum of the widths of the parallel block columns from 0th to (i-1)th from PicWidthInCtbsY.

[0523] As shown in the example of Table 10, the variable uniformTileColWidth may be derived by adding 1 to tile_column_width_minus1[num_exp_tile_columns_minus1], where uniformTileColWidth is the width of the tile column that is last explicitly signaled. In this case, when 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 partitioned at the size of the variable uniformTileColWidth.

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

[0525] On the other hand, when the index j of a tile column is equal to or greater than the number of tile columns whose widths are explicitly signaled, the width of the corresponding tile column may be set to the smaller value of the variables uniformTileColWidth and remainingWidthInCtbY.

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

[0527] Information for specifying the number of tile columns whose width is explicitly signaled in the current picture may be signaled in the bitstream. In an example, the syntax num_exp_tile_columns_minus1 for determining the number of tile columns whose width is signaled may be signaled in the bitstream. The syntax num_exp_tile_columns_minus1 may be a value minus 1 from the number of tile columns whose width is signaled.

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

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

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

[0531] In an example, when the value obtained by subtracting the height of the previous tile row from the height of the current picture is equal to or greater than the value obtained by adding the syntax tile_height_minus1[1] to 1, the height of the tile row j may be set to the value obtained by adding the syntax tile_height_minus1[1] to 1. On the other hand, when the value obtained by subtracting the height of the previous tile row from the height of the current picture is less than the value obtained by adding 1 to the syntax tile_height_minus1[1], the difference 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 the tile row j.

[0532] Table 11 shows the process of determining the height of a tile row.

[0533] [Table 11]

[0534]

[0535]

[0536] In Table 11, the variable PicHeightInCtbsY represents the number of coding tree unit rows included in the current picture. In an example, the variable PicWidthInCtbsY may be derived as in Equation 10 below.

[0537] [Equation 10]

[0538] PicHeightInCtbsY=Ceil(pic_height_in_luma_samples / CtbSizeY)

[0539] The variable remingHeightInCtbsY represents the value of the cumulative height of the tile row subtracted from the variable PicHeightInCtbsY. In the example, for a tile row indexed i, remainingHeightInCtbsY can be derived by subtracting the sum of the heights of the 0th to (i-1)th tile rows from PicHeightInCtbsY.

[0540] As shown in the example of Table 10, the variable uniformTileRowHeight may be derived by adding tile_row_height_minus1[num_exp_tile_rows_minus1] to 1, where uniformTileRowHeight is the height of the tile row that is last explicitly signaled. In this case, when 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 partitioned by the size of the variable uniformTileRowHeight.

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

[0542] On the other hand, when the index j of a tile row is equal to or greater than the number of tile rows whose heights are explicitly signaled, the height of the corresponding tile row may be set to the smaller value of the variables uniformTileRowHeight and remainingHeightInCtbY.

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

[0544] Table 12 shows a syntax table including a syntax indicating the number of tile columns where the width is explicitly signaled and a syntax indicating the number of tile rows where the height is explicitly signaled.

[0545] [Table 12]

[0546]

[0547] In addition, the syntax loop_filter_across_tiles_enabled_flag indicates whether it is allowed to apply an in-loop filter on the boundary of a tile in a picture of a reference picture parameter set. In this case, the in-loop filter may include at least one of a deblocking filter, an ALF, or a SAO. When the value of the flag loop_filter_across_tiles_enabled_flag is 1, it indicates that an in-loop filter across the boundary of a tile in a picture of a reference picture parameter set can be applied. On the other hand, when the value of the flag loop_filter_across_tiles_enabled_flag is 0, it indicates that it is not allowed to apply an in-loop filter on the boundary of a tile in a picture of a reference picture parameter set.

[0548] The syntax loop_filter_across_slices_enabled_flag indicates whether it is allowed to apply the in-loop filter on the boundary of the slice in the picture of the reference picture parameter set. In this case, the in-loop filter may include at least one of a deblocking filter, an ALF, or a SAO. When the value of the flag loop_filter_across_slices_enabled_flag is 1, it indicates that the in-loop filter across the boundary of the slice in the picture of the reference picture parameter set can be applied. On the other hand, when the value of the flag loop_filter_across_slices_enabled_flag is 0, it indicates that the in-loop filter is not allowed to be applied on the boundary of the slice in the picture of the reference picture parameter set.

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

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

[0551] Fig.35 It is a diagram for explaining the generation aspect of the blocks.

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

[0553] When it is assumed that raster scanning is applied to a parallel block, raster scanning may be applied between partitions. In an example, after scanning all partitions included in a particular parallel block, a subsequent parallel block may be scanned. In other words, a partition may have the same state as a parallel block.

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

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

[0556] [Table 13]

[0557]

[0558]

[0559]

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

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

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

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

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

[0565] When a parallel block is partitioned into multiple partitions, information for determining the partitioning of the parallel block can be signaled in the bitstream. In an example, the syntax uniform_brick_spacing_flag can be signaled in the bitstream. When the syntax uniform_brick_spacing_flag is 1, it indicates that the height of the partitions in the parallel block is uniform. When the value of uniform_brick_spacing_flag is 1, the syntax brick_height_minus1 indicating the basic height of the partition can be signaled. The syntax brick_height_minus1 represents the value obtained by subtracting 1 from the number of coding tree units constituting the partition.

[0566] The remaining tiles except the last tile in the tile may have a base height determined by the syntax brick_height_minus1. The last tile in the tile may be set as an area except other tiles.

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

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

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

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

[0571] Alternatively, the partitioning aspect of the parallel blocks may be determined by using information specifying the number of blocks whose height is explicitly signaled. In an example, the syntax num_exp_brick_minus1 for determining the number of blocks whose height is explicitly signaled may be signaled in the bitstream. The syntax num_exp_brick_minus1 may have a value of the number of blocks whose height is explicitly signaled minus 1.

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

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

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

[0575] In the later-mentioned embodiments, the term "parallel block" may include a plurality of parallel blocks generated by partitioning a parallel block (ie, sub-parallel blocks or blocks) as well as the parallel block.

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

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

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

[0579] Information indicating a slice type may be signaled via a bitstream. This information indicates a definition method of a slice in a current picture. In an example, a syntax rect_slice_flag indicating a slice type may be signaled in a bitstream.

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

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

[0582] The definition method based on raster scanning specifies at least one or more parallel blocks according to a raster scanning order, and defines at least one or more specified parallel blocks as strips. When the definition method based on raster scanning is followed, one or more continuous parallel blocks may be defined as strips. In this case, continuous parallel blocks may be determined according to a raster scanning order. When raster scanning strips are applied, non-rectangular strips may be generated.

[0583] Fig.36 and Fig.37 is a diagram showing an example of defining stripes based on a raster order.

[0584] In the example, Fig.36In the example shown, when it is assumed that the first stripe (stripe 0) includes 3 tiles, the first stripe (stripe 0) may be defined to include tiles 0 to 2 according to the raster scan order. When it is assumed that the second stripe (stripe 1) includes 6 tiles, the second stripe (stripe 1) may be defined to include tiles 3 to 8 according to the raster scan order. According to the raster scan order, the last stripe (stripe 2) may include residual tiles (tiles 9 to 11).

[0585] When slices are defined based on a raster scan order, information indicating the number of tiles included by each slice may be signaled.Signaling of information indicating the number of tiles included by the slice may be omitted for the last slice.

[0586] When a stripe includes a plurality of tiles, the widths or heights of the tiles included in the stripe may be different. In the example, it is shown that the height of tile 3 among the tiles included in the second tile (tile 1) is different from that of the other tiles.

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

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

[0589] As in Fig.38 In the example shown, the fourth stripe (stripe 3) includes tile 5, tile 6, tile 9, and tile 10. As in the example shown, when a stripe includes a plurality of tiles, a rectangle having an upper left tile and a lower right tile as its two vertices may be defined as one stripe.

[0590] The border of the strip may match the border of the picture and / or the border of the tile. In an example, the left border or the top border of the strip may be set as the border of the picture, or the left border or the top border of the strip may be set as the border of the tile.

[0591] Optionally, when the method of defining rectangular strips is applied, one parallel block may be partitioned into a plurality of rectangular strips.

[0592] When a method of defining a rectangular slice is applied (for example, when rect_slice_flag is 1), information indicating whether a picture is configured with a single slice may be signaled. In an example, a syntax one_slice_in_pic_flag indicating whether the number of slices in a picture is 1 may be signaled in a bitstream. When the flag one_slice_in_pic_flag is 1, it indicates that the picture is configured with a single slice. On the other hand, when the flag one_slice_in_pic_flag is 0, it indicates that the picture is configured with at least 2 or more slices. When the value of the flag one_slice_in_pic_flag is 0, configuration information of the slice may be additionally signaled. In an example, Table 14 shows a syntax table including the syntax one_slice_in_pic_flag.

[0593] [Table 14]

[0594]

[0595]

[0596]

[0597] As shown in the figure, when one_slice_in_pic_flag is 1, encoding of information related to the configuration of a slice to be described later (for example, syntax top_left_brick_idx[i] indicating the index of a tile included in a slice, and / or syntax bottom_right_bric_idx_delta[i] indicating the index difference between a tile included in a first slice and a tile included in a second slice, etc.) can be omitted. In other words, one_slice_in_pic_flag can be used to determine whether information related to the configuration of a slice is encoded.

[0598] A picture may represent a sub-picture. A picture may be partitioned into at least one sub-picture. Information related to sub-picture partitioning may be signaled at a sequence level. In an example, information related to sub-picture partitioning signaled by a sequence parameter set may be commonly applied to all pictures that reference the sequence parameter set.

[0599] The information related to the sub-picture partition may include information indicating whether a picture is partitioned into a plurality of sub-pictures, information indicating the number of sub-pictures, information indicating the size of a sub-picture, or information indicating whether a sub-picture is regarded as an independent picture.

[0600] The syntax one_slice_in_pic_flag indicating whether it is configured with a single slice may be signaled per sub-picture.

[0601] Alternatively, the syntax one_slice_in_pic_flag indicating whether each sub-picture is configured with a single slice may be signaled at the sequence level or the picture level. In the example, when the flag one_slice_in_pic_flag is 1, it indicates that all sub-pictures in the current picture are configured with a single slice. On the other hand, when the flag one_slice_in_pic_flag is 0, it indicates that at least one sub-picture in the current picture is configured with multiple slices.

[0602] When it is determined that a picture is configured with a plurality of slices, a syntax indicating the number of slices in the picture may be encoded and signaled. In an example, a syntax num_slices_in_pic_minus2 indicating the number of slices in the picture may be signaled in a bitstream. The syntax num_slices_in_pic_minus2 may indicate a value of 2 subtracted from the number of slices in the picture. Therefore, the decoder may determine the total number of slices by adding 2 to the value indicated by the syntax num_slices_in_pic_minus2.

[0603] The syntax num_slices_in_pic_minus1 indicating a value minus 1 from the number of slices in a picture may be encoded instead of the syntax num_slices_in_pic_minus2.

[0604] When the method for defining a rectangular strip is applied, information for identifying the parallel blocks included in each strip may be sent with a signal to determine the parallel blocks included in each strip. The information may be used to specify at least one of the first parallel block or the last parallel block of the strip. The order between the parallel blocks may be determined according to a predetermined scanning order. In an example, when a raster scanning order is applied, the first parallel block indicates a parallel block at the upper left position of the strip, and the last parallel block indicates a parallel block at the lower right position of the strip.

[0605] Information for identifying at least one of an index of a tile at an upper left position of a slice or an index of a tile at a lower right position of a slice may be signaled in a bitstream. In an example, at least one of a syntax of top_left_tile_idx for identifying an index of a tile at an upper left position of a slice or a syntax of bottom_right_tile_idx for identifying an index of a tile at a lower right position of a slice may be signaled in a bitstream. Encoding of at least one of a syntax for identifying an index of a tile at an upper left position of a slice or a syntax for identifying an index of a tile at a lower right position of a slice may be omitted for the last slice. The remaining area in the current picture except for the area occupied by the previous slice may be set as the last slice.

[0606] In the example, Fig.38 In the example shown, the index top_left_tile_idx indicating the tile at the upper left position of the slice, and the index bottom_right_tile_idx indicating the tile at the lower right position of the slice may be signaled for each of slices 0, 1, and 2. On the other hand, for the last slice (slice 3) in the picture, encoding of top_left_tile_idx and bottom_right_tile_idx may be omitted. The index of the upper left tile of the last slice (slice 3) in the picture may be set to the index of the tile at the upper left position in the remaining area of ​​the picture except slices 0, 1, and 2, and the index of the lower right tile of slice 3 may be set to the index of the tile at the lower right position in the remaining area (or the tile at the lower right position of the picture).

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

[0608] Optionally, at least one of the horizontal parallel block index difference information or the vertical parallel block index difference information may be encoded and signaled. The horizontal parallel block index difference information may indicate a difference between an index of the first parallel block and an index of a rightmost parallel block included in the same parallel block row as the first parallel block. The vertical parallel block index difference information may indicate a difference between an index of the first parallel block and an index of a bottommost parallel block included in the same parallel block column as the first parallel block.

[0609] According to the position of the slice, the type of difference information to be encoded can be determined. In an example, for a slice adjacent to the right boundary or the lower boundary of the picture, horizontal parallel block index difference information or vertical parallel block index difference information can be encoded and sent with a signal. The amount of bits can be reduced by encoding the horizontal parallel block index difference information or the vertical parallel block index difference information instead of the information indicating the index difference between the upper left parallel block and the upper right parallel block.

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

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

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

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

[0614] The tile for deriving difference information between the first slice and the second slice may be located at the upper left, upper right, lower right, lower left, or center of the slice.

[0615] Table 15 shows a syntax table including difference information.

[0616] [Table 15]

[0617]

[0618]

[0619]

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

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

[0622] [Equation 11]

[0623] TopLeftBrickIdx[i]=TopLeftBrickIdx[i-1]+top_left_brigk_idx_delta[i]

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

[0625] Coding of the syntax top_left_brick_idx_delta[i] indicating difference information from the previous slice may be omitted for the first slice (ie, a slice with index i being 0). 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 may be encoded and signaled for the first slice.

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

[0627] [Table 16]

[0628]

[0629] NumBricksInSlice[i] indicates the number of parallel blocks included in slice i. TopLeftBrickIdx[i] indicates the index of the top left parallel block of slice i. BotRightBkIdx indicates the index of the top right parallel block. BrickColBd[j] indicates the index of the parallel block column to which parallel block j belongs. BrickRowBd[j] indicates the index of the parallel block row to which parallel block j belongs. BricksToSliceMap[j]=i indicates adding parallel block j to slice i.

[0630] 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 in the bitstream instead of the syntax top_left_brick_idx_delta[i]. 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.

[0631] The bottom_right_brick_idx_delta[0] of the first slice may be set to be the same as the index of the bottom right tile of the first slice. In other words, the index of the bottom right tile of the first slice may be set to be the same as the syntax bottom_right_brick_idx_delta[0].

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

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

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

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

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

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

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

[0639] The stripes can be determined by using the syntax table as shown in Table 17 below.

[0640] [Table 17]

[0641]

[0642]

[0643] When the flag rect_slice_flag indicating the slice type is encoded and the value of the flag rect_slice_flag is 1, syntax num_slices_in_pic_minus1 indicating the number of slices in the picture may be encoded.

[0644] When it is determined that a picture includes a plurality of slices, a syntax slice_width_in_tiles_minus1[i] indicating a width of each slice and a syntax slice_height_in_tiles_minus1[i] indicating a height of each slice may be encoded and signaled.

[0645] In addition, a syntax tile_idx_delta[i] representing a difference between an index of a tile included in an i-th slice and an index of a tile included in an (i+1)-th slice may be signaled. Encoding of the syntax tile_idx_delta[i] may be omitted for the last tile.

[0646] The syntax derived by subtracting an offset from the difference in tile index between two slices may be encoded. The offset may be a natural number such as 1 or 2. In an example, the syntax tile_idx_delta_minus1[i] may be signaled in the 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].

[0647] When the current picture includes multiple slices, the difference information of the tile index may be encoded / decoded. In other words, when the current picture is configured with a single slice, the signaling of the syntax tile_idx_delta[i] indicating the difference between the tile indexes may be omitted. For example, when the flag one_slice_in_pic_flag indicating whether the current picture is configured with a single slice is 1, the signaling of the syntax tile_idx_delta[i] may be omitted.

[0648] Optionally, the encoder may determine whether to encode the syntax tile_idx_delta[i] indicating the difference between the tile indexes, and encode the flag tile_idx_delta_present_flag indicating whether the syntax tile_idx_delta[i] is encoded according to the determination. When the value of the flag tile_idx_delta_present_flag is 0, it 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.

[0649] A tile may be partitioned into a plurality of stripes. In an example, a plurality of stripes may be generated by partitioning the tile in a horizontal direction.

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

[0651] When both the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] are 0, information indicating whether a tile is partitioned into a plurality of tiles may be signaled.

[0652] In an example, a syntax num_slices_in_tile_minus1[i] indicating the number of tiles included by a tile may be signaled. The syntax num_slices_in_tile_minus1[i] indicates a value obtained by subtracting 1 from the number of tiles included by an i-th tile.

[0653] When a parallel block including an i-th slice is configured with a plurality of slices, a syntax indicating the height of each slice in the parallel block may be encoded. In an example, a syntax slice_height_in_ctu_minus1[i][j] indicating the height of the j-th slice (i.e., the (i+j)-th slice) in the parallel block including the 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 parallel block including the i-th slice. Table 18 shows a syntax structure including the syntax slice_height_in_ctu_minus1[i][j] indicating the height of the slice.

[0654] [Table 18]

[0655]

[0656]

[0657] Based on the height of the parallel block, it can be determined whether to encode / decode the syntax representing the height of the stripe. In the example, when the parallel block including the i-th stripe is configured with a single coding tree unit row, or when the parallel block including the i-th stripe is configured with two coding tree unit rows, the encoding / decoding of the syntax slice_height_in_ctu_minus1[i][j] representing the height of the stripe can be omitted. The height of the syntax slice_height_in_ctu_minus1[i][j] can be adaptively determined according to the number of stripes in the parallel block. In the example, when the number of stripes in the parallel block is 1, the height of the stripe can be set to the same as the height of the parallel block. Alternatively, when the number of stripes in the parallel block is 2 and the height of the parallel block is 2, the height of each stripe can be set to 1. In Table 18, the variable TileIdx[i] indicates the index of the parallel block including the i-th stripe, and the variable NumTileColumn indicates the number of parallel block columns. TileIdx[i] / NumTileColumn returns the row including the tile including the i-th stripe. The variable RowHeight[TileIdx[i] / NumTileColumn] represents the height of the tile including the i-th stripe.

[0658] In another example, syntax num_exp_slices_in_tile[i] representing information about the number of slice heights that should be explicitly signaled may be signaled in a bitstream. The syntax num_exp_slices_in_tile[i] may have a value that is the same as or smaller than the number of slices included in a tile.

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

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

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

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

[0663] In other words, the heights of the remaining slices except for the slices whose heights are explicitly signaled may have values ​​less than or equal to the height of the last slice among the slices whose heights are explicitly signaled.

[0664] In the above example, it is shown that only when the method of defining a rectangular slice is applied, it is determined whether to encode the syntax one_slice_in_pic_flag indicating whether the picture is configured with a single slice. Contrary to the example, after encoding the syntax one_slice_in_pic_flag, it may be determined whether to encode the syntax rect_slice_flag. In the example, when the value of one_slice_in_pic_flag is 1, the encoding of rect_slice_flag may be omitted.

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

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

[0667] In an example, encoding of the syntax slice_width_in_tiles_minus1 indicating the width of a slice may be omitted, and the distance from a tile at a predetermined position in an adjacent slice may be set to the width of the slice. Specifically, the top left tile of the (i+1)th slice adjacent to the right side of the i-th slice may be specified by the syntax top_left_brick_idx_delta[i]. The width of the i-th slice may be derived by 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 point) and the x coordinate of the top left tile in the (i+1)th slice (e.g., the x coordinate of the top left sample point).

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

[0669] Optionally, when a slice is defined in a rectangular shape, information indicating whether difference information is used may be signaled in the bitstream. In an example, tile_idx_delta_present_flag indicating whether difference information is used may be signaled in the bitstream. When the value of the syntax tile_idx_delta_present_flag is 1, it indicates that the syntax indicating the difference of the parallel block index is encoded and signaled. In 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 difference information (e.g., top_left_brick_idx_delta[i-1] or bottom_right_brick_idx_delta[i]) for determining the position of the top left parallel block or the position of the top right parallel block in the slice.

[0670] 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, the slice adjacent to the left border of the current picture and the slice adjacent to the right side of the slice may have the same height. Therefore, information indicating the height of the slice may be signaled only for the slice adjacent to the left border of the current picture, and signaling of information indicating the height of the slice may be omitted for the slice not adjacent to the left border of the current picture.

[0671] When the number of slices included in the current picture is equal to or greater than a threshold value, the syntax tile_idx_delta_present_flag indicating whether information indicating the difference between parallel block indices is encoded may be encoded / decoded. In this case, the threshold value may be set to an integer such as 0, 1, or 2. In the example, the syntax tile_idx_delta_present_flag may be encoded / decoded only when the number of slices included in the current image is equal to or greater than 1 or 2. When the number of slices included in the current picture is less than the threshold value, the encoding / decoding of tile_idx_delta_present_flag may be omitted, and its value may be inferred to be 0. Table 19 shows the syntax structure of the encoding / decoding condition for adding the syntax tile_idx_delta_present_flag.

[0672] [Table 19]

[0673]

[0674]

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

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

[0677] Applying the embodiments described with respect to the decoding process or the encoding process to the encoding process or the decoding process, respectively, may be included within the scope of the present disclosure. Within the scope of the present disclosure, embodiments in which operations occur in a predetermined order may be modified to embodiments in which operations occur in an order different from the predetermined order.

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

[0679] Industrial availability

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

Claims

1. A method for decoding a video, the method comprising: Partition the current screen into multiple parallel block columns; Partition the current screen into multiple parallel block rows; decoding the stripe type information indicating whether the rectangular stripe partitioning method is applied; as well as decoding slice number information indicating the number of slices in the current picture, Wherein, when the slice type information indicates that the rectangular slice partitioning method is applied, the slice number information is decoded from the bit stream, Wherein, when the slice type information indicates that a rectangular slice partitioning method is applied, each of the slices in the current picture has a rectangular shape and includes at least one tile or a portion of a tile, wherein, when the slice type information indicates that a rectangular slice partitioning method is applied, tile index difference information specifying an index difference between an upper left tile included in the first slice and an upper left tile of the second slice is decoded from a bitstream, and The index of the upper left tile of the second slice is derived by adding the index difference specified by the tile index difference information to the index of the upper left tile of the first slice.

2. The method of claim 1, wherein: The method further comprises: decoding a difference information existence flag indicating whether the tile index difference information exists in a bit stream, and Among them, only when the number of slices included in the current picture is equal to or greater than a threshold, the difference information existence flag is decoded from the bit stream.

3. The method of claim 2, wherein: When the number of slices included in the current picture is equal to or smaller than the threshold value, decoding of the difference information existence flag is omitted and the value of the difference information existence flag is inferred to be 0.

4. A method for encoding a video, the method comprising: Partition the current screen into multiple parallel block columns; Partition the current screen into multiple parallel block rows; Determine whether to apply the rectangular strip partitioning method; encoding stripe type information indicating whether a rectangular stripe partitioning method is applied; as well as Encode the number of stripes information, When the rectangular stripe partitioning method is applied, the stripe number information is encoded into the bit stream. Wherein, when the rectangular strip partitioning method is applied, each of the strips in the current picture has a rectangular shape and includes at least one tile or a portion of a tile, Wherein, when the rectangular slice partitioning method is applied, tile index difference information specifying an index difference between an upper left tile included in a first slice and an upper left tile of a second slice is encoded into a bitstream, and The value of the tile index difference information is derived by subtracting the index of the upper left tile of the first stripe from the index of the upper left tile of the second stripe.

5. A device for sending compressed video data, the device comprising: a processor configured to obtain compressed video data; as well as A sending unit configured to send compressed video data, Wherein, obtaining compressed video data comprises: Partition the current screen into multiple parallel block columns; Partition the current screen into multiple parallel block rows; Determine whether to apply the rectangular strip partitioning method; encoding slice type information indicating whether a rectangular slice partitioning method is applied; and Encode the number of stripes information, When the rectangular stripe partitioning method is applied, the stripe number information is encoded into the bit stream. Wherein, when the rectangular strip partitioning method is applied, each of the strips in the current picture has a rectangular shape and includes at least one tile or a portion of a tile, Wherein, when the rectangular slice partitioning method is applied, tile index difference information specifying an index difference between an upper left tile included in a first slice and an upper left tile of a second slice is encoded into a bitstream, and The value of the tile index difference information is derived by subtracting the index of the upper left tile of the first stripe from the index of the upper left tile of the second stripe.