Method and apparatus for deriving intra prediction mode
By constructing an MPM list based on the relationship between intra-frame prediction modes and neighboring blocks, the problem of insufficient compression efficiency in high-resolution and high-quality image encoding/decoding is solved, enabling more efficient image transmission and storage.
Patent Information
- Application Number
- CN202411394875.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-03-25
- Filing Date
- 2019-12-27
- Publication Date
- 2024-11-22
AI Technical Summary
Existing technologies are not efficient enough in encoding/decoding high-resolution and high-quality images, leading to increased transmission and storage costs.
The intra-prediction mode is adopted. The intra-prediction mode of the current block is derived by the neighboring blocks adjacent to the current block, and the most probable mode (MPM) list is constructed. The planar mode is replaced by the intra-prediction mode of the neighboring blocks. The construction of the MPM list is not affected by multi-reference sample line related information, sub-block partition prediction information and intra/inter-frame combination prediction related information.
It improves the compression efficiency of image encoding/decoding and reduces transmission and storage costs.
Smart Images

Figure CN119011825A_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with an application date of December 27, 2019, application number 201980086300.7, and invention name “Method and device for deriving intra-frame prediction mode”. Technical Field
[0002] The present invention relates to an image encoding / decoding method and apparatus, and a recording medium storing a bit stream. More specifically, the present invention relates to a method and apparatus for encoding / decoding an image using intra-frame prediction, and a recording medium storing a bit stream generated by the method or apparatus for encoding an image of the present invention. Background Art
[0003] Recently, in various applications, the demand for high-resolution and high-quality images (such as high-definition (HD) or ultra-high-definition (UHD) images) has increased. As the resolution and quality of images increase, the amount of data increases accordingly. This is one of the reasons for the increase in transmission cost and storage cost when image data is transmitted through existing transmission media (such as wired or wireless broadband channels) or when image data is stored. In order to solve these problems of high-resolution and high-quality image data, efficient image encoding / decoding technology is required.
[0004] There are various video compression techniques (such as, inter-frame prediction techniques, which predict the values of pixels within a current image from the values of pixels within a previous image or a subsequent image; intra-frame prediction techniques, which predict the values of pixels within a region of the current image from the values of pixels within another region of the current image; transform and quantization techniques, which compress the energy of the residual signal; and entropy coding techniques, which assign short codes to frequently occurring pixel values and long codes to less frequently occurring pixel values). Summary of the invention
[0005] Technical issues
[0006] An object of the present invention is to provide an image encoding / decoding method and apparatus with improved compression efficiency.
[0007] Another object of the present invention is to provide an image encoding / decoding method and apparatus using intra-frame prediction with improved compression efficiency.
[0008] Another object of the present invention is to provide a recording medium storing a bit stream generated by the image encoding / decoding method or apparatus of the present invention.
[0009] Technical Solution
[0010] According to the present invention, a method for decoding an image is provided, comprising: deriving an intra-frame prediction mode of a current block using an intra-frame prediction mode of a neighboring block adjacent to the current block; constructing a reference sample of the current block; and performing intra-frame prediction on the current block using the intra-frame prediction mode and the reference sample of the current block, wherein the step of deriving the intra-frame prediction mode of the current block comprises: constructing a most probable mode (MPM) list based on whether the intra-frame prediction mode of the current block is a planar mode.
[0011] When the intra prediction mode of the neighboring block is unavailable, the intra prediction mode of the neighboring block may be replaced by the planar mode.
[0012] The neighboring block may be at least one of a lower left block or an upper right block of the current block.
[0013] The MPM list can be constructed by the same method regardless of the multi-reference sample line related information, the sub-block partition prediction information and the intra / inter combined prediction related information.
[0014] The step of constructing the MPM list may include: deriving intra-frame prediction modes of multiple neighboring blocks adjacent to the current block; and constructing the MPM list based on at least one of whether the intra-frame prediction modes of the multiple neighboring blocks are equal to each other or whether the intra-frame prediction modes of the multiple neighboring blocks are directional.
[0015] The step of constructing the MPM list may include: deriving intra-frame prediction modes of multiple neighboring blocks adjacent to the current block; selecting a mode corresponding to a maximum value from the derived intra-frame prediction modes of the multiple neighboring blocks; and constructing the MPM list to include the mode corresponding to the maximum value.
[0016] The step of constructing the MPM list may include: deriving intra-frame prediction modes of multiple neighboring blocks adjacent to the current block; selecting a mode corresponding to a maximum value and a mode corresponding to a minimum value from the derived intra-frame prediction modes of the multiple neighboring blocks; and constructing an MPM list including the mode corresponding to the maximum value and the mode corresponding to the minimum value. The MPM list may be constructed to also include: an additional mode derived by adding a predetermined offset and the mode corresponding to the maximum value or the mode corresponding to the minimum value.
[0017] The method of deriving the additional mode may be determined differently depending on whether the difference between the maximum value and the minimum value is a predetermined value.
[0018] The predetermined value may be at least one of 1, 2 or 61.
[0019] The current block may be partitioned into a predetermined number of sub-blocks based on at least one of a size or a shape of the current block.
[0020] According to the present invention, a method for encoding an image is provided, comprising: determining an intra-frame prediction mode of a current block; constructing a reference sample of the current block; performing intra-frame prediction of the current block using the intra-frame prediction mode and the reference sample of the current block; and encoding the intra-frame prediction mode of the current block using the intra-frame prediction mode of a neighboring block adjacent to the current block, wherein the step of encoding the intra-frame prediction mode of the current block comprises: constructing a most probable mode (MPM) list based on whether the intra-frame prediction mode of the current block is a planar mode.
[0021] When the intra prediction mode of the neighboring block is unavailable, the intra prediction mode of the neighboring block may be replaced by the planar mode.
[0022] The neighboring block may be at least one of a lower left block or an upper right block of the current block.
[0023] The MPM list can be constructed by the same method regardless of the multi-reference sample line related information, the sub-block partition prediction information and the intra / inter combined prediction related information.
[0024] The step of constructing the MPM list may include: deriving intra-frame prediction modes of multiple neighboring blocks adjacent to the current block; and constructing the MPM list based on at least one of whether the intra-frame prediction modes of the multiple neighboring blocks are equal to each other or whether the intra-frame prediction modes of the multiple neighboring blocks are directional.
[0025] The step of constructing the MPM list may include: deriving intra-frame prediction modes of multiple neighboring blocks adjacent to the current block; selecting a mode corresponding to a maximum value from the derived intra-frame prediction modes of the multiple neighboring blocks; and constructing the MPM list to include the mode corresponding to the maximum value.
[0026] The step of constructing the MPM list may include: deriving intra-frame prediction modes of multiple neighboring blocks adjacent to the current block; selecting a mode corresponding to a maximum value and a mode corresponding to a minimum value from the derived intra-frame prediction modes of the multiple neighboring blocks; and constructing an MPM list including the mode corresponding to the maximum value and the mode corresponding to the minimum value. The MPM list may be constructed to also include: an additional mode derived by adding a predetermined offset and the mode corresponding to the maximum value or the mode corresponding to the minimum value.
[0027] The method of deriving the additional mode may be determined differently depending on whether the difference between the maximum value and the minimum value is a predetermined value.
[0028] The predetermined value may be at least one of 1, 2 or 61.
[0029] According to the present invention, a non-temporary computer-readable recording medium is provided for storing a bit stream for reconstructing an image received and decoded by an image decoding device, wherein the bit stream includes information about a prediction of a current block, wherein the information about the prediction of the current block is used to derive an intra-frame prediction mode of the current block using an intra-frame prediction mode of a neighboring block adjacent to the current block, and to construct a reference sample of the current block, wherein the intra-frame prediction mode and the reference sample of the current block are used to perform intra-frame prediction of the current block, and wherein a most probable mode MPM list for deriving the intra-frame prediction mode of the current block is constructed based on whether the intra-frame prediction mode of the current block is a planar mode.
[0030] The recording medium according to the present invention can store a bit stream generated by the image encoding method according to the present invention.
[0031] Beneficial Effects
[0032] According to the present invention, an image encoding / decoding method and apparatus with improved compression efficiency can be provided.
[0033] According to the present invention, an image encoding / decoding method and apparatus using intra prediction with improved compression efficiency can be provided.
[0034] According to the present invention, there can be provided a recording medium storing a bit stream generated by the image encoding / decoding method or apparatus of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0036] Figure 2 is a block diagram showing a configuration of a decoding device according to an embodiment to which the present invention is applied.
[0037] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded.
[0038] Figure 4 is a diagram illustrating an intra prediction process.
[0039] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0040] Figure 6 is a diagram illustrating transform and quantization processing.
[0041] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0042] Figure 8is a flowchart illustrating an intra prediction process according to an embodiment of the present invention.
[0043] Fig. 9 is a diagram illustrating a relationship between a luminance block and a chrominance block according to an embodiment of the present invention.
[0044] Fig.10 is a diagram illustrating neighboring blocks that can be referenced to derive an intra prediction mode of a current block according to an embodiment of the present invention.
[0045] Fig.11 is a diagram illustrating an intra prediction mode according to an exemplary embodiment of the present invention.
[0046] Figures 12 to 18 is a diagram illustrating a process of building an MPM list according to an embodiment of the present invention.
[0047] Fig.19 is a diagram illustrating a process of signaling an intra prediction mode according to an embodiment of the present invention.
[0048] Fig. 20 is a diagram illustrating DC prediction according to a size and / or shape of a current block according to an embodiment of the present invention.
[0049] Fig.21 is a diagram illustrating a cross-color component intra prediction process according to the present invention. DETAILED DESCRIPTION
[0050] Various modifications may be made to the present invention, and there are various embodiments of the present invention, wherein examples of various embodiments of the present invention will now be provided with reference to the accompanying drawings and described in detail. However, the present invention is not limited thereto, although the exemplary embodiments may be interpreted as including all modifications, equivalents or substitutions within the technical concept and technical scope of the present invention. In various aspects, similar figure numerals refer to the same or similar functions. In the accompanying drawings, the shapes and sizes of the elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings, wherein the accompanying drawings illustrate specific embodiments in which the present invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, without departing from the spirit and scope of the present disclosure, the specific features, structures and features described herein in conjunction with one embodiment may be implemented in other embodiments. In addition, it should be understood that the position or arrangement of each element within each disclosed embodiment may be modified without departing from the spirit and scope of the present disclosure. Therefore, the following detailed description should not be regarded as having a limiting meaning, and the scope of the present disclosure is limited only by the appended claims (with the full range of equivalents claimed by the claims, in the case of appropriate interpretation).
[0051] The terms "first", "second", etc. used in the specification may be used to describe various components, but the components should not be interpreted as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, the "first" component may be named as the "second" component, and the "second" component may also be similarly named as the "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.
[0052] It will be understood that in this specification, when an element is simply referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, the element may be “directly connected to” or “directly coupled to” another element, or connected to or coupled to another element with other elements interposed therebetween. Conversely, it will be understood that when an element is referred to as being “directly coupled to” or “directly connected to” another element, there are no intervening elements.
[0053] In addition, the components shown in the embodiments of the present invention are shown independently to represent the characteristic functions that are different from each other. Therefore, this does not mean that each component is composed of a separate hardware or software component unit. In other words, for convenience, each component includes each of the listed components. Therefore, at least two components of each component can be combined to form a component, or a component can be partitioned into multiple components to perform each function. If it does not depart from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is partitioned are also included in the scope of the present invention.
[0054] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Unless there is a significantly different meaning in the context, the expression used in the singular includes the expression in the plural form. In this specification, it will be understood that terms such as "including", "having" etc. are intended to indicate the presence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added. In other words, when a particular element is referred to as "included", it does not exclude elements other than the corresponding elements, but may include additional elements in an embodiment of the present invention or in the scope of the present invention.
[0055] In addition, some components may not be indispensable components for performing the basic functions of the present invention, but rather selective components that only improve the performance thereof. The present invention may be implemented by including only indispensable components for realizing the essence of the present invention without including components for improving performance. Structures that include only indispensable components without including selective components that only improve performance are also included within the scope of the present invention.
[0056] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing the exemplary embodiments of the present invention, well-known functions or configurations will not be described in detail because they may unnecessarily obscure the understanding of the present invention. The same constituent elements in the accompanying drawings are represented by the same reference numerals, and repeated descriptions of the same elements will be omitted.
[0057] Hereinafter, an image may refer to a picture constituting a video, or may refer to the video itself. For example, "encoding or decoding an image or both encoding and decoding" may refer to "encoding or decoding a moving picture or both encoding and decoding", and may refer to "encoding or decoding one of the images of the moving picture or both encoding and decoding".
[0058] Hereinafter, the terms "motion picture" and "video" may be used as the same meaning and may be replaced with each other.
[0059] Hereinafter, a target image may be an encoding target image as an encoding target and / or a decoding target image as a decoding target. In addition, a target image may be an input image input to an encoding device, and an input image input to a decoding device. Here, the target image may have the same meaning as the current picture.
[0060] Hereinafter, the terms "image", "picture", "frame" and "screen" may be used as the same meaning and may be replaced with each other.
[0061] Hereinafter, the target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. In addition, the target block may be a current block as a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used as the same meaning and may be replaced with each other.
[0062] Hereinafter, the terms "block" and "unit" may be used as the same meaning and may be replaced with each other. Alternatively, a "block" may refer to a specific unit.
[0063] In the following, the terms "region" and "segment" are used interchangeably.
[0064] Hereinafter, a specific signal may be a signal representing a specific block. For example, an original signal may be a signal representing a target block. A prediction signal may be a signal representing a prediction block. A residual signal may be a signal representing a residual block.
[0065] In an embodiment, each of the specific information, data, flags, indexes, elements, attributes, etc. may have a value. The value of the information, data, flags, indexes, elements, and attributes equal to "0" may represent a logical false or a first predefined value. In other words, the value "0", false, logical false, and the first predefined value may be replaced with each other. The value of the information, data, flags, indexes, elements, and attributes equal to "1" may represent a logical true or a second predefined value. In other words, the value "1", true, logical true, and the second predefined value may be replaced with each other.
[0066] When the variable i or j is used to represent a column, row, or index, the value of i may be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, the column, row, index, etc. may be counted from 0 or 1.
[0067] Terminology Description
[0068] Encoder: This refers to the device that performs encoding. In other words, it refers to the encoding device.
[0069] Decoder: refers to a device that performs decoding. In other words, it refers to a decoding device.
[0070] Block: is an M×N array of samples. Here, M and N may represent positive integers, and a block may represent an array of samples in a two-dimensional form. A block may refer to a unit. A current block may represent an encoding target block that becomes a target when encoding, or a decoding target block that becomes a target when decoding. In addition, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.
[0071] Sample: It is the basic unit of a block. According to the bit depth (Bd), a sample can be represented from 0 to 2 Bd In the present invention, a sample point may be used as the meaning of a pixel. That is, a sample point, a pel, and a pixel may have the same meaning as each other.
[0072] Unit: may refer to a coding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. In addition, when a single image is partitioned into sub-partition units during encoding or decoding, a unit may represent a sub-partition unit. That is, an image may be partitioned into a plurality of units. When encoding and decoding an image, a predetermined process for each unit may be performed. A single unit may be partitioned into sub-units having a size smaller than that of the unit. Depending on the function, a unit may represent a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, and the like. In addition, in order to distinguish a unit from a block, a unit may include a luminance component block, a chrominance component block associated with the luminance component block, and a syntax element for each color component block. A unit may have various sizes and shapes, and specifically, the shape of a unit may be a two-dimensional geometric figure such as a square, a rectangle, a trapezoid, a triangle, a pentagon, and the like. In addition, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transformation unit, etc., and a unit size, a unit depth, an order of encoding and decoding of the unit, and the like.
[0073] Coding tree unit: A single coding tree block configured with a luminance component Y and two coding tree blocks associated with chrominance components Cb and Cr. In addition, the coding tree unit may represent a syntax element including a block and each block. Each coding tree unit may be partitioned by using at least one of a quadtree partitioning method, a binary tree partitioning method, and a ternary tree partitioning method to configure a lower-level unit such as a coding unit, a prediction unit, a transform unit, etc. The coding tree unit may be used as a term for specifying a sample block that becomes a processing unit when encoding / decoding an image as an input image. Here, the quadtree may represent a quadtree.
[0074] When the size of the coding block is within a predetermined range, it can be partitioned using only quadtree partitioning. Here, the predetermined range may be defined as at least one of the maximum size and the minimum size of the coding block that can be partitioned using only quadtree partitioning. Information indicating the maximum / minimum size of the coding block that allows quadtree partitioning may be signaled through a bitstream, and the information may be signaled in at least one unit of a sequence, a picture parameter, a parallel block group, or a slice (fragment). Optionally, the maximum / minimum size of the coding block may be a fixed size predetermined in the encoder / decoder. For example, when the size of the coding block corresponds to 256×256 to 64×64, it is possible to partition using only quadtree partitioning. Optionally, when the size of the coding block is larger than the size of the maximum conversion block, it is possible to partition using only quadtree partitioning. Here, the block to be partitioned may be at least one of a coding block and a transform block. In this case, information indicating the partitioning of the coding block (e.g., split_flag) may be a flag indicating whether quadtree partitioning is performed. When the size of the coding block falls within a predetermined range, it is possible to partition using only binary or ternary tree partitioning. In this case, the above description of the quadtree partition may be applied to the binary tree partition or the ternary tree partition in the same manner.
[0075] Coding tree block: may be used as a term used to designate any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.
[0076] Neighboring block: may refer to a block adjacent to the current block. The block adjacent to the current block may refer to a block that touches the boundary of the current block or a block that is located within a predetermined distance from the current block. The neighboring block may refer to a block adjacent to a vertex of the current block. Here, the block adjacent to a vertex of the current block may refer to a block that is vertically adjacent to a neighboring block that is horizontally adjacent to the current block or a block that is horizontally adjacent to a neighboring block that is vertically adjacent to the current block.
[0077] Reconstructed neighboring block: may represent a neighboring block that is adjacent to the current block and has been encoded or decoded in space / time. Here, the reconstructed neighboring block may represent a reconstructed neighboring unit. The reconstructed spatial neighboring block may be a block that is within the current picture and has been reconstructed by encoding or decoding or both encoding and decoding. The reconstructed temporal neighboring block is a block at a position corresponding to the current block of the current picture within the reference picture or a neighboring block of the block.
[0078] Unit depth: can represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) can correspond to the first unit that is not partitioned. In addition, the highest node can have a minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 can represent a unit generated by partitioning the first unit for the first time. A node with a depth of level 2 can represent a unit generated by partitioning the first unit twice. A node with a depth of level n can represent a unit generated by partitioning the first unit n times. A leaf node can be the lowest node and a node that cannot be further partitioned. The depth of a leaf node can be the maximum level. For example, the predefined value of the maximum level can be 3. The depth of the root node can be the lowest, and the depth of the leaf node can be the deepest. In addition, when a unit is represented as a tree structure, the level at which the unit exists can represent the unit depth.
[0079] Bitstream: can represent a stream of bits including coded image information.
[0080] Parameter set: corresponds to header information among the configurations in the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set may be included in the parameter set. In addition, the parameter set may include a slice header, a tile group header, and tile header information. The term "tile group" means a group of tiles and has the same meaning as a slice.
[0081] The adaptation parameter set may represent a parameter set that can be shared by being referenced in different pictures, sub-pictures, slices, tile groups, tiles, or partitions. In addition, information in the adaptation parameter set may be used by referencing different adaptation parameter sets for sub-pictures, slices, tile groups, tiles, or partitions within a picture.
[0082] In addition, regarding adaptation parameter sets, different adaptation parameter sets may be referenced by using identifiers of different adaptation parameter sets for a sub-picture, a slice, a tile group, a tile, or a partition within a picture.
[0083] In addition, regarding the adaptation parameter sets, different adaptation parameter sets may be referenced by using identifiers of different adaptation parameter sets for slices, tile groups, tiles, or partitions within a sub-picture.
[0084] In addition, regarding the adaptation parameter sets, different adaptation parameter sets may be referenced by using identifiers of different adaptation parameter sets for tiles or partitions within a slice.
[0085] In addition, with respect to adaptation parameter sets, different adaptation parameter sets may be referenced by using identifiers of different adaptation parameter sets for partitions within a tile.
[0086] Information about the adaptation parameter set identifier may be included in a parameter set or a header of a sub-picture, and an adaptation parameter set corresponding to the adaptation parameter set identifier may be used for the sub-picture.
[0087] Information about the adaptation parameter set identifier may be included in a parameter set or a header of the tile, and an adaptation parameter set corresponding to the adaptation parameter set identifier may be used for the tile.
[0088] Information about the adaptation parameter set identifier may be included in a header of the tile, and an adaptation parameter set corresponding to the adaptation parameter set identifier may be used for the tile.
[0089] A picture may be partitioned into one or more tile rows and one or more tile columns.
[0090] A sub-picture may be partitioned into one or more parallel block rows and one or more parallel block columns within a picture. A sub-picture may be an area having a rectangular / square form within a picture and may include one or more CTUs. In addition, at least one or more parallel blocks / blocks / strips may be included in one sub-picture.
[0091] A tile may be an area having a rectangular / square form within a picture and may include one or more CTUs. In addition, a tile may be partitioned into one or more partitions.
[0092] A partition may represent one or more CTU rows within a tile. A tile may be partitioned into one or more blocks, and each block may have at least one or more CTU rows. A tile that is not partitioned into two or more may represent a partition.
[0093] A slice may include one or more tiles within a picture, and may include one or more partitions within a tile.
[0094] Parsing: may mean determining the value of a syntax element by performing entropy decoding, or may mean the entropy decoding itself.
[0095] Symbol: At least one of a syntax element, a coding parameter, and a transform coefficient value that can represent a coding / decoding target unit. In addition, the symbol can represent an entropy coding target or an entropy decoding result.
[0096] Prediction mode: may be information indicating a mode for encoding / decoding using intra prediction or a mode for encoding / decoding using inter prediction.
[0097] Prediction unit: may represent a basic unit when performing prediction (such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation). A single prediction unit may be partitioned into multiple partitions of smaller size, or may be partitioned into multiple prediction units of lower levels. Multiple partitions may be basic units when performing prediction or compensation. Partitions generated by partitioning a prediction unit may also be prediction units.
[0098] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.
[0099] A reference picture list may refer to a list including one or more reference pictures used for inter prediction or motion compensation. There are several types of reference picture lists available, including LC (List Combination), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3).
[0100] The inter prediction indicator may refer to the direction of inter prediction of the current block (unidirectional prediction, bidirectional prediction, etc.). Alternatively, the inter prediction indicator may refer to the number of reference pictures used to generate the prediction block of the current block. Alternatively, the inter prediction indicator may refer to the number of prediction blocks used when performing inter prediction or motion compensation on the current block.
[0101] The prediction list utilization flag indicates whether at least one reference picture in a specific reference picture list is used to generate a prediction block. The prediction list utilization flag may be used to derive the inter prediction indicator, and conversely, the inter prediction indicator may be used to derive the prediction list utilization flag. For example, when the prediction list utilization flag has a first value of zero (0), it indicates that the reference picture in the reference picture list is not used to generate the prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it indicates that the reference picture list is used to generate the prediction block.
[0102] The reference picture index may refer to an index indicating a specific reference picture in a reference picture list.
[0103] A reference picture may refer to a reference picture referenced by a specific block for the purpose of inter-frame prediction or motion compensation of the specific block. Alternatively, a reference picture may be a picture including a reference block referenced by a current block for inter-frame prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference picture" have the same meaning and may be interchangeable.
[0104] A motion vector may be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector may represent an offset between a target block for encoding / decoding and a reference block. For example, (mvX, mvY) may represent a motion vector. Here, mvX may represent a horizontal component, and mvY may represent a vertical component.
[0105] The search range may be a two-dimensional area that is searched during inter prediction to retrieve a motion vector. For example, the size of the search range may be M×N. Here, M and N are both integers.
[0106] The motion vector candidate may refer to a prediction candidate block or a motion vector of a prediction candidate block when predicting a motion vector. In addition, the motion vector candidate may be included in a motion vector candidate list.
[0107] The motion vector candidate list may mean a list consisting of one or more motion vector candidates.
[0108] The motion vector candidate index may represent an indicator indicating a motion vector candidate in the motion vector candidate list. Alternatively, it may be an index of a motion vector predictor.
[0109] The motion information may represent information including at least one of a motion vector, a reference picture index, an inter prediction indicator, a prediction list utilization flag, a reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.
[0110] The merge candidate list may refer to a list consisting of one or more merge candidates.
[0111] The merge candidate may represent a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-prediction merge candidate, or a zero merge candidate. The merge candidate may include motion information such as an inter prediction indicator, a reference picture index for each list, a motion vector, a prediction list utilization flag, and an inter prediction indicator.
[0112] The merge index may represent an indicator indicating a merge candidate in the merge candidate list. Alternatively, the merge index may indicate a block in a reconstructed block that is spatially / temporally adjacent to the current block, from which the merge candidate has been derived. Alternatively, the merge index may indicate at least one piece of motion information of the merge candidate.
[0113] Transform unit: may represent a basic unit when encoding / decoding (such as transform, inverse transform, quantization, inverse quantization, transform coefficient encoding / decoding) is performed on a residual signal. A single transform unit may be partitioned into a plurality of lower-level transform units having a smaller size. Here, the transform / inverse transform may include at least one of a first transform / first inverse transform and a second transform / second inverse transform.
[0114] Scaling: may refer to the process of multiplying the level of quantization by a factor. Transform coefficients may be generated by scaling the level of quantization. Scaling may also be referred to as inverse quantization.
[0115] Quantization parameter: may represent a value used when a transform coefficient is used to generate a quantized level during quantization. The quantization parameter may also represent a value used when a transform coefficient is generated by scaling the quantized level during inverse quantization. The quantization parameter may be a value mapped on a quantization step size.
[0116] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.
[0117] Scan: can refer to a method of ordering coefficients within a cell, block, or matrix. For example, changing a two-dimensional matrix of coefficients to a one-dimensional matrix can be called scanning, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix can be called scanning or inverse scanning.
[0118] Transform coefficient: may refer to a coefficient value generated after performing a transform in an encoder. A transform coefficient may refer to a coefficient value generated after performing at least one of entropy decoding and inverse quantization in a decoder. A quantization level obtained by quantizing a transform coefficient or a residual signal or a quantized transform coefficient level may also fall within the meaning of a transform coefficient.
[0119] Quantization level: may represent a value generated by quantizing a transform coefficient or a residual signal in an encoder. Alternatively, the quantization level may represent a value that is a dequantization target subjected to dequantization in a decoder. Similarly, the quantized transform coefficient level as a result of transformation and quantization may also fall within the meaning of the quantization level.
[0120] Non-zero transform coefficient: may refer to a transform coefficient having a value other than zero, or a transform coefficient level or quantization level having a value other than zero.
[0121] Quantization matrix: may refer to a matrix used in a quantization process or an inverse quantization process performed to improve subjective image quality or objective image quality. The quantization matrix may also be referred to as a scaling list.
[0122] Quantization matrix coefficients: can represent each element in the quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.
[0123] Default matrix: may represent a predetermined quantization matrix predefined in an encoder or a decoder.
[0124] Non-default matrix: may denote a quantization matrix that is not predefined in the encoder or decoder but is signaled by the user.
[0125] Statistical value: The statistical value for at least one of a variable, a coding parameter, a constant value, etc. having a calculable specific value can be one or more of the average value, summed value, weighted average value, weighted sum value, minimum value, maximum value, most frequently occurring value, median value, and interpolation value of the corresponding specific value.
[0126] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0127] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include at least one image. The encoding device 100 may sequentially encode at least one image.
[0128] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.
[0129] The encoding device 100 may perform encoding of an input image by using an intra mode or an inter mode or both an intra mode and an inter mode. In addition, the encoding device 100 may generate a bit stream including encoding information by encoding the input image, and output the generated bit stream. The generated bit stream may be stored in a computer-readable recording medium, or may be streamed through a wired / wireless transmission medium. When the intra mode is used as a prediction mode, the switch 115 may switch to the intra mode. Alternatively, when the inter mode is used as a prediction mode, the switch 115 may switch to the inter mode. Here, the intra mode may represent an intra prediction mode, and the inter mode may represent an inter prediction mode. The encoding device 100 may generate a prediction block for an input block of the input image. In addition, the encoding device 100 may encode the residual block using the residual of the input block and the prediction block after generating the prediction block. The input image may be referred to as the current picture as the current encoding target. The input block may be referred to as the current block as the current encoding target, or may be referred to as the encoding target block.
[0130] When the prediction mode is the intra mode, the intra prediction unit 120 may use samples of a block that has been encoded / decoded and is adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block by using the reference samples, or may generate prediction samples of the input block by performing spatial prediction. Here, intra prediction may refer to prediction within a frame.
[0131] When the prediction mode is the inter-frame mode, the motion prediction unit 111 may retrieve the area that best matches the input block from the reference picture when performing motion prediction, and derive the motion vector by using the retrieved area. In this case, the search area may be used as the area. The reference picture may be stored in the reference picture buffer 190. Here, when encoding / decoding of the reference picture is performed, the reference picture may be stored in the reference picture buffer 190.
[0132] The motion compensation unit 112 may generate a prediction block by performing motion compensation on the current block using a motion vector. Here, inter prediction may refer to prediction or motion compensation between frames.
[0133] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial area of a reference picture. In order to perform inter-picture prediction or motion compensation on a coding unit, it may be determined which mode among the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode is used for motion prediction and motion compensation of a prediction unit included in the corresponding coding unit. Then, inter-picture prediction or motion compensation may be performed differently depending on the determined mode.
[0134] The subtractor 125 may generate a residual block by using the difference between the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may represent the difference between the original signal and the prediction signal. In addition, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal, or by transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be a residual signal of a block unit.
[0135] The transform unit 130 may generate a transform coefficient by performing a transform on the residual block and output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip the transform on the residual block.
[0136] The quantization level may be generated by applying quantization to a transform coefficient or to a residual signal. Hereinafter, the quantization level may also be referred to as a transform coefficient in an embodiment.
[0137] The quantization unit 140 may generate a quantization level by quantizing the transform coefficient or the residual signal according to the parameter and output the generated quantization level. Here, the quantization unit 140 may quantize the transform coefficient by using a quantization matrix.
[0138] The entropy encoding unit 150 may generate a bit stream by performing entropy encoding on the value calculated by the quantization unit 140 or the encoding parameter value calculated when encoding is performed according to the probability distribution, and output the generated bit stream. The entropy encoding unit 150 may perform entropy encoding on sample information of the image and information for decoding the image. For example, the information for decoding the image may include a syntax element.
[0139] When entropy coding is applied, symbols are represented so that a smaller number of bits are assigned to symbols with a high probability of generation, and a larger number of bits are assigned to symbols with a low probability of generation, and therefore, the size of the bit stream for the symbol to be encoded can be reduced. The entropy coding unit 150 may use a coding method for entropy coding such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 may perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 may derive a binarization method of a target symbol and a probability model of a target symbol / binary bit, and perform arithmetic coding by using the derived binarization method and context model.
[0140] In order to encode the transform coefficient level (quantized level), the entropy encoding unit 150 may change the coefficient in the two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.
[0141] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and sent to the decoder with a signal, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partition direction (horizontal or vertical), binary tree partition form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, the direction of multi-type tree partitioning direction (horizontal or vertical), type of multi-type tree partition (symmetric type or asymmetric type), tree (binary tree or ternary tree) structure of multi-type tree partition, prediction mode (intra-frame prediction or inter-frame prediction), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample point filtering method, reference sample point filter tap, reference sample point filter coefficient, prediction block filtering method, prediction block filter tap, prediction block filter coefficient, prediction block boundary filtering method, prediction block boundary filter tap, prediction block boundary filter coefficient, intra-frame prediction mode, Inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation accuracy of motion vector, transform type, transform size, information on whether the primary (first) transform is used, information on whether the secondary transform is used, primary transform index, secondary transform index , information on whether a residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an intra-frame loop filter, intra-frame loop filter coefficients, intra-frame loop filter taps, intra-frame loop filter shape / form, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form,Binarization / debinarization method, context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag for unit of coefficient group, position of last valid coefficient, flag on whether the value of coefficient is greater than 1, flag on whether the value of coefficient is greater than 2, flag on whether the value of coefficient is greater than 3, information on remaining coefficient values, sign information, reconstructed luminance samples, reconstructed chrominance samples, residual luminance samples, residual chrominance samples, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, motion vector search area at decoder side size, shape of a motion vector search area at a decoder side, number of motion vector searches at a decoder side, information about a CTU size, information about a minimum block size, information about a maximum block size, information about a maximum block depth, information about a minimum block depth, image display / output order, slice identification information, slice type, slice partition information, tile identification information, tile type, tile partition information, tile group identification information, tile group type, tile group partition information, picture type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantization levels, and information about a luminance signal or information about a chrominance signal.
[0142] Here, signaling a flag or an index may mean entropy encoding the corresponding flag or index by an encoder and including it in a bitstream, and may mean entropy decoding the corresponding flag or index from the bitstream by a decoder.
[0143] When the encoding apparatus 100 performs encoding by inter-frame prediction, the encoded current picture may be used as a reference picture for another image that is subsequently processed. Therefore, the encoding apparatus 100 may reconstruct or decode the encoded current picture, or store the reconstructed or decoded image as a reference picture in the reference picture buffer 190.
[0144] The quantized level may be dequantized in the dequantization unit 160 or may be inversely transformed in the inverse transform unit 170. The dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may be added to the prediction block by the adder 175. A reconstructed block may be generated by adding the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient to the prediction block. Here, the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may mean a coefficient on which at least one of dequantization and inverse transformation is performed, and may mean a reconstructed residual block.
[0145] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed sample, the reconstructed block, or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.
[0146] The deblocking filter can remove block distortion generated in the boundary between blocks. In order to determine whether to apply the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on the samples included in the number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter can be applied according to the required deblocking filter strength.
[0147] In order to compensate for the coding error, a suitable offset value may be added to the sample value by using sample adaptive offset. Sample adaptive offset can correct the offset of the deblocked image from the original image in units of samples. A method of applying the offset in consideration of edge information about each sample may be used, or a method of partitioning the samples of the image into a predetermined number of regions, determining the region to which the offset is applied, and applying the offset to the determined region may be used.
[0148] The adaptive loop filter may perform filtering based on a comparison result of a filtered reconstructed image and an original image. Samples included in an image may be partitioned into predetermined groups, a filter to be applied to each group may be determined, and differential filtering may be performed on each group. Information on whether ALF is applied may be signaled by a coding unit (CU), and the form and coefficient of ALF to be applied to each block may vary.
[0149] The reconstructed block or the reconstructed image that has passed through the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed block processed by the filter unit 180 may be a part of a reference picture. That is, the reference picture is a reconstructed image composed of the reconstructed blocks processed by the filter unit 180. The stored reference picture may be used later in inter-frame prediction or motion compensation.
[0150] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment and to which the present invention is applied.
[0151] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0152] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210, a dequantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260 and a reference picture buffer 270.
[0153] The decoding device 200 may receive a bit stream output from the encoding device 100. The decoding device 200 may receive a bit stream stored in a computer-readable recording medium, or may receive a bit stream streamed through a wired / wireless transmission medium. The decoding device 200 may decode the bit stream by using an intra-frame mode or an inter-frame mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.
[0154] When the prediction mode used in decoding is the intra mode, the switch may be switched to the intra mode. Alternatively, when the prediction mode used in decoding is the inter mode, the switch may be switched to the inter mode.
[0155] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block as a decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as a current block.
[0156] The entropy decoding unit 210 may generate symbols by entropy decoding the bit stream according to the probability distribution. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be an inverse process of the above entropy encoding method.
[0157] In order to decode the transform coefficient levels (quantized levels), the entropy decoding unit 210 may change the coefficients in the form of a one-way vector into a two-dimensional block form by using a transform coefficient scanning method.
[0158] The quantized level may be dequantized in the dequantization unit 220, or the quantized level may be inversely transformed in the inverse transform unit 230. The quantized level may be a result of dequantization or inverse transformation or both, and may be generated as a reconstructed residual block. Here, the dequantization unit 220 may apply a quantization matrix to the quantized level.
[0159] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values of blocks that are adjacent to the decoding target block and have been decoded.
[0160] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses a motion vector and a reference picture stored in the reference picture buffer 270 .
[0161] The adder 225 can generate a reconstructed block by adding the reconstructed residual block to the prediction block. The filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or the reconstructed image. The filter unit 260 can output the reconstructed image. The reconstructed block or the reconstructed image can be stored in the reference picture buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by the filter unit 260 can be a part of a reference picture. That is, the reference picture is a reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference picture can be used later in inter-frame prediction or motion compensation.
[0162] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded. Figure 3 An example of partitioning a single cell into a plurality of lower-level cells is schematically shown.
[0163] In order to effectively partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing an intra prediction mode from an inter prediction mode when encoding / decoding an image. A coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of a transform coefficient.
[0164] Reference Figure 3 , the image 300 is partitioned sequentially according to the maximum coding unit (LCU), and the LCU unit is determined as a partition structure. Here, the LCU may be used in the same meaning as the coding tree unit (CTU). Unit partitioning may mean partitioning a block associated with the unit. In the block partition information, information about the unit depth may be included. The depth information may indicate the number or degree of the unit being partitioned or both the number and degree of the unit being partitioned. A single unit may be partitioned into a plurality of lower-level units hierarchically associated with the depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning the unit may correspond to a node and a child node of the node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information indicating the size of a CU and may be stored in each CU. The unit depth indicates the number and / or degree associated with partitioning the unit. Therefore, the partition information of the lower-level unit may include information about the size of the lower-level unit.
[0165] The partition structure may indicate the distribution of coding units (CUs) within the LCU 310. Such distribution may be determined according to whether a single CU is partitioned into a plurality of (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal size and vertical size of the CU generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning, respectively, or may have sizes smaller than the horizontal size and vertical size before partitioning according to the number of partitions. The CU may be recursively partitioned into a plurality of CUs. By recursive partitioning, at least one of the height and width of the CU after partitioning may be reduced compared to at least one of the height and width of the CU before partitioning. The partitioning of the CU may be recursively performed until a predetermined depth or a predetermined size. For example, the depth of the LCU may be 0, and the depth of the minimum coding unit (SCU) may be a predetermined maximum depth. Here, as described above, the LCU may be a coding unit having a maximum coding unit size, and the SCU may be a coding unit having a minimum coding unit size. Partitioning starts from the LCU 310, and when the horizontal size or vertical size or both the horizontal size and the vertical size of the CU are reduced by partitioning, the CU depth increases by 1. For example, for each depth, the size of the non-partitioned CU may be 2N×2N. Also, in the case of a partitioned CU, a CU of size 2N×2N may be partitioned into four CUs of size N×N. As the depth increases by 1, the size of N may be halved.
[0166] In addition, information on whether a CU is partitioned may be indicated by using the partition information of the CU. The partition information may be 1-bit information. All CUs except the SCU may include partition information. For example, when the value of the partition information is a first value, the CU may not be partitioned, and when the value of the partition information is a second value, the CU may be partitioned.
[0167] Reference Figure 3 , an LCU with a depth of 0 may be a block of 64×64. 0 may be the minimum depth. An SCU with a depth of 3 may be a block of 8×8. 3 may be the maximum depth. A CU of a block of 32×32 and a CU of a block of 16×16 may be represented as depth 1 and depth 2, respectively.
[0168] For example, when a single coding unit is partitioned into four coding units, the horizontal size and vertical size of the four coding units partitioned may be half the horizontal size and vertical size of the CU before being partitioned. In one embodiment, when a coding unit of size 32×32 is partitioned into four coding units, each of the four coding units partitioned may have a size of 16×16. When a single coding unit is partitioned into four coding units, it can be said that the coding unit can be partitioned into a quadtree form.
[0169] For example, when one coding unit is partitioned into two sub-coding units, the horizontal size or vertical size (width or height) of each of the two sub-coding units may be half of the horizontal size or vertical size of the original coding unit. For example, when a coding unit having a size of 32×32 is vertically partitioned into two sub-coding units, each of the two sub-coding units may have a size of 16×32. For example, when a coding unit having a size of 8×32 is horizontally partitioned into two sub-coding units, each of the two sub-coding units may have a size of 8×16. When one coding unit is partitioned into two sub-coding units, the coding unit may be said to be partitioned into two or partitioned by a binary tree partition structure.
[0170] For example, when one coding unit is partitioned into three sub-coding units, the horizontal size or the vertical size of the coding unit may be partitioned at a ratio of 1:2:1, thereby generating three sub-coding units having a ratio of the horizontal size or the vertical size of 1:2:1. For example, when a coding unit having a size of 16×32 is partitioned horizontally into three sub-coding units, the three sub-coding units may have sizes of 16×8, 16×16, and 16×8, respectively, in order from the uppermost sub-coding unit to the lowermost sub-coding unit. For example, when a coding unit having a size of 32×32 is partitioned vertically into three sub-coding units, the three sub-coding units may have sizes of 8×32, 16×32, and 8×32, respectively, in order from the left sub-coding unit to the right sub-coding unit. When one coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned into three sub-coding units or partitioned according to a ternary tree partition structure.
[0171] exist Figure 3 , a coding tree unit (CTU) 320 is an example of a CTU to which a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure are all applied.
[0172] As described above, in order to partition a CTU, at least one of a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure may be applied. Various tree partition structures may be sequentially applied to a CTU according to a predetermined priority order. For example, a quadtree partition structure may be preferentially applied to a CTU. Coding units that can no longer be partitioned using a quadtree partition structure may correspond to leaf nodes of a quadtree. Coding units corresponding to leaf nodes of a quadtree may be used as root nodes of a binary and / or ternary tree partition structure. That is, coding units corresponding to leaf nodes of a quadtree may be further partitioned according to a binary tree partition structure or a ternary tree partition structure, or may not be further partitioned. Therefore, by preventing a coding block obtained from a binary tree partition or a ternary tree partition of a coding unit corresponding to a leaf node of a quadtree from undergoing further quadtree partitioning, a block partitioning operation and / or an operation of sending partition information with a signal may be effectively performed.
[0173] The fact that the coding unit corresponding to the node of the quadtree is partitioned may be signaled using the four partition information. The four partition information having a first value (e.g., '1') may indicate that the current coding unit is partitioned according to the quadtree partition structure. The four partition information having a second value (e.g., '0') may indicate that the current coding unit is not partitioned according to the quadtree partition structure. The four partition information may be a flag having a predetermined length (e.g., one bit).
[0174] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, the coding unit corresponding to the leaf node of the quadtree may further undergo any partitioning of the binary tree partitioning and the ternary tree partitioning. In addition, the coding unit generated by the binary tree partitioning or the ternary tree partitioning may undergo further binary tree partitioning or further ternary tree partitioning, or may not be further partitioned.
[0175] A tree structure in which there is no priority between binary tree partitions and ternary tree partitions is called a multi-type tree structure. A coding unit corresponding to a leaf node of a quadtree may be used as a root node of a multi-type tree. At least one of multi-type tree partition indication information, partition direction information, and partition tree information may be used to signal whether to partition a coding unit corresponding to a node of a multi-type tree. In order to partition a coding unit corresponding to a node of a multi-type tree, multi-type tree partition indication information, partition direction information, and partition tree information may be sequentially signaled.
[0176] The multi-type tree partition indication information having a first value (eg, '1') may indicate that the current coding unit will undergo multi-type tree partitioning. The multi-type tree partition indication information having a second value (eg, '0') may indicate that the current coding unit will not undergo multi-type tree partitioning.
[0177] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a multi-type tree partition structure, the coding unit may include partition direction information. The partition direction information may indicate in which direction the current coding unit will be partitioned for the multi-type tree partition. The partition direction information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned vertically. The partition direction information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned horizontally.
[0178] When the coding unit corresponding to the node of the multi-type tree is further partitioned according to the multi-type tree partition structure, the current coding unit may include partition tree information. The partition tree information may indicate a tree partition structure to be used to partition the nodes of the multi-type tree. The partition tree information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to a binary tree partition structure. The partition tree information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to a ternary tree partition structure.
[0179] The partition indication information, the partition tree information and the partition direction information may all be flags having a predetermined length (eg, one bit).
[0180] At least any one of the quadtree partition indication information, the multi-type tree partition indication information, the partition direction information, and the partition tree information may be entropy encoded / decoded. In order to entropy encode / decode those types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, there is a high probability that the partition type (partitioned or not partitioned, partition tree, and / or partition direction) of the left neighboring coding unit and / or the upper neighboring coding unit of the current coding unit is similar to the partition type of the current coding unit. Therefore, context information for entropy encoding / decoding the information about the current coding unit may be derived from the information about the neighboring coding units. The information about the neighboring coding units may include at least any one of the quadtree partition information, the multi-type tree partition indication information, the partition direction information, and the partition tree information.
[0181] As another example, among binary tree partitioning and ternary tree partitioning, binary tree partitioning may be preferentially performed. That is, the current coding unit may first undergo binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree may be set as the root node for the ternary tree partitioning. In this case, for the coding unit corresponding to the node of the ternary tree, neither quadtree partitioning nor binary tree partitioning may be performed.
[0182] A coding unit that cannot be partitioned according to a quadtree partition structure, a binary tree partition structure, and / or a ternary tree partition structure becomes a basic unit for encoding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Therefore, partition structure information and partition information for partitioning a coding unit into a prediction unit and / or a transformation unit may not exist in the bitstream.
[0183] However, when the size of the coding unit (i.e., the basic unit for partitioning) is larger than the size of the maximum transform block, the coding unit may be recursively partitioned until the size of the coding unit is reduced to be equal to or smaller than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and when the size of the maximum transform block is 32×32, the coding unit may be partitioned into four 32×32 blocks for transforming. For example, when the size of the coding unit is 32×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into two 32×32 blocks for transforming. In this case, the partition of the coding unit for transforming is not separately signaled, and the partition of the coding unit for transforming may be determined by comparison between the horizontal size or vertical size of the coding unit and the horizontal size or vertical size of the maximum transform block. For example, when the horizontal size (width) of the coding unit is larger than the horizontal size (width) of the maximum transform block, the coding unit may be vertically divided into two equal parts. For example, when the vertical size (height) of the coding unit is larger than the vertical size (height) of the maximum transform block, the coding unit may be horizontally divided into two equal parts.
[0184] Information on the maximum and / or minimum size of a coding unit and information on the maximum and / or minimum size of a transform block may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. For example, the minimum size of a coding unit may be determined as 4×4. For example, the maximum size of a transform block may be determined as 64×64. For example, the minimum size of a transform block may be determined as 4×4.
[0185] Information on the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information on the maximum depth from the root node of the multi-type tree to the leaf node (maximum tree depth of the multi-type tree) may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. Information on the minimum size of the quadtree and / or information on the maximum depth of the multi-type tree may be signaled or determined for each of an intra-picture slice and an inter-picture slice.
[0186] The difference information between the size of the CTU and the maximum size of the transform block may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, a parallel block group level, a parallel block level, etc. The information of the maximum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the maximum size of the binary tree) may be determined based on the size of the coding tree unit and the difference information. The maximum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the maximum size of the ternary tree) may vary depending on the type of the slice. For example, for an intra-picture slice, the maximum size of the ternary tree may be 32×32. For example, for an inter-picture slice, the maximum size of the ternary tree may be 128×128. For example, the minimum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the minimum size of the binary tree) and / or the minimum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the minimum size of the ternary tree) may be set to the minimum size of the coding block.
[0187] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree may be signaled or determined at the slice level. Alternatively, the minimum size of the binary tree and / or the minimum size of the ternary tree may be signaled or determined at the slice level.
[0188] Depending on the sizes and depth information of the above-mentioned various blocks, quad partition information, multi-type tree partition indication information, partition tree information and / or partition direction information may or may not be included in the bitstream.
[0189] For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not include the quad partition information. Therefore, the quad partition information may be inferred from the second value.
[0190] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is greater than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be partitioned by the binary tree or the ternary tree. Therefore, the multi-type tree partition indication information may not be signaled, but the multi-type tree partition indication information may be inferred from the second value.
[0191] Optionally, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or is twice as large as the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but may be derived from the second value. This is because when the coding unit is partitioned by the binary tree partition structure and / or the ternary tree partition structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0192] Optionally, the binary tree partition or ternary tree partition may be limited based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when the coding unit is partitioned into sub-coding units that do not fit the pipeline buffer size by binary tree partition or ternary tree partition, the corresponding binary tree partition or ternary tree partition may be limited. The pipeline buffer size may be the size of the maximum transform block (e.g., 64×64). For example, when the pipeline buffer size is 64×64, the following partitions may be limited.
[0193] - N×M (N and / or M is 128) ternary tree partitions for coding units
[0194] - 128×N (N<=64) binary tree partitions in the horizontal direction for coding units
[0195] - N×128 (N<=64) binary tree partitions in the vertical direction for coding units
[0196] Optionally, when the depth of the coding unit corresponding to the node of the multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be sent by a signal, but the multi-type tree partition indication information may be inferred from the second value.
[0197] Optionally, only when at least one of vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is possible for a coding unit corresponding to a node of a multi-type tree, a multi-type tree partition indication information may be signaled. Otherwise, the coding unit may not be partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but may be inferred from the second value.
[0198] Optionally, partition direction information may be signaled only when both vertical binary tree partitioning and horizontal binary tree partitioning or both vertical ternary tree partitioning and horizontal ternary tree partitioning are possible for a coding unit corresponding to a node of a multi-type tree. Otherwise, partition direction information may not be signaled, but may be derived from a value indicating a possible partition direction.
[0199] Optionally, the partition tree information may be signaled only when both vertical binary tree partitioning and vertical ternary tree partitioning or both horizontal binary tree partitioning and horizontal ternary tree partitioning are possible for a coding tree corresponding to a node of a multi-type tree. Otherwise, the partition tree information may not be signaled but derived from a value indicating a possible partition tree structure.
[0200] Figure 4 is a diagram illustrating an intra prediction process.
[0201] Figure 4 The arrows from the center to the outside in FIG. 1 represent the prediction direction of the intra prediction mode.
[0202] Intra-frame encoding and / or decoding may be performed by using reference samples of neighboring blocks of the current block. The neighboring blocks may be reconstructed neighboring blocks. For example, intra-frame encoding and / or decoding may be performed by using encoding parameters or values of reference samples included in the reconstructed neighboring blocks.
[0203] The prediction block may represent a block generated by performing intra prediction. The prediction block may correspond to at least one of a CU, a PU, and a TU. The unit of the prediction block may have a size of one of a CU, a PU, and a TU. The prediction block may be a square block of a size of 2×2, 4×4, 16×16, 32×32, or 64×64, etc., or may be a rectangular block of a size of 2×8, 4×8, 2×16, 4×16, and 8×16, etc.
[0204] Intra-prediction may be performed according to an intra-prediction mode for the current block. The number of intra-prediction modes that the current block may have may be a fixed value, and may be a value determined differently according to properties of the prediction block. For example, the properties of the prediction block may include the size of the prediction block, the shape of the prediction block, and the like.
[0205] Regardless of the block size, the number of intra-frame prediction modes can be fixed to N. Alternatively, the number of intra-frame prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65 or 67, etc. Optionally, the number of intra-frame prediction modes can vary according to the block size or the color component type or both the block size and the color component type. For example, the number of intra-frame prediction modes can vary depending on whether the color component is a luminance signal or a chrominance signal. For example, as the block size becomes larger, the number of intra-frame prediction modes can increase. Optionally, the number of intra-frame prediction modes of the luminance component block can be greater than the number of intra-frame prediction modes of the chrominance component block.
[0206] The intra prediction mode may be a non-angle mode or an angle mode. The non-angle mode may be a DC mode or a planar mode, and the angle mode may be a prediction mode having a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of intra prediction modes may be M, which is greater than 1, including non-angle modes and angle modes. In order to perform intra prediction on a current block, a step of determining whether a sample included in a reconstructed neighboring block can be used as a reference sample of the current block may be performed. When there are samples that cannot be used as reference samples of the current block, a value obtained by copying or interpolating at least one sample value of the samples included in the reconstructed neighboring block, or performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, so that the replaced sample value is used as the reference sample of the current block.
[0207] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0208] like Figure 7 As shown, at least one of the reference sample line 0 to the reference sample line 3 can be used for intra prediction of the current block. Figure 7 In the example, the samples of fragment A and fragment F may be filled with the samples of the closest fragment B and fragment E, respectively, instead of being retrieved from the reconstructed neighboring blocks. Index information indicating the reference sample line to be used for intra prediction of the current block may be signaled. When the upper boundary of the current block is the boundary of the CTU, only the reference sample line 0 may be available. Therefore, in this case, the index information may not be signaled. When a reference sample line other than the reference sample line 0 is used, filtering for the prediction block, which will be described later, may not be performed.
[0209] When intra prediction is performed, a filter may be applied to at least one of reference samples and prediction samples based on the intra prediction mode and the current block size / shape.
[0210] In the case of the planar mode, when generating a prediction block of the current block, according to the position of the prediction target sample in the prediction block, the sample value of the prediction target sample may be generated by using the weighted sum of the upper reference sample and the left reference sample of the current sample and the upper right reference sample and the lower left reference sample of the current block. In addition, in the case of the DC mode, when generating the prediction block of the current block, the average value of the upper reference sample and the left reference sample of the current block may be used. In addition, in the case of the angular mode, the prediction block may be generated by using the upper reference sample, the left reference sample, the upper right reference sample and / or the lower left reference sample of the current block. In order to generate the prediction sample value, interpolation of real number units may be performed.
[0211] In the case of intra prediction between color components, a prediction block of a current block of a second color component may be generated based on a corresponding reconstruction block of a first color component. For example, the first color component may be a luminance component, and the second color component may be a chrominance component. For intra prediction between color components, parameters of a linear model between the first color component and the second color component may be derived based on a template. The template may include upper and / or left neighboring samples of the current block and upper and / or left neighboring samples of a reconstruction block of the first color component corresponding thereto. For example, the sample value of the first color component having the maximum value among the samples in the template and the sample value of the second color component corresponding thereto, and the sample value of the first color component having the minimum value among the samples in the template and the sample value of the second color component corresponding thereto may be used to derive parameters of a linear model. When the parameters of the linear model are derived, the corresponding reconstruction block may be applied to the linear model to generate a prediction block of the current block. Depending on the video format, subsampling may be performed on the reconstruction block of the first color component and the neighboring samples of the corresponding reconstruction block. For example, when one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component may be subsampled to calculate one corresponding sample. In this case, parameter derivation of a linear model and intra prediction between color components may be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of a template may be signaled as an intra prediction mode.
[0212] The current block may be partitioned into two sub-blocks or four sub-blocks in the horizontal direction or the vertical direction. The partitioned sub-blocks may be reconstructed sequentially. That is, intra prediction may be performed on the sub-block to generate a sub-prediction block. In addition, inverse quantization and / or inverse transformation may be performed on the sub-block to generate a sub-residual block. The reconstructed sub-block may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block may be used as a reference sample for intra prediction of the sub-sub-block. The sub-block may be a block including a predetermined number (e.g., 16) or more samples. Thus, for example, when the current block is an 8×4 block or a 4×8 block, the current block may be partitioned into two sub-blocks. In addition, when the current block is a 4×4 block, the current block may not be partitioned into sub-blocks. When the current block has other sizes, the current block may be partitioned into four sub-blocks. Information on whether intra prediction is performed based on sub-blocks and / or partition directions (horizontal or vertical) may be signaled. It may be limited to performing sub-block-based intra prediction only when reference sample line 0 is used. When subblock-based intra prediction is performed, filtering for a prediction block, which will be described later, may not be performed.
[0213] The final prediction block can be generated by performing filtering on the prediction block predicted by the intra-frame. The filtering can be performed by applying predetermined weights to the filtering target samples, the left reference samples, the upper reference samples and / or the upper left reference samples. The weights and / or reference samples (range, position, etc.) used for filtering can be determined based on at least one of the block size, the intra-frame prediction mode and the position of the filtering target samples in the prediction block. The filtering can be performed only in the case of a predetermined intra-frame prediction mode (e.g., DC, plane, vertical, horizontal, diagonal and / or adjacent diagonal mode). The adjacent diagonal mode can be a mode in which k is added to the diagonal mode or k is subtracted from the diagonal mode. For example, k can be a positive integer of 8 or less.
[0214] The intra-frame prediction mode of the current block can be entropy encoded / decoded by predicting the intra-frame prediction mode of the block adjacent to the current block. In the case where the intra-frame prediction mode of the current block is the same as that of the neighboring block, the same information as that of the intra-frame prediction mode of the current block and the neighboring block can be sent by signaling using predetermined flag information. In addition, the indicator information of the intra-frame prediction mode that is the same as the intra-frame prediction mode of the current block among the intra-frame prediction modes of multiple neighboring blocks can be sent by signaling. In the case where the intra-frame prediction mode of the current block and the neighboring block is not the same, the intra-frame prediction mode information of the current block can be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.
[0215] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0216] exist Figure 5 In , a rectangle can represent a picture. Figure 5In FIG. 1 , the arrow indicates the prediction direction. According to the encoding type of the picture, the picture can be classified into an intra picture (I picture), a predicted picture (P picture) and a bi-predicted picture (B picture).
[0217] An I picture may be encoded by intra prediction without requiring inter-picture prediction. A P picture may be encoded by inter-picture prediction using a reference picture existing in one direction (i.e., forward or backward) for the current block. A B picture may be encoded by inter-picture prediction using a reference picture existing in two directions (i.e., forward and backward) for the current block. When inter-picture prediction is used, the encoder may perform inter-picture prediction or motion compensation, and the decoder may perform corresponding motion compensation.
[0218] Hereinafter, embodiments of inter prediction will be described in detail.
[0219] Reference pictures and motion information may be used to perform inter-picture prediction or motion compensation.
[0220] The motion information of the current block may be derived during inter-picture prediction by each of the encoding device 100 and the decoding device 200. The motion information of the current block may be derived by using the motion information of a reconstructed neighboring block, the motion information of a co-located block (also referred to as a col block or a co-located block), and / or the motion information of a block adjacent to the co-located block. The co-located block may represent a block in a previously reconstructed co-located picture (also referred to as a col picture or a co-located picture) that is spatially located at the same position as the current block. The co-located picture may be one of one or more reference pictures included in a reference picture list.
[0221] The derivation method of motion information may be different depending on the prediction mode of the current block. For example, the prediction modes applied to inter prediction include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, triangle partition mode, inter-intra combined prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.
[0222] For example, when AMVP is used as a prediction mode, at least one of a motion vector of a reconstructed neighboring block, a motion vector of a co-located block, a motion vector of a block adjacent to the co-located block, and a (0,0) motion vector may be determined as a motion vector candidate for the current block, and a motion vector candidate list may be generated by using the motion vector candidate. The motion vector candidate of the current block may be derived by using the generated motion vector candidate list. The motion information of the current block may be determined based on the derived motion vector candidate. The motion vector of the co-located block or the motion vector of the block adjacent to the co-located block may be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block may be referred to as a spatial motion vector candidate.
[0223] The encoding device 100 may calculate a motion vector difference (MVD) between a motion vector of a current block and a motion vector candidate, and may perform entropy coding on the motion vector difference (MVD). In addition, the encoding device 100 may perform entropy coding on a motion vector candidate index and generate a bitstream. The motion vector candidate index may indicate the best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding device may perform entropy decoding on the motion vector candidate index included in the bitstream, and may select a motion vector candidate of a decoding target block from the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. In addition, the decoding device 200 may add the entropy-decoded MVD to the motion vector candidate extracted by entropy decoding, thereby deriving a motion vector of the decoding target block.
[0224] In addition, the encoding apparatus 100 may perform entropy encoding on the resolution information of the calculated MVD. The decoding apparatus 200 may adjust the resolution of the entropy-decoded MVD using the MVD resolution information.
[0225] In addition, the encoding device 100 calculates a motion vector difference (MVD) between a motion vector in the current block and a motion vector candidate based on an affine model, and performs entropy encoding on the MVD. The decoding device 200 derives a motion vector based on each sub-block by deriving an affine controlled motion vector of a decoded target block through the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.
[0226] The bitstream may include a reference picture index indicating a reference picture. The reference picture index may be entropy encoded by the encoding apparatus 100 and then signaled as a bitstream to the decoding apparatus 200. The decoding apparatus 200 may generate a prediction block of a decoding target block based on the derived motion vector and the reference picture index information.
[0227] Another example of a method of deriving motion information of a current block may be a merge mode. The merge mode may indicate a method of merging motions of a plurality of blocks. The merge mode may indicate a mode of deriving motion information of a current block from motion information of a neighboring block. When the merge mode is applied, the motion information of the reconstructed neighboring block and / or the motion information of the co-located block may be used to generate a merge candidate list. The motion information may include at least one of a motion vector, a reference picture index, and an inter-picture prediction indicator. The prediction indicator may indicate unidirectional prediction (L0 prediction or L1 prediction) or bidirectional prediction (L0 prediction and L1 prediction).
[0228] The merge candidate list may be a list of stored motion information. The motion information included in the merge candidate list may be at least one of the following: motion information of a neighboring block adjacent to the current block (spatial merge candidate), motion information of a co-located block of the current block in a reference picture (temporal merge candidate), new motion information generated by a combination of motion information present in the merge candidate list, motion information of a block encoded / decoded before the current block (historical-based merge candidate), and a zero merge candidate.
[0229] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and may signal the bitstream to the decoding device 200. The merge flag may be information indicating whether a merge mode is performed for each block, and the merge index may be information indicating which neighboring block among neighboring blocks of the current block is a merge target block. For example, the neighboring blocks of the current block may include a left neighboring block located on the left side of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.
[0230] In addition, the encoding device 100 performs entropy encoding on the correction information for correcting the motion vector in the motion information of the merge candidate, and sends it to the decoding device 200 with a signal. The decoding device 200 can correct the motion vector of the merge candidate selected by the merge index based on the correction information. Here, the correction information may include at least one of information on whether to perform correction, correction direction information, and correction size information. As described above, the prediction mode in which the motion vector of the merge candidate is corrected based on the correction information sent with the signal can be referred to as a merge mode with a motion vector difference.
[0231] The skip mode may be a mode in which the motion information of the neighboring blocks is applied to the current block as it is. When the skip mode is applied, the encoding apparatus 100 may perform entropy encoding on information of the fact of which block's motion information is to be used as the motion information of the current block to generate a bitstream, and may signal the bitstream to the decoding apparatus 200. The encoding apparatus 100 may not signal a syntax element regarding at least any one of the motion vector difference information, the coded block flag, and the transform coefficient level to the decoding apparatus 200.
[0232] The sub-block merge mode may represent a mode for deriving motion information in units of sub-blocks of a coding block (CU). When the sub-block merge mode is applied, the sub-block merge candidate list may be generated using motion information of a sub-block co-located with the current sub-block in the reference picture (sub-block based temporal merge candidates) and / or affine control point motion vector merge candidates.
[0233] The triangular partition mode may denote a mode of deriving motion information by partitioning the current block into diagonal directions, deriving each prediction sample using each of the derived motion information, and deriving the prediction sample of the current block by weighting each of the derived prediction samples.
[0234] The inter-intra combined prediction mode may mean a mode of deriving a prediction sample of a current block by weighting a prediction sample generated by inter prediction and a prediction sample generated by intra prediction.
[0235] The decoding apparatus 200 may correct the derived motion information by itself. The decoding apparatus 200 may search for a predetermined area based on a reference block indicated by the derived motion information, and derive motion information having a minimum SAD as corrected motion information.
[0236] The decoding apparatus 200 may compensate for prediction samples derived through inter-frame prediction using optical flow.
[0237] Figure 6 is a diagram illustrating transform and quantization processing.
[0238] like Figure 6 As shown in , a transform process and / or a quantization process is performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the prediction block (i.e., an intra-frame prediction block or an inter-frame prediction block). The prediction block is a block generated by intra-frame prediction or inter-frame prediction. The transform can be a primary transform, a secondary transform, or both a primary transform and a secondary transform. The primary transform of the residual signal generates transform coefficients, and the secondary transform of the transform coefficients generates secondary transform coefficients.
[0239] At least one scheme selected from various predefined transform schemes is used to perform the primary transform. For example, examples of the predetermined transform scheme include discrete cosine transform (DCT), discrete sine transform (DST) and Karhunen-Loève transform (KLT). The transform coefficients generated by the primary transform may undergo a secondary transform. The transform scheme used for the primary transform and / or the secondary transform may be determined based on the coding parameters of the current block and / or the neighboring blocks of the current block. Optionally, transform information indicating the transform scheme may be sent by a signal. DCT-based transforms may include, for example, DCT-2, DCT-8, etc. DST-based transforms may include, for example, DST-7.
[0240] A quantized level signal (quantized coefficient) may be generated by performing quantization on a residual signal or a result of performing a primary transform and / or a secondary transform. Depending on the intra prediction mode or block size / shape of the block, the quantized level signal may be scanned according to at least one of a diagonal upper right scan, a vertical scan, and a horizontal scan. For example, when scanning coefficients in a diagonal upper right scan, the coefficients in block form are changed to a one-dimensional vector form. In addition to the diagonal upper right scan, a horizontal scan that scans the coefficients in a two-dimensional block form horizontally or a vertical scan that scans the coefficients in a two-dimensional block form vertically may be used depending on the intra prediction mode and / or the size of the transform block. The scanned quantized level coefficients may be entropy encoded for insertion into a bitstream.
[0241] The decoder performs entropy decoding on the bit stream to obtain quantized level coefficients. The quantized level coefficients can be arranged in a two-dimensional block form by reverse scanning. For reverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning can be used.
[0242] The quantized level coefficients may then be dequantized, then inversely transformed twice as needed, and finally inversely transformed once as needed to produce a reconstructed residual signal.
[0243] Inverse mapping in the dynamic range can be performed for the luminance component reconstructed by intra-frame prediction or inter-frame prediction before in-loop filtering. The dynamic range can be partitioned into 16 equal segments, and the mapping function of each segment can be sent with a signal. The mapping function can be sent with a signal at the slice level or the parallel block group level. The inverse mapping function for performing inverse mapping can be derived based on the mapping function. In-loop filtering, reference picture storage and motion compensation are performed in the inverse mapping area, and the prediction block generated by inter-frame prediction is converted to the mapping area via mapping using the mapping function, and then used to generate a reconstructed block. However, since intra-frame prediction is performed in the mapping area, the prediction block generated via intra-frame prediction can be used to generate a reconstructed block without mapping / inverse mapping.
[0244] When the current block is a residual block of a chroma component, the residual block can be converted to an inverse mapping area by performing scaling on the chroma component of the mapping area. The availability of scaling can be signaled at the slice level or the parallel block group level. Scaling can be applied only when the mapping of the luminance component is available and the partitions of the luminance component and the chroma component follow the same tree structure. Scaling can be performed based on the average value of the sample values of the luminance prediction block corresponding to the chroma block. In this case, when the current block uses inter-frame prediction, the luminance prediction block can represent the mapped luminance prediction block. The value required for scaling can be derived by using the index reference lookup table of the fragment to which the average value of the sample values of the luminance prediction block belongs. Finally, the residual block can be converted to an inverse mapping area by scaling the residual block using the derived value. Then, chroma component block recovery, intra-frame prediction, inter-frame prediction, in-loop filtering, and reference picture storage can be performed in the inverse mapping area.
[0245] Information indicating whether mapping / inverse mapping of luma components and chroma components is available may be signaled through a sequence parameter set.
[0246] The prediction block of the current block can be generated based on a block vector indicating the displacement between the current block and the reference block in the current picture. In this way, the prediction mode for generating the prediction block with reference to the current picture is called an intra-block copy (IBC) mode. The IBC mode can be applied to M×N (M<=64, N<=64) coding units. The IBC mode may include a skip mode, a merge mode, an AMVP mode, and the like. In the case of a skip mode or a merge mode, a merge candidate list is constructed, and a merge index is sent with a signal so that a merge candidate can be specified. The block vector of the specified merge candidate can be used as the block vector of the current block. The merge candidate list may include at least one of a spatial candidate, a history-based candidate, a candidate based on the average of two candidates, and a zero merge candidate. In the case of the AMVP mode, a difference block vector may be sent with a signal. In addition, a prediction block vector may be derived from the left neighboring block and the upper neighboring block of the current block. The index of the neighboring block to be used may be sent with a signal. The prediction block in the IBC mode is included in the current CTU or the left CTU and is limited to a block in an area that has been reconstructed. For example, the value of the block vector can be limited so that the prediction block of the current block is located in the region of three 64×64 blocks before the 64×64 block to which the current block belongs in the encoding / decoding order. By limiting the value of the block vector in this way, the memory consumption and device complexity of the implementation scheme according to the IBC mode can be reduced.
[0247] Figure 8 is a flowchart illustrating an intra prediction process according to an embodiment of the present invention.
[0248] The intra prediction process of the current block may include step S801 of deriving an intra prediction mode, step S802 of constructing reference samples, and / or step S803 of performing intra prediction.
[0249] In step S801, an intra prediction mode of a current block may be derived. The intra prediction mode of the current block may be derived using the following methods: a method using an intra prediction mode of a neighboring block, a method entropy encoding / decoding an intra prediction mode of the current block from a bitstream, a method using encoding parameters of a neighboring block, or a method using an intra prediction mode of a color component. In addition, the first direction mode may be changed to a second direction mode based on at least one of the intra prediction mode or the size / shape of the current block.
[0250] In step S802, reference samples may be constructed by performing at least one of reference sample selection, reference sample filling, or reference sample filtering.
[0251] In step S803, intra prediction may be performed by performing at least one of non-directional prediction, directional prediction, prediction based on position information, or cross-color component prediction. In addition, in the process of performing intra prediction, filtering may be performed on the prediction samples. When additional filtering is performed, filtering may be performed on one or more prediction samples in the current block based on at least one of the intra prediction mode of the block, the width and height of the block, the shape of the block, or the position of the prediction samples. At this time, the filter type (e.g., at least one of the filter coefficient, the filter tap, or the filter shape) may be different.
[0252] Hereinafter, step S801 of deriving an intra prediction mode will be described.
[0253] One or more reconstructed neighboring blocks may be used to derive the intra prediction mode of the current block. The position of the reconstructed neighboring block may be a predefined fixed position or a position derived by encoding / decoding. In the following, encoding / decoding may represent entropy encoding / decoding. For example, when the coordinates of the sample point at the upper left corner of the current block of size W×H are (0,0), the neighboring block may be at least one of the blocks adjacent to the coordinates (-1,H-1), (W-1,-1), (W,-1), (-1,H) and (-1,-1) or a neighboring block of the block. At this time, W and H may represent the width W and height H of the current block or the number of samples.
[0254] The intra prediction mode of an unavailable neighboring block may be replaced by a predetermined intra prediction mode. The predetermined intra prediction mode may be, for example, a DC mode, a plane mode, a vertical mode, a horizontal mode, and / or a diagonal mode. For example, when a neighboring block is outside the boundary of at least one predetermined unit (such as a picture, a slice, a parallel block, or a coding tree unit (CTU)), is subjected to inter prediction, or is encoded in PCM mode, the neighboring block may be determined to be unavailable. On the contrary, when the neighboring block is an inter prediction block and an indicator indicating whether inter prediction and intra prediction are combined (e.g., inter_intra_flag) is 1, the neighboring block may be determined to be available.
[0255] For example, when the neighboring block is an upper block and the CTU to which the neighboring block belongs is different from the CTU to which the current block belongs (i.e., the upper boundary of the current block is the upper boundary of the current CTU), the neighboring block may be determined to be unavailable. In this case, the plane mode may be used instead of the intra-frame prediction mode of the neighboring block. That is, the plane mode may be derived as the intra-frame prediction mode of the current block.
[0256] The intra prediction mode of the current block can be derived by the intra prediction mode of the neighboring block at a predetermined position or the statistical value of the intra prediction mode of two or more neighboring blocks. Here, the statistical value can represent at least one of an average value, a maximum value, a minimum value, a most frequently occurring value, a median value, a weighted average value, or an interpolation value. The mode corresponding to the maximum value of the intra prediction mode of the upper block and the intra prediction mode of the left block can be determined as an MPM candidate, thereby being derived as the intra prediction mode of the current block.
[0257] Alternatively, the intra prediction mode of the current block may be derived based on the size of the neighboring block. For example, the intra prediction mode of the neighboring block with a relatively large size may be derived as the intra prediction mode of the current block. Alternatively, the statistical value may be calculated by assigning a relatively large weight to the intra prediction mode of the block with a relatively large size.
[0258] Optionally, whether the intra prediction mode of the neighboring block is directional may be considered. For example, when the intra prediction mode of the neighboring block is non-directional, the non-directional mode may be derived as the intra prediction mode of the current block. Optionally, the intra prediction mode of the neighboring block other than the non-directional mode may be used to derive the intra prediction mode of the current block.
[0259] In order to derive the intra prediction mode of the current block, one or more most probable mode (MPM) lists may be constructed using the intra prediction modes of neighboring blocks. The number N of candidate modes included in the MPM list may be fixed, or may be determined according to the size and / or shape of the current block. The MPM list may be constructed without a repeated pattern. When the number of available candidate modes is less than N, a predetermined candidate mode in the available candidate modes (e.g., one or more modes obtained by adding a predetermined offset to a directional mode or subtracting a predetermined offset from a directional mode) may be added to the MPM list. Optionally, at least one of a horizontal mode, a vertical mode, a 45-degree mode, a 135-degree mode, a 225-degree mode, or a non-directional mode may be added to the MPM list. The predetermined offset may be 1, 2, 3, 4, or a positive integer.
[0260] For example, a pattern obtained by adding a predetermined offset to the minimum and maximum values of the direction candidate patterns included in the MPM list or subtracting the predetermined offset from the minimum and maximum values of the direction candidate patterns included in the MPM list may be added to the MPM list as an MPM candidate. For example, a pattern obtained by adding m to the minimum value or subtracting m from the minimum value and a pattern obtained by adding n to the maximum value or subtracting n from the maximum value may be added to the MPM list. At this time, m and n may be positive integers (e.g., 1 or 2).
[0261] The same MPM candidate may not be repeatedly included in the MPM list. Therefore, the MPM list construction method may be applied differently based on the difference between the minimum value and the maximum value, so that the pattern obtained by adding m to the minimum value is inconsistent with the pattern obtained by subtracting n from the maximum value. For example, when the difference between the minimum value and the maximum value of the candidate patterns included in the MPM list is determined to be 1, the pattern obtained by adding 1 to the minimum value is consistent with the maximum value, and the pattern obtained by subtracting 1 from the maximum value is consistent with the minimum value. Therefore, overlapping patterns may not be added to the MPM list. In this case, a pattern obtained by subtracting 1 from the minimum value, a pattern obtained by adding 1 to the maximum value, and a third pattern may be added to the MPM list. For example, the third pattern may be a pattern obtained by subtracting 2 from the minimum value.
[0262] The MPM list can be constructed in a predetermined order based on the positions of the neighboring blocks. For example, the predetermined order can be the order of the blocks adjacent to the left, top, lower left, upper right, and upper left corners of the current block. The non-directional mode can be included in any position of the MPM list. For example, this can be added as the next order of the intra-frame prediction mode of the blocks adjacent to the left and top sides.
[0263] For example, the MPM list can be constructed to always include non-directional (e.g., DC and planar) modes. Since prediction is performed using all upper reference samples and left reference samples, the probability of occurrence may be high. Therefore, by always adding the DC mode and the planar mode to the MPM list, the bit overhead of signaling the intra prediction mode can be reduced.
[0264] In another example, the intra prediction mode of the neighboring block and the intra prediction mode derived using the MPM list can be used to derive the intra prediction mode of the current block. For example, when the intra prediction mode derived using the MPM list is Pred_mpm, the intra prediction mode of the neighboring block can be used to change Pred_mpm. For example, when Pred_mpm is greater than the intra prediction mode of the neighboring block (or the statistical value of two or more intra prediction modes), Pred_mpm can be increased by n, otherwise it can be reduced by n. At this time, n can be a predetermined integer (such as +1, +2, +3, 0, -1, -2 or -3). The intra prediction mode of the current block can be derived as the changed Pred_mpm. Optionally, when at least one of the intra prediction modes of Pred_mpm or the neighboring block is a non-directional mode, the intra prediction mode of the current block can be derived as a non-directional mode. On the contrary, the intra prediction mode of the current block can be derived as a directional mode.
[0265] In another example, the intra prediction mode of the current block may be derived using the intra prediction mode of another color component. For example, when the current block is a chroma block, the intra prediction mode of the luminance block corresponding to the chroma block may be used. The number of corresponding luminance blocks may be one or more. The corresponding luminance block may be determined based on at least one of the size, shape, and / or encoding parameters of the chroma block. The corresponding luminance block may be determined based on at least one of the size, shape, and / or encoding parameters of the luminance block.
[0266] The luminance block corresponding to the chrominance block may include multiple partitions. All or some of the multiple partitions may have different intra-frame prediction modes. The intra-frame prediction mode of the chrominance block may be derived based on all or some of the multiple partitions in the corresponding luminance block. At this time, some partitions (all or some of the multiple partitions) may be selectively used based on a comparison of block size, shape or depth information between the chrominance block and the luminance block. A partition at a position in the luminance block corresponding to a predetermined position in the chrominance block may be selectively used. The predetermined position may represent a corner sample point (e.g., an upper left sample point) position or a center sample point position of the chrominance block.
[0267] The method of deriving the intra prediction mode across color components disclosed in the present invention is not limited to using the intra prediction mode of the corresponding luminance block. For example, the intra prediction mode of the chrominance block can be derived by using or sharing at least one of the mpm_idx or MPM list of the corresponding luminance block.
[0268] Fig. 9 is a diagram illustrating a relationship between a luminance block and a chrominance block according to an embodiment of the present invention.
[0269] Reference Fig. 9 , the ratio between the color components can be 4:2:0, and the luminance block corresponding to the chrominance block can be at least one of A, B, C, or D.
[0270] Reference Fig. 9 For example, the intra prediction mode of the chroma block may be derived using the intra prediction mode of the luminance block A corresponding to the upper left position (0,0) in the chroma block or the intra prediction mode of the luminance block D corresponding to the center sample position (nS / 2,nS / 2) of the chroma block. The predetermined position in the chroma block is not limited to (0,0) and (nS / 2,nS / 2). For example, the predetermined position may be the position of the sample at the top, lower left corner, and / or lower right corner in the chroma block.
[0271] The predetermined position may be selected based on the shape of the chroma block. For example, when the chroma block has a square shape, the predetermined position may be a center sample position. For example, when the chroma block has a rectangular shape, the predetermined position may be an upper left sample position. In the above examples, the predetermined position when the chroma block has a square shape and the predetermined position when the chroma block has a rectangular shape may be opposite to each other.
[0272] In another example, the intra prediction mode of the chroma block may be derived using statistics of one or more intra prediction modes in a luma block corresponding in size to that of the chroma block.
[0273] In another example, at least one position in the chroma block or at least one position in the luma block may be calculated based on the upper left position of each block. For example, the center sample position in the luma block may be calculated by adding (nS / 2, nS / 2) to the upper left position (0, 0) of the luma block.
[0274] Here, the horizontal position nS and the vertical position nS of the block may be different. For example, in the case of a rectangular shape, the center sample point position of the block may be different in horizontal position and vertical position.
[0275] Reference Fig. 9 , a mode corresponding to the average value of the intra-frame prediction modes of the luminance blocks A and D or a mode corresponding to the average value of the intra-frame prediction modes of A, B, C and D in the luminance block corresponding to the size of the chrominance block can be derived as the intra-frame prediction mode of the chrominance block.
[0276] When there are multiple available intra-prediction modes for a luma block, all or some of the intra-prediction modes may be selected. The selection may be performed based on a predetermined position in the chroma block or based on the size, shape, and / or depth of the chroma block and / or luma block. The selected intra-prediction mode of the luma block may be used to derive the intra-prediction mode of the chroma block.
[0277] By comparing the size of the luminance block A corresponding to the upper left sample position (0,0) in the chrominance block and the size of the luminance block D corresponding to the center sample position (nS / 2,nS / 2) in the chrominance block, the intra-frame prediction mode of the chrominance block can be derived using the intra-frame prediction mode of the luminance block D having a relatively large size.
[0278] In another example, when the luma block corresponding to a predetermined position in the chroma block is greater than or equal to the chroma block, the intra prediction mode of the chroma block may be derived using the intra prediction mode of the luma block.
[0279] In another example, when the size of the chroma block is within a predetermined range, the intra prediction mode of the chroma block may be derived using the intra prediction mode of the luma block corresponding to the top left sample position (0,0) in the chroma block.
[0280] In another example, when the size of the chroma block is within a predetermined range, the intra-frame prediction mode of the chroma block can be derived using the intra-frame prediction mode of the block with a large size by comparing the sizes of the luminance blocks corresponding to predetermined positions (0,0) and (nS / 2,nS / 2) in the chroma block.
[0281] The predetermined range may be derived based on at least one of information signaled via a bitstream, information about a size (and / or depth) of a block (chroma block and / or luma block), or information predefined in an encoder / decoder.
[0282] In another example, when the chroma block has a rectangular shape, the intra prediction mode of the chroma block may be derived using the intra prediction mode of the luma block corresponding to the center sample position (nS / 2, nS / 2) in the chroma block.
[0283] In another example, a partition having the same shape as the chrominance block among the plurality of partitions in the luma block may be used to derive the intra prediction mode of the chrominance block. For example, when the chrominance block has a square or non-square shape, a square or non-square partition among the plurality of partitions in the luma block may be used.
[0284] In addition, refer to the above Fig. 9In the described embodiment, the intra prediction mode of the chrominance block is derived using the intra prediction mode of the luminance block, including the case where the intra prediction mode of the luminance block is used as the intra prediction mode of the chrominance block without change. In addition, in addition to using the intra prediction mode of the luminance block, information including the mpm_idx and MPM list of the luminance block used when deriving the intra prediction mode of the luminance block can also be used.
[0285] In another example, the intra prediction mode of the luma block corresponding to the predetermined position may be used to construct the MPM list of the chroma block. In this case, the mpm_idx information of the chroma block may be encoded and signaled. The MPM list of the chroma block may be constructed using a similar method as the MPM list of the luma block. However, the MPM candidates of the chroma block may include the intra prediction mode of the neighboring chroma block and / or the intra prediction mode of the corresponding luma block.
[0286] When the MPM flag is 0, a secondary MPM list including one or more intra prediction modes may be constructed, and the intra prediction mode of the current block may be derived using the secondary MPM index 2nd_mpm_idx. At this time, a secondary indicator (e.g., a secondary MPM flag) indicating whether the intra prediction mode of the current block is included in the secondary MPM list may be encoded / decoded. The secondary MPM list may be constructed using the intra prediction modes of neighboring blocks similarly to the primary MPM list. At this time, the intra prediction mode included in the primary MPM list may not be included in the secondary MPM list. The number of MPM lists is not limited to one or two, and N MPM lists may be used.
[0287] When the intra prediction mode of the current block is not included in one of the multiple MPM lists, the intra prediction mode of the luma component of the current block may be encoded / decoded. In addition, the intra prediction mode of the chroma component may be derived or encoded / decoded based on the intra prediction mode of the corresponding luma component.
[0288] When the current block is partitioned into a plurality of sub-blocks, at least one of the above methods is applicable in order to derive an intra prediction mode for each of the partitioned sub-blocks.
[0289] The size and / or shape of the sub-block may be a predetermined size and / or shape (e.g., 4×4), or may be determined according to the size and / or shape of the current block. Alternatively, the size of the sub-block may be determined based on whether the neighboring blocks of the current block are partitioned or based on the intra-prediction mode of the neighboring blocks of the current block. For example, the current block may be partitioned based on boundaries where the intra-prediction modes of the neighboring blocks are different. Alternatively, the current block may be partitioned based on whether the neighboring blocks are intra-coded blocks or inter-coded blocks.
[0290] An indicator (e.g., NDIP_flag) indicating that the intra prediction mode of the current block is derived using the intra prediction mode of the neighboring block may be encoded / decoded. The indicator may be encoded / decoded every at least one unit of the current block or subblock. At this time, the indicator may be encoded / decoded only when the size of the current block or subblock corresponds to a predetermined size or a predetermined size range.
[0291] The determination as to whether the size of the current block corresponds to the predetermined size may be performed based on the width or height of the current block. For example, when the width or height is partitionable, it may be determined that the size of the current block corresponds to the predetermined size.
[0292] When the current block is partitioned into a plurality of sub-blocks, the intra prediction modes of the plurality of sub-blocks may be derived in a zigzag order or in parallel. The intra prediction mode of the sub-block may be derived using at least one of the methods for deriving the intra prediction mode of the current block. At this time, the neighboring blocks of the current block may be used as the neighboring blocks of each sub-block. Alternatively, the sub-blocks in the current block may be used as the neighboring blocks of each sub-block.
[0293] The intra prediction mode of the sub-block belonging to the current block may be derived using the average of the intra prediction modes of the current block and the intra prediction modes of the blocks adjacent to the left and upper sides of the (0,0) position sample of each sub-block. For example, when the intra prediction mode of the current block is greater than the average value, 1 / 2 of the average value may be subtracted from the derived intra prediction mode, and when the intra prediction mode of the current block is equal to or less than the average value, 1 / 2 of the average value may be added to the derived intra prediction mode.
[0294] The information about the intra prediction may be signaled through at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header, or a parallel block header. At a predetermined block size or smaller, at least one of the information about the intra prediction may not be signaled. In this case, information about the intra prediction of a previously encoded / decoded block (e.g., a higher-level block) may be used.
[0295] Fig.10 is a diagram illustrating neighboring blocks that can be referenced to derive an intra prediction mode of a current block according to an embodiment of the present invention.
[0296] For example, as in Fig.10 In the example of , the intra prediction mode of the current block can be derived using the intra prediction modes of the upper right neighboring block and the lower left neighboring block of the current block. The intra prediction mode of the upper right neighboring block can be B, the intra prediction mode of the lower left neighboring block can be A, and A and B can represent intra prediction mode numbers (e.g. Fig.11In addition, the MPM candidate of the current block may be derived using statistical values of A and B (e.g., at least one of the maximum / minimum value, median value, or average value). In addition, the MPM candidate may be derived by applying a predetermined offset (e.g., + / -1, 2, 3, ...) to A, B, or the statistical value, and the mode of applying the offset may be derived, for example, by a modulo (%) operation. In addition, the predetermined offset may be added or subtracted.
[0297] In another example, a method of deriving the intra prediction mode of the current block may vary based on at least one of multi-reference sample line related information (e.g., intra_luma_ref_idx), sub-block partition prediction information (e.g., intra_sub_partition_flag or intra_sub_partition_type), or intra / inter combined prediction related information (e.g., mh_intra_flag).
[0298] In another example, the MPM list may be constructed and the intra prediction mode may be derived using the same method regardless of multi-reference sample line related information, sub-block partition prediction information, intra / inter combined prediction related information, and the like.
[0299] The multi-reference sample line related information may indicate whether to use the reference sample line and / or line index information of the second or higher adjacent reference sample line of the current block. At this time, the indexes of the first, second, third and fourth adjacent reference sample lines may be 0, 1, 2 and 3.
[0300] For example, the intra prediction mode of the current block may be derived based on the first, second, and / or third reference sample lines adjacent to the current block. Alternatively, a determination as to whether a reference sample is available, a determination as to whether to replace a reference sample, and filtering of a reference sample may be performed based on the first, second, and / or third reference sample lines adjacent to the current block.
[0301] In addition, the first, second and / or third reference sample lines adjacent to the current block may be used to derive parameters of a cross-component linear model (CCLM). For example, the reference sample line that may be used for intra prediction of the current block and the reference sample line that may be used to derive parameters of the CCLM may be the same. Here, the reference sample line may represent the first, second and / or third reference sample line adjacent to the current block.
[0302] Here, indexes indicating the first reference sample line, the second reference sample line, and the third reference sample line adjacent to the current block may be 0, 1, and 2, respectively.
[0303] In addition, when the reference sample line 1 that can be used for intra prediction of the current block and the reference sample line 2 that can be used to derive the parameters of the CCLM are different (for example, when the reference sample line 1 includes the first, second, and fourth reference sample lines adjacent to the current block, and the reference sample line 2 includes the first, second, and third reference sample lines adjacent to the current block), the encoder / decoder may need an additional memory for the fourth reference sample line.
[0304] Therefore, when the reference sample line 1 becomes equal to the reference sample line 2 by using the third reference sample line instead of the fourth reference sample line, an additional memory may not be required. In addition, a predetermined mapping table indicating a mapping relationship between reference sample lines and indexes of the reference sample lines preset in the encoder / decoder may not be provided.
[0305] The subblock partition prediction information may indicate whether the current block is partitioned into predetermined subblocks to perform prediction, at least one of a partition direction or a partition number.
[0306] Here, the above method may be one of the following embodiments.
[0307] In the following embodiments, A can represent Fig.10 In the example of , the intra prediction mode of the lower left neighboring block is represented as Fig.10 The intra prediction mode of the upper right neighboring block in the example.
[0308] In addition, in addition to the planar mode, the MPM list constructed in the following embodiments may be constructed. For example, the MPM list may be constructed after determining whether the intra prediction mode of the current block is the planar mode. Alternatively, the MPM list of the current block may be constructed based on information about whether the intra prediction mode of the current block is the planar mode.
[0309] Figures 12 to 17 is a diagram illustrating a process of building an MPM list according to an embodiment of the present invention.
[0310] For example, when intra prediction is performed using the first reference sample line adjacent to the current block (eg, intra_luma_ref_idx=0), or when sub-block partition prediction is performed (eg, intra_sub_partition_flag=1), as in Fig.12 In the example, MPM candidates can be derived and the intra prediction mode of the current block can be derived.
[0311] 1) In the case where A and B are the same mode and are directional modes (e.g., a mode greater than 1), five or six MPM candidates can be constructed in the MPM list in the following order: [A, plane, DC, 2+((A+61)%64), 2+((A-1)%64), 2+((A+60)%64)] or [plane, A, 2+((A+61)%64), 2+((A-1)%64), 2+((A+60)%64), 2+(A%64)].
[0312] 2) In the case where A and B are different and are directional modes, four MPM candidates can be constructed in the MPM list in the following order: [A, B, Planar, DC].
[0313] In addition, the pattern with a larger size between A and B can be determined as maxAB, and the pattern with a smaller size can be determined as minAB. At this time, when the difference between maxAB and minAB is greater than 1 and less than 63, two MPM candidates [2+((maxAB+61)%64), 2+((maxAB-1)%64] can be added to the MPM list, thereby filling the list with six candidates. In addition, when the difference between maxAB and minAB is 1 or greater than or equal to 63, two MPM candidates [2+((maxAB+60)%64), 2+((maxAB)%64] can be added to the MPM list, thereby filling the list with six candidates.
[0314] 3) In the case where A and B are different, one of A and B is a directional mode and the other is a non-directional mode, five or six MPM candidates can be constructed in the MPM list in the following order: [A, B, 1-minAB, 2+((maxAB+61)%64), 2+((maxAB-1)%64, 2+((maxAB+60)%64] or [maxAB, 2+((maxAB+61)%64), 2+((maxAB-1)%64, 2+((maxAB+60)%64, 2+(max AB%64)].
[0315] 4) In cases other than the above (for example, when A and B are the same and are non-directional patterns (for example, a pattern less than or equal to 1)), five or six MPM candidates can be constructed in the MPM list in the following order: [A, 1-A, 50, 18, 46, 54] or [DC, 50, 18, 46, 54].
[0316] The MPM candidates may be secondary derived by applying a predetermined offset to the constructed five or six MPM candidates.
[0317] Under predetermined conditions, only Fig.12 For example, MPM candidate modes other than the planar mode may be constructed.
[0318] In another example, when intra prediction is performed using one of the second reference sample line and the higher reference sample line adjacent to the current block (e.g., intra_luma_ref_idx!=0 or intra_luma_ref_idx>0), or when sub-block partition prediction is performed (e.g., intra_sub_partition_flag=1), as in Fig.13 In the example, MPM candidates can be derived and the intra prediction mode of the current block can be derived.
[0319] In addition, as described above, the MPM list can be constructed and the intra prediction mode can be derived using the same method regardless of multi-reference sample line related information, sub-block partition prediction information, etc.
[0320] 1) In the case where A and B are the same mode and are directional modes (e.g., a mode greater than 1), five or six MPM candidates can be constructed in the MPM list in the following order: [A, 2+((A+61)%64), 2+((A-1)%64), 2+((A+60)%64), 2+((A)%64), 2+((A+59)%64)] or [A, 2+((A+61)%64), 2+((A-1)%64), 2+((A+60)%64), 2+(A%64)].
[0321] 2) In the case where A and B are different and in directional mode, two MPM candidates can be constructed in the MPM list in the following order: [A, B].
[0322] In this case, the MPM list may be constructed based on a predetermined mode. Here, the predetermined mode may be 1, 2, or 61 (or 62). That is, the MPM list may be constructed differently based on intra prediction mode 1, 2, or 61 (or 62). Here, constructing the MPM list differently may mean that the candidates included in the MPM list may be different, or the order of the candidates may be different.
[0323] In addition, a mode having a larger size between A and B may be determined as maxAB, a mode having a smaller size may be determined as minAB, and four modes may be derived by comparing the sizes of A and B.
[0324] 2-1) When the difference between maxAB and minAB is 1, the following 3 or four candidates can be added to the MPM list: [2+((minAB+61)%64), 2+((MinAB-1)%64), 2+((minAB+60)%64), 2+((minAB)%64)] or [2+((minAB+61)%64), 2+((MinAB-1)%64), 2+((minAB+60)%64)].
[0325] 2-2) When the difference between maxAB and minAB is 2, the following 3 or four candidates can be added to the MPM list: [2+((minAB-1)%64), 2+((minAB+61)%64), 2+((minAB-1)%64), 2+((minAB+60)%64)] or [2+((minAB-1)%64), 2+((minAB+61)%64), 2+((minAB-1)%64)].
[0326] 2-3) When the difference between maxAB and minAB is greater than 61 (i.e., greater than or equal to 62), the following three or four candidates can be added to the MPM list: [2+((minAB-1)%64), 2+((minAB+61)%64), 2+((minAB)%64), 2+((minAB+60)%64)] or [2+((minAB-1)%64), 2+((minAB+61)%64), 2+((minAB)%64)].
[0327] 2-4) In the case where the difference between maxAB and minAB does not correspond to 2-1 to 2-3 (i.e., the difference between maxAB and minAB is greater than 2 and less than 62), the following four candidates can be added to the MPM list: [2+((minAB+61)%64), 2+((minAB-1)%64), 2+((maxAB+61)%64), 2+((maxAB-1)%64)] or [2+((minAB+61)%64), 2+((maxAB-1)%64)].
[0328] 3) In the case where A and B are different, one of A and B is a directional mode and the other is a non-directional mode, five or six MPM candidates can be constructed in the MPM list in the following order: [maxAB, 2+((maxAB+61)%64), 2+((maxAB-1)%64), 2+((maxAB+60)%64), 2+((maxAB)%64), 2+((maxAB+59)%64)] or [maxAB, 2+((maxAB+61)%64), 2+((maxAB-1)%64), 2+((maxAB+60)%64), 2+((maxAB)%64)]
[0329] 4) In cases other than the above (for example, when A and B are the same and are non-directional patterns (for example, a pattern less than or equal to 1)), 5 or six MPM candidates can be constructed in the MPM list in the following order: [50, 18, 2, 34, 66, 26] or [DC, 50, 18, 46, 54].
[0330] In case intra_luma_ref_idx!=0 as described above, a non-directional mode (eg, DC or planar) may not be derived as an MPM candidate.
[0331] The order may be changed. For example, a pattern of six MPM candidates may be derived as follows using a pattern with a changed order: [34, 50, 18, 2, 66, 26].
[0332] The pattern constructing the above-mentioned pattern may be a predetermined direction pattern (eg, a predetermined direction pattern other than 50, 18, 2, 34, 66, 26).
[0333] The MPM candidates may be secondary derived by applying a predetermined offset to the constructed six MPM candidates.
[0334] Under predetermined conditions, only Fig.13 some steps.
[0335] For example, in the case where the intra prediction mode of the current block is not the planar mode, an MPM candidate mode other than the planar mode may be constructed.
[0336] In another example, candidates located at predetermined positions may be excluded from the constructed MPM list. Optionally, the MPM list may be rebuilt using some candidates of the constructed MPM list.
[0337] In another example, when the intra prediction mode of the current block is not a planar mode, MPM candidates other than the MPM candidate located at the last position in the MPM list may be constructed. In this case, in the example of 2-1), the MPM list may be composed of candidates [2+((minAB+61)%64), 2+((maxAB-1)%64), 2+((minAB+60)%64)]. In addition, in the example of 2-2), the MPM list may be composed of candidates [2+((minAB-1)%64), 2+((minAB+61)%64), 2+((maxAB-1)%64)]. In addition, in the example of 2-3), the MPM list may be composed of candidates [2+((minAB-1)%64), 2+((maxAB+61)%64), 2+((minAB)%64)]. In addition, in the example of 2-4), the MPM list may consist of candidates [2+((minAB+61)%64), 2+((maxAB+61)%64)].
[0338] In another example, when intra prediction is performed using a second reference sample line or one of higher reference sample lines adjacent to the current block (eg, intra_luma_ref_idx!=0 or intra_luma_ref_idx>0), as in Fig.14 In the example, MPM candidates can be derived and the intra prediction mode of the current block can be derived.
[0339] In addition, as described above, the MPM list can be constructed and the intra prediction mode can be derived using the same method regardless of multi-reference sample line related information, sub-block partition prediction information, etc.
[0340] At this time, the method of deriving six MPM candidates can be performed using the same method regardless of intra_luma_ref_idx. That is, in the same manner as the method of deriving MPM candidates when intra_luma_ref_idx=0, six MPM candidates can be derived, and then the MPM candidates can be reconstructed when intra_luma_ref_idx!=0. For example, four MPM candidate modes other than the non-directional mode among the derived six candidates can be derived. Optionally, one or more non-directional modes can be excluded in the derivation process using the same method. For example, in the same manner as the method of deriving MPM candidates when intra_luma_ref_idx=0, MPM candidates can be constructed as five modes other than the planar mode in the MPM list derivation process.
[0341] The MPM derivation method when intra_luma_ref_idx=0 may include the DC mode and the planar mode as non-directional modes in list candidates 0 to 3. Therefore, two directional modes other than the non-directional mode in the four candidates may be reconstructed in the MPM list. In addition, four MPM candidate modes may be derived by adding two directional modes corresponding to list candidate 4 and list candidate 5 in the six candidates.
[0342] The reconstructed MPM list may have four candidate modes, and the MPM list derived when intra_luma_ref_idx=0 may be used to derive the MPM list when intra_luma_ref_idx!=0.
[0343] Syntax (eg, mrl_intra_luma_mpm_idx) for signaling the reconstructed four MPM indices may be added. Alternatively, the previously signaled intra_luma_mpm_idx may be used to signal the indices.
[0344] When the above method is used to derive the MPM, the method of deriving the six MPMs can be unified. In addition, when intra_luma_ref_idx!=0, the additional derivation process can be simplified.
[0345] The MPM candidates may be secondary derived by applying a predetermined offset to the constructed six MPM candidates.
[0346] Under predetermined conditions, only Fig.14 For example, when the intra prediction mode of the current block is not the planar mode, an MPM candidate mode other than the planar mode may be constructed. In another example, when the intra prediction mode of the current block is not the planar mode, an MPM candidate other than the MPM candidate located at the last position in the MPM list may be constructed.
[0347] In another example, when intra prediction is performed using one of the second reference sample line and the higher reference sample line adjacent to the current block (eg, intra_luma_ref_idx!=0 or intra_luma_ref_idx>0), as in Fig.15 In the example, the MPM candidate can be derived and the intra prediction mode of the current block can be derived. In addition, as described above, the MPM list can be constructed and the intra prediction mode can be derived using the same method, regardless of the multi-reference sample line related information, sub-block partition prediction information, etc.
[0348] 1) In the case where the intra prediction mode A or B derived from the neighboring block is a non-directional mode, it can be changed to a predetermined directional mode. For example, this can be changed to a directional mode that varies according to the position of the neighboring block. For example, when the intra prediction mode A is a non-directional mode, the A mode can be changed to 18 as a horizontal mode. In addition, when the intra prediction mode B is a non-directional mode, the B mode can be changed to 50 as a vertical mode.
[0349] 2) A pattern (e.g., C) can be derived by comparing A and B. For example, when A and B are the same, a pattern can be derived. Alternatively, a candidate can be derived using statistical values of A and B (e.g., at least one of the maximum / minimum, median, or average). A pattern with the same value or maximum value between A and B can be derived as shown in the following equation: C=A>B? A:B.
[0350] 3) Six MPM candidate modes can be derived based on the derived mode C as follows: [C, 2+((C+61)%64), 2+((C-1)%64), 2+((C+60)%64), 2+((C)%64), 2+((C+59)%64)]
[0351] When Fig.15 When deriving MPM candidates in the example of FIG. 5 , the complexity of deriving the MPM list can be reduced when intra_luma_ref_idx != 0.
[0352] The MPM candidates may be secondary derived by applying a predetermined offset to the constructed six MPM candidates.
[0353] Under predetermined conditions, only Fig.15 some steps.
[0354] In another example, when intra prediction is performed using a second reference sample line or one of higher reference sample lines adjacent to the current block (eg, intra_luma_ref_idx!=0 or intra_luma_ref_idx>0), as in Fig.16 In the example, MPM candidates can be derived and the intra prediction mode of the current block can be derived.
[0355] In addition, as described above, the MPM list can be constructed and the intra prediction mode can be derived using the same method regardless of multi-reference sample line related information, sub-block partition prediction information, etc.
[0356] 1) In the case where the intra prediction mode A or B derived from the neighboring block is a non-directional mode, it can be changed to a predetermined directional mode. For example, both A and B can be changed to a diagonal mode (e.g., mode 34) using the upper reference sample and the left reference sample.
[0357] 2) When intra prediction modes A and B are the same, six MPM candidate modes can be derived using A and adjacent intra prediction modes: [A, 2+((A+61)%64), 2+((A-1)%64), 2+((A+60)%64), 2+((A)%64), 2+((A+59)%64)]
[0358] 3) When intra prediction modes A and B are different, A and B may be added to the MPM list, and four MPM candidate modes may be added based on statistical values (e.g., at least one of difference, maximum / minimum, median, or average) of A and B. At this time, the candidate mode may be derived based on the distance between A and B so that the four candidate modes do not overlap with each other.
[0359] 4) When the value obtained by subtracting the minimum value from the maximum value between A and B is greater than 4, a pattern adjacent to the minimum value pattern and greater than the minimum value pattern (e.g., minimum value + 1 or minimum value + 2) may be derived as an MPM candidate pattern. In addition, a pattern adjacent to the maximum value pattern and less than the maximum value pattern (e.g., maximum value - 1 or maximum value - 2) may be derived as an MPM candidate pattern. The order of the four candidate patterns added to the MPM list is as follows: [2+((minAB-1)%64), 2+((maxAB+61)%64), 2+((minAB)%64), 2+((maxAB+60)%64)]
[0360] 5) When the value obtained by subtracting the minimum value from the maximum value between A and B is less than or equal to 4 (i.e., the A mode and the B mode are adjacent), a mode adjacent to the minimum mode and smaller than the minimum mode (e.g., minimum value -1 or minimum value -2) can be derived as an MPM candidate mode. In addition, a mode adjacent to the maximum mode and larger than the maximum mode (e.g., maximum value +1 or maximum value +2) can be derived as an MPM candidate mode. The order of the four candidate modes added to the MPM list is as follows: [2+((minAB+61)%64), 2+((maxAB-1)%64), 2+((minAB+60)%64), 2+((maxAB)%64)]
[0361] The derivation method based on the case where the difference between the maximum and minimum values is greater than 4 or the case where the difference between the maximum and minimum values is less than or equal to 4 is applicable to Fig.13 For example, you can use Fig.16 The derivation method for the case where the difference between the maximum and minimum values in the example is greater than 4 or the difference between the maximum and minimum values is less than or equal to 4, instead of Fig.13 A derivation method in the case where the difference between the maximum value and the minimum value in the example is 2 or 6 or greater than 61.
[0362] The MPM candidates may be secondary derived by applying a predetermined offset to the constructed six MPM candidates.
[0363] Under predetermined conditions, only Fig.16 some steps.
[0364] In another example, when intra prediction is performed using a second reference sample line or one of higher reference sample lines adjacent to the current block (eg, intra_luma_ref_idx!=0 or intra_luma_ref_idx>0), as in Fig.17 In the example, MPM candidates can be derived and the intra prediction mode of the current block can be derived.
[0365] In addition, as described above, the MPM list can be constructed and the intra prediction mode can be derived using the same method regardless of multi-reference sample line related information, sub-block partition prediction information, etc.
[0366] 1) A pattern (e.g., C) can be derived by comparing A and B from neighboring blocks. For example, when A and B are the same, a pattern can be derived. Alternatively, a candidate can be derived using statistical values of A and B (e.g., at least one of the maximum / minimum, median, or average). A pattern having the same value or the maximum value between A and B can be derived as shown in the following equation: C=A>B? A:B.
[0367] Alternatively, a pattern having the same value or minimum value between A and B can be derived as shown in the following equation: C = A>B? B:A
[0368] 2) When the derived mode C is a directional mode (e.g., C>1), six MPM candidate modes can be derived using neighboring modes adjacent to mode C as follows: [C, 2+((C+61)%64), 2+((C-1)%64), 2+((C+60)%64), 2+((C)%64), 2+((C+59)%64)]
[0369] 3) When the derived mode C is a non-directional mode (e.g., C<=1), six MPM candidate modes can be derived as follows: [50, 18, 2, 34, 66, 26]
[0370] The order of the predefined patterns can be changed. For example, six MPM candidate patterns can be derived as follows using the predefined patterns with a changed order: [34, 50, 18, 2, 66, 26]
[0371] Optionally, the six MPM candidate modes may be assigned to an MPM list (eg, candModeList) in the following order: [50, 18, 34, 66, 2, 26]
[0372] The pattern constructing the predefined pattern may be a predetermined direction pattern (eg, a predetermined direction pattern other than 50, 18, 2, 34, 66, 26).
[0373] The MPM candidates may be secondary derived by applying a predetermined offset to the constructed six MPM candidates.
[0374] Under predetermined conditions, only Fig.17 some steps.
[0375] Mode C may be derived by being fixed to one of A and B. For example, the same method as described above may be used to derive the MPM candidate mode by fixing mode C to A which is the mode of the left neighboring block and determining whether the mode of A is a directional mode.
[0376] In another example, when the coding mode of the current block is the inter mode and intra / inter combined prediction is performed (eg, mh_intra_flag=1), as in Fig.18 In the example, MPM candidates can be derived and the intra prediction mode of the current block can be derived.
[0377] In addition, as described above, the MPM list can be constructed and the intra prediction mode can be derived using the same method regardless of multi-reference sample line related information, sub-block partition prediction information, etc.
[0378] When performing intra / inter combined prediction, the intra prediction mode used for intra prediction may be limited to a predetermined mode. For example, prediction may be performed using one of DC, Planar, Horizontal 18, or Vertical 50.
[0379] The intra prediction mode of the current block may be derived using the intra prediction mode A of a block adjacent to the left side of the current block and the intra prediction mode B of a block adjacent to the upper side of the current block.
[0380] 1) The modes of A and B may be changed to an intra prediction mode that may be used for the current block. For example, when the intra prediction mode of A or B is a vertical mode (e.g., A or B is greater than 34), A or B may be changed to a vertical mode 50. In addition, when the intra prediction mode of A or B is a horizontal mode (e.g., A or B is greater than 1 and less than or equal to 34), A or B may be changed to a horizontal mode 18.
[0381] 2) When the changed intra prediction modes of A and B are the same and are non-directional modes (eg, modes less than 2), three MPM candidates may be constructed in the MPM list in the following order: [planar, DC, vertical].
[0382] 3) When A and B are the same and are directional modes (eg, modes greater than 1), three MPM candidates may be constructed in the MPM list in the following order: [A, Planar, DC].
[0383] 4) When A and B are different from each other, two MPM candidates can be constructed in the MPM list in the following order: [A, B].
[0384] In addition, when the planar mode does not exist in the MPM list, the planar mode can be derived as the third candidate mode. In addition, when the planar mode exists in the MPM list and the DC mode does not exist, the DC mode can be derived as the third candidate mode. In addition, when both the planar mode and the DC mode exist in the MPM list, the vertical mode can be derived as the third candidate mode.
[0385] A mode not included in the constructed MPM list among planar, DC, horizontal, and vertical modes may be assigned C.
[0386] The MPM list can be rebuilt based on the size / shape of the current block. For example, when the height of the current block is greater than twice the width and there is a vertical mode in the list, the vertical mode can be replaced by the C mode. In addition, when the width of the current block is greater than twice the height and there is a horizontal mode in the list, the horizontal mode can be replaced by the C mode.
[0387] Under predetermined conditions, only Fig.18 some steps.
[0388] Fig.19 is a diagram illustrating a process of signaling an intra prediction mode according to an embodiment of the present invention.
[0389] In another example, when the coding mode of the current block is inter mode and intra / inter combined prediction is performed (eg, mh_intra_flag=1), the intra prediction mode of the current block can be directly signaled without using the MPM list. That is, the complexity of deriving the MPM list can be removed.
[0390] When performing intra / inter combined prediction, the intra prediction mode may be signaled as one of the DC mode, the planar mode, the horizontal mode, and the vertical mode. Fig.19In the example, when mh_intra_flag = 1, the intra prediction mode mh_intra_luma_mode can be signaled. The intra prediction mode can be one of the four modes described above, and can be signaled using fixed-length binarization or truncated Rice binarization. When the mode is signaled using fixed-length binarization, each intra prediction mode can be signaled using two binary bits. When the mode is signaled using truncated Rice binarization, the intra prediction modes are arranged in the order of plane mode, DC mode, vertical mode, and horizontal mode, and the plane mode can be signaled using one binary bit, the DC mode can be signaled using two binary bits, and the vertical mode and horizontal mode can be signaled using three binary bits, respectively.
[0391] In another example, when the coding mode of the current block is an inter mode and intra / inter combined prediction is performed (e.g., mh_intra_flag=1), the intra prediction mode of the current block may be fixed to a predetermined mode. That is, one of the DC mode, the plane mode, the horizontal mode, and the vertical mode may be fixed and used. For example, when intra / inter combined prediction is performed, only plane prediction may be performed as intra prediction, and its signaling may not be performed.
[0392] In addition, the intra prediction mode may be derived differently by combining the multi-reference sample line related information (e.g., intra_luma_ref_idx) and the intra / inter combined prediction related information (e.g., mh_intra_flag). Figures 12 to 17 and / or Fig.18 The intra prediction mode is derived by performing the following steps.
[0393] Based on one or more of the multi-reference sample line related information and the sub-block partition prediction information, one or more of the above methods may be used to derive MPM candidates and the intra prediction mode of the current block may be derived.
[0394] For example, when intra prediction is performed using the first reference sample line adjacent to the current block (eg, intra_luma_ref_idx=0), or when sub-block partition prediction is performed (eg, intra_sub_partition_flag=1), the following may be used: Fig.12 In addition, when intra prediction is performed using one of the second reference sample line or higher reference sample lines adjacent to the current block (eg, intra_luma_ref_idx!=0 or intra_luma_ref_idx>0), as in Fig.17 In the example, MPM candidates can be derived and the intra prediction mode of the current block can be derived.
[0395] In another example, the same method may be used to derive the MPM candidate regardless of the above information. That is, when intra prediction is performed using the first reference sample line adjacent to the current block (e.g., intra_luma_ref_idx=0), when intra prediction is performed using the second reference sample line adjacent to the current block or one of the higher reference sample lines (e.g., intra_luma_ref_idx!=0 or intra_luma_ref_idx>0), or when sub-block partition prediction is performed (e.g., intra_sub_partition_flag=1), the same method may be used to derive the MPM candidate.
[0396] For example, as in Fig.13 In the example of , five or six MPM candidates can be derived. At this time, information indicating whether the intra prediction mode of the current block is a non-directional intra prediction mode or a directional intra prediction mode can be preferentially sent by signal. For example, information indicating whether the intra prediction mode of the current block is a planar mode (e.g., intra_planar_flag) can be preferentially sent by signal. In addition, the mode of the current block can be derived by signaling information indicating whether the intra prediction mode of the current block is a planar mode. For example, when intra_planar_flag is a first value (e.g., 1), mpm_index can be derived. In addition, when intra_planar_flag is a first value (e.g., 1), mpm_index can be derived as in Fig.13 In the example of , five MPM candidates are derived. In addition, intra_planar_flag can be derived based on multi-reference sample line related information (e.g., intra_luma_ref_idx). In another example, information indicating planar mode / DC mode or directional mode (e.g., intra_angular_flag) can be preferentially signaled. In addition, when intra_angular_flag is a first value (e.g., 1), as in Fig.13 In the example of , the MPM candidate may be derived, and in addition, the intra prediction mode of the current block may be derived based on mpm_flag or mpm_index. In addition, when intra_angular_flag is a second value (eg, 0), the mode of the current block may be derived by signaling intra_planar_flag. Optionally, the intra_angular_flag may be used. Fig.17 Rather than Fig.13 Optionally, some of the above derivation methods may be used to derive MPM candidates.
[0397] In addition, in case of intra_luma_ref_idx=0 or intra_sub_partition_flag=1, intra_planar_flag or intra_angular_flag may be signaled.
[0398] In another example, as in Fig.13 In the example of , five or six MPM candidates are derived. At this time, it is preferred to signal whether the intra prediction mode of the current block is a non-directional intra prediction mode or a directional intra prediction mode. That is, when intra_angular_flag is signaled and intra_angular_flag is 1, as in Fig.13 In the example of , the MPM candidate can be derived and the intra prediction mode of the current block can be derived based on mpm_flag or mpm_index. In addition, intra_planar_flag can also be used as information indicating whether the intra prediction mode of the current block is a non-directional intra prediction mode. For example, the mode of the current block can be derived by signaling intra_planar_flag indicating whether the intra prediction mode of the current block is a planar mode. That is, when intra_planar_flag is a first value (e.g., 1), mpm_index can be derived. In addition, when intra_planar_flag is a first value (e.g., 1), it can be as in Fig.13 Here, intra_planar_flag can indicate whether the intra prediction mode of the current block is DC mode. Optionally, Fig.17 Rather than Fig.13 Optionally, some of the above derivation methods may be used to derive MPM candidates.
[0399] In another example, the same method can be used to derive four candidate modes. Fig.13 The same method is derived for the example and can be Fig.13 The four higher modes in the MPM list in . Optionally, the four candidate modes can be used with Fig.17 The same method is derived for the example and can be Fig.17At this time, when intra prediction is performed using the first reference sample line adjacent to the current block (e.g., intra_luma_ref_idx=0), or when sub-block partition prediction is performed (e.g., intra_sub_partition_flag=1), MPM indexes 0 and 1 may be assigned to the planar mode and the DC mode, respectively, and the derived four modes may be assigned indexes 2 to 5, thereby deriving six MPM candidate modes.
[0400] In another example, a combination of some of the above methods may be used to derive MPM candidates. Fig.13 In the example of , six MPM candidates can be derived. At this time, instead of deriving four MPM candidates based on the conditions "maxAB-minAB=1" and "maxAB-minAB=2" and "maxAB-minAB>61", it can be as follows Fig.16 In the example, four MPM candidates are derived based on the condition “maxAB-minAB>4”.
[0401] In another example, the MPM list derived using the same method may consist only of directional intra prediction modes. That is, a non-directional intra prediction mode (e.g., planar or DC) may be derived based on at least one of the above information, and a directional intra prediction mode (e.g., angular mode) may be used to derive the MPM candidate mode regardless of the above information.
[0402] In another example, the MPM list can be constructed by deriving five MPM candidates. At this time, the predetermined mode can be excluded, and the predetermined mode can be a non-directional mode (e.g., a plane or DC mode). When the predetermined mode is a plane mode, the MPM list can be constructed using the DC mode and the directional mode. For example, the following construction is possible.
[0403] 1) When the intra-frame prediction modes A and B of the neighboring blocks are the same and are directional modes (for example, a mode greater than 1), five MPM candidates can be constructed in the MPM list in the following order: [A, 2+((A+61)%64), 2+((A-1)%64), DC, 2+((A+60)%64)].
[0404] 2) In the case where A and B are different from each other and are directional patterns, three MPM candidates may be constructed in the MPM list in the following order: [A, B, DC].
[0405] In addition, the pattern with a larger size in A and B can be determined as maxAB, and the pattern with a smaller size can be determined as minAB. At this time, when the difference between maxAB and minAB is greater than 1 and less than 63, the MPM list can be filled with five candidates by adding two MPM candidates [2+((maxAB+61)%64), 2+((maxAB-1)%64] to the MPM list. In addition, when the difference between maxAB and minAB is 1 or greater than or equal to 63, the MPM list can be filled with five candidates by adding two MPM candidates [2+((maxAB+60)%64), 2+((maxAB)%64] to the MPM list.
[0406] 3) In the case where A and B are different from each other, one of A and B is a directional mode and the other is a non-directional mode, five MPM candidates can be constructed in the MPM list in the following order: [maxAB, DC, 2+((maxAB+61)%64), 2+((maxAB-1)%64, 2+((maxAB+60)%64].
[0407] 4) In cases other than the above, for example, when A and B are the same and are planar patterns (eg, patterns less than 1), five MPM candidates may be constructed in the MPM list in the following order: [DC, 50, 18, 46, 54].
[0408] Intra prediction may be performed by partitioning the current block into a predetermined number of subblocks based on the size and / or shape of the current block.
[0409] For example, when the size of the current block is at least one of 8×8, 4×8, or 8×4, the width or height of the current block may be partitioned into two.
[0410] In another example, when the size of the current block is greater than 8×8, the width or height of the current block may be partitioned into four. At this time, information about whether the partition direction is a vertical direction or a horizontal direction may be sent by a signal. In the case of vertical partitioning, the width may be partitioned into two or four parts, and in the case of horizontal partitioning, the height may be partitioned into two or four parts. For example, when the size of the current block is 32×16 and vertical partitioning is performed, the width may be partitioned into four parts, thereby being partitioned into four sub-blocks, each of which has a size of 8×16.
[0411] In addition, information about the type of partitioning the current block into sub-blocks may be sent from the encoder to the decoder using a signal. The information may indicate the direction in which the current block is partitioned. The information may be a flag. For example, the information may include information indicating no partitioning, horizontal partitioning, and vertical partitioning.
[0412] In addition, the number of sub-blocks may be derived based on information about the type of partitioning the current block into sub-blocks. Alternatively, the number of sub-blocks may be derived based on the width and height of the current block.
[0413] For example, when the information about the type of sub-blocks into which the current block is partitioned indicates non-partitioning, the current block may not be partitioned. At this time, the information indicating the number of sub-blocks may be 1.
[0414] In another example, when the size of the current block is 4×8, the information indicating the number of sub-blocks may be 2.
[0415] In another example, when the size of the current block is 8×4, the information indicating the number of sub-blocks may be 2.
[0416] In another example, when the size of the current block is greater than or equal to 8×8, the information indicating the number of subblocks may be 4. At this time, the current block may be partitioned in the horizontal direction or the vertical direction.
[0417] The current block may represent a luma block.
[0418] An intra prediction mode is applicable to the sub-blocks partitioned in the current block. For example, multiple sub-blocks partitioned in the current block can share the same intra prediction mode. In this case, the intra prediction mode can be determined based on the size of the current block or the size of the sub-block.
[0419] For example, when the size of the current block is 32×8 and the current block is partitioned into four in the vertical direction, the intra prediction mode may be derived based on the size / shape of the current block. For example, when the intra prediction mode signaled for the current block is 2, the mode may be changed to a predetermined mode based on the shape (e.g., aspect ratio) of the current block. Mode 2 may be changed to mode 67 based on the width of the current block and the height of the current block.
[0420] In another example, when the size of the current block is 32×8 and the current block is partitioned into four in the vertical direction, the intra prediction mode may be derived based on the size / shape of the current block. For example, when the intra prediction mode signaled for the current block is 2, since the shape of the subblock is a square with the same height and width, mode 2 may be applied without change. That is, intra prediction of the four partitioned 8×8 subblocks may be performed using intra prediction mode 2. Since the intra prediction mode is changed and derived based on the size / shape of the subblock, the size of the reference sample may be maintained as width x2 and height x2.
[0421] In another example, when the size of the current block is 32×32 and the current block is partitioned into four in the horizontal direction, the size of the subblock may be 32×8. At this time, when the intra prediction mode signaled for the current block is 2, mode 2 may be changed to mode 67 based on the aspect ratio of the subblock, and intra prediction of each subblock may be performed.
[0422] A method of changing an intra prediction mode based on the size / shape of a block (eg, a current block or a subblock) is as follows.
[0423] For example, when the following conditions are met, the intra prediction mode may be changed to predModeIntra=predModeIntra+65.
[0424] The width of the block is greater than the height of the block.
[0425] predModeIntra is greater than or equal to 2.
[0426] predModeIntra is less than (whRatio>1)? (8+2*whRatio): 8. whRatio can be the absolute value of Log2(width / height).
[0427] In another example, when the following conditions are met, the intra prediction mode may be changed to predModeIntra=predModeIntra-67.
[0428] The height of the block is greater than the width of the block.
[0429] predModeIntra is less than or equal to 66.
[0430] predModeIntra greater than (whRatio>1)? (60-2*whRatio): 60. whRatio can be the absolute value of Log2(width / height).
[0431] A high priority index in the MPM list may be assigned to a predetermined pattern, thereby reducing the signaling overhead bits. For example, a non-directional pattern with a high frequency of occurrence (e.g., planar or DC) may be assigned an index of 0 or 1. A non-directional pattern may be assigned an index number that is less than the index number of a directional pattern. The method of assigning a high priority index to a non-directional pattern may be applied to at least one of the above-mentioned MPM derivation methods.
[0432] When constructing the MPM list, the MPM candidate mode can be derived by distinguishing at least one of the positions of neighboring blocks, the number of MPM candidate modes, or the number of available intra prediction modes. That is, one MPM list can be constructed by constructing multiple MPM lists (e.g., two MPM lists) and combining the multiple MPM lists.
[0433] For example, you can use Fig.10 An MPM list can be constructed by using the intra prediction mode of the neighboring block at the same position as the example of . In addition, another MPM list can be constructed using the intra prediction mode of the neighboring block located on the left and upper sides of the upper left side (e.g., [0,0]) of the current block.
[0434] In another example, one MPM list may be constructed using five candidate patterns, and another MPM list may be constructed using three candidate patterns.
[0435] In another example, 6 intra prediction modes may be used to construct candidate modes in one MPM list, and 3 intra prediction modes may be used to construct candidate modes in another MPM list. The number of modes used may vary depending on the size of the current block, and may be at least one of 66, 35, 19, or 11.
[0436] When the intra prediction mode of the current block is derived using the MPM list, the intra prediction mode information may be signaled. The intra prediction mode information may be at least one of intra_luma_mpm_flag, intra_luma_mpm_idx, intra_luma_mpm_remainder, or intra_luma_not_planar_flag. For example, intra_luma_mpm_flag indicating whether there is an intra prediction mode of the current block in the MPM list may be signaled. When intra_luma_mpm_flag is 1, index information intra_luma_mpm_idx indicating which of the candidate modes in the MPM list is sent by a signal. In addition, when intra_luma_mpm_flag is 0, intra_luma_mpm_remainer indicating the intra prediction mode of the current block may be signaled.
[0437] Here, intra_luma_not_planar_flag may be an indicator indicating whether the intra prediction mode of the current block is a planar mode.
[0438] At least one of the intra prediction mode information may not be signaled based on at least one of the multi-reference sample line related information (e.g., intra_luma_ref_idx), the subblock partition prediction information (e.g., intra_sub_partition_flag, intra_sub_partition_type), or the intra / inter combined prediction related information (e.g., mh_intra_flag).
[0439] For example, in the case of intra_luma_ref_idx!=0, intra_luma_mpm_flag or intra_luma_mpm_remainder may not be signaled. That is, the intra prediction mode of the current block corresponding to the index may be derived by signaling intra_luma_mpm_idx.
[0440] In another example, in case of intra_luma_ref_idx!=0, mrl_intra_luma_mpm_idx may be signaled, and entropy encoding / decoding different from intra_luma_mpm_idx may be applied. For example, mrl_intra_luma_mpm_idx may signal the indices of four MPM candidates, and intra_luma_mpm_idx may signal the indices of six MPM candidates.
[0441] In another example, in case of intra_sub_partition_flag = 1, intra_luma_mpm_flag or intra_luma_mpm_remainder may not be signaled. That is, the intra prediction mode of the current block corresponding to the index may be derived by signaling intra_luma_mpm_idx.
[0442] In another example, in the case of mh_intra_flag=1, the intra prediction mode of the current block may be directly signaled without signaling the intra prediction mode information. For example, the intra prediction mode may be derived by signaling mh_intra_luma_mode.
[0443] In addition, the intra prediction mode may be differently derived based on at least one of multi-reference sample line related information (eg, intra_luma_ref_idx) or intra / inter combined prediction related information (eg, mh_intra_flag).
[0444] Hereinafter, step S802 of constructing reference samples will be described.
[0445] Reference samples for intra prediction may be constructed based on the derived intra prediction mode. In the following embodiments, the current block may represent a prediction block or a sub-block having a size / shape smaller than the prediction block. Reference samples may be constructed using one or more reconstructed samples around the current block or a combination thereof. In addition, filtering may be applied to the constructed reference samples.
[0446] The number and / or position of the reconstruction sample lines used to construct the reference sample may vary according to the position of the current sample in the coding tree block. Each of the reconstruction sample lines may be used as a reference sample without change. Optionally, a predetermined filter may be applied to the reconstruction sample, and the filtered reconstruction sample may be used to generate the reference sample. The reconstruction samples to which the filter is applied may belong to the same reconstruction sample line or different reconstruction sample lines.
[0447] The constructed reference sample may be represented by ref[m,n], and the adjacent reconstructed sample or the sample obtained by filtering the adjacent reconstructed sample may be represented by rec[m,n]. At this time, m or n may be a predetermined integer value indicating the position of the sample. When the position of the upper left sample position in the current block is (0,0), the position of the upper left reference sample of the current block may be set to (-1,-1).
[0448] In order to construct reference samples, the availability of neighboring reconstruction samples may be determined. When the neighboring reconstruction samples are located outside at least one of a picture, a slice, a tile, or a CTU, it may be determined that the neighboring reconstruction samples are unavailable. Alternatively, when constrained intra prediction of the current block is performed and the neighboring reconstruction samples are located on an inter-coded / decoded block, it may be determined that the neighboring reconstruction samples are unavailable.
[0449] When it is determined that the adjacent reconstruction sample points are unavailable, the unavailable sample points may be replaced with the adjacent available reconstruction sample points. For example, starting from the lower left sample point, the unavailable sample points may be filled with the adjacent available sample points. Alternatively, a combination of available sample points may be used to fill the unavailable sample points. For example, the unavailable sample points may be filled with the average value of the available sample points at both ends of the unavailable sample point.
[0450] Alternatively, information about available reference sample points may be used to fill in unavailable sample points. At this time, unavailable sample points may be filled with an arbitrary value other than the values of adjacent available sample points. The arbitrary value may be an average value of the available sample point values or a value that takes into account the gradient of the available sample point values. Alternatively, both the average value and the gradient may be used. The gradient may be determined based on the difference between adjacent available sample points. Alternatively, the gradient may be determined based on the difference between the average value and the available sample point values. In addition to the average value, a maximum value, a minimum value, a median value, or a weighted sum using an arbitrary weight may be used. The arbitrary weight may be determined based on the distance between the available sample point and the unavailable sample point.
[0451] The method can be applied to both the upper reference sample and the left reference sample, or can be applied only in any direction. In addition, the method can even be applied to the case where multiple reconstruction sample lines are used to construct the reference sample line of the current block.
[0452] Whether to apply filtering to the constructed one or more reference samples may be determined based on at least one of an intra prediction mode of the current block or a size / shape of the block. When filtering is applied, the filter type may vary according to at least one of an intra prediction mode, size, or shape of the current block.
[0453] Hereinafter, steps of performing intra prediction will be described.
[0454] Intra prediction of the current block may be performed based on the derived intra prediction mode and / or reference samples.
[0455] In DC mode, an average value of one or more constructed reference samples may be used. At this time, filtering may be applied to one or more prediction samples located at the boundary of the current block. DC prediction may be performed differently based on at least one of the size or shape of the current block. For example, a range of reference samples used in DC mode may be specified based on the size and / or shape of the current block.
[0456] Fig. 20 is a diagram illustrating DC prediction according to a size and / or shape of a current block according to an embodiment of the present invention.
[0457] like Fig. 20 As shown in (a) of FIG. 8 , when the current block has a square shape, DC prediction may be performed using an average value of upper reference samples and left reference samples of the current block.
[0458] When the current block has a non-square shape, neighboring samples adjacent to the left or top of the current block may be selectively used. Fig. 20 In the example of (b), when the current block has a rectangular shape, DC prediction may be performed using an average value of reference samples adjacent to a larger size of a width and a height of the current block.
[0459] Optionally, when the size of the current block is a predetermined size or is included in a predetermined range, a predetermined sample may be selected from the upper reference sample or the left reference sample of the current block, and the DC prediction may be performed using the average value of the selected sample. The predetermined size may represent a fixed size N×M predefined in the encoder / decoder. N and M are integers greater than 0, and N and M may be the same or different. The predetermined range may represent a threshold for selecting a reference sample of the current block. The threshold may be implemented as at least one of a minimum value or a maximum value. The minimum value and / or the maximum value may be a fixed value predefined in the encoder / decoder, and may be a variable value encoded in the encoder and signaled from the encoder.
[0460] As described above, DC prediction may be performed using an average value of one or more reference samples. A division using the number of reference samples may be performed to calculate the average value. When the number of reference samples is 2 n (n is a positive integer), the division can be replaced by a binary shift operation. In the case of non-square blocks, when both the upper reference sample and the left reference sample are used, the number of reference samples may not be 2. n , and in this case, the shift operation may not be used instead of the division. Therefore, as in the above embodiment, by using 2 n To find the upper reference sample points or the left reference sample points, a shift operation can be used instead of division.
[0461] In the case of the planar mode, a weighted sum considering the distances from one or more constructed reference samples may be used according to the position of the intra prediction target sample of the current block.
[0462] In the case of the directional mode, one or more reference samples existing on and near a predetermined angle line may be used at the position of the intra prediction target sample.
[0463] In the case of intra prediction mode based on position information, the reconstructed sample block generated based on the encoded / decoded or derived position information can be used as the intra prediction block of the current block. Alternatively, the decoder can retrieve and derive the reconstructed sample block to be used as the intra prediction block of the current block.
[0464] The intra prediction of the chrominance signal can be performed using the reconstructed luminance signal of the current block. In addition, the intra prediction of another chrominance signal Cr can be performed using a reconstructed chrominance signal Cb of the current block or a residual signal of Cb.
[0465] Intra-frame prediction can be performed by combining one or more prediction methods. For example, the intra-frame prediction block of the current block can be configured by a weighted sum of a block predicted using a predetermined non-directional intra-frame prediction mode and a block predicted using a predetermined directional intra-frame prediction mode. At this time, the weights can be applied differently according to at least one of the intra-frame prediction mode of the current block, the size of the block, or the position of the sample point. Optionally, in the case of a chroma block, the intra-frame prediction block of the chroma block can be configured by a weighted sum of a block predicted using a predetermined intra-frame prediction mode and a block predicted using a reconstructed signal of a luminance block. At this time, the predetermined intra-frame prediction mode can be one of a plurality of modes for deriving the intra-frame prediction mode of the chroma block. In the case of a chroma block, as described above, whether the final prediction block is configured using the weighted sum of the two prediction blocks can be signaled through encoding information.
[0466] In the directional mode, the constructed reference samples may be reconstructed based on the directional prediction mode. For example, when the directional prediction mode refers to a mode using both the left reference samples and the upper reference samples, a one-dimensional array may be constructed for the left reference samples and the upper reference samples. Alternatively, the left reference samples may be moved to construct the upper reference samples, and the upper reference samples may be constructed using a weighted sum of one or more left reference samples.
[0467] Different directional intra predictions can be performed in a predetermined sample group unit of the current block. The predetermined sample group unit can be a block, a sub-block, a line or a single sample.
[0468] According to an embodiment, cross-color component intra prediction may be performed.
[0469] Fig.21 is a diagram illustrating a cross-color component intra prediction process according to the present invention.
[0470] According to one embodiment, the cross-color component intra prediction process may include a step S2101 of reconfiguring the color component block, a step S2102 of deriving prediction parameters, and / or a step S2103 of performing cross-color component prediction. The color component may represent at least one of a luminance signal, a chrominance signal, red, green, blue, Y, Cb, or Cr. The prediction of the first color component may be performed using at least one of a second color component, a third color component, or a fourth color component. At this time, the signal of the color component used for prediction may be at least one of an original signal, a reconstructed signal, a residual signal, or a predicted signal.
[0471] When intra-frame prediction is performed for the second color component target block, at least one of the samples of the first color component corresponding block corresponding to the target block and / or the samples of the neighboring blocks of the corresponding block can be used. For example, when intra-frame prediction is performed for the chrominance component block Cb or Cr, the reconstructed luminance component block Y corresponding to the chrominance component block can be used. Alternatively, when intra-frame prediction is performed for the Cr component block, the Cb component block can be used. Alternatively, when intra-frame prediction is performed for the fourth color component block, a combination of at least one of the first color component block, the second color component block, or the third color component block corresponding to the block can be used.
[0472] Whether to perform cross-color component intra prediction may be determined based on the size and shape of the current target block or encoding parameters of a block corresponding to the prediction target block.
[0473] For example, whether to perform cross-color component intra prediction may be determined based on at least one of the size or shape of the current target block. For example, when the size of the target block is the CTU size, equal to or greater than a predetermined size, or within a predetermined size range, cross-color component intra prediction may be performed for the target block.
[0474] Optionally, when the shape of the target block is a predetermined shape, cross-color component intra prediction may be performed for the target block. The predetermined shape may be a square shape. In this case, when the target block has a rectangular shape, cross-color component intra prediction may not be performed. When the predetermined shape is a rectangular shape, the above embodiment may be implemented inversely.
[0475] 1) When the size of the current luma block CTU is less than 64, cross-color component intra prediction can be performed.
[0476] 2) In cases other than 1), in a dual tree where partition structures of a first color component block and a second color component block in one CTU are different, cross-color component intra prediction may be performed in the following case.
[0477] For example, when the width and height of the second color component block are 64, cross-color component intra prediction may be performed.
[0478] In another example, when the quadtree partition depth of the second color component block is equal to (the size of the current luminance block CTU - 6), the shape of the multi-type tree (for example, a partition tree including a binary tree and a ternary tree) is a binary tree partition in the horizontal direction, the width of the second color component current block is 64 and the height of the second color component current block is 32, cross-color component intra-frame prediction can be performed.
[0479] In another example, when the quadtree partition depth of the second color component block is greater than (the size of the current luma block CTU-6), cross-color component intra prediction may be performed.
[0480] In another example, when the quadtree partition depth of the second color component block is equal to (the size of the current luminance block CTU - 6), the shape of the multi-type tree is a binary tree partition in the horizontal direction, and the lower-level block in the binary tree partitioned block in the horizontal direction is subjected to a binary partition in the vertical direction, cross-color component intra prediction can be performed. For example, when quadtree partitioning is not performed on a 32×32 second color component block, binary tree partitioning is performed in the horizontal direction on a 32×16 lower-level block, and binary tree partitioning is performed in the vertical direction, cross-color component intra prediction can be performed.
[0481] 3) As in the embodiments of 1) to 2), even if cross-color component intra prediction is performed, cross-color component intra prediction may not be performed in the following case.
[0482] 1) When the width and height of the first color component block are 64 and the current block is partitioned into a predetermined number of sub-blocks, cross-color component intra prediction may not be performed.
[0483] 2) When the width or height of the first color component block is less than 64 and the quadtree partition depth of the first color component block is equal to (the size of the current luma block CTU - 6), cross-color component intra prediction may not be performed.
[0484] Here, the first color component block may represent a luminance block, and the second color component block may represent a chrominance block.
[0485] In another example, whether to perform cross-color component intra prediction can be determined based on the encoding parameters of at least one of the corresponding block corresponding to the prediction target block or the neighboring blocks of the corresponding block. For example, when the corresponding block is subjected to inter-frame prediction under a constrained intra prediction (CIP) environment, cross-color component intra prediction may not be performed. Alternatively, when the intra prediction mode of the corresponding block corresponds to a predetermined mode, cross-color component intra prediction can be performed. Alternatively, whether to perform cross-color component intra prediction can be determined based on at least one of the CBF information of the corresponding block and the neighboring blocks. The encoding parameters are not limited to the prediction mode of the block, and the above-mentioned various parameters that can be used for encoding / decoding can be used.
[0486] Hereinafter, the steps of reconfiguring the color component blocks will be described.
[0487] When the first color component block is used to predict the second color component block, the first color component block may be reconstructed. For example, when the color space of the image is YCbCr and the ratio between the color components is one of 4:4:4, 4:2:2, and 4:2:0, the size of the blocks between the color components may be different. Therefore, when the second color component block is predicted using the first color component block having different sizes, the first color component block may be reconstructed so that the sizes of the two blocks are equal. At this time, the reconstructed block may include at least one of the samples of the corresponding block of the first color component or the samples of the adjacent block.
[0488] In the above step of configuring the reference samples, an indicator corresponding to a predetermined line among the plurality of reference sample lines may be signaled. At this time, in the reconfiguration process, reconfiguration may be performed using the predetermined line corresponding to the signaled indicator.
[0489] For example, when the indicator (eg, mrl_idx) is 3, reconfiguration may be performed using a fourth reference sample line adjacent to the first color component corresponding block. At this time, when reconfiguration is performed using two or more reference sample lines, a third reference sample line may be additionally used.
[0490] In another example, when the indicator is 1, reconfiguration may be performed using a second reference sample line adjacent to the first color component corresponding block.
[0491] A reference sample line not indicated by the indicator may not be used in the reconfiguration method. For example, when the indicator indicates one of the first reference sample line, the second reference sample line, and the fourth reference sample line, the third reference sample line may not be used in the reconfiguration process. That is, when performing intra prediction, samples corresponding to the third reference sample line may not be accessed and retrieved from the memory.
[0492] When the partition structures of the first color component block and the second color component block are the same, a method using an indicator in the reconfiguration process may be used. For example, when the first color component block and the second color component block in one CTU have a single tree partition structure, an indicator-based reconfiguration process may be performed.
[0493] When at least one of the boundary of the second color component target block or the boundary of the corresponding first color component corresponding block corresponds to the boundary of the predetermined area, the reconfiguration process may be performed by selecting reference samples for reconfiguration differently. At this time, the number of upper reference sample lines and the number of left reference sample lines may be different from each other. For example, the predetermined area may be at least one of a picture, a slice, a tile, a CTU, or a CU.
[0494] For example, when an upper boundary of the first color component corresponding block corresponds to a boundary of a predetermined area, reconfiguration may be performed using only left reference samples without using upper reference samples.
[0495] In another example, when the left boundary of the first color component corresponding block corresponds to the boundary of the predetermined area, reconfiguration may be performed using only the upper reference samples without using the left reference samples.
[0496] In another example, N upper reference sample point lines and M left reference sample point lines may be used. In this case, N may be less than M. For example, when the upper boundary corresponds to the boundary of the predetermined area, N may be 1, and when the left boundary corresponds to the boundary of the predetermined area, M may be 1.
[0497] Optionally, regardless of whether it corresponds to the boundary of the predetermined area, the reconfiguration may be performed using the N upper reference sample lines and / or the M left reference sample lines of the corresponding block of the first color component.
[0498] In the following, the steps of deriving prediction parameters will be described.
[0499] The prediction parameter may be derived using at least one of the reference samples of the reconstructed first color component corresponding block or the reference samples of the second color component prediction target block. Hereinafter, the first color component and the first color component block may represent the reconstructed first color component and the reconstructed first color component block, respectively.
[0500] For example, the prediction parameters may be derived by adaptively using the reconstructed reference samples of the first color component based on the intra prediction mode of the block corresponding to the first color component. At this time, the reference samples of the second color component may also be adaptively used based on the intra prediction mode of the block corresponding to the first color component.
[0501] Hereinafter, steps of performing cross-color component prediction will be described.
[0502] As described above, when the prediction parameters are derived, cross-color component intra prediction may be performed using at least one of the derived prediction parameters.
[0503] The cross-color component prediction method can be applied to the inter-frame prediction mode.
[0504] When the encoding mode of the first color component is an inter mode, cross-color component prediction may be performed for the second color component. For example, when performing inter prediction of the current block, inter prediction may be performed for the first color component, and cross-color component prediction may be performed for the second color component. For example, the first color component may be a luma component, and the second color component may be a chroma component.
[0505] Cross-color component prediction may be performed using prediction samples or reconstructed samples of the luma component. For example, after performing inter-frame prediction on the luma component, prediction may be performed on the chroma component by applying cross-color component prediction parameters to the prediction samples. At this time, the prediction samples may represent samples that have undergone at least one of motion compensation, motion correction, overlapped block motion compensation (OBMC), or bidirectional optical flow (BIO).
[0506] Cross-color component prediction can be adaptively performed according to the encoding parameters of the first color component. For example, whether to perform cross-color component prediction can be determined according to the CBF information of the first color component. The CBF information can indicate whether there is a residual signal. That is, when the CBF of the first color component is 1, cross-color component prediction can be performed for the second color component. In addition, when the CBF of the first color component is 0, inter-frame prediction can be performed for the second color component without performing cross-color component prediction.
[0507] A flag indicating whether to perform cross-color component prediction may be sent by a signal. For example, the flag may be sent by a signal in units of CU or PU.
[0508] When the encoding parameter of the first color component satisfies a predetermined condition, a flag indicating whether to perform cross-color component prediction may be sent with a signal. For example, when the CBF of the first color component is 1, the flag may be sent with a signal to determine whether to perform cross-color component prediction.
[0509] When performing cross-color component prediction for the second color component, the inter-frame motion prediction or compensation value of the second color component may be used. For example, the inter-frame motion prediction or compensation of the second color component may be performed using the inter-frame prediction information of the first color component, and the prediction may be performed via a weighted sum of the inter-frame motion compensation value of the second color component and the cross-color component prediction value.
[0510] Alternatively, when the inter prediction mode of the current block is a merge mode, prediction of the second color component of the current block may be performed by weighting a value predicted using motion information corresponding to a merge index and a value predicted by performing cross-color component prediction. At this time, the first color component block used to perform cross-color component prediction may be at least one of values predicted or reconstructed by performing inter prediction (e.g., merge mode). The weight of the weighted sum may be 1:1.
[0511] Filtering may be applied to prediction samples generated by performing intra prediction.
[0512] The filtering applied to the prediction samples may be performed based on at least one of the intra prediction mode of the current block, the size / shape of the current block, a reference sample line, or inter and intra combined prediction (e.g., inter_intra_flag). For example, when at least one of the intra prediction mode or the size / shape of the current block satisfies a predetermined condition, it may be determined whether to apply a filter or a filter type. The filter type may be at least one of a filter tap, a filter coefficient, or a filter shape.
[0513] For example, when the intra prediction mode of the current block corresponds to at least one of the DC mode, the planar mode, or the predetermined direction mode, filtering is applied to the prediction sample. The predetermined direction mode may be at least one of the vertical mode (mode 2) to mode 66. Alternatively, the predetermined direction mode may be a mode less than or equal to mode 18 and a mode greater than or equal to mode 50. In addition, when the intra prediction mode corresponds to at least one of mode-1 to mode-10 or mode 67 to mode 76, filtering may not be applied to the prediction sample.
[0514] In another example, the number of filter taps may vary depending on the intra prediction mode. When the intra prediction mode is DC mode, a 4-tap filter is applicable. When the intra prediction mode corresponds to at least one of a plane mode, a horizontal mode, a vertical mode, or a diagonal mode, a 3-tap filter is applicable. When the intra prediction mode corresponds to a predetermined direction mode, a 2-tap filter is applicable. The number of filter taps can be changed by setting one or more filter coefficients to 0.
[0515] In another example, when the intra prediction mode of the current block is a predetermined direction mode, a filter having a fixed number of filter taps is applicable. That is, the number of filter taps may not be changed regardless of the x or y coordinates of the prediction sample points to which filtering is applied included in the current block. For example, when the intra prediction mode of the current block is at least one of a mode less than mode 18 or a mode greater than mode 50, a filter having a fixed number of filter taps is applicable. The number may be 2.
[0516] In this case, the operation of determining whether each predetermined value derived based on the position of the prediction sample point to which filtering is applied is within a predetermined range may not be performed. In addition, the operation of changing the number of filter taps based on the operation of determining whether the predetermined value is within a predetermined range may not be performed.
[0517] In another example, filtering is applicable to the prediction samples when the size / shape of the current block satisfies a predetermined condition. For example, filtering is applicable when the width is less than 64 and the height is less than 64. Optionally, filtering is applicable when the average of the logarithmic value of the width and the logarithmic value of the height is less than 6. Optionally, filtering is applicable when the width is equal to or greater than 4 and the height is equal to or greater than 4, or when the current block is not a luminance block.
[0518] In another example, when the shape of the current block is a rectangular shape (e.g., the width and the height are different), whether to apply filtering to the prediction sample may be determined based on a comparison between the width and the height and the aspect ratio. When the shape of the current block is a rectangular shape and the intra prediction mode corresponds to a predetermined mode, filtering may not be applied. For example, when the width is twice the height and the intra prediction mode corresponds to at least one of modes 2 to 7, filtering may not be applied.
[0519] In another example, the number of lines of prediction samples to which the filter is applied may vary according to at least one of an intra prediction mode or a size / shape of the block. The line of prediction samples may represent a prediction sample line adjacent to a reference sample. For example, when the size of the block is less than a predetermined size, the filter is applied to N prediction sample lines, and when the size of the block is greater than a predetermined size, the filter is applied to M lines. For example, when the size of the current block is 32×32, the filter may be applied to six prediction sample lines, and when the size of the current block is 4×4, the filter may be applied to three prediction sample lines. The number of prediction sample lines may differ between the horizontal direction and the vertical direction.
[0520] In another example, filtering may be applied to the prediction samples based on the reference sample line used for prediction. For example, when the reference sample used to perform prediction corresponds to the first reference sample line (e.g., mrl_idx=0) or when the current block is not a luma block, filtering of the prediction samples may be performed based on the intra prediction mode of the current block and the size / shape of the block. In addition, when the reference sample used for prediction corresponds to at least one of the second to fourth reference sample lines (e.g., mrl_idx!=0), filtering of the prediction samples may not be performed.
[0521] In another example, when prediction is performed by combining inter prediction and intra prediction (e.g., inter_intra_flag=1), filtering may not be applied to intra prediction samples. Since combined prediction is performed by applying weights to inter prediction values and intra prediction values, complexity can be reduced and prediction efficiency can be improved by not applying filtering to intra prediction samples.
[0522] The above embodiments may be performed in the same way in an encoder and a decoder.
[0523] At least one or a combination of the above embodiments may be used to encode / decode a video.
[0524] The order applied to the above embodiments may be different between the encoder and the decoder, or the order applied to the above embodiments may be the same in the encoder and the decoder.
[0525] The above embodiments may be performed on each of the luminance signal and the chrominance signal, or may be performed identically on the luminance and chrominance signals.
[0526] The block form to which the above embodiment of the present invention is applied may have a square form or a non-square form.
[0527] The above embodiments of the present invention may be applied according to the size of at least one of a coding block, a prediction block, a transform block, a block, a current block, a coding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as a minimum size or a maximum size or both a minimum size and a maximum size, so that the above embodiments are applied, or may be defined as a fixed size to which the above embodiments are applied. In addition, in the above embodiments, the first embodiment may be applied to a first size, and the second embodiment may be applied to a second size. In other words, the above embodiments may be applied according to size combinations. In addition, the above embodiments may be applied when the size is equal to or greater than the minimum size and equal to or less than the maximum size. In other words, the above embodiments may be applied when the block size is included in a specific range.
[0528] For example, when the size of the current block is 8×8 or larger, the above embodiment may be applied. For example, when the size of the current block is only 4×4, the above embodiment may be applied. For example, when the size of the current block is 16×16 or smaller, the above embodiment may be applied. For example, when the size of the current block is equal to or larger than 16×16 and equal to or smaller than 64×64, the above embodiment may be applied.
[0529] The above embodiments of the present invention may be applied in accordance with time layers. In order to identify the time layers to which the above embodiments may be applied, a corresponding identifier may be signaled, and the above embodiments may be applied to the specified time layers identified by the corresponding identifiers. Here, the identifier may be defined as the lowest layer or the highest layer or both the lowest layer and the highest layer to which the above embodiments may be applied, or may be defined as a specific layer indicating the application of the embodiments. In addition, a fixed time layer to which the embodiments may be applied may be defined.
[0530] For example, when the temporal layer of the current image is the lowest layer, the above embodiment can be applied. For example, when the temporal layer identifier of the current image is 1, the above embodiment can be applied. For example, when the temporal layer of the current image is the highest layer, the above embodiment can be applied.
[0531] A slice type or a tile group type to which the above embodiments of the present invention are applied may be defined, and the above embodiments may be applied depending on the corresponding slice type or tile group type.
[0532] In the above embodiments, the method is described based on a flowchart having a series of steps or units, but the present invention is not limited to the order of the steps, but some steps can be performed simultaneously with other steps or in a different order. In addition, it should be understood by those skilled in the art that the steps in the flowchart are not mutually exclusive, and other steps can be added to the flowchart, or some steps can be deleted from the flowchart without affecting the scope of the present invention.
[0533] The embodiments include various aspects of the examples. All possible combinations for various aspects may not be described, but those skilled in the art will be able to recognize different combinations. Therefore, the present invention may include all substitutions, modifications and changes within the scope of the claims.
[0534] Embodiments of the present invention may be implemented in the form of program instructions that can be executed by various computer components and recorded in a computer-readable recording medium. A computer-readable recording medium may include independent program instructions, data files, data structures, etc., or a combination of program instructions, data files, data structures, etc. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention, or known to a person of ordinary skill in the field of computer software technology. Examples of computer-readable recording media include: magnetic recording media (such as hard disks, floppy disks, and magnetic tapes); optical data storage media (such as CD-ROMs or DVD-ROMs); magnetically optimized media (such as optical floppy disks); and hardware devices (such as read-only memory (ROM), random access memory (RAM), flash memory, etc.) that are specially constructed to store and implement program instructions. Examples of program instructions include not only machine language codes formatted by a compiler, but also high-level language codes that can be implemented by a computer using an interpreter. A hardware device may be configured to be operated by one or more software modules to perform processing according to the present invention, or vice versa.
[0535] Although the present invention has been described according to specific items such as detailed elements and limited embodiments and drawings, they are only provided to help a more comprehensive understanding of the present invention, and the present invention is not limited to the above embodiments. It should be understood by those skilled in the art that various modifications and changes can be made based on the above description.
[0536] Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents will fall within the scope and spirit of the present invention.
[0537] Industrial Applicability
[0538] The present invention can be used to encode or decode images.
Claims
1. A method for decoding an image, the method comprising: Obtaining from the bitstream a flag indicating whether the intra prediction mode of the current block is not a planar mode; Derivation of an intra prediction mode of the current block based on the flag; generating reference samples of the current block; as well as predicting the current block based on the intra prediction mode of the current block and the reference sample, wherein, in response to the flag indicating that the intra prediction mode of the current block is not a planar mode, the intra prediction mode of the current block is derived based on a most probable mode MPM list, wherein, in response to the flag indicating that the intra prediction mode of the current block is a planar mode, the intra prediction mode of the current block is derived as a planar mode without deriving the MPM list, The MPM list is derived based on a comparison between the first intra prediction mode candidate and the second intra prediction mode candidate, The first intra-frame prediction mode candidate is derived based on the left intra-frame prediction mode of the left neighboring block of the current block, The second intra-frame prediction mode candidate is derived based on the upper intra-frame prediction mode of the upper neighboring block of the current block, The number of intra prediction mode candidates in the MPM list is fixed to 5. wherein, in response to the first intra prediction mode candidate being equal to the second intra prediction mode candidate and the index value of the first intra prediction mode candidate and the index value of the second intra prediction mode candidate being less than or equal to 1, the MPM list includes a DC mode, a vertical direction mode, a horizontal direction mode, an intra prediction mode with an index of 46, and an intra prediction mode with an index of 54, and The current block is obtained by dividing the coding tree block using a quadtree partitioning method.
2. The method of claim 1, wherein: The current block is partitioned into a predetermined number of sub-blocks based on at least one of a size and a shape of the current block.
3. A method for encoding an image, the method comprising: determining whether the intra prediction mode of the current block is not a planar mode; Determining the intra prediction mode of the current block based on whether the intra prediction mode of the current block is not a planar mode; generating reference samples of the current block; and Predicting the current block based on the intra prediction mode and the reference sample, wherein a flag indicating whether the intra prediction mode of the current block is not a planar mode is encoded into the bitstream, In which, in response to the intra prediction mode of the current block not being a planar mode, the intra prediction mode of the current block is derived based on a most probable mode MPM list, wherein, in response to the intra prediction mode of the current block being a plane mode, the intra prediction mode of the current block is derived as a plane mode without deriving the MPM list, The MPM list is derived based on a comparison between the first intra prediction mode candidate and the second intra prediction mode candidate, The first intra-frame prediction mode candidate is derived based on the left intra-frame prediction mode of the left neighboring block of the current block, The second intra-frame prediction mode candidate is derived based on the upper intra-frame prediction mode of the upper neighboring block of the current block, The number of intra prediction mode candidates in the MPM list is fixed to 5. wherein, in response to the first intra prediction mode candidate being equal to the second intra prediction mode candidate and the index value of the first intra prediction mode candidate and the index value of the second intra prediction mode candidate being less than or equal to 1, the MPM list includes a DC mode, a vertical direction mode, a horizontal direction mode, an intra prediction mode with an index of 46, and an intra prediction mode with an index of 54, and The current block is obtained by dividing the coding tree block using a quadtree partitioning method.
4. A non-transitory computer-readable recording medium storing a bit stream generated by an encoding device through an image encoding method, the method comprising: determining whether the intra prediction mode of the current block is not a planar mode; Determining the intra prediction mode of the current block based on whether the intra prediction mode of the current block is not a planar mode; generating reference samples of the current block; and Predicting the current block based on the intra prediction mode and the reference sample, wherein a flag indicating whether the intra prediction mode of the current block is not a planar mode is encoded into the bitstream, In which, in response to the intra prediction mode of the current block not being a planar mode, the intra prediction mode of the current block is derived based on a most probable mode MPM list, wherein, in response to the intra prediction mode of the current block being a plane mode, the intra prediction mode of the current block is derived as a plane mode without deriving the MPM list, The MPM list is derived based on a comparison between the first intra prediction mode candidate and the second intra prediction mode candidate, The first intra-frame prediction mode candidate is derived based on the left intra-frame prediction mode of the left neighboring block of the current block, The second intra-frame prediction mode candidate is derived based on the upper intra-frame prediction mode of the upper neighboring block of the current block, The number of intra prediction mode candidates in the MPM list is fixed to 5. wherein, in response to the first intra prediction mode candidate being equal to the second intra prediction mode candidate and the index value of the first intra prediction mode candidate and the index value of the second intra prediction mode candidate being less than or equal to 1, the MPM list includes a DC mode, a vertical direction mode, a horizontal direction mode, an intra prediction mode with an index of 46, and an intra prediction mode with an index of 54, and The current block is obtained by dividing the coding tree block using a quadtree partitioning method.
