Method for encoding / decoding image signal and apparatus therefor

By partitioning the picture into parallel blocks or stripes and partitioning based on index or difference information, the problem of large data volume and low compression rate in high-definition video is solved, and more efficient video signal encoding and decoding is achieved.

CN119835422APending Publication Date: 2025-04-15KONINKLIJKE PHILIPS NV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411987739.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2020-04-13
Filing Date
2020-11-18
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Existing video encoding technology faces the problems of large data volume and low compression rate in high-definition video services, resulting in low efficiency.

Method used

The encoding/decoding efficiency is improved by partitioning the picture into multiple parallel blocks or strips and partitioning the strips based on parallel block index or difference information.

Benefits of technology

It improves the encoding/decoding efficiency of video signals, can process high-definition video data more effectively, and reduces storage and transmission requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835422A_ABST
    Figure CN119835422A_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for encoding / decoding an image signal and an apparatus therefor. A video signal decoding method according to an embodiment of the present disclosure comprises the steps of dividing a current picture into a plurality of parallel blocks, decoding partition information indicating a slice type, where the partition information indicates whether a rectangular slice is applied, decoding width information and height information for a first slice, and decoding the width information and height information for a second slice. Parallel block index difference information for a first slice is decoded, and an index of an upper left parallel block of a second slice is determined based on the difference information.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application date of November 18, 2020, application number 202080006085.8, and invention name “Method and device for encoding / decoding image signals”. Technical Field

[0002] The present disclosure relates to a video signal encoding / decoding method and a device 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 Task Force on Video Coding (JCT-VC) was established in 2009 by the Moving Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) under the International Telecommunication Union Telecommunication Standardization Division (ITU-T). JCT-VC proposed a video compression standard: High Efficiency Video Coding (HEVC), which has a compression performance approximately twice that of H.264 / AVC, and was approved as a standard on January 25, 2013. However, with the rapid development of high-definition video services, the performance of HEVC has gradually shown its limitations. Summary of the invention

[0004] Technical Purpose

[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 a device for performing the method.

[0006] An object of the present disclosure is to provide a method for partitioning a slice based on a tile index when partitioning a picture into a plurality of tiles and a device 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 a device 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 may 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 includes: 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, decoding width information and height information for a first stripe, decoding parallel block index difference information for the first stripe, and determining an index of an upper left parallel block of a second stripe based on the difference information. In this case, whether to decode the width information for the second stripe may be determined based on a position of the upper left parallel block of the second stripe.

[0011] The video signal encoding method according to the present disclosure includes: partitioning a current picture into a plurality of tiles, determining whether to apply a rectangular tile, determining the size of a first stripe and a second stripe, encoding width information and size information for the first stripe, and encoding tile index difference information for the first stripe. In this case, whether to encode the width information for the second stripe may be determined based on the position of the upper left tile of the second stripe.

[0012] In the video signal decoding method according to the present disclosure, when the upper left tile of the second slice is included in the rightmost tile column in the current picture, decoding of width information for the second slice may be omitted and the value of the width information for the second slice may be inferred to be 0.

[0013] In the video signal decoding method according to the present disclosure, whether the upper left tile of the second slice belongs to the rightmost tile column can be determined based on a modulo operation between the index of the upper left tile and the number of tile columns in the picture.

[0014] In the video signal decoding method according to the present disclosure, whether to decode height information for the second slice may be determined based on the position of the upper left tile of the second slice.

[0015] In the video signal decoding method according to the present disclosure, when the upper left tile of the second slice is included in the lowermost tile row in the current picture, decoding of height information for the second slice may be omitted and the value of the height information for the second slice may be inferred to be 0.

[0016] In the video signal decoding method according to the present disclosure, whether the upper left tile of the second slice belongs to the lowermost tile row can be determined based on a division operation between the index of the upper left tile and the number of tile columns in the picture.

[0017] In the video signal decoding method according to the present disclosure, the tile index difference information may represent a difference between an index of an upper left tile of a first slice and an index of an upper left tile of a second slice.

[0018] In the video signal decoding method according to the present disclosure, when the value of the parallel block index difference existence flag indicating that the parallel block index difference is encoded is true, and whether the parallel block index difference existence flag will be decoded can be determined based on the number of slices in the current picture, the parallel block index difference can be obtained.

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

[0020] Technical Effects

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0039] Fig.15 : is a diagram showing an example of updating the index of the saved motion information candidate.

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

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

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

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

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

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

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

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

[0048] Fig.24 and Fig.25 is a diagram showing an example in which reference spots are arranged in a one-dimensional array in a line.

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

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

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

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

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

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

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

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

[0057] Fig.34 An example of partitioning a screen into a plurality of tiles is shown.

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

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

[0060] Fig.38 1 is a diagram showing an example of a case where a screen is configured with two stripes.

[0061] Fig.39 : is a diagram showing a case where the number of tile columns or tile rows in a picture is 1. DETAILED DESCRIPTION

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

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

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

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

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

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

[0068] 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 a component, or a component may be partitioned into multiple components that can perform their functions. Even embodiments that integrate various components and embodiments that divide components are included in the scope of the present disclosure unless they depart from the spirit of the present disclosure.

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

[0070] 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).

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

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

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

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

[0075] The prediction unit 120 and the prediction unit 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, and 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 the prediction unit 125 and is sent to the decoding unit.

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

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

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

[0079] The intra 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 the neighboring block of the current prediction unit is a block on which inter prediction is performed, and thus the reference pixel is a pixel on which inter prediction is performed, the reference pixel included in the block on which inter prediction is performed may be replaced with information about the reference pixel of the neighboring block on which intra prediction is performed. In other words, when the reference pixel is unavailable, at least one reference pixel among the available reference pixels may be used to replace the unavailable reference pixel information.

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

[0081] When 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 on the left, upper left, and top of the prediction unit. However, when 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.

[0082] 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. When the prediction mode for the current prediction unit is predicted by using mode information predicted from neighboring prediction units, when the intra prediction mode for the current prediction unit is the same as the intra prediction mode of the neighboring prediction unit, information indicating that the current prediction unit 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.

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

[0084] 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 the prediction unit 125. In this regard, the DCT transform kernel includes at least one of DCT2 or DCT8, and the DST transform kernel includes DST7. Whether to apply DCT or DST in order to perform a transform on the residual block may be determined based on information about an intra prediction mode of a 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.

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

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

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

[0088] 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 coding, context adaptive variable length coding (CAVLC), or context adaptive binary arithmetic coding (CABAC).

[0089] 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).

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

[0091] 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 the prediction unit predicted by the motion estimation unit, the motion compensation unit, or the intra prediction unit included in the prediction units 120 and 125 so as to generate a reconstructed block.

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

[0093] The deblocking filter can remove block distortion that occurs due to the boundaries between blocks in the reconstructed picture. In order to determine whether to perform deblocking, 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, when applying the deblocking filter, when performing horizontal direction filtering and vertical direction filtering, the horizontal direction filtering and the vertical direction filtering can be configured to be processed in parallel.

[0094] The offset correction unit can correct the original image with an offset in pixels relative to the image on which deblocking 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.

[0095] Adaptive 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) for 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.

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

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

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

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

[0100] 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, various methods such as exponential Golomb coding, context adaptive variable length coding (CAVLC), or context adaptive binary arithmetic coding (CABAC) may be applied in association with a method performed by an image encoder device.

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

[0102] 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. Coefficients represented in a one-dimensional vector form may be reconstructed and rearranged into coefficients in a two-dimensional block form. 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.

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

[0104] 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 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.).

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

[0106] 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 top of 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.

[0107] The prediction unit 230 and the prediction unit 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 divide 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. Optionally, inter prediction may be performed based on information about some pre-reconstructed areas in the current picture including the current prediction unit.

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

[0109] 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 that has been subjected to intra prediction, 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 used for the current prediction unit. When AIS filtering is performed on the reference pixels of the current block, the prediction mode of the prediction unit received from the image encoder and information about the AIS filter may be used. When the prediction mode for the current block is a mode to which AIS filtering is not applied, the AIS filter may not be applied.

[0110] 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 integer units or smaller units. When the prediction mode for the current prediction unit is a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode for the current block is a DC mode, the DC filter may generate a prediction block by filtering.

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

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

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

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

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

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

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

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

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

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

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

[0122] 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 that has been encoded / decoded in the current picture. 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 transmitted 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.

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

[0124] Combined prediction refers to a combined coding mode that combines at least two of intra prediction, inter prediction, and current picture reference. In an example, when combined prediction is applied, a first prediction block may be generated based on any one of intra 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 a bitstream. The information may be a 1-bit flag.

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

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

[0127] 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 of "SPLIT_QT").

[0128] 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 in a vertical direction (that is, 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 in a horizontal direction (that is, 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" is a diagram showing the result of binary tree partitioning in the vertical direction. Figure 4 “SPLIT_BT_HOR” is a diagram showing the result of binary tree partitioning in the horizontal direction.

[0129] 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 (that is, 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 (that is, 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 FIG. 1 is a diagram showing a result of ternary tree partitioning in the vertical direction, and “SPLIT_TT_HOR” of FIG. 2 is a diagram showing a result of ternary tree partitioning in the horizontal direction.

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

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

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

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

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

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

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

[0137] 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 a top 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.

[0138] 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. The 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.

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

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

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

[0142] When quadtree partitioning is not applied to a coding block, it may be determined whether binary tree partitioning or ternary tree partitioning is performed for 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 for the coding block, information indicating the partition direction may be transmitted 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 transmitted 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.

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

[0144] Inter prediction is a prediction coding mode that predicts a current block by using information about a previous picture. In an example, a block located at the same position as the current block in the previous picture (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.

[0145] 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 motion 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.

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

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

[0148] 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 motion direction and magnitude of an object. The reference picture index specifies a reference picture of a current block among reference pictures included in a 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 an L0 prediction block and a weighting factor applied to an L1 prediction block.

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

[0150] 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 (S601), and performing motion compensation prediction for the current block based on the obtained motion information (S603).

[0151] 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 bit stream. 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 defined as a motion vector prediction mode.

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

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

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

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

[0156] Whether the affine motion based inter prediction method 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 affine motion based inter prediction method is applied to the current block.

[0157] When the inter prediction method based on affine motion is applied to the current block, an affine motion model for 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.

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

[0159] [Equation 1]

[0160] v x =ax-by+e

[0161] v y cx+dy+f

[0162] 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 may be reduced. Therefore, affine motion can be expressed by using 4 parameters. Equation 2 represents affine motion by using 4 parameters.

[0163] [Equation 2]

[0164] v x =ax-by+e

[0165] v y =bx+ay+f

[0166] Information for determining an affine motion model for a current block may be encoded and signaled in a bitstream. 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 a slice, a tile, or a block (e.g., a coding block or a coding tree unit). When the flag is signaled at a slice level, the affine motion model determined at the slice level may be applied to all blocks belonging to the slice.

[0167] 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 transmitted by signal. 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".

[0168] 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 for 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 for 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.

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

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

[0171] In the 6-parameter affine motion model, affine seed vectors for the top left corner, top right corner, and bottom 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 vector can be derived by using the affine seed vector sv0 for the upper left corner of the current block (e.g., the upper left sample point (x0, y0)), the affine seed vector sv1 for the upper right corner of the current block (e.g., the upper right sample point (x1, y1)), and the affine seed vector sv2 for the lower left corner of the current block (e.g., the lower left sample point (x2, y2)).

[0172] 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 using the first affine seed vector and the second affine seed vector described later, 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).

[0173] 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 may be replaced by the affine seed vector (fourth affine seed vector) at the lower right control point.

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

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

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

[0177] [Equation 3]

[0178]

[0179] 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 a 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 coordinate or the y-axis coordinate. (x0, y0) represents the position of the first control point, and (sv 0x ,sv 0y ) represents the first affine seed vector. In addition, (x1, y1) represents the position of the second control point, and (sv 1x ,sv 1y ) represents the second affine seed vector.

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

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

[0182] 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, the motion information of at least one of the reference picture index, the specific direction prediction flag or the bidirectional weight of the current block may also be set to be the same as that of the merge candidate.

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

[0184] 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 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 a predicted value of the motion vector of the current block may be defined as a motion vector prediction mode.

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

[0186] A merge candidate of the 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.

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

[0188] The candidate block may include at least one of a neighboring block or a non-neighboring block, wherein the neighboring block includes samples adjacent to the current block and the non-neighboring block includes samples not adjacent to the current block. Hereinafter, samples 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.

[0189] 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 of 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 indexes 0 to 4 may be used as candidate blocks.

[0190] The non-neighboring basic sample points represent samples whose x-axis distance or y-axis distance to the basic sample points adjacent to the current block is a predefined value. In an example, at least one of a block including a basic sample point whose x-axis distance to the left basic sample point is a predefined value, a block including a non-neighboring sample point whose y-axis distance to the top basic sample point is a predefined value, or a block including a non-neighboring sample point whose x-axis distance and y-axis distance to the top left basic sample point are 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 accompanying drawings, at least one of the blocks indexed from 5 to 26 may be used as a candidate block.

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

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

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

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

[0195] 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 transmitted by signal in the bitstream. In an example, information merge_idx representing an index of any one of the merge candidates included in the merge candidate list may be transmitted by signal in the bitstream.

[0196] When the number of merge candidates included in the merge candidate list 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. 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 obtained by subtracting an offset from the maximum number of merge candidates. The offset may be a natural number such as 1 or 2.

[0197] The motion information table includes motion information candidates derived from blocks encoded / decoded based on inter-frame prediction in the current picture. In an example, the motion information of the motion information candidates included in the motion information table may be set to be the same as the motion information of the blocks 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.

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

[0199] The maximum number of motion information candidates that can be included in the motion information table may 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 may be 1, 2, 3, 4, 5, 6, 7, 8 or more (e.g., 16).

[0200] Optionally, information indicating a maximum number of motion information candidates that can be included in a motion information table may be signaled in a bitstream. The information may be signaled at a sequence, picture, or slice level. The information may indicate the maximum number of motion information candidates that can be included in the motion information table. Optionally, the information may indicate a 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.

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

[0202] The motion information table may be initialized in units of pictures, slices, tiles, partitions, 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, and thus the motion information table may not include any motion information candidates.

[0203] 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, partition or block level. Before the information indicates initialization of the motion information table, a pre-configured motion information table may be used.

[0204] 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 that is the first encoding / decoding target in the slice.

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

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

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

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

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

[0210] When the motion information table already includes motion information candidates S1303, a redundancy check S1305 for the motion information of the current block (or the motion information candidates derived based on the current block) may be performed. 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 for all pre-stored motion information candidates in the motion information table. Optionally, the redundancy check may be performed for 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 for a predefined number of motion information candidates. In an example, 2 motion information candidates having the smallest index or having the largest index may be determined as targets for the redundancy check.

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

[0212] In this regard, when the maximum number of motion information candidates are 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.

[0213] The motion information candidates may be identified by respective indexes. When a motion information candidate derived from the current block is added to the motion information table, 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.

[0214] Optionally, when adding a motion information candidate derived from the current block to the motion information table, the maximum index may be assigned to the motion information candidate. In an example, when the number of pre-stored motion information candidates in the motion information table is less than the maximum value, an index having the same value as the number of pre-stored motion information candidates may be assigned to the motion information candidate. 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 indexes of the remaining pre-stored motion information candidates are decreased by 1.

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

[0216] 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 a maximum number of motion information candidates have been stored in the motion information table.

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

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

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

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

[0221] When the index of the pre-stored motion information candidate that is the same as the motion information candidate mvCand derived from the current block is hIdx, the pre-stored motion information candidate may be removed, and the index of the motion information candidate with an index greater than hIdx may be reduced by 1. In an example, 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.

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

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

[0224] 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 for the blocks included in the merge processing area is not defined, it is not appropriate to use the motion information of any one of the blocks included in the merge processing area for inter-frame prediction of another block therein. 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.

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

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

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

[0228] 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 order of the indexes of the motion information candidates arranged 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.

[0229] When adding a motion information candidate included in the motion information table to a merge candidate list, a redundancy check between the motion information candidate and a pre-stored merge candidate 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 a pre-stored merge candidate may not be added to the merge candidate list.

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

[0231] Optionally, the redundancy check may be performed only for a portion of the pre-stored merge candidates in the merge candidate list. In an example, the redundancy check may be performed only for merge candidates whose index exceeds or is below a threshold or for 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, a top neighboring block, an upper right neighboring block, or a lower left neighboring block of the current block.

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

[0233] When adding a motion information candidate HmvpCand[j] to a merge candidate list, a redundancy check with two 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] Unlike the example shown, when adding motion information candidate HmvpCand[j] 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].

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

[0236] When adding a motion information candidate HmvpCand[j] to a merge candidate list, a redundancy check with two 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.

[0237] A redundancy check with a merge candidate may be performed only for a portion of the motion information candidates. In an example, a redundancy check may be performed only for N motion information candidates with large or small indexes among the motion information candidates included in the motion information table. In an example, a redundancy check may be performed only for motion information candidates with an index whose difference between the number of motion information candidates included in the motion information table and the motion information candidate is lower than a threshold. When the threshold is 2, a redundancy check may be performed only for three motion information candidates with the largest index value among the motion information candidates included in the motion information table. For motion information candidates other than the above three motion information candidates, a 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.

[0238] On the contrary, the redundancy check is set to be performed only for the motion information candidates having the index for which the difference between the number of motion information candidates included in the motion information table and the motion information candidate exceeds the threshold value.

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

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

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

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

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

[0244] In the example, Fig.17 In the example shown, it has been determined that HmvpCand[i] is the same as mergeCandList[2]. Therefore, a redundancy check for HmvpCand[i-1] may be performed without adding HmvpCand[i] to the merge candidate list. In this regard, a redundancy check between HmvpCand[i-1] and mergeCandList[2] may be omitted.

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

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

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

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

[0249] 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 a motion vector prediction candidate for the current block. Specifically, the motion vector of the motion information candidate may be set as a motion vector prediction candidate.

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

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

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

[0253] The 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 the temporal motion vector prediction candidate represents a motion vector prediction candidate derived from a previous reference picture. The affine motion information candidate represents a motion information candidate derived from a block encoded / decoded by an affine motion model. The zero motion vector prediction candidate represents a candidate whose motion vector value is 0.

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

[0255] 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).

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

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

[0258] exist Fig.18 In the example shown, at the time of decoding / 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 unavailable 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 available as merge candidates.

[0259] exist Fig.18 In the example shown, when decoding / decoding 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 unavailable as merge candidates. However, candidate blocks x5 and x9 not included in the same merge processing region as CU8 may be set to be available as merge candidates.

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

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

[0262] As in Fig.19 In the example shown in (a) of FIG. 1 , 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 region as the current block may be set to be unusable as a merge candidate. In the example, when deriving a merge candidate for the coding block CU3, the top neighboring block y3 and the upper right neighboring block y4 included in the same merge processing region as the coding block CU3 may be set to be unusable as a merge candidate for the coding block CU3.

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

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

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

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

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

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

[0269] The merged processing area may be square or non-square. Information for determining the merged processing area may be transmitted by signal 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 transmitted by signal in the bitstream.

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

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

[0272] 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 when encoding / decoding 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 when encoding / decoding the block included in the merge processing area, a situation may occur where motion prediction compensation is performed by using the 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 block whose encoding / decoding is completed may not be added to the motion information table.

[0273] Alternatively, 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 bottom 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.

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

[0275] In an example, if motion compensation prediction is performed for a block included in a merge processing area, the motion information candidates 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.

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

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

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

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

[0280] In another example, a motion information table for a merge processing area 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 area. In order to distinguish a general motion information table from a motion information table for a merge processing area or a coding tree unit, the motion information table for the merge processing area 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.

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

[0282] A temporary motion information table for a coding tree unit or a merge processing area may be configured. When motion compensation prediction is performed for 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 including the current block.

[0283] 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 bottom 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.

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

[0285] The current block included in the coding tree unit or the merge processing region may be set to not use the temporary motion information table for the corresponding coding tree unit or the merge processing region. In other words, when the number of merge candidates included in the merge candidate list of the current block is less than a threshold 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 region as the current block may not be used for motion compensation prediction of the current block.

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

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

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

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

[0290] 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 partitions having the same motion information.

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

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

[0293] 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 for 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 for a portion of the motion information candidates included in the motion information table. In an example, a redundancy check may be performed for motion information candidates having an index exceeding or below a threshold. 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.

[0294] It may limit the use of motion information candidates derived from partitions included in the same coding tree unit or the same merge processing area as the current block as the merge candidate of the current block. 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 area including the block, the address of the merge processing area including the block, the index of the merge processing area including the block, the position of the coding tree area including the block, the address of the coding tree area including the block, or the index of the coding tree area including the block.

[0295] Intra-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 may be used for intra-prediction of the current block.

[0296] Intra prediction methods include matrix-based intra prediction and intra prediction based on the direction of adjacent reconstruction samples. Information indicating the intra prediction method of the current block can be transmitted 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 adjacent block. In one example, when there is a current block that crosses the picture boundary, the current block can be set so that the matrix-based intra prediction method is not applied to the current block.

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

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

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

[0300] 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 away from the top and / or left side of the current block. The reference samples may be derived from reconstructed samples encoded / decoded around the current block.

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

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

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

[0304]

Table 1

[0305]

[0306]

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

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

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

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

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

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

[0313] 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 a top neighboring block adjacent to the top of the current block.

[0314] 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. Alternatively, information indicating the number of MPMs may be signaled in the bitstream. Optionally, the number of MPMs is determined based on at least one of a prediction coding mode of a neighboring block, a size of a current block, a shape of a current block, or a reference sample line index of a current block. In an example, N MPMs may be used when an adjacent reference sample line is determined as a reference sample line of a current block, whereas M MPMs may be used when a non-adjacent reference sample line is determined as a reference sample line of a 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, when the index of the reference sample line of the current block is 0 and the MPM flag is true, the intra-frame prediction mode of the current block may be determined as any one of 6 candidate intra-frame prediction modes, whereas when the index of the reference sample line of the current block is greater than 0 and the MPM flag is true, the intra-frame prediction mode of the current block may be determined as any one of 5 candidate intra-frame prediction modes.

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

[0316] 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. When the information is a 1-bit flag, it may be referred to as an MPM flag. When the MPM flag indicates that the same MPM as the current block is included in the MPM list, index information identifying one of the MPMs may be signaled in the bitstream. In an example, index information mpm_idx specifying any one of a 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.

[0317] When deriving the intra prediction mode of the current block, comparison of a part of the MPM with the remaining mode information may be omitted. In the example, the MPM in the non-directional intra prediction mode in the MPM may 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 may be derived by comparing the remaining MPMs other than the non-directional intra prediction mode with the remaining mode information. Instead of excluding the non-directional intra prediction mode from the comparison target, the result value may be compared with the remaining MPMs after adding the number of non-directional intra prediction modes to the remaining mode information.

[0318] Instead of setting the default mode to MPM, information indicating whether the intra-frame 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-frame prediction mode of the current block is a plane. When the default mode flag indicates that the intra-frame prediction mode of the current block is not the default mode, one of the MPMs indicated by the index information may be set as the intra-frame prediction mode of the current block.

[0319] When the default mode flag is used, the intra prediction mode same as the default mode may be set to MPM. In an 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 may be derived by using 5 MPMs excluding the MPM corresponding to the plane.

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

[0321] When the index of the reference sample line of the current block is not 0, it may be set to not use the default mode. In one example, when a non-adjacent reference sample line is determined as the reference sample line of the current block, it may be set to not 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).

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

[0323] When the DC mode is selected, the prediction sample for the current block may be generated based on the average value of the reference samples. Specifically, 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 top reference sample adjacent to the top of the current block and the left reference sample adjacent to the left of the current block.

[0324] 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 top 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, reference samples adjacent to the larger length may be applied in order to calculate the average value. Alternatively, whether to calculate the average value by using the top 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.

[0325] When the planar mode is selected, the prediction sample may be obtained by using the horizontal prediction sample and the vertical prediction sample. In this regard, the horizontal prediction sample may be obtained based on the left reference sample and the right reference sample located at the same horizontal line as the prediction sample, and the vertical prediction sample may be obtained based on the top reference sample and the bottom reference sample located at the same vertical line as the prediction sample. In this regard, the right reference sample may be generated by copying the reference sample adjacent to the upper right corner of the current block, and the bottom reference sample may be generated by copying the reference sample adjacent to the lower left corner of the current block. The horizontal prediction sample may be obtained based on the weighted sum of the left reference sample and the right reference sample, and the vertical prediction sample may be obtained based on the weighted sum of the top reference sample and the bottom reference sample. In this regard, the weighting factor assigned to each reference sample may be determined according to the position of the prediction sample. The prediction sample may 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, weighting factors assigned to the horizontal direction prediction samples and the vertical direction prediction samples may be determined based on the positions of the prediction samples.

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

[0327]

Table 2

[0328] 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

[0329] Table 2 represents the intra-frame direction parameter of each intra-frame prediction mode, wherein, when 35 intra-frame prediction modes are defined, the index of each intra-frame prediction mode is one of 2 to 34. When more than 33 directional intra-frame prediction modes are defined, the intra-frame direction parameter of each intra-frame prediction mode can be set by finely dividing Table 2.

[0330] The top 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 direction parameter. In this regard, when the value of the intra direction parameter is a negative value, the left reference sample and the top reference sample can be arranged in a line.

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

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

[0333] 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 top 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.

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

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

[0336] [Equation 4]

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

[0338] [Equation 5]

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

[0340] 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 an integer pixel.

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

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

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

[0344] [Equation 6]

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

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

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

[0348] [Equation 7]

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

[0350] Intra prediction for 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.

[0351] Optionally, an intra prediction mode may be derived for each region, and intra prediction for 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 predefined in the encoder and the decoder independently of the size or shape of the current block.

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

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

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

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

[0356] In the example, Fig. 27 In the example shown in (a) of FIG. 1 , 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 sample A around the column on the right side of the current block is derived from the reference samples located at the angular mode according to the above angle, there may be a case where the left reference sample L far from the prediction sample is used instead of the top reference sample T close to the prediction sample.

[0357] In another example, if Fig. 27 In 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 bottom row of the current block is derived from the reference sample located at the angular mode according to the above angle, there may be a case where the top reference sample T far from the prediction sample is used instead of the left reference sample L close to the prediction sample.

[0358] In order to solve the above problem, when the current block is non-square, the intra prediction mode of the current block can be replaced by the intra prediction mode in the opposite direction. 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 indicates a directional intra prediction mode that does not belong to the range of 45 degrees to -135 degrees.

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

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

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

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

[0363] By using the wide-angle intra prediction mode, the reference sample T can be used 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).

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

[0365]

Table 3

[0366]

[0367]

[0368] When the current block is non-square and the intra prediction mode of the current block obtained in S2202 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 of a width to a height of the current block.

[0369] When the current block is a non-square with a width greater than a height, the transformation range may be set to be from the intra prediction mode index in the upper right diagonal direction (e.g., 66) to (the intra prediction mode index in the upper right diagonal direction - N). 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 transformation range, the intra prediction mode may be transformed into the wide-angle intra prediction mode. The transformation 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).

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

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

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

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

[0374] The transform range may be determined based on the ratio of the current block. In an example, Table 4 and Table 5 respectively show transform ranges in 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.

[0375]

Table 4

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

[0377]

Table 5

[0378]

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

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

[0381]

Table 6

[0382]

[0383]

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

[0385] 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 the prediction method may be configured so that a multi-line intra prediction encoding method for selecting one of a plurality of reference sample lines is not used. When the multi-line intra prediction encoding method is not used, an adjacent reference sample line may be determined as a reference sample line of the current block.

[0386] 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, a non-adjacent reference sample line spaced i from the current block may include (nTbW+nTbH+offsetX[i]) top reference samples and (nTbW+nTbH+offsetY[i]) left reference samples in addition to the upper left reference sample. That is, a non-adjacent reference sample line spaced i from the current block may include (2nTbW+2nTbH+offsetX[i]+offsetY[i]+1) reference samples. For example, when the value of whRatio is greater than 1, the value of offsetX 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.

[0387] Since the wide-angle intra-prediction mode is used in addition to the conventional intra-prediction mode, resources for encoding the wide-angle intra-prediction mode may be increased, and thus encoding efficiency may be reduced. Therefore, an alternative intra-prediction mode of the wide-angle intra-prediction mode is encoded instead of encoding the wide-angle intra-prediction mode as it is, in order to improve encoding efficiency.

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

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

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

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

[0392] The residual image can be derived by subtracting the predicted image from the original image. In this regard, when the residual image is converted into 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.

[0393] 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 an example, when DCT transform is performed on a block of size N×N, N 2 The size of each of the basic mode components included in the N×N size block can be obtained by transformation. The size of the basic mode component may be referred to as a DCT coefficient or a DST coefficient according to the transformation method used.

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

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

[0396] 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 the example, the transform coefficient may refer to 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.

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

[0398] The two-dimensional image transform may not be performed for 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.

[0399] 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 size. Optionally, transform skipping may be allowed only when the sub-partition intra coding method is not used.

[0400] Alternatively, 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.

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

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

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

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

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

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

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

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

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

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

[0411] Information indicating whether the second transformation is performed may be transmitted by a signal in the bitstream. In an example, a flag indicating whether the second transformation is performed may be transmitted by a signal, or index information specifying whether the second transformation is performed and a transformation core for the second transformation may be specified. 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.

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

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

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

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

[0416] 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 a transform coefficient at an upper left position in the current block.

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

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

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

[0420]

Table 7

[0421]

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

[0423] When Table 7 is used, DCT2 may be applied in the horizontal direction and 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.

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

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

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

[0427] When the coding block is partitioned in the horizontal direction, the transform type of the sub-block (Sub-CU0) at the top position of the coding block may be set to be the same as the transform type of the sub-block (Sub-CU1) at the bottom 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 the top subblock, the determined transform type may also be applied to the bottom subblock.

[0428] 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 may 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.

[0429] Whether to encode the index information may be determined based on at least one of a 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 value, 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.

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

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

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

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

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

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

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

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

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

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

[0440] Transform type combination candidates different from those listed in Table 7 may also be used. In an example, a transform type combination candidate consisting of a transform skip applied to one of a horizontal direction transform or a vertical direction transform and a transform kernel (e.g., DCT2, DCT8, or DST7, etc.) applied to the other may be used. In this case, whether the transform skip is to be used as a transform type candidate in the horizontal direction or 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.

[0441] 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 and / or sps_explicit_intra_mts_flag may be signaled at a sequence level, wherein sps_explicit_intra_mts_flag is information indicating whether explicit transform type determination is allowed for a block encoded by intra prediction, and sps_explicit_intra_mts_flag is information indicating whether explicit transform type determination is allowed for a block encoded by inter prediction.

[0442] When explicit transform type determination is allowed, the transform type of the current block may be determined based on index information tu_mts_idx signaled in the bitstream. On the other hand, when explicit transform type determination is not allowed, the transform type may be determined based on whether transform is allowed to be performed in units of subblocks, the position of the subblock including non-zero transform coefficients, whether the second transform is performed, whether the sub-partition intra coding method is applied, or at least one of the size or shape of the current block. 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.

[0443] Alternatively, when the current block has a square shape whose height is the same as the 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 whose height and width are 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.

[0444] 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, DST7, 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.

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

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

[0447] When obtaining a reconstructed block of the current block, information loss occurring in the quantization and encoding process may 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 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.

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

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

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

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

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

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

[0454] SAO is used to mitigate the ringing effect that occurs 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, the pixel brightness can be partitioned into 32 uniform parts, and pixels with similar brightness values ​​can be set as a group. In the example, 4 adjacent bands out of 32 bands can be set as a group, and the same offset value can be applied to the samples belonging to the 4 bands.

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

[0456] [Equation 8]

[0457]

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

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

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

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

[0462] 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 may be considered. Specifically, the picture may be partitioned into parallel blocks or strips (or parallel block groups) depending on the purpose of processing.

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

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

[0465] When encoding / decoding a parallel block, it can be set to not use the data of other parallel blocks. Parallel processing of parallel blocks can be supported by removing the encoding / decoding dependencies between parallel blocks. Specifically, the probability table of CABAC (context adaptive binary arithmetic coding) context can be initialized for 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.

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

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

[0468] First, it may be determined whether the current picture is partitioned into a plurality of processing units (S3301). In this regard, the processing unit may include at least one of a tile or a slice. In an example, a syntax no_pic_partition_flag indicating whether the current picture is partitioned into a plurality of tiles or slices may be signaled in 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 tile 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 tiles or slices.

[0469] 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).

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

[0471] When it is determined to partition the current picture 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 (S3302).

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

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

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

[0475] 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, partitioning a coding tree unit into multiple partition types may not be allowed.

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

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

[0478] 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 transmitted by a signal.

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

[0480] The information indicating the partition shape of the picture may include at least one of information indicating whether the parallel blocks are partitioned according to 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.

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

[0482] When it is determined to partition the tile 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.

[0483] The syntax tile_cols_width_minus1 represents 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 represents a value obtained by subtracting 1 from the number of coding tree unit rows included in a tile of uniform size.

[0484] 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 obtained by subtracting the sum of the widths of the 0th parallel block column to the (m-1)th parallel block column from the width of the current picture may be set as the width of the last parallel block column. In the example, when the index of the last parallel block row is n, the value obtained by subtracting the sum of the heights of the 0th parallel block row to the (n-1)th parallel block row from the height of the current picture may be set as 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.

[0485] When a picture is partitioned by using at least one of a vertical line or a horizontal line passing through 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 transmitted 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 transmitted by a signal in a bitstream. The syntax num_tile_row_minus1 indicates a value obtained by subtracting 1 from the number of parallel block rows, and the syntax num_tile_column_minus1 indicates a value obtained by subtracting 1 from the number of parallel block columns.

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

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

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

[0489] 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. Signaling of the syntax tile_cols_width_minus1[i] may be omitted for the last tile column. 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.

[0490] The syntax tile_rows_height_minus1[j] represents a value obtained by subtracting 1 from the number of coding tree unit rows constituting the jth tile row. Signaling of the syntax tile_rows_height_minus1[j] may be omitted for the last tile row. 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.

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

[0492] One tile can 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 can be set to be not 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.

[0493] According to the partition shape of the picture, the tiles may have the same size in all areas except for 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.

[0494] 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 may be partitioned into multiple tiles.

[0495] When it is determined that the current picture can be partitioned into multiple parallel blocks, at least one of information for determining the number of parallel block columns and the number of parallel block rows, information indicating whether the parallel blocks are evenly partitioned, or information for determining the size of the parallel block columns and the size of the parallel block rows can be encoded.

[0496]

Table 8

[0497]

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

[0499] Instead of signaling the size information of each tile column or each tile row, the size of the current tile column or the current tile row may be derived based on the size information of the previous tile column or the previous tile row.

[0500] To this end, 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 obtained by subtracting 1 from the number of parallel block columns whose width is signaled.

[0501] 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 obtained by subtracting 1 from the number of coding tree unit columns included in the tile row.

[0502] 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 the syntax tile_width_minus1[i] signaled in the bitstream.

[0503] 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[l] that is signaled last. In this case, l may represent the index of the parallel block column whose width is signaled last, and may be an integer less than j. In the example, when the value obtained by subtracting the width of the previous parallel block column from the width of the current picture is equal to or greater than the value obtained by adding 1 to the syntax tile_width_minus1[l], the width of the parallel block column j may be set to the value obtained by adding 1 to the syntax tile_width_minus1[l]. On the other hand, when the value obtained by subtracting the width of the previous parallel block column from the width of the current picture is less than the value obtained by adding 1 to the syntax tile_width_minus1[l], the difference obtained by subtracting the width of the previous parallel block column from the width of the current picture may be set as the width of the parallel block column j.

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

[0505]

Form 9

[0506]

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

[0508] [Equation 9]

[0509] PicWidthInCtbsY=Ceil(pic_width_in_luma_samples / CtbSizeY) The variable remainingWidthInCtbsY represents the value obtained by subtracting the cumulative width of the parallel block column from the variable PicWidthInCtbsY. In the example, for the parallel block column indexed as i, remainingWidthInCtbsY can be derived by subtracting the value that is the sum of the widths from the 0th parallel block column to the (i-1)th parallel block column from PicWidthInCtbsY.

[0510] As shown in the example of Table 9, the variable uniformTileColWidth may be derived by adding 1 to the width of the last explicitly signaled tile column tile_column_width_minus1[num_exp_tile_columns_minus1]. In this case, when the variable remainingWidthInCtbY representing 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 by the size of the variable uniformTileColWidth.

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

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

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

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

[0515] The syntax for specifying the height of a tile row may be encoded and signaled as many times as the number determined based on the syntax num_exp_tile_rows_minus1. 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.

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

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

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

[0519] Table 10 shows the process of determining the height of a tile row.

[0520]

Form 10

[0521]

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

[0523] [Equation 10]

[0524] PicHeightInCtbsY=Ceil(pic_height_in_luma_samples / CtbSizeY) The variable remainingHeightInCtbsY represents the value obtained by subtracting the cumulative height of the tile row from the variable PicHeightInCtbsY. In the example, for the tile row whose index is i, remainingHeightInCtbsY can be derived by subtracting the value that is the sum of the heights from the 0th tile row to the (i-1)th tile row from PicHeightInCtbsY.

[0525] As in the example shown in Table 10, the variable uniformTileRowHeight can be derived by adding 1 to the height of the last tile row explicitly signaled, tile_row_height_minus1[num_exp_tile_rows_minus1]. In this case, when the variable remainingHeightInCtbY representing the number of remaining coding tree unit rows in the current picture is equal to or greater than the variable uniformTileRowHeight, the remaining area can be partitioned by the size of the variable uniformTileRowHeight.

[0526] 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 is.

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

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

[0529] Table 11 shows a syntax table including a syntax indicating the number of tile columns whose width is explicitly signaled and a syntax indicating the number of tile rows whose height is explicitly signaled.

[0530]

Form 11

[0531]

[0532] When the value of the syntax num_exp_tile_columns_minus1 and the value of the syntax num_exp_tile_row_minus1 are both 0, each of the syntax tile_column_width_minus1 and the syntax tile_row_height_minus1 may be signaled. In this case, when the width indicated by the syntax tile_column_width_minus1[0] is the same as the width of the current picture (for example, when the value of tile_column_width_minus1[0] is (PicWidthInCtbsY-1)), the height indicated by the syntax tile_row_height_minus1[0] should be set to a value different from the height of the current picture. In other words, the value of the syntax tile_row_height_minus1[0] may be set to a value less than (PicHeightInCtbsY-1). When the value of the syntax tile_row_height_minus1[0] is set to a value less than (PicHeightInCtbsY-1), the picture is partitioned into at least two or more tiles.

[0533] In addition, the syntax loop_filter_across_tiles_enabled_flag indicates whether it is allowed to apply an in-loop filter to the boundary of a tile 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_tiles_enabled_flag is 1, it indicates that an in-loop filter that crosses the boundary of a tile 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_tiles_enabled_flag is 0, it indicates that it is not allowed to apply an in-loop filter to the boundary of a tile in the picture of the reference picture parameter set.

[0534] The syntax loop_filter_across_slices_enabled_flag indicates whether it is allowed to apply an in-loop filter to the boundary of a slice 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_slices_enabled_flag is 1, it indicates that an in-loop filter that crosses the boundary of a slice in a picture of a reference picture parameter set may be applied. On the other hand, when the value of the flag loop_filter_across_slices_enabled_flag is 0, it indicates that it is not allowed to apply an in-loop filter to the boundary of a slice in a picture of a reference picture parameter set.

[0535] At least one or more tiles or parts of tiles may be defined as a processing unit. In an example, a plurality of tiles may be defined as a stripe.

[0536] Optionally, a parallel block can be partitioned into multiple stripes.

[0537] One slice may include at least one coding tree unit column. When a tile is partitioned into a plurality of slices, information indicating the height of each slice may be signaled in a bitstream.

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

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

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

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

[0542] The definition method based on raster scanning specifies at least one or more parallel blocks according to a raster scanning order, and defines the specified at least one or more 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.

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

[0544] In the example, Fig.35 In the example shown, when it is assumed that the first stripe slice0 includes 3 tiles, the first stripe slice0 may be defined as including tiles Tile0 to Tile2 according to the raster scan order. When it is assumed that the second stripe slice1 includes 6 tiles, the second stripe slice1 may be defined as including tiles Tile3 to Tile8 according to the raster scan order. According to the raster scan order, the last stripe slice2 may include the remaining tiles Tile9 to Tile11.

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

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

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

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

[0549] As in Fig.37 In the illustrated example, the fourth slice slice3 includes tiles Tile5, Tile6, Tile9, and Tile10. As in the illustrated example, when a slice 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 slice.

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

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

[0552] When the method of defining rectangular slices is applied, a syntax indicating the number of slices in a picture may be encoded and signaled. In an example, a syntax num_slices_in_pic_minus1 indicating the number of slices in a picture may be signaled in a bitstream. The syntax num_slices_in_pic_minus1 may indicate a value obtained by subtracting 1 from the number of slices in the picture. Therefore, a decoder may determine the total number of slices by adding 1 to the value indicated by the syntax num_slices_in_pic_minus1.

[0553] Instead of encoding the syntax num_slices_in_pic_minus1, the syntax num_slices_in_pic_minus2 indicating a value obtained by subtracting 2 from the number of slices in the picture may be encoded.

[0554] When the method for defining a strip of a rectangular shape is applied, information for identifying a parallel block included by each strip may be transmitted by a signal to determine the parallel block included by 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 an upper left position of the strip, and the last parallel block indicates a parallel block at a lower right position of the strip.

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

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

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

[0558] 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 (a next tile of the first tile in the scanning order) or difference information between a first slice included in the first tile and a second slice included in the second tile 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.

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

[0560] In an example, a syntax tile_idx_delta[i] representing the index difference between the top left tile of the i-th slice and the top left tile of the subsequent slice (i.e., the (i+1)-th slice) may be signaled in the bitstream. The syntax tile_idx_delta[i] may represent the absolute value of the difference between the index of the top left tile of the i-th slice and the index of the top left tile of the i+1-th slice.

[0561] Alternatively, the syntax tile_idx_delta_minus1[i] derived by subtracting 1 from the absolute value of the index difference between the upper left tile of the i-th slice and the upper left tile of the subsequent slice may be encoded / decoded. Table 12 represents a syntax structure including the above syntax.

[0562]

Form 12

[0563]

[0564]

[0565] The syntax tile_idx_delta_sign[i] indicating the sign of the tile index difference between the slices may also be encoded / decoded. In the example, when the value of the syntax tile_idx_delta_sign[i] is 1, it indicates that the sign of the difference indicated by tile_idx_delta[i] is positive, and when the value of the syntax tile_idx_delta_sign[i] is 0, it indicates that the sign of the difference indicated by tile_idx_delta[i] is negative.

[0566] For slices where i is 0, encoding / decoding of the syntax tile_idx_delta_sign may be omitted.

[0567] Based on the difference information, the position of the top left tile in the (i+1)th slice may be determined. Specifically, the index of the top left tile of the (i+1)th slice may be derived by adding the index of the top left tile of the i-th slice to the syntax tile_idx_delta[i].

[0568] The tile index difference between the first slice in a picture (i.e., the slice where i is 0) and the second slice (i.e., the slice where i is 1) can always be set to a positive number. Therefore, for the first slice in a picture, the encoding / decoding of tile_idx_delta_sign[i] can be omitted and its value can be inferred to be 1.

[0569] In addition, the tile index difference between the previous slice of the last slice in the picture (e.g., the slice where i is the value obtained by subtracting 1 from num_slices_in_pic_minus1) and the last slice in the picture (e.g., the slice where i is the value indicated by num_slices_in_pic_minus1) is always set to a positive number. Therefore, for the previous slice of the last slice, encoding / decoding of tile_idx_delta_sign[i] may be omitted and its value may be inferred to be 1.

[0570] For the last slice, encoding / decoding of the syntax tile_idx_delta[i] indicating the difference with the subsequent slices may be omitted.

[0571] Information specifying at least one of the width or height of a slice may be encoded / decoded. In an example, at least one of a syntax slice_width_in_tiles_minus1[i] indicating the width of an i-th slice or a syntax slice_height_in_tiles_minus1[i] indicating the height of an i-th slice may be signaled in a bitstream.

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

[0573] The i-th slice may be configured with as many tile columns as the number determined based on the syntax slice_width_in_tiles_minus1[i] and as many tile rows as the number 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 tile_idx_delta[i] or tile_idx_delta_minus1[i].

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

[0575] 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 a picture may be encoded.

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

[0577] 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. For the last tile, encoding of the syntax tile_idx_delta[i] may be omitted.

[0578] The encoder may determine whether syntax tile_idx_delta[i] indicating a difference in tile index is encoded, and encode a flag tile_idx_delta_present_flag indicating whether syntax tile_idx_delta[i] is encoded according to the determination. Syntax tile_idx_delta[i] may be encoded only when the value of the flag tile_idx_delta_present_flag is 1.

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

[0580] 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 is composed of only a single tile, or the tile is partitioned into multiple slices.

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

[0582] In an example, a syntax num_slices_in_tile_minus1[i] indicating the number of slices 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 slices included by an i-th tile.

[0583] Alternatively, 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 by a tile.

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

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

[0586] 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[l] 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.

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

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

[0589] When the number of tile columns in the current picture is 1, 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, encoding of the syntax slice_height_in_tiles_minus1 may be omitted.

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

[0591] In an example, encoding of the syntax slice_width_in_tiles_minus1 indicating the width of a slice may be omitted, and a distance from a tile at a predetermined position in an adjacent slice may be set as the width of the slice. Specifically, the top left tile of the (i+1)th slice adjacent to the right side of the i-th slice may be specified 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).

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

[0593] Optionally, when a rectangular-shaped slice is defined, 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 a syntax indicating a difference in a 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] indicating the size of the slice and the syntax slice_height_in_tiles_minus1[i] for determining the position of the upper left parallel block or the position of the upper right parallel block in the slice (e.g., tile_idx_delta[i]).

[0594] When the value of the syntax tile_idx_delta_present_flag is 0, the position / size of 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 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.

[0595] Based on the index of the tile in the slice, it may be determined whether to signal information indicating the size of the slice. In an example, Table 13 represents a syntax structure for determining whether to signal information determining the size of the slice based on the index of the tile in the slice.

[0596]

Form 13

[0597]

[0598]

[0599] In Table 13, the variable tileIdx represents the index of the tile included by the i-th slice. Specifically, the index of the tile at the predefined position in the i-th slice may be set to the variable tileIdx. The tile at the predefined position may represent the top left tile.

[0600] The variable NumTileColumns represents the number of tile columns included by the picture. In the example, the position of the tile column to which the top left tile belongs can be determined based on a modulo operation (%) between the index of the top left tile in the i-th stripe and the value obtained by subtracting 1 from the variable NumTileColums. In the example, the result value n of the modulo operation represents that the top left tile belongs to the tile column with index n. In other words, when the value of the remainder obtained by dividing the top left tile index SliceTopLeftTileIdx[i] of the i-th stripe by the variable NumTileColumns is (NumTileColumns-1), it can be determined that the i-th stripe is included in the last tile column.

[0601] Based on the position of the top left tile in the slice, it can be determined whether to signal the information indicating the size of the slice. Specifically, it can be determined whether to signal the information indicating the size of the tile based on whether the tile column to which the top left tile of the slice belongs corresponds to the rightmost tile column in the picture.

[0602] In an example, when the top left tile in a slice belongs to the rightmost tile column in the picture, signaling of the syntax slice_width_in_tiles_minus1[i] indicating the width of the slice may be omitted. In an example, as in Table 13, when the result of performing a modulo operation on the top left tile index SliceTopLeftTileIdx[i] of the i-th slice using the variable NumTileColumns is the same as the value obtained by subtracting 1 from the number of tile columns NumTileColumns in the picture, encoding / decoding of the syntax slice_width_in_tiles_minus1[i] may be omitted. In this case, the value of the syntax slice_width_in_tiles_minus1[i] may be inferred to be 0.

[0603] The position of the tile row to which the top left tile belongs can be determined based on a division operation between the index of the top left tile in the i-th slice and the variable NumTileColumns. In the example, when the quotient of the division operation is m, it indicates that the top left tile is included in the tile row with index m. In other words, as in Table 13, when the quotient obtained by dividing the top left tile index SliceTopLeftTileIdx[i] of the i-th slice by the variable NumTileColumns is (NumTileRows-1), it can be determined that the i-th slice is included in the last tile row.

[0604] When the top left tile in the slice belongs to the bottom tile row in the picture, the signaling of the syntax slice_height_in_tiles_minus[i] indicating the height of the slice may be omitted. In an example, when the result of the division operation is the same as the value obtained by subtracting 1 from the number of tile rows NumTileRows in the picture, the encoding / decoding of the syntax slice_height_in_tiles_minus1[i] may be omitted. In this case, the value of the syntax slice_height_in_tiles_minus1[i] may be inferred to be 0.

[0605] When the top left tile in a slice belongs to both the rightmost column and the bottommost row in the picture, the coding of the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] may be omitted. In this case, the values ​​of both syntaxes may be inferred to be 0.

[0606] When the upper left tile in a slice is not included in the lowermost row in the picture, whether to encode / decode the syntax slice_height_in_tiles_minus1[i] representing the height of the slice can be determined by considering at least one of whether the upper left tile in the slice belongs to the leftmost column in the picture and / or whether the difference information between the tile indexes is encoded.

[0607] In an example, although the top left tile in the slice is not included in the bottommost row in the picture, when the tile index difference is encoded (for example, when tile_idx_delta_present_flag is 1), encoding / decoding of the syntax slice_height_in_tiles_minus1[i] indicating the height of the slice may be omitted.

[0608] Alternatively, although the top left tile in the slice does not belong to the bottommost row in the picture, encoding / decoding of the syntax slice_height_in_tiles_minus1[i] may be omitted when the top left tile does not belong to the leftmost column in the slice.

[0609] When the top left tile in a slice does not belong to the bottommost row in the picture, but encoding / decoding of the syntax slice_height_in_tiles_minus1[i] is omitted, the syntax may be set to be the same as the height slice_height_in_tiles_minus[i-1] of the previous slice.

[0610] Table 14 shows the semantics of the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i].

[0611]

Form 14

[0612]

[0613]

[0614] In the example of Table 14, it is shown that when the number of slices included in the current picture is equal to or greater than 1, the syntax tile_idx_delta_present_flag indicating whether information indicating a difference in tile indices is encoded is encoded / decoded.

[0615] When the value of the syntax slice_height_in_tiles_minus1[i] indicating the height of the i-th slice and the value of the syntax slice_width_in_tiles_minus1[i] indicating the width of the i-th slice are both 0, the syntax num_exp_slices_in_tiles[i] for determining the partition shape of the tile including the i-th slice may be encoded / decoded additionally. However, when the height of the tile including the i-th slice is 1, the tile may not be partitioned into a plurality of slices. Therefore, when the height of the tile including the i-th slice is 1, encoding / decoding of the syntax num_exp_slices_in_tile[i] may be omitted, and its value may be inferred to be 0.

[0616] When the number of slices in a picture is 2, two rectangular slices may be generated by partitioning the picture in a horizontal direction or a vertical direction.

[0617] Fig.38 : is a diagram showing an example of a case where a screen is configured with two stripes.

[0618] Fig.38 (a) shows an example of partitioning the screen in the horizontal direction. Fig.38 (b) shows an example of partitioning the screen in the vertical direction.

[0619] As in the illustrated example, when the screen includes only two slices, the two slices may be classified only by the syntax indicating the width of the slice or the syntax indicating the height of the slice, respectively.

[0620] In the example, as in Fig.38 In the example shown in (a) of FIG. 1 , when the picture is partitioned in the horizontal direction, slice 0 may be specified based on syntax slice_width_in_tiles_minus1[0] indicating the width of a slice whose index is 0 and syntax slice_height_in_tiles_minus1[0] indicating the height of a slice whose index is 0. For slice 1, encoding / decoding of a syntax for determining the size of a slice may be omitted, and the remaining area in the picture except for slice 0 may be set to slice 1. In addition, the index of the upper left tile of slice 1 may be derived by subtracting 1 from the product of the number of tile rows and the number of tile columns included in slice 0.

[0621] As in Fig.38 In the example shown in (b) of FIG. 1 , when the picture is partitioned in the vertical direction, slice 0 may be specified based on syntax slice_width_in_tiles_minus1[0] indicating the width of a slice whose index is 0 and syntax slice_height_in_tiles_minus1[0] indicating the height of a slice whose index is 0. For slice 1, encoding / decoding of a syntax for determining the size of a slice may be omitted, and the remaining area in the picture except for slice 0 may be set to slice 1. In addition, the index of the upper left tile of slice 1 may be derived to be the same as the number of tile rows included in slice 1.

[0622] As described above, when only two slices are included in the picture, although encoding of information indicating the difference of tile indexes is omitted, the index of the upper left tile in all slices may be derived. Therefore, when the number of slices included in the picture is equal to or less than 2, encoding / decoding of syntax tile_idx_delta_present_flag indicating whether tile index difference information is encoded / decoded may be omitted, and the value may be inferred to be 0. Therefore, encoding / decoding of tile_idx_delta[i] for each slice may be omitted.

[0623] Table 15 represents a syntax structure for omitting encoding / decoding of the syntax tile_idx_delta_present_flag when the number of slices included by the current picture is equal to or less than 2.

[0624]

Form 15

[0625]

[0626]

[0627] As in the example of Table 15, the syntax tile_idx_delta_present_flag may be encoded / decoded only when the syntax num_slices_in_pic_minus1 is greater than 1.

[0628] Even when the number of tile columns in a picture is 1 or when the number of tile rows is 1, although tile index difference information is not used, the position of the top left tile in each slice can be identified.

[0629] Fig.39 : is a diagram showing a case where the number of tile columns or tile rows in a picture is 1.

[0630] Fig.39(a) shows an example where a picture includes 1 parallel block column, and Fig.39 (b) shows an example in which a picture includes 1 parallel block row.

[0631] When a picture includes 1 tile column, the index of the top left tile of the slice can be derived based on the height of the previous slice. Fig.39 In the example shown in (a), when the first tile is partitioned into two slices, the syntax slice_width_in_tiles_minus1[0] indicating the width for the first slice slice0 of the two slices and the syntax slice_width_in_tiles_minus1[0] indicating the height for the first slice slice0 of the two slices may both be set to 0. Since the second slice slice1 belongs to the same tile as the first slice slice0, encoding / decoding of the syntax slice_width_in_tiles_minus1[i] and the syntax slice_width_in_tiles_minus1[i] indicating the height may be omitted for the second slice slice1.

[0632] The index of the left tile of the third slice can be set to the number of tile rows signaled for the previous slice. In this example, from the syntax slice_height_in_tiles_minus1[0] signaled for slice0, it can be recognized that 1 tile row is organized with slices, so the index of the top left tile row of slice2 can be set to 1.

[0633] The index of the top left tile row of slice3 can be derived based on the height of the tile row of the previous slice. In the example, from the syntax slice_height_in_tiles_minus1[0] signaled for slice0 and the syntax slice_height_width_in_tiles_minus1[2] signaled for slice2, it can be recognized that a total of 3 tile rows are organized using slices, so the index of the top left tile row of slice3 can be set to 3.

[0634] In other words, when a picture includes 1 tile column, the number of tile rows occupied by a previous slice may be determined as an index of an upper left tile of a subsequent slice.

[0635] When a picture includes 1 tile row, the index of the top left tile of the stripe can be derived based on the width of the previous stripe. Fig.39In the example shown in (b), when the first tile is set to 1 slice, both the syntax slice_width_in_tiles_minus1[0] indicating the width for the first slice slice0 and the syntax slice_width_in_tiles_minus1[0] indicating the height for the first slice slice0 are set to 0.

[0636] The index of the left tile of the second slice can be set to the number of tile columns signaled for the previous slice. In this example, from the syntax slice_width_in_tiles_minus1[0] signaled for slice0, it can be recognized that 1 tile column is organized with slices, so the index of the top left tile row of slice1 can be set to 1.

[0637] The index of the top left tile row of slice2 can be derived based on the height of the tile column of the previous slice. In the example, it can be recognized from the syntax slice_width_in_tiles_minus1[0] signaled for slice0 and the syntax slice_width_width_in_tiles_minus1[1] signaled for slice1 that a total of 3 tile columns are organized using slices, so the index of the top left tile row of slice2 can be set to 3.

[0638] In other words, when a picture includes 1 tile row, the number of tile columns occupied by a previous slice may be determined as an index of an upper left tile of a subsequent slice.

[0639] As described above, when a picture is configured with only 1 tile column or 1 tile row, the index of the upper left tile of each slice may be specified without tile index difference information. Therefore, when the number of tile columns or tile rows included in the picture is 1, encoding / decoding of the syntax tile_idx_delta_present_flag indicating whether tile index difference information is encoded / decoded may be omitted, and the value may be inferred to be 0. Therefore, encoding / decoding of tile_idx_delta[i] for each slice may be omitted.

[0640] Table 16 represents a syntax structure for omitting encoding / decoding of the syntax tile_idx_delta_present_flag when the number of tile columns or tile rows included in the current picture is 1.

[0641]

Form 16

[0642]

[0643] As described above, when the syntax slice_width_in_tiles_minus1[i] indicating the width of a slice and the syntax slice_height_in_tiles_minus1[i] indicating the height of a slice are 0, it may indicate that a slice is configured with one tile or one tile is configured with a plurality of slices.

[0644] When a tile is configured with a plurality of stripes, the heights of the plurality of stripes may be set to have the same value, or the stripes except the last stripe in the plurality of stripes may be set to have the same height. In this case, the height information may be signaled only for the first stripe in the tile.

[0645] When the number of slices in a picture is 2, the size and position of each slice may be determined only by the tile index difference between two slices. Therefore, when the value of the syntax tile_idx_delta_present_flag indicating that the tile index difference is encoded is 1 and the value of the syntax num_slice_in_pic_minus1 indicating the number of slices in a picture is 1, encoding / decoding of the syntax slice_width_in_tiles_minus1 indicating the width of the slice and the syntax slice_height_in_tiles_minus1 indicating the height of the slice may be omitted. Table 17 shows an example thereof.

[0646]

Form 17

[0647]

[0648]

[0649]

[0650] As shown in Table 17, when the value of the syntax tile_idx_delta_present_flag is 1 and num_slices_in_pic_minus1 is 1, encoding / decoding of the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] may be omitted.

[0651] In other words, when the value of the syntax tile_idx_delta_present_flag is 0, or when the value of num_slices_in_pic_minus1 is not 1, the syntax slice_width_in_tiles_minus1[i] and / or the syntax slice_height_in_tiles_minus1[i] may be encoded / decoded.

[0652] When encoding / decoding of the syntax slice_width_in_tiles_minus1[i] and the syntax slice_height_in_tiles_minus1[i] is omitted, the decoder may derive the height or width of each slice by considering at least one of a slice index difference between two slices, a slice column number, or a slice row number.

[0653] In an example, when the value of the syntax tile_idx_delta[i] indicating the difference in tile index between two slices is less than the variable NumTileColumns indicating the number of tile columns in the picture, the value of the syntax slice_width_in_tiles_minus1[i] may be inferred as a value obtained by subtracting 1 from the difference value indicated by the syntax tile_idx_delta[i]. In addition, the value of the syntax slice_height_in_tiles_minus1[i] may be inferred as a value obtained by subtracting 1 from the variable NumTileRows indicating the number of tile rows. In other words, the width of the first slice in the picture may be set to the same value as the syntax tile_idx_delta[0], and the height of the first slice may be set to the same as the number of tile columns.

[0654] In an example, when the value of the syntax tile_idx_delta[i] representing the difference in tile index between two slices is the same as or greater than the variable NumTileColumns representing the number of tile columns in the picture, the value of the syntax slice_width_in_tiles_minus1[i] may be inferred as a value obtained by subtracting 1 from the variable NumTileColumns representing the number of tile columns. In addition, the value of the syntax slice_height_in_tiles_minus1[i] may be inferred as a value obtained by dividing the syntax tile_idx_delta[i] by the number of tile columns NumTileColumns (i.e., tile_idx_delta[i] / NumTileColumns). In other words, the width of the first slice in the picture may be set to the same value as the number of tile columns, and the height of the first slice may be set to the same value as the quotient obtained by dividing the syntax tile_idx_delta[0] by the variable NumTileColumns.

[0655] When the values ​​of the syntax slice_width_in_tiles_minus1[i] indicating the size of the i-th slice and the syntax slice_height_in_tiles_minus1[i] indicating the height of the slice are both 0, information for determining the partition shape of the tile including the i-th slice (e.g., the syntax num_exp_slice_in_tiles[i] and / or the syntax exp_slice_height_in_ctus_minus1[j]) may be encoded / decoded.

[0656] In this case, whether information for determining a partition shape of a tile is encoded / decoded may be determined based on a height of a tile row.

[0657] Whether to encode / decode the syntax tile_idx_delta[i] may be determined based on the number of tiles in the picture. Table 18 shows an example for this description.

[0658]

Form 18

[0659]

[0660]

[0661] In Table 18, the variable NumTileInPic represents the number of slices in the picture. When the number of tiles in the picture is equal to or less than the threshold, the encoding / decoding of the syntax tile_idx_delta[i] representing the tile index difference value can be omitted. The threshold value can be a natural number such as 1, 2, or 3. In Table 18, it is shown that the threshold value is 1. In other words, when the tile in the picture is 1, only one tile can be partitioned into multiple slices. Therefore, the syntax difference value for all slices is 0, so the encoding / decoding of the syntax tile_idx_delta[i] can be omitted.

[0662] In another example, whether to encode / decode the syntax tile_idx_delta_present_flag indicating whether the parallel block index difference is decoded may be determined based on the number of parallel blocks in the picture. In the example, when the number of parallel blocks in the picture is equal to or less than a threshold, encoding / decoding of the syntax tile_idx_delta_present_flag may be omitted. The threshold may be a natural number such as 1, 2, or 3. When encoding / decoding of the syntax tile_idx_delta_present_flag is omitted, the value of the syntax may be inferred to be 0. Therefore, the syntax tile_idx_delta[i] indicating the parallel block index difference may not be encoded / decoded.

[0663] In the above-described embodiments, a slice may be defined based on an index of a coding tree unit instead of an index of a tile.

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

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

[0666] Although the above embodiments are described based on a series of operations or flow charts, the embodiments are not limited to the time sequence of the operations of the method. In another example, these operations may be performed simultaneously, or may be performed in different orders, as required. In addition, in the above embodiments, each of the components (e.g., units, modules, etc.) constituting the block diagram may be implemented in the form of a hardware device or software. Multiple components may be combined with each other into a single component that may be implemented using a single hardware device or software. The above embodiments may be implemented using program instructions that may be run via various computer components. The instructions may be recorded in a computer-readable storage medium. The computer-readable storage medium may include program instructions, data files, data structures, etc. that are separate or combined with each other. Examples of computer-readable storage media include magnetic media (such as hard disks, floppy disks, and tapes), optical storage media (such as CD-ROMs, DVDs), and magneto-optical media (such as floppy disks), and hardware devices (such as ROMs, RAMs, flash memories, etc.) that are specifically configured to store and run program instructions. The hardware device may be configured to operate as one or more software modules to perform processing according to the present disclosure, or vice versa.

[0667] Industrial availability

[0668] 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: When the current picture includes a plurality of tiles, decoding a rectangular slice flag indicating whether a rectangular slice mode is applied to the current picture; as well as When the rectangular stripe mode is applied to the current picture, determining a stripe having a rectangular shape in the current picture including a first stripe and a second stripe, wherein an index assigned to the second stripe is greater than an index assigned to the first stripe by 1, wherein the tile index difference information is decoded from the bitstream, wherein the tile index difference information specifies a difference between an index of an upper left tile of a first slice and an index of an upper left tile of a second slice, wherein the index of the top left tile of the second slice is determined by adding the difference specified by the tile index difference information to the index of the top left tile of the first slice, and Whether to decode the width information for the second slice from the bitstream is determined based on whether the upper left tile of the second slice is included in the rightmost tile column in the current picture.

2. The method according to claim 1, wherein: The width information indicates a value minus 1 from the number of tile columns included in the second slice, and When the upper left tile of the second slice is included in the rightmost tile column in the current picture, decoding of the width information for the second slice is omitted and a value of the width information is inferred to be 0.

3. The method according to claim 2, wherein: Whether the top left tile of the second slice is included in the rightmost tile column is determined based on a modulo operation between an index of the top left tile of the second slice and the number of tile columns in the current picture.

4. The method according to claim 1, wherein: Whether to decode height information for the second slice from the bitstream is determined based on whether the upper left tile of the second slice is included in a lowermost tile row in the current picture.

5. The method according to claim 4, wherein: The height information indicates a value minus 1 from the number of tile rows included in the second slice, and When the upper left tile of the second slice is included in the lowermost tile row in the current picture, decoding of the height information for the second slice is omitted and the value of the height information is inferred to be 0.

6. The method according to claim 5, wherein: Whether the top left tile of the second slice is included in the bottommost tile row is determined based on a division operation between an index of the top left tile of the second slice and the number of tile columns in the current picture.

7. The method according to claim 1, wherein: The method further comprises: decoding a parallel block index difference value existence flag, wherein the parallel block index difference value existence flag indicates whether the parallel block index difference value information exists in the bit stream, and Wherein, whether to decode the tile index difference value existence flag from the bitstream is determined based on the number of slices included in the current picture.

8. A method for encoding a video, the method comprising: When the current picture includes a plurality of tiles, encoding a rectangular slice flag indicating whether a rectangular slice mode is applied to the current picture; as well as When the rectangular stripe mode is applied to the current picture, determining a stripe having a rectangular shape in the current picture including a first stripe and a second stripe, wherein an index assigned to the second stripe is greater than an index assigned to the first stripe by 1, wherein the parallel block index difference information is encoded into a bitstream, wherein the parallel block index difference information specifies a difference between an index of an upper left parallel block of a first stripe and an index of an upper left parallel block of a second stripe, wherein the tile index difference information has a value derived by subtracting an index of the upper left tile of the second slice from an index of the upper left tile of the first slice, and Whether to encode width information for the second slice into the bitstream is determined based on whether the upper left tile of the second slice is included in the rightmost tile column in the current picture.

9. The method according to claim 8, wherein: The width information indicates a value minus 1 from the number of tile columns included in the second slice, and When the upper left tile of the second slice is included in the rightmost tile column in the current picture, encoding of the width information for the second slice is omitted.

10. The method according to claim 8, wherein: Whether to encode height information for the second slice into the bitstream is determined based on whether the upper left tile of the second slice is included in a lowermost tile row in the current picture.

11. The method according to claim 10, wherein: The height information indicates a value minus 1 from the number of tile rows included in the second slice, and When the upper left tile of the second slice is included in the lowermost tile row in the current picture, encoding of the height information for the second slice is omitted.

12. An apparatus for transmitting compressed video data, the apparatus comprising: A processor configured to obtain the compressed video data; as well as a sending unit, configured to send the compressed video data, The operation of obtaining the compressed video data includes: When a current picture includes a plurality of tiles, encoding a rectangular slice flag indicating whether a rectangular slice mode is applied to the current picture; and When the rectangular stripe mode is applied to the current picture, determining a stripe having a rectangular shape in the current picture including a first stripe and a second stripe, wherein an index assigned to the second stripe is greater than an index assigned to the first stripe by 1, wherein the parallel block index difference information is encoded into a bitstream, wherein the parallel block index difference information specifies a difference between an index of an upper left parallel block of a first stripe and an index of an upper left parallel block of a second stripe, wherein the tile index difference information has a value derived by subtracting an index of the upper left tile of the second slice from an index of the upper left tile of the first slice, and Whether to encode width information for the second slice into the bitstream is determined based on whether the upper left tile of the second slice is included in the rightmost tile column in the current picture.