Method and device for encoding / decoding image signal
By partitioning the picture into multiple sub-pictures and encoding their characteristic information, the problem of low high-definition video encoding efficiency in the prior art is solved, and more efficient video signal encoding and decoding is achieved.
Patent Information
- Application Number
- CN202080006001.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-11-15
- Filing Date
- 2020-08-20
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2040-08-20
AI Technical Summary
When existing video encoding technology processes high-definition video, the data volume is large and the compression performance is limited, making it difficult to meet the needs of high-quality video services.
By partitioning the picture into multiple sub-screens and encoding and decoding the feature information of the sub-screen, the encoding and decoding efficiency of the video signal is improved.
It improves the encoding and decoding efficiency of video signals, can process high-definition video more effectively, and meets the needs of high-quality video services.
Smart Images

Figure CN112970251B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a video signal encoding / decoding method and a device thereof. Background Art
[0002] As display panels become larger, higher quality video services are required. The biggest problem with high-definition video services is the greatly increased amount of data. 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
[0003] Technical Purpose
[0004] An object of the present disclosure is to provide a method for partitioning a picture into a plurality of sub-pictures when encoding / decoding a video signal and a device for performing the method.
[0005] The present disclosure aims to provide a method for encoding / decoding feature information of a sub-picture when encoding / decoding a video signal and a device for executing the method.
[0006] 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.
[0007] Technical Solution
[0008] A video signal decoding method according to the present disclosure includes: determining whether a picture is partitioned into multiple sub-pictures; when it is determined that the picture is partitioned into the multiple sub-pictures, partitioning the picture into the multiple sub-pictures; and determining whether the multiple sub-pictures are independent. In this case, the step of determining whether the multiple sub-pictures are independent is based on a first flag indicating whether all of the multiple sub-pictures are independent.
[0009] A video signal encoding method according to the present disclosure includes: determining whether a picture is partitioned into a plurality of sub-pictures; when it is determined that the picture is partitioned into the plurality of sub-pictures, partitioning the picture into the plurality of sub-pictures; and determining whether the plurality of sub-pictures are independent. In this case, a first flag indicating whether all of the plurality of sub-pictures are independent can be encoded in a bitstream.
[0010] In the video signal decoding method according to the present disclosure, when the first flag indicates that at least one of the multiple sub-pictures is not independent, a second flag indicating whether each sub-picture is independent may be parsed for each of the multiple sub-pictures.
[0011] In the video signal decoding method according to the present disclosure, the step of partitioning the picture may include: determining the number of multiple sub-pictures included in the picture, and determining position information and size information of each of the multiple sub-pictures.
[0012] In the video signal decoding method according to the present disclosure, for the first sub-picture among the plurality of sub-pictures, signal transmission of the position information may be omitted.
[0013] In the video signal decoding method according to the present disclosure, for the last sub-picture among the plurality of sub-pictures, signal transmission of size information may be omitted.
[0014] In the video signal decoding method according to the present disclosure, the size information may include width information indicating the number of coding tree units in a horizontal direction in a sub-picture and height information indicating the number of coding tree units in a vertical direction in the sub-picture.
[0015] The features briefly summarized for the present disclosure are merely exemplary aspects of the detailed description of the following description of the present disclosure and do not limit the scope of the present disclosure.
[0016] Technical Effects
[0017] According to the present disclosure, encoding / decoding efficiency may be improved by partitioning a picture into a plurality of sub-pictures.
[0018] According to the present disclosure, encoding / decoding efficiency can be improved by encoding / decoding attribute information of a sub-picture.
[0019] 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 pertains. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1is a diagram illustrating a block diagram of a video encoding device (encoder) according to an embodiment of the present disclosure.
[0021] Figure 2 is a diagram showing a block diagram of a video decoding device (decoder) according to an embodiment of the present disclosure.
[0022] Figure 3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.
[0023] Figure 4 is a diagram illustrating various partition types of a coding block.
[0024] Figure 5 is a diagram illustrating an example of one aspect of partitioning a CTU.
[0025] Figure 6 is a flowchart of an inter-frame prediction method according to an embodiment of the present disclosure.
[0026] Figure 7 is a flow chart of a process for deriving motion information for a current block in merge mode.
[0027] Figure 8 is a diagram illustrating candidate blocks for deriving merge candidates.
[0028] Fig. 9 is a diagram illustrating candidate blocks for deriving merge candidates.
[0029] Fig.10 is a diagram for explaining the updating aspect of the motion information table.
[0030] Fig.11 is a diagram illustrating an updating aspect of a motion information table.
[0031] Fig.12 : is a diagram showing an example of updating the index of the saved motion information candidate.
[0032] Fig.13 is a diagram showing the positions of representative sub-blocks.
[0033] Fig.14 is a diagram of an example in which a redundancy check is performed only on a part of merge candidates.
[0034] Fig.15 is a diagram illustrating an example of omitting a redundant check with a specific merge candidate.
[0035] Fig.16 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.
[0036] Fig.17is 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.
[0037] Fig.18 is a diagram showing a temporary motion information table.
[0038] Fig.19 is a diagram showing an example in which a motion information table and a temporary motion information table are unified.
[0039] Fig. 20 is a flowchart of an intra-frame prediction method according to an embodiment of the present disclosure.
[0040] Fig.21 is a diagram showing an intra prediction mode.
[0041] Fig. 22 and Fig.23 is a diagram showing an example of a one-dimensional array in which reference spots are arranged in rows.
[0042] Fig.24 is a diagram showing an angle formed by a directional intra prediction mode and a straight line parallel to the x-axis.
[0043] Fig.25 is a diagram illustrating an aspect of obtaining prediction samples when a current block has a non-square shape.
[0044] Fig.26 is a diagram illustrating a wide-angle intra prediction mode.
[0045] Fig. 27 : is a diagram showing an example of partitioning in a vertical direction and partitioning in a horizontal direction.
[0046] Fig.28 is a diagram illustrating an example of determining a partition shape of a coding block.
[0047] Fig.29 is a diagram illustrating an example of determining a partition shape of a coding block.
[0048] Fig.30 is a diagram illustrating an example of determining whether to perform transform skip for each subblock.
[0049] Fig.31 is a diagram showing an example in which sub-blocks use the same transform type.
[0050] Fig.32 and Fig.33 is a diagram illustrating application aspects of the sub-transform block coding method.
[0051] Fig.34 and Fig.35A horizontal direction transform type and a vertical direction transform type according to the position of a subblock as a transform target are shown.
[0052] Fig.36 is a diagram showing aspects of encoding of transform coefficients when the reduction factor is 16.
[0053] Fig.37 and Fig.38 is a diagram showing an area of a target for the second transformation.
[0054] Fig.39 is an example showing various inseparable transformation matrix candidates.
[0055] Fig.40 is a diagram for describing partition shapes that can be applied to a screen.
[0056] Fig.41 is a flowchart of a method for partitioning a screen into at least one sub-screen according to an embodiment of the present disclosure.
[0057] Fig.42 is an example for describing determination of position information of a sub-picture according to a partition aspect of a picture.
[0058] Fig.43 is an example for describing determination of size information of a sub-picture according to a partition aspect of a picture. DETAILED DESCRIPTION
[0059] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
[0060] Image encoding and decoding are performed on a block basis. In an example, encoding / decoding processes such as transform, quantization, prediction, in-loop filtering, reconstruction, etc. may be performed on a coding block, a transform block, or a prediction block.
[0061] Hereinafter, the encoding / decoding target block is referred to as a “current block.” In an example, the current block may refer to a coding block, a transform block, or a prediction block according to a current encoding / decoding process.
[0062] In addition, the term "unit" used in this specification means a basic unit for performing a specific encoding / decoding process, and "block" can be understood to mean a sample array having a predetermined size. Unless otherwise specified, "block" and "unit" can be used interchangeably. In the example, the coding block and the coding unit can be understood to have the same meaning as each other in the examples described later.
[0063] Figure 1 is a diagram showing a block diagram of an image encoding device (encoder) according to an embodiment of the present disclosure.
[0064] Reference Figure 1The 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.
[0065] Figure 1 The components described in the figure are shown independently in order to illustrate different characteristic functions in the image encoding device, and the figure does not mean that each component is composed of separate hardware or a software unit. That is, each component is listed only for the convenience of explanation, at least two of the components may constitute 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.
[0066] In addition, some components are not essential components for performing the essential functions of the present disclosure, but are optional components only for improving performance. The present disclosure may be implemented using essential components for implementing the spirit of the present disclosure other than components only for improving performance, and a structure including only essential components other than optional components only for improving performance is also included in the scope of the present disclosure.
[0067] The picture partition unit 110 may partition the input picture into at least one processing unit. In this regard, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). In the picture partition unit 110, a single picture may be partitioned into a plurality of combinations of a plurality of coding units, prediction units, and transform units, and the picture may be encoded by selecting a combination of coding units, prediction units, and transform units according to a predetermined condition (e.g., a cost function).
[0068] For example, a single picture may be partitioned into a plurality of coding units. In order to partition a picture into coding units, a recursive tree structure such as a quadtree structure may be used, and a coding unit derived from a root such as a single image or a maximum coding unit may be partitioned into other coding units and may have as many child nodes as the partitioned coding units. Coding units that are no longer partitioned according to certain restrictions become leaf nodes. That is, when it is assumed that only square partitions are available for a single coding unit, a single coding unit may be partitioned into up to four other coding units.
[0069] Hereinafter, in an embodiment of the present disclosure, a coding unit may be used as a unit for encoding, or may be used as a unit for decoding.
[0070] The prediction units may be obtained by partitioning a single coding unit into at least one square or rectangle having the same size, or may be partitioned into prediction units in such a manner that one prediction unit may be different in shape and / or size from another prediction unit.
[0071] 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.
[0072] 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.
[0073] The inter-frame prediction unit 120 may predict the prediction unit based on information about at least one of a previous picture and a subsequent picture of the current picture, or in some cases, may predict the prediction unit based on information about some encoded regions in the current picture. The inter-frame prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
[0074] The reference picture interpolation unit may receive reference picture information from the memory 155, and may generate pixel information of integer pixels or smaller pixels from the reference picture. In the case of luma pixels, an 8-tap DCT-based interpolation filter with different coefficients may be used to generate pixel information about integer pixels or smaller pixels in units of 1 / 4 pixels. In the case of chroma pixels, a 4-tap DCT-based interpolation filter with different filter coefficients may be used to generate pixel information about integer pixels or smaller pixels in units of 1 / 8 pixels.
[0075] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods such as a full search based matching algorithm (FBMA), a three-step search (TSS) algorithm, a new three-step search (NTS) algorithm, etc. may be used as a method for calculating a motion vector. The motion vector may have a motion vector value in units of 1 / 2 pixel or 1 / 4 pixel based on the interpolated pixel. The motion prediction unit may predict the current prediction unit by changing the motion prediction method. Various methods such as a skip method, a merge method, an advanced motion vector prediction (AMVP) method, an intra-block copy method, etc. may be used as a motion prediction method.
[0076] The 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 partition 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 partition 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.
[0077] The prediction mode under the intra prediction may include a directional prediction mode that uses reference pixel information according to a prediction direction when performing prediction, and a non-directional mode that does not use directional information when performing prediction. The mode for predicting luma information may be different from the mode for predicting chroma information. In order to predict chroma information, information about the intra prediction mode for predicting luma information or information about the predicted luma signal may be used.
[0078] When performing intra prediction, when the size of the prediction unit is the same as the size of the transformation unit, intra prediction may be performed on the prediction unit based on pixels located at 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 may be performed by using reference pixels based on the transformation unit. In addition, intra prediction using N×N partitions may be used only for the minimum coding unit.
[0079] In the intra prediction method, a prediction block may be generated after an adaptive intra smoothing (AIS) filter is applied to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels may vary. In order to perform the intra prediction method, an intra prediction mode for a current prediction unit may be predicted from intra prediction modes of prediction units existing around the current prediction unit. 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.
[0080] 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.
[0081] The transform unit 130 may perform a transform on the residual block by using a transform method such as discrete cosine transform (DCT) or discrete sine transform (DST), wherein the residual block includes information about a residual value between the original block and the prediction unit generated by the prediction unit 120 or 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.
[0082] The quantization unit 135 may perform quantization on the value transformed into the frequency domain by the transformation unit 130. The quantization coefficient may vary according to the importance or block of the image. The value calculated in the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.
[0083] The rearrangement unit 160 may perform rearrangement on the transform coefficients with respect to the quantized residual values.
[0084] The rearrangement unit 160 may change the coefficients in the two-dimensional block form into coefficients in the one-dimensional vector form by a coefficient scanning method. For example, the rearrangement unit 160 may scan from the DC coefficient to the coefficients in the high frequency domain by using a zigzag scanning method so as to change the coefficients into the one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical direction scanning of scanning the coefficients in the two-dimensional block form along the column direction or horizontal direction scanning of scanning the coefficients in the two-dimensional block form along the row direction may be used instead of the zigzag scanning. In other words, which scanning method to use among the zigzag scanning, the vertical direction scanning, and the horizontal direction scanning may be determined according to the size of the transform unit and the intra-frame prediction mode.
[0085] The entropy encoding unit 165 may perform entropy encoding based on the value calculated by the rearrangement unit 160. The entropy encoding may use various encoding methods, for example, exponential Golomb coding, context adaptive variable length coding (CAVLC), or context adaptive binary arithmetic coding (CABAC).
[0086] The entropy coding unit 165 may encode various types of information obtained from the rearrangement unit 160 and the prediction units 120 and 125 (such as information about residual value coefficients and information about a block type of a coding unit, information about a prediction mode, information about a partition unit, information about a prediction unit and information about a transform unit, information about a motion vector, information about a reference frame, information about block interpolation, filtering information, and the like).
[0087] The entropy encoding unit 165 may entropy encode coefficients of the coding unit input from the rearrangement unit 160 .
[0088] The inverse quantization unit 140 may perform inverse quantization on the value quantized in the quantization unit 135, and the inverse transform unit 145 may perform inverse transform on the value transformed in the transform unit 130. The residual value generated by the inverse quantization unit 140 and the inverse transform unit 145 may be added to 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.
[0089] The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
[0090] The deblocking filter can remove the block distortion that occurs due to the boundary 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] Figure 2 is a diagram showing a block diagram of an image decoding device (decoder) according to an embodiment of the present disclosure.
[0095] Reference Figure 2 , the image decoding apparatus 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.
[0096] When an image bitstream is input from an encoder, the input bitstream may be decoded according to an inverse process of the image encoding apparatus.
[0097] The entropy decoding unit 210 may perform entropy decoding according to an inverse process of entropy encoding performed by an entropy encoding unit of an image encoder. For example, 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.
[0098] The entropy decoding unit 210 may decode information about intra prediction and inter prediction performed by the encoder.
[0099] The rearrangement unit 215 may perform rearrangement on the bit stream entropy-decoded by the entropy decoding unit 210 based on the rearrangement method used in the encoder. 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.
[0100] The inverse quantization unit 220 may perform inverse quantization based on the quantization parameter received from the encoder and the coefficient values of the rearranged partitions.
[0101] The inverse transform unit 225 may perform an inverse transform (i.e., inverse DCT or inverse DST) for the transform (i.e., DCT or DST) performed on the quantization result by the transform unit in the image encoder. In this regard, the DCT transform core may include at least one of DCT2 or DCT8, and the DST transform core may include DST7. Optionally, when the transform is skipped in the image encoder, the inverse transform is not performed in the inverse transform unit 225. The inverse transform may be performed based on the transform unit determined by the image encoder. The inverse transform unit 225 of the image decoder may selectively perform a transform method (e.g., DCT or DST) according to a plurality of pieces of information (such as a prediction method, a size of a current block, a prediction direction, etc.).
[0102] The prediction unit 230 or 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 .
[0103] As described above, like the operation of the image encoder, in the process of performing intra prediction, when the size of the prediction unit is the same as the size of the transformation unit, intra prediction may be performed on the prediction unit based on pixels located on the left, upper left, and top of the prediction unit. However, in the process of performing intra prediction, when the size of the prediction unit is different from the size of the transformation unit, intra prediction may be performed based on the transformation unit by using reference pixels. In addition, intra prediction by using N×N partitions may be used only for the minimum coding unit.
[0104] 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.
[0105] In order to perform inter prediction, which method of the skip mode, the merge mode, the AMVP mode, or the intra block copy mode is used as a motion prediction method for a prediction unit included in the coding unit may be determined based on the coding unit.
[0106] The intra prediction unit 235 may generate a prediction block based on information about pixels within the current picture. When the prediction unit is a prediction unit 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.
[0107] When the prediction mode of the prediction unit is a prediction mode for performing intra prediction based on a pixel value obtained by interpolating reference pixels, the reference pixel interpolation unit may interpolate the reference pixels so as to generate reference pixels having 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.
[0108] The reconstructed block or the reconstructed picture may be provided to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset correction module, and an ALF.
[0109] Information about whether a deblocking filter has been applied to a corresponding block or picture and information about whether a strong filter or a weak filter is applied when the deblocking filter is applied may be received from the image encoder. A deblocking filter of an image decoder may receive information about the deblocking filter from the image encoder, and the image decoder may perform deblocking filtering on the corresponding block.
[0110] The offset correction unit may perform offset correction on the reconstructed image based on the type of offset correction applied to the image when encoding is performed, information about the offset value, and the like.
[0111] ALF may be applied to the coding unit based on information on whether ALF is applied, information on an ALF coefficient, etc. received from the encoder. The above ALF information may be provided by being included in a specific parameter set.
[0112] In the memory 245 , the reconstructed picture or the reconstructed block may be stored in order to be used as a reference picture or a reference block, and the reconstructed picture may be provided to the output unit.
[0113] Figure 3 is a diagram illustrating a basic coding tree unit according to an embodiment of the present disclosure.
[0114] The largest coding block may be defined as a coding tree block. A single picture may be partitioned into a plurality of coding tree units (CTUs). A CTU may be a coding unit of the largest size and may be referred to as a largest coding unit (LCU). Figure 3 is a diagram showing an example in which a single picture is partitioned into a plurality of CTUs.
[0115] The size of 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.
[0116] In an example, the size of the CTU for the entire picture within the sequence may be set to 128×128. Alternatively, any one of 128×128 or 256×256 may be determined as the size of the CTU at 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.
[0117] A coding block can be generated by partitioning the CTU. A coding block represents a basic unit for performing encoding / decoding. In an example, prediction or transformation can be performed for each coding block, and optionally, a prediction coding mode can be determined for each coding block. In this regard, the prediction coding mode represents a method for generating a predicted image. In an example, the prediction coding mode may include intra-frame prediction, inter-frame prediction, current picture reference (CPR), intra-frame block copy (IBC), or combined prediction. For a coding block, a prediction block of the coding block can be generated by using a prediction coding mode of at least one of intra-frame prediction, inter-frame prediction, current picture reference, or combined prediction.
[0118] Information indicating the prediction coding mode for the current block may be signaled in the bitstream. In an example, the information may be a 1-bit flag indicating whether the prediction coding mode is an intra mode or an inter mode. When the prediction coding mode for the current block is determined to be an inter mode, current picture reference or combined prediction may be available.
[0119] The current picture reference is to set the current picture as the reference picture and obtain the prediction block of the current block from the area 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.
[0120] Alternatively, the prediction coding mode for the current block may be determined based on the reference picture index. In an example, when the reference picture index indicates the current picture, the prediction coding mode for the current block may be determined as the current picture reference. When the reference picture index indicates a picture other than the current picture, the prediction coding mode for the current block may be determined as the inter-frame prediction. In other words, the current picture reference is a prediction method using information about an area that has been encoded / decoded within the current picture, and the inter-frame prediction is a prediction method using information about another picture that has been encoded / decoded.
[0121] Combined prediction refers to a combined coding mode that combines at least two of intra prediction, inter prediction, and current picture reference. In 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.
[0122] Figure 4 is a diagram illustrating various partition types of a coding block.
[0123] The coding block may be partitioned into a plurality of coding blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning. The partitioned coding block may be partitioned into a plurality of coding blocks based on quadtree partitioning, binary tree partitioning, or ternary tree partitioning.
[0124] Quadtree partitioning represents a method of partitioning the current block into four blocks. As a result of quadtree partitioning, the current block can be partitioned into four square partitions (refer to Figure 4 of "SPLIT_QT").
[0125] Binary tree partitioning refers to a method of partitioning a current block into two blocks. An operation of partitioning a current block into two blocks 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.
[0126] Ternary tree partitioning means a method of partitioning a current block into three blocks. The operation of partitioning a current block into three blocks along a vertical direction (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" is a diagram showing the result of ternary tree partitioning in the vertical direction. Figure 4 “SPLIT_TT_HOR” is a diagram showing the result of ternary tree partitioning in the horizontal direction.
[0127] The number of partitions of a CTU may be defined as a partition depth. The maximum partition depth of a CTU may be determined at a sequence level or a picture level. Therefore, the maximum partition depth of a CTU may vary based on a sequence or a picture.
[0128] Optionally, the maximum partition depth may be determined independently for each partitioning method. In an example, the maximum partition depth allowed for quadtree partitioning may be different from the maximum partition depth allowed for binary tree partitioning and / or ternary tree partitioning.
[0129] The encoder may signal information indicating at least one of a partition type and a partition depth of 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.
[0130] Figure 5 is a diagram illustrating an example of one aspect of partitioning a CTU.
[0131] An operation of partitioning a coding block by using quadtree partitioning, binary tree partitioning, and / or ternary tree partitioning may be referred to as multitree partitioning.
[0132] A coding block generated by partitioning a coding block by applying multi-tree partitioning may be referred to as a sub coding block. When the partition depth of the coding block is k, the partition depth of the sub coding block is set to k+1.
[0133] In contrast, for a coding block whose partition depth is k+1, the coding block whose partition depth is k may be referred to as a parent coding block.
[0134] The partition type of the current coding block may be determined based on at least one of the partition type of the parent coding block and the partition type of the adjacent coding block. In this regard, the adjacent coding block may be a partition 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.
[0135] In order to determine the partition type of the coding block, information indicating whether the coding block is partitioned may be signaled in the bitstream. 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.
[0136] 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.
[0137] In the example, Figure 5 In the example shown in , the CTU is partitioned by quadtree partitioning, and thus four coding blocks with a partition depth of 1 are generated. In addition, it is shown that quadtree partitioning is applied again to the first coding block and the fourth coding block among the four coding blocks generated by quadtree partitioning. As a result, four coding blocks with a partition depth of 2 can be generated.
[0138] In addition, by applying quadtree partitioning again to the coding block with a partition depth of 2, a coding block with a partition depth of 3 may be generated.
[0139] When quadtree partitioning is not applied to a coding block, it may be determined whether 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.
[0140] In the example, Figure 5 In the example shown in , vertical binary tree partitioning is applied to a coding block with a partition depth of 1, vertical ternary tree partitioning is applied to a left coding block among the coding blocks generated by the vertical binary tree partitioning, and vertical binary tree partitioning is applied to a right coding block.
[0141] Inter prediction is a prediction coding mode that predicts a current block by using information about a previous picture. In an example, a block 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.
[0142] In contrast, when an object existing in a previous picture has moved to another position in a current picture, the current block can be effectively predicted by using the motion of the object. For example, when the 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.
[0143] The residual block may be generated by subtracting the prediction block from the current block. In this regard, in the case where the object moves, the energy of the residual block may be reduced by using the motion prediction block instead of using the co-located prediction block, and thus the compression performance of the residual block may be improved.
[0144] As above, the operation of generating a prediction block by using motion information may be referred to as motion estimation prediction. In most inter predictions, a prediction block may be generated based on motion compensation prediction.
[0145] The motion information may include at least one of a motion vector, a reference picture index, a prediction direction, and a bidirectional weighting factor index. The motion vector represents the 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.
[0146] Figure 6 is a flowchart of an inter-frame prediction method according to an embodiment of the present disclosure.
[0147] Reference Figure 6 The inter-frame prediction method includes: determining an inter-frame prediction mode for a current block (S601), obtaining motion information of the current block according to the determined inter-frame prediction mode (S602), and performing motion compensation prediction for the current block based on the obtained motion information (S603).
[0148] In this regard, the inter prediction mode may represent various methods for determining motion information of the current block, and may include an inter prediction mode using translational motion information, an inter prediction mode using affine motion information. In an example, the inter prediction mode using translational motion information may include a merge mode and a motion vector prediction mode, and the inter prediction mode using affine motion information may include an affine merge mode and an affine motion vector prediction mode. The motion information about the current block may be determined based on a neighboring block adjacent to the current block or information obtained by parsing a bitstream.
[0149] The motion information of the current block may be derived from the motion information of another block. In this regard, the other block may be a partition that is encoded / decoded by inter-frame prediction before the current block. An operation of setting the motion information of the current block to be the same as the motion information of the other block may be defined as a merge mode. In addition, an operation of 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.
[0150] Figure 7 is a flow chart of a process for deriving motion information for a current block in merge mode.
[0151] A merge candidate of the current block may be derived S701. The merge candidate of the current block may be derived from a partition that is encoded / decoded by inter prediction before the current block.
[0152] Figure 8 is a diagram illustrating candidate blocks for deriving merge candidates.
[0153] 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.
[0154] 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.
[0155] 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 block among the blocks indexed from 5 to 26 may be used as a candidate block.
[0156] 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.
[0157] Hereinafter, a candidate block including neighboring basic samples among candidate blocks is referred to as a neighboring block, and a block including non-neighboring basic samples is referred to as a non-neighboring block.
[0158] When the distance between the current block and the candidate block is equal to or greater than a threshold, the candidate block may be set to be unavailable as a merge candidate. The threshold may be determined based on the size of the coding tree unit. In one example, the threshold may be set to the height of the coding tree unit (ctu_height) or a value obtained by adding the offset to the height of the coding tree unit or subtracting the offset from the height of the coding tree unit (e.g., ctu_height±N). As a predefined value in the encoder and decoder, the offset N may be set to 4, 8, 16, 32, or ctu_height.
[0159] When a difference between the y-axis coordinate of the current block and the y-axis coordinate of a sample included in the candidate block is greater than a threshold value, it may be determined that the candidate block is not usable as a merge candidate.
[0160] Optionally, a candidate block that does not belong to the same coding tree unit as the current block may be set to be unavailable as a merge candidate. In one example, when the base sample is outside the upper boundary of the coding tree unit to which the current block belongs, the candidate block including the base sample may be set to be unavailable as a merge candidate.
[0161] If the upper boundary of the current block is adjacent to the upper boundary of the coding tree unit, multiple candidate blocks may be determined to be unavailable as merge candidates, thereby reducing the encoding / decoding efficiency of the current block. To solve such a problem, the candidate blocks may be set so that the number of candidate blocks at the left position of the current block is greater than the number of candidate blocks at the top position of the current block.
[0162] Fig. 9 is a diagram illustrating candidate blocks for deriving merge candidates.
[0163] As in Fig. 9 In the example shown, the top blocks of the N top block columns belonging to the current block and the left blocks of the M left block columns belonging to the current block can be set as candidate blocks. In this case, the number of left candidate blocks can be set to be greater than the number of top candidate blocks by setting M to be greater than N.
[0164] In an example, the difference between the y-axis coordinates of the basic sample points in the current block and the y-axis coordinates of the top block that can be used as the candidate block may be set to not exceed N times the height of the current block. In addition, the difference between the x-axis coordinates of the basic sample points in the current block and the x-axis coordinates of the left block that can be used as the candidate block may be set to not exceed M times the width of the current block.
[0165] In the example, Fig. 9In the illustrated example, it is shown that blocks belonging to 2 top block columns of the current block and blocks belonging to 5 left block columns of the current block are set as candidate blocks.
[0166] The merging candidate may be derived from a temporally neighboring block included in a different picture from the current block. In an example, the merging candidate may be derived from a co-located block included in a co-located picture. Any one of the reference pictures included in the reference picture list may be set as the co-located picture. Index information identifying the co-located picture among the reference pictures may be signaled in the bitstream. Optionally, a reference picture having a predefined index among the reference pictures may be determined as the co-located picture.
[0167] 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.
[0168] A merge candidate list including merge candidates may be generated S702 .
[0169] 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.
[0170] When multiple merge candidates are included in the merge candidate list, at least one of the multiple merge candidates may be selected S703. 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.
[0171] 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.
[0172] The motion information table includes motion information candidates derived from the partitions 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 partitions 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.
[0173] The motion information candidates included in the motion information table may also be referred to as inter-region merging candidates or prediction region merging candidates.
[0174] 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).
[0175] 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.
[0176] 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.
[0177] 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.
[0178] 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.
[0179] 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 partition that is the first encoding / decoding target in the slice.
[0180] 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.
[0181] The blocks are encoded / decoded in the order of encoding / decoding, and partitions encoded / decoded based on inter-prediction may be sequentially set as motion information candidates in the order of encoding / decoding.
[0182] Fig.10 is a diagram for explaining the updating aspect of the motion information table.
[0183] When inter prediction is performed for a current block S1001, a motion information candidate may be derived based on the current block S1002. The motion information of the motion information candidate may be set to be the same as the motion information of the current block.
[0184] When the motion information table is empty S1003 , the motion information candidate derived based on the current block may be added to the motion information table S1004 .
[0185] When the motion information table already includes motion information candidates S1003, a redundancy check S1005 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.
[0186] 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 S1008. 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.
[0187] In this regard, when the maximum number of motion information candidates are already stored in the motion information table S1006, the oldest motion information candidate may be deleted S1007, and the motion information candidate derived based on the current block may be added to the motion information table S1008. In this regard, the oldest motion information candidate may be a motion information candidate having a maximum or minimum index.
[0188] 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.
[0189] 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 reduced by 1.
[0190] Fig.11 is a diagram illustrating an updating aspect of a motion information table.
[0191] 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.
[0192] 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.11 n) shown in .
[0193] When the same motion information candidate as the motion information candidate derived based on the current block is pre-stored S1005 , the motion information candidate derived based on the current block may not be added to the motion information table S1009 .
[0194] 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.
[0195] Fig.12is a diagram illustrating an example of updating an index of a pre-stored motion information candidate.
[0196] 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.12 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.
[0197] And, the motion information candidate mvCand derived based on the current block may be added to the end of the motion information table.
[0198] 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.
[0199] The motion information of the partitions included in the predetermined area 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 the partitions included in the merge processing area may not be added to the motion information table. Since the encoding / decoding order for the partitions included in the merge processing area is not defined, it is inappropriate to use the motion information of any one of the partitions included in the merge processing area for inter-frame prediction of another block therein. Therefore, the motion information candidate derived based on the partitions included in the merge processing area may not be added to the motion information table.
[0200] Optionally, the motion information of a block smaller than a preset size may be set not to be added to the motion information table. In an example, motion information candidates derived based on motion information of a coding block with a width or height less than 4 or 8 or motion information of a coding block of 4×4 size may not be added to the motion information table.
[0201] When motion compensation prediction is performed in units of subblocks, a motion information candidate may be derived based on motion information of a representative subblock among a plurality of subblocks included in the current block. In an example, when a subblock merge candidate is used for the current block, a motion information candidate may be derived based on motion information of a representative subblock among the subblocks.
[0202] The motion vector of the sub-block may be derived in the following order. First, one of the merge candidates included in the merge candidate list of the current block may be selected, and an initial shift vector (shVector) may be derived based on the motion vector of the selected merge candidate. And, a shifted sub-block having a basic sample position (xColSb, yColSb) may be derived by adding the initial shift vector to the position (xSb, ySb) of the basic sample (e.g., the upper left sample or the center sample) of each sub-block in the coding block. The following equation 1 shows an equation for deriving a shifted sub-block.
[0203] [Equation 1]
[0204] (xColSb, yColSb) = (xSb+shVector[0]>>4, ySb+shVector[1]>>4)
[0205] Then, a motion vector of a co-located block corresponding to a center position of a sub-block including (xColSb, yColSb) may be set as a motion vector of a sub-block including (xSb, ySb).
[0206] The representative sub-block may refer to a sub-block including an upper left sample point, a center sample point, a lower right sample point, an upper right sample point, or a lower left sample point of the current block.
[0207] Fig.13 is a diagram showing the positions of representative sub-blocks.
[0208] Fig.13 (a) represents an example in which a sub-block at the upper left position of the current block is set as a representative sub-block, and Fig.13 (b) represents an example in which a subblock at the center position of the current block is set as a representative subblock. When motion compensation prediction is performed in units of subblocks, a motion information candidate of the current block may be derived based on a motion vector of a subblock including a top left sample of the current block or a subblock including a center sample of the current block.
[0209] 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.
[0210] Alternatively, whether the current block is to be used as a motion information candidate may be determined based on at least one of a motion vector resolution of the current block, whether a merge offset encoding method is applied, whether combined prediction is applied, or whether triangular partitioning is applied. In an example, for at least one of a case where the motion information resolution of the current block is equal to or greater than 2 integer pixels, a case where combined prediction is applied to the current block, a case where triangular partitioning is applied to the current block, or a case where a merge offset encoding method is applied to the current block, the current block may be set to be unusable as a motion information candidate.
[0211] Alternatively, the motion information candidate may be derived based on a sub-block vector of at least one of the sub-blocks included in the block encoded / decoded based on the affine motion model. In an example, the motion information candidate may be derived by using a sub-block at an upper left position, a sub-block at a center position, or a sub-block at an upper right position of the current block. Alternatively, an average value of sub-block vectors of a plurality of sub-blocks may be set as a motion vector of the motion information candidate.
[0212] 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.
[0213] 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.
[0214] The redundancy check may be performed only on a portion of the motion information candidates included in the motion information table. In an example, the redundancy check may be performed only on motion information candidates having an index exceeding or below a threshold. Alternatively, the redundancy check may be performed only on N motion information candidates having a maximum index or a minimum index. Alternatively, the redundancy check may be performed only on a portion of the pre-stored merge candidates in the merge candidate list. In an example, the redundancy check may be performed only on merge candidates whose index exceeds or is below a threshold or on merge candidates derived from a partition 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.
[0215] Fig.14 is a diagram illustrating an example of performing a redundancy check on only a part of merge candidates.
[0216] 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.
[0217] 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].
[0218] 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.
[0219] 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.
[0220] 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.
[0221] 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.
[0222] 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.
[0223] 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.
[0224] 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.
[0225] Fig.15 is a diagram illustrating an example of omitting a redundant check with a specific merge candidate.
[0226] 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.
[0227] In the example, Fig.15 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.
[0228] 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.
[0229] For the merge candidate list of the current block, merge candidates may be added in the following order.
[0230] Spatial merging candidate - Temporal merging candidate - Motion information candidate - (affine motion information candidate) - Paired merging candidate - Zero merging candidate
[0231] 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 partition encoded / decoded by an affine motion model.
[0232] The motion information table may also be used in the motion vector prediction mode. In an example, when the number of motion vector prediction candidates included in the motion vector prediction candidate list of the current block is less than a threshold value, the motion information candidate included in the motion information table may be set as the motion vector prediction candidate of the current block. Specifically, the motion vector of the motion information candidate may be set as the motion vector prediction candidate.
[0233] 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.
[0234] The motion vector prediction candidate list of the current block may be configured in the following order.
[0235] Spatial motion vector prediction candidate - Temporal motion vector prediction candidate - Motion information candidate - (affine motion information candidate) - Zero motion vector prediction candidate
[0236] 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 partition encoded / decoded by an affine motion model. The zero motion vector prediction candidate represents a candidate whose motion vector value is 0.
[0237] 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 sequential encoding / decoding. In this regard, not being encoded / decoded sequentially means that the order of encoding / decoding is not defined. Therefore, the encoding / decoding processing of the blocks included in the merge processing area 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.
[0238] 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).
[0239] 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.
[0240] Fig.16 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.
[0241] exist Fig.16 In the example shown in (a) of FIG. 5 , when decoding / decoding 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.
[0242] exist Fig.16 In the example shown in (b) of FIG. 1 , when decoding / decoding CU8, a partition 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.
[0243] Alternatively, when the current block is included in the merge processing region, neighboring blocks adjacent to the current block and the merge processing region may be set as candidate blocks.
[0244] Fig.17 is a diagram illustrating an example of deriving a merge candidate of a current block when the current block is included in a merge processing region.
[0245] As in Fig.17In 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.
[0246] 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.
[0247] When the number of merge candidates that can be derived from neighboring blocks adjacent to the current block is less than a value obtained by subtracting an offset from the maximum number of merge candidates or the maximum number, as in Fig.17 In the example shown in (b), the merge candidate of the current block can be derived by using the neighboring blocks adjacent to the merge processing area. In the example, the neighboring blocks adjacent to the merge processing area including the coding block CU3 can be set as candidate blocks of the coding block CU3. In this regard, the neighboring blocks adjacent to the merge processing area may include at least one of the left neighboring block x1, the top neighboring block x3, the bottom left neighboring block x0, the top right neighboring block x4, or the top left neighboring block x2.
[0248] The merge candidate may be derived by scanning neighboring blocks adjacent to the merge processing area in a predefined order. In an example, the predefined order may be the order of x1, x3, x4, x0, and x2.
[0249] 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.
[0250] (y1,y3,y4,y0,y2,x1,x3,x4,x0,x2)
[0251] 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.
[0252] 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.
[0253] 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.
[0254] If motion compensated prediction is performed on a partition included in the merge processing region, motion information candidates derived based on motion information of the partition on which motion compensated prediction is performed may be added to the motion information table.
[0255] However, if the motion information candidate derived from the partition included in the merge processing area is added to the motion information table, a situation may occur where the motion information candidate derived from the block is used for encoding / decoding of other blocks in the merge processing area whose encoding / decoding is actually slower than that of the block. In other words, although the dependency between blocks should be excluded when encoding / decoding the partition 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 the encoding / decoding of the partition included in the merge processing area is completed, the motion information of the partition for which encoding / decoding is completed may not be added to the motion information table.
[0256] 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.
[0257] Alternatively, after decoding of all blocks included in the merge processing area is completed, the motion information candidate derived from the block may be added to the motion information table. That is, although the blocks included in the merge processing area are encoded / decoded, the motion information table may not be updated.
[0258] In an example, if motion compensation prediction is performed on a partition 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 partitions having the same motion information.
[0259] 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.
[0260] 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.
[0261] When the current block is included in the merge processing region and the number of merge candidates included in the merge candidate list of the current block is less than the maximum number, the motion information candidate included in the motion information table may be added to the merge candidate list. In this regard, the motion information candidate derived from the partition included in the same merge processing region as the current block may be set not to be added to the merge candidate list of the current block.
[0262] 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.
[0263] In another example, a motion information table for a merge processing region or a coding tree unit may be configured. The motion information table serves to temporarily store motion information of a partition included in the merge processing region. In order to distinguish a general motion information table from a motion information table for a merge processing region or a coding tree unit, the motion information table for the merge processing region or the coding tree unit is referred to as a temporary motion information table. And, the motion information candidate stored in the temporary motion information table is referred to as a temporary motion information candidate.
[0264] Fig.18 is a diagram showing a temporary motion information table.
[0265] 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 the coding tree unit or the merge processing area, the motion information of the block may not be added to the motion information table HmvpCandList. Instead, 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 the partition included in the coding tree unit or the merge processing area including the current block.
[0266] Optionally, only the motion information of some blocks included in the merge processing area may be added to the temporary motion information table. As an example, only the blocks at the predefined positions within the merge processing area may be used to update the motion information table. 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, 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.
[0267] The maximum number of temporary motion information candidates that the temporary motion information table may include may be set to be equal to the maximum number of motion information candidates that the motion information table may include. Alternatively, the maximum number of temporary motion information candidates that the temporary motion information table may 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 may include may be set to be smaller than the maximum number of motion information candidates that the motion information table may include.
[0268] 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.
[0269] 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.
[0270] Fig.19 is a diagram illustrating an example of a unified motion information table and a temporary motion information table.
[0271] If encoding / decoding of all blocks included in the coding tree unit or the merge processing area is completed, Fig.19 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.
[0272] 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).
[0273] 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.
[0274] 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.
[0275] 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.
[0276] 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.
[0277] 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.
[0278] 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.
[0279] 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 bitstream. 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 the current block crosses the picture boundary, it can be set so that the matrix-based intra prediction method is not applied to the current block.
[0280] 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.
[0281] 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.
[0282] Fig. 20 is a flowchart of an intra-frame prediction method according to an embodiment of the present disclosure.
[0283] A reference sample line of the current block may be determined S2001. 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.
[0284] 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.
[0285] 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.
[0286] Table 1 shows the index assigned to each candidate reference sample line.
[0287]
Table 1
[0288] Index (intra_luma_ref_idx) Reference sample line 0 Adjacent reference sample point line 1 The first non-adjacent reference sample line 2 The second non-adjacent reference sample point line
[0289] Based on at least one of the position, size, shape, or prediction coding mode of the current 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. 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 side of the current block. The top reference sample and the left reference sample may be derived from the reconstructed samples around the current block. The reconstructed samples may be in a state before the in-loop filter is applied.
[0290] Next, the intra prediction mode of the current block may be determined S2002. 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.
[0291] Fig.21 is a diagram showing an intra prediction mode.
[0292] Fig.21 (a) shows 35 intra prediction modes, Fig.21 (b) shows 67 intra prediction modes.
[0293] Definable ratio Fig.21 A greater or lesser number of intra prediction modes than those shown in .
[0294] 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.
[0295] 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. Alternatively, the number of MPMs may be determined based on at least one of the prediction coding mode of the neighboring block, the size, shape, or reference sample line index of the current block. In an example, although N MPMs may be used when an adjacent reference sample line is determined as a reference sample line of the current block, M MPMs may also be used when a non-adjacent reference sample line is determined as a reference sample line of the current block. Since M is a natural number less than N, in an example, N may be 6 and M may be 5, 4, or 3. Therefore, although the intra-frame prediction mode of the current block may be determined as any one of the 6 candidate intra-frame prediction modes 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 also be determined as any one of the 5 candidate intra-frame prediction modes when the index of the reference sample line of the current block is greater than 0 and the MPM flag is true.
[0296] 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.
[0297] When matrix-based intra prediction is applied to neighboring blocks, MPM candidates may be derived by inferring the intra prediction modes of the neighboring blocks as planes.
[0298] When intra BDPCM is applied to a neighboring block, an MPM candidate may be derived by inferring the intra prediction mode of the neighboring block as a default mode. In this case, the default mode may be at least one of DC, planar, vertical direction, or horizontal direction.
[0299] Optionally, based on the intra BDPCM application direction of the neighboring block, the intra prediction mode of the neighboring block may be determined. In the example, when the intra BDPCM in the horizontal direction is applied to the neighboring block, the intra prediction mode of the neighboring block may be inferred to be in the horizontal direction. On the other hand, when the intra BDPCM in the vertical direction is applied to the neighboring block, the intra prediction mode of the neighboring block may be inferred to be in the vertical direction.
[0300] An MPM list including a plurality of MPMs may be generated, and information indicating whether the same MPM as the intra prediction mode of the current block is included in the MPM list may be signaled in the bitstream. Since the information is a 1-bit flag, it may be referred to as an MPM flag. When the MPM flag indicates 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.
[0301] 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 except the non-directional intra prediction mode with the remaining mode information. Instead of excluding the non-directional intra prediction mode from the comparison target, the result value may be compared with the remaining MPMs after adding the number of non-directional intra prediction modes to the remaining mode information.
[0302] Information indicating whether the intra-frame prediction mode of the current block is the default mode may be signaled in the bitstream instead of setting the default mode to the MPM. The information is a 1-bit flag, and the flag may be referred to as a default mode flag. The default mode flag may be signaled only when the MPM flag indicates that the same MPM as the current block is included in the MPM list. As described above, the default mode may include at least one of 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.
[0303] 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.
[0304] When a plurality of intra prediction modes are set as a default mode, index information indicating any one of the default modes may also be signaled. The intra prediction mode of the current block may be set to the default mode indicated by the index information.
[0305] 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 an 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).
[0306] When the intra prediction mode of the current block is determined, prediction samples for the current block may be obtained based on the determined intra prediction mode S2003.
[0307] 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. In detail, the values of all samples within 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 a top reference sample adjacent to the top of the current block and a left reference sample adjacent to the left of the current block.
[0308] 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, the average value may be calculated using reference samples adjacent to the larger length. 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 a ratio between the width and the height of the current block.
[0309] 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 on 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 on 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, the 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.
[0310] 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.
[0311]
Table 2
[0312]
[0313]
[0314] Table 2 shows the intra-frame direction parameter of each intra-frame prediction mode, where, when 35 intra-frame prediction modes are defined, its index 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 subdividing Table 2. The top reference sample and the left reference sample for the current block are arranged into a line, and then the prediction sample can be obtained based on the value of the intra-frame direction parameter. In this regard, when the value of the intra-frame direction parameter is negative, the left side is negative. Fig. 22 and Fig.23 are diagrams each showing an example of a one-dimensional arrangement in which reference spots are arranged in a line.
[0315] Fig. 22 is a diagram showing a one-dimensional arrangement in the vertical direction in which reference samples are arranged in the vertical direction, Fig.23 35 intra prediction modes are defined to describe Fig. 22 and Fig.23 .
[0316] 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 the reference samples are arranged in a line, the intra prediction mode angle may be considered.
[0317] 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.
[0318] The reference sample index iIdx and the weighting factor parameter i can be obtained by the following equations 2 and 3 respectively. fact .
[0319] [Equation 2]
[0320] iIdx=(y+1)*P ang / 32
[0321] [Equation 3]
[0322] i fact =[(y+1)*P ang ]&31In equation 2 and equation 3, P ang Indicates intra-frame direction parameters. The reference sample specified by the reference sample index iIdx corresponds to an integer pixel.
[0323] In order to derive the prediction sample, at least one reference sample may be specified. Specifically, according to the slope of the prediction mode, the position of the reference sample used to derive the prediction sample may be specified. In an example, the reference sample used to derive the prediction sample may be specified by using the reference sample index iIdx.
[0324] In this regard, when the slope of the intra prediction mode is not represented by one reference sample, the prediction sample may be generated by performing interpolation on a plurality of reference samples. In an example, when the slope of the intra prediction mode is a value between a slope between the prediction sample and a first reference sample and a slope between the prediction sample and a second reference sample, the prediction sample may be obtained by performing interpolation on the first reference sample and the second reference sample. In other words, when an angle line according to an intra prediction angle does not pass through a reference sample located at an integer pixel, the prediction sample may be obtained by performing interpolation on reference samples adjacent to the left and right sides or the top and bottom of a position through which the angle line passes.
[0325] Equation 4 below represents an example of obtaining a prediction sample based on a reference sample.
[0326] [Equation 4]
[0327] P(x,y)=((32-i fact ) / 32)*Ref_1D(x+iIdx+1)+(i fact / 32)*Ref_1D(x+iIdx+2)
[0328] In Equation 4, 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.
[0329] 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 4 can be reduced to the following Equation 5.
[0330] [Equation 5]
[0331] P(x, y) = Ref_1D(x+iIdx+1)
[0332] 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.
[0333] 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.
[0334] Fig.24 is a diagram showing an angle formed between a directional intra prediction mode and a straight line parallel to the x-axis.
[0335] As in Fig.24 In the example shown in , the directional prediction mode may exist between the lower left diagonal direction and the upper right diagonal direction. When describing the angle formed between the x-axis and the directional prediction mode, the directional prediction mode may exist from 45 degrees (lower left diagonal direction) to -135 degrees (upper right sub-diagonal direction).
[0336] When the current block is non-square, there may be a case where prediction samples are derived by using reference samples located at an angle line according to an intra prediction angle that are located farther than reference samples close to prediction samples according to an intra prediction mode of the current block.
[0337] Fig.25 is a diagram illustrating an aspect of obtaining prediction samples when the current block is non-square.
[0338] In the example, Fig.25 In the example shown in (a) of FIG. 1 , it is assumed that the current block is a non-square whose width is greater than its height, and the intra prediction mode of the current block is a directional intra prediction mode having an angle of 0 to 45 degrees. In the above case, when the prediction samples A around the right column of the current block are derived from the reference samples located at the angular mode according to the above angle, there may be a case where the left reference sample L far from the prediction sample is used instead of the top reference sample T close to the prediction sample.
[0339] In another example, if Fig.25 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 samples A around the bottom row of the current block are derived from the reference samples located at the angle 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.
[0340] In order to solve the above problem, when the current block is non-square, the intra-frame prediction mode of the current block can be replaced by the intra-frame prediction mode in the opposite direction. Fig.21 The directional prediction mode shown in the figure is a directional prediction mode of an angle. The above directional intra prediction mode may be defined as a wide-angle intra prediction mode. The wide-angle intra prediction mode indicates a directional intra prediction mode that does not belong to the range of 45 degrees to -135 degrees.
[0341] Fig.26 is a diagram illustrating a wide-angle intra prediction mode.
[0342] exist Fig.26 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.
[0343] exist Fig.26, 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.
[0344] 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.
[0345] By using the wide-angle intra prediction mode, the reference sample T can be used to predict Fig.25 The sample point A shown in (a) of FIG. 1 and can be predicted by the reference sample point L Fig.25 Sample point A shown in (b).
[0346] 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.
[0347]
Table 3
[0348] PredModeIntra -10 -9 -8 -7 -6 -5 -4 -3 -2 intraPredAngle 114 93 79 68 60 54 49 45 39 PredModeIntra -1 2 3 4 5 6 7 8 9 intraPredAngle 35 32 29 26 23 21 19 17 15 PredModeIntra 10 11 12 13 14 15 16 17 18 intraPredAngle 13 11 9 7 5 3 2 1 0 PredModeIntra 19 20 21 22 23 24 25 26 27 intraPredAngle -1 -2 -3 -5 -7 -9 -11 -13 -15 PredModeIntra 28 29 30 31 32 33 34 35 36 intraPredAngle -17 -19 -21 -23 -26 -29 -32 -29 -26 PredModeIntra 37 38 39 40 41 42 43 44 45 intraPredAngle -23 -21 -19 -17 -15 -13 -11 -9 -7 PredModeIntra 46 47 48 49 50 51 52 53 54 intraPredAngle -5 -3 -2 -1 0 1 2 3 5 PredModeIntra 55 56 57 58 59 60 61 62 63 intraPredAngle 7 9 11 13 15 17 19 21 23 PredModeIntra 64 65 66 67 68 69 70 71 72 intraPredAngle 26 29 32 35 39 45 49 54 60 PredModeIntra 73 74 75 76 intraPredAngle 68 79 93 114
[0349] 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 can be transformed into a wide-angle intra prediction mode. The transformation range can be determined based on at least one of the size, shape or ratio of the current block. In this regard, the ratio may represent the ratio between the width and height of the current block. When the current block is non-square with a width greater than the height, the transformation range can be set to the intra prediction mode index in the upper right diagonal direction (e.g., 66) to (intra prediction mode index in the upper right diagonal direction-N). In this regard, N can 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 can be transformed into a wide-angle intra prediction mode. The transformation can be to subtract a predefined value from the intra prediction mode, and the predefined value can be the total number of intra prediction modes that do not include the wide-angle intra prediction mode (e.g., 67).
[0350] In the above example, the intra prediction modes from number 66 to number 53 may be transformed into wide-angle intra prediction modes from number -1 to number -14, respectively.
[0351] 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 scale 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.
[0352] In the above example, the intra prediction modes from number 2 to number 15 may be transformed into wide-angle intra prediction modes from number 67 to number 80, respectively.
[0353] Hereinafter, the intra prediction mode belonging to the transform range is referred to as a wide-angle intra prediction alternative mode.
[0354] The transform range may be determined based on the scale 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.
[0355]
Table 4
[0356] 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
[0357]
Table 5
[0358]
[0359] As shown in Table 4 and Table 5, the number of wide-angle intra prediction replacement modes included in the transform range may vary according to the scale of the current block. The scale of the current block may also be subdivided to set the transform range as shown in Table 6 below.
[0360]
Table 6
[0361]
[0362] 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 a 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 a transformation range, the intra prediction mode of the current block may not be transformed into a wide-angle intra prediction mode. Alternatively, when the intra prediction mode of the current block is determined as a wide-angle intra prediction mode, the prediction method may be configured so that a non-adjacent reference sample line is not available as a reference sample line for the current block, or may be configured not to use a multi-line intra prediction encoding method to select one of a plurality of reference sample lines. When the multi-line intra prediction encoding method is not used, an adjacent reference sample line may be determined as a reference sample line for the current block.
[0363] When the wide-angle intra prediction mode is not used, each of refW and refH may be set to the sum of nTbW and nTbH. Therefore, in addition to the upper left reference sample, the non-adjacent reference sample line spaced i from the current block may further include (nTbW+nTbH+offsetX[i]) top reference samples and (nTbW+nTbH+offsetY[i]) left reference samples. That is, the 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.
[0364] 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.
[0365] In one example, the value of offsetX may be set to 0, and the value of offsetY may be set to 1.
[0366] 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, instead of encoding the wide-angle intra-prediction mode as it is, an alternative intra-prediction mode of the wide-angle intra-prediction mode is encoded to improve encoding efficiency.
[0367] In an example, when the current block is encoded by using the wide-angle intra prediction mode number 67, number 2 as the wide-angle replacement intra prediction mode number 67 may be encoded as the intra prediction mode of the current block. In addition, when the current block is encoded by using the wide-angle intra prediction mode number -1, number 66 as the wide-angle replacement intra prediction mode number -1 may be encoded as the intra prediction mode of the current block.
[0368] 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.
[0369] 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.
[0370] The encoding of the intra prediction mode may be performed based on the above-mentioned MPM list. Specifically, when the neighboring block is encoded in the wide-angle intra prediction mode, the MPM may be set based on the wide-angle replacement intra prediction mode corresponding to the wide-angle intra prediction mode.
[0371] A coding block or a transform block may be partitioned into a plurality of sub-blocks (or sub-partitions). When a coding block or a transform block is partitioned into a plurality of sub-blocks, prediction, transformation, and quantization may be performed for each sub-block. Partitioning a coding block or a transform block into a plurality of sub-blocks may be defined as a sub-partition intra coding method.
[0372] Information indicating whether the sub-partition intra coding method is applied may be signaled in the bitstream. The information may be a 1-bit flag. In an example, "intra_subpartitions_mode_flag" (a syntax factor indicating whether a coding block or a transform block is partitioned into multiple sub-blocks) may be signaled in the bitstream.
[0373] Optionally, whether to apply the sub-partition intra-coding method may be determined based on at least one of the size, shape, or intra-prediction mode of the coding block or the transform block. In an example, when the intra-prediction mode of the coding block is a non-directional intra-prediction mode (e.g., plane or DC) or a predefined directional intra-prediction mode (e.g., an intra-prediction mode in the horizontal direction, an intra-prediction mode in the vertical direction, or an intra-prediction mode in the diagonal direction), the sub-partition intra-coding method may not be applied. Optionally, when the size of the coding block is less than a threshold, the sub-partition intra-coding method may be set to not be used.
[0374] Optionally, when intra prediction of a subblock is performed based on an intra prediction mode of a coding block, whether to apply a sub-partition intra coding method may be determined based on whether a reconstructed sample included in a neighboring subblock should be used as a reference sample in intra prediction of the subblock. In an example, when the intra prediction mode of the coding block is an intra prediction mode in a diagonal direction or a wide-angle intra prediction mode, and a neighboring subblock may not be used as a reference sample when intra prediction is performed for the subblock based on the intra prediction mode, the sub-partition intra coding method may be set not to be used.
[0375] Optionally, when the aspect ratio of the coding block is equal to or greater than a threshold or equal to or less than a threshold, the sub-partition intra-coding method may be set to not be used. Optionally, when at least one of the height or width of the coding block is equal to or less than a threshold, the sub-partition intra-coding method may not be used. In the example, when the width or height of the coding block is equal to or less than a threshold, or when both the height and width of the coding block are equal to or less than a threshold, the sub-partition intra-coding method may not be used. Optionally, when the number of samples included in the coding block is equal to or less than a threshold, the sub-partition intra-coding method may not be used. The threshold may have a predefined value in the encoder and the decoder. Optionally, information for determining the threshold may be transmitted by signal in the bitstream.
[0376] Optionally, whether to signal a flag indicating whether to apply the sub-partition intra-coding method may be determined based on at least one of the size, shape, or intra-prediction mode of the coding block or the transform block. In the example, only when both the height and width of the coding block are equal to or less than a threshold value and / or when the size of the coding block is equal to or greater than a threshold value, a flag indicating whether the sub-partition intra-coding method is applied may be encoded and signaled. When the flag indicating whether the sub-partition intra-coding method is applied is not encoded, the sub-partition intra-coding method may not be applied.
[0377] When the sub-partition intra coding method is not used, the signaling of the syntax factor intra_subpartitions_mode_flag may be omitted. When the signaling of the flag is omitted, the flag may be considered to indicate that the sub-partition intra coding method is not applied.
[0378] When the sub-partition intra encoding method is applied, the partition shape of the coding block or the transform block may be determined. In this case, the partition shape indicates the partition direction of the coding block or the transform block. In an example, partitioning in a vertical direction may refer to partitioning the coding block or the transform block by using at least one vertical line, and partitioning in a horizontal direction may refer to partitioning the coding block or the transform block by using at least one horizontal line.
[0379] Fig. 27 : is a diagram showing an example of partitioning in a vertical direction and partitioning in a horizontal direction.
[0380] Fig. 27 (a) shows an example where a coding block is partitioned into two sub-blocks. Fig. 27 (b) shows an example in which a coding block is partitioned into 4 sub-blocks.
[0381] Information for determining the partition shape of a coding block or a transform block may be transmitted by a signal in a bitstream. In an example, information indicating whether a partition in a vertical direction is applied to a coding block or a transform block or whether a partition in a horizontal direction is applied to a coding block or a transform block may be transmitted by a signal. The information may be a 1-bit flag intra_subpart_type_flag. When the value of the flag is 1, it indicates that the coding block or the transform block is partitioned in the horizontal direction, and when the value of the flag is 0, it indicates that the coding block or the transform block is partitioned in the vertical direction.
[0382] Optionally, the partition shape of the coding block or transform block may be determined based on the size, shape, or intra prediction mode of the coding block or transform block. In the example, the partition shape of the coding block may be determined based on the ratio of the width to the height of the coding block. For example, when the value whRatio representing the ratio of the height to the width of the coding block is equal to or greater than the first threshold, the partition in the vertical direction may be applied to the coding block. Otherwise, the partition in the horizontal direction may be applied to the coding block.
[0383] Fig.28 is a diagram illustrating an example of determining a partition shape of a coding block.
[0384] For ease of description, it is assumed that the first threshold is 2. Fig.28 In the example shown in (a), the whRatio of the coding block is 1, which is less than the first threshold. Therefore, encoding of information indicating the partition shape of the coding block can be omitted, and partitioning in the horizontal direction can be applied to the coding block.
[0385] exist Fig.28 In the example shown in (b), the whRatio of the coding block is 2, which is the same as the first threshold. Therefore, encoding of information indicating the partition shape of the coding block can be omitted, and partitioning in the vertical direction can be applied to the coding block.
[0386] The partition shape of the coding block can be determined by using a second threshold whose sign is opposite to the first threshold. In the example, when the value of whRatio is equal to or less than the second threshold, the partition in the horizontal direction can be applied to the coding block, otherwise, the partition in the vertical direction can be applied to the coding block. The absolute values of the first threshold and the second threshold may be the same, and their signs may be different. In the example, when the first threshold is N (in this case, N is an integer such as 1, 2, 4, etc.), the second threshold may be -N.
[0387] Fig.29 is a diagram illustrating an example of determining a partition shape of a coding block.
[0388] For ease of description, it is assumed that the second threshold is -2. Fig.29 In the example shown in (a), the whRatio of the coding block is -1, which is greater than the second threshold. Therefore, encoding of information indicating the partition shape of the coding block can be omitted, and partitioning in the vertical direction can be applied to the coding block.
[0389] exist Fig.29 In the example shown in (b), the whRatio of the coding block is -2, which is the same as the second threshold. Therefore, encoding of information indicating the partition shape of the coding block can be omitted, and partitioning in the horizontal direction can be applied to the coding block.
[0390] Optionally, the partition shape of the coding block may be determined based on a first threshold and a second threshold. In the example, when the value of whRatio is equal to or greater than the first threshold, the partition in the horizontal direction may be applied to the coding block, and when the value of whRatio is equal to or less than the second threshold, the partition in the vertical direction may be applied to the coding block. When the value of whRatio is between the first threshold and the second threshold, the partition shape of the current block may be determined by parsing the information in the bitstream.
[0391] The first threshold and the second threshold may be predefined in the encoder and the decoder. Alternatively, the first threshold and the second threshold may be defined for each sequence, picture or slice.
[0392] Optionally, the partition shape may be determined based on the size of the coding block or the transform block. In the example, when the size of the coding block is N×n, partitioning in the vertical direction may be applied, and when the size of the coding block is n×N, partitioning in the horizontal direction may be applied. In this case, n may be a natural number less than N. N and / or n may be predefined values in the encoder and decoder. Optionally, information for determining N and / or n may be transmitted by signal in the bitstream. In the example, N may be 32, 64, 128, or 256, etc. Therefore, when the size of the coding block is 128×n (in this case, n is a natural number such as 16, 32, or 64), partitioning in the vertical direction may be applied, and when the size of the coding block is n×128, partitioning in the horizontal direction may be applied.
[0393] Optionally, the partition shape of the coding block or the transform block may be determined based on the intra prediction mode of the coding block or the transform block. In an example, when the intra prediction mode of the coding block is in the horizontal direction or in a direction similar to the horizontal direction, the partition in the vertical direction may be applied to the coding block. In this case, the intra prediction mode in the direction similar to the horizontal direction means that the partition shape is different from the intra prediction mode in the horizontal direction (e.g., Fig.21 Intra prediction modes (e.g., INTRA_ANGULAR18±N) whose index difference is equal to or less than a threshold value (e.g., INTRA_ANGULAR18±N) shown in (b) of FIG. 1 . On the other hand, when the intra prediction mode of the coding block is in the vertical direction or in a direction similar to the vertical direction, the partition in the horizontal direction may be applied to the coding block. In this case, the intra prediction mode in a direction similar to the vertical direction indicates that the intra prediction mode in the vertical direction (e.g., Fig.21 Intra prediction mode (e.g., INTRA_ANGULAR50±N) where the index difference of INTRA_ANGULAR50 shown in (b) is equal to or less than a threshold. In this case, the threshold N may be a predefined value in the encoder and the decoder. Optionally, information for determining the threshold N may be signaled at the level of a sequence, a picture, or a slice.
[0394] When both partitioning in the vertical direction and partitioning in the horizontal direction are available, the partition shape of the coding block may be determined by parsing information indicating the partition shape of the coding block.
[0395] The number of sub-blocks may be determined based on at least one of the size or shape of the coding block or the transform block. In the example, when either the width or the height of the coding block is 8 and the other is 4, the coding block may be partitioned into 2 sub-blocks. On the other hand, when both the width and the height of the coding block are equal to or greater than 8, or when either the width or the height of the coding block is greater than 8, the coding block may be partitioned into 4 sub-blocks. In short, when the coding block has a 4×4 size, the coding block may not be partitioned into sub-blocks. When the coding block has a 4×8 size or an 8×4 size, the coding block may be partitioned into 2 sub-blocks. Otherwise, the coding block may be partitioned into 4 sub-blocks.
[0396] Alternatively, information indicating the size or shape of the sub-block or the number of sub-blocks may be signaled in the bitstream. The size or shape of the sub-block may be determined by the information indicating the number of sub-blocks. Alternatively, the number of sub-blocks may be determined by the information indicating the size or shape of the sub-block.
[0397] When the sub-partition intra-coding method is applied, the sub-blocks generated by partitioning the coding block or the transform block can use the same intra-prediction mode. In one example, the MPM for the coding block can be derived based on the intra-prediction mode of the neighboring blocks adjacent to the coding block, and the intra-prediction mode for the coding block can be determined based on the derived MPM. When the intra-prediction mode of the coding block is determined, each sub-block can perform intra-prediction by using the determined intra-prediction mode.
[0398] When the sub-partition intra coding method is applied, any one of the MPMs may be determined as the intra prediction mode of the coding block. In other words, when the sub-partition intra coding method is applied, the MPM flag may be considered true even though it is not signaled.
[0399] Optionally, when the sub-partition intra-coding method is applied, any one of the predefined candidate intra-prediction modes may be determined as the intra-prediction mode of the coding block. In one example, any one of the intra-prediction modes in the horizontal direction, the intra-prediction mode in the vertical direction, the intra-prediction mode in the diagonal direction (e.g., at least one of the upper left intra-prediction mode, the upper right intra-prediction mode, or the lower left intra-prediction mode) or the non-directional intra-prediction mode (e.g., at least one of the plane or DC) may be determined as the intra-prediction mode of the coding block. Index information specifying any one of the predefined candidate intra-prediction modes may be transmitted by signal in the bitstream. Optionally, the number and / or type of the candidate intra-prediction modes may be different depending on the partition direction of the coding block. In the example, when the partition in the horizontal direction is applied to the coding block, at least one of the non-directional intra-prediction mode, the intra-prediction mode in the vertical direction, the intra-prediction mode in the upper left diagonal direction, or the intra-prediction mode in the upper right diagonal direction may be set as the candidate intra-prediction mode. On the other hand, when partitioning in the vertical direction is applied to the coding block, at least one of a non-directional intra-frame prediction mode, an intra-frame prediction mode in the horizontal direction, an intra-frame prediction mode in the upper left diagonal direction, or an intra-frame prediction mode in the lower left diagonal direction can be set as a candidate intra-frame prediction mode.
[0400] The quantization parameters of the sub-blocks may be determined individually. Therefore, the value of the quantization parameter of each sub-block may be set differently. Information representing the difference from the quantization parameter of the previous sub-block may be encoded to determine the quantization parameter of each sub-block. In an example, for the Nth sub-block, the difference between the quantization parameter of the Nth sub-block and the quantization parameter of the N-1th sub-block may be encoded.
[0401] Intra-frame prediction of a sub-block may be performed by using reference samples. In this case, the reference samples may be derived from the reconstructed samples of a neighboring block adjacent to the sub-block. When the neighboring block adjacent to the sub-block is another sub-block included in the same coding block as the sub-block, the reference samples of the sub-block may be derived based on the reconstructed samples of the other sub-block. In the example, when the first sub-block is located on the left or top of the second sub-block, the reference samples of the second sub-block may be derived from the reconstructed samples of the first sub-block. To this end, parallel intra-frame prediction may not be applied between sub-blocks. In other words, encoding / decoding may be performed sequentially for the sub-blocks included in the coding block. Therefore, after encoding / decoding of the first sub-block is completed, intra-frame prediction for the second sub-block may be performed.
[0402] When the sub-partition intra coding method is applied, it may be set to not use a multi-line intra prediction coding method that selects any one of a plurality of reference sample line candidates. When the multi-line intra prediction coding method is not used, an adjacent reference sample line adjacent to each sub-block may be determined as a reference sample line of each sub-block. Optionally, when the index of the reference sample line of the current block is greater than 0, the encoding of the syntax factor intra_subpartitions_mode_flag indicating whether the sub-partition intra coding method is applied may be omitted. When the encoding of the syntax intra_subpartitions_mode_flag is omitted, the sub-partition intra coding method may not be applied.
[0403] The filtering may be performed on samples adjacent to a boundary between subblocks. The filtering may be performed on predicted samples or reconstructed samples. In an example, when it is assumed that the second subblock is adjacent to the right side of the first subblock, the predicted samples or reconstructed samples adjacent to the left side boundary of the second subblock may be filtered by using the reconstructed samples adjacent to the right boundary of the first subblock.
[0404] Whether a filter is to be applied to samples adjacent to a boundary between subblocks may be determined based on at least one of an intra prediction mode, a size of a subblock, or the number of subblocks.
[0405] When a prediction block is generated by performing intra prediction, the prediction samples may be updated based on the position of each prediction sample included in the prediction block. This updating method may be referred to as a sample position-based intra weighted prediction method (or position-dependent prediction combination, PDPC).
[0406] Whether PDPC will be used can be determined by considering the size or shape of the current block, the intra-frame prediction mode, the reference sample line of the current block, the size or color component of the current block. In the example, PDPC can be used when the intra-frame prediction mode of the current block is at least one of plane, DC, vertical direction, horizontal direction, a mode with an index value less than the vertical direction, or a mode with an index value greater than the horizontal direction. Optionally, PDPC can be used only when at least one of the width or height of the current block is greater than 4. Optionally, PDPC can be used only when the index of the reference picture row of the current block is 0. Optionally, PDPC can be used only when the index of the reference picture row of the current block is equal to or greater than a predefined value. Optionally, PDPC can be used only for brightness components. Optionally, whether to use PDPC can be determined based on whether two or more enumerated conditions are met.
[0407] Alternatively, whether to use PDPC may be determined based on whether a sub-partition intra-coding method is used. In an example, when a sub-partition intra-coding method is applied to a coding block or a transform block, PDPC may be set to not be used. Optionally, when a sub-partition intra-coding method is applied to a coding block or a transform block, PDPC may be applied to at least one of a plurality of sub-blocks. In this case, a sub-block targeted for PDPC may be determined based on at least one of the size, shape, position, intra-prediction mode, or reference sample line index of a coding block or sub-block. In one example, PDPC may be applied to a sub-block adjacent to the upper boundary and / or the left boundary of a coding block or to a sub-block adjacent to the lower boundary and / or the right boundary of a coding block. Optionally, based on the size or shape of a sub-block, PDPC may be set to be applied to all sub-blocks included in a coding block, or PDPC may be set not to be applied to all sub-blocks included in a coding block. In an example, when at least one of the width or height of a sub-block is less than a threshold, the application of PDPC may be omitted. In another example, PDPC may be applied to all sub-blocks in a coding block.
[0408] Optionally, whether to apply PDPC may be determined for each sub-block based on whether at least one of the size, shape, intra-prediction mode, or reference picture index of a sub-block generated by partitioning a coding block or a transform block satisfies a preset condition. In an example, PDPC may be applied to a sub-block when at least one of the width or height of the sub-block is greater than 4.
[0409] In another example, information indicating whether PDPC is applied may be signaled in the bitstream.
[0410] Optionally, the area to which PDPC is applied may be determined based on at least one of the size, shape, or intra prediction mode of the current block or the position of the prediction sample. In the example, when the intra prediction mode of the current block has an index greater than the vertical direction, at least one of the prediction samples whose x-axis coordinates or y-axis coordinates are greater than the threshold value may not be modified, and only the prediction samples whose x-axis coordinates or y-axis coordinates are equal to or less than the threshold value may be modified. Optionally, when the intra prediction mode of the current block has an index less than the horizontal direction, at least one of the prediction samples whose x-axis coordinates or y-axis coordinates are greater than the threshold value may not be modified, and only the prediction samples whose x-axis coordinates or y-axis coordinates are equal to or less than the threshold value may be modified. In this case, the threshold may be determined based on at least one of the size, shape, or intra prediction mode of the current block.
[0411] When the prediction sample is obtained by intra-prediction sample, the reference sample used to modify the prediction sample may be determined based on the position of the obtained prediction sample.
[0412] The residual signal may be obtained by differentiating the predicted sample from the original sample of the current block after performing intra prediction on the current block. In this case, after deriving the difference between the residual signal at a specific position and the adjacent residual signal, the derived difference may be encoded instead of encoding the residual signal at the specific position as it is. In this case, the residual signal may represent the residual sample, the transform coefficient generated by transforming the residual sample, or the coefficient generated by skipping the transform.
[0413] For example, encoding of the difference residual value may be performed after differencing the residual signal belonging to the first line and the residual signal belonging to the second line, rather than encoding the residual signal belonging to the second line as it is. In this case, at least one of the x-axis coordinate or the y-axis coordinate may be different for the first line and the second line.
[0414] In an example, the encoder may generate a transform coefficient by transforming the residual sample points, and encode the difference between the transform coefficient generated by the encoding and the transform coefficient derived by taking the difference of the adjacent transform coefficients. The decoder may set the transform coefficient belonging to the first line as the transform coefficient prediction value of the second residual signal, and derive the second transform coefficient by adding the decoded difference transform coefficient to the transform coefficient prediction value.
[0415] As described above, when the residual difference value is encoded / decoded after differencing the residual signal, it may be referred to as intra BDPCM (Block-based Delta Pulse Code Modulation). Intra BDPCM may be used only when the prediction coding mode of the current block is determined as intra prediction.
[0416] When intra BDPCM is applied, the prediction samples of the current block may be set to 0. In other words, when intra BDPCM is applied, the residual samples may be set to the reconstructed samples.
[0417] Optionally, when intra BDPCM is applied, the prediction samples of the current block may be derived based on intra prediction. In this case, the intra prediction mode of the current block may be determined according to the intra BDPCM direction. In the example, when the intra BDPCM direction is horizontal, the prediction samples may be obtained based on the intra prediction mode in the horizontal direction. When the intra BDPCM direction is vertical, the prediction samples may be obtained based on the intra prediction mode in the vertical direction.
[0418] Optionally, the prediction samples of the current block may be derived by using a default intra prediction mode. The default intra prediction mode may be any one of DC, planar, horizontal, or vertical. The default intra prediction mode may be predefined in the encoder and decoder. Information specifying one of the default intra prediction modes may be encoded and signaled.
[0419] Alternatively, the intra prediction mode may be derived from one of a plurality of MPM candidates.
[0420] When intra BDPCM is applied to the current block, it is possible to compulsorily use adjacent reference sample lines. In other words, prediction samples can be obtained by omitting signaling of index information for one of the designated reference sample lines and by using the adjacent reference sample lines.
[0421] When the intra BDPCM method is applied, information for determining the intra BDPCM direction may be signaled in the bitstream. In an example, intra_bdpcm_dir_flag (a flag indicating the intra BDPCM direction) may be signaled in the bitstream. When the syntax intra_bdpcm_dir_flag is 0, it indicates that BDPCM in the horizontal direction is applied, and when the syntax intra_bdpcm_dir_flag is 1, it indicates that BDPCM in the vertical direction is applied.
[0422] Alternatively, the intra-frame BDPCM direction may be determined based on the size or shape of the current block. In an example, when the current block has a non-square shape with a width greater than a height, it may be determined to apply the BDPCM in the horizontal direction. On the other hand, when the current block has a non-square shape with a height greater than a width, it may be determined to apply the BDPCM in the vertical direction.
[0423] Alternatively, the intra-frame BDPCM direction may be determined by considering the intra-frame prediction modes of neighboring blocks adjacent to the current block. In the example, when at least one intra-frame prediction mode of the left block and the top block of the current block is in the horizontal direction or in a direction similar to the horizontal direction, the BDPCM in the horizontal direction may be applied to the current block. In this case, the direction similar to the horizontal direction represents an intra-frame prediction mode whose difference with the intra-frame prediction mode in the horizontal direction is equal to or less than a threshold. Alternatively, when at least one intra-frame prediction mode of the left block and the top block of the current block is in the vertical direction or in a direction similar to the vertical direction, the BDPCM in the vertical direction may be applied to the current block. In this case, the direction similar to the vertical direction represents an intra-frame prediction mode whose difference with the intra-frame prediction mode in the vertical direction is equal to or less than a threshold.
[0424] When BDPCM in the horizontal direction is applied, a residual signal and a difference value between a residual signal adjacent to a top of the residual signal may be encoded. The decoder may derive a residual signal by adding the top residual signal to the decoded difference value.
[0425] When BDPCM in the vertical direction is applied, a difference between a residual signal and a residual signal adjacent to the left side of the residual signal may be encoded. The decoder may derive a residual signal by adding the left residual signal to the decoded difference.
[0426] Optionally, non-directional BDPCM may be applied. In the example, DC BDPCM means encoding / decoding the difference between the residual signal at a predetermined position and the average value of the adjacent residual signals at the predetermined position. Planar BDPCM means encoding / decoding the average or weighted sum result of the difference in the horizontal direction (the difference between the residual signal at the predetermined position and the residual signal in the horizontal direction of the residual signal at the predetermined position) and the difference in the vertical direction (the difference between the residual signal at the predetermined position and the residual signal in the vertical direction of the residual signal at the predetermined position).
[0427] Information for specifying an available BDPCM mode may be signaled in a bitstream. The information may be information indicating whether non-directional BDPCM is applied or information for specifying any one of a plurality of BDPCM candidates that may be applied to the current block.
[0428] Information indicating whether intra BDPCM is to be applied to the current block may be signaled in the bitstream. In an example, a flag intra_bdpcm_flag may be signaled in the bitstream. When the syntax intra_bdpcm_flag is 1, it indicates that intra BDPCM is applied to the current block. When the syntax intra_bdpcm_flag is 0, it indicates that intra BDPCM is not applied to the current block.
[0429] At the level of a picture or sequence, information indicating the availability of intra BDPCM may be signaled. In an example, a flag sps_intra_bdpcm_flag indicating the availability of intra BDPCM may be signaled via a sequence parameter set (SPS). When the syntax sps_intra_bdpcm_flag is 1, it indicates that the picture of the reference sequence parameter set may use intra BDPCM. When the syntax sps_intra_bdpcm_flag is 0, it indicates that the picture of the reference sequence parameter set may not use intra BDPCM. The intra_bdpcm_flag indicating whether intra BDPCM is applied to the current block may be signaled only when sps_intra_bdpcm_flag is 1.
[0430] When intra BDPCM is applied to the current block, PDPC may be set not to be used.
[0431] When intra BDPCM is applied to the current block, it may be set to forcibly apply transform skip. In other words, when intra BDPCM is applied to the current block, although transform_skip_flag indicating whether transform skip is applied is not signaled, the value may be considered to be 1.
[0432] The combined prediction mode is a method of generating a predicted image by combining two or more prediction modes. In an example, when the combined prediction mode is applied, a prediction block may be generated by averaging a first prediction block generated based on a first prediction mode and a second prediction block generated based on a second prediction mode or by using their weighted sum operation. The prediction mode may include at least one of an intra prediction mode, a merge mode, an AMVP mode, a skip mode, an intra block copy mode, or a palette mode. In an example, the first prediction mode may be a merge mode, and the second prediction mode may be an intra prediction mode.
[0433] When a combined prediction mode of a merge mode and an intra prediction mode combination is used, a prediction block of the current block may be generated by weighted prediction of a first prediction block obtained based on motion information and a second prediction block obtained based on a predetermined intra prediction mode. The motion information of the current block may be derived from a merge candidate specified by an index merge_idx signaled in a bitstream. The intra prediction mode of the current block may be set to a predefined intra prediction mode. The predefined intra prediction mode may be a plane mode, a DC mode, a horizontal mode, or a vertical mode. Optionally, the intra prediction mode of a neighboring block may be set to the intra prediction mode of the current block.
[0434] A flag indicating whether the combined prediction mode is applied to the current block may be signaled in the bitstream. In an example, the syntax ciip_flag may be signaled in the bitstream. When the value of the syntax ciip_flag is 1, it indicates that the combined prediction mode is applied to the current block. When the value of the syntax ciip_flag is 0, it indicates that the combined prediction mode is not applied to the current block. In the case where the combined prediction mode is not applied to the current block, at least one of the merge offset coding method or the triangle partitioning method may be applied.
[0435] 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.
[0436] DCT is to decompose (or transform) the residual image into two-dimensional frequency components by using cosine transform, while DST is to synthesize (or transform) the residual image into two-dimensional frequency components by using sine transform. As a result of transforming the residual image, the frequency components can be represented as a basic image. In the example, when DCT transform is performed on a block of size N×N, N 2 The size of each 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.
[0437] 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.
[0438] It is also possible to transform the residual image by using a transform method other than DCT or DST.
[0439] 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.
[0440] 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.
[0441] 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 value for which the transform is not performed.
[0442] 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.
[0443] Optionally, when the subpartition intra encoding method is applied to the current block, it may be determined whether to apply transform skip for each subpartition.
[0444] Fig.30 is a diagram illustrating an example of determining whether to perform transform skip for each subblock.
[0445] Transform skipping may be applied to only a portion of the plurality of sub-blocks. Fig.30 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.
[0446] 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.
[0447] 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.
[0448] Alternatively, information for determining a transform type may be signaled for a coding block, and the transform type specified by the information may be commonly applied to subblocks included in the coding block. In other words, the transform types of subblocks in the coding block may be set identically.
[0449] 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.
[0450] 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.
[0451] Different transform kernels may be used for the horizontal direction and the vertical direction. Information indicating a combination of a transform kernel in the horizontal direction and a transform kernel in the vertical direction may be signaled in the bitstream. In an example, the above tu_mts_idx may indicate one of the combinations of a transform kernel in the horizontal direction and a transform kernel in the vertical direction.
[0452] 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.
[0453] The transform coefficients in the remaining regions where the second transform is not performed may also be set to zero.
[0454] 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.
[0455] 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.
[0456] 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.
[0457]
Table 7
[0458]
[0459] 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.
[0460] When Table 7 is used, when tu_mts_idx is 0, DCT2 may be applied in the horizontal direction and DCT2 may be applied in the vertical direction. When tu_mts_idx is 2, DCT8 may be applied in the horizontal direction and DCT7 may be applied in the vertical direction.
[0461] When the sub-partition intra coding 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.
[0462] 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.
[0463] Fig.31 is a diagram showing an example in which sub-blocks use the same transform type.
[0464] 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.31 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.
[0465] 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.31 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.
[0466] 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, 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.
[0467] 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 the second transform is performed, whether the sub-partition intra-coding method is applied, 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.
[0468] 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.
[0469] 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.
[0470] 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.
[0471] 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.
[0472] 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.
[0473] 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.
[0474] 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.
[0475] 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.
[0476] 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.
[0477] Transform type combination candidates other than the transform type combination candidates 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.
[0478] 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 (i.e., information indicating whether explicit transform type determination is allowed for a block encoded by intra prediction) and / or sps_explicit_intra_mts_flag (i.e., information indicating whether explicit transform type determination is allowed for a block encoded by inter prediction) may be signaled at a sequence level.
[0479] 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 it is allowed to perform transform in units of subblocks, the position of the subblocks including non-zero transform coefficients, whether to perform the second transform, whether to apply the sub-partition intra-coding method, and 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 the 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.
[0480] 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.
[0481] 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.
[0482] A coding block or a transform block may be partitioned into a plurality of sub-blocks, and transform may be performed only on a portion of the plurality of sub-blocks. Applying transform to only a portion of the plurality of sub-blocks may be defined as a sub-transform block encoding method.
[0483] Fig.32 and Fig.33 is a diagram illustrating application aspects of the sub-transform block coding method.
[0484] Fig.32 is a diagram showing an example in which transformation is performed on only one sub-block among four sub-blocks, and Fig.33 is a diagram showing an example of performing transformation on only one of the two sub-blocks. Fig.32 and Fig.33 In , it is assumed that the transformation is performed only on the sub-blocks marked as "target".
[0485] As in Fig.32 In the illustrated example, after partitioning the coding block into 4 sub-blocks by using mutually orthogonal vertical and horizontal lines, transformation and quantization may be performed on only one of them. The transformation coefficient in the sub-block where the transformation is not performed may be set to 0.
[0486] Optionally, as in Fig.33 In the illustrated example, after a coding block is divided into 2 sub-blocks by using a vertical line or a horizontal line, transformation and quantization may be performed on only one of the sub-blocks. A transformation coefficient in a sub-block where transformation is not performed may be set to 0.
[0487] Information indicating whether the sub-transform block encoding method is applied to the coding block may be signaled in the bitstream. The information may be a 1-bit flag cu_sbt_flag. When the flag is 1, it indicates that the transform is performed only on a portion of the plurality of sub-blocks generated by partitioning the coding block or the transform block, and when the flag is 0, it indicates that the transform is performed without partitioning the coding block or the transform block into sub-blocks.
[0488] Whether the sub-transform block encoding method can be used for the coding block can be determined based on whether the size, shape, prediction coding mode or combination prediction mode of the coding block is used for at least one of the coding blocks. In the example, the sub-transform block encoding method can be used for the coding block when at least one of the width or height of the coding block is equal to or greater than the threshold, the inter-frame prediction is applied to the coding block, or the combination prediction mode is not applied to the coding block. In this case, the threshold value can be a natural number such as 4, 8, or 16.
[0489] Optionally, when the ratio between the width and the height of the coding block is greater than a threshold, the sub-transform block coding method may not be allowed to be applied.
[0490] When intra prediction is applied to the coding block or when the intra block copy mode is applied, it may be determined that the sub-transform block encoding method is unavailable.
[0491] Alternatively, whether the sub-transform block encoding method can be used for the encoding block may be determined based on whether the sub-partition intra encoding method is applied to the encoding block. In an example, when the sub-partition intra encoding method is applied, it may be determined that the sub-transform block encoding method is available.
[0492] When it is determined that the sub-transform block coding method can be used for the coding block, the syntax cu_sbt_flag can be signaled in the bitstream. According to the value of the parsed cu_sbt_flag, it can be determined whether the sub-transform block coding method is applied.
[0493] On the other hand, when it is determined that the sub-transform block encoding method is not applicable to the coding block, the signaling of the syntax cu_sbt_flag may be omitted. When the signaling of the syntax cu_sbt_flag is omitted, it may be determined that the sub-transform block encoding method is not applied to the coding block.
[0494] When the sub-transform coding method is applied to the coding block, information indicating the partition shape of the coding block may be transmitted by signaling in the bitstream. The information indicating the partition shape of the coding block may include at least one of information indicating whether the coding block is partitioned into sub-blocks of 1 / 4 size, information indicating the partition direction of the coding block, or information indicating the number of sub-blocks.
[0495] In an example, when the syntax cu_sbt_flag is 1, a flag cu_sbt_quadtree_flag indicating whether the coding block is partitioned into sub-blocks of ¼ size may be signaled.
[0496] When the syntax cu_sbt_quadtree_flag is 1, it indicates that the coding block is partitioned into sub-blocks of 1 / 4 size. In the example, by using 1 vertical line or 1 horizontal line, the coding block can be partitioned into sub-blocks whose width is 1 / 4 of the coding block width and sub-blocks whose width is 3 / 4 of the coding block width, or the coding block can be partitioned into sub-blocks whose height is 1 / 4 of the coding block height and sub-blocks whose height is 3 / 4 of the coding block height. Optionally, the coding block may be partitioned into sub-blocks whose width and height are each 1 / 2 of the width and height of the coding block. When the coding block is partitioned into sub-blocks of 1 / 4 size, it may be referred to as quadtree type partitioning. When the syntax cu_sbt_quad_tree_flag is 1, a sub-block of 1 / 4 size of the coding block may be set as a transform target.
[0497] When the syntax cu_sbt_quadtree_flag is 0, it indicates that the coding block is partitioned into sub-blocks of 1 / 2 size. In an example, the coding block can be partitioned into 2 sub-blocks of 1 / 2 size by using 1 vertical line or 1 horizontal line. Partitioning the coding block into 2 sub-blocks of 1 / 2 size may be referred to as a binary tree type partition. When the value of the syntax cu_sbt_quad_tree_flag is 0, sub-blocks of 1 / 2 size of the coding block may be included in the coding block.
[0498] In addition, a flag indicating the partition direction of the coding block can be signaled in the bitstream. In one example, a flag cu_sbt_horizontal_flag indicating whether horizontal partitioning is applied to the coding block can be encoded and signaled. When the value of cu_sbt_horizontal_flag is 1, it indicates that horizontal partitioning using at least one partition line parallel to the top and bottom sides of the coding block is applied. When the value of cu_sbt_horizontal_flag is 0, it indicates that vertical partitioning using at least one partition line parallel to the left and right sides of the coding block is applied.
[0499] According to the size or shape of the coding block, the partition shape of the coding block may be determined. In an example, when at least one of the width or height of the coding block is equal to or greater than a first threshold, a quadtree type partition may be available. In an example, the first threshold may be a natural number such as 4, 8, or 16. The first threshold may be referred to as a quadtree type threshold.
[0500] When it is determined that quadtree type partitioning is available, the syntax cu_sbt_quadtree_flag may be signaled in the bitstream. Depending on the value of the parsed cu_sbt_quadtree_flag, it may be determined whether quadtree type partitioning is applied to the coding block.
[0501] When it is determined that quadtree type partitioning is not available, signaling of the syntax cu_sbt_quadtree_flag may be omitted. When signaling of the syntax cu_sbt_quadtree_flag is omitted, it may be determined that binary tree type partitioning is applied to the coding block.
[0502] Table 8 shows a syntax structure for determining whether to parse the syntax cu_sbt_quadtree_flag.
[0503]
Table 8
[0504]
[0505]
[0506] In Table 8, the variable allowSbtVerQ indicates whether quadtree type partitioning in the vertical direction is allowed, and the variable allowSbtHorQ indicates whether quadtree type partitioning in the horizontal direction is allowed. The variables allowSbtVerQ and allowSbtHorQ may be determined based on the quadtree type threshold. In an example, when the quadtree type threshold is 16, allowSbtVerQ may be determined based on whether the width of the coding block is equal to or greater than 16, and allowSbtHorQ may be determined based on whether the height of the coding block is equal to or greater than 16.
[0507] As in the example shown in Table 8, when all variables allowSbtVerQ and allowSbtHorQ are true, the syntax cu_sbt_quad_flag can be parsed from the bitstream. In the example, when the coding block is 16×8, the variable allowSbtHorQ is set to false, so the parsing of the syntax cu_sbt_quad_flag can be omitted. Alternatively, when the coding block is 8×16, the variable allowSbtVerQ is set to false, so the parsing of the syntax cu_sbt_quad_flag can be omitted. When the parsing of the syntax cu_sbt_quad_flag is omitted, a binary tree type partitioning can be applied to the coding block.
[0508] Optionally, unlike the example shown in Table 8, the syntax cu_sbt_quad_flag may be parsed when either the variable allowSbtVerQ or the variable allowSbtHorQ is true. In other words, quadtree type partitioning may be available when only either the width and height of the coding block is equal to or greater than the quadtree type threshold.
[0509] Alternatively, although any one of the width or height of the coding block is equal to or greater than the first threshold, when the other of the width or height of the coding block is equal to or less than the second threshold, it may be determined that the quadtree type partitioning of the coding block is not available. In this case, the second threshold may have a value less than the first threshold. In an example, the second threshold may be a natural number such as 2, 4, or 8.
[0510] The variable allowSbtHorH indicates whether the binary tree type partition in the horizontal direction is available. When the height of the coding block is equal to or greater than the threshold, the binary tree type partition in the horizontal direction can be set to available. The variable allowSbtVerH indicates whether the binary tree type partition in the vertical direction is available. When the width of the coding block is equal to or greater than the threshold, the binary tree type partition in the vertical direction can be set to available. In this case, the threshold can be a natural number such as 4, 8, or 16.
[0511] When both quadtree type partitioning / binary tree type partitioning in the horizontal direction and quadtree type partitioning / binary tree type partitioning in the vertical direction are available, the syntax cu_sbt_horizontal_flag can be signaled in the bitstream. Depending on the value of the syntax cu_sbt_horizontal_flag, partitioning in the horizontal direction or partitioning in the vertical direction can be applied to the coding block.
[0512] On the other hand, when only one of quadtree type partitioning / binary tree type partitioning in the horizontal direction and quadtree type partitioning / binary tree type partitioning in the vertical direction is available, the signal transmission of the syntax cu_sbt_horizontal_flag can be omitted. When the signal transmission of the syntax cu_sbt_horizontal_flag is omitted, the available one of quadtree type partitioning / binary tree type partitioning in the horizontal direction and quadtree type partitioning / binary tree type partitioning in the vertical direction can be applied.
[0513] When binary tree type partitioning in the horizontal direction or binary tree type partitioning in the vertical direction is not available, the signaling of the syntax cu_sbt_horizontal_flag may be omitted.
[0514] When the signaling of the syntax cu_sbt_horizontal_flag is omitted and the variable allowSbtHorH is true, a binary tree type partitioning in the horizontal direction may be applied for the coding blocks.
[0515] When the signaling of the syntax cu_sbt_horizontal_flag is omitted and the variable allowSbtVerH is true, a binary tree type partitioning in the vertical direction may be applied to the coding blocks.
[0516] Information for specifying a sub-block as a transform target among a plurality of sub-blocks may be transmitted by signal in a bitstream. In an example, the syntax cu_sbt_pos_flag may be transmitted by signal in a bitstream. The syntax cu_sbt_pos_flag indicates whether the transform target is the first sub-block in a coding block. In an example, when quadtree type partitioning / binary tree type partitioning in the horizontal direction is applied to a coding block, when cu_sbt_pos_flag is 1, the leftmost sub-block is determined as the transform target, and when cu_sbt_pos_flag is 0, the rightmost sub-block is determined as the transform target. When quadtree type partitioning / binary tree type partitioning in the vertical direction is applied to a coding block, when cu_sbt_pos_flag is 1, the topmost sub-block is determined as the transform target, and when cu_sbt_pos_flag is 0, the bottommost sub-block is determined as the transform target.
[0517] The transform type of the subblock may be determined by considering the partition direction of the coding block and the position of the subblock. In an example, when the coding block is partitioned in the vertical direction and a transform is performed on a subblock located at a left position among the subblocks, the horizontal direction transform type and the vertical direction transform type may be set differently.
[0518] Fig.34 and Fig.35 A horizontal direction transform type and a vertical direction transform type according to the position of a subblock as a transform target are shown.
[0519] exist Fig.34 In the example shown, when the sub-block as the transform target includes the upper left sample or the lower right sample of the coding block, the horizontal transform type and the vertical transform type can be set to be the same. Fig.34 In the example shown in the figure, it is shown that when the sub-block as the transform target includes the upper left sample of the coding block, the horizontal transform type and the vertical transform type can be set to DCT8, and when the sub-block as the transform target includes the lower right sample of the coding block, the horizontal transform type and the vertical transform type can be set to DST7.
[0520] When the sub-block as the transform target includes the upper right sample or the lower left sample of the coding block, the horizontal transform type and the vertical transform type may be set differently. Fig.34 The illustrated example shows that when the sub-block as the transform target includes the upper right sample of the coding block, the horizontal transform type can be set to DST7, and the vertical transform type can be set to DCT8. When the sub-block as the transform target includes the lower left sample of the coding block, the horizontal transform type can be set to DCT8, and the vertical transform type can be set to DST7.
[0521] and Fig.34 Unlike the example shown, when a sub-block including an upper left sample or a sub-block including a lower right sample in a coding block is determined as a transform target, the horizontal transform type and the vertical transform type may be set differently, and when a sub-block including an upper right sample or a sub-block including a lower left sample in a coding block is determined as a transform target, the horizontal transform type and the vertical transform type may be set to be the same.
[0522] Fig.34 It is shown that a sub-block whose height and width are 1 / 2 of the coding block is set as a transformation target. Unlike the example shown, a sub-block whose width is the same as the coding block but whose height is 1 / 4 of the coding block or a sub-block whose height is the same as the coding block but whose width is 1 / 4 of the coding block may be set as a transformation target.
[0523] exist Fig.35 In the example shown, when the sub-block as the transform target includes the upper left sample of the coding block, the horizontal transform type and the vertical transform type can be set differently. Fig.35 In the example shown in , when the binary tree type partition in the horizontal direction is applied and the top subblock is determined as the transform target, the horizontal direction transform type may be set to DST7 and the vertical direction transform type may be set to DCT8. When the binary tree type partition in the vertical direction is applied and the left subblock is determined as the transform target, the horizontal direction transform type may be set to DCT8 and the vertical direction transform type may be set to DST7.
[0524] and Fig.35 Different from the example shown, when the sub-block as the transform target includes the upper left sample of the coding block, the horizontal transform type and the vertical transform type can be set to the same, and when the sub-block as the transform target includes the lower right sample of the coding block, the horizontal transform type and the vertical transform type can be set to different.
[0525] When the sub-block as the transform target includes the lower right sample of the coding block, the horizontal transform type and the vertical transform type may be set to be the same. Fig.35 In the example shown in , when the binary tree type partition in the horizontal direction is applied and the bottom sub-block is determined as the transform target, the horizontal transform type and the vertical transform type may be set to DST7. When the binary tree type partition in the vertical direction is applied and the right sub-block is determined as the transform target, the horizontal transform type and the vertical transform type may be set to DST7.
[0526] As in the above example, whether the horizontal transform type and the vertical transform type are set to be the same may be determined according to the position of the sub-block as the transform target in the coding block. In addition, the horizontal transform type and the vertical transform type may be determined according to the position of the sub-block as the transform target in the coding block.
[0527] For a sub-block, encoding of information indicating whether there is a non-zero coefficient (e.g., CBF) may be omitted. When encoding of the CBF is omitted, whether a non-zero residual coefficient is included in each sub-block may be determined based on the position of the block where the transform is performed. In an example, when a sub-block at a right or bottom position in a coding block to which a binary tree type partition is applied is determined as a transform target, a CBF value of a sub-block at a left or top position may be inferred to be 0, and a CBF value of a sub-block at a right or bottom position may be inferred to be 1. Alternatively, when a sub-block at a left or bottom position in a coding block to which a binary tree type partition is applied is determined as a transform target, a CBF value of a sub-block at a left or top position may be inferred to be 1, and a CBF value of a sub-block at a right or bottom position may be inferred to be 0.
[0528] The second transform may be performed on the block to which the first transform is performed. The second transform may be performed on an upper left area in the transform block to which the first transform has been applied.
[0529] If the residual coefficients of the first transform and the second transform have been performed are encoded, the decoding apparatus may perform the second inverse transform as an inverse process of the second transform on the transform block, and perform the first inverse transform as an inverse process of the first transform on the transform block on which the second inverse transform has been performed.
[0530] Whether to apply the second transform to the current block may be determined based on at least one of the size of the current block, the number of residual coefficients, the coding mode or the intra prediction mode, or whether a sub-partition intra coding method is applied. The encoder may encode information indicating whether the second transform is applied and transmit it to the decoder with a signal. Alternatively, the encoder and the decoder may determine whether to perform the second transform based on the same condition.
[0531] In an example, information indicating whether to perform the second transform may be transmitted by signal in the bitstream. Specifically, a flag indicating whether to perform the second transform or index information specifying whether to perform the second transform and a transform core for the second transform may be transmitted by signal.
[0532] Table 9 shows an example of signaling a flag lfnst_flag indicating whether to perform the second transform in a bitstream. When the value of the flag lfnst_flag is 0, it indicates that the second transform is not performed on the current block. On the other hand, when the value of the flag lfnst_flag is 1, it indicates that the second transform is performed on the current block.
[0533]
Table 9
[0534]
[0535] Optionally, the syntax lfnst_idx may be signaled in the bitstream. When the value of the index lfnst_idx is 0, it indicates that the second transform is not performed for the current block. On the other hand, when the index lfnst_idx is greater than 0, it indicates that the second transform is performed for the current block. When the value of the index lfnst_idx is greater than 0, lfnst_idx may be used to specify a transform core for performing the second transform.
[0536] Alternatively, whether to perform the second transformation may be determined by comparing at least one of the width or height of the current block with a threshold. In an example, when the minimum value of the width and height of the current block is less than the threshold, the second transformation may not be performed. In this case, the threshold may be a natural number such as 4, 8 or 16.
[0537] Alternatively, when the current block is encoded by inter prediction, the second transform may not be applied.
[0538] Alternatively, although the current block is encoded by intra prediction, the second transform may not be applied when matrix-based intra prediction is performed.
[0539] Alternatively, whether to perform the second transformation may be determined based on whether the transformation kernel in the horizontal direction is the same as the transformation kernel in the vertical direction. In an example, the second transformation may be performed only when the transformation kernel in the horizontal direction is the same as the transformation kernel in the vertical direction. Alternatively, the second transformation may be performed only when the transformation kernel in the horizontal direction is different from the transformation kernel in the vertical direction.
[0540] Optionally, the second transform may be allowed only when a predefined transform kernel is used for the transform in the horizontal direction and the transform in the vertical direction. In an example, the second transform may be allowed when a DCT2 transform kernel is used for the transform in the horizontal direction and the transform in the vertical direction.
[0541] Alternatively, when the subpartition intra encoding method is applied to the current block, the second transform may be allowed only when a DCT2 transform kernel is used for transform in the horizontal direction and transform in the vertical direction.
[0542] Alternatively, whether to perform the second transform may be determined based on the number of non-zero transform coefficients of the current block. In an example, when the number of non-zero transform coefficients of the current block is less than or equal to a threshold, the second transform may be set not to be used, and when the number of non-zero transform coefficients of the current block is greater than the threshold, the second transform may be set to be used. The second transform may be allowed to be used only when the current block is encoded by intra prediction.
[0543] 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 encoder and the decoder. Alternatively, the threshold may be determined based on the size or shape of the current block.
[0544] 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.
[0545] Whether to perform the second transform may be determined based on whether the combined prediction encoding mode is applied to the current block. In an example, when the combined prediction encoding mode is applied to the current block, it may be set not to perform the second transform.
[0546] Alternatively, when the combined prediction encoding mode is applied, whether to perform the second transform may be determined based on at least one of a size or shape of the current block, an intra prediction mode, or a weight.
[0547] Optionally, when the combined prediction coding mode is applied, it may be configured to transmit information indicating whether the second transform is performed on the current block using a signal. For example, when the combined prediction coding mode is applied to the current block, the index lfnst_idx may be transmitted using a signal.
[0548] Alternatively, whether to perform the second transform may be determined regardless of whether the combined prediction encoding mode is applied.
[0549] Alternatively, whether to allow the second transform may be determined based on whether the subpartition intra encoding method is applied to the current block. In an example, when the subpartition intra encoding method is applied to the current block, it may be set not to apply the second transform to the current block.
[0550] Optionally, when the sub-partition intra-frame coding method is applied to the current block, it may be set to apply the second transform. For example, when the vertical partition or the horizontal partition is applied to the current block, the index information indicating whether the second transform is applied to the current block may be transmitted by a signal. Whether the second transform and / or the transform kernel for the second transform are applied may be determined by the index information. On the other hand, when the sub-partition intra-frame coding method is not applied to the current block, the encoding of the index information may be omitted. Optionally, when the sub-partition intra-frame coding method is not applied to the current block, it may be determined whether to encode the index information indicating whether the second transform is applied based on whether a preset condition is satisfied. In this case, the preset condition may be related to at least one of the position of the non-zero coefficient, the number of non-zero coefficients, or the size of the current block. In the example, when the number of non-zero coefficients is equal to or greater than 1, when the number of non-zero coefficients is 1 but is not included in the 4×4 upper left area of the current block, or when the non-zero coefficient is not included in the 4×4 area of the current block and the scanning order of the non-zero coefficient is equal to or less than a threshold, the index information may be encoded and transmitted by a signal. Otherwise, the encoding of the index information may be omitted.
[0551] When the index information is not signaled, the value of the index information may be inferred to indicate that the second transform is not applied.
[0552] Optionally, whether to apply the second transform may be determined based on at least one of the size, width, height, or shape of the sub-block. In the example, when at least one of the size, width, or height of the sub-block is less than a threshold, it may be set not to apply the second transform. Specifically, when at least one of the size, width, or height of the sub-block is less than a threshold, encoding of the index information may be omitted. Information indicating whether to perform the second transform may be signaled at the level of the coding block. Whether the second transform will be applied to the sub-block belonging to the coding block may be determined based on the information signaled at the level of the coding block.
[0553] The threshold value may have a predefined value in the encoder and the decoder. In an example, the threshold value may be set to 2, 4, or 8, etc. Alternatively, the threshold value may be determined based on at least one of a partition direction of the current block or the number of subblocks included in the current block.
[0554] Alternatively, it is listed above that whether to encode the syntax indicating whether to apply the second transform can be determined by using a parameter related to the current block for determining whether to apply the second transform.
[0555] In an example, when at least one of the size of the current block, the number of residual coefficients, the coding mode or the intra prediction mode, or whether the sub-partition intra coding method is applied does not meet the preset condition, the encoding of the syntax indicating whether the second transform is applied may be omitted. In an example, the encoding of lfnst_flag or lfnst_idx may be omitted, and the values of lfnst_flag and lfnst_idx may be inferred to be 0. In other words, when the encoding of the syntax is omitted, the second transform may not be applied.
[0556] When intra BDPCM is applied to the current block, the second transform may not be performed. When intra BDPCM is applied to the current block, the signal transmission of the syntax element indicating whether the second transform is performed may be omitted, and the value of the syntax element may be derived as 0. Table 10 shows an example of omitting the signal transmission of lfnst_idx for a block to which intra BDPCM is applied.
[0557]
Form 10
[0558]
[0559] Optionally, when intra BDPCM is applied to the current block, signaling of a syntax element (e.g., transform_skip_flag) indicating whether to perform transform skipping may be omitted. When intra BDPCM is applied to the current block, signaling of the flag transform_skip_flag may be omitted, and the value of the flag transform_skip_flag may be inferred to be 1. In other words, when intra BDPCM is applied, transform may not be applied to the current block.
[0560] When it is determined that the transform is not applied to the current block, both the first transform and the second transform may not be applied. Therefore, when the transform of the current block is skipped, the signal transmission of the syntax element indicating whether the second transform is performed may be omitted, and the value of the syntax element may be inferred to be 0. Finally, when intra BDPCM is applied to the current block, the signal transmission of the syntax element lfnst_idx indicating whether the second transform is performed may be omitted.
[0561] Based on the above description, a method of performing the second transform in an encoder and a decoder will be described in detail.
[0562] The second transform may be performed for the upper left region in the current block. The target region to which the second transform is applied may have a predefined size or a predefined shape. The target region to which the second transform is applied may have a square block shape such as 4×4 or 8×8 or a non-square block shape such as 4×8 or 8×4.
[0563] Optionally, when the current block is evenly partitioned into N regions, at least one of the N regions may be set as the target region. In this case, N may be a natural number such as 2, 4, 8, or 16. The variable N may be predefined in the encoder and the decoder. Optionally, the variable N may be determined based on the size and / or shape of the current block.
[0564] Alternatively, the target region may be determined based on the number of transform coefficients. In an example, a predetermined number of transform coefficients may be determined as the target region according to a predetermined scanning order.
[0565] Alternatively, information for specifying the size and / or shape of the target region may be encoded and transmitted in a bitstream. The information may include at least one of information indicating the size of the target region or information indicating the number of 4×4 blocks included in the target region.
[0566] Alternatively, the entire current block may be set as the target region. In an example, when the size of the current block is the same as the minimum size (eg, 4×4) of the target region, the entirety of the current block may be set as the target for the second transform.
[0567] The second transform may be applied in a non-separable shape. Therefore, the second transform may also be referred to as a non-separable secondary transform (NSST).
[0568] The transform coefficients in the region to which the second transform is applied may be arranged in a single column. In an example, when the second transform is performed on a target region of N×N size, the transform coefficients included in the target region may be converted into N 2 When a block of 4×4 size is set as the target region, the transform coefficients included in the target region may be converted into an input matrix of 16×1 size. When a block of 8×8 size is set as the target region, the transform coefficients included in the target region may be converted into an input matrix of 64×1 size.
[0569] The non-separable transform matrix may be applied to an input matrix generated by arranging transform coefficients included in the target region into a line. The size of the non-separable transform matrix may be variously determined according to the size of the input matrix.
[0570] In the example, when the input matrix size is N 2 ×1, based on N 2 ×N 2 For example, when the size of the input matrix is 16×1, a 16×16 non-separable transformation matrix may be used, and when the size of the input matrix is 64×1, a 64×64 non-separable transformation matrix may be used.
[0571] A plurality of inseparable transform matrices may be stored in the encoder and the decoder. Information for specifying any one of the plurality of inseparable transform matrices may be signaled in a bitstream.
[0572] Alternatively, the non-separable transform matrix may be specified based on at least one of a size, a shape, a quantization parameter, an intra prediction mode, or a transform type of the current block used in the first transform.
[0573] Alternatively, a non-separable transform matrix candidate that can be used by the current block may be specified based on at least one of a size, a shape, a quantization parameter, an intra prediction mode, or a transform type of the current block used in the first transform. When there are multiple non-separable transform matrix candidates that can be used by the current block, information indicating one of the multiple non-separable transform matrix candidates may be encoded and transmitted with a signal.
[0574] The transformation matrix may be obtained by multiplying the non-separable transformation matrix by the input matrix. In an example, Equation 6 shows an example of obtaining the transformation matrix A'.
[0575] [Equation 6]
[0576] A′=T*A
[0577] In Equation 6, T represents the non-separable transformation matrix, and A represents the input matrix. When the size of the matrix T is N 2 ×N 2 And the size of matrix A is N 2 ×1, you can get N 2 In an example, when a 16×1 input matrix and a 16×16 non-separable transformation matrix are used, a 16×1 transformation matrix A' may be obtained. Alternatively, when a 64×1 input matrix and a 64×64 non-separable transformation matrix are used, a 64×1 transformation matrix A' may be obtained.
[0578] When the transformation matrix A' is obtained, the components in the transformation matrix A' may be set to the transformation coefficients of the N×N size block in the current block. The transformation coefficients in the remaining regions not including the N×N size block may be set to default values. In an example, the transformation coefficients in the region where the second transformation is not performed may be set to 0.
[0579] The second transformation may be performed by using a non-separable transformation matrix in which the number of rows is smaller than the number of columns. 2 )-sized non-separable transformation matrix can be applied to (N 2 ×1) size. In this case, k can have a size smaller than N 2 In this example, k can be N 2 / 2、N2 / 4 or 3N 2 / 4, etc. k may be referred to as a reduction factor.
[0580] As a result, a transformation matrix having a (k×1) size smaller than the input matrix may be obtained. Thus, the second transform outputting a transformation matrix having a size smaller than the input matrix may be referred to as a reduced secondary transform.
[0581] Equation 7 represents an example of applying a downscaled secondary transform.
[0582] [Equation 7]
[0583] A R =R*A
[0584] In Equation 7, R represents k×N 2 The number of rows k is smaller than the number of columns N. 2 The non-separable transformation matrix of A can be called the reduced non-separable transformation matrix. R Represents a transformation matrix of size k×1. The size is smaller than the transformation matrix A of the input matrix A. R Can be called a reduced transformation matrix.
[0585] When the reduced transformation matrix A R When obtained, the reduced transformation matrix A R The components in are set to the transform coefficients of at least one or more M×M-sized blocks in the current block. In this case, M may be a natural number less than N. The number of M×M-sized blocks may be determined according to the reduction factor k. The transform coefficients of the remaining regions except for at least one M×M-sized block may be set to default values. In an example, the transform coefficients in the remaining regions may be set to 0.
[0586] Fig.36 is a diagram showing aspects of encoding of transform coefficients when the reduction factor is 16.
[0587] Transform coefficients included in a target region of 8×8 size may be transformed into an input matrix of 64×1 size, and a transform matrix of 16×1 size may be obtained by using a non-separable transform matrix of 16×64 size.
[0588] A transform matrix of a 16×1 size may be set as a transform coefficient of a 4×4 block, and transform coefficients in other regions may be set to zero.
[0589] Although not shown, when the reduction factor k is 32, a transform matrix of a 32×1 size may be set to transform coefficients of an 8×4 block or a 4×8 block, and transform coefficients in other regions may be set to zero.
[0590] When the reduction factor k is 48, a transform matrix of a 48×1 size may be set to transform coefficients of three 4×4 blocks, and transform coefficients in other regions may be set to 0. Specifically, the transform matrix may be set to transform coefficients of a 4×4 block at an upper left position of the current block, a 4×4 block adjacent to the right of the upper left block, and a 4×4 block adjacent to the bottom of the upper left block.
[0591] The transform matrix may be determined based on at least one of the size or shape of the current block or the intra prediction mode. In an example, based on the intra prediction mode of the current block, a transform matrix set may be determined, and one of a plurality of transform matrix candidates included in the transform matrix set may be selected. Index information specifying a transform matrix applied to the current block from among the plurality of transform matrix candidates may be encoded and signaled.
[0592] When the remaining transform coefficients excluding the transform coefficient generated by the second transform are set to 0, the decoder may determine whether to perform the second transform based on the position of the last non-zero residual coefficient. In an example, when the last residual coefficient is located outside the block storing the transform coefficient generated by the second transform, it may be determined that the second transform is not performed. In other words, the decoder may perform an inverse transform of the second transform only when the last residual coefficient is located in the block storing the transform coefficient generated by the second transform.
[0593] Whether to perform a reduced second transform may be determined based on at least one of a size or a shape of the current block. In an example, when at least one of a width or a height of the current block is greater than a threshold, a reduced second transform may be applied, otherwise, a general second transform may be applied. In this case, the threshold may be a natural number such as 4, 8, or 16.
[0594] Alternatively, whether to perform a reduced second transform may be determined according to the size of the target region. In an example, when the second transform is performed for a target region of 4×4 size, a general second transform may be applied. In an example, for a target region of 4×4 size, the second transform may be performed by using a non-separable transform matrix of 16×16 size.
[0595] On the other hand, when the second transform is performed for a target region of 8×8 size, a reduced second transform may be applied. In an example, for a target region of 8×8 size, the second transform may be performed by using a non-separable transform matrix of 48×64, 32×64 or 16×64 size.
[0596] When performing an inverse transform for the reduced second transform, the size of the output matrix has a value greater than the size of the input matrix. In an example, when the reduction factor k is 16, an output matrix of 64×1 size may be obtained by performing an inverse transform on an input matrix of 16×1 size.
[0597] When the sub-partition intra encoding method is applied to the coding block, the coding block may be partitioned into a plurality of sub-blocks. When the sub-partition intra encoding method is applied to the coding block, it may be set not to apply the second transform.
[0598] Alternatively, whether to perform the second transform may be determined based on the shape or size of the sub-partition. In the example, when the coding block is partitioned into sub-partitions with a width or height of 4, the second transform may be applied. In other words, the second transform may be applied only when the sub-partition has a 4×L or L×4 shape. In this case, L represents an integer equal to or greater than 4.
[0599] Optionally, the second transformation may be applied only when the minimum of the width and height of the sub-partition is equal to or greater than a predefined threshold. In this case, the threshold may be an integer such as 4, 8 or 16.
[0600] As in the above example, when the shape or size of the sub-partition satisfies the predefined condition, information indicating whether the second transform is applied may be signaled in the bitstream. In the example, when the sub-partition is 4×L or L×4, or when the minimum value of the width and height of the sub-partition is equal to or greater than a threshold, the syntax lfnst_idx indicating whether the second transform is performed may be signaled.
[0601] On the other hand, when the shape or size of the sub-partition does not satisfy the predefined condition, the encoding / decoding of the information indicating whether the second transformation is applied may be omitted. In an example, when the minimum value of the width and height of the sub-partition is less than a threshold value, the encoding / decoding of the syntax lfnst_idx may be omitted. When the encoding / decoding of the syntax lfnst_idx is omitted, the value of the syntax lfnst_idx may be derived as 0.
[0602] When it is determined to apply the second transform, the second transform may be applied to a subblock at a predefined position in the coding block or a subblock whose partition index is less than a threshold. In this case, the partition index of the left subblock may be set to a value having a smaller partition index than the right subblock, or the partition index of the top subblock may be set to a value having a smaller partition index than the bottom subblock. In an example, the second transform may be applied only to the first subblock in the coding block.
[0603] Optionally, the second transform may be applied to each of all sub-blocks.
[0604] Optionally, when it is determined to perform the second transform at the level of the coding block, it may be adaptively determined whether to apply the second transform to each sub-block based on the attribute of each sub-block. In this case, the attribute of the sub-block may include at least one of the number of residual coefficients included in the sub-block, whether transform skipping is applied to the sub-block, or a transform kernel applied to the sub-block.
[0605] The size of the target region for the second transform may be determined based on the size of the sub-block. In an example, a 4×4-sized block including 16 samples, two 4×4-sized blocks including 32 samples, three 4×4-sized blocks including 48 samples, or four 4×4-sized blocks including 64 samples may be set as the target region for the second transform. Depending on the size of the target region, a general second transform may be applied, or a reduced second transform may be applied.
[0606] The size of the target area for the second transformation may be determined based on the size of the sub-block. In an example, when at least one of the width or height of the sub-block is less than a threshold value, an area including N samples may be set as the target area for the second transformation. On the other hand, when the width and height of the sub-block are equal to or greater than the threshold value, an area including M samples may be set as the target area for the second transformation. In this case, M may be a natural number greater than N. In an example, N may be 16 or 32, and M may be 48 or 64. In addition, the threshold value may be a natural number such as 2, 4, 8, or 16.
[0607] The target region for the second transform may be set not to extend beyond the boundary of the sub-block. In other words, when the target region for the second transform spans two or more sub-blocks, the target region may be set not to perform the second transform.
[0608] Fig.37 and Fig.38 is a diagram showing a target area for a second transformation.
[0609] When partitioning in the horizontal direction is applied to a 16×16 sized coding block, the coding block may be partitioned into 16×4 sized sub-blocks. As in the example shown, when the sub-block has an N×4 size (N is an integer greater than 4), the height of the target region for the second transform may be set to not more than 4.
[0610] In other words, as in Fig.37 In the example shown in (a) of FIG. 1 , the target region for the second transformation may be set to a region of 4×4 or 8×4 size.
[0611] On the other hand, as in Fig.37 In the example shown in (b) of FIG. 5 , setting of a target area for the second transformation, for example, 4×8 or 8×8 may not be allowed.
[0612] When partitioning in the vertical direction is applied to a 16×16 sized coding block, the coding block may be partitioned into 4×16 sized sub-blocks. As in the example shown, when the sub-block has a 4×N size (N is an integer greater than 4), the width of the target region for the second transform may be set to not more than 4.
[0613] In other words, as in Fig.38 In the example shown in (a) of FIG. 1 , the target region for the second transformation may be set to a region of 4×4 or 4×8 size.
[0614] On the other hand, as in Fig.38 In the example shown in (b), setting a target area for the second transformation, such as 8×4 or 8×8, may not be allowed.
[0615] The decoder may decode the residual coefficients in the bitstream and derive transform coefficients by performing inverse quantization on the residual coefficients. When transform coefficients are generated by the first transform and the second transform, residual samples may be derived by performing the second inverse transform and the first inverse transform on the transform coefficients.
[0616] When it is determined that the second transform is performed on the current block, a target region as a target of the second inverse transform may be determined. When a general second transform is applied, the size of the target region for the second inverse transform may be set to be the same as the size of the target region for the second transform. In an example, when the second transform is performed on a 4×4 sized region by using a 16×16 sized inseparable transform matrix, the second inverse transform may be applied to the 4×4 sized region.
[0617] On the other hand, when the reduced second transform is applied, the size of the target region for the second inverse transform may have a value smaller than the size of the target region for the second transform. In an example, when the second transform is performed on an 8×8 sized region by using a reduced transform matrix of a 64×48 size, the second inverse transform may be performed on a region including 48 samples (e.g., three 4×4 sized blocks).
[0618] In the decoder, the target area for the second inverse transform may be determined based on the size of the current block. In this case, the current block may represent a coding block or a transform block that is a target for performing the second inverse transform. In an example, when at least one of the width or height of the current block is less than a threshold, the target area may be constructed to include 16 samples. On the other hand, when the width and height of the current block are equal to or greater than the threshold, the target area may be constructed to include 48 samples.
[0619] The input matrix may be generated by arranging the transform coefficients included in the target area in rows. In this case, when the reduced second transform is applied to the current block, the input matrix may be generated based on as many transform coefficients as the reduction factor k. In the example, when the reduction factor k is 16, the input matrix may be generated based on the transform coefficients included in the upper left block of 4×4 size. When the reduction factor k is 32, the input matrix may be generated based on the transform coefficients included in the upper left block and in the 4×4 size neighboring blocks adjacent to the right or bottom of the upper left block. When the reduction factor k is 48, the input matrix may be generated based on the transform coefficients of the upper left block, the transform coefficients of the 4×4 size neighboring blocks adjacent to the right of the upper left block, and the transform coefficients of the 4×4 size neighboring blocks adjacent to the bottom of the upper left block.
[0620] The reduction factor k may be predefined in the encoder and the decoder. Alternatively, information for determining the reduction factor k may be signaled in the bitstream. Alternatively, the reduction factor k may be determined based on the size or shape of the current block.
[0621] The transformation matrix may be obtained by multiplying the input matrix with the non-separable inverse transformation matrix. The non-separable inverse transformation matrix may be a symmetric matrix of the non-separable transformation matrix shown in Equations 6 to 7. Equations 8 and 9 show examples of obtaining the transformation matrix by using the non-separable inverse transformation matrix.
[0622] [Equation 8]
[0623] A′=T T *A
[0624] When a general second transform is applied to the current block, it can be obtained by combining the input matrix A with the non-separable inverse transform matrix T T In this example, the inverse transformation matrix T of size 16×16 can be derived by multiplying T Multiply with the 16×1 input matrix A to derive a 16×1 transformation matrix.
[0625] When the transform matrix A' is obtained, the components in the transform matrix A' may be set to transform coefficients of an NxN sized block in the current block. In an example, a 16x1 sized transform matrix may be set to transform coefficients of a 4x4 block.
[0626] [Equation 9]
[0627] A′=R T *A
[0628] When the reduced second transform is applied to the current block, the input matrix A can be combined with the reduced non-separable inverse transform matrix R TThe transformation matrix A' is derived by multiplying. In an example, the reduced non-separable inverse transformation matrix R of size 64×16 can be obtained by multiplying T Multiply with the 16×1 input matrix A to derive a 64×1 transformation matrix.
[0629] Alternatively, the reduced inverse non-separable transform matrix R of size 64×32 can be T Multiply with the 32×1 input matrix A to derive a 64×1 transformation matrix.
[0630] Alternatively, the reduced inverse non-separable transform matrix R of size 64×48 can be obtained by T Multiply it with the 48×1 input matrix A to derive a 48×1 transformation matrix.
[0631] When the transform matrix A' is obtained, the components in the transform matrix A' may be set to transform coefficients of an NxN sized block in the current block. In an example, a 64x1 sized transform matrix may be set to transform coefficients of an 8x8 block.
[0632] The non-separable inverse transform matrix may be determined based on at least one of index information signaled in a bitstream or the size of the current block or the intra prediction mode. In an example, the size of the non-separable inverse transform matrix may be determined based on the size of the current block, and the non-separable inverse transform matrix set may be determined based on the intra prediction mode of the current block. When the non-separable inverse transform matrix set is determined by the intra prediction mode of the current block, at least one of a plurality of non-separable inverse transform matrix candidates corresponding to the size of the current block included in the non-separable inverse transform matrix set may be specified by the index lfnst_idx.
[0633] The non-separable inverse transform matrix set may include a plurality of non-separable inverse transform matrix candidates. In this case, at least one of the type or number of inverse transform matrix candidates may be different between non-separable inverse transform matrix sets having different indices.
[0634] Table 11 shows an example of determining a non-separable inverse transform set based on an intra prediction mode. In Table 11, predModeIntra represents the index of the intra prediction mode, and lfnstTrSetIdx represents the index of the non-separable inverse transform set.
[0635]
Form 11
[0636] predModeIntra lfnstTrSetIdx predModeIntra<0 1 0<=predModeIntra<=1 0 2<=predModeIntra<=12 1 13<=predModeIntra<=23 2 24<=predModeIntra<=44 3 45<=predModeIntra<=55 2 56<=predModeIntra<=80 1 81<=predModeIntra<=83 0
[0637] In an example, when the intra prediction mode of the current block is planar, a non-separable inverse transform matrix set with an index of 0 may be selected. Thereafter, the non-separable inverse transform matrix may be determined based on the size of the current block and the value of lfnst_idx.
[0638] The set of inseparable inverse transforms may be determined by further simplifying Table 11. In an example, Table 11 may be simplified as Table 12.
[0639]
Form 12
[0640]
[0641]
[0642] Alternatively, the non-separable inverse transform matrix set may be selected by only considering whether the intra prediction mode is directional or non-directional. Table 13 shows an example of determining the non-separable inverse transform matrix set based on whether the intra prediction mode is directional or non-directional.
[0643]
Form 13
[0644] predModeIntra lfnstTrSetIdx 0<=predModeIntra<=1 0 Otherwise 1
[0645] Optionally, after storing multiple lookup tables defining the mapping relationship between the intra prediction mode and the inseparable inverse transform matrix set, the inseparable inverse transform matrix set can be determined by using one of the multiple lookup tables. In an example, when determining the inseparable inverse transform matrix set, one of Tables 11 to 13 can be selectively used.
[0646] Information specifying one of the multiple lookup tables may be signaled in the bitstream. The information may be signaled at the level of a sequence, picture, slice, or block.
[0647] Alternatively, one of the plurality of lookup tables may be selected based on at least one of a size or a shape of the current block or a transform kernel applied in the first transform.
[0648] When an inverse transform matrix of a predefined size is used, it may be set not to use a method of determining a set of inseparable inverse transform matrices based on an intra prediction mode. In an example, when an inverse transform matrix of a 48×16 size is used, the process of determining a set of inseparable inverse transform matrices based on an intra prediction mode may be omitted.
[0649] As in the above-mentioned description, one of a plurality of non-separable transform matrix candidates may be applied to the current block. In this case, each of the non-separable transform matrix candidates may have at least one different size or coefficient.
[0650] Fig.39 is an example showing various inseparable transformation matrix candidates.
[0651] It is assumed that a 4×4 sub-block is a target for the second inverse transform.
[0652] As in Fig.39 In the example shown in (a) of FIG. 1 , a transform matrix of 64×1 size may be derived by using a non-separable inverse transform matrix of 64×16 size. The derived transform matrix may be set as a transform coefficient of a block of 8×8 size.
[0653] As in Fig.39 In the example shown in (b) of FIG. 1 , a transform matrix of 32×1 size can be derived by using a non-separable inverse transform matrix of 32×16 size. The derived transform matrix can be set as a transform coefficient of a block of 4×8 or 8×4 size.
[0654] As in Fig.39 In the example shown in (c), a transform matrix of 48×1 size can be derived by using a non-separable inverse transform matrix of 48×16 size. The derived transform matrix can be set as the transform coefficients of three 4×4 size blocks. There is a non-zero transform coefficient in the upper left block of the three 4×4 size blocks, and in other blocks, the value of the transform coefficient in the block can be set to 0.
[0655] The non-separable inverse transform matrix to be applied to the current block may be determined based on whether the sub-partition intra encoding method is applied to the current block. In an example, optionally, when the sub-partition intra encoding method is applied to the current block, a non-separable inverse transform matrix of 32×16 size may be set to be applied.
[0656] Alternatively, the type or number of non-separable inverse transform matrix candidates may be determined differently based on whether the subpartition intra encoding method is applied to the current block. In an example, a non-separable inverse transform matrix of 32×16 size may be used as a candidate only when the subpartition intra encoding method is applied to the current block.
[0657] When the subpartition intra encoding method is applied to the current block and a non-separable inverse transform matrix of a 32×16 size is applied, the size or shape of a block derived by performing the second inverse transform may differ according to the size or shape of a subpartition.
[0658] In an example, when a partition in a vertical direction is applied to the current block (for example, when the sub-partition has a 4×L shape), a transform matrix of a size of 32×1 obtained by performing the second inverse transform may be set as a transform coefficient of a block of a size of 4×8. On the other hand, when a partition in a horizontal direction is applied to the current block (for example, when the sub-partition has an L×4 shape), a transform matrix of a size of 32×1 obtained by performing the second inverse transform may be set as a transform coefficient of a block of a size of 8×4.
[0659] Although the subpartition intra prediction encoding method is not applied, when the current block is encoded by intra prediction and its size is 4×L or L×4, a non-separable matrix of a size of 32×16 may be applied.
[0660] When the subpartition intra encoding method is applied to the current block, the second inverse transform and the first inverse transform may be applied to each of a plurality of subblocks included by the current block.
[0661] Optionally, the second inverse transform and the first inverse transform may be applied to a sub-block at a predefined position in the plurality of sub-blocks or a sub-block whose partition index is less than a threshold value. In an example, the second transform may be applied only to a sub-partition at the topmost position of the current block or a sub-partition at the leftmost position of the current block, and may not be applied to the remaining sub-partitions.
[0662] When the sub-partition intra-coding method is applied, the target area for the second inverse transform may be determined as 4×4 in size. Alternatively, the size of the target area may be adaptively determined according to the size of the sub-block. In an example, when the minimum value of the width and height of the sub-partition is 4, a 4×4 sized area may be set as the target area.
[0663] Alternatively, for a sub-block of a 4×N or N×4 shape, an area of a 8×4 size may be set as a target area. In this case, N represents an integer equal to or greater than 8.
[0664] The input matrix may be generated by arranging the transform coefficients in the target region included in the sub-block into rows. In an example, when the target region is set to a 4×4 size, the transform coefficients included in the target region may be transformed into an input matrix of a 16×1 shape. Alternatively, when the target region is set to a 4×8 or 8×4 size, the transform coefficients included in the target region may be transformed into an input matrix of a 32×1 shape.
[0665] The transformation matrix may be derived by multiplying the input matrix with a non-separable transformation matrix. In an example, a 16×1 sized transformation matrix may be obtained by multiplying a 16×16 sized non-separable transformation matrix with a 16×1 sized input matrix. Alternatively, a 32×1 sized transformation matrix may be obtained by multiplying a 32×32 sized non-separable transformation matrix with a 32×1 sized input matrix.
[0666] When the transformation matrix is obtained, the components in the transformation matrix may be set as the transformation coefficients of the sub-block. In an example, a transformation matrix of 16×1 size may be set as the transformation coefficients of a block of 4×4 size. Alternatively, a transformation matrix of 32×1 size may be set as the transformation coefficients of the upper left block of 4×8 or 8×4 size.
[0667] When the second inverse transform is applied to the subblock, a predefined transform kernel may be applied to the horizontal transform and the vertical transform of the subblock. In an example, the horizontal transform kernel and the vertical transform kernel of the subblock to which the second inverse transform is applied may be set to DCT2.
[0668] Whether the second transform is allowed may be determined based on whether the sub-transform block encoding method is applied to the coding block. In an example, when the sub-transform block encoding method is applied to the coding block, it may be set not to apply the second transform.
[0669] Optionally, when the sub-transform block coding method is applied to the coding block, it can be set to apply the second transform only to at least one available sub-block among the multiple sub-blocks. In this case, the available sub-block may represent a block among the multiple sub-blocks on which the first transform is performed.
[0670] The size of the target area for the second transformation in the sub-block may be determined according to the size or shape of the sub-block. In an example, when at least one of the height or width of the sub-block is less than a threshold, the second transformation may be performed for a 4×4 area. On the other hand, when at least one of the height or width of the sub-block is equal to or greater than the threshold, the second transformation may be performed for an 8×8 area.
[0671] Whether to apply the second transform to the sub-block may be determined based on at least one of the size, shape, position, or partition index of the sub-block. In an example, the second transform may be applied only to the sub-block including the upper left sample of the coding block. Optionally, the second transform may be applied only when at least one of the height or width of the sub-block is greater than a threshold.
[0672] Alternatively, information indicating whether the second transform is applied to the sub-block may be signaled in the bitstream.
[0673] When the sub-transform block encoding method is applied, it may be set not to allow the downscaled second transform. Alternatively, although the sub-transform block encoding method is applied, whether to perform the downscaled second transform may be determined based on at least one of the size or shape of the sub-block.
[0674] The reconstructed sample of the sub-block where the transformation is performed may be derived by the sum of the prediction sample and the residual sample. On the other hand, the prediction sample may be set to the reconstructed sample in the sub-block where the transformation is omitted. Quantization is to reduce the energy of the block, and the quantization process includes a process of dividing the transformation coefficient by a specific constant value. The constant value may be derived from the quantization parameter, and the quantization parameter may be defined as a value from 1 to 63.
[0675] When the reconstructed block of the current block is obtained, the information loss occurring in the quantization and encoding process can be reduced via in-loop filtering. The in-loop filter may include at least one of a deblocking filter, a sample adaptive offset filter (SAO), or an adaptive 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.
[0676] 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.
[0677] A screen may be partitioned into at least one or more sub-screens. A sub-screen may be a rectangular area including at least one stripe.
[0678] The encoding or decoding may be performed in units of sub-pictures. Optionally, a partial bitstream may be generated for each sub-picture. In the decoder, only a portion of the multiplexed bitstream may be parsed. In an example, a partial bitstream corresponding to a viewing area of a user may be parsed, and based on the partial bitstream, an image may be presented.
[0679] A sub-picture can be configured using a continuous area. This means that a sub-picture cannot be configured using two strips that are not adjacent to each other in space. For example, strips that are adjacent to each other can be defined as one sub-picture, but strips that are not adjacent to each other cannot be defined as one sub-picture.
[0680] A sub-picture may be defined as a rectangular shape including one or more strips. In other words, a sub-picture is not allowed to have a partition shape that is not a rectangular shape.
[0681] Fig.40 is a diagram for describing partition shapes that can be applied to a screen.
[0682] exist Fig.40 In (a) to (c) of FIG. 1 , each quadrilateral represents a slice. In addition, a number assigned to each slice represents an index of a sub-picture to which the corresponding slice belongs.
[0683] Through the slice header, the index of the sub-picture to which each slice belongs can be signaled. Fig.40 In the example of , it can be understood that slices to which the same index is assigned are included in the same sub-picture.
[0684] Reference Fig.40 (a) shows that each sub-picture is defined as a rectangular shape. Fig.40 The same partition shape as the example shown in (a) is applied to the screen.
[0685] On the other hand, Fig.40 In (b), it is shown that the sub-picture marked as number 3 is defined as a non-rectangular shape. Since it is not allowed to define a sub-picture as a non-rectangular shape, it is not possible to Fig.40 The example shown in (b) is that the same partition shape is applied to the screen.
[0686] exist Fig.40 In (c), it is shown that the sub-picture marked as number 0 is defined as two spatially separated areas. It is not allowed for a sub-picture to include multiple areas that are not continuous in space. Therefore, it is not possible to combine Fig.40 (c) shows an example in which the same partition shape is applied to the screen.
[0687] Based on this description, a method for partitioning a screen into at least one sub-screen will be described in detail according to an embodiment of the present disclosure.
[0688] Fig.41 is a flowchart of a method for partitioning a screen into at least one sub-screen according to an embodiment of the present disclosure.
[0689] Information related to a sub-picture may be signaled at a sequence level. In an example, at least one of a syntax indicating whether a sub-picture to be described later is partitioned, a syntax related to picture partition information, or a syntax related to sub-picture independence may be included in a sequence parameter set.
[0690] The information related to the sub-picture may be commonly applied to the pictures of the reference sequence parameter set. Therefore, the partition shapes of the pictures of the reference sequence parameter set may be the same.
[0691] Alternatively, some of the information related to the sub-picture may be signaled at the sequence level, and some of the information related to the sub-picture may be signaled at the picture level. In an example, the syntax indicating whether to perform sub-picture partitioning may be included in the sequence parameter set, but the syntax related to the picture partition information and the syntax related to the sub-picture independence may be included in the picture parameter set. Alternatively, the syntax indicating whether to perform sub-picture partitioning and the syntax related to the picture partition information may be included in the sequence parameter set, but the syntax related to the sub-picture independence may be included in the picture parameter set. In this case, at least one of the partition shape or the independence of the sub-picture may be different for each picture.
[0692] In the embodiments described below, it is assumed that information related to a sub-picture is signaled through a sequence parameter set.
[0693] Reference Fig.41, it can be determined whether a picture will be partitioned into at least one sub-picture (S4101). Information indicating whether a picture will be partitioned into at least one sub-picture can be transmitted by signal in the bitstream. In an example, the syntax subpics_present_flag can be transmitted by signal in the bitstream. When the syntax subpics_present_flag is 1, it indicates that the picture can be partitioned into at least one sub-picture. When the syntax subpics_present_flag is 1, the picture partition information can be included in the bitstream. On the other hand, when the syntax subpics_present_flag is 0, it indicates that the picture is not partitioned into sub-pictures. When the syntax subpics_present_flag is 0, the picture partition information is not included in the bitstream.
[0694] When the screen can be partitioned into at least one sub-screen, screen partition information may be obtained (S4102). The screen partition information may include at least one of information indicating the number of sub-screens included in the screen, information indicating the position of each sub-screen, or information indicating the size of each sub-screen.
[0695] In an example, a syntax sps_num_subpics_minus1 indicating the number of sub-pictures may be signaled in a bitstream. The syntax sps_num_subpics_minus1 may indicate a value obtained by subtracting 1 from the number of sub-pictures included in a picture.
[0696] The size of the sub-picture may be determined based on square blocks. The square blocks may be blocks of a predefined size derived by applying a lattice structure to a picture. The square blocks that become a basic unit for determining the size of the sub-picture may be referred to as a grid.
[0697] The size of the grid may be predefined in the encoder and the decoder. In an example, the grid may have a size of 8×8, 16×16, 32×32, or 64×64. Optionally, information indicating the size of the grid may be signaled in the bitstream. Optionally, the coding tree unit may be set as a grid. The size of the coding tree unit may be signaled at the sequence level. In other words, the coding tree unit size information included in the sequence parameter set may be parsed, and the position and size of the sub-picture may be determined by using the parsed coding tree unit size information.
[0698] The size of the sub-picture may be determined based on at least one of position information of the sub-picture or size information of the sub-picture.
[0699] The position information of the sub-picture may include horizontal position information (ie, x-axis coordinate) of the sub-picture and vertical position information (ie, y-axis coordinate) of the sub-picture. When a plurality of sub-pictures are included in a picture, the position information may be signaled for each sub-picture.
[0700] In an example, a syntax subpic_ctu_top_left_x[i] for determining the horizontal position of a sub-picture may be signaled in a bitstream. The syntax subpic_ctu_top_left_x[i] represents the horizontal position of the i-th sub-picture in the picture. Specifically, subpic_ctu_top_left_x[i] represents the horizontal position of a grid (e.g., a coding tree unit) at the upper left position of the i-th sub-picture. In this case, the horizontal position may be a value determined based on the size of the coding tree unit. In an example, the horizontal position may be derived by dividing the x-coordinate of the coding tree unit at the upper left position of the i-th sub-picture by the size (e.g., width) of the coding tree unit. Therefore, the x-coordinate at the upper left position of the i-th coding tree unit may be derived by multiplying the value of the syntax subpic_ctu_top_left_x[i] by the size of the coding tree unit.
[0701] The syntax subpic_ctu_top_left_y[i] for determining the vertical position of a sub-picture may be signaled in a bitstream. The syntax subpic_ctu_top_left_y[i] indicates the vertical position of the i-th sub-picture in the picture. Specifically, subpic_ctu_top_left_y[i] indicates the vertical position of a grid (e.g., a coding tree unit) at the upper left position of the i-th sub-picture. In this case, the vertical position may be a value determined based on the size of the coding tree unit. In the example, the vertical position may be derived by dividing the y coordinate of the coding tree unit at the upper left position of the i-th sub-picture by the size (e.g., height) of the coding tree unit. Therefore, the y coordinate at the upper left position of the i-th coding tree unit may be derived by multiplying the value of the syntax subpic_ctu_top_left_y[i] by the size of the coding tree unit.
[0702] When the upper left boundary of the first sub-picture is adjacent to the upper left boundary of the picture, the signal transmission of the information indicating the position of the sub-picture may be omitted for the first sub-picture.
[0703] The size information of the sub-picture may include width information of the sub-picture and height information of the sub-picture. When a plurality of sub-pictures are included in the picture, the size information may be signaled for each of the sub-pictures.
[0704] In an example, a syntax subpic_width_minus1[i] for determining the width of a sub-picture may be signaled in a bitstream. The syntax subpic_width_minus1[i] may represent a value obtained by subtracting 1 from a value obtained by dividing the width of the i-th sub-picture in the picture by the size of the grid (e.g., the width of the coding tree unit). In an example, when the size of the grid is 4×4, the syntax subpic_width_minus1[i] may be set to a value derived by subtracting 1 from a value obtained by dividing the width of the i-th sub-picture by 4. Alternatively, when the size of the grid is the same as the size of the coding tree unit, the syntax subpic_width_minus1[i] may be set to a value derived by subtracting 1 from a value obtained by dividing the width of the i-th sub-picture by the size of the coding tree unit. In other words, the syntax subpic_width_minus1 represents a value obtained by subtracting 1 from the number of grid columns (e.g., coding tree unit columns) included in the i-th sub-picture.
[0705] When the size of the grid is the same as the size of the coding tree unit, the decoder may derive the width of the sub-picture as in Equation 10 below.
[0706] [Equation 10]
[0707] subpicWidth=(subpic_width_minus1[i]+1)*CtbSize
[0708] In Equation 10, subpicWidth represents the width of the i-th sub-picture, and CtbSize represents the size of the coding tree unit. In an example, the variable CtbSize may be a value derived by taking Log_2 of the product of the width and height of the coding tree unit.
[0709] The syntax subpic_height_minus1[i] for determining the height of a sub-picture may be signaled in a bitstream. The syntax subpic_height_minus1[i] may represent a value obtained by subtracting 1 from a value obtained by dividing the height of the i-th sub-picture in the picture by the size of the grid (e.g., the height of the coding tree unit). In an example, when the size of the grid is 4×4, the syntax subpic_height_minus1[i] may be set to a value derived by subtracting 1 from a value obtained by dividing the height of the i-th sub-picture by 4. Alternatively, when the size of the grid is the same as the size of the coding tree unit, the syntax subpic_height_minus1[i] may be set to a value derived by subtracting 1 from a value obtained by dividing the height of the i-th sub-picture by the size of the coding tree unit. In other words, the syntax subpic_height_minus1 represents a value obtained by subtracting 1 from the number of grid columns (e.g., coding tree unit columns) included by the i-th sub-picture.
[0710] When the size of the grid is the same as the size of the coding tree unit, the decoder may derive the height of the sub-picture as in Equation 11 below.
[0711] [Equation 11]
[0712] subpicHeight=(subpic_height_minus1[i]+1)*CtbSizeize
[0713] In Equation 11, subpicHeight represents the height of the i-th sub-picture.
[0714] Size information may not be signaled for the last sub-picture in the current picture. The remaining area except for the area occupied by other sub-pictures in the picture may be set as the last sub-picture.
[0715] Table 14 shows a syntax table including position information and size information of a sub-picture.
[0716]
Form 14
[0717]
[0718] Fig.42 is an example for describing determination of position information of a sub-picture according to a partition aspect of a picture.
[0719] exist Fig.42 In the example shown, each square represents a coding tree unit. In addition, it is assumed that the coding tree units are arranged in a grid.
[0720] exist Fig.42In the example shown, the coding tree unit at the upper left position of sub-picture 0 belongs to the first coding tree unit column and the first coding tree unit row in the picture. When it is assumed that each coding tree unit column and each coding tree unit row are identified by integers starting from 0, the index assigned to the first coding tree unit column and the index assigned to the first coding tree unit row may be 0, respectively. Therefore, subpic_ctu_top_left_x[0] and subpic_ctu_top_left_y[0] of sub-picture 0 may be set to 0, respectively. However, for the first sub-picture, encoding of subpic_ctu_top_left_x[0] and subpic_ctu_top_left_y[0] may be omitted.
[0721] The coding tree unit at the upper left position of sub-picture 1 belongs to the fifth coding tree unit column and the first coding tree unit row. Therefore, subpic_ctu_top_left_x[1] and subpic_ctu_top_left_y[1] of sub-picture 1 may be set to 4 and 0, respectively.
[0722] The coding tree unit at the upper left position of sub-picture 2 belongs to the first coding tree unit column and the fifth coding tree unit row. Therefore, subpic_ctu_top_left_x[2] and subpic_ctu_top_left_y[2] of sub-picture 2 may be set to 0 and 4, respectively.
[0723] The coding tree unit at the upper left position of the sub-picture 3 belongs to the fifth coding tree unit column and the fifth coding tree unit row. Therefore, subpic_ctu_top_left_x[3] and subpic_ctu_top_left_y[3] of the sub-picture 3 may be set to 4 and 4, respectively.
[0724] Fig.43 is an example for describing determination of size information of a sub-picture according to a partition aspect of a picture.
[0725] exist Fig.43 In the example shown, each square represents a coding tree unit. In addition, it is assumed that the coding tree units are arranged in a grid.
[0726] exist Fig.43 In the example shown, subpicture 0 includes 4 coding tree units in the horizontal direction and 4 coding tree units in the vertical direction. Therefore, a value of 3 derived by subtracting 1 from the number of coding tree units in the horizontal direction may be set to subpic_width_minus1[0], and a value of 3 derived by subtracting 1 from the number of coding tree units in the vertical direction may be set to subpic_height_minus1[0].
[0727] Since the sizes of sub-picture 1 and sub-picture 2 are the same as that of sub-picture 0, subpic_width_minus1[1] and subpic_width_minus1[2] may be set to 3, and subpic_height_minus1[1] and subpic_height_minus1[2] may be set to 3.
[0728] Sub-picture 3 includes 4 coding tree units in the horizontal direction and 2 coding tree units in the vertical direction. Therefore, a value derived by subtracting 1 from the number of coding tree units in the horizontal direction may be set to subpic_width_minus1[3], and a value derived by subtracting 1 from the number of coding tree units in the vertical direction may be set to subpic_height_minus1[3].
[0729] Since sub-picture 4 has the same size as sub-picture 3, subpic_width_minus1[4] and subpic_height_minus1[4] may be set to 3 and 1, respectively. However, since sub-picture 4 is the last sub-picture in the picture, size information may not be signaled for sub-picture 4.
[0730] When the coding tree unit is set to a grid, the maximum bit length subpic_width_minus1 of the syntax may be determined as in Equation 12 below.
[0731] [Equation 12]
[0732] Ceil(Log2(pic_width_max_in_luma_samples / CtbSizeY))
[0733] In Equation 12, pic_width_max_in_luma_samples represents the number of luma samples for the horizontal direction in the picture.
[0734] In addition, the maximum bit length of the syntax subpic_height_minus1 may be determined as in Equation 13 below.
[0735] [Equation 13]
[0736] Ceil(Log2((pic_height_max_in_luma_samples / CtbSizeY))eY))
[0737] In Equation 13, pic_height_max_in_luma_samples represents the number of luma samples for the vertical direction in the picture.
[0738] The value of the syntax subpic_width_minus1[i] indicating the width of the i-th sub-picture may be less than or equal to the value obtained by subtracting the syntax subpic_ctu_top_left_x[i] indicating the top left position of the i-th sub-picture from the number of coding tree units in the horizontal direction in the picture. Therefore, the bit length of the syntax subpic_width_minus1[i] may be determined as in the following Equation 14.
[0739] [Equation 14]
[0740] Ceil(Log2((pic_height_max_in_luma_samples / CtbSizeY)-subpic_ctu_top_left_y[i]))eft_x[i]))
[0741] In addition, the value of the syntax subpic_height_minus1[i] indicating the height of the i-th sub-picture may be less than or equal to the value obtained by subtracting the syntax subpic_ctu_top_left_y[i] indicating the upper left position of the i-th sub-picture from the number of coding tree units in the vertical direction in the picture. Therefore, the bit length of the syntax subpic_height_minus1[i] may be determined as in the following Equation 15.
[0742] [Equation 15]
[0743] Ceil(Log2((pic_height_max_in_luma_samples / CtbSizeY)-subpic_ctu_top_left_y[i]))
[0744] Information indicating whether each sub-picture has the same size may be signaled in the bitstream.
[0745] In an example, subpic_same_size_flag indicating whether the sub-pictures have the same size may be signaled in the bitstream. When the value of the syntax subpic_same_size_flag is 1, it indicates that the sub-pictures have the same size.
[0746] When the value of subpic_same_size_flag is 1, size information may be signaled only for the first sub-picture. For the remaining sub-pictures except the first sub-picture, position information and / or size information may not be signaled. The sizes of the remaining sub-pictures may be derived based on the size information of the first sub-picture.
[0747] In the example, Fig.42In the example shown, all sub-pictures are the same size, so the value of subpic_same_size_flag may be set to 1. In this case, size information may be signaled only for sub-picture 0, and size information may not be signaled for the remaining sub-pictures.
[0748] On the other hand, Fig.43 In the example shown, since the sizes of subpictures 0, 1, and 2 are different from those of subpictures 3 and 4, the value of subpic_same_size_flag may be set to 0. In this case, size information may be signaled for each of the subpictures.
[0749] When a picture can be partitioned into at least one sub-picture, sub-picture independence information can be obtained. The sub-picture independence information indicates whether the sub-picture can be independently encoded / decoded. In an example, the sub-picture independence information may include at least one of information indicating whether the sub-picture is processed like a picture or information indicating whether a loop filter is allowed to be applied to a sub-picture boundary.
[0750] In the example, in the example of Table 14, the syntax subpic_treated_as_pic_flag[i] indicates whether the i-th subpicture is regarded as a picture. When the value of the syntax subpic_treated_as_pic_flag[i] is 1, it indicates that when encoding / decoding a subpicture, the subpicture can be encoded / decoded independently except for the loop filter processing.
[0751] When a sub-picture is regarded as a picture, it may not be allowed to refer to information of other sub-pictures at the time of encoding / decoding except for the in-loop filtering process. In other words, the boundary of the sub-picture may be regarded as a picture boundary. In an example, in a process of deriving a temporal motion prediction vector or in an encoding / decoding process such as interpolation, encoding / decoding may be processed under the assumption that the boundary of the sub-picture is a picture boundary.
[0752] In the example, in general, a temporal motion prediction vector candidate or a temporal merge candidate may be derived based on a motion vector of a co-located block in a co-located picture. In this case, a block in the co-located picture including the coordinates of the lower right corner of a block having the same position and size as the current block may be set as the co-located block. If the block including the coordinates of the lower right corner is not available, a block in the co-located picture including the center coordinates of a block having the same position and size as the current block may be set as the co-located block. When deriving a temporal motion prediction vector candidate or a temporal merge candidate, when the lower right corner of a block having the same position and size as the current block in the co-located picture is on or outside the picture boundary, the temporal motion prediction vector candidate or the temporal merge candidate may be derived from the motion vector of a block in the co-located picture including the center coordinates of a block having the same position and size as the current block.
[0753] When a sub-picture is not regarded as a picture, whether the lower right corner is on the picture boundary or whether the lower right corner is outside the picture boundary may be determined based on the picture boundary instead of the sub-picture boundary.
[0754] On the other hand, when a sub-picture is regarded as a picture, whether the lower right corner is on the picture boundary or whether the lower right corner is outside the picture boundary may be determined based on the sub-picture boundary. In an example, when the lower right corner of a block having the same position and size as the current block in the co-picture is on the sub-picture boundary or outside the sub-picture boundary, a block including the center coordinates of the block having the same position and size as the current block in the co-picture may be set as the co-picture block.
[0755] In addition, generally, in inter-frame prediction, when decimal pixels are interpolated, there is a restriction that the brightness component pixels at integer positions of the current picture and the reference picture are not outside the left boundary, right boundary, top boundary, and bottom boundary of the picture. When a sub-picture is regarded as a picture, by regarding the boundary of the sub-picture as a picture boundary, there may be a restriction that the brightness component pixels at integer positions are not outside the left boundary, right boundary, top boundary, and bottom boundary of the sub-picture.
[0756] In the example of Table 14, the syntax loop_filter_across_subpic_enabled_flag[i] indicates whether the in-loop filter is allowed to be applied in the i-th sub-picture. In the example, when the value of the syntax loop_filter_across_subpic_enabled_flag[i] is 1, it indicates that the in-loop filter is allowed to be applied on the boundary of the i-th sub-picture. The in-loop filter may include at least one of a deblocking filter, SAO, or ALF. On the other hand, when the value of the syntax loop_filter_across_subpic_enabled_flag[i] is 0, it indicates that the in-loop filter is not allowed to be applied on the boundary of the i-th sub-picture.
[0757] Information indicating whether sub-picture independence information is present may be signaled in the bitstream. In an example, a syntax subpic_treated_as_pic_present_flag indicating whether sub-picture independence information is encoded may be signaled. When the syntax subpic_treated_as_pic_present_flag is 1, it indicates that sub-picture independence information for each sub-picture is present in the bitstream. When the syntax subpic_treated_as_pic_present_flag is 1, at least one sub-picture may be treated as a picture.
[0758] On the other hand, when the syntax subpic_treated_as_pic_present_flag is 0, it indicates that there is no sub-picture independence information in the bitstream. When the syntax subpic_treated_as_pic_present_flag is 0, it indicates that all sub-pictures are not allowed to be treated as sub-pictures.
[0759] Table 15 shows a syntax table including the syntax subpic_treated_as_pic_present_flag.
[0760]
Form 15
[0761]
[0762] In Table 15, when the syntax subpic_treated_as_pic_present_flag is 1, information indicating whether a sub-picture is regarded as a picture may be signaled for each sub-picture.
[0763] In an example, only when the syntax subpic_treated_as_pic_present_flag is 1, the syntax subpic_treated_as_pic_flag[i] indicating whether the i-th sub-picture is regarded as a picture may be signaled.
[0764] The signaling of the syntax subpic_treated_as_pic_flag[i] may be omitted when the syntax subpic_treated_as_pic_present_flag is 0. When the syntax subpic_treated_as_pic_present_flag is 0, the value of the syntax subpic_treated_as_pic_flag[i] may be inferred to be 0 for the i-th sub-picture.
[0765] The syntax subpic_treated_as_pic_present_flag may be signaled only when the number of sub-pictures in a picture is multiple. In an example, the syntax subpic_treated_as_pic_present_flag may be signaled only when the value of sps_num_subpics_minus1 is greater than 0. When there is a single sub-picture in a picture, the boundaries of the sub-picture are the same as the picture boundaries, so the signaling of subpic_treated_as_pic_flag may be omitted and the value of subpic_treated_as_pic_flag may be inferred to be 1.
[0766] In another example, information indicating whether all sub-pictures in a picture are independent may be signaled. In an example, a syntax isAll_subpic_treated_as_pic_flag indicating whether all sub-pictures in a picture are independent may be signaled. When the syntax isAll_subpic_treated_as_pic_flag is 1, it indicates that all sub-pictures are independent and all sub-pictures are treated as a picture. When the syntax isAll_subpic_treated_as_pic_flag is 1, encoding of the syntax subpic_treated_as_pic_flag may be omitted for each sub-picture.
[0767] On the other hand, when the syntax isAll_subpic_treated_as_pic_flag is 0, it indicates that at least one sub-picture is not independent and is not regarded as a picture. When the syntax isAll_subpic_treated_as_pic_flag is 0, subpic_treated_as_pic_flag may be signaled for each sub-picture.
[0768] Table 16 shows a syntax table including the syntax isAll_subpic_treated_as_pic_flag.
[0769]
Form 16
[0770]
[0771] In Table 16, when the syntax isAll_subpic_treated_as_pic_flag is 1, the signaling of the syntax subpic_treated_as_pic_flag[i] may be omitted. When the value of the syntax isAll_subpic_treated_as_pic_flag is 1, the value of the syntax subpic_treated_as_pic_flag[i] may be inferred to be 1 for the i-th sub-picture.
[0772] When the syntax isAll_subpic_treated_as_pic_flag is 0, the syntax subpic_treated_as_pic_flag[i] indicating whether the i-th subpicture is treated as a picture may be signaled.
[0773] The syntax isAll_subpic_treated_as_pic_flag may be signaled only when the number of sub-pictures in a picture is multiple. In an example, the syntax isAll_subpic_treated_as_pic_flag may be signaled only when the value of sps_num_subpics_minus1 is greater than 0. When there is a single sub-picture in a picture, the sub-picture boundaries are the same as the picture boundaries, so the signaling of subpic_treated_as_pic_flag may be omitted and the value of subpic_treated_as_pic_flag may be inferred to be 1.
[0774] It is within the scope of the present disclosure to apply the embodiments described with respect to the decoding process or the encoding process to the encoding process or the decoding process, respectively. It is within the scope of the present disclosure where the embodiments operating in a predetermined order can be modified to embodiments operating in an order different from the predetermined order.
[0775] Although the above embodiments are described based on a series of operations or flow charts, the embodiments do not limit the time series order of the operation of the method to this. In another example, the operation can be performed simultaneously or in a different order from it as needed. In addition, in the above embodiments, each of the components constituting the block diagram (e.g., unit, module, etc.) can be implemented in the form of hardware devices or software. Multiple components can be combined with each other into a single component, wherein the single component can be implemented using a single hardware device or software. The above embodiments can be implemented using program instructions that can be executed via various computer components. Instructions can be recorded in a computer-readable storage medium. The computer-readable storage medium can include program instructions, data files, data structures, etc., individually or in combination 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 optical floppy disks), and hardware devices (such as ROMs, RAMs, flash memories, etc.), which are specifically configured to store and execute program instructions therein. The hardware device can be configured to operate as one or more software modules to perform processing according to the present disclosure, and vice versa.
[0776] [Industrial Applicability]
[0777] The present disclosure may be applied to an electronic device that encodes / decodes a video.
Claims
1. A method for partitioning a picture for a decoder, comprising: Determine whether the screen is partitioned into multiple sub-screens; When it is determined that the picture is partitioned into the plurality of sub-pictures, partitioning the picture into the plurality of sub-pictures; as well as determining whether the plurality of sub-pictures have independence, wherein the sub-picture having independence is decoded independently from other sub-pictures, The step of determining whether the plurality of sub-pictures are independent is based on a first flag indicating whether all of the plurality of sub-pictures are independent. The first value of the first flag indicates that the plurality of sub-pictures are independent, and The second value of the first flag indicates that at least one of the plurality of sub-pictures does not have independence.
2. The method according to claim 1, wherein: When the first flag indicates that at least one of the plurality of sub-pictures is not independent, a second flag indicating whether each of the plurality of sub-pictures is independent is analyzed for each of the plurality of sub-pictures.
3. The method according to claim 1, wherein: The step of partitioning the picture includes: determining the number of the plurality of sub-pictures included in the picture, and determining position information and size information of each of the plurality of sub-pictures.
4. The method according to claim 3, wherein: For a first sub-picture among the plurality of sub-pictures, signal transmission of position information is omitted.
5. The method according to claim 3, wherein: For a last sub-picture of the plurality of sub-pictures, signaling of size information is omitted.
6. The method according to claim 3, wherein: The size information includes width information indicating the number of coding tree units in the horizontal direction in the sub-picture and height information indicating the number of coding tree units in the vertical direction in the sub-picture.
7. A method for partitioning a picture for an encoder, comprising: Determine whether the screen is partitioned into multiple sub-screens; When it is determined that the picture is partitioned into the plurality of sub-pictures, partitioning the picture into the plurality of sub-pictures; as well as determining whether the plurality of sub-pictures have independence, wherein the sub-picture having independence is encoded independently from other sub-pictures, wherein a first flag indicating whether all of the plurality of sub-pictures are independent is encoded in a bit stream, The first value of the first flag indicates that the plurality of sub-pictures are independent, and The second value of the first flag indicates that at least one of the plurality of sub-pictures does not have independence.
8. The method according to claim 7, wherein: When the first flag indicates that at least one of the plurality of sub-pictures is not independent, a second flag indicating whether each sub-picture is independent is encoded for each of the plurality of sub-pictures.
9. The method according to claim 7, wherein: The method further includes: encoding partition information of the picture, and The partition information includes position information and size information of each of the multiple sub-pictures.
10. The method according to claim 9, wherein: For a first sub-picture among the plurality of sub-pictures, encoding of the position information is omitted.
11. The method according to claim 9, wherein: For the last sub-picture among the plurality of sub-pictures, encoding of the size information is omitted.
12. The method according to claim 9, wherein: The size information includes width information indicating the number of coding tree units in the horizontal direction in the sub-picture and height information indicating the number of coding tree units in the vertical direction in the sub-picture.
Citation Information
Patent Citations
Method and device for decoding image by using partition unit including additional region
CA3105474A1
Method and apparatus for encoding and decoding video using picture division information
CN109076216A