Video encoding / decoding method and apparatus, and recording medium storing bit stream
By selecting interpolation filters for image encoding/decoding, the problem of increased data volume in high-definition and ultra-high-definition images is solved, encoding/decoding efficiency is improved, and transmission and storage costs are reduced.
Patent Information
- Application Number
- CN202410791147.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-06-18
- Filing Date
- 2020-06-08
- Publication Date
- 2024-10-15
AI Technical Summary
With the improvement of high-definition and ultra-high-definition image resolution and quality, the amount of image data has increased, leading to higher transmission and storage costs, and existing video encoding/decoding technologies are not efficient enough.
The image is encoded/decoded by selecting an interpolation filter, a prediction block is generated using the prediction information, and a prediction block for the current block is generated by the interpolation filter. Different interpolation filters are selected to improve encoding/decoding efficiency.
It improves the efficiency of image encoding/decoding, reduces the amount of data, and thus lowers transmission and storage costs.
Smart Images

Figure CN118784871A_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with an application date of June 8, 2020, application number 202080036953.7, and invention name “Video encoding / decoding method and device and recording medium for storing bit stream”. Technical Field
[0002] The present invention relates to an image encoding / decoding method and apparatus, and a recording medium for storing a bit stream. More specifically, the present invention relates to an image encoding / decoding method and apparatus for selecting an interpolation filter, and a recording medium for storing a bit stream. 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 that predict the values of pixels in a current picture from the values of pixels in a previous picture or a subsequent picture, intra-frame prediction techniques that predict the values of pixels in an area of the current picture from the values of pixels in another area of the current picture, transformation and quantization techniques for compressing the energy of residual signals, and entropy coding techniques that assign shorter codes to frequently occurring pixel values and longer codes to less frequently occurring pixel values. Summary of the invention
[0005] Technical issues
[0006] The present disclosure is to provide a video encoding / decoding method and apparatus with improved encoding / decoding efficiency.
[0007] The present disclosure is to provide a method and apparatus for encoding / decoding an image by selecting an interpolation filter.
[0008] The present disclosure provides a recording medium storing a bit stream generated by an image decoding method or apparatus according to the present disclosure.
[0009] Technical Solution
[0010] According to an aspect of the present disclosure, an image decoding method includes: obtaining prediction information of a current block from a bitstream; and generating a prediction block of the current block by performing prediction based on the prediction information, wherein the prediction information includes partition prediction information of the current block, wherein the step of generating the prediction block includes: obtaining reference samples from neighboring blocks of the current block; applying an interpolation filter to the reference samples; and generating the prediction block by using the reference samples to which the interpolation filter is applied, and wherein the interpolation filter is determined based on the partition prediction information of the current block.
[0011] According to an embodiment, the interpolation filter is determined to be one of two interpolation filters that are different from each other.
[0012] According to an embodiment, the partition prediction information of the current block includes information on whether to perform partition prediction of the current block and a partition direction of the current block.
[0013] According to an embodiment, the partition direction of the current block is a vertical direction or a horizontal direction.
[0014] According to an embodiment, the prediction information includes information about a plurality of reference sample lines, and the interpolation filter is determined based on the information about the plurality of reference sample lines.
[0015] According to an embodiment, the prediction information includes matrix-based intra prediction mode information of the neighboring block for the current block, and when matrix-based intra prediction is performed on the neighboring block, the intra prediction mode of the neighboring block is considered to be a planar mode.
[0016] According to an embodiment, the neighboring block is a block located at a lower left or upper right of the current block.
[0017] According to an embodiment, when the intra prediction mode of the luminance block of the current block is a matrix-based intra prediction mode, the intra prediction mode of the chrominance block of the current block is derived as a planar mode.
[0018] According to an embodiment, the prediction information includes residual signal prediction information of the current block, and the intra prediction mode of the current block is determined based on the residual signal prediction information.
[0019] According to an embodiment, the intra prediction mode of the current block is determined as one of a horizontal prediction mode and a vertical prediction mode based on the residual signal prediction information.
[0020] According to another aspect of the present disclosure, an image encoding method includes: determining a prediction mode of a current block; generating a prediction block of the current block by performing prediction based on the prediction mode of the current block; and encoding prediction information of the current block including the prediction mode of the current block, wherein the prediction information includes partition prediction information of the current block, wherein the step of generating the prediction block includes: obtaining reference samples from neighboring blocks of the current block; applying an interpolation filter to the reference samples; and generating the prediction block by using the reference samples to which the interpolation filter is applied, and wherein the interpolation filter is determined based on the partition prediction information of the current block.
[0021] According to an embodiment, the interpolation filter is determined to be one of two interpolation filters that are different from each other.
[0022] According to an embodiment, the partition prediction information of the current block includes information on whether to perform partition prediction of the current block and a partition direction of the current block.
[0023] According to an embodiment, the prediction information includes information about a plurality of reference sample lines, and the interpolation filter is determined based on the information about the plurality of reference sample lines.
[0024] According to an embodiment, the prediction information includes matrix-based intra prediction mode information of the neighboring block for the current block, and when matrix-based intra prediction is performed on the neighboring block, the intra prediction mode of the neighboring block is considered to be a planar mode.
[0025] According to an embodiment, the neighboring block is a block located at a lower left or upper right of the current block.
[0026] According to an embodiment, when the intra prediction mode of the luminance block of the current block is a matrix-based intra prediction mode, the intra prediction mode of the chrominance block of the current block is derived as a planar mode.
[0027] According to an embodiment, the prediction information includes residual signal prediction information of the current block, and the intra prediction mode of the current block is determined based on the residual signal prediction information.
[0028] According to an embodiment, the intra prediction mode of the current block is determined as one of a horizontal prediction mode and a vertical prediction mode based on the residual signal prediction information.
[0029] A non-transitory computer-readable recording medium is configured to store a bit stream generated by an image encoding method according to another aspect of the present disclosure, wherein the image encoding method includes: determining a prediction mode of a current block; generating a prediction block of the current block by performing prediction based on the prediction mode of the current block; and encoding prediction information of the current block including the prediction mode of the current block, wherein the prediction information includes partition prediction information of the current block, wherein the step of generating the prediction block includes: obtaining reference samples from neighboring blocks of the current block; applying an interpolation filter to the reference samples; and generating the prediction block by using the reference samples to which the interpolation filter is applied, and wherein the interpolation filter is determined based on the partition prediction information of the current block.
[0030] Beneficial Effects
[0031] According to the present disclosure, there is thus provided an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.
[0032] Furthermore, according to the present disclosure, a method and apparatus for encoding / decoding an image by selecting an interpolation filter are provided.
[0033] Furthermore, according to the present disclosure, there is provided a recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure.
[0034] In addition, according to the present disclosure, there is provided a recording medium storing a bit stream received and decoded by the image decoding apparatus according to the present disclosure and used for image restoration. 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 the configuration of a decoding device according to an embodiment and 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 7is a diagram showing reference samples that can be used for intra prediction.
[0042] Figure 8 FIG. 1 is a diagram for explaining an intra prediction process according to an embodiment of the present invention.
[0043] Fig. 9 A diagram for explaining the relationship between a luminance block and a chrominance block.
[0044] Fig.10 is a diagram for explaining intra prediction modes of neighboring blocks used to derive an intra prediction mode of a current block according to an exemplary embodiment of the present invention.
[0045] Fig.11 is a diagram for explaining an embodiment of DC prediction according to the size and / or shape of a current block according to an embodiment of the present invention.
[0046] Fig.12 is a diagram for explaining a process of performing intra prediction between color components according to an embodiment of the present invention.
[0047] Fig.13 2 is a diagram for explaining an example of sample point line unit prediction according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] 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 that illustrate specific embodiments of the present invention in a graphical manner. 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 characteristics 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 (when properly interpreted, together with the full range of equivalents claimed by the claims).
[0049] 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, a "first" component may be named a "second" component, and a "second" component may also be similarly named a "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.
[0050] 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.
[0051] 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 component in 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.
[0052] 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 element, but may include other elements in an embodiment of the present invention or in the scope of the present invention.
[0053] In addition, some components may not be essential components for performing the basic functions of the present invention, but rather selective components that only improve its performance. The present invention may be implemented by including only essential components for implementing the essence of the present invention without including components for improving performance. Structures that include only essential components without including selective components that only improve performance are also included within the scope of the present invention.
[0054] 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.
[0055] 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".
[0056] Hereinafter, the terms "motion picture" and "video" may be used as the same meaning and may be replaced with each other.
[0057] 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 image.
[0058] Hereinafter, the terms "image", "picture", "frame" and "screen" may be used as the same meaning and may be replaced with each other.
[0059] 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.
[0060] 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.
[0061] In the following, the terms "region" and "segment" are used interchangeably.
[0062] 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.
[0063] 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.
[0064] 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 may be counted from 1.
[0065] Description of terms
[0066] Encoder: This refers to a device that performs encoding. In other words, it refers to an encoding device.
[0067] Decoder: Refers to a device that performs decoding. In other words, it refers to a decoding device.
[0068] Block: is an M×N sample array. Here, M and N may represent positive integers, and a block may represent a sample array 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 at the time of encoding, or a decoding target block that becomes a target at the time of 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.
[0069] Sample: It is the basic unit of a block. d ), the sample point 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.
[0070] 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. According to 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. Also, 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.
[0071] 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.
[0072] 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, the information indicating the partition 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 can be applied to the binary tree partition or the ternary tree partition in the same manner.
[0073] 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.
[0074] 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.
[0075] 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 image or a neighboring block of the block.
[0076] 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 once. 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.
[0077] Bitstream: can represent a stream of bits including coded image information.
[0078] 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.
[0079] 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 bricks. In addition, information in the adaptation parameter set may be used by referring to different adaptation parameter sets for sub-pictures, slices, tile groups, tiles, or bricks within a picture.
[0080] Furthermore, 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.
[0081] Furthermore, regarding 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.
[0082] Furthermore, regarding 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.
[0083] Furthermore, 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.
[0084] 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.
[0085] Information about the adaptation parameter set identifier may be included in a parameter set or a header of a tile, and an adaptation parameter set corresponding to the adaptation parameter set identifier may be used for the tile.
[0086] 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.
[0087] A picture may be partitioned into one or more tile rows and one or more tile columns.
[0088] 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 a sub-picture.
[0089] 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.
[0090] A partition may represent one or more CTU rows within a tile. A tile may be partitioned into one or more partitions, and each partition may have at least one or more CTU rows. A tile that is not partitioned into two or more may represent a partition.
[0091] A slice may include one or more tiles within a picture, and may include one or more partitions within a tile.
[0092] Parsing: may mean determining the value of a syntax element by performing entropy decoding, or may mean the entropy decoding itself.
[0093] 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.
[0094] Prediction mode: may be information indicating a mode for encoding / decoding using intra prediction or a mode for encoding / decoding using inter prediction.
[0095] 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.
[0096] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.
[0097] 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 available reference picture lists, including LC (List Combination), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3).
[0098] 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.
[0099] 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.
[0100] The reference picture index may refer to an index indicating a specific reference picture in a reference picture list.
[0101] 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 image" have the same meaning and are interchangeable.
[0102] 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 coding / decoding target block 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.
[0103] 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.
[0104] The motion vector candidate may refer to a prediction candidate block or a motion vector of the prediction candidate block when predicting a motion vector. In addition, the motion vector candidate may be included in a motion vector candidate list.
[0105] The motion vector candidate list may mean a list consisting of one or more motion vector candidates.
[0106] 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.
[0107] The motion information may represent information including at least one of items including a motion vector, a reference picture index, an inter-frame 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.
[0108] The merge candidate list may mean a list consisting of one or more merge candidates.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] Quantization parameter: may indicate a value used when a transform coefficient is used to generate a quantized level during quantization. The quantization parameter may also indicate 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 to a quantization step size.
[0114] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.
[0115] Scan: may 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 may be called scanning, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix may be called scanning or inverse scanning.
[0116] Transform coefficient: may refer to a coefficient value generated after performing a transform in an encoder. 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.
[0117] 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.
[0118] 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.
[0119] 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.
[0120] Quantization matrix coefficients: can represent each element in the quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.
[0121] Default matrix: may represent a predetermined quantization matrix predefined in an encoder or a decoder.
[0122] Non-default matrix: may denote a quantization matrix that is not predefined in the encoder or decoder but is signaled by the user.
[0123] 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.
[0124] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0125] 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.
[0126] 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.
[0127] 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 a current image as a current encoding target. The input block may be referred to as a current block as a current encoding target, or may be referred to as an encoding target block.
[0128] 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.
[0129] When the prediction mode is the inter mode, the motion prediction unit 111 may retrieve the area that best matches the input block from the reference image when performing motion prediction, and derive a motion vector by using the retrieved area. In this case, the search area may be used as the area. The reference image may be stored in the reference picture buffer 190. Here, when encoding / decoding the reference image is performed, the reference image may be stored in the reference picture buffer 190.
[0130] The motion compensation unit 112 may generate a predicted 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.
[0131] 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 according to the determined mode.
[0132] 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.
[0133] 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.
[0134] The quantized level may be generated by applying quantization to a transform coefficient or to a residual signal. Hereinafter, the quantized level may also be referred to as a transform coefficient in an embodiment.
[0135] 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.
[0136] The entropy encoding unit 150 may generate a bitstream 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 bitstream. 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.
[0137] When entropy coding is applied, symbols are represented so that a smaller number of bits are allocated to symbols with a high probability of generation, and a larger number of bits are allocated to symbols with a low probability of generation, and therefore, the size of the bitstream 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, probability model, and context model.
[0138] In order to encode a transform coefficient level (quantized level), the entropy encoding unit 150 may change a coefficient in a two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.
[0139] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and sent to the decoder by signaling, 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, and the type of multi-type tree partitioning. direction (horizontal or vertical), type of multi-type tree partition (symmetric or asymmetric), 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 filtering method, reference sample filter taps, reference sample filter coefficients, prediction block filtering method, prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, 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 primary (first) transform is used, information on whether 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 sample, reconstructed chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, motion vector search area at decoder side domain size, shape of a motion vector search area at a decoder side, number of motion vector searches at a decoder side, information on a CTU size, information on a minimum block size, information on a maximum block size, information on a maximum block depth, information on 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 on a luminance signal or information on a chrominance signal.
[0140] 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.
[0141] When the encoding apparatus 100 performs encoding by inter-frame prediction, the encoded current image may be used as a reference image for another image that is subsequently processed. Therefore, the encoding apparatus 100 may reconstruct or decode the encoded current image, or store the reconstructed or decoded image as a reference image in the reference picture buffer 190.
[0142] 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. By adding the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient to the prediction block, a reconstructed block may be generated. 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.
[0143] 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.
[0144] 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, different filters can be applied according to the required deblocking filter strength.
[0145] 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.
[0146] 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.
[0147] 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 the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 180. The stored reference image may be used later in inter-frame prediction or motion compensation.
[0148] 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.
[0149] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0150] 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.
[0151] 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 mode or an inter 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.
[0152] 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.
[0153] 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 that becomes 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.
[0154] 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.
[0155] 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.
[0156] 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.
[0157] 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 a block that is adjacent to the decoding target block and has been decoded.
[0158] 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 image stored in the reference picture buffer 270 .
[0159] The adder 255 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 the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference image can be used later in inter-frame prediction or motion compensation.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] The partition structure may represent the distribution of coding units (CUs) within the LCU 310. Such distribution may be determined according to whether a single CU is partitioned into multiple (including 2, 4, 8, 16, etc., positive integers equal to or greater than 2) 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, respectively, according to the number of partitioning. The CU may be recursively partitioned into multiple 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 predefined depth or a predefined size. For example, the depth of the LCU may be 0, and the depth of the minimum coding unit (SCU) may be a predefined 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 the 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. In addition, 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.
[0164] 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.
[0165] 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.
[0166] 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 size of 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.
[0167] 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 of size 32×32 is partitioned vertically 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 of size 8×32 is partitioned horizontally 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 according to a binary tree partition structure.
[0168] 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.
[0169] 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.
[0170] 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 coding units obtained from binary tree partitions or ternary tree partitions of coding units corresponding to leaf nodes of a quadtree from undergoing further quadtree partitions, block partitioning operations and / or operations of signaling partition information may be effectively performed.
[0171] 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).
[0172] 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.
[0173] 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.
[0174] 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.
[0175] 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.
[0176] 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 node 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.
[0177] The partition indication information, the partition tree information and the partition direction information may all be flags having a predetermined length (eg, one bit).
[0178] 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.
[0179] 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.
[0180] 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.
[0181] 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 partitioning of the coding unit for transforming is not separately signaled, and the partitioning 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.
[0182] 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 block 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.
[0183] 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 the intra-picture slice and the inter-picture slice.
[0184] 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 according to 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.
[0185] 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.
[0186] According to 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.
[0187] 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. It can be inferred that the quad partition information is the second value.
[0188] 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 into two or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but the multi-type tree partition indication information may be inferred to be the second value.
[0189] 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 the multi-type tree partition indication information may be derived as a second value. This is because when the coding unit is partitioned according to 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.
[0190] 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.
[0191] - N×M (N and / or M is 128) ternary tree partitions for coding units
[0192] - 128×N (N<=64) binary tree partitions in the horizontal direction for coding units
[0193] - N×128 (N<=64) binary tree partitions in the vertical direction for coding units
[0194] 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 to be the second value.
[0195] 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 the multi-type tree partition indication information may be inferred to be a second value.
[0196] Optionally, 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 the coding unit corresponding to the node of the multi-type tree, the partition direction information can be sent by signal. Otherwise, the partition direction information may not be sent by signal, but the partition direction information may be derived as a value indicating a possible partition direction.
[0197] Optionally, 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, partition tree information may be signaled. Otherwise, partition tree information may not be signaled, but may be derived as a value indicating a possible partition tree structure.
[0198] Figure 4 is a diagram illustrating an intra prediction process.
[0199] Figure 4 The arrows from the center to the outside in FIG. 1 represent the prediction direction of the intra prediction mode.
[0200] 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.
[0201] 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.
[0202] 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.
[0203] 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.
[0204] 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 by both copying and interpolating, 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.
[0205] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0206] 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 samples of fragment A and fragment F can be filled with the samples of the closest fragment B and fragment E, respectively, instead of retrieving from the reconstructed neighboring blocks. The index information indicating the reference sample line to be used for intra prediction of the current block can be sent by signaling. For example, in Figure 7 In the example, reference sample line indicators 0, 1, and 2 may be signaled as index information indicating reference sample lines 0, 1, and 2. When the upper boundary of the current block is the boundary of the CTU, only reference sample line 0 may be available. Therefore, in this case, index information may not be signaled. When reference sample lines other than reference sample line 0 are used, filtering for a prediction block to be described later may not be performed.
[0207] When intra prediction is performed, a filter may be applied to at least one of a reference sample and a prediction sample based on at least one of an intra prediction mode and a current block size.
[0208] In the case of the planar mode, when generating the 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 block 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.
[0209] 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 the upper and / or left neighboring samples of the current block and the upper and / or left neighboring samples of the 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 the parameters of the linear model. When deriving the parameters of the linear model, 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, sub-sampling 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 sub-sampled 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 sub-sampled samples. Whether to perform intra prediction between color components and / or the range of the template may be signaled as an intra prediction mode.
[0210] 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 a subsequent 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 sent by a signal. Intra prediction based on sub-blocks may be performed 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.
[0211] The final prediction block may be generated by performing filtering on the prediction block predicted by the intra-frame. The filtering may be performed by applying a predetermined weight to the filtering target sample, the left reference sample, the upper reference sample, and / or the upper left reference sample. The weight and / or reference sample (range, position, etc.) used for filtering may be determined based on at least one of the block size, the intra-frame prediction mode, and the position of the filtering target sample in the prediction block. The filtering may 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 may be a mode in which k is added to the diagonal mode or subtracted from the diagonal mode. For example, k may be a positive integer of 8 or less.
[0212] The intra-frame prediction mode of the current block may be entropy encoded / decoded by predicting the intra-frame prediction mode of a block existing adjacent to the current block. When the intra-frame prediction mode of the current block is the same as that of the neighboring block, information that the intra-frame prediction mode of the current block is the same as that of the neighboring block may be signaled by using predetermined flag information. In addition, 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 may be signaled. When the intra-frame prediction mode of the current block is different from that of the neighboring block, the intra-frame prediction mode information of the current block may be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.
[0213] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0214] 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).
[0215] 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) relative to 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) relative to 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.
[0216] Hereinafter, embodiments of inter-picture prediction will be described in detail.
[0217] Reference pictures and motion information may be used to perform inter-picture prediction or motion compensation.
[0218] 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.
[0219] The derivation method of motion information may be different according to the prediction mode of the current block. For example, the prediction modes applied to inter-frame prediction include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, geometric partition mode, inter-intra combined prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.
[0220] 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 for 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 a 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.
[0221] 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.
[0222] 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.
[0223] 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 decoding target block according to the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.
[0224] 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.
[0225] Another example of a method of deriving motion information of a current block may be a merge mode. The merge mode may represent a method of merging motions of a plurality of blocks. The merge mode may represent 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 same-position 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).
[0226] 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 combining 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.
[0227] 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.
[0228] 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 transmits it to the decoding device 200 by signal. The decoding device 200 may 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 transmitted by the signal may be referred to as a merge mode with a motion vector difference.
[0229] 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.
[0230] 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 a reference image (sub-block based temporal merge candidates) and / or affine control point motion vector merge candidates.
[0231] The geometric partition mode may denote a mode of deriving motion information by partitioning the current block into predetermined 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.
[0232] 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.
[0233] 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 the corrected motion information.
[0234] The decoding apparatus 200 may compensate for prediction samples derived through inter-frame prediction using optical flow.
[0235] Figure 6 is a diagram illustrating transform and quantization processing.
[0236] 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 a transform coefficient, and the secondary transform of the transform coefficient generates a secondary transform coefficient.
[0237] At least one scheme selected from various predefined transform schemes is used to perform the primary transform. For example, examples of the predefined transform schemes 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 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.
[0238] A quantized level signal (quantized coefficient) may be generated by performing quantization on a residual signal or on a result of performing a primary transform and / or a secondary transform. Depending on the intra prediction mode of the block or the block size / shape, 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 the coefficients are scanned according to 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 according to 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.
[0239] 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 inverse scanning. For the inverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning can be used.
[0240] The quantized level coefficients may then be dequantized, then inversely transformed secondary if necessary, and finally inversely transformed primary if necessary to generate a reconstructed residual signal.
[0241] 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 for each segment can be sent by signal. The mapping function can be sent by signal at the slice level or 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 the 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 the reconstructed block without mapping / inverse mapping.
[0242] 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 mapping for 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.
[0243] Information indicating whether mapping / inverse mapping of luma components and chroma components is available may be signaled through a sequence parameter set.
[0244] The prediction block of the current block may 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 may 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 signaled so that a merge candidate can be specified. The block vector of the specified merge candidate may 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 signaled. 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 signaled. The prediction block in the IBC mode is included in the current CTU or the left CTU and is limited to blocks in the reconstructed area. For example, the value of the block vector may be limited so that the prediction block of the current block is located in the region of three 64×64 blocks preceding 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 according to the IBC mode may be reduced.
[0245] In the following, reference will be made to Figures 8 to 13 Embodiments of the present invention are described.
[0246] Figure 8 FIG. 1 is a diagram for explaining an intra prediction process according to an embodiment of the present invention.
[0247] Reference Figure 8 , the intra prediction process of the current block may include deriving an intra prediction mode (S810), configuring reference samples (S820), performing inter prediction (S830), and predicting a residual signal (S840). However, the process is not limited thereto, and may further include additional steps required for intra prediction of the current block.
[0248] In deriving the intra prediction mode according to the embodiment (S810), the intra prediction mode of the current block may be derived. For example, the intra prediction mode of the current block may be derived by using the intra prediction mode of the neighboring block, entropy encoding / decoding of the intra prediction mode of the current block from the bitstream, encoding parameters of the neighboring block, the intra prediction mode of the color component, and at least one of the residual signal prediction information. In addition, based on the intra prediction mode of the current block and at least one of the size and shape of the current block, the first angle mode may be changed to the second angle mode.
[0249] In configuring reference samples according to an embodiment (S820), reference samples for intra prediction of the current block may be configured. For example, the reference samples may be configured by performing at least one of reference sample selection, reference sample padding, and reference sample filtering.
[0250] In performing intra prediction according to an embodiment (S830), intra prediction of the current block may be performed. The intra prediction may be performed by at least one of non-angular prediction, angular prediction, prediction based on position information, and inter-color component prediction.
[0251] In addition, when performing intra prediction, filtering may be performed on the prediction samples. For example, based on at least one of the intra prediction mode of the current block, the horizontal size and the vertical size of the current block, the shape of the current block, and the position of the prediction samples, filtering may be performed on at least one prediction sample within the current block. Here, the filter type (e.g., at least one of the filter coefficient, the filter tap, and the filter shape) may be different.
[0252] In predicting the residual signal according to the embodiment (S840), the residual signal of the current block may be predicted. For example, for the first residual signal of the current block, prediction may be performed in units of at least one of a sample line, a sample, and a predetermined group within the current block, thereby generating a second residual signal.
[0253] Hereinafter, deriving the intra prediction mode (S810) will be described in detail according to an embodiment of the present invention. In this specification, encoding / decoding may mean entropy encoding / decoding.
[0254] According to an embodiment, at least one reconstructed neighboring block may be used to derive an intra prediction mode of the current block. Here, the position of the reconstructed neighboring block may be a predetermined fixed position or a position derived through encoding / decoding.
[0255] For example, when the size of the current block is W×H and the coordinates of the upper left corner sample of the current block are (0, 0), the neighboring block may be at least one of a block adjacent to the coordinates (-1, H-1), (W-1, -1), (W, -1), (-1, H) and (-1, -1) and a neighboring block of the block. Here, W and H may indicate the horizontal length (= width) and vertical length (= height) of the current block, respectively, or the number of samples in the current block.
[0256] According to an embodiment, in order to derive the intra prediction mode of the current block, whether the neighboring block is available may be considered. When the neighboring block is located outside the boundary of at least one predetermined unit (e.g., a picture, a slice, a tile, and a coding tree unit (CTU)), is inter-predicted, or is encoded by using a PCM mode, the neighboring block may be determined to be unavailable.
[0257] Here, the intra prediction mode of the unavailable neighboring block may be replaced by a predetermined intra prediction mode. Here, the predetermined intra prediction mode may be a DC mode, a planar mode, a vertical mode, a horizontal mode, and / or a diagonal mode.
[0258] For example, when the neighboring block is an inter prediction block and an indicator (eg, ciip_flag) showing whether inter prediction and intra prediction are combined has a specific value (eg, '1'), the neighboring block may be derived as a planar mode.
[0259] The intra prediction mode of the current block may be derived as the intra prediction mode of the neighboring block in a predetermined position or as a statistical value of the intra prediction modes of two or more neighboring blocks. In this specification, the statistical value may represent at least one of an average value, a maximum value, a minimum value, a mode value, a median value, a weighted average value, and an interpolation value.
[0260] According to an embodiment, in order to derive the intra prediction mode of the current block, it may be considered whether the intra prediction mode of the neighboring block is an angle mode. For example, when the intra prediction mode of the neighboring block is a non-angle mode, the non-angle mode may be derived as the intra prediction mode of the current block. As another example, when the intra prediction mode of the neighboring block is a non-angle mode, the intra prediction mode of the current block may be derived by using the intra prediction modes of other neighboring blocks other than the non-angle mode.
[0261] According to an embodiment, in order to derive the intra prediction mode of the current block, it may be determined whether the intra prediction mode of the current block corresponds to a predetermined intra prediction mode.
[0262] For example, when it is determined that the intra prediction mode of the current block corresponds to the plane mode, the intra prediction mode of the current block may be derived as the plane mode. Meanwhile, when the intra prediction mode of the current block does not correspond to the plane mode, a most probable mode (MPM) list may be configured, and the intra prediction mode of the current block may be derived based on the MPM candidate indicator (e.g., mpm_idx).
[0263] According to an embodiment, in order to derive the intra prediction mode of the current block, one or more MPM lists may be configured by using the intra prediction mode of the neighboring blocks. The number N of candidate modes included in the MPM list may have a fixed value or be determined according to the size and / or shape of the current block. In addition, the MPM list may be configured so that there is no overlapping mode.
[0264] Here, when the number of available candidate modes is less than N, a predetermined candidate mode among the available candidate modes may be added to the MPM list. For example, a mode obtained by adjusting a predetermined offset to an angle mode may be added to the MPM list. Here, the predetermined offset may be a positive integer (e.g., 1, 2, 3, 4, etc.). Optionally, at least one of a horizontal mode, a vertical mode, a 45 degree mode, a 135 degree mode, a 225 degree mode, and a non-angle mode may be added to the MPM list.
[0265] Optionally, when configuring the MPM list, non-angle modes (e.g., DC mode, planar mode, etc.) may be always included. Since prediction is performed using both the upper reference sample and the left reference sample, the non-angle mode may have a high probability of occurrence. Therefore, since the DC mode and the planar mode are always added to the MPM list, the bit overhead of signaling the intra prediction mode may be reduced.
[0266] According to an embodiment, the intra prediction mode of the current block may be derived using the intra prediction modes of different color components.
[0267] For example, when the current block is a chroma block, an intra prediction mode of a luminance block corresponding to the chroma block may be used. Here, there may be one or more corresponding luminance blocks, and the number of corresponding luminance blocks may be determined based on at least one of the size and shape of the chroma block and / or encoding parameters. Alternatively, the corresponding luminance block may be determined based on at least one of the size and shape of the luminance block and / or encoding parameters.
[0268] When the intra prediction mode of the corresponding luminance block is a matrix-based intra prediction (MIP) mode or an intra block copy (IBC) prediction mode, the predetermined intra prediction mode may be derived as the intra prediction mode of the chrominance block. For example, when the intra prediction mode of the luminance block is the MIP mode, the planar mode may be derived as the intra prediction mode of the chrominance block. Alternatively, when the intra prediction mode of the luminance block is the IBC prediction mode, the DC mode may be derived as the intra prediction mode of the chrominance block.
[0269] Here, the matrix-based intra prediction (MIP) may be a prediction method that generates prediction samples of a current block by multiplying a predefined matrix or a matrix previously transmitted with respect to samples of a previously decoded neighboring block.
[0270] A luma block corresponding to a chroma block may include a plurality of partitions, and all or some of the plurality of partitions may have different intra prediction modes.
[0271] The intra prediction mode of the chroma block can be derived based on all or some of the multiple partitions in the corresponding luminance block. Here, some partitions (all or some of the multiple partitions) can be selectively used by comparing the size, shape, depth and other information between the chroma block and the luminance block.
[0272] In addition, a partition at a position in the luma block corresponding to a predetermined position in the chroma block may be selectively used. In this case, the predetermined position may represent the position of a center sample or a corner sample (eg, an upper left sample) of the chroma block.
[0273] The method for deriving the intra prediction mode between color components according to an embodiment of 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 at least one of the MPM list and the MPM candidate indicator (e.g., mpm_idx) of the corresponding luminance block. In addition, the intra prediction mode of the chrominance block can be derived by sharing at least one of the MPM list and the MPM candidate indicator of the corresponding luminance block.
[0274] Fig. 9 It is a diagram used to illustrate the relationship between the luminance block and the chrominance block.
[0275] Reference Fig. 9 , a ratio between color components may be 4:2:0, and a luminance block corresponding to a chrominance block may be at least one of A, B, C, and D.
[0276] The intra prediction mode of the chroma block may be derived by using the intra prediction mode of the luma block A corresponding to the upper left position (0,0) within the chroma block or the intra prediction mode of the luma block D corresponding to the position of the center sample (nS / 2,nS / 2) of the chroma block. Here, the predetermined position within the chroma block is not limited to (0,0) and (nS / 2,nS / 2), and may be the position of the upper right, lower left, and / or lower right sample within the chroma block.
[0277] The predetermined position within the chroma block may be determined based on the shape of the chroma block. For example, when the shape of the chroma block is a square, the predetermined position within the chroma block may be the position of the center sample point. In addition, when the shape of the chroma block is a rectangle, the predetermined position within the chroma block may be the position of the upper left sample point. Optionally, in the above example, the predetermined position within the square chroma block and the predetermined position within the rectangular chroma block may be opposite to each other.
[0278] In addition, the intra prediction mode of the chrominance block can be derived by using the statistical value of one or more intra prediction modes in the luminance block corresponding to the size of the chrominance block. Here, the statistical value can be at least any one of an average value, a maximum value, a minimum value, a mode value, a median value, a weighted average value, and an interpolation value.
[0279] For example, refer to Fig. 9 , a mode corresponding to the average value of the intra-prediction modes of the luminance blocks A and D or a mode corresponding to the average value of the intra-prediction modes of the luminance blocks A, B, C, and D corresponding to the size of the chrominance block can be derived as the intra-prediction mode of the chrominance block.
[0280] When there are multiple intra-prediction modes for the available luma block, all or some of the intra-prediction modes may be selected. Here, all or some of the intra-prediction modes for the luma block may be selected based on a predetermined position within the chroma block or based on the size, shape and / or depth of the chroma block and / or the luma block. By using the intra-prediction mode of the luma block thus selected, the intra-prediction mode of the chroma block may be derived.
[0281] For example, the size of the luma block A corresponding to the position (0,0) of the upper left sample in the chroma block may be compared with the size of the luma block D corresponding to the position (nS / 2,nS / 2) of the center sample in the chroma block. Thus, the intra prediction mode of the chroma block may be derived by using the intra prediction mode of the relatively larger luma block D.
[0282] In addition, when the size of the chroma block is within a predetermined range, the intra prediction mode of the chroma block may be derived by using the intra prediction mode of the luma block corresponding to the position (0,0) of the upper left sample in the chroma block.
[0283] Here, the predetermined range may be derived based on information sent via a bitstream signal, information about the size of the chroma blocks and / or luminance blocks, information about the depth of the chroma blocks and / or luminance blocks, and at least one piece of information predefined in the encoder / decoder.
[0284] In addition, when the shape of the chroma block is rectangular, the intra prediction mode of the chroma block may be derived by using the intra prediction mode of the luma block corresponding to the position (nS / 2, nS / 2) of the center sample within the chroma block.
[0285] In About Fig. 9 In the above description, deriving the intra prediction mode of the chroma block by using the intra prediction mode of the luminance block may include a case where the intra prediction mode of the luminance block is used as the intra prediction mode of the chroma block as it is.
[0286] In addition, in addition to the case where the intra-frame prediction mode of the luminance block is used as the intra-frame prediction mode of the chrominance block as it is, it can also include the case where the intra-frame prediction mode of the chrominance block is derived by using the information used to derive the intra-frame prediction mode of the luminance block (for example, mpm_idx, MPL list, etc.).
[0287] In addition, the intra prediction mode of the luminance block corresponding to the predetermined position within the chrominance block can be used to derive the MPM list of the chrominance block. Here, the information of the chrominance block (e.g., mpm_idx, etc.) can be encoded and sent with a signal. The MPM list of the chrominance block can be configured in a similar manner to the MPM list of the luminance block. Optionally, the MPM candidates of the chrominance block may include the intra prediction mode of the adjacent chrominance block or the intra prediction mode of the corresponding luminance block, or both.
[0288] When configuring the MPM list of the chroma block, if the indicator (e.g., MPM flag) indicating whether the intra prediction mode of the current block is included in the MPM list is "0", a second MPM list including one or more intra prediction modes may be configured. In addition, a second MPM candidate indicator (e.g., 2nd_mpm_idx) may be used to derive the intra prediction mode of the current block. Here, the second MPM indicator (e.g., the second MPM flag) indicating whether the intra prediction mode of the current block is included in the second MPM list may be encoded / decoded. Similar to the first MPM list, the second MPM list may be configured by using the intra prediction mode of the neighboring block. Here, the intra prediction mode included in the first MPM list may not be included in the second MPM list. The number of MPM lists used to derive the intra prediction mode of the current block is not limited to 1 or 2, but N MPM lists (here, N is a positive integer) may be used.
[0289] As another example, two MPM lists may be configured, and information (e.g., MPM_flag) indicating whether the intra prediction mode of the current block is included in the two MPM lists may be sent by a signal. When the intra prediction mode of the current block is included in at least one of the two MPM lists, a first MPM indicator (e.g., first_mpm_flag) indicating whether the intra prediction mode of the current block is included in the first MPM list may be sent by a signal.
[0290] For example, when first_mpm_flag has a first value (e.g., 1), it may indicate that the intra prediction mode of the current block is included in the first MPM list. When first_mpm_flag has a first value, based on index information about the first MPM list, the intra prediction mode of the current block may be determined as one of the MPM candidates included in the first MPM list. Here, when the first MPM list includes only one MPM candidate, separate index information may not be signaled. In this case, when first_mpm_flag has a first value, the intra prediction mode of the current block may be determined as one of the MPM candidates included in the first MPM list.
[0291] For example, when first_mpm_flag has a second value (e.g., 0), it may indicate that the intra prediction mode of the current block is not included in the first MPM list. When first_mpm_flag has a second value, it may be determined that the intra prediction mode of the current block is included in the second MPM list. Therefore, in this case, index information indicating one of the modes included in the second MPM list may be signaled. The intra prediction mode of the current block may be determined as one MPM candidate specified by the index information among the MPM candidates included in the second MPM list.
[0292] 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 luminance component of the current block may be encoded / decoded. In addition, the intra prediction mode of the chrominance component may be encoded / decoded or the intra prediction mode of the chrominance component may be derived based on the intra prediction mode of the corresponding luminance component.
[0293] When the current block is partitioned into a plurality of subblocks, the intra prediction mode of each subblock may be derived based on at least one of the above methods. Optionally, as described above, the intra prediction mode derived for the current block may be uniformly used for each of the subblocks.
[0294] The size and / or shape of the sub-block may be a predetermined size (eg, 4×4) and / or shape. Alternatively, the size and / or shape of the sub-block may be determined based on the size and / or shape of the current block.
[0295] In addition, the size of the subblock may be determined based on whether the neighboring blocks of the current block are partitioned or based on the intra-frame prediction mode of the neighboring blocks of the current block. For example, the size of the subblock may be determined by partitioning the current block based on the boundary of the neighboring blocks having different intra-frame prediction modes. Alternatively, when the current block is partitioned based on whether the neighboring blocks are intra-frame prediction coding blocks or inter-frame prediction coding blocks, the size of the subblock may be determined.
[0296] According to an embodiment, an indicator (e.g., NDIP_flag) showing that an intra prediction mode of a current block is derived by using an intra prediction mode of a neighboring block may be encoded / decoded. Here, the indicator may be encoded / decoded in each unit of at least one of the current block and the subblock. Alternatively, the indicator may be encoded / decoded only when the size of the current block or the subblock is a predetermined size or within a predetermined range.
[0297] Whether the size of the current block is a predetermined size may be determined based on the horizontal length or vertical length of the current block. For example, when the horizontal length or vertical length is a length that can be partitioned, the size of the current block may be determined as a predetermined size.
[0298] 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 by at least one method of deriving the intra-prediction mode of the current block. Here, the neighboring blocks of the current block may be used as the neighboring blocks of each sub-block. In addition, the sub-blocks within the current block may be used as the neighboring blocks of each sub-block.
[0299] The intra prediction mode of the subblock within the current block may be derived by using the intra prediction mode of the current block and the average value of the intra prediction modes of the blocks adjacent to the left and above the sample at the position (0,0) of each subblock. For example, when the intra prediction mode of the current block is greater than the average value of the intra prediction modes of the blocks adjacent to the left and above the sample at the position (0,0) of each subblock, the derived intra prediction mode may be reduced by half of the average value. Otherwise, that is, the intra prediction mode of the current block is equal to or less than the average value of the intra prediction modes of the blocks adjacent to the left and above the sample at the position (0,0) of each subblock, the derived intra prediction mode may be increased.
[0300] 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, and a parallel block header. Here, for a predetermined block size or smaller, at least one piece of information about the intra prediction may not be signaled. When the at least one piece of information about the intra prediction is not signaled, information about the intra prediction of a block (e.g., an upper block) that is encoded / decoded before encoding / decoding the current block may be used.
[0301] Fig.10 is a diagram for explaining intra prediction modes of neighboring blocks used to derive an intra prediction mode of a current block according to an exemplary embodiment of the present invention.
[0302] When deriving the intra prediction mode of the current block, the MPM candidates may be derived by using the intra prediction modes of the neighboring blocks.
[0303] For example, refer to Fig.10 , the MPM candidate may be derived by using the intra prediction mode A of the neighboring block adjacent to the left of the current block and the intra prediction mode B of the neighboring block adjacent to the top of the current block. Here, the MPM candidate may be derived by using statistical values of A and B (e.g., at least any one of an average value, a maximum value, a minimum value, a mode value, a median value, a weighted average value, and an interpolation value).
[0304] In addition, the MPM candidate can be derived by adding a predetermined offset (e.g., 1, 2, 3, ...) to the statistical value of A, B, or A and B, or subtracting a predetermined offset (e.g., 1, 2, 3, ...) from the statistical value of A, B, or A and B.
[0305] In addition, the MPM candidate may be derived by applying a modulo operation (%) and / or an offset to the statistical values of A, B, or A and B.
[0306] When deriving the intra prediction mode of the current block, the MPM or intra prediction mode may be derived based on at least one of a reference sample line indicator (e.g., intra_luma_ref_idx), a block partition indicator (e.g., intra_subblock_flag, intra_subpartitions_mode_flag, etc.), a block partition direction indicator (e.g., intra_subblock_type_flag, intra_subpartitions_split_flag, etc.), a matrix-based intra prediction (MIP) indicator (e.g., intra_mip_flag), and an indicator indicating whether inter prediction and intra prediction are combined (e.g., ciip_flag).
[0307] The reference sample line indicator indicates one of a plurality of reference sample lines that can be used for intra prediction and may have a value among 0, 1, and 2.
[0308] The block partition indicator may indicate whether the current block is predicted by partitioning into sub-blocks. For example, when the block partition indicator has a specific value (eg, '1'), the current block may be set to be predicted by partitioning into sub-blocks.
[0309] When the current block is predicted by partitioning into sub-blocks, the block partition direction indicator may indicate the partition direction. For example, when the block partition direction indicator has a value of 0, the current block may be set to horizontal partitioning. On the other hand, when the value of the block partition direction indicator is 1, the current block may be set to vertical partitioning. Optionally, as a variant example, when the block partition direction indicator has a value of 0, the current block may not be partitioned into sub-blocks. When the value of the block partition direction indicator is 1, the current block may be set to be predicted by performing horizontal partitioning. When the block partition direction indicator has a value of 2, the current block may be set to be predicted by performing vertical partitioning.
[0310] The MIP indicator may indicate whether matrix-based intra prediction is performed on the current block. For example, when the MIP indicator has a specific value (eg, "1"), MIP may be set to be performed on the current block. In other words, the intra prediction mode of the current block may be set to the MIP mode.
[0311] Here, depending on whether MIP is performed, the intra prediction mode may be derived differently.
[0312] For example, depending on whether MIP is performed, the intra prediction mode may be derived by changing the number of MPMs. For example, when matrix-based intra prediction is performed, three MPMs may be configured. When matrix-based intra prediction is not performed, five MPMs may be configured. In other words, when matrix-based intra prediction is performed, a smaller number of MPMs may be used than in other ways (i.e., when matrix-based intra prediction is not performed).
[0313] As another example, the number of intra-frame prediction modes may be set differently depending on whether matrix-based intra-frame prediction is performed. For example, when matrix-based intra-frame prediction is performed, the number of intra-frame prediction modes may be set differently depending on the size of the current block. For example, when the size of the current block is large, a larger number of intra-frame prediction modes may be used. Alternatively, when the size of the current block is small, a larger number of intra-frame prediction modes may be used. Alternatively, when matrix-based intra-frame prediction is not performed, the number of intra-frame prediction modes may be fixed regardless of the size of the current block.
[0314] As another example, different methods may be used to derive the intra prediction mode of the neighboring blocks depending on whether matrix-based intra prediction is performed. For example, when matrix-based intra prediction is performed, the intra prediction mode of the neighboring blocks may be changed to a predetermined intra prediction mode and then derived based on the size of the current block and the size of the neighboring blocks. Alternatively, when matrix-based intra prediction is not performed, the intra prediction mode of the neighboring blocks may not be changed.
[0315] For example, when matrix-based intra prediction is performed on a neighboring block, the intra prediction mode of the neighboring block may be derived as a predetermined intra prediction mode (e.g., plane mode). Specifically, when the MIP indicator (e.g., intra_mip_flag) of the neighboring block has a specific value (e.g., 1), that is, when matrix-based intra prediction is performed on the neighboring block, the intra prediction mode of the neighboring block may be derived as a predetermined intra prediction mode (e.g., plane mode).
[0316] Here, the neighboring block may mean a block adjacent to the lower left of the current block or the upper right of the current block.
[0317] According to an embodiment, whether the intra prediction mode of the current block is a predetermined prediction mode may be determined based on the reference sample line indicator. For example, the predetermined prediction mode may be a planar mode.
[0318] For example, when the reference sample line indicator has a specific value (e.g., 0) and the intra prediction mode of the current block is determined to be a plane mode, the intra prediction mode of the current block may be derived as a plane mode. Meanwhile, when the intra prediction mode of the current block is determined not to be a plane mode, an MPM list may be configured, and the intra prediction mode of the current block may be derived based on the MPM candidate indicator. In the above example, whether the intra prediction mode of the current block is a plane mode may be determined based on separate information indicating whether the intra prediction mode of the current block is a plane mode. Separate information may be sent by a signal only when the reference sample line indicator has a specific value (e.g., 0).
[0319] In addition, when the reference sample line indicator does not have a specific value (e.g., 0), determining whether the intra prediction mode of the current block is a predetermined prediction mode may be skipped. In other words, when the reference sample line indicator has a value different from 0, the MPM list may be configured, and the intra prediction mode of the current block may be derived based on the MPM candidate indicator without determining whether the intra prediction mode of the current block is a predetermined prediction mode. For example, when the reference sample line indicator does not have a specific value (e.g., 0), separate information indicating whether the intra prediction mode of the current block is a planar mode may not be signaled.
[0320] According to an embodiment, the MPM list of the current block may be configured regardless of a reference sample line indicator (eg, intra_luma_ref_idx) and subblock partition prediction information (eg, intra_subblock_flag, intra_subpartitions_mode_flag, intra_subblock_type_flag, intra_subpartitions_split_flag, etc.).
[0321] For example, refer to Fig.10 , the MPM list of the current block may be configured based on the intra prediction mode A of the neighboring block adjacent to the left side of the current block and the intra prediction mode B of the neighboring block adjacent to the top of the current block.
[0322] When A and B are the same mode and are angle modes (for example, a mode greater than 1), an MPM list including five MPM candidates in the order of A, 2+((A+61)%64), 2+((A-1)%64), DC, and 2+((A+60)%64) can be configured.
[0323] As another example, when A and B are different modes and both are angle modes, the three MPM candidates may be preferentially included in the MPM list in the order of A, B, and DC. In addition, the larger mode of A and B and the smaller mode of A and B may be determined as maxAB and minAB, respectively. Here, when the difference between maxAB and minAB is greater than 1 but less than 63, two MPM candidates may be added in the order of 2+((maxAB+61)%64) and 2+((maxAB-1)%64), and thus, an MPM list including a total of five MPM candidates may be configured. Optionally, when the difference between maxAB and minAB is 1 or equal to or greater than 63, two MPM candidates may be added in the order of 2+((maxAB+60)%64) and 2+((maxAB)%64), and thus, an MPM list including a total of five MPM candidates may be configured.
[0324] As another example, when A and B are in different modes, one is an angle mode and the other is a non-angle mode, an MPM list including five MPM candidates in the order of maxAB, DC, 2+((maxAB+61)%64), 2+((maxAB-1)%64, and 2+((maxAB+60)%64) can be configured.
[0325] In other cases other than the above, for example, when A and B are the same and are in non-angle mode (for example, a mode equal to or less than 1), or when A and B are different but both are in non-angle mode, an MPM list including five MPM candidates in the order of DC, 50, 18, 46 and 54 can be configured.
[0326] In addition, when combined inter and intra prediction of the current block is performed, the MPM is not derived, and intra prediction of the current block may be performed by using a planar mode.
[0327] For example, when the combined inter and intra prediction indicator (eg, ciip_flag) is 1 (or true), the intra prediction mode of the current block may be determined as the planar mode.
[0328] According to an embodiment, when deriving the intra prediction mode of the current block, residual signal prediction information may be used. The residual signal prediction information may include residual signal prediction application information and / or residual signal prediction direction information. The residual signal prediction application information may be information indicating whether residual signal prediction is applied to the current block. When residual signal prediction is applied to the current block, the residual signal prediction direction information may be information indicating the prediction direction of the residual signal. The prediction direction of the residual signal may be determined as one of a horizontal direction and a vertical direction. When the residual signal prediction application information indicates that residual signal prediction is applied to the current block, the residual signal prediction direction information may be sent by a signal. When residual signal prediction is applied to the current block, the intra prediction mode of the current block may be derived based on the residual signal prediction direction information. For example, when the residual signal prediction direction is a horizontal direction, the intra prediction mode of the current block may be derived as a horizontal mode. Optionally, when the residual signal prediction direction is a vertical direction, the intra prediction mode of the current block may be derived as a vertical mode.
[0329] Here, the residual signal prediction information may be described as a block differential pulse coded modulation (BDPCM) direction indicator (e.g., intra_bdpcm_luma_dir_flag). In other words, when residual signal prediction is performed, the BDPCM direction indicator may indicate a prediction direction. For example, when the BDPCM direction indicator has a first value (e.g., 0), the residual signal prediction direction may be set to a horizontal direction. In addition, when the BDPCM direction indicator has a second value (e.g., 1), the residual signal prediction direction may be set to a vertical direction.
[0330] When residual signal prediction is performed on the current block, a predetermined intra prediction mode may be stored as the intra prediction mode of the current block.
[0331] For example, the planar mode may be stored as the intra prediction mode of the current block.
[0332] Alternatively, the DC mode may be stored as the intra prediction mode of the current block.
[0333] Alternatively, a predetermined mode included in the MPM list may be stored as the intra prediction mode of the current block. For example, the intra prediction mode present in the first position of the MPM list may be stored as the intra prediction mode of the current block.
[0334] Optionally, an intra-frame prediction mode corresponding to the same direction as the prediction direction of the residual signal may be stored as the intra-frame prediction mode of the current block. For example, when the residual signal prediction is performed horizontally, "mode 18" corresponding to the horizontal mode may be stored as the intra-frame prediction mode of the current block. In addition, when the residual signal prediction is performed vertically, "mode 50" corresponding to the vertical mode may be stored as the intra-frame prediction mode of the current block.
[0335] For example, when the BDPCM direction indicator (eg, intra_bdpcm_luma_dir_flag) has a first value (eg, 0), residual signal prediction may be performed in the horizontal direction. Therefore, the horizontal direction (eg, "mode 18") as the residual signal prediction direction may be stored as the intra prediction mode of the current block.
[0336] In addition, when the BDPCM direction indicator (e.g., intra_bdpcm_luma_dir_flag) has a second value (e.g., 1), residual signal prediction may be performed in the vertical direction. Therefore, the vertical direction (e.g., "mode 50") as the residual signal prediction direction may be stored as the intra prediction mode of the current block.
[0337] When the intra prediction mode of the current block is derived by using the MPM list, the intra prediction mode information may be sent by a signal. The intra prediction mode information may be at least one of an MPM indicator (e.g., intra_luma_mpm_flag or MPM flag), an MPM candidate indicator (e.g., mpm_idx or intra_luma_mpm_idx), a planar mode indicator (e.g., intra_luma_planar_flag), and / or a residual mode indicator (e.g., intra_luma_mpm_remainder).
[0338] The MPM indicator (e.g., intra_luma_mpm_flag or MPM flag) may indicate whether there is a mode identical to the intra prediction mode of the current block in the MPM list. Here, when the MPM indicator has a first value (e.g., 1), an MPM candidate indicator (e.g., mpm_idx or intra_luma_mpm_idx) indicating which mode among the candidate modes in the MPM list is the same mode as the intra prediction mode of the current block may be sent by a signal. Alternatively, on the contrary, when the MPM indicator has a second value (e.g., 0), a residual mode indicator (e.g., intra_luma_mpm_remainder) indicating the intra prediction mode of the current block among modes other than the MPM mode may be sent by a signal.
[0339] A planar mode indicator (e.g., intra_luma_planar_flag) may indicate whether the intra prediction mode of the current block can be derived as a planar mode. For example, when intra_luma_planar_flag has a first value (e.g., 1), the intra prediction mode of the current block may be derived as a planar mode. Alternatively, when intra_luma_planar_flag has a second value (e.g., 0), intra_luma_mpm_idx may be signaled, and the intra prediction mode of the current block may be derived from the MPM list. The first value and the second value may be defined oppositely.
[0340] In addition, based on at least one of the reference sample line related information (e.g., intra_luma_ref_idx), sub-block partition prediction related information (e.g., intra_subblock_flag, intra_subpartitions_mode_flag, intra_subblock_type_flag, intra_subpartitions_split_flag, etc.), MIP related information (e.g., intra_mip_flag) and CIIP related information (e.g., ciip_flag), at least one item of intra-frame prediction information may not be sent by a signal.
[0341] For example, when intra_luma_ref_idx has a specific value (eg, 0), intra_luma_mpm_flag or intra_luma_mpm_remainder may not be signaled. Thus, intra_luma_mpm_idx may be signaled, and thus the intra prediction mode of the current mode may be derived.
[0342] As another example, when intra_luma_ref_idx does not have a specific value (eg, 0), intra_luma_planar_flag may not be signaled. Thus, intra_luma_mpm_idx may be signaled, and thus the intra prediction mode of the current mode may be derived.
[0343] As another example, when matrix-based intra prediction is performed on the current block, that is, when intra_mip_flag has a specific value (eg, 1), intra_luma_planar_flag may not be signaled. Thus, intra_luma_mpm_flag or intra_luma_mpm_idx may be signaled, and thus the intra prediction mode of the current block may be derived.
[0344] As another example, when subblock partition prediction is performed on the current block, that is, when intra_subpartitions_mode_flag has a specific value (eg, 1), intra_luma_mpm_flag or intra_luma_mpm_remainder may not be signaled. Thus, only intra_luma_mpm_idx may be signaled, and thus the intra prediction mode of the current mode may be derived.
[0345] As another example, when combined inter and intra prediction (CIIP) is performed on the current block, that is, when ciip_flag has a specific value (e.g., 1), intra_luma_mpm_flag, intra_luma_mpm_idx, or intra_luma_mpm_remainder may not be signaled, and the intra prediction mode of the current block may be derived as planar mode.
[0346] Hereinafter, configuring reference samples (S820) will be described in detail according to an embodiment of the present invention.
[0347] Based on the intra prediction mode derived in the deriving intra prediction mode (S810), reference samples for intra prediction may be constructed. Hereinafter, in this specification, the current block may refer to a prediction block or a subblock having a smaller size and / or shape than the prediction block.
[0348] The reference sample may be constructed by using one or more reconstructed samples adjacent to the current block or a combination thereof. In addition, filtering may be performed on the constructed reference sample.
[0349] The number and / or position of the reconstruction sample lines used to configure the reference sample may be different depending on the position of the current block within the coding tree block. Here, each of the multiple reconstruction sample lines may be used as a reference sample as is. Alternatively, the reference sample may be generated by performing a predetermined filter on the reconstruction sample and using the filtered reconstruction sample. The reconstruction samples to which the filter is applied may belong to the same reconstruction sample line or different reconstruction sample lines.
[0350] The reconstructed reference sample may be expressed as ref[m,n], and the neighboring reconstructed sample to which filtering is applied or not applied may be expressed as rec[m,n]. Here, m or n may be a predetermined integer representing the position of the sample. In addition, when the position of the upper left sample in the current block is (0,0), the position of the reference sample adjacent to the upper left of the current block may be set to (-1,-1).
[0351] In order to configure the reference samples, the availability of the neighboring reconstruction samples may be determined. Here, when the neighboring reconstruction samples are located outside at least one area of the picture, slice, tile, and CTU, the samples may be determined to be unavailable. In addition, when constrained intra prediction is performed on the current block and the neighboring reconstruction samples are located in a block encoded / decoded by inter prediction, the samples may be determined to be unavailable.
[0352] When a neighboring reconstruction sample point is determined to be unavailable, another available neighboring reconstruction sample point may be used to replace the unavailable sample point.
[0353] For example, starting from the lower left sample point position, adjacent available sample points may be used and replace unavailable sample points.
[0354] In addition, the unavailable sample points may be replaced by using a combination of available sample points. For example, the unavailable sample points may be replaced by using the average value of the available sample points located on either side of the unavailable sample points.
[0355] In addition, the unavailable sample point may be replaced by using information about the available reference sample point. Here, the unavailable sample point may be replaced by using an arbitrary value instead of the value of the adjacent available reference sample point. The arbitrary value may be an average value of the available sample point values or a value considering the gradient of the available sample point values. Alternatively, both the average value and the gradient may be used. Here, the gradient may be determined based on the difference between the adjacent available sample points. Alternatively, in addition to the average value, a maximum value, a minimum value, a median value, or a weighted sum to which an arbitrary weight is applied may also be used. Here, the arbitrary weight may be determined based on the distance between the available sample point and the unavailable sample point.
[0356] The above method can be applied to all upper reference samples and left reference samples, or only to any direction. In addition, the method can also be applied when the reference sample line of the current block is configured by using multiple reference sample lines.
[0357] Whether to perform filtering on one or more constructed reference samples may be determined based on at least one of an intra prediction mode of the current block and a size / shape of the block. When filtering is performed, a filter type may become different according to at least one of an intra prediction mode of the current block and a size and shape of the block.
[0358] When subblock partition prediction is performed on the current block, reference samples for each subblock may be constructed. Here, the horizontal length or vertical length of the reference samples may be twice the horizontal length or vertical length of each subblock.
[0359] For example, when the size of the current block is M×N and the current block is horizontally partitioned into four equal parts so that each subblock has a size of M×(N / 4), the reference sample of the subblock may have a horizontal length of 2*M and a vertical length of 2*(N / 4). In other words, based on the size of the block on which prediction and transformation are performed, a reference sample having a horizontal length of 2*and a vertical length of 2* may be constructed.
[0360] Hereinafter, performing intra prediction (S830) will be described in detail according to an embodiment of the present invention.
[0361] Intra prediction of the current block may be performed based on the intra prediction mode and the reference samples derived through the deriving the intra prediction mode ( S810 ) and the configuring the reference samples ( S820 ).
[0362] When the derived intra prediction mode is the DC mode, an average value of one or more constructed reference samples may be used. Herein, filtering may be performed on one or more prediction samples located on the boundary of the current block. Prediction by the DC mode may be performed differently based on at least one of the size and shape of the current block. For example, a range of reference samples used in the DC mode may be specified based on the size and / or shape of the current block and a reference sample line indicator.
[0363] Fig.11 is a diagram for explaining an embodiment of DC prediction according to the size and / or shape of a current block according to an embodiment of the present invention.
[0364] Reference Fig.11 (a), when the current block is a square, DC prediction can be performed by using the average of the upper and left samples of the current block.
[0365] In addition, when the current block is not a square, the neighboring samples adjacent to the left or top of the current block can be selectively used. Fig.11 As shown in (b) of FIG. 1 , when the current block is rectangular, DC prediction may be performed by using an average value of reference samples adjacent to a longer one of a horizontal length and a vertical length of the current block.
[0366] In addition, when the size of the current block is a predetermined size or within a predetermined range, predetermined samples of a reference sample line indicated by a reference sample line indicator may be selected from the upper or left reference samples of the current block, and DC prediction may be performed by using an average value of the samples thus selected.
[0367] The predetermined size may refer to a fixed size of N×M predefined in an encoder / decoder. Here, N and M are integers greater than 0, and may be the same or different.
[0368] The predetermined range may represent a threshold value for selecting a reference sample of the current block. The threshold value may be implemented as at least one of a maximum value and a minimum value. Here, the minimum value and / or the maximum value may be a fixed value predefined in the encoder / decoder or a variable value encoded in the encoder and sent with a signal.
[0369] As described above, the average value of one or more reference samples can be used for DC prediction. To calculate the average value, the number of reference samples can be divided. Here, when the number of reference samples is 2 n (n is a positive integer), the division can be replaced by a binary shift operation.
[0370] In the case of non-square blocks, if both the upper reference sample and the left reference sample are used, the number of reference samples may not be 2. n In this case, the shift operation may not be used to replace the division operation. Therefore, as in the above embodiment, by using only 2 n The division operation can be replaced by a shift operation.
[0371] When the intra prediction mode is the planar mode, a weighted sum considering distances from at least one or more constructed reference samples may be used according to a location of a target sample for intra prediction of the current block.
[0372] When the intra prediction mode is a directional mode, one or more reference samples existing on and around a predetermined angle line at the position of a target sample for intra prediction may be used.
[0373] When directional prediction is performed, the intra prediction mode may be changed to a predetermined mode based on the shape of the current block. In other words, when the intra prediction mode is a directional mode and the horizontal and vertical sizes of the block are different from each other, the intra prediction mode may be changed to a predetermined mode based on the ratio between the horizontal and vertical sizes. The ratio between the width and height of the block (whRaito) may be determined by whRatio=Abs(Log2(nW / nH)). Here, nW and nH may be the horizontal and vertical lengths of the block, respectively, and Abs(x) may represent the absolute value of x.
[0374] For example, if the horizontal size of the current block is larger than its vertical size, the predetermined direction mode predicted from the lower left may be changed to a direction mode predicted from the upper right. In other words, when all of the following conditions are met, a predetermined offset may be applied to the intra prediction mode, and thus the intra prediction mode may be changed by predModeIntra=predModeIntra+65. Here, predModeIntra may represent an intra prediction mode.
[0375] (1) The horizontal size of the block is larger than its vertical size.
[0376] (2) predModeIntra is equal to or greater than 2.
[0377] (3) predModeIntra is less than the predetermined mode. Here, when whRatio is 1, the predetermined mode may be 8, and when whRatio is greater than 1, the predetermined mode may be (8+2*whRatio). Alternatively, the predetermined mode may be fixed to (8+2*whRatio) regardless of the size of whRatio.
[0378] In addition, if the vertical size of the current block is larger than its horizontal size, the predetermined direction mode predicted from the upper right can be changed to a mode predicted from the lower left. In other words, when all of the following conditions are met, a predetermined offset can be applied to the intra prediction mode, so the intra prediction mode can be changed by predModeIntra=predModeIntra-67.
[0379] (1) The vertical size of the block is larger than its horizontal size.
[0380] (2) predModeIntra is equal to or less than 66.
[0381] (3) predModeIntra is greater than the predetermined mode. Here, when whRatio is 1, the predetermined mode may be 60, and when whRatio is greater than 1, the predetermined mode may be (60-2*whRatio). Alternatively, the predetermined mode may be fixed to (60-2*whRatio) regardless of the size of whRatio.
[0382] When prediction is performed by partitioning the current block into sub-blocks, each sub-block may be predicted by commonly using one intra-prediction mode derived based on the current block. In this case, the intra-prediction mode may be changed to a predetermined mode based on the shape of the sub-block (e.g., the horizontal and vertical sizes of the block). In other words, the intra-prediction mode of the current block may be derived by using a neighboring intra-prediction mode based on the size of the current block. Based on the horizontal size and vertical size of the sub-block obtained by partitioning the current block, the derived intra-prediction mode of the current block may be changed to a predetermined mode.
[0383] For example, the size of the current block may be 32×32, the intra prediction mode (predModeIntra) may be 4, and the subblock may be constructed by partitioning the current block into four equal parts in the horizontal direction. Here, based on the size of each subblock 32×8, the intra prediction mode (predModeIntra) 4 may be changed by applying the above method. In other words, since whRatio is 2, the horizontal size of the subblock is larger than its vertical size, predModeIntra is greater than 2, and predModeIntra is less than (8+2*2), the intra prediction mode may be changed to 69 (=4+65).
[0384] As another example, the size of the current block may be 32×8, the intra prediction mode (predModeIntra) may be 4, and the subblock may be constructed by partitioning the current block into four equal parts in the vertical direction. Here, based on the size of each subblock 8×8, the intra prediction mode (predModeIntra) 4 may be changed by applying the above method. However, in this case, since the horizontal and vertical sizes of the subblock become the same by applying this method, the intra prediction mode may not be changed.
[0385] When performing directional prediction, an interpolation filter may be determined based on at least one of a size and / or shape, a horizontal length, a vertical length, and an intra prediction mode of the current block. Here, the interpolation filter may include a first interpolation filter and a second interpolation filter. For example, the first interpolation filter may be a cubic filter, and the second interpolation filter may be a Gaussian filter.
[0386] According to an embodiment, the interpolation filter may be determined by comparing a difference value between a horizontal mode or a vertical mode and an intra prediction mode (preModeIntra) of a current block with a predetermined threshold. The difference value (Diff) may be determined as follows.
[0387] Difference (Diff)=Min(Abs(PredModeIntra-50),Abs(PredModeIntra-18))
[0388] In other words, the difference value (Diff) may be determined as the smaller (Min) of the absolute value (Abs) of the difference between the vertical mode (50) and the intra-prediction mode (predModeIntra) of the current block and the absolute value (Abs) of the difference between the horizontal mode (18) and the intra-prediction mode (predModeIntra) of the current block.
[0389] When the difference value is equal to or less than a predetermined threshold, the interpolation filter may be determined as a first interpolation filter. When the difference value exceeds the threshold, the interpolation filter may be determined as a second interpolation filter.
[0390] According to an embodiment, the interpolation filter may be determined based on a predetermined threshold value (TH) determined by using a combination of a horizontal size and a vertical size of the current block. Here, the combination of a horizontal size and a vertical size of the current block may be determined as follows.
[0391] The combination of the horizontal size and vertical size of the current block (S) = (Log2(nTbW)+Log2(nTbH))>>1
[0392] In other words, the combination of the horizontal size and the vertical size (S) of the current block may be determined as an average value between the logarithmic value (Log2) of the horizontal size (nTbW) of the current block and the logarithmic value (Log2) of the vertical size (nTbH) of the current block.
[0393] Table 1 shows an example of determining a threshold based on a combination of a horizontal size and a vertical size of a current block.
[0394] According to a combination of the horizontal size and the vertical size of the current block, the threshold may be determined as shown in Table 1.
[0395] Table 1
[0396] S=2 S=3 S=4 S=5 S=6 TH[S] 16 14 2 0 0
[0397] Here, when the difference value (Diff) is equal to or less than a threshold value (TH), the interpolation filter may be determined as a first interpolation filter. When the difference value exceeds the threshold value, the interpolation filter may be determined as a second interpolation filter.
[0398] Table 2 shows an example of determining a threshold based on a combination of the horizontal size and the vertical size of the current block.
[0399] In addition, since the first interpolation filter and the second interpolation filter are determined according to the threshold value, when the interpolation filter is selected by changing the threshold value as shown in Table 2, compression efficiency can be improved.
[0400] Table 2
[0401] S=2 S=3 S=4 S=5 S=6 TH[S] 16 14 4 0 0
[0402] Therefore, when the combination of the horizontal size and the vertical size of the current block is 2, it can always be determined as the first interpolation filter. In addition, when S is 3, if the intra-frame prediction mode difference (Diff) is equal to or less than 14, it can be determined as the first interpolation filter. Otherwise, that is, if the intra-frame prediction mode difference (Diff) exceeds 14, it can be determined as the second interpolation filter. When S is equal to or greater than 5, it can always be determined as the second interpolation filter.
[0403] Alternatively, when neither Table 1 nor Table 2 is used, the threshold value (TH) may be derived by a separate formula.
[0404] For example, the threshold value (TH) may be derived using the following formula.
[0405] TH=1<<(6-S)
[0406] In other words, as shown in the above formula, the threshold (TH) can be determined based on the combination of the horizontal size and the vertical size of the current block (S). For example, according to the formula, when S is 2, 3, 4, 5 and 6, TH can be 16, 8, 4, 2 and 1 respectively.
[0407] Alternatively, a combination (S) of the horizontal size and the vertical size of the current block may be determined as the logarithm of the horizontal size or the logarithm of the vertical size of the current block based on the intra prediction mode of the current block.
[0408] For example, when the intra prediction mode of the current block is greater than the diagonal mode 34, the logarithm of the horizontal length of the current block (Log2(nTbW)) may be determined as a combination (S) of the horizontal size and the vertical size of the current block. In other words, when the intra prediction mode of the current block is greater than the diagonal mode 34, S may be Log2(nTbW).
[0409] In addition, when the intra prediction mode of the current block is equal to or less than the diagonal mode 34, the logarithm of the vertical length of the current block (Log2(nTbH)) may be determined as a combination (S) of the horizontal size and the vertical size of the current block. In other words, when the intra prediction mode of the current block is equal to or less than the diagonal mode 34, S may be Log2(nTbH).
[0410] As another example, the size combination may be determined by comparing the intra prediction mode of the current block with a value obtained by applying a predetermined offset to the diagonal pattern 34. For example, when the intra prediction mode of the current block is greater than 34+6, the logarithm of the horizontal length of the current block may be determined as a combination of the horizontal size and the vertical size of the current block. Alternatively, when the intra prediction mode of the current block is less than 34-6, the logarithm of the vertical length of the current block may be determined as a combination of the horizontal size and the vertical size of the current block. Here, when any condition is not satisfied, the logarithm of the average value of the horizontal length and the vertical length of the current block may be determined as a combination of the horizontal size and the vertical size of the current block.
[0411] According to an embodiment, the interpolation filter may be determined based on at least one of the reference sample line related information (e.g., intra_luma_ref_idx) of the current block and the subblock partition prediction information (e.g., intra_subblock_flag, intra_subpartitions_mode_flag, intra_subblock_type_flag, intra_subpartitions_split_flag, etc.). Here, when the intra prediction mode is a mode (e.g., 2, 34, 66) of copying the reference sample at the integer position, the interpolation filter may not be determined, and the reference sample at the integer position may be copied and predicted. Optionally, among the filter coefficients of the first interpolation filter, the filter coefficients corresponding to the integer position may be used.
[0412] Tables 3 to 6 show examples of determining an interpolation filter based on an intra prediction mode, reference sample line related information, and subblock partition prediction information.
[0413] For example, as shown in Table 3, when the reference sample line indicator does not have a specific value (eg, 0) (eg, intra_luma_ref_idx != 0), the first interpolation filter may be used to perform directional prediction.
[0414] As another example, as shown in Table 3, when prediction is performed by partitioning the current block into sub-blocks (e.g., intra_subblock_flag=1), the interpolation filter may be determined based on at least one of the intra prediction mode of the current block, the horizontal size, and the vertical size of the current block. According to the method, when a predetermined condition is satisfied without comparing with a threshold, a first interpolation filter may be used.
[0415] Table 3
[0416]
[0417] For example, referring to Table 3, when the intra prediction mode of the current block is equal to or greater than 34 and the horizontal length (W) of the current block is equal to or less than 8, or when the intra prediction mode of the current block is less than 34 and the vertical length (H) of the current block is equal to or less than 8, the interpolation filter may be determined differently according to the reference sample line indicator and / or whether prediction is performed by partitioning the current block into sub-blocks.
[0418] For example, when the reference sample line indicator is not 0 (eg, intra_luma_ref_idx != 0), the first interpolation filter may be selected regardless of whether a condition of an intra prediction mode of the current block is satisfied.
[0419] As another example, when a condition of an intra prediction mode of a current block is satisfied and prediction is performed by partitioning the current block into subblocks (eg, intra_subblock_flag=1), the first interpolation filter may be selected.
[0420] As another example, when the condition of the intra prediction mode of the current block is not satisfied and prediction is performed by partitioning the current block into subblocks (e.g., intra_subblock_flag=1), the first interpolation filter or the second interpolation filter may be selected by comparison between the intra prediction mode of the current block and a threshold.
[0421] As another example, when the reference sample line indicator is 0 (e.g., intra_luma_ref_idx=0) and the current block is not partitioned into sub-blocks (e.g., intra_subblock_flag!=1), the first interpolation filter or the second interpolation filter may be selected by comparing the intra prediction mode of the current block with a threshold, regardless of whether the condition of the intra prediction mode of the current block is satisfied.
[0422] When prediction is performed by partitioning the current block into sub-blocks, the predetermined condition of this example may be removed, thereby reducing complexity.
[0423] Referring to Table 4, directional prediction may be performed by determining a first interpolation filter or a second interpolation filter by comparing an intra prediction mode of a current block with a threshold.
[0424] Table 4
[0425]
[0426] For example, referring to Table 4, when the intra prediction mode of the current block is the interpolation prediction mode and the reference sample line indicator is not 0 (e.g., intra_luma_ref_idx!=0), the first interpolation filter may be selected. Alternatively, when the reference sample line indicator is 0 (e.g., intra_luma_ref_idx=0) or when prediction is performed by partitioning the current block into sub-blocks (e.g., intra_subblock_flag=1), the first interpolation filter or the second interpolation filter may be selected by comparing the intra prediction mode of the current block with a threshold.
[0427] For example, when it is determined to apply the filter to the reference sample and the reference sample line indicator is not 0, the first interpolation filter may always be applied. Meanwhile, when both conditions are not satisfied, the interpolation filter may be determined by comparison with a threshold value.
[0428] Table 5
[0429]
[0430] For example, referring to Table 5, when the intra prediction mode of the current block is the interpolation prediction mode and the reference sample line indicator is not 0 (e.g., intra_luma_ref_idx!=0) or prediction is performed by partitioning the current block into sub-blocks (e.g., intra_subblock_flag=1), the first interpolation filter may be selected. Alternatively, when the reference sample line indicator is 0 (e.g., intra_luma_ref_idx=0) and the current block is not partitioned into sub-blocks, the first interpolation filter or the second interpolation filter may be selected by comparing the intra prediction mode of the current block with a threshold.
[0431] For example, when the reference sample line indicator (intra_luma_ref_idx) is not 0 or prediction is performed by partitioning the current block into sub-blocks in a horizontal or vertical direction, a cubic filter may be selected as the interpolation filter.
[0432] For example, when the reference sample line (intra_luma_ref_idx) is 0 and the current block is not partitioned into sub-blocks, the interpolation filter can be determined by comparing the above-mentioned "difference (Diff) between the intra prediction mode of the current block and the horizontal mode or the vertical mode" and the above-mentioned predetermined threshold (TH). Specifically, when the difference (Diff) is greater than the threshold (TH), a Gaussian filter can be selected as the interpolation filter. Alternatively, on the contrary, when the difference (Diff) is equal to or less than the threshold (TH), a cubic filter can be selected as the interpolation filter. Here, as described above, the difference (Diff) can be calculated by the following formula.
[0433] Difference (Diff)=Min(Abs(PredModeIntra-50), Abs(PredModeIntra-18))
[0434] In other words, the difference value (Diff) may be determined as the smaller (Min) of the absolute value (Abs) of the difference between the vertical mode (50) and the intra-prediction mode (predModeIntra) of the current block and the absolute value (Abs) of the difference between the horizontal mode (18) and the intra-prediction mode (predModeIntra) of the current block.
[0435] In addition, as described above, the threshold value (TH) may be determined based on a combination (S) of the horizontal size and the vertical size of the current block. Here, the combination may be determined as follows.
[0436] Combination (S) = (Log2(nTbW) + Log2(nTbH)) >> 1
[0437] In other words, the combination (S) may be determined as an average value between a logarithmic value (Log2) of a horizontal size (nTbW) of the current block and a logarithmic value (Log2) of a vertical size (nTbH) of the current block.
[0438] As a variation example, the threshold (TH) may be determined according to a combination (S) of the horizontal size and the vertical size of the current block, as shown in Table 6.
[0439] Table 6
[0440] S=2 S=3 S=4 S=5 S=6 S=7 TH[S] 24 14 2 0 0 0
[0441] Table 7
[0442]
[0443] In addition, referring to Table 7, when the intra prediction mode of the current block is an interpolation prediction mode and the reference sample line indicator is not 0 (e.g., intra_luma_ref_idx!=0), the first interpolation filter may be selected. Alternatively, when prediction is performed by partitioning the current block into sub-blocks (e.g., intra_subblock_flag=1), the second interpolation filter may be selected. Optionally, when neither condition is satisfied, one of the first interpolation filter and the second interpolation filter may be selected by comparing the intra prediction mode of the current block with a threshold.
[0444] In the case of an intra prediction mode based on position information, a reconstructed sample block generated based on the encoded / decoded or derived position information may be used as an intra prediction block of the current block. Alternatively, the decoder may search for and derive a reconstructed sample block to be used as an intra prediction block of the current block.
[0445] Whether the intra prediction mode based on position information is applied to the current block may be explicitly signaled as a flag of the current block or may be implicitly derived. In this specification, a flag indicating whether the intra prediction mode based on position information is applied to the current block may be referred to as an intra block copy (IBC) flag.
[0446] For example, when the tile group including the current block is an I tile group that does not refer to other pictures and the current block is not a skip block, the IBC flag may be signaled.
[0447] In addition, when the tile group including the current block is an I tile group and the current block is not in a general intra prediction mode, an IBC flag may be signaled.
[0448] Availability information indicating whether the intra prediction mode based on the position information is available at a higher level (eg, sequence level, etc.) of the current block may be signaled. Here, the IBC flag may be explicitly signaled only when the availability information indicates that it is available.
[0449] When the IBC flag is not signaled, the IBC flag value may be derived implicitly based on the properties of the parallel block group to which the current block belongs.
[0450] For example, when the current block belongs to an I parallel block group, the IBC flag value may be derived as a value of available information.
[0451] In addition, when the current block belongs to a P tile group or a B tile group, the IBC flag value may be derived as 0.
[0452] When the IBC flag value is 1, it may indicate that the intra prediction mode based on the position information is applied to the current block. When the IBC flag value is 0, it may indicate that the intra prediction mode based on the position information is not applied to the current block.
[0453] The position information may be restored to perform intra prediction based on the position information. Both the current block and the reconstructed sample block are included in the current picture, and the position information may be information about the position difference between the current block and the reconstructed sample block. Here, restoring the position information may be similar to the way a motion vector for inter prediction is reconstructed.
[0454] For example, similar to the merge mode in inter prediction, the position information may be restored from the position information of the neighboring blocks. In this regard, information indicating the merge mode may be signaled (eg, MergeFlag=1), and a merge candidate list including N (N is a positive integer) candidates may be configured.
[0455] For example, N may be 5. In other words, a merge candidate list including five merge candidates may be configured. Here, the five merge candidates may be the same as the five spatial merge candidates for inter prediction, and the priority order for being added to the merge candidate list may also be the same. All five spatial merge candidates may be included in the merge candidate list. In addition, when the number of candidates included in the merge candidate list is less than 5, additional candidates may be included.
[0456] Here, the position information of the additional candidate may be an average or weighted average of position information of two candidates selected from the candidates already included in the merge candidate list according to a predetermined rule. The two selected candidates may be the first candidate and the second candidate of the merge candidate list.
[0457] Optionally, a candidate selected from the candidate list according to a predetermined rule may be included as an additional candidate of the current block, wherein the selected candidate is used for intra prediction based on the position information of the previous block. When the index information sent by the signal is applied to the merge candidate list thus configured, the position information of the current block can be restored.
[0458] For example, the position information may be restored as the predicted position information sum of the position information and the residual position information. In this regard, information indicating that it is not a merge mode (eg, MergeFlag=0) may be signaled, and candidates for the predictor may be left and upper blocks of the current block.
[0459] Here, the list may be configured by using the position information of the left block and the position information of the upper block, and the prediction position information of the current block may be derived by applying the index sent by the signal. When two or less pieces of prediction position information are included in the list, rounding information and / or zero position information of the included prediction position information may be added to the list.
[0460] When the luminance information and the chrominance information are partitioned into the same tree structure, the position information of the chrominance block may be derived based on the position information of the luminance block. On the other hand, when the luminance information and the chrominance information are partitioned into different tree structures, the chrominance block may be partitioned into sub-blocks each having a predetermined size (e.g., 4×4), and the position information of each sub-block may be derived based on the position information of the luminance block at the corresponding position.
[0461] The derived position information may be updated to a predetermined list for use in deriving the position information of the next block. Here, the predetermined list may represent the above-mentioned “candidate list for intra-frame prediction based on position information of the previous block”. Here, it may be confirmed whether the position information to be added is already included in the list. When the same position information is included in the list, the corresponding position information is removed from the list, and the positions of the multiple pieces of position information after the removed position information are moved to fill the position of the removed position information. Then, the position information to be added may be added to the final position of the list. When there is no same position information in the list, the position information to be added may be added at the end of the list.
[0462] When the position information of the current block is derived, the information may be used to generate a prediction block of the current block. The picture to which the position information is to be applied may be a restored current picture. For example, when inter-frame prediction is performed by using the restored current picture as a reference image and using the position information as a motion vector, a prediction block of the current block may be generated from the restored current picture.
[0463] The intra prediction of the chrominance signal may be performed by using the restored luminance signal of the current block. In addition, the intra prediction of another chrominance signal Cr may be performed by using one restored chrominance signal Cb of the current block or a residual signal of Cb.
[0464] Intra prediction may be performed by combining one or more of the above prediction methods. For example, an intra prediction block of a current block may be constructed by weighting a block predicted by using a predetermined non-directional intra prediction mode and a block predicted by using a predetermined directional intra prediction mode. Here, the weight may be applied differently according to at least one of the intra prediction mode of the current block, the size of the block, and the position of the sample point.
[0465] Alternatively, in the case of a chroma block, an intra prediction block of the chroma block may be constructed by a weighted sum of a block predicted by using a predetermined intra prediction mode and a block predicted by using a restored signal of a luminance block. Here, the predetermined intra prediction mode may be one of the modes used to derive the intra prediction mode of the chroma block. In the case of the chroma block, as described above, whether a final prediction block is constructed by using a weighted sum of two prediction blocks may be signaled through encoding information.
[0466] In the case of a directional mode, based on the directional prediction mode, the reference sample points constructed above may be reconstructed. For example, when the directional prediction mode is a mode using all reference samples existing on the left or above, a one-dimensional arrangement may be configured for the left or above reference sample points. Alternatively, the above reference sample points may be constructed by moving the left reference sample points. The above reference sample points may be constructed by using a weighted sum of one or more left reference sample points.
[0467] Optionally, different directional intra predictions may be performed with a predetermined sample group of the current block as a unit. Here, the predetermined sample group unit may be a block, a sub-block, a line or a single sample.
[0468] Fig.12 is a diagram for explaining a process of performing intra prediction between color components according to an embodiment of the present invention.
[0469] According to an embodiment of the present invention, intra prediction between color components may be performed.
[0470] Reference Fig.12 , the process of performing intra prediction between color components may include reconstructing a color component block (S1210), deriving a prediction parameter (S1220), and / or performing prediction between color components (S1230). However, the process may not be limited to these steps.
[0471] The color component may represent at least one of a luminance signal, a chrominance signal, red, green, blue, Y, Cb, and Cr. The prediction of the first color component may be performed by using at least one of a second color component, a third color component, and a fourth color component. Here, the signal of the color component used for prediction may be at least one of an original signal, a restored signal, a residual signal, and a predicted signal.
[0472] When intra prediction is performed on the second color component target block, samples of a corresponding block of the first color component of the second color component target block, samples of a neighboring block of the corresponding block, or both may be used.
[0473] For example, when intra prediction is performed on the chrominance component block Cb or Cr, a reconstructed luminance component block Y corresponding to the chrominance component block may be used.
[0474] Alternatively, when intra prediction is performed on a Cr component block, a Cb component block may be used.
[0475] Optionally, when intra prediction is performed on the fourth component block, a combination of at least one or more of the first color component block, the second color component block, and / or the third color component block corresponding to the fourth component block may be used.
[0476] Whether intra prediction between color components is possible may be determined based on encoding parameters of the current block. The encoding parameters of the current block may include at least one of a slice type including the current block, whether the current block is a binary tree partition, and a size and shape of the current block.
[0477] For example, when the size of the target block is the CTU size, exceeds a predetermined size, or is within a predetermined size range, it may be determined that intra prediction between color components is implementable for the target block.
[0478] Specifically, when the current block is included in the I slice and the luminance component and the chrominance component of the current block are not binary tree partitioned, it can be determined that intra prediction between color components is implementable for the current block. The binary tree partitioning may mean partitioning the luminance component and the chrominance component of the current block according to a separate tree structure.
[0479] In addition, when the slice type of the target block is not an I slice, it may be determined that intra prediction between color components is implementable for the target block. Therefore, for example, when the slice type of the target block is a P slice or a B slice, it may be determined that intra prediction between color components is implementable for the target block.
[0480] In addition, when the shape of the target block is a predetermined shape, it may be determined that intra prediction between color components is implementable for the target block. Here, if the target block is rectangular, intra prediction between color components may not be performed, and the above embodiment may be implemented in the opposite manner.
[0481] When it is determined that intra prediction between color components is feasible for the current block, intra prediction between color components may be performed on the current block. Alternatively, when it is determined that intra prediction between color components is feasible for the current block, information about whether intra prediction between color components is applied to the current block may be separately signaled. In this case, based on the information about whether intra prediction between color components is applied to the current block, it may be finally determined whether intra prediction between color components is applied to the current block.
[0482] Whether to perform intra prediction between color components may also be determined based on at least one encoding parameter of a corresponding block of the prediction target block and a neighboring block of the corresponding block.
[0483] For example, when a corresponding block is inter-predicted in a constrained intra prediction (CIP) environment, intra prediction between color components may not be performed.
[0484] In addition, when the intra prediction mode of the corresponding block is a predetermined mode, intra prediction between color components may be performed.
[0485] In addition, whether to perform intra prediction between color components may be determined based on at least one of a plurality of pieces of CBF (Coding Block Flag) information of a corresponding block and a neighboring block. Here, the CBF information may be information showing whether a residual signal exists.
[0486] The encoding parameters are not limited to the prediction mode of the block, and various parameters available for encoding / decoding may be used.
[0487] Reference Fig.12 In order to perform intra prediction between color components, a step of reconstructing a color component block (S1210) may be performed.
[0488] When the second color component block is predicted by using the first color component block, the first color component block may be reconstructed.
[0489] 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 predicting the second color component block by using the first color component block having a different size, the first color component block may be reconstructed so that the two blocks have the same size. In this case, the reconstructed block may include at least one of a sample of the first color component corresponding block and a sample of an adjacent block.
[0490] In the above-mentioned step of constructing reference samples, an indicator (eg, intra_luma_ref_idx) corresponding to a predetermined line among a plurality of reference sample lines may be signaled. Here, in the step of reconstructing, reconstruction may be performed by using a predetermined line corresponding to the signaled indicator.
[0491] For example, when the reference sample line indicator (intra_luma_ref_idx) is 3, reconstruction may be performed by using a fourth reference sample line adjacent to the first color component corresponding block. Here, when reconstruction is performed by using two or more reference sample lines, a third reference sample line may be additionally used.
[0492] In addition, when the reference sample line indicator (intra_luma_ref_idx) is 1, reconstruction may be performed by using a second reference sample line adjacent to the first color component corresponding block.
[0493] Here, the reconstruction process may not use the reference sample line that is not indicated by the reference sample line indicator. For example, the reference sample line indicator indicates one of the first reference sample line, the second reference sample line, and the fourth reference sample line, and the third reference sample line may not be used in the reconstruction process. In other words, when intra prediction is performed on the current block, the samples corresponding to the third reference sample line may not be accessed and obtained from the memory.
[0494] When the first color component block and the second color component block have the same partitioning scheme, a method of using an indicator in a reconstruction process may be used.
[0495] For example, when both the first color component block and the second color component block in one CTU have the same single-tree partitioning scheme, an indicator-based reconstruction process may be performed.
[0496] In the reconstruction process, when at least one of a boundary of the second color component target block and a boundary of the first color component block corresponding thereto is a boundary of a predetermined area, reference samples for reconstruction may be selected differently. Here, the number of upper reference sample lines and left reference sample lines may be different. In addition, the predetermined area may be at least one of a picture, a slice, a tile, a CTU, and a CU.
[0497] For example, when the upper boundary of the first color component corresponding block is the boundary of the predetermined area, reconstruction may be performed by not using the upper reference samples but using only the left reference samples.
[0498] In addition, when the left boundary of the first color component corresponding block is the boundary of the predetermined area, reconstruction may be performed by not using the left reference samples but using only the upper reference samples.
[0499] In addition, N upper reference sample point lines and M left reference sample point lines may be used. For example, when the upper boundary is the boundary of the predetermined area, N may be 1. Alternatively, when the left boundary is the boundary of the predetermined area, M may also be 1.
[0500] In addition, regardless of whether it is a boundary of a predetermined area, reconstruction may be performed by using N upper reference sample lines and / or M left reference sample lines of the first color component corresponding block.
[0501] According to an embodiment of the present invention, in order to perform intra prediction between color components, a step of deriving prediction parameters (S1220) may be performed.
[0502] The prediction parameter may be derived by using at least one of the reference samples of the first color component corresponding block reconstructed in step S1210 and the reference samples of the second color component prediction target block. Hereinafter, in this specification, the first color component and the first color component block may respectively refer to the reconstructed first color component and the reconstructed first color component block.
[0503] For example, the prediction parameters can 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. In this article, the reference samples of the second color component can also be adaptively used based on the intra prediction mode of the block corresponding to the first color component.
[0504] According to an embodiment of the present invention, in order to perform intra prediction between color components, a step of performing prediction between color components (S1230) may be performed.
[0505] When the prediction parameters are derived in step S1220, intra prediction between color components may be performed by using at least one of the derived prediction parameters.
[0506] The prediction method between color components may also be applied to the inter-frame prediction mode. For example, when inter-frame prediction is performed on the current block, inter-frame prediction may be performed on the first color component, and prediction between color components may be performed on the second color component. For example, the first color component may be a luminance component, and the second color component may be a chrominance component.
[0507] In addition, prediction between color components may be adaptively performed according to encoding parameters of the first color component.
[0508] For example, whether to perform prediction between color components may be determined according to CBF information of the first color component. Here, the CBF information may be information showing whether a residual signal exists.
[0509] In other words, when the CBF of the first color component is 1, prediction between color components may be performed on the second color component. On the other hand, when the CBF of the first color component is 0, prediction between color components may not be performed on the second color component, but inter-frame prediction may be performed on the second color component.
[0510] In addition, a flag indicating whether prediction between color components is performed may be separately signaled. Here, whether prediction between color components is performed may be determined based on the CCLM indicator (cclm_mode_flag). For example, when the CCLM indicator (cclm_mode_flag) is 1 (or true), it may be determined that prediction between color components is performed on the chrominance block. If there is no CCLM indicator (cclm_mode_flag) value, it may be determined that prediction between color components is not performed.
[0511] When prediction between color components is performed, if an encoding mode of a first color component is an inter-prediction mode, prediction between color components may be performed on a second color component.
[0512] For example, when inter prediction is performed on the current block, inter prediction may be performed on the first color component, and prediction between color components may be performed on the second color component. Here, the first color component may be a luminance component, and the second color component may be a chrominance component.
[0513] Prediction between color components may be performed by using a reconstructed sample or a predicted sample of a luma component. For example, after performing inter-frame prediction on a luma component, prediction of a chroma component may be performed by applying a prediction parameter between color components of the predicted sample. Here, the predicted sample may refer to a sample on which at least one of motion compensation, motion correction, overlapped block motion compensation (OBMC), and bidirectional optical (BIO) streaming is performed.
[0514] Prediction between color components may be adaptively performed based on the encoding parameter of the first color component. For example, whether to perform prediction between color components may be determined based on CBF information of the first color component. The CBF information may be information showing whether a residual signal exists.
[0515] In other words, when the CBF of the first color component is 1, prediction between color components may be performed on the second color component. On the other hand, when the CBF of the first color component is 0, prediction between color components may not be performed on the second color component, but inter-frame prediction may be performed on the second color component.
[0516] In addition, a flag indicating whether prediction between color components is performed may be sent by a signal. For example, whether prediction between color components is performed may be sent by a signal in a CU or PU unit. Here, whether prediction between color components is performed may be determined based on a CCLM indicator (cclm_mode_flag).
[0517] When the encoding parameter of the first color component satisfies a predetermined condition, a flag indicating whether prediction between color components is performed may be signaled.
[0518] For example, when the CBF of the first color component is 1, whether to perform color component prediction may be determined by signaling a flag indicating whether to perform prediction between color components.
[0519] When prediction between color components is performed on the second color component, an inter-picture motion prediction or compensation value of the second color component may be used.
[0520] For example, inter-picture motion prediction or compensation of the second color component may be performed by using inter-frame prediction information of the first color component, and prediction may be performed by a weighted sum of a prediction value between color components and an inter-picture motion compensation value of the second color component.
[0521] Optionally, when the inter prediction mode of the current block is the merge mode, prediction of the second color component of the current block may be performed by a weighted sum of a value predicted using motion information corresponding to a merge index and a value predicted by performing prediction between color components.
[0522] Here, the first color component block used to perform prediction between color components may be at least one of a predicted value and a reconstructed value from inter prediction (eg, using a merge mode).
[0523] Additionally, the weight of the weighted sum can be 1:1.
[0524] Hereinafter, the step (S840) of predicting a residual signal will be described according to an embodiment of the present invention.
[0525] According to an embodiment, for the first residual signal of the current block, prediction may be performed in units of at least one of a sample line, a sample, and a predetermined group within the current block, and thus a second residual signal may be generated. Here, the first residual signal may be a signal corresponding to a difference between an original block and a predicted block, or a signal generated by decoding a transform coefficient. The second residual signal may be a signal generated by adding or subtracting the first residual signal in units of at least one of a sample line, a sample, and a predetermined group of the current block. The predetermined group may be a plurality of sample points or a plurality of sample lines.
[0526] Fig.13 2 is a diagram for explaining an example of sample point line unit prediction according to an embodiment of the present invention.
[0527] According to an embodiment, the second residual block may be generated by performing sample line unit prediction on the first residual block generated based on the difference between the original block and the predicted block. Fig.13 , which can be found in Fig.13 (b) in the vertical direction or in Fig.13 In (c), the horizontal direction Fig.13 The current block of size 8×8 shown in (a) performs sample point line unit prediction.
[0528] When the sample line unit prediction is performed in the vertical direction as shown in FIG. 13 (b), the prediction is not performed on the line 0 of the first residual block, and the line 0 of the first residual block may be assigned to the line 0 of the second residual block. In other words, the second residual block [x] [0] = the first residual block [x] [0]. Here, the residual block [x] [y] may represent the residual sample value of the coordinate (x, y).
[0529] In addition, for line n of the first residual block, the difference between line n and line n-1 as the predicted value can be generated as a second residual signal. For example, the second residual block [x][y] = the first residual block [x][y] - the first residual block [x][y-1].
[0530] Entropy encoding may be performed on the residual sample values of the second residual block.
[0531] In addition, Fig.13 Related methods of (b) can also be applied to Fig.13 (c) shows the case where sample point line unit prediction is performed in the horizontal direction.
[0532] Fig.13 (b) method and Fig.13 The method (c) may correspond to the above-mentioned vertical residual signal prediction and horizontal residual signal prediction respectively.
[0533] According to an embodiment, the second residual block may be generated by performing sample line unit prediction or reconstruction on the first residual block generated by entropy decoding. Fig.13 , can be like Fig.13 Performing sample point line unit prediction or reconstruction in the vertical direction as in (b) of Fig.13 Sample point line unit prediction or reconstruction is performed in the horizontal direction as in (c) of FIG.
[0534] When Fig.13 When the sample line unit prediction or reconstruction is performed in the horizontal direction as shown in (c), the sample line unit prediction and reconstruction are not performed on line 0 of the first residual block, and line 0 of the first residual block can be assigned to line 0 of the second residual block. In other words, the second residual block [0] [y] = the first residual block [0] [y].
[0535] In addition, for line n of the first residual block, the sum of line n and line n-1 as the predicted value can be generated as the second residual signal. For example, the second residual block [x][y] = the first residual block [x][y] + the first residual block [x-1][y].
[0536] The current block may be reconstructed by adding the generated second residual block to the prediction block generated by the intra prediction. Here, the intra prediction mode for the intra prediction may have the same direction as the sample line unit residual block prediction.
[0537] For example, when sample line-unit residual block prediction is performed in the horizontal direction, intra prediction may be performed by using mode 18 as the horizontal intra prediction mode.
[0538] As with the sample line unit prediction, a predetermined group unit residual signal prediction may be performed. The above-mentioned embodiments may be performed in the same way in an encoder and a decoder.
[0539] The above-described embodiments may be performed in the same manner in an encoder and a decoder.
[0540] At least one embodiment or a combination of the above embodiments may be used to encode / decode a video.
[0541] The order in which the above-described embodiments are applied may be different between an encoder and a decoder, or the order in which the above-described embodiments are applied may be the same in an encoder and a decoder.
[0542] The above-described embodiments may be performed on each luminance signal and each chrominance signal, or may be performed identically on the luminance signal and the chrominance signal.
[0543] The block form to which the above-described embodiment of the present invention is applied may have a square form or a non-square form.
[0544] At least one of the syntax elements (flags, indices, etc.) entropy-encoded by the encoder and entropy-decoded by the decoder may use at least one of the following binarization methods.
[0545] Truncated Rice Binarization Method
[0546] k-order Exponential Columbus Binarization Method
[0547] Restricted k-order exponential Columbus binarization method
[0548] Fixed-length binarization method
[0549] Unary Binarization Method
[0550] Truncated Unary Binarization Method
[0551] Truncated Binary Binarization Method
[0552] The above-mentioned 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-mentioned embodiments are applied, or the size may be defined as a fixed size to which the above-mentioned embodiments are applied. In addition, in the above-mentioned 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-mentioned embodiments may be applied in combination according to the size. In addition, the above-mentioned 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-mentioned embodiments may be applied when the block size is included in a specific range.
[0553] 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.
[0554] The above-described embodiments of the present invention may be applied according to time layers. In order to identify the time layers to which the above-described embodiments may be applied, a corresponding identifier may be signaled, and the above-described embodiments may be applied to the specified time layers identified by the corresponding identifier. 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-described embodiments may be applied, or may be defined as a specific layer to which the embodiments may be applied. In addition, a fixed time layer to which the embodiments may be applied may be defined.
[0555] For example, when the temporal layer of the current image is the lowest layer, the above embodiment may be applied. For example, when the temporal layer identifier of the current image is 1, the above embodiment may be applied. For example, when the temporal layer of the current image is the highest layer, the above embodiment may be applied.
[0556] A slice type or a tile group type to which the above-described embodiments of the present invention are applied may be defined, and the above-described embodiments may be applied according to the corresponding slice type or tile group type.
[0557] 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 may 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 may be added to the flowchart, or some steps may be deleted from the flowchart without affecting the scope of the present invention.
[0558] 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.
[0559] Embodiments of the present invention can be implemented in the form of program instructions that can be executed by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium may include a separate program instruction, a data file, a data structure, 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 those 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 tapes), optical data storage media (such as CD-ROMs or DVD-ROMs), magneto-optical media (such as floppy disks), and hardware devices (such as read-only memory (ROM), random access memory (RAM), flash memory, etc.) that are specifically 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. The 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.
[0560] Although the present invention has been described according to specific items such as detailed elements and limited embodiments and drawings, they are provided only to help a greater understanding of the present invention, and the present invention is not limited to the above embodiments. It will be appreciated by those skilled in the art that various modifications and changes can be made from the above description.
[0561] Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the entire scope of the claims and their equivalents will fall within the scope and spirit of the present invention.
[0562] Industrial Applicability
[0563] The present invention can be used to encode or decode images.
Claims
1. A method for decoding an image, the method comprising: Determining an intra prediction mode for a current block; deriving a reference sample of the current block; as well as Obtaining a prediction sample of the current block based on an intra prediction mode and a reference sample, Wherein, when the current block is a chrominance block, the intra-frame prediction mode of the current block is determined by referring to the intra-frame prediction mode of the corresponding luminance block, and When the corresponding luminance block is encoded by the matrix-based intra prediction MIP mode, the intra prediction mode of the corresponding luminance block is considered as a planar mode for deriving the intra prediction mode of the current block.
2. The method according to claim 1, wherein: When the corresponding luminance block is encoded by the intra block copy mode, the intra prediction mode of the corresponding luminance block is considered to be the DC mode.
3. The method according to claim 1, wherein: When the current block is a chroma block, the intra prediction mode is determined to be one of a plurality of intra prediction modes including a cross-component intra prediction mode.
4. The method according to claim 4, wherein: Whether a cross-component intra prediction mode is available for the current block is determined based on whether a tree type with respect to the current block is a single tree.
5. The method according to claim 4, wherein: Whether a cross-component intra prediction mode is available for the current block is also determined based on the size of the current block.
6. The method according to claim 1, wherein: When the current block is a luminance block, the intra prediction mode of the current block is derived from the most probable mode MPM candidate list, The MPM candidate list includes intra prediction mode candidates derived from intra prediction modes of neighboring blocks of the current block, and Among them, when the neighboring block is encoded by the MIP mode, the intra prediction mode candidate is derived by considering the intra prediction mode of the neighboring block as the planar mode.
7. The method according to claim 6, wherein: When a neighboring block is encoded by a residual prediction mode, an intra prediction mode candidate is derived by considering the intra prediction mode of the neighboring block as a horizontal mode or a vertical mode.
8. The method according to claim 1, wherein: When the prediction sample of the current block is derived by applying an interpolation filter to the reference sample, the interpolation filter is determined to be one of a first interpolation filter and a second interpolation filter.
9. The method according to claim 8, wherein: When a subblock partition flag decoded from a bitstream indicates that the current block is partitioned into a plurality of subblocks, an interpolation filter is determined to be a first interpolation filter regardless of an intra prediction mode of the current block.
10. The method according to claim 9, wherein: When the subblock partition flag indicates that the current block is partitioned into the plurality of subblocks, partition direction information indicating whether the current block is partitioned in a vertical direction or a horizontal direction is further decoded from the bitstream.
11. A method for encoding an image, the method comprising: Determining an intra prediction mode for a current block; deriving a reference sample of the current block; as well as Obtaining a prediction sample of the current block based on an intra prediction mode and a reference sample, Wherein, when the current block is a chrominance block, the intra-frame prediction mode of the current block is determined by referring to the intra-frame prediction mode of the corresponding luminance block, and When the corresponding luminance block is encoded by the matrix-based intra prediction MIP mode, the intra prediction mode of the corresponding luminance block is considered as a planar mode for deriving the intra prediction mode of the current block.
12. An apparatus for transmitting compressed video data, the apparatus comprising: a processor configured to obtain compressed video data; as well as a sending unit configured to send compressed video data, The compressed video data is obtained, including: Determining an intra prediction mode for a current block; deriving a reference sample of the current block; and Obtaining a prediction sample of the current block based on an intra prediction mode and a reference sample, Wherein, when the current block is a chrominance block, the intra-frame prediction mode of the current block is determined by referring to the intra-frame prediction mode of the corresponding luminance block, and When the corresponding luminance block is encoded by the matrix-based intra prediction MIP mode, the intra prediction mode of the corresponding luminance block is considered as a planar mode for deriving the intra prediction mode of the current block.
