Quantization matrix encoding / decoding method and apparatus, and recording medium storing bit stream
By considering various factors in the image encoding/decoding method to build a quantization matrix, the problem of limited image quality in the prior art is solved, and more efficient image encoding/decoding and quality improvement are achieved.
Patent Information
- Application Number
- CN202510129939.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-06-18
- Filing Date
- 2019-12-24
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art fails to fully consider factors such as prediction mode, color components, and size in image encoding/decoding, resulting in the limitation of the objective and subjective quality of the image.
The quantization matrix is constructed and the corresponding encoding and decoding process is performed by considering at least one of the prediction mode, color components, size, form, one-dimensional transformation type, two-dimensional transformation combination and whether to use at least one of the transformation in the image encoding/decoding method.
It improves the encoding/decoding efficiency of images, improves the objective and subjective quality of images, and can effectively store and transmit high-resolution and high-quality image data.
Smart Images

Figure CN119967176A_ABST
Abstract
Description
[0001] This application is a divisional application of an invention patent application with an application date of December 24, 2019, application number "201980086403.3", and invention name "Quantization matrix 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 a method and apparatus for encoding / decoding an image based on a quantization matrix 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.
[0005] In conventional quantization matrix encoding / decoding, since only a prediction mode, a color component, or a size is considered, there are limitations in objective image quality and subjective image quality of an image. Summary of the invention
[0006] Technical issues
[0007] An object of the present invention is to provide an image encoding / decoding method and apparatus with improved image encoding / decoding efficiency.
[0008] Another object of the present invention is to provide a method and apparatus that considers at least one of the prediction mode, color component, size, form, one-dimensional transform type, two-dimensional transform combination, or whether to use a transform, so as to improve the objective image quality and subjective image quality of an image.
[0009] Another object of the present invention is to provide a recording medium for storing a bit stream generated by the image encoding / decoding method or apparatus of the present invention.
[0010] Technical Solution
[0011] According to the present invention, a method for decoding an image includes: decoding information about a quantization matrix from a bit stream, acquiring a quantization matrix of a current block based on the information about the quantization matrix, and dequantizing the current block using the quantization matrix of the current block. The step of acquiring the quantization matrix of the current block includes: deriving a single identifier using at least one of a size, a prediction mode, or a color component of the current block, and acquiring the quantization matrix of the current block based on the single identifier.
[0012] The information about the quantization matrix may include quantization matrix prediction method information, and the quantization matrix prediction method information may be decoded in an adaptive parameter set.
[0013] The prediction modes may include an intra mode, an inter mode, and an intra block copy (IBC) mode, and a single identifier for the inter mode and a single identifier for the IBC mode may be the same.
[0014] The information about the quantization matrix may include information about whether the quantization matrix exists, and when the information about whether the quantization matrix exists indicates that the quantization matrix does not exist, all coefficient values of the quantization matrix of the current block may have a predetermined constant value.
[0015] The predetermined constant value may be 16.
[0016] The step of acquiring the quantization matrix of the current block may include adjusting coefficient values of the quantization matrix of the current block in consideration of a transform size of the current block.
[0017] The step of adjusting the coefficient values of the quantization matrix of the current block may include replacing coefficients of a region other than a first region corresponding to a transform size of the current block in the quantization matrix of the current block with 0.
[0018] The first area may be located at an upper left side of the quantization matrix of the current block.
[0019] The step of acquiring the quantization matrix of the current block may include acquiring a default quantization matrix based on the information about the quantization matrix, and all coefficient values of the default quantization matrix may have predetermined constant values regardless of the size of the current block.
[0020] The step of acquiring the quantization matrix of the current block may include performing subsampling on the reconstructed primary quantization matrix based on the information about the quantization matrix, and the subsampling may be performed in at least one of a horizontal direction or a vertical direction of the primary quantization matrix.
[0021] According to the present invention, a method for encoding an image may include: determining a quantization matrix of a current block, quantizing the current block using the quantization matrix of the current block, and encoding information about the quantization matrix of the current block. The step of encoding the information about the quantization matrix of the current block includes: deriving a single identifier using at least one of a size, a prediction mode, or a color component of the current block, and encoding the information about the quantization matrix of the current block based on the single identifier.
[0022] The information about the quantization matrix of the current block may include quantization matrix prediction method information, and the quantization matrix prediction method information may be encoded in an adaptive parameter set.
[0023] The prediction modes may include an intra mode, an inter mode, and an intra block copy (IBC) mode, and a single identifier for the inter mode and a single identifier for the IBC mode may be the same.
[0024] When the quantization matrix of the current block does not exist, all coefficient values of the quantization matrix of the current block may have predetermined constant values.
[0025] The predetermined constant value may be 16.
[0026] The encoding of the information about the quantization matrix of the current block may include adjusting coefficient values of the quantization matrix of the current block in consideration of a transform size of the current block.
[0027] The step of adjusting the coefficient values of the quantization matrix of the current block may include replacing coefficients of a region other than a first region corresponding to a transform size of the current block in the quantization matrix of the current block with 0.
[0028] The first area may be located at an upper left side of the quantization matrix of the current block.
[0029] The step of encoding the information about the quantization matrix of the current block may include encoding the information about the quantization matrix of the current block based on a default quantization matrix, and all coefficient values of the default quantization matrix may have predetermined constant values regardless of the size of the current block.
[0030] According to the present invention, a non-transitory computer-readable recording medium for storing a bit stream generated by an image encoding method, wherein the image encoding method includes: determining a quantization matrix of a current block, quantizing the current block using the quantization matrix of the current block, and encoding information about the quantization matrix of the current block. The step of encoding the information about the quantization matrix of the current block includes: deriving a single identifier using at least one of a size, a prediction mode, or a color component of the current block, and encoding the information about the quantization matrix of the current block based on the single identifier.
[0031] Beneficial Effects
[0032] According to the present invention, an image encoding / decoding method and apparatus with improved image encoding / decoding efficiency can be provided.
[0033] According to the present invention, a method and apparatus can be provided that considers at least one of a prediction mode, a color component, a size, a form, a one-dimensional transform type, a two-dimensional transform combination, or whether to use a transform, so as to improve the objective image quality and the subjective image quality of an image.
[0034] According to the present invention, there can be provided a recording medium storing a bit stream generated by the image encoding / decoding method or apparatus of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0036] Figure 2 is a block diagram showing a configuration of a decoding device according to an embodiment to which the present invention is applied.
[0037] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded.
[0038] Figure 4 is a diagram illustrating an intra prediction process.
[0039] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0040] Figure 6 is a diagram illustrating transform and quantization processing.
[0041] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0042] Figure 8a is a diagram illustrating a method of operating an apparatus for encoding a quantization matrix according to an embodiment of the present invention.
[0043] Figure 8b is a diagram illustrating a method of operating an apparatus for decoding a quantization matrix according to an embodiment of the present invention.
[0044] Figures 9 to 17 is a diagram illustrating a quantization matrix according to an embodiment of the present invention.
[0045] Figures 18 to 20 is a diagram illustrating syntax elements for signaling information on whether a quantization matrix is used in a parameter set according to an embodiment of the present invention.
[0046] Figure 21 to Figure 26 is a diagram illustrating a default matrix used in a quantization / dequantization process according to an embodiment of the present invention.
[0047] Figures 27 to 59 is a diagram illustrating a process of entropy encoding / decoding quantization matrix prediction method information according to an embodiment of the present invention.
[0048] Figure 60 to Figure 61 is a diagram illustrating a process of performing inter-quantization matrix prediction based on a block size according to an embodiment of the present invention.
[0049] Figure 62 to Figure 64 is a diagram illustrating a mapping table refMap according to an embodiment of the present invention.
[0050] Figures 65 to 73 is a diagram illustrating a scanning method for quantization matrix coefficients according to an embodiment of the present invention.
[0051] Figure 74 to Figure 76 is a diagram illustrating a process of reconstructing a quantization matrix according to an embodiment of the present invention.
[0052] Figures 77 to 88 It is a diagram illustrating syntax element information, semantics of the syntax element information, and encoding / decoding processing required to implement a quantization matrix encoding / decoding method and apparatus and a recording medium storing a bit stream according to an embodiment of the present invention.
[0053] Figures 89 to 100 is a diagram illustrating a default matrix used in a quantization / dequantization process according to an embodiment of the present invention.
[0054] Figures 101 to 134 A diagram illustrating syntax element information, semantics of the syntax element information, and encoding / decoding processing required to implement a quantization matrix encoding / decoding method and apparatus and a recording medium storing a bitstream according to another embodiment of the present invention.
[0055] Fig.135 is a flowchart illustrating an image decoding method according to another embodiment of the present invention.
[0056] Fig.136 is a flowchart illustrating an image encoding method according to another embodiment of the present invention. DETAILED DESCRIPTION
[0057] 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).
[0058] 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.
[0059] 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.
[0060] 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 divided 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 divided are also included in the scope of the present invention.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] 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".
[0065] Hereinafter, the terms "motion picture" and "video" may be used as the same meaning and may be replaced with each other.
[0066] 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.
[0067] Hereinafter, the terms "image", "picture", "frame" and "screen" may be used as the same meaning and may be replaced with each other.
[0068] 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.
[0069] 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.
[0070] In the following, the terms "region" and "segment" are used interchangeably.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] Description of terms
[0075] Encoder: This refers to a device that performs encoding. In other words, it refers to an encoding device.
[0076] Decoder: Refers to a device that performs decoding. In other words, it refers to a decoding device.
[0077] 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.
[0078] 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.
[0079] 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-division units during encoding or decoding, a unit may represent a sub-division 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.
[0080] 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.
[0081] When the size of the coding block is within a predetermined range, it can be divided 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 divided 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 divide 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 divide using only quadtree partitioning. Here, the block to be divided may be at least one of a coding block and a transform block. In this case, the information indicating the division 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 divide 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.
[0082] 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.
[0083] 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.
[0084] 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.
[0085] 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.
[0086] Bitstream: can represent a stream of bits including coded image information.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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.
[0096] A picture may be partitioned into one or more tile rows and one or more tile columns.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] A slice may include one or more tiles within a picture, and may include one or more partitions within a tile.
[0101] Parsing: may mean determining the value of a syntax element by performing entropy decoding, or may mean the entropy decoding itself.
[0102] 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.
[0103] Prediction mode: may be information indicating a mode for encoding / decoding using intra prediction or a mode for encoding / decoding using inter prediction.
[0104] 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 splitting a prediction unit may also be prediction units.
[0105] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.
[0106] 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).
[0107] 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.
[0108] 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.
[0109] The reference picture index may refer to an index indicating a specific reference picture in a reference picture list.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] The motion vector candidate list may mean a list consisting of one or more motion vector candidates.
[0115] 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.
[0116] The motion information may represent information including at least one of items including a motion vector, a reference picture index, an inter prediction indicator, a prediction list utilization flag, a reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.
[0117] The merge candidate list may mean a list consisting of one or more merge candidates.
[0118] 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.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] Quantization matrix coefficients: can represent each element in the quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.
[0130] Default matrix: may represent a predetermined quantization matrix predefined in an encoder or a decoder.
[0131] Non-default matrix: may denote a quantization matrix that is not predefined in the encoder or decoder but is signaled by the user.
[0132] 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.
[0133] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0134] 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.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] 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.
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] When entropy coding is applied, symbols are represented so that a smaller number of bits are assigned to symbols with a high probability of generation, and a larger number of bits are assigned to symbols with a low probability of generation, and therefore, the size of the bit stream for the symbol to be encoded can be reduced. The entropy coding unit 150 may use a coding method for entropy coding such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 may perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 may derive a binarization method of a target symbol and a probability model of a target symbol / binary bit, and perform arithmetic coding by using the derived binarization method and context model.
[0147] 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.
[0148] 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.
[0149] 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] The deblocking filter may remove block distortion generated in the boundary between blocks. In order to determine whether to apply the deblocking filter, it may be determined whether to apply the deblocking filter to the current block based on the samples included in the number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter may be applied according to the required deblocking filter strength.
[0154] 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.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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.
[0164] 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.
[0165] 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.
[0166] 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.
[0167] 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 .
[0168] 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.
[0169] 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.
[0170] 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.
[0171] 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.
[0172] 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.
[0173] 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.
[0174] 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.
[0175] 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.
[0176] 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.
[0177] 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 1:2:1 in the horizontal size or the vertical size. 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.
[0178] 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.
[0179] 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 the coding blocks 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.
[0180] 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).
[0181] 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.
[0182] 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.
[0183] 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.
[0184] 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.
[0185] 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.
[0186] The partition indication information, the partition tree information and the partition direction information may all be flags having a predetermined length (eg, one bit).
[0187] 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.
[0188] 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.
[0189] 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.
[0190] 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.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] 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.
[0196] For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not include the quad partition information. Therefore, the quad partition information may be inferred from the second value.
[0197] 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 from the second value.
[0198] Optionally, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or is twice as large as the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but may be derived from the second value. This is because when the coding unit is partitioned 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.
[0199] 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 divided 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 division may be limited.
[0200] - N×M (N and / or M is 128) ternary tree partitions for coding units
[0201] - 128×N (N<=64) binary tree partitions in the horizontal direction for coding units
[0202] - N×128 (N<=64) binary tree partitions in the vertical direction for coding units
[0203] Optionally, when the depth of the coding unit corresponding to the node of the multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be sent by a signal, but the multi-type tree partition indication information may be inferred from the second value.
[0204] Optionally, only when at least one of vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is possible for a coding unit corresponding to a node of a multi-type tree, a multi-type tree partition indication information may be signaled. Otherwise, the coding unit may not be partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but may be inferred from the second value.
[0205] Optionally, partition direction information may be signaled only when both vertical binary tree partitioning and horizontal binary tree partitioning or both vertical ternary tree partitioning and horizontal ternary tree partitioning are possible for a coding unit corresponding to a node of a multi-type tree. Otherwise, partition direction information may not be signaled, but may be derived from a value indicating a possible partition direction.
[0206] Optionally, partition tree information may be signaled only when both vertical binary tree partitioning and vertical ternary tree partitioning or both horizontal binary tree partitioning and horizontal ternary tree partitioning are possible for a coding tree corresponding to a node of a multi-type tree. Otherwise, partition tree information may not be signaled but may be inferred from a value indicating a possible partition tree structure.
[0207] Figure 4 is a diagram illustrating an intra prediction process.
[0208] Figure 4 The arrows from the center to the outside in FIG. 1 represent the prediction direction of the intra prediction mode.
[0209] 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.
[0210] 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.
[0211] 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.
[0212] 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.
[0213] 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 with 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 greater than 1, including non-angle modes and angle modes.
[0214] In order to perform intra prediction on the current block, a step of determining whether a sample included in the 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 among the samples included in the reconstructed neighboring block, or performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, so that the replaced sample value is used as the reference sample of the current block.
[0215] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0216] like Figure 7 As shown, at least one of the reference sample line 0 to the reference sample line 3 can be used for intra prediction of the current block. Figure 7 In the example, the samples of fragment A and fragment F may be filled with the samples closest to fragment B and fragment E, respectively, instead of being retrieved from the reconstructed neighboring blocks. Index information indicating the reference sample line to be used for intra prediction of the current block may be signaled. When the upper boundary of the current block is the boundary of the CTU, only the reference sample line 0 may be available. Therefore, in this case, the index information may not be signaled. When reference sample lines other than the reference sample line 0 are used, filtering for the prediction block, which will be described later, may not be performed.
[0217] When intra prediction is performed, a filter may be applied to at least one of a reference sample and a prediction sample based on an intra prediction mode and a current block size.
[0218] 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 sample and the upper right reference sample and the lower left reference sample of the current block. In addition, in the case of the DC mode, when generating the prediction block of the current block, the average value of the upper reference sample and the left reference sample of the current block may be used. In addition, in the case of the angular mode, the prediction block may be generated by using the upper reference sample, the left reference sample, the upper right reference sample and / or the lower left reference sample of the current block. In order to generate the prediction sample value, interpolation of real number units may be performed.
[0219] 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, subsampling may be performed on the reconstruction block of the first color component and the neighboring samples of the corresponding reconstruction block. For example, when one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component may be subsampled to calculate one corresponding sample. In this case, parameter derivation of the linear model and intra prediction between color components may be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of the template may be signaled as an intra prediction mode.
[0220] 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.
[0221] 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.
[0222] 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.
[0223] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0224] 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).
[0225] 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.
[0226] Hereinafter, embodiments of inter-picture prediction will be described in detail.
[0227] Reference pictures and motion information may be used to perform inter-picture prediction or motion compensation.
[0228] 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.
[0229] 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 prediction include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, triangle partition mode, inter-intra combined prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.
[0230] 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.
[0231] 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.
[0232] 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.
[0233] 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 through the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.
[0234] 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.
[0235] 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).
[0236] 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.
[0237] 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.
[0238] 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.
[0239] 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.
[0240] 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.
[0241] The triangular partition mode may denote a mode of deriving motion information by partitioning the current block into diagonal directions, deriving each prediction sample using each of the derived motion information, and deriving the prediction sample of the current block by weighting each of the derived prediction samples.
[0242] 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.
[0243] 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.
[0244] The decoding apparatus 200 may compensate for prediction samples derived through inter-frame prediction using optical flow.
[0245] Figure 6 is a diagram illustrating transform and quantization processing.
[0246] 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.
[0247] 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.
[0248] 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.
[0249] 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.
[0250] 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.
[0251] 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 divided 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 by intra-frame prediction can be used to generate the reconstructed block without mapping / inverse mapping.
[0252] 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 division of the luminance component and the division of the chroma component follow the same tree structure. Scaling can be performed based on the average value of the sample value 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 value 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.
[0253] Information indicating whether mapping / inverse mapping of luma components and chroma components is available may be signaled through a sequence parameter set.
[0254] 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.
[0255] In an encoder, in order to improve the subjective / objective quality of an image, based on a quantization matrix, quantization matrix coefficient values that differ between spatial frequencies may be used as transform coefficients in a block in the quantization process.
[0256] In the decoder, based on the quantization matrix, quantization matrix coefficient values that differ between spatial frequencies may be used as transform coefficients in the block in an inverse quantization process.
[0257] Here, inverse quantization may represent scaling. In addition, a quantization matrix may represent a scaling list.
[0258] In the quantization and inverse quantization process, a default matrix predefined in the encoder and the decoder may be used as a quantization matrix. Here, the default matrix may be a default quantization matrix. Regardless of the prediction mode, color component, block size, etc., all matrix coefficient values of the default matrix may have a constant value. For example, the constant value may be a positive integer and may be 16.
[0259] In addition, in the encoder, a user-defined quantization matrix may be used. In this case, the user-defined quantization matrix may be referred to as a non-default matrix, and the quantization matrix may be encoded by the encoder and signaled to the decoder in the form of a bitstream. Here, the non-default matrix may represent a non-default quantization matrix.
[0260] Here, the quantization matrix may represent at least one of a default matrix, a non-default matrix, a reference matrix, and the like.
[0261] Figure 8a is a diagram illustrating a method of operating an apparatus for encoding a quantization matrix according to an embodiment of the present invention, and Figure 8b is a diagram illustrating a method of operating an apparatus for decoding a quantization matrix according to an embodiment of the present invention.
[0262] In the following, the following will be described in detail Figure 8a and Figure 8b every step.
[0263] Hereinafter, the steps of constructing a quantization matrix will be described.
[0264] According to one embodiment, a quantization matrix to be used in a quantization / dequantization process of at least one block in a block may be constructed. Here, a block may represent at least one of a coding unit (CU), a coding block (CB), a prediction unit (PU), a prediction block (PB), a transform unit (TU), or a transform block (TB).
[0265] The encoder and / or decoder may use a predefined default matrix to construct a quantization matrix required for quantization / inverse quantization processing. At this time, a reference matrix identifier as information on whether the default matrix is used may be signaled from the encoder to the decoder.
[0266] The user can use the non-default matrix input to the encoder to construct the quantization matrix required for the quantization / dequantization process. At this time, at least one of the following items can be sent to the decoder by signaling from the encoder: a reference matrix identifier as information about the non-default matrix, a DC matrix coefficient, a lowest frequency matrix coefficient, and a difference between the previously encoded / decoded quantization matrix coefficient value and the quantization matrix coefficient value to be encoded / decoded in the quantization matrix.
[0267] The quantization matrix may be constructed so that different quantization matrices are used in the quantization / inverse quantization process based on at least one of a prediction mode, a color component, a size, a form, a one-dimensional transform type, a two-dimensional transform combination, or whether a transform is used of the block. At this time, at least one coefficient in the quantization matrix may vary according to at least one of a prediction mode, a color component, a size, a form, a one-dimensional transform type, a two-dimensional transform combination, or whether a transform is used of the block.
[0268] The prediction mode may indicate a prediction mode of a block, and may indicate in which mode encoding / decoding is performed among an intra prediction mode, an inter prediction mode, or an intra block copy (IBC) mode.
[0269] In addition, the quantization matrix constructed based on the IBC mode may be equal to the quantization matrix constructed based on the inter prediction mode. That is, the quantization matrix constructed based on the inter prediction mode may be used for the block encoded / decoded in the IBC mode.
[0270] In addition, the quantization matrix reconstructed based on the IBC mode may be equal to the quantization matrix reconstructed based on the inter prediction mode. That is, the quantization matrix reconstructed based on the inter prediction mode may be used for a block encoded / decoded in the IBC mode.
[0271] In addition, a quantization matrix indicator (matrixId) for a quantization matrix corresponding to an IBC mode may be equal to a quantization matrix indicator for a quantization matrix corresponding to an inter-prediction mode. In addition, a quantization matrix indicator for a quantization matrix corresponding to an IBC mode may be different from a quantization matrix indicator for a quantization matrix corresponding to an intra-prediction mode. Here, matrixId may be determined according to a prediction mode, a color component, a size of a block (a width of a block and / or a height of a block), or at least one of a larger value of a width of a block and a height of a block.
[0272] For example, when a prediction block is generated by performing intra prediction and inter prediction in a specific mode, the specific mode may indicate an inter prediction mode.
[0273] In another example, when the current image is used as a reference image and the vector is used during prediction in a specific mode, the specific mode may represent an inter-prediction mode. Here, the mode in which the current image is used as a reference image and the vector is used during prediction may represent an IBC mode.
[0274] Here, the IBC mode means a mode in which a reference region is set in the current image / sub-picture / slice / tile / tile group / CTU, a position in the reference region is indicated by a block vector, and prediction is performed using the region indicated by the block vector.
[0275] The color component may represent a color component of a block and represent a luma Y or chroma component.
[0276] For example, the chrominance component may represent at least one of a Cb component or a Cr component, that is, a Y component, a Cb component, or a Cr component.
[0277] In another example, the chrominance component may represent at least one of an R component, a G component, or a B component.
[0278] In another example, when an image is decomposed into various components and encoded / decoded, a chrominance component may represent each of the decomposed components.
[0279] The size may represent at least one of a block size, a transform size, or a quantization matrix size.
[0280] Here, the transform size may represent a transform size for a corresponding block. The transform size may be equal to or smaller than the block size.
[0281] Here, the quantization matrix size may represent the quantization matrix size for the corresponding block. The quantization matrix size may be smaller than or equal to the corresponding block size. The quantization matrix size may be smaller than or equal to the transform size.
[0282] The size may be a size of M×N, such as 2×2, 4×2, 2×4, 4×4, 8×4, 8×2, 2×8, 4×8, 8×8, 16×8, 16×4, 16×2, 2×16, 4×16, 8×16, 16×16, 32×16, 32×8, 32×4, 32×2, 2×32, 4×32, 8×32, 16×32, 32×32, 64×32, 64×16, 64×8, 64×4, 64×2, 2×64, 4×64, 8×64, 16×64, 32×64, 64×64, 128×64, 128×32, 32×128, 64×128, or 128×128. Here, M and N may be positive integers and may be equal to or different from each other. In addition, M may have a size of S*N. N may have a size of S*M. Here, S may be a positive integer.
[0283] For example, in the case where the size of the block is 64×64, a transform of a size of 32×32 may be performed in the upper left region of the block. At this time, a quantization matrix of a size of 32×32 may be used.
[0284] In another example, in the case where the size of the block is 64×32, a transform of a size of 32×32 may be performed in the upper left region of the block. At this time, a quantization matrix of a size of 32×32 may be used.
[0285] In another example, in the case where the size of the block is 32×64, a transform of a size of 16×32 may be performed in the upper left region of the block. At this time, a quantization matrix of a size of 16×32 may be used.
[0286] In another example, in the case where the size of the block is 32×32, a transform of a size of 32×32 may be performed in the block. At this time, a quantization matrix of a size of 32×32 may be used.
[0287] The size of the quantization matrix may be derived based on the size of the transform block. For example, a non-square quantization matrix may be derived for a non-square transform block. At this time, when deriving a non-square quantization matrix for a non-square transform block, a square quantization matrix may be used to derive the non-square quantization matrix.
[0288] The form may represent at least one of a block form, a transform form, or a quantization matrix form.
[0289] Here, the form may be a square form or a non-square form.
[0290] Here, the square form may mean a square form.
[0291] Here, the non-square form may mean a rectangular form.
[0292] Here, the transform form may represent a form of transform for the corresponding block. When the horizontal transform size and the vertical transform size are different from each other, the transform form may be a non-square form. In addition, when the horizontal transform size and the vertical transform size are the same, the transform form may be a square form. The transform form may be the same as or different from the form of the corresponding block.
[0293] Here, the form of the quantization matrix may represent the form of the quantization matrix used for the corresponding block. When the horizontal transform size and the vertical transform size are different from each other, the form of the quantization matrix may be a non-square form. In addition, when the horizontal transform size and the vertical transform size are the same, the form of the quantization matrix may be a square form. The form of the quantization matrix may be the same as or different from the form of the corresponding block. The form of the quantization matrix may be the same as or different from the form of the transform.
[0294] For example, in the case where the size of a square block is 64×64, a square transform of a size of 32×32 may be performed in the upper left region of the block. At this time, a square quantization matrix of a size of 32×32 may be used.
[0295] In another example, in the case where the size of the square block is 16×16, a square transform of a size of 16×16 may be performed in the block. At this time, a square quantization matrix of a size of 16×16 may be used.
[0296] In another example, when the size of the non-square block is 16×4, a transform of size 16×4 may be performed in the block. At this time, a quantization matrix of size 16×4 may be used.
[0297] In another example, when the size of the non-square block is 2×8, a transform of size 2×8 may be performed in the block. At this time, a quantization matrix of size 2×8 may be used.
[0298] The primary transform may represent at least one of DCT-J or DST-K based integer transforms, such as DCT-2, DCT-8, DST-7, DCT-4, or DST-4, performed in the residual block to generate transform coefficients. Here, J and K may be positive integers.
[0299] The primary transform may be performed using a transform matrix extracted from a transform matrix of at least one integer transform based on DCT-J or DST-K (such as DCT-2, DCT-8, DST-7, DCT-4 or DST-4). That is, the primary transform may be performed using the extracted transform matrix. In addition, at least one of the coefficients in the extracted transform matrix may be equal to at least one of the coefficients in the transform matrix of at least one integer transform based on DCT-J or DST-K (such as DCT-2, DCT-8, DST-7, DCT-4 or DST-4). In addition, the extracted transform matrix may be included in the transform matrix to be extracted. In addition, the extracted transform matrix may be obtained by performing at least one of flipping or sign change for a specific coefficient in the transform matrix to be extracted.
[0300] For example, at least one integer transform based on DCT-J or DST-K (such as DCT-8, DST-7, DCT-4, or DST-4) may be extracted from the transform matrix of DCT-2 and may be used for the primary transform.
[0301] Here, at least one integer transform based on DCT-J or DST-K (such as DCT-2, DCT-8, DST-7, DCT-4, or DST-4) may have coefficients in a transform matrix that are different from at least one integer transform based on DCT-J or DST-K (such as DCT-2, DCT-8, DST-7, DCT-4, or DST-4).
[0302] For example, a DCT-8 based integer transform matrix may be derived by performing horizontal flipping on a DST-7 based integer transform matrix and performing a sign change on at least one coefficient of the DST-7 transform matrix coefficients. In this case, vertical flipping may be used instead of horizontal flipping.
[0303] In another example, a DST-7 based integer transform matrix may be derived by performing horizontal flipping on a DCT-8 based integer transform matrix and performing a sign change on at least one coefficient of the DCT-8 transform matrix coefficients. In this case, vertical flipping may be used instead of horizontal flipping.
[0304] In another example, a DCT-4 based integer transform matrix may be derived by performing horizontal flipping on a DST-4 based integer transform matrix and performing a sign change on at least one coefficient of the DST-4 transform matrix coefficients. In this case, vertical flipping may be used instead of horizontal flipping.
[0305] In another example, the DST-4 based integer transform matrix may be derived by performing horizontal flipping on the DCT-4 based integer transform matrix and performing a sign change on at least one coefficient of the DST-4 transform matrix coefficients. In this case, vertical flipping may be used instead of horizontal flipping.
[0306] The secondary transform may mean a transform for rotating at least one of the transform coefficients based on an angle. The secondary transform may be performed after the primary transform. In addition, the secondary transform may be performed on a portion of the region where the primary transform is performed.
[0307] When the secondary transform is performed, the quantization matrix coefficients in the quantization / dequantization process may all have a value K. Here, K may be a positive integer, and may be, for example, 16. The value of K may be a default quantization matrix coefficient value predefined in the encoder / decoder.
[0308] In addition, when the secondary transform is performed, information about whether the quantization matrix coefficients are all set to the value K may be signaled from the encoder to the decoder. Here, the information may refer to information indicating whether the quantization matrix is applied to the block encoded / decoded using the secondary transform.
[0309] At this time, when all matrix coefficient values in the quantization matrix have the value K, this may mean that the quantization matrix is not used in the quantization / inverse quantization process.
[0310] Whether the transform is used may indicate whether at least one of the primary transform or the secondary transform is used. Whether the transform is used may include at least one of whether the primary transform is used or whether the secondary transform is used.
[0311] For example, when transform_skip_flag, which is information on whether at least one of the primary transform or the secondary transform is used, is a first value (eg, 0), this may indicate that at least one of the primary transform or the secondary transform is used.
[0312] In another example, when transform_skip_flag, which is information on whether at least one of the primary transform or the secondary transform is used, is a second value (eg, 1), this may indicate that at least one of the primary transform or the secondary transform is not used.
[0313] Here, the transform may mean at least one of a transform or an inverse transform.
[0314] The one-dimensional transform type may indicate a type of a primary transform (ie, a primary transform type) and indicate a horizontal transform type trTypeHor or a vertical transform type trTypeVer for at least one of integer transform types based on DCT-J or DST-K.
[0315] As a one-dimensional transform type, the first transform to the Nth transform may be used. Here, N may be a positive integer equal to or greater than 2.
[0316] For example, the first transform may represent a DCT-2 based integer transform.
[0317] In another example, when the first transform is used in the horizontal transform and the vertical transform, trTypeHor as the transform type for the horizontal transform and trTypeVer as the transform type for the vertical transform may have a value Q and a value R, respectively. Here, Q and R may be at least one of a negative integer, 0, or a positive integer. For example, Q and R may be 0 and 0, respectively.
[0318] In addition, for example, the second transform may represent at least one integer transform other than DCT-2 among integer transforms based on DCT-J or DST-K, such as DCT-8, DST-7, DCT-4, or DST-4. Here, J and K may be positive integers. That is, the second transform may represent at least one transform among transforms other than the first transform.
[0319] In another example, when the second transform is used in at least one of the horizontal transform or the vertical transform, trTypeHor as the transform type for the horizontal transform and trTypeVer as the transform type for the vertical transform may have a value of T and a value of U, respectively. Here, each of T and U may be at least one of a negative integer, 0, or a positive integer. For example, T and U may be a value equal to or greater than 1 and a value equal to or greater than 1, respectively. In addition, T and U may be greater than Q and R, respectively.
[0320] Also, for example, when trTypeHor is the first value, this may represent an integer horizontal transformation based on DST-7.
[0321] In another example, when trTypeHor is a second value, this may represent a DCT-8 based integer horizontal transform.
[0322] In another example, when trTypeVer is the first value, this may represent an integer vertical transform based on DST-7.
[0323] In another example, when trTypeVer is a second value, this may represent a DCT-8 based integer vertical transform.
[0324] The first value may be 1. Also, the second value may be 2.
[0325] DST-4 may be used instead of DST-7. Furthermore, DCT-4 may be used instead of DCT-8.
[0326] In addition, for example, the first transform may be an integer transform based on DCT-2. In addition, the second transform may be an integer transform based on DCT-7. In addition, the third transform may be an integer transform based on DCT-8. In addition, the second transform may represent at least one of the second transform or the third transform.
[0327] In another example, the first transform may be an integer transform based on DCT-2. In addition, the second transform may be an integer transform based on DCT-4. In addition, the third transform may be an integer transform based on DCT-4. In addition, the second transform may represent at least one of the second transform or the third transform.
[0328] That is, the first transform may be an integer transform based on DCT-2, and the second transform to the Nth transform may represent at least one integer transform other than DCT-2 among integer transforms based on DCT-J or DST-K, such as DCT-8, DST-7, DCT-4, or DST-4. Here, N may be a positive integer of 3 or more.
[0329] In addition, for example, the first transform may be an integer transform based on DCT-2. In addition, the second transform may be an integer transform based on DCT-7 extracted from an integer transform matrix based on DCT-2. In addition, the third transform may be an integer transform based on DCT-8 extracted from an integer transform matrix based on DCT-2. In addition, the second transform may be at least one of the second transform or the third transform.
[0330] In another example, the first transform may be an integer transform based on DCT-2. Furthermore, the second transform may be an integer transform based on DCT-4 extracted from an integer transform matrix based on DCT-2. Furthermore, the third transform may be an integer transform based on DCT-4 extracted from an integer transform matrix based on DCT-2. Furthermore, the second transform may be at least one of the second transform or the third transform.
[0331] That is, the first transform may be an integer transform based on DCT-2, and the second transform to the Nth transform may represent at least one integer transform extracted from the integer transform matrix based on DCT-2 in the integer transform based on DCT-J or DST-K, such as DCT-8, DST-7, DCT-4, or DST-4. Here, N may be an integer of 3 or more. In addition, the second transform may be at least one of the second transform to the Nth transform.
[0332] As an alternative to the DCT-2 transform, at least one of integer transforms based on DCT-J or DST-K, such as DCT-8, DST-7, DCT-4, or DST-4, may be used.
[0333] The two-dimensional transform combination may represent a combination of primary transforms, and may represent a combination of a horizontal transform type trTypeHor and a vertical transform type trTypeVer of at least one integer transform type based on DCT-J or DST-K integer transform types. In addition, the two-dimensional transform combination may represent mts_idx as a multi-transform selection index.
[0334] When the first transform is used in the horizontal transform and the vertical transform, mts_idx as the multi-transform selection index may have a value of P. Here, P may be at least one of a negative integer, 0, or a positive integer. For example, P may be -1.
[0335] For example, when mts_idx is -1, trTypeHor and trTypeVer may have a value of 0 and a value of 0, respectively. Alternatively, when mts_idx is 0, trTypeHor and trTypeVer may have a value of 0 and a value of 0, respectively.
[0336] When the second transform is used in at least one of the horizontal transform or the vertical transform, mts_idx as the multi-transform selection index may have a value of S or greater. Here, S may be at least one of a negative integer, 0, or a positive integer. For example, S may be 0. In addition, S may be greater than P.
[0337] For example, when mts_idx is 0, trTypeHor and trTypeVer may have a first value and a second value, respectively.
[0338] In another example, when mts_idx is 1, trTypeHor and trTypeVer may have a second value and a first value, respectively.
[0339] In another example, when mts_idx is 2, trTypeHor and trTypeVer may have a first value and a second value, respectively.
[0340] In another example, when mts_idx is 3, trTypeHor and trTypeVer may have a second value and a second value, respectively.
[0341] In addition, for example, when mts_idx is 0, trTypeHor and trTypeVer may have a first value and a second value, respectively.
[0342] In another example, when mts_idx is 1, trTypeHor and trTypeVer may have a second value and a second value, respectively.
[0343] In another example, when mts_idx is 2, trTypeHor and trTypeVer may have a third value and a second value, respectively.
[0344] In another example, when mts_idx is 3, trTypeHor and trTypeVer may have a second value and a third value, respectively.
[0345] In another example, when mts_idx is 4, trTypeHor and trTypeVer may have a third value and a third value, respectively.
[0346] The first value may be 0. Furthermore, the second value may be 1. Furthermore, the third value may be 2.
[0347] Also, for example, when trTypeHor is the first value, this may represent an integer horizontal transformation based on DST-7.
[0348] In another example, when trTypeHor is a second value, this may represent a DCT-8 based integer horizontal transform.
[0349] In another example, when trTypeVer is the first value, this may represent an integer vertical transform based on DST-7.
[0350] In another example, when trTypeVer is a second value, this may represent a DCT-8 based integer vertical transform.
[0351] The first value may be 1. Also, the second value may be 2.
[0352] DST-4 may be used instead of DST-7. Furthermore, DCT-4 may be used instead of DCT-8.
[0353] In addition, for example, in the first transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-2, respectively. In addition, in the second transform, the horizontal transform and the vertical transform may be integer transforms based on DST-7 and integer transforms based on DST-7, respectively. In addition, in the third transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-8 and integer transforms based on DST-7, respectively. In addition, in the fourth transform, the horizontal transform and the vertical transform may be integer transforms based on DST-7 and integer transforms based on DCT-8, respectively. In addition, in the fifth transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-8 and integer transforms based on DCT-8, respectively. In addition, the second transform may represent at least one of the second transform, the third transform, the fourth transform, or the fifth transform.
[0354] In another example, in the first transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-2, respectively. In addition, in the second transform, the horizontal transform and the vertical transform may be integer transforms based on DST-4 and integer transforms based on DST-4, respectively. In addition, in the third transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-4 and integer transforms based on DST-4, respectively. In addition, in the fourth transform, the horizontal transform and the vertical transform may be integer transforms based on DST-4 and integer transforms based on DCT-4, respectively. In addition, in the fifth transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-4 and integer transforms based on DCT-4, respectively. In addition, the second transform may be at least one of the second transform, the third transform, the fourth transform, or the fifth transform.
[0355] That is, in the first transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-2, respectively, and in the second transform to the Nth transform, the horizontal transform and the vertical transform may represent at least one integer transform other than DCT-2 among integer transforms based on DCT-J or DST-K, such as DCT-8, DST-7, DCT-4, or DST-4. Here, N may be a positive integer of 3 or more.
[0356] For example, in the first transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-2, respectively. In addition, in the second transform, the horizontal transform and the vertical transform may be integer transforms based on DST-7 and integer transforms based on DST-7 extracted from integer transform matrices based on DCT-2, respectively. In addition, in the third transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-8 extracted from integer transform matrices based on DCT-2 and integer transforms based on DST-7 extracted from integer transform matrices based on DCT-2, respectively. In addition, in the fourth transform, the horizontal transform and the vertical transform may be integer transforms based on DST-7 extracted from integer transform matrices based on DCT-2 and integer transforms based on DCT-8 extracted from integer transform matrices based on DCT-2, respectively. In addition, in the fifth transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-8 and integer transforms based on DCT-8 extracted from integer transform matrices based on DCT-2, respectively. In addition, the second transform may represent at least one of the second transform, the third transform, the fourth transform, or the fifth transform.
[0357] In another example, in the first transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-2, respectively. In addition, in the second transform, the horizontal transform and the vertical transform may be integer transforms based on DST-4 and integer transforms based on DST-4 extracted from integer transform matrices based on DCT-2, respectively. In addition, in the third transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-4 extracted from integer transform matrices based on DCT-2 and integer transforms based on DST-4 extracted from integer transform matrices based on DCT-2, respectively. In addition, in the fourth transform, the horizontal transform and the vertical transform may be integer transforms based on DST-4 extracted from integer transform matrices based on DCT-2 and integer transforms based on DCT-4 extracted from integer transform matrices based on DCT-2, respectively. In addition, in the fifth transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-4 and integer transforms based on DCT-4 extracted from integer transform matrices based on DCT-2, respectively. In addition, the second transform may represent at least one of the second transform, the third transform, the fourth transform, or the fifth transform.
[0358] That is, in the first transform, the horizontal transform and the vertical transform may be integer transforms based on DCT-2, respectively, and in the second transform to the Nth transform, the horizontal transform and the vertical transform may be at least one integer transform extracted from an integer transform matrix based on DCT-2, such as DCT-8, DST-7, DCT-4, or DST-4, among integer transforms based on DCT-J or DST-K. Here, N may be an integer of 3 or more. In this case, the second transform may represent at least one of the second transform to the Nth transform.
[0359] As an alternative to the DCT-2 transform, at least one of integer transforms based on DCT-J or DST-K, such as DCT-8, DST-7, DCT-4, or DST-4, may be used.
[0360] Figures 9 to 17 is a diagram illustrating a quantization matrix according to an embodiment of the present invention.
[0361] As in Fig. 9 In the example of , a quantization matrix can be constructed. For example, as in Fig. 9 In the example, a quantization matrix may be constructed based on at least one of a prediction mode, a color component, or a size.
[0362] As in Fig.10 In the example of , a quantization matrix can be constructed. For example, as in Fig.10 In the example of , the default matrix predefined in the encoder and decoder can be constructed. In addition, as in Fig.10 In the example, a quantization matrix may be constructed based on at least one of a prediction mode, a color component, or a size.
[0363] As in Fig.11 In the example of , a quantization matrix can be constructed. For example, as in Fig.11 In the example of , the default matrix predefined in the encoder and decoder can be constructed. In addition, as in Fig.11 In the example, a quantization matrix may be constructed based on at least one of a prediction mode, a color component, or a size.
[0364] As in Fig.12 In the example of , a quantization matrix can be constructed. For example, as in Fig.12 In the example of , the default matrix predefined in the encoder and decoder can be constructed. In addition, as in Fig.12 In the example, a quantization matrix may be constructed based on at least one of a prediction mode, a color component, a size, a form, or a primary transform type.
[0365] For example, when there are at least N primary transform types, K different quantization matrices may be constructed according to the primary transform types. Here, N and K may be positive integers. In addition, K may be less than or equal to N.
[0366] As in Fig.13 In the example of , a quantization matrix can be constructed. For example, as in Fig.13 In the example of , the default matrix predefined in the encoder and decoder can be constructed. In addition, as in Fig.13 In the example, a quantization matrix may be constructed based on at least one of a prediction mode, a color component, a size, a form, or a two-dimensional transform combination.
[0367] For example, when there are at least N two-dimensional transform combinations, K different quantization matrices may be constructed according to the two-dimensional transform combinations. Here, N and K may be positive integers. In addition, K may be less than or equal to N.
[0368] As in Fig.14 In the example of , a quantization matrix can be constructed. For example, as in Fig.14 In the example of , the default matrix predefined in the encoder and decoder can be constructed. In addition, as in Fig.14 In the example, a quantization matrix may be constructed based on at least one of a prediction mode, a color component, a size, a form, or a two-dimensional transform combination.
[0369] For example, when there are at least N two-dimensional transform combinations, K different quantization matrices may be constructed according to the two-dimensional transform combinations. Here, N and K may be positive integers. In addition, K may be less than or equal to N.
[0370] As in Fig.15 In the example of , a quantization matrix can be constructed. For example, as in Fig.15 In the example of , the default matrix predefined in the encoder and decoder can be constructed. In addition, as in Fig.15 In the example of , a quantization matrix may be constructed based on at least one of a prediction mode, a color component, a size, a form, or whether a transform is used.
[0371] As in Fig.16 In the example of , a quantization matrix can be constructed. For example, as in Fig.16 In the example of , the default matrix predefined in the encoder and decoder can be constructed. In addition, as in Fig.16 In the example of , a quantization matrix may be constructed based on at least one of a prediction mode, a color component, a size, a form, or whether a primary transform is used.
[0372] As in Fig.17 In the example of , a quantization matrix can be constructed. For example, as in Fig.17 In the example of , the default matrix predefined in the encoder and decoder can be constructed. In addition, as in Fig.17 In the example of , a quantization matrix may be constructed based on at least one of a prediction mode, a color component, a size, a form, or whether a secondary transform is used.
[0373] Hereinafter, encoding / decoding steps of information on whether a quantization matrix is used will be described.
[0374] Information about whether a quantization matrix is used (indicating whether a quantization matrix is used) may be encoded / decoded in at least one of a parameter set or a header. Here, the information about whether a quantization matrix is used may include at least one of whether a quantization matrix is used or whether a quantization matrix exists.
[0375] At this time, at least one of the parameter sets or headers may be at least one of a video parameter set, a sequence parameter set, an adaptation parameter set, a picture parameter set, a picture header, a slice header, a parallel block group header, or a parallel block header.
[0376] For example, in order to indicate whether a quantization matrix is used in a video, information on whether a quantization matrix is used may be entropy encoded / decoded in a video parameter set.
[0377] In another example, in order to indicate whether a quantization matrix is used in a sequence, information on whether the quantization matrix is used may be entropy encoded / decoded in a sequence parameter set.
[0378] In another example, in order to indicate whether the quantization matrix is used in several pictures, several sub-pictures, several tile groups, several tile blocks or several slices, the information about whether the quantization matrix is used may be entropy encoded / decoded in the adaptive parameter set.
[0379] In another example, in order to indicate whether a quantization matrix is used in a picture, information on whether a quantization matrix is used may be entropy encoded / decoded in a picture parameter set or a picture header.
[0380] In another example, in order to indicate whether a quantization matrix is used in a slice, information on whether a quantization matrix is used may be entropy encoded / decoded in a slice header.
[0381] In another example, in order to indicate whether a quantization matrix is used in a tile group, information on whether a quantization matrix is used may be entropy encoded / decoded in a tile group header.
[0382] In another example, in order to indicate whether a quantization matrix is used in a tile, information on whether a quantization matrix is used may be entropy encoded / decoded in a tile header.
[0383] Figures 18 to 20 is a diagram illustrating syntax elements for signaling information on whether a quantization matrix is used in a parameter set or a header according to an embodiment of the present invention.
[0384] As in Fig.18 In the example of the syntax element of, scaling_list_enable_flag as information about whether the quantization matrix is used in the sequence parameter set may be entropy encoded / decoded. At this time, the information about whether the quantization matrix is used may indicate information indicating whether the quantization matrix is used in the quantization / inverse quantization process of a specific unit in the encoder and the decoder.
[0385] For example, scaling_list_enable_flag may be encoded / decoded as a first value (eg, 0) to indicate that a quantization matrix is not used in a quantization / dequantization process of an encoder and a decoder in sequence units.
[0386] In another example, scaling_list_enable_flag may be encoded / decoded as a second value (eg, 1) to indicate that a quantization matrix is used in a quantization / dequantization process of an encoder and a decoder in sequence units.
[0387] As in Fig.18 In the example of the syntax element of , sps_scaling_list_data_present_flag as information about whether the quantization matrix exists in the sequence parameter set may be entropy encoded / decoded. At this time, the information about whether the quantization matrix exists may indicate information indicating whether the information about the quantization matrix exists in a specific unit in the bitstream. The information about whether the quantization matrix exists may be a flag. In addition, although in Fig.18 sps_scaling_list_data_present_flag is used as information on whether a quantization matrix exists, but this is merely an example and the name of the flag may be changed.
[0388] For example, sps_scaling_list_data_present_flag may be encoded / decoded as a first value (e.g., 0) to indicate that the quantization matrix does not exist in the sequence unit. At this time, when the quantization matrix does not exist, the quantization matrix coefficients in the quantization / dequantization process may all have a value K. Here, K may be a positive integer and may be, for example, 16. The value of K may be a default quantization matrix coefficient value predefined in the encoder / decoder.
[0389] In another example, sps_scaling_list_data_present_flag may be encoded / decoded as a second value (eg, 1) to indicate that the quantization matrix exists in sequence units.
[0390] As in Fig.19In the example of the syntax element of , pps_scaling_list_data_present_flag as information about whether the quantization matrix exists in the picture parameter set may be entropy encoded / decoded. At this time, the information about whether the quantization matrix exists may represent information indicating whether the information about the quantization matrix exists in a specific unit in the bitstream. The information about whether the quantization matrix exists may be a flag. In addition, although in Fig.19 pps_scaling_list_data_present_flag is used as information on whether a quantization matrix exists, but this is merely an example and the name of the flag may be changed.
[0391] For example, pps_scaling_list_data_present_flag may be encoded / decoded to a first value (e.g., 0) to indicate that the quantization matrix does not exist in the picture unit. At this time, the quantization matrix encoded / decoded in the sequence parameter set may be used in the quantization / dequantization process. Optionally, when the quantization matrix does not exist, the quantization matrix coefficients in the quantization / dequantization process may all have a value K. Here, K may be a positive integer and may be, for example, 16. The value of K may be a default quantization matrix coefficient value predefined in the encoder / decoder.
[0392] In another example, pps_scaling_list_data_present_flag may be encoded / decoded as a second value (eg, 1) to indicate that the quantization matrix exists in the picture unit. At this time, the quantization matrix encoded / decoded in the picture parameter set may be used in the quantization / inverse quantization process.
[0393] As in Fig. 20 In the example of the syntax element of , aps_scaling_list_data_present_flag as information about whether a quantization matrix exists in the adaptive parameter set may be entropy encoded / decoded. At this time, the information about whether a quantization matrix exists may represent information indicating whether the information about the quantization matrix exists in a specific unit in the bitstream. The information about whether a quantization matrix exists may be a flag. In addition, although in Fig. 20 aps_scaling_list_data_present_flag is used as information on whether a quantization matrix exists, but this is merely an example and the name of the flag may be changed.
[0394] For example, aps_scaling_list_data_present_flag may be encoded / decoded to a first value (e.g., 0) to indicate that the quantization matrix does not exist in a number of pictures, a number of sub-pictures, a number of tile groups, a number of tile blocks, or a number of slices. At this time, the quantization matrix encoded / decoded in the sequence parameter set may be used in the quantization / dequantization process. Optionally, when the quantization matrix does not exist, the quantization matrix coefficients in the quantization / dequantization process may all have a value K. Here, K may be a positive integer and may be, for example, 16. The value of K may be a default quantization matrix coefficient value predefined in the encoder / decoder.
[0395] In another example, aps_scaling_list_data_present_flag may be encoded / decoded to a second value (e.g., 1) to indicate that the quantization matrix exists in several pictures, several sub-pictures, several tile groups, several tile blocks, or several slices. At this time, the quantization matrix encoded / decoded in the adaptive parameter set may be used in the quantization / dequantization process.
[0396] In addition, in order to indicate the quantization matrix in the adaptive parameter set (APS) referenced in the picture, pic_scaling_list_aps_id may be encoded / decoded in the picture header. Figures 18 to 20 In the example, pic_scaling_list_aps_id may be encoded / decoded based on information on whether a quantization matrix exists.
[0397] Figure 21 to Figure 26 is a diagram illustrating a default matrix used in a quantization / dequantization process according to an embodiment of the present invention.
[0398] As in Figure 21 to Figure 22 In the example of , a default matrix of size J×K predefined in the encoder and decoder may be used in the quantization / dequantization process of a block of size M×N.
[0399] Different default matrices may be used in the quantization / dequantization process based on at least one of a prediction mode, a color component, a size, a form, a one-dimensional transform type, a two-dimensional transform combination, or whether a transform is used of a block. In addition, different default matrices may be predefined in the encoder and the decoder based on at least one of a prediction mode, a color component, a size, a form, a one-dimensional transform type, a two-dimensional transform combination, or whether a transform is used of a block. At this time, at least one coefficient of the coefficients of the default matrix may be different from each other according to at least one of a prediction mode, a color component, a size, a form, a one-dimensional transform type, a two-dimensional transform combination, or whether a transform is used of a block.
[0400] For example, different default matrices may be used in the quantization / inverse quantization process according to at least one of trTypeHor, trTypeVer, mts_idx, or transform_skip_flag.
[0401] In another example, different default matrices may be predefined in the encoder and the decoder according to at least one of trTypeHor, trTypeVer, mts_idx, or transform_skip_flag.
[0402] J, K, M, and N may be positive integers.
[0403] For example, at least one of J, K, M, or N may be 2.
[0404] In another example, J and M may be the same, and K and N may be the same.
[0405] In another example, as in Fig.21 In the example, at least one of J, K, M or N can be 4.
[0406] In another example, as in Fig. 22 In the example of , at least one of J or K may be 8. In addition, at least one of M or N may be greater than 8.
[0407] At this time, J may be smaller than M and K may be smaller than N.
[0408] In another example, at least one of J or K may be 16. Additionally, at least one of M or N may be greater than 16.
[0409] At this time, J may be smaller than M and K may be smaller than N.
[0410] Furthermore, J and K may be equal to or different from each other, and M and N may be equal to or different from each other.
[0411] At least one of the size of J×K or the size of M×N may be 2×2, 4×2, 2×4, 4×4, 8×4, 8×2, 2×8, 4×8, 8×8, 16×8, 16×4, 16×2, 2×16, 4×16, 8×16, 16×16, 32×16, 32×8, 32×4, 32×2, 2×32, 4×32, 8×32, 16×32, 32×32, 64×32, 64×16, 64×8, 64×4, 64×2, 2×64, 4×64, 8×64, 16×64, 32×64, 64×64, 128×64, 128×32, 32×128, 64×128, or 128×128. In addition, M may have a size of S*N. N may have a size of S*M. Here, S may be a positive integer.
[0412] At this time, i may represent a scanning order, and ScalingList[sizeId][matrixId][i] may represent a default quantization matrix coefficient corresponding to sizeId, matrixId, and i.
[0413] Similar to Figure 21 to Figure 22 For example, Figure 23 to Figure 26 In the example of , a default matrix of size J×K predefined in the encoder and decoder may be used in the quantization / dequantization process of a block of size M×N.
[0414] Here, ScalingList[sizeId][matrixId][i] may indicate a default quantization matrix coefficient corresponding to sizeId, matrixId, and i, and sizeId and matrixId may be represented in Fig.55 and Fig.56 or Fig.58 and Fig.59 Those defined in .
[0415] Hereinafter, the encoding / decoding steps of the quantization matrix prediction method information will be described.
[0416] The quantization matrix prediction method information indicating the quantization matrix prediction method type may be entropy encoded / decoded in at least one of the parameter set or the header. Here, the quantization matrix prediction method type may include at least one of a prediction encoding / decoding method of coefficients in the quantization matrix or an inter-quantization matrix prediction method (or a prediction method between quantization matrices). In addition, the inter-quantization matrix prediction method may include at least one of a default matrix use method and a reference matrix use method.
[0417] At this time, at least one of the parameter sets or headers may be at least one of a video parameter set, a sequence parameter set, an adaptation parameter set, a picture parameter set, a picture header, a slice header, a parallel block group header, or a parallel block header.
[0418] For example, quantization matrix prediction method information may be entropy encoded / decoded in an adaptive parameter set.
[0419] Furthermore, information about the adaptation parameter set identifier may be entropy encoded / decoded in the picture header.
[0420] For example, in order to indicate a quantization matrix prediction method in a video, quantization matrix prediction method information may be entropy encoded / decoded in a video parameter set.
[0421] In another example, in order to indicate the quantization matrix prediction method in a sequence, the quantization matrix prediction method information may be entropy encoded / decoded in a sequence parameter set.
[0422] In another example, in order to indicate the quantization matrix prediction method in several pictures, several sub-pictures, several tile groups, several tiles, or several slices, the quantization matrix prediction method information may be entropy encoded / decoded in an adaptive parameter set.
[0423] In another example, in order to indicate the quantization matrix prediction method in a picture, the quantization matrix prediction method information may be entropy encoded / decoded in a picture parameter set or a picture header.
[0424] In another example, in order to indicate the quantization matrix prediction method in a slice, quantization matrix prediction method information may be entropy encoded / decoded in a slice header.
[0425] In another example, in order to indicate the quantization matrix prediction method in the tile group, the quantization matrix prediction method information may be entropy encoded / decoded in the tile group header.
[0426] In another example, in order to indicate the quantization matrix prediction method in a tile, the quantization matrix prediction method information may be entropy encoded / decoded in the tile header.
[0427] In addition, information indicating whether to apply the quantization matrix to the encoding / decoding block using the secondary transform as a two-dimensional non-separable transform may be in at least one of the parameter set or the header. At this time, the parameter set may be an adaptive parameter set entropy encoded / decoded.
[0428] When the information indicating whether to apply the quantization matrix to the encoding / decoding block using the secondary transform is a first value (e.g., 0), quantization / dequantization may be performed using the quantization matrix corresponding to the corresponding block. In addition, when the information indicating whether to apply the quantization matrix to the encoding / decoding block using the secondary transform is a second value (e.g., 1) and the secondary transform is performed for the corresponding block, the quantization matrix coefficients in the quantization / dequantization process of the corresponding block may all have a value K. Here, K may be a positive integer, and may be, for example, 16. The value of K may represent a default quantization matrix coefficient value predefined in the encoder / decoder.
[0429] Figures 27 to 59 is a diagram illustrating a process of entropy encoding / decoding quantization matrix prediction method information according to an embodiment of the present invention.
[0430] As in Figures 27 to 59 In the example of the syntax element of , scaling_list_pred_mode_flag, which is the prediction method information of the quantization matrix in the sequence parameter set, the adaptation parameter set, and the picture parameter set, can be entropy encoded / decoded. At this time, as the quantization matrix prediction method during quantization matrix encoding / decoding, a prediction encoding / decoding method using coefficients in the quantization matrix or an inter-quantization matrix prediction method can be indicated.
[0431] For example, scaling_list_pred_mode_flag may be encoded / decoded as a first value (e.g., 0) to indicate an inter-quantization matrix prediction method, wherein the inter-quantization matrix prediction method uses at least one of a reference matrix usage method or a default matrix usage method for determining that a reference matrix and an encoding / decoding target quantization matrix matrixId have the same value.
[0432] At this time, the reference matrix use method may represent an inter-quantization matrix prediction method for copying reference matrix coefficient values to encoding / decoding target quantization matrix coefficient values.
[0433] In addition, the default matrix use method may represent an inter-quantization matrix prediction method for copying a default matrix coefficient value to an encoding / decoding target quantization matrix coefficient value.
[0434] In another example, scaling_list_pred_mode_flag may be encoded / decoded as a second value (e.g., 1) to indicate a predictive coding / decoding method for coefficients in a quantization matrix, wherein the predictive coding / decoding method for coefficients in a quantization matrix uses at least one of quantization matrix scanning, DPCM (differential pulse code modulation) / inverse DPCM, or exponential Golomb coding.
[0435] Also, scaling_list_copy_mode_flag and scaling_list_pred_mode_flag, which are prediction method information of a quantization matrix, may be entropy encoded / decoded in a sequence parameter set, an adaptation parameter set, and a picture parameter set.
[0436] The scaling_list_pred_mode_flag may be entropy encoded / decoded based on the value of scaling_list_copy_mode_flag. For example, when scaling_list_copy_mode_flag has a first value (eg, 0), scaling_list_pred_mode_flag may be entropy encoded / decoded.
[0437] For example, scaling_list_copy_mode_flag may be encoded / decoded as a second value (e.g., 1) to indicate an inter-quantization matrix prediction method, wherein the inter-quantization matrix prediction method uses at least one of a reference matrix usage method and a default matrix usage method for determining that a reference matrix and an encoding / decoding target quantization matrix id have the same value.
[0438] Here, id may represent matrix information corresponding to at least one of a prediction mode, a color component, a width of a transform block, or a height of a transform block. For example, id may have a value between S and T. Here, S and T may be positive integers including 0, and may be 0 and 27, respectively. In addition, id may be an identifier of a combination of matrixId and sizeId. As in the example of Table 1, id may be represented according to a prediction mode, a color component, a width of a transform block, a height of a transform block, etc.
[0439] [Table 1]
[0440]
[0441] In another example, scaling_list_copy_mode_flag may be encoded / decoded as a first value (e.g., 0) to indicate a predictive coding / decoding method for coefficients in a quantization matrix, wherein the predictive coding / decoding method for coefficients in a quantization matrix uses at least one of quantization matrix scanning, DPCM (differential pulse code modulation) / inverse DPCM, or exponential Golomb coding.
[0442] In another example, scaling_list_pred_mode_flag may be encoded / decoded to a second value (e.g., 1) to predict the encoding / decoding target quantization matrix coefficient values from the previously encoded / decoded quantization matrix. At this time, the difference between the matrix coefficient values of the current quantization matrix and the matrix coefficient values of the predicted quantization matrix may be signaled from the encoder to the decoder for each matrix component.
[0443] For example, the decoding target quantization matrix coefficient value may be acquired based on scaling_list_pred_id_delta indicating a reference quantization matrix identifier of an encoding / decoding target quantization matrix.
[0444] For example, when scaling_list_pred_id_delta has a first value (eg, 0), a decoding target quantization matrix may be acquired based on a default matrix.
[0445] In another example, when scaling_list_pred_id_delta has a second value (eg, a non-zero positive integer), the encoding / decoding quantization matrix indicated by refId may be determined as a reference quantization matrix of a decoding target quantization matrix, and the decoding target quantization matrix may be acquired based on the reference quantization matrix.
[0446] In addition, scaling_list_pred_id_delta may be encoded in the parameter set. At this time, the reference quantization matrix identifier scaling_list_pred_id_delta may be determined using id indicating the encoding target quantization matrix and refId indicating the reference quantization matrix. For example, this may be represented as refId=id_scaling_list_pred_id_delta[id].
[0447] In addition, scaling_list_pred_id_delta information indicating a reference quantization matrix identifier of a decoding target quantization matrix may be decoded in a parameter set. At this time, using a reference quantization matrix identifier (scaling_list_pred_id_delta) and an id indicating a decoding target quantization matrix, a reference quantization matrix refId of a decoding target quantization matrix may be determined. For example, this may be represented as refId=id-scaling_list_pred_id_delta[id].
[0448] In addition, all matrix coefficient values of the default matrix may have a constant value regardless of the prediction mode, color component, block size, etc. For example, the constant value may be a positive integer and may be 16.
[0449] When scaling_list_pred_id_delta[id] has a first value (e.g., 0), prediction values used to predict or copy the quantization matrix may all have a constant value. For example, the constant value may be a positive integer and may be 16. At this time, the prediction value may be set to a value of a matrix coefficient of the quantization matrix.
[0450] In addition, the quantization matrix of size 2×2 for intra chroma components may be removed from the default matrix list, and the user-defined quantization matrix may not be encoded / decoded for the quantization matrix of size 2×2 for intra prediction blocks. Here, the user-defined quantization matrix may represent a quantization matrix signaled by a user. The quantization matrix of size 2×2 for intra prediction blocks may be a quantization matrix of size 2×2 for chroma intra prediction blocks.
[0451] When both scaling_list_copy_mode_flag and scaling_list_pred_mode_flag have the first value (e.g., 0), the prediction values used to predict or copy the quantization matrix may all have a constant value. For example, the constant value may be a positive integer and may be 8. By adding the difference value to the prediction value, the matrix coefficient in the quantization matrix may be calculated.
[0452] When scaling_list_copy_mode_flag has the second value (eg, 1), the difference values may all be set to zero.
[0453] In addition, all matrix coefficients in the quantization matrix may have a constant value in at least one of the following cases: the case where the information about whether the quantization matrix is used has a first value (e.g., 0) indicating that the quantization matrix is not used, the case where the information about whether the quantization matrix exists has a first value (e.g., 0) indicating that the quantization matrix does not exist in the bitstream, or the case where the transform skip mode of the current block has a second value (e.g., 1) indicating that the transform skip mode is used. For example, the constant value may be a positive integer and may be 16.
[0454] As in Figure 27 to Figure 29 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode or a color component.
[0455] For example, sizeId may have values from U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may have positive integers including 0.
[0456] Here, J and K may be 4, and M and N may be 32.
[0457] Here, U and V can be 0 and 3 respectively.
[0458] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0459] Here, P and Q may be 0 and 5 respectively.
[0460] As in Figure 30 to Figure 32 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode or a color component.
[0461] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0462] Here, J and K can be 2, and M and N can be 64.
[0463] Here, U and V can be 0 and 5 respectively.
[0464] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0465] Here, P and Q may be 0 and 5, respectively.
[0466] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, or 5. Also, when sizeId is 5, matrixId may have a value of at least one of 0 or 3.
[0467] As in Figure 33 to Figure 35 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode, a color component, or a one-dimensional transform type.
[0468] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0469] Here, J and K can be 2, and M and N can be 64.
[0470] Here, U and V can be 0 and 5 respectively.
[0471] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0472] Here, P and Q may be 0 and 7, respectively.
[0473] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, or 5. In addition, when sizeId is 1 to 4, matrixId may have a value of at least one of 0 to 7. In addition, when sizeId is 6 to 7, matrixId may have a value of at least one of 1 to 4. In addition, when sizeId is 5, matrixId may have a value of at least one of 0 or 3.
[0474] As in Figure 36 to Figure 38 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode, a color component, or a one-dimensional transform type.
[0475] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0476] Here, J and K can be 2, and M and N can be 64.
[0477] Here, U and V can be 0 and 5 respectively.
[0478] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0479] Here, P and Q may be 0 and 9, respectively.
[0480] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, or 5. In addition, when sizeId is 1 to 4, matrixId may have a value of at least one of 0 to 9. In addition, when sizeId is 6 to 9, matrixId may have a value of at least one of 1 to 4. In addition, when sizeId is 5, matrixId may have a value of at least one of 0 or 3.
[0481] As in Figure 39 to Figure 41 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode, a color component, or a two-dimensional transform combination.
[0482] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0483] Here, J and K can be 2, and M and N can be 64.
[0484] Here, U and V can be 0 and 5 respectively.
[0485] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0486] Here, P and Q may be 0 and 7, respectively.
[0487] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, or 5. In addition, when sizeId is 1 to 4, matrixId may have a value of at least one of 0 to 7. In addition, when sizeId is 6 to 7, matrixId may have a value of at least one of 1 to 4. In addition, when sizeId is 5, matrixId may have a value of at least one of 0 or 3.
[0488] As in Figure 42 to Figure 44In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode, a color component, or a two-dimensional transform combination.
[0489] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0490] Here, J and K can be 2, and M and N can be 64.
[0491] Here, U and V can be 0 and 5 respectively.
[0492] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0493] Here, P and Q may be 0 and 13, respectively.
[0494] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, or 5. In addition, when sizeId is 1 to 4, matrixId may have a value of at least one of 0 to 13. In addition, when sizeId is 6 to 13, matrixId may have a value of at least one of 1 to 4. In addition, when sizeId is 5, matrixId may have a value of at least one of 0 or 3.
[0495] As in Figure 45 to Figure 47 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode, a color component, or a two-dimensional transform combination.
[0496] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0497] Here, J and K can be 2, and M and N can be 64.
[0498] Here, U and V can be 0 and 5 respectively.
[0499] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0500] Here, P and Q may be 0 and 7, respectively.
[0501] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, or 5. In addition, when sizeId is 1 to 4, matrixId may have a value of at least one of 0 to 7. In addition, when sizeId is 6 to 7, matrixId may have a value of at least one of 1 to 4. In addition, when sizeId is 5, matrixId may have a value of at least one of 0 or 3.
[0502] As in Figures 48 to 50 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode, a color component, or a two-dimensional transform combination.
[0503] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0504] Here, J and K can be 2, and M and N can be 64.
[0505] Here, U and V can be 0 and 5 respectively.
[0506] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0507] Here, P and Q may be 0 and 13, respectively.
[0508] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, or 5. In addition, when sizeId is 1 to 4, matrixId may have a value of at least one of 0 to 13. In addition, when sizeId is 6 to 13, matrixId may have a value of at least one of 1 to 4. In addition, when sizeId is 5, matrixId may have a value of at least one of 0 or 3.
[0509] As in Figure 51 to Figure 53 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode, a color component, or whether a transform is used.
[0510] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0511] Here, J and K can be 2, and M and N can be 64.
[0512] Here, U and V can be 0 and 5 respectively.
[0513] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0514] Here, P and Q may be 0 and 7, respectively.
[0515] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, or 5. Also, when sizeId is 1 to 4, matrixId may have a value of at least one of 0 to 7. Also, when sizeId is 6 to 7, matrixId may have a value of 1. Also, when sizeId is 5, matrixId may have a value of at least one of 0 or 3.
[0516] As in Figure 54 to Figure 56 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode or a color component.
[0517] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0518] Here, J and K can be 1, and M and N can be 64.
[0519] Here, U and V can be 0 and 6 respectively.
[0520] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0521] Here, P and Q may be 0 and 8, respectively.
[0522] When sizeId is 1, matrixId may have a value of at least one of 1, 2, 4, 5, 7, or 8. Also, when sizeId is 6, matrixId may have a value of at least one of 0, 3, or 6.
[0523] As in Figure 57 to Figure 59 In the example of , sizeId may represent size information corresponding to at least one of a block size, a transform size, or a quantization matrix size. In addition, matrixId may represent matrix information corresponding to at least one of a prediction mode or a color component.
[0524] For example, sizeId may have values of U to V corresponding to J×K to M×N. Here, J, K, M, N, U, and V may be positive integers including 0.
[0525] Here, J and K can be 2, and M and N can be 64.
[0526] Here, U and V can be 0 and 5 respectively.
[0527] For example, matrixId may have a value of P to Q. Here, P and Q may be positive integers including 0.
[0528] Here, P and Q may be 0 and 8, respectively.
[0529] When sizeId is 0, matrixId may have a value of at least one of 1, 2, 4, 5, 7, or 8. Also, when sizeId is 5, matrixId may have a value of at least one of 0, 3, or 6.
[0530] Hereinafter, encoding / decoding of a reference matrix identifier for inter-quantization matrix prediction will be described.
[0531] When the quantization matrix prediction method information scaling_list_pred_mode_flag has a first value (e.g., 0), a reference matrix identifier of an encoding / decoding target quantization matrix may be entropy encoded / decoded in at least one of a parameter set or a header. Here, the reference matrix identifier may indicate a quantization matrix referenced in an encoding / decoding target quantization matrix for inter-quantization matrix prediction. At this time, the inter-quantization matrix prediction method may include at least one of a default matrix use method or a reference matrix use method.
[0532] At this time, at least one of the parameter sets or headers may be at least one of a video parameter set, a sequence parameter set, an adaptation parameter set, a picture parameter set, a picture header, a slice header, a parallel block group header, or a parallel block header.
[0533] For example, in order to indicate a reference matrix of an encoding / decoding target quantization matrix in a video, a reference matrix identifier may be entropy encoded / decoded in a video parameter set.
[0534] In another example, in order to indicate a reference matrix for encoding / decoding a target quantization matrix in a sequence, a reference matrix identifier may be entropy encoded / decoded in a sequence parameter set.
[0535] In another example, in order to indicate a reference matrix of an encoding / decoding target quantization matrix in several pictures, several sub-pictures, several tile groups, several tiles, or several slices, a reference matrix identifier may be entropy encoded / decoded in an adaptive parameter set.
[0536] In another example, in order to indicate a reference matrix of an encoding / decoding target quantization matrix in a picture, a reference matrix identifier may be entropy encoded / decoded in a picture parameter set or a picture header.
[0537] In another example, in order to indicate a reference matrix of an encoding / decoding target quantization matrix in a slice, a reference matrix identifier may be entropy encoded / decoded in a slice header.
[0538] In another example, in order to indicate a reference matrix of an encoding / decoding target quantization matrix in a tile group, a reference matrix identifier may be entropy encoded / decoded in a tile group header.
[0539] In another example, in order to indicate a reference matrix of an encoding / decoding target quantization matrix in a tile, a reference matrix identifier may be entropy encoded / decoded in a tile header.
[0540] As in Figures 27 to 59 In the example of a syntax element of , scaling_list_pred_matrix_id_delta, which is a reference matrix identifier for encoding / decoding a target quantization matrix, may be entropy encoded / decoded in at least one of a parameter set or a header.
[0541] For example, scaling_list_pred_matrix_id_delta may be encoded / decoded as a first value (eg, 0) to indicate a default matrix use method for determining that an encoding / decoding target quantization matrix has the same value as a default matrix.
[0542] The default matrix usage method may represent an inter-quantization matrix prediction method for copying the default matrix coefficient value to the encoding / decoding target quantization matrix coefficient value. That is, the default matrix usage method may represent an inter-quantization matrix prediction method for determining the default matrix as the reference matrix of the encoding / decoding target quantization matrix matrixId and copying the default matrix coefficient value to the encoding / decoding target quantization matrix coefficient value.
[0543] In another example, scaling_list_pred_matrix_id_delta may be encoded / decoded as a second value (eg, P) to indicate a reference matrix usage method for determining that the encoding / decoding target quantization matrix has the same value as the reference matrix. Here, P may be a positive integer and may have a value between 1 and matrixId.
[0544] The reference matrix use method may represent an inter-quantization matrix prediction method for copying reference matrix coefficient values to encoding / decoding target quantization matrix coefficient values. That is, the reference matrix use method may represent an inter-quantization matrix prediction method for determining a reference matrix corresponding to refMatrixId as a reference matrix of the encoding / decoding target quantization matrix matrixId and copying the reference matrix coefficient values to the encoding / decoding target quantization matrix coefficient values.
[0545] For example, when the encoder determines that the encoding target quantization matrix coefficient value is equal to the default matrix coefficient value predetermined in the encoder / decoder, scaling_list_pred_matrix_id_delta is encoded as a first value (e.g., 0) so that the refMatrixId value and the matrixId value are the same. At this time, the default matrix may represent a default matrix corresponding to sizeId and matrixId.
[0546] In another example, when the encoder determines that the encoding target quantization matrix coefficient value is equal to the reference matrix coefficient value, scaling_list_pred_matrix_id_delta may be encoded as a second value (eg, P) so that the refMatrixId value and matrixId may be different. At this time, the reference matrix may represent the quantization matrix corresponding to refMatrixId.
[0547] For example, when the result of decoding scaling_list_pred_matrix_id_delta in the decoder has a first value (e.g., 0) (the refMatrixId value and the matrixId value are the same), the decoded target quantization matrix coefficient value corresponding to sizeId and matrixId may be determined to be equal to the default matrix coefficient value predetermined in the encoder / decoder. The operation of determining the decoded target quantization matrix coefficient value to be equal to the default matrix coefficient value predetermined in the encoder / decoder may represent a default matrix usage method for copying the default matrix coefficient value to the decoded target quantization matrix coefficient value.
[0548] In another example, when the result of decoding scaling_list_pred_matrix_id_delta in the decoder has a second value (e.g., P) (the refMatrixId value and the matrixId value are different), the quantization matrix corresponding to refMatrixId may be determined as a reference matrix of the decoding target quantization matrix, and the decoding target quantization matrix coefficient value may be determined to be equal to the reference matrix coefficient value. The operation of determining the decoding target quantization matrix coefficient value to be equal to the reference matrix coefficient value may represent a reference matrix use method for determining the reference matrix corresponding to refMatrixId as a reference matrix of the decoding target quantization matrix and copying the reference matrix coefficient value to the decoding target quantization matrix coefficient value.
[0549] Using matrixId indicating an encoding / decoding target quantization matrix and scaling_list_pred_matrix_id_delta as a reference matrix identifier, refMatrixId indicating a reference matrix or a default matrix may be determined as follows:
[0550] refMatrixId=matrixId-scaling_list_pred_matrix_id_delta[sizeId][matrixId]*(sizeId==3?3:1)
[0551] Or refMatrixId=matrixId-scaling_list_pred_matrix_id_delta[sizeId][matrixId]*(sizeId==5?3:1)
[0552] Or in the case of a 2×2 block size, refMatrixId=matrixId-scaling_list_pred_matrix_id_delta[sizeId][matrixId]-((matrixId>3&&(matrixId-scaling_list_pred_matrix_id_delta[sizeId][matrixId]<=3))?1:0)
[0553] Figure 60 to Figure 61 is a diagram illustrating a process of performing inter-quantization matrix prediction based on a block size according to an embodiment of the present invention.
[0554] As in Fig.60In the example of , inter-quantization matrix prediction may be performed using the quantization matrix size (block size) in the quantization / dequantization process instead of the quantization matrix size in the encoding / decoding process. That is, prediction may not be performed between quantization matrices having different sizeIds that distinguish between quantization matrix sizes in the quantization / dequantization process.
[0555] For example, an 8×8 inter-frame chrominance Cb quantization matrix (sizeId==1, matrixId==5) may be predicted from an 8×8 inter-frame chrominance Cr quantization matrix (sizeId==1, matrixId==4).
[0556] In another example, the 32x32 inter luma Y quantization matrix (sizeld==3, matrixld==1) may not be predicted from the 8x8 intra luma Y quantization matrix (sizeld==1, matrixld==0).
[0557] In another example, the 16×16 inter chroma Cr quantization matrix (sizeId==2, matrixId==4) may not be predicted from the 8×8 intra chroma Cr quantization matrix (sizeId==1, matrixId==1).
[0558] As in Fig.61 In the example of , inter-quantization matrix prediction can be performed from a quantization matrix having the same size as the quantization matrix size (block size) in the encoding / decoding process. At this time, quantization matrix copying can be performed using the quantization matrix size (block size) in the encoding / decoding process. That is, when sizeId that distinguishes between quantization matrix sizes in quantization / inverse quantization processes is different but the quantization matrix sizes in the encoding / decoding processes are the same, inter-quantization matrix prediction can be performed.
[0559] For example, an 8×8 inter-frame chrominance Cb quantization matrix (sizeId==1, matrixId==5) may be predicted from an 8×8 inter-frame chrominance Cr quantization matrix (sizeId==1, matrixId==4).
[0560] In another example, a 32×32 inter luma Y quantization matrix (sizeld==3, matrixld==1) may be predicted from an 8×8 intra luma Y quantization matrix (sizeld==1, matrixld==0).
[0561] In another example, a 16×16 inter chroma Cr quantization matrix (sizeId==2, matrixId==4) may be predicted from an 8×8 intra chroma Cr quantization matrix (sizeId==1, matrixId==1).
[0562] In another example, a 16×16 intra luma Y quantization matrix (sizeld==2, matrixld==0) may be predicted from an 8×8 intra luma Y quantization matrix (sizeld==1, matrixld==0).
[0563] At this time, the sizeID of the quantization matrix referenced by quantization matrix copying, quantization matrix prediction, etc. may be smaller than or equal to the sizeID of the current quantization matrix.
[0564] Inter-quantization matrix prediction can be performed when different quantization matrices have the same prediction mode, color component, size, form, one-dimensional transform type, two-dimensional transform combination, or whether a transform is used in the encoding / decoding process.
[0565] For example, when different quantization matrices have the same size in a prediction mode in an encoding / decoding process, inter-quantization matrix prediction may be performed.
[0566] In another example, when different quantization matrices have the same size by color component in an encoding / decoding process, inter-quantization matrix prediction may be performed.
[0567] In another example, when different quantization matrices have the same form in a coding / decoding process, inter-quantization matrix prediction may be performed.
[0568] In another example, when different quantization matrices have the same size in at least one of a one-dimensional transform type, a two-dimensional transform combination, or whether transform is used in an encoding / decoding process, inter-quantization matrix prediction may be performed.
[0569] In another example, when different quantization matrices have the same size in size in an encoding / decoding process, inter-quantization matrix prediction may be performed. A detailed example thereof will be described below.
[0570] A quantization matrix having a size of J×K in the encoding / decoding process may have a size of J×K even in the quantization / dequantization process, but a quantization matrix having a size of M×N in the encoding / decoding process may have a size of M×N, 2*M×2*N, 4*M×4*N, 8*M×8*N, etc. in the quantization / dequantization process. Here, J, K, M, and N may be positive integers. In addition, J and K may be less than or equal to M and N.
[0571] For example, a quantization matrix having a size of 4×4 in the encoding / decoding process may have a size of 4×4 even in the quantization / dequantization process, but a quantization matrix having a size of 8×8 in the encoding / decoding process may have a size of 8×8, 16×16, 32×32, 64×64, etc. in the quantization / dequantization process.
[0572] In another example, a quantization matrix having a size of 2×2 or 4×4 in the encoding / decoding process may have a size of 2×2 or 4×4 even in the quantization / dequantization process, but a quantization matrix having a size of 8×8 in the encoding / decoding process may have a size of 8×8, 16×16, 32×32, 64×64, etc. in the quantization / dequantization process.
[0573] In another example, a quantization matrix having a size of 4×4 in the encoding / decoding process may have a size of 2×2 or 4×4 even in the quantization / dequantization process, but a quantization matrix having a size of 8×8 in the encoding / decoding process may have a size of 8×8, 16×16, 32×32, 64×64, etc. in the quantization / dequantization process.
[0574] In another example, a quantization matrix having a size of 2×2, 4×4, or 8×8 in the encoding / decoding process may have a size of 2×2, 4×4, or 8×8 even in the quantization / dequantization process, but a quantization matrix having a size of 16×16 in the encoding / decoding process may have a size of 16×16, 32×32, 64×64, etc. in the quantization / dequantization process.
[0575] Since quantization matrices having sizes of M×N, 2*M×2*N, 4*M×4*N, 8*M×8*N, etc. in the quantization / dequantization process have the same size of M×N in the encoding / decoding process, inter-quantization matrix prediction can be performed. Here, M and N may be positive integers.
[0576] For example, when a quantization matrix having a size of 8×8, 16×16, 32×32, 64×64, etc. in a quantization / inverse quantization process has the same size of 8×8 in an encoding / decoding process, inter-quantization matrix prediction may be performed.
[0577] In another example, when a quantization matrix having a size of 2×2, 4×4, etc. in a quantization / inverse quantization process has the same size of 4×4 in an encoding / decoding process, inter-quantization matrix prediction may be performed.
[0578] In another example, when a quantization matrix having a size of 16×16, 32×32, 64×64, etc. in a quantization / inverse quantization process has the same size of 16×16 in an encoding / decoding process, inter-quantization matrix prediction may be performed.
[0579] When quantization matrices having the same size (M×N) are signaled in the encoding / decoding process, but quantization matrices having different sizes (M×N, 2*M×2*N, 4*M×4*N, 8*M×8*N, etc.) are derived in the quantization / dequantization process, prediction is allowed only between quantization matrices having the same size in the encoding / decoding process (between quantization matrices having a size of M×N in the encoding / decoding process). Here, M and N may be positive integers.
[0580] For example, when quantization matrices having the same size (8×8) are signaled in the encoding / decoding process, but quantization matrices having different sizes (8×8, 16×16, 32×32, 64×64, etc.) are derived in the quantization / dequantization process, prediction is allowed only between quantization matrices having the same size in the encoding / decoding process (between quantization matrices having a size of 8×8 in the encoding / decoding process).
[0581] In another example, when quantization matrices having the same size (4×4) are signaled in the encoding / decoding process, but quantization matrices having different sizes (2×2, 4×4, etc.) are derived in the quantization / dequantization process, prediction is allowed only between quantization matrices having the same size in the encoding / decoding process (between quantization matrices having a size of 4×4 in the encoding / decoding process).
[0582] In another example, when quantization matrices having the same size (16×16) are signaled in the encoding / decoding process, but quantization matrices having different sizes (16×16, 32×32, 64×64, etc.) are derived in the quantization / dequantization process, prediction is allowed only between quantization matrices having the same size in the encoding / decoding process (between quantization matrices having a size of 16×16 in the encoding / decoding process).
[0583] Prediction may not be allowed between quantization matrices having different sizes in the encoding / decoding process (between a size of J×K and a size of M×N in the encoding / decoding process). Here, J, K, M, and N may be positive integers. In addition, J and K may be smaller than M and N, respectively.
[0584] For example, prediction may not be allowed between quantization matrices having different sizes in the encoding / decoding process (between a size of 4×4 and a size of 8×8 in the encoding / decoding process).
[0585] The encoder may determine scaling_list_pred_size_matrix_id_delta as a reference matrix identifier based on matrix information matrixId of an encoding / decoding target quantization matrix, matrix information refMatrixId of a reference matrix, encoding / decoding target quantization matrix size information sizeId, size information refSizeId of a reference matrix, or at least one of the encoding / decoding target quantization matrix size and matrix information sizeMatrixId as follows:
[0586] scaling_list_pred_size_matrix_id_delta=sizeMatrixId-refMap[refSizeId][refMatrixId]
[0587] The method may be applied to a quantization matrix having a size of M×N in an encoding / decoding process, and may not be applied to a quantization matrix having a size of J×K in an encoding / decoding process. For a quantization matrix having a size of J×K in an encoding / decoding process, a reference matrix identifier scaling_list_pred_size_matrix_id_delta may be determined. That is, the inter-quantization matrix prediction method may vary according to the size of the quantization matrix in the encoding / decoding process, and the reference matrix identifier determination method may also vary. Here, J, K, M, and N may be positive integers. In addition, J and K may be smaller than M and N, respectively.
[0588] scaling_list_pred_size_matrix_id_delta=matrixId-refMatrixId
[0589] The decoder may determine at least one of matrix information refMatrixId of the reference matrix or size information refSizeId of the reference matrix based on the reference matrix identifier scaling_list_pred_size_matrix_id_delta or at least one of the encoding / decoding target quantization matrix size and matrix information sizeMatrixId.
[0590] refSizeId=refMap[sizeMatrixId-scaling_list_pred_size_matrix_id_delta]
[0591] refMatrixId=refMap[sizeMatrixId-scaling_list_pred_size_matrix_id_delta]
[0592] The method may be applied to a quantization matrix having a size of M×N in an encoding / decoding process, and may not be applied to a quantization matrix having a size of J×K in an encoding / decoding process. For a quantization matrix having a size of J×K in an encoding / decoding process, refMatrixId as matrix information of a reference matrix may be determined. That is, the inter-quantization matrix prediction method may vary according to the size of the quantization matrix in the encoding / decoding process, and the reference matrix identifier determination method may also vary. Here, J, K, M, and N may be positive integers. In addition, J and K may be smaller than M and N, respectively.
[0593] refMatrixId=matrixId-scaling_list_pred_size_matrix_id_delta
[0594] Figure 62 to Figure 64 is a diagram illustrating a mapping table refMap according to an embodiment of the present invention.
[0595] As in Figure 62 to Figure 64 In the example of , refMap may be a mapping table for at least one of sizeMatrixId, refSizeId, or refMatrixId. At this time, since the quantization matrix size in the quantization / inverse quantization process is different, but the quantization matrix size in the encoding / decoding process is the same, the reference matrix identifier may be sequentially allocated according to the quantization matrix information having a size of 8×8 in the encoding / decoding process.
[0596] Here, the encoding / decoding target quantization matrix size and matrix information may represent a single identifier. In addition, the single identifier may be derived based on the matrix size, prediction mode, color component, size of the current block, etc. in the quantization / dequantization process. In addition, the single identifier for the intra mode and the single identifier for the IBC mode may be the same.
[0597] For example, in the case of a quantization matrix having a size of M×N in the encoding / decoding process, scaling_list_pred_size_matrix_id_delta may be encoded / decoded as a first value (e.g., 0) to indicate a default matrix usage method for determining that the encoding / decoding target quantization matrix has the same value as the default matrix. That is, refMatrixId and matrixId may be allowed to be the same, and refSizeId and sizeId may be allowed to be the same. At this time, the default matrix may represent a default matrix corresponding to sizeId and matrixId. Here, M and N may be positive integers, and M×N may be 8×8.
[0598] In another example, in the case of a quantization matrix having a size of J×K in the encoding / decoding process, scaling_list_pred_size_matrix_id_delta may be encoded / decoded as a first value (e.g., 0) to indicate a default matrix usage method for determining that the encoding / decoding target quantization matrix has the same value as the default matrix. That is, refMatrixId and matrixId may be allowed to be the same. At this time, the default matrix may represent a default matrix corresponding to sizeId and matrixId. Here, J and K may be positive integers, and J×K may be 4×4.
[0599] For example, in the case of a quantization matrix having a size of M×N in the encoding / decoding process, scaling_list_pred_size_matrix_id_delta may be encoded / decoded as a second value (e.g., P) to indicate a reference matrix usage method for determining that the encoding / decoding target quantization matrix has the same value as the reference matrix. Here, P may be a positive integer and may have a value between 1 and matrixId. That is, inter-matrix prediction may be performed from a reference matrix corresponding to refMatrixId and refSizeId. Here, M and N may be positive integers, and M×N may be 8×8.
[0600] In another example, in the case of a quantization matrix having a size of J×K in the encoding / decoding process, scaling_list_pred_size_matrix_id_delta may be encoded / decoded as a second value (e.g., P) to indicate a reference matrix usage method for determining that the encoding / decoding target quantization matrix has the same value as the reference matrix. Here, P may be a positive integer and may have a value between 1 and matrixId. That is, inter-matrix prediction may be performed from a reference matrix corresponding to refMatrixId. Here, J and K may be positive integers, and J×K may be 4×4.
[0601] Furthermore, a restriction may be imposed such that inter-matrix prediction is not performed from a quantization matrix having a value greater than sizeMatrixId of an encoding / decoding target quantization matrix, and a reference matrix identifier scaling_list_pred_size_matrix_id_delta may be restricted to have a value between 0 and U. Here, U may be a positive integer.
[0602] For example, when quantization matrix copying is performed using the quantization matrix size in the quantization / dequantization process, a restriction may be imposed so that a reference matrix identifier of a quantization matrix having a size of 2×2 in the quantization / dequantization process has a value between 0 and X, a reference matrix identifier of a quantization matrix having a size of 4×4, 8×8, 16×16, or 32×32 in the quantization / dequantization process has a value between 0 and Y, and a reference matrix identifier of a quantization matrix having a size of 64×64 in the quantization / dequantization process has a value between 0 and Z. Here, X, Y, and Z may be positive integers and may have different values.
[0603] At this time, when the matrix size in the quantization / dequantization process is at least one of 8×8, 16×16, 32×32, 64×64, etc., which is equal to or greater than a specific size M×N, the lowest frequency matrix coefficient or DC matrix coefficient may be included. Therefore, during prediction, the lowest frequency matrix coefficient or DC matrix coefficient may also be predicted from a quantization matrix having a size equal to or greater than a specific size M×N in the quantization / dequantization process (such as 8×8, 16×16, 32×32, 64×64, etc.). Here, M and N may be positive integers, and M×N may be 8×8.
[0604] Hereinafter, the predictive encoding / decoding steps of the coefficients in the quantization matrix will be described.
[0605] When the quantization matrix prediction method information scaling_list_pred_mode_flag has a second value (e.g., 1), the quantization matrix prediction method information may indicate a prediction encoding / decoding method of coefficients in the quantization matrix. The prediction encoding / decoding method of coefficients in the quantization matrix may represent a method using at least one of quantization matrix scanning, DPCM (Differential Pulse Code Modulation) / inverse DPCM, or exponential Golomb coding.
[0606] In the case of a predictive encoding / decoding method of coefficients in a quantization matrix, the difference between previously encoded / decoded quantization matrix coefficient values and the encoding / decoding target quantization matrix coefficient values in the quantization matrix or at least one of the lowest frequency matrix coefficients may be entropy encoded / decoded in at least one of the parameter sets or headers.
[0607] Here, the lowest frequency matrix coefficient may represent a coefficient in a quantization matrix as at least one of a DC matrix coefficient and a lowest frequency matrix coefficient, wherein the DC matrix coefficient and the lowest frequency matrix coefficient are used to quantize / dequantize at least one of a DC transform coefficient located on the upper left side and a lowest frequency transform coefficient among transform coefficients in a residual block. During predictive encoding / decoding of coefficients in a quantization matrix, the lowest frequency matrix coefficient may be encoded / decoded first.
[0608] For example, as a one-dimensional transform type, when DCT-2 is used as a horizontal transform or a vertical transform, the lowest frequency matrix coefficient for a DC transform coefficient may be a DC matrix coefficient.
[0609] In another example, as a one-dimensional transform type, a transform other than DCT-2 (DCT-8, DST-7, DCT-4, DST-4, etc.) is used as a horizontal transform or a vertical transform, and the lowest frequency matrix coefficient for the lowest frequency transform coefficient can be the lowest frequency matrix coefficient.
[0610] For example, as a two-dimensional transform combination, when DCT-2 is used as a horizontal transform or a vertical transform, the lowest frequency matrix coefficient for a DC transform coefficient may be a DC matrix coefficient.
[0611] In another example, as a two-dimensional transform combination, when a transform other than DCT-2 (DCT-8, DST-7, DCT-4, DST-4, etc.) is used as at least one of the horizontal transform or the vertical transform, the lowest frequency matrix coefficient for the lowest frequency transform coefficient can be the lowest frequency matrix coefficient.
[0612] For example, when at least one of the primary transform or the secondary transform is not used, the lowest frequency matrix coefficient value may not be encoded / decoded.
[0613] As in Figures 27 to 59 In the example of the syntax element of , when the encoding / decoding target quantization matrix size is at least one of 8×8, 16×16, 32×32, etc. equal to or greater than a specific size M×N, scaling_list_dc_coef_minus8 as a DC matrix coefficient or a lowest frequency matrix coefficient may be encoded / decoded in at least one of a parameter set or a header. Here, M and N may be positive integers. M×N may be 8×8, 16×16, etc.
[0614] At this time, scaling_list_dc_coef_minus8 may be limited to a value between -A and B, and may be encoded / decoded as a value between -A and B using signed exponential Golomb encoding.
[0615] Here, A and B may be positive integers.
[0616] For example, when the quantization matrix coefficient is represented by 6 bits, A may be 7, B may be 55, and A+B may be 62 or 63.
[0617] In another example, when the quantization matrix coefficient is represented by 8 bits, A may be 7, B may be 247, and A+B may be 254 or 255.
[0618] In another example, when the quantization matrix coefficient is represented by 10 bits, A may be 7, B may be 1015, and A+B may be 1022 or 1023.
[0619] When the quantization matrix is reconstructed, the DC matrix coefficient or the lowest frequency matrix coefficient may be calculated as a value of scaling_list_dc_coef_minus8+L, and the calculated value may be a value between C and D. Here, L may be a positive integer and may be eight.
[0620] Here, C and D may be positive integers.
[0621] For example, when the quantization matrix coefficient is represented by 6 bits, C may be 1 and D may be 63.
[0622] In another example, when the quantization matrix coefficient is represented by 8 bits, C may be 1 and D may be 255.
[0623] In another example, when the quantization matrix coefficient is represented by 10 bits, C may be 1 and D may be 1023.
[0624] When scaling_list_pred_mode_flag as prediction method information of the quantization matrix has a first value, scaling_list_pred_matrix_id_delta as a reference matrix identifier has a first value, and the quantization matrix size is equal to or larger than the size of M×N, scaling_list_dc_coef_minus8 may be determined as L. Here, M and N may be positive integers. M×N may be 8×8, 16×16, etc. Here, L may be a positive integer and may be 8.
[0625] As in Figures 27 to 59In the example of a syntax element, scaling_list_delta_coef, which is the difference between a previously encoded / decoded quantization matrix coefficient value ScalingList[sizeId][matrixId][i-1] in a quantization matrix and an encoded / decoded target quantization matrix coefficient value ScalingList[sizeId][matrixId][i], can be encoded / decoded in at least one of the parameter set or the header.
[0626] When a quantization matrix of size J×K is encoded / decoded, a total of J×K scaling_list_delta_coefs may be encoded / decoded, where J×K is the number of coefficients in the quantization matrix of J×K. Here, J and K may be positive integers.
[0627] For example, when a quantization matrix of a size of 4×4 is encoded / decoded, a total of 16 scaling_list_delta_coefs may be encoded / decoded, where 16 is the number of coefficients in the quantization matrix of 4×4.
[0628] When a quantization matrix used in a block having a size of M×N or more is encoded / decoded, a total of M*N scaling_list_delta_coefs may be encoded / decoded, where M*N is the number of coefficients in the quantization matrix of M×N. Here, M and N may be positive integers.
[0629] For example, when a quantization matrix used in a block having a size of 8×8 or more is encoded / decoded, a total of 64 coefficients in the 8×8 quantization matrix may be encoded / decoded.
[0630] At this time, scaling_list_delta_coef may be limited to a value between -A and B, and may be encoded / decoded as a value between -A and B using signed exponential Golomb encoding.
[0631] Here, A and B may be positive integers.
[0632] For example, when the quantization matrix coefficient is represented by 6 bits, A may be 32, B may be 31, and A+B may be 63.
[0633] In another example, when the quantization matrix coefficient is represented by 8 bits, A may be 128, B may be 127, and A+B may be 255.
[0634] In another example, when the quantization matrix coefficient is represented by 10 bits, A may be 512, B may be 511, and A+B may be 1023.
[0635] When the quantization matrix is reconstructed, the quantization matrix coefficient nextCoef may be calculated as a value of nextCoef+scaling_list_delta_coef+(C+D))%(C+D), and the calculated value may be a value between C and D.
[0636] Here, C and D may be positive integers.
[0637] For example, when the quantization matrix coefficient is represented by 6 bits, C may be 1 and D may be 63.
[0638] In another example, when the quantization matrix coefficient is represented by 8 bits, C may be 1 and D may be 255.
[0639] In another example, when the quantization matrix coefficient is represented by 10 bits, C may be 1 and D may be 1023.
[0640] When scaling_list_pred_mode_flag as prediction method information of the quantization matrix has a first value and scaling_list_pred_matrix_id_delta as a reference matrix identifier has a first value, scaling_list_delta_coef may be determined as L. Here, M and N may be positive integers. M×N may be 8×8, 16×16, etc. Here, L may be at least one of a negative integer, 0, or a positive integer and may be 0.
[0641] Furthermore, scaling_list_dc_coef_minus8 or scaling_list_delta_coef used to calculate nextCoef may be used to indicate the use of a default matrix.
[0642] For example, the encoder may encode the value of scaling_list_dc_coef_minus8 as -8 for the encoding target quantization matrix and signal the use of the default matrix to the decoder. In addition, scaling_list_delta_coef may be encoded so that the first nextCoef value becomes 0, thereby signaling the use of the default matrix to the decoder.
[0643] In another example, when the decoder decodes the value of scaling_list_dc_coef_minus8 as -8, the decoding target quantization matrix may be determined as the default matrix. In addition, when the first nextCoef value calculated by decoding scaling_list_delta_coef is 0, the decoding target quantization matrix may be determined as the default matrix.
[0644] At this time, at least one of the parameter sets or headers may be at least one of a video parameter set, a sequence parameter set, an adaptation parameter set, a picture parameter set, a picture header, a slice header, a parallel block group header, or a parallel block header.
[0645] For example, to predictively encode / decode coefficients in a quantization matrix in a video, at least one of a difference value of a quantization matrix coefficient value or a lowest frequency matrix coefficient value may be entropy encoded / decoded in a video parameter set.
[0646] In another example, to predictively encode / decode coefficients in a quantization matrix in a sequence, at least one of a difference value of a quantization matrix coefficient value or a lowest frequency matrix coefficient value may be entropy encoded / decoded in a sequence parameter set.
[0647] In another example, in order to predictively encode / decode coefficients in a quantization matrix in several pictures, several sub-pictures, several parallel block groups, several parallel blocks, or several slices, at least one of the difference values of the quantization matrix coefficient values or the lowest frequency matrix coefficient values may be entropy encoded / decoded in an adaptive parameter set.
[0648] In another example, to predictively encode / decode coefficients in a quantization matrix in a picture, at least one of a difference value of a quantization matrix coefficient value or a lowest frequency matrix coefficient value may be entropy encoded / decoded in a picture parameter set or a picture header.
[0649] In another example, in order to predictively encode / decode coefficients in a quantization matrix in a slice, at least one of a difference value of a quantization matrix coefficient value or a lowest frequency matrix coefficient value may be entropy encoded / decoded in a slice header.
[0650] In another example, to predictively encode / decode coefficients in a quantization matrix in a tile group, at least one of a difference value of a quantization matrix coefficient value or a lowest frequency matrix coefficient value may be entropy encoded / decoded in a tile group header.
[0651] In another example, in order to predictively encode / decode coefficients in a quantization matrix in a tile, at least one of a difference value of a quantization matrix coefficient value or a lowest frequency matrix coefficient value may be entropy encoded / decoded in a tile header.
[0652] The encoder may encode the difference between the previously encoded quantization matrix coefficient value and the encoding target quantization matrix coefficient value in the quantization matrix in the following process.
[0653] In a first process, scanning may be performed so as to align at least one of the coefficients in the two-dimensional quantization matrix in the one-dimensional coefficient array.
[0654] In the second process, scaling_list_delta_coef may be generated, wherein scaling_list_delta_coef is the difference between the quantization matrix coefficient of the encoding target by the scanning method and the quantization matrix coefficient in the previous order in the one-dimensional coefficient array. At this time, DPCM may be used to calculate the difference, and the quantization matrix coefficient in the previous order may be a coding coefficient located immediately before the encoding target quantization matrix coefficient. In addition, since the first coefficient in the one-dimensional coefficient array does not have the quantization matrix coefficient in the previous order to be predicted, a predetermined constant value may be used to generate the difference. For example, when the quantization matrix size is greater than 8×8, the DC matrix coefficient or the lowest frequency matrix coefficient may be used to generate the difference. At this time, the predetermined constant value may be a value between C and D as a positive integer, and more specifically, may be a positive value such as 8 or 16.
[0655] In the third process, scaling_list_delta_coef, which is the calculated difference value, may be encoded using exponential Golomb coding. At this time, the difference value has sign information and thus may be encoded using signed exponential Golomb coding. scaling_list_delta_coef may be limited to a value between -A and B and may be encoded as a value between -A and B.
[0656] The decoder may decode the difference between the previously encoded quantization matrix coefficient value and the decoding target quantization matrix coefficient value in the quantization matrix in the following process.
[0657] In the first process, scaling_list_delta_coef may be decoded using exponential Golomb coding. scaling_list_delta_coef may be limited to values between -A and B, the difference having sign information, and thus may be decoded using signed exponential Golomb coding to values between -A and B. The decoded difference may be sequentially stored in a one-dimensional coefficient array in a decoding order.
[0658] In the second process, the sum of the decoded difference and the quantization matrix coefficients in the previous order in the one-dimensional coefficient array is calculated to reconstruct nextCoef or scalingList[i] as the decoded target quantization matrix coefficients. At this time, i may represent the order number in the one-dimensional coefficient array. The decoded target quantization matrix coefficients may be calculated using inverse DPCM, and the quantization matrix coefficients in the previous order may be decoded coefficients immediately before the decoded target quantization matrix coefficients. In addition, the first coefficient in the one-dimensional coefficient array does not have the quantization matrix coefficients in the previous order to be predicted, and therefore may be reconstructed using predetermined constants. For example, when the quantization matrix size is greater than 8×8, the DC matrix coefficient or the lowest frequency matrix coefficient may be used to reconstruct the quantization matrix. At this time, the predetermined constant value may be a value between C and D as a positive integer, and more specifically, may be a positive value such as 8 or 16. The reconstructed quantization matrix coefficient may be a value between C and D.
[0659] In the third process, inverse scanning may be performed to align the reconstructed one-dimensional coefficient array in the two-dimensional quantization matrix. At this time, the inverse scanning may be performed in the same manner as the scanning, or may be performed in the reverse order of the scanning.
[0660] A, B, C, and D may be positive integers.
[0661] For example, when the quantization matrix is represented by 6 bits, A may be 32, B may be 31, and A+B may be 63.
[0662] In another example, when the quantization matrix coefficient is represented by 8 bits, A may be 128, B may be 127, and A+B may be 255.
[0663] In another example, when the quantization matrix coefficient is represented by 10 bits, A may be 512, B may be 511, and A+B may be 1023.
[0664] For example, when the quantization matrix coefficient is represented by 6 bits, C may be 1 and D may be 63.
[0665] In another example, when the quantization matrix coefficient is represented by 8 bits, C may be 1 and D may be 255.
[0666] In another example, when the quantization matrix coefficient is represented by 10 bits, C may be 1 and D may be 1023.
[0667] Figures 65 to 73 is a diagram illustrating a scanning method for quantization matrix coefficients according to an embodiment of the present invention.
[0668] At least one of the following scanning methods may be performed on at least one of the encoding target quantization matrix coefficients or the reconstruction coefficients.
[0669] As in Fig.65 In the example of , diagonal scanning can be used to align the coefficients in the two-dimensional quantization matrix in the one-dimensional coefficient array. In addition, diagonal scanning can be used to align the reconstructed one-dimensional coefficient array in the two-dimensional quantization matrix.
[0670] At this time, the diagonal scanning direction can be as follows Fig.65 , or may be from the upper right side to the lower left side.
[0671] When the scanning direction is from the lower left side to the upper right side, the scanning may be referred to as an upper right diagonal scanning. In addition, when the scanning direction is from the upper right side to the lower left side, the scanning may be referred to as a lower left diagonal scanning.
[0672] Fig.65 The upper right diagonal scan is shown as the diagonal scan.
[0673] As in Fig.66 In the example of , horizontal scanning can be used to align the coefficients in the two-dimensional quantization matrix in the one-dimensional coefficient array. In addition, horizontal scanning can be used to align the reconstructed one-dimensional coefficient array in the two-dimensional quantization matrix.
[0674] At this time, in the horizontal scan, the coefficients corresponding to the first row may be scanned preferentially.
[0675] As in Fig.67 In the example of , vertical scanning can be used to align the coefficients in the two-dimensional quantization matrix in the one-dimensional coefficient array. In addition, horizontal scanning can be used to align the reconstructed one-dimensional coefficient array in the two-dimensional quantization matrix.
[0676] At this time, in the vertical scan, the coefficients corresponding to the first column may be scanned preferentially.
[0677] As in Fig.68 In the example of , the coefficients in the two-dimensional quantization matrix can be aligned in the one-dimensional coefficient array using block-based diagonal scanning. In addition, the reconstructed one-dimensional coefficient array can be aligned in the two-dimensional quantization matrix using block-based diagonal scanning.
[0678] At this time, the block size may be M×N. Here, at least one of M or N may be a positive integer and may be 4. In addition, the block size may be equal to the size of a coefficient group used for transform coefficient encoding / decoding.
[0679] As in Fig.68 In the example of , the diagonal scanning direction may be from the lower left side to the upper right side. In addition, the diagonal scanning direction may be from the upper right side to the lower left side.
[0680] Fig.68 A block-based upper right diagonal scan is shown as a block-based diagonal scan.
[0681] At this time, the block may represent a sub-block partitioned from a specific block size. When block-based scanning is used, the sub-blocks in a specific block may be scanned using the same scanning method as that of the block.
[0682] As in Fig.68 In the example of , when block-based diagonal scanning is used, a block of size 8×8 can be partitioned into sub-blocks of size 4×4, the sub-blocks of size 4×4 can be scanned using diagonal scanning, and the coefficients in the sub-blocks can be scanned using diagonal scanning.
[0683] As in Fig.69 In the example of , block-based horizontal scanning can be used to align coefficients in a two-dimensional quantization matrix in a one-dimensional coefficient array. In addition, block-based horizontal scanning can be used to align the reconstructed one-dimensional coefficient array in a two-dimensional quantization matrix. At this time, the block size can be 4×4, and the block corresponding to the first row can be scanned preferentially.
[0684] At this time, the block size may be M×N. Here, at least one of M or N may be a positive integer and may be 4. In addition, the block size may be equal to the size of a coefficient group used for transform coefficient encoding / decoding.
[0685] At this time, in the block-based horizontal scanning, the block corresponding to the first row may be preferentially scanned.
[0686] As in Fig.70 In the example of , the coefficients in the two-dimensional quantization matrix can be aligned in the one-dimensional coefficient array using block-based vertical scanning. In addition, the reconstructed one-dimensional coefficient array can be aligned in the two-dimensional quantization matrix using block-based vertical scanning.
[0687] At this time, the block size may be M×N. Here, at least one of M or N may be a positive integer and may be 4. In addition, the block size may be equal to the size of a coefficient group used for transform coefficient encoding / decoding.
[0688] At this time, in the block-based vertical scanning, the block corresponding to the first column may be preferentially scanned.
[0689] As in Fig.71 In the example of , the coefficients in the two-dimensional quantization matrix can be aligned in the one-dimensional coefficient array using block-based horizontal scanning. In addition, the reconstructed one-dimensional coefficient array can be aligned in the two-dimensional quantization matrix using block-based horizontal scanning.
[0690] At this time, the block size may be M×N. Here, at least one of M or N may be a positive integer, and may be 8 and 2, respectively. In addition, the block size may be equal to the size of a coefficient group used for transform coefficient encoding / decoding.
[0691] At this time, in the block-based horizontal scanning, the block corresponding to the first row may be preferentially scanned.
[0692] As in Fig.72 In the example of , the coefficients in the two-dimensional quantization matrix can be aligned in the one-dimensional coefficient array using block-based vertical scanning. In addition, the reconstructed one-dimensional coefficient array can be aligned in the two-dimensional quantization matrix using block-based vertical scanning.
[0693] At this time, the block size may be M×N. Here, at least one of M or N may be a positive integer, and may be 2 and 8, respectively. In addition, the block size may be equal to the size of a coefficient group used for transform coefficient encoding / decoding.
[0694] At this time, in the block-based horizontal scanning, the block corresponding to the first column may be preferentially scanned.
[0695] As in Figures 65 to 72 In the example of , the scan corresponding to (a) may be used for a quantization matrix of size J×K for a block of J×K, and the scan corresponding to (b) may be used for a quantization matrix of size M×N or larger for at least one block such as 8×8 / 16×16 / 32×32 / 64×64, or a quantization matrix of size M×N. J, K, M, and N may be positive integers. In addition, J and K may be smaller than M and N, respectively. In addition, J×K may be 4×4 and M×N may be 8×8.
[0696] Although in Figures 65 to 72 In the example, only the scanning method corresponding to the maximum size of 8×8 is shown, but the scanning method corresponding to the size of 8×8 can be applied to the scanning method corresponding to the size greater than 8×8, and the scanning method can be applied not only to square quantization matrices but also to non-square quantization matrices.
[0697] The encoder may scan the quantization matrix coefficients so that the coefficients in the square / non-square two-dimensional quantization matrix are aligned in the one-dimensional coefficient array. In addition, the decoder may scan the quantization matrix coefficients so that the reconstructed one-dimensional coefficient array is aligned in the square / non-square two-dimensional quantization matrix. In addition, the quantization matrix to be aligned in the two-dimensional quantization matrix can be a default matrix predefined in the encoder and decoder.
[0698] As in Fig.73 In the example, at least one of the quantization matrix coefficients may be scanned.
[0699] For example, as in Fig.73 In the example of (a), diagonal scanning can be used to align the coefficients in the two-dimensional quantization matrix in the one-dimensional coefficient array. In addition, diagonal scanning can be used to align the reconstructed one-dimensional coefficient array in the two-dimensional quantization matrix.
[0700] At this time, the diagonal scanning direction can be Fig.73 As in the example of (a), it is from the lower left side to the upper right side, and may be from the upper right side to the lower left side.
[0701] When the scanning direction is from the lower left side to the upper right side, the scanning may be referred to as an upper right diagonal scanning. In addition, when the scanning direction is from the upper right side to the lower left side, the scanning may be referred to as a lower left diagonal scanning.
[0702] Fig.73 (a) shows the upper right diagonal scan as a diagonal scan.
[0703] In another example, as in Fig.73 In the example of (b), vertical scanning can be used to align the coefficients in the two-dimensional quantization matrix in the one-dimensional coefficient array. In addition, vertical scanning can be used to align the reconstructed one-dimensional coefficient array in the two-dimensional quantization matrix.
[0704] At this time, in the vertical scan, the coefficients corresponding to the first column may be scanned preferentially.
[0705] In another example, as in Fig.73 In the example of (c), horizontal scanning can be used to align the coefficients in the two-dimensional quantization matrix in the one-dimensional coefficient array. In addition, horizontal scanning can be used to align the reconstructed one-dimensional coefficient array in the two-dimensional quantization matrix.
[0706] At this time, in the horizontal scan, the coefficients corresponding to the first row may be scanned preferentially.
[0707] In another example, as in Fig.73 In the example of (d), block-based diagonal scanning can be used to align the coefficients in the two-dimensional quantization matrix in the one-dimensional coefficient array. In addition, block-based diagonal scanning can be used to align the reconstructed one-dimensional coefficient array in the two-dimensional quantization matrix.
[0708] At this time, the block size may be M×N. Here, at least one of M or N may be a positive integer and may be 4. In addition, the block size may be equal to the size of a coefficient group used for transform coefficient encoding / decoding.
[0709] As in Fig.73 In the example of (d), the diagonal scanning direction may be from the lower left side to the upper right side. In addition, the diagonal scanning direction may be from the upper right side to the lower left side.
[0710] Fig.73(d) shows a block-based upper right diagonal scan as a block-based diagonal scan for an 8×4 block.
[0711] In another example, as in Fig.73 In the example of (e), the coefficients in the two-dimensional quantization matrix can be aligned in the one-dimensional coefficient array using block-based vertical scanning for the entire 8×4 block. In addition, the reconstructed one-dimensional coefficient array can be aligned in the two-dimensional quantization matrix using block-based vertical scanning for the entire 8×4 block.
[0712] At this time, the block size may be M×N. Here, at least one of M or N may be a positive integer and may be 4. In addition, the block size may be equal to the size of a coefficient group used for transform coefficient encoding / decoding.
[0713] At this time, in the block-based vertical scanning, the block corresponding to the first column may be preferentially scanned.
[0714] In another example, as in Fig.73 In the example of (f), the coefficients in the two-dimensional quantization matrix can be aligned in the one-dimensional coefficient array using block-based horizontal scanning for the entire 4×8 block. In addition, the reconstructed one-dimensional coefficient array can be aligned in the two-dimensional quantization matrix using block-based horizontal scanning for the entire 4×8 block.
[0715] At this time, the block size may be M×N. Here, at least one of M or N may be a positive integer and may be 4. In addition, the block size may be equal to the size of a coefficient group used for transform coefficient encoding / decoding.
[0716] At this time, in the block-based horizontal scanning, the block corresponding to the first row may be preferentially scanned.
[0717] As in Figures 65 to 73 In the example of , when the quantization matrix for the non-square block has a non-square form, scanning may be performed in the non-square form when scanning the quantization matrix, or scanning for each specific square block unit and scanning in a specific square block unit may be performed by partitioning the corresponding quantization matrix into a size of M×N as a specific square block unit. Here, M and N may be positive integers and may have the same value or different values.
[0718] Hereinafter, the steps of reconstructing the quantization matrix will be described.
[0719] Figure 74 to Figure 76 is a diagram illustrating a process of reconstructing a quantization matrix according to an embodiment of the present invention.
[0720] The quantization matrix coefficients aligned and reconstructed in the two-dimensional quantization matrix can be reconstructed into a square two-dimensional quantization matrix to be used for quantization / inverse quantization. At this time, at least one of upsampling, interpolation, DC matrix coefficient or lowest frequency matrix coefficient replacement, subsampling, or downsampling can be used to reconstruct the two-dimensional quantization matrix. An example of reconstructing the quantization matrix is shown below.
[0721] For example, the following method may be used to reconstruct a quantization matrix for quantization / inverse quantization of a square block of size M×M such as 2×2, 4×4, 8×8, 16×16, 32×32, or 64×64. Here, M may be a positive integer.
[0722] As in the example of Equation 1, a quantization matrix RQM for quantization / inverse quantization of a block having a size of 2×2 may be reconstructed by performing subsampling on an aligned two-dimensional quantization matrix QM having a size of 4×4.
[0723] [Equation 1]
[0724] RQM(x,y)=QM(x*F,y*F), where x=0,1, y=0,1, F=2
[0725] Alternatively, in the example of Equation 2, in the quantization matrix RQM used for quantization / inverse quantization of a block having a size of 2×2, an aligned two-dimensional quantization matrix QM having a size of 2×2 may be used without change.
[0726] [Equation 2]
[0727] RQM(x,y)=QM(x,y), where x=0,1, y=0,1
[0728] As in the example of Equation 3, in the quantization matrix RQM used for quantization / inverse quantization of a block having a size of 4×4, an aligned two-dimensional quantization matrix QM having a size of 4×4 may be used without change.
[0729] [Equation 3]
[0730] RQM(x,y)=QM(x,y), where x=0,1,...3, y=0,1,...3
[0731] As in the example of Equation 4, in the quantization matrix RQM used for quantization / inverse quantization of a block having a size of 8×8, an aligned two-dimensional quantization matrix QM having a size of 8×8 may be used without change.
[0732] [Equation 4]
[0733] RQM(x,y)=QM(x,y), where x=0,1,…7, y=0,1,…7
[0734] As in the example of Equation 5, Fig.75 As in the example of , upsampling is performed while copying from the nearest neighboring matrix coefficients aligned with the two-dimensional quantization matrix QM of size 8×8 to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 16×16. In addition, as in the example of Equation 6, the quantization matrix coefficient located at position (0,0) in the quantization matrix may be replaced by the value of scaling_list_dc_coef_minus8+8 which is the DC matrix coefficient or the lowest frequency matrix coefficient.
[0735] [Equation 5]
[0736] RQM(x,y)=QM(x / F,y / F), where x=0,1,…15, y=0,1,…15, F=2
[0737] [Equation 6]
[0738] RQM(0,0)=scaling_list_dc_coef_minus8+8
[0739] As in the example of Equation 7, Fig.75 As in the example of , upsampling is performed while copying from the nearest neighboring matrix coefficients aligned with the two-dimensional quantization matrix QM of size 8×8 to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 32×32. In addition, as in the example of Equation 8, the quantization matrix coefficient located at position (0,0) in the quantization matrix may be replaced by the value of scaling_list_dc_coef_minus8+8 which is the DC matrix coefficient or the lowest frequency matrix coefficient.
[0740] [Equation 7]
[0741] RQM(x,y)=QM(x / F,y / F), where x=0,1,…31, y=0,1,…31, F=4
[0742] [Equation 8]
[0743] RQM(0,0)=scaling_list_dc_coef_minus8+8
[0744] As in the example of Equation 9, Fig.75As in the example of , upsampling is performed while copying from the nearest neighboring matrix coefficients aligned with the two-dimensional quantization matrix QM of size 8×8 to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 64×64. In addition, as in the example of Equation 10, the quantization matrix coefficient located at position (0,0) in the quantization matrix may be replaced by the value of scaling_list_dc_coef_minus8+8 which is the DC matrix coefficient or the lowest frequency matrix coefficient.
[0745] [Equation 9]
[0746] RQM(x,y)=QM(x / F,y / F), where x=0,1,…63, y=0,1,…63, F=8
[0747] [Equation 10]
[0748] RQM(0,0)=scaling_list_dc_coef_minus8+8
[0749] The quantization matrix coefficients aligned and reconstructed in the two-dimensional quantization matrix can be reconstructed into a non-square two-dimensional quantization matrix to be used for quantization / inverse quantization. At this time, at least one of upsampling, interpolation, DC matrix coefficient or lowest frequency matrix coefficient replacement, subsampling, or downsampling can be used to reconstruct the two-dimensional quantization matrix. An example of reconstructing the quantization matrix is shown below.
[0750] For example, the following method may be used to reconstruct a quantization matrix for a non-square block of size M×N, such as 2×2, 4×2, 2×4, 4×4, 8×4, 8×2, 2×8, 4×8, 8×8, 16×8, 16×4, 16×2, 2×16, 4×16, 8×16, 16×16, 32×16, 32×8, 32×4, 32×2, 2×32, 4×32, 8×32, 16×32, 32×32, 64×32, 64×16, 64×8, 64×4, 64×2, 2×64, 4×64, 8×64, 16×64, 32×64, 64×64, 128×64, 128×32, 32×128, 64×128, or 128×128. Here, M and N may be positive integers. Furthermore, M and N may have different values.
[0751] As in the example of Equation 11, Fig.76 As in the example of (a) of FIG. 1 , when J (=F-1) rows are skipped at the y position (row, vertical direction), subsampling is performed on the reconstructed quantization matrix QM of size 8×8 to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 8×2. Here, J may be a positive integer.
[0752] [Equation 11]
[0753] RQM(x,y)=QM(x,y*F), where x=0,1,…7, y=0,1, F=4
[0754] As in the example of equation 12, Fig.76 As in the example of (b) of FIG. 1 , subsampling is performed on the reconstructed quantization matrix QM of size 8×8 while skipping K (=F-1) columns at the x position (column, horizontal direction) to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 2×8. Here, K may be a positive integer.
[0755] [Equation 12]
[0756] RQM(x,y)=QM(x*F,y), where x=0,1, y=0,1,…7, F=4
[0757] As in the example of equation 13, Fig.76 As in the example of (a) of FIG. 1 , when skipping J (=F-1) rows at the y position (row, vertical direction), subsampling is performed for the reconstructed quantization matrix QM of size 16×16 to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 16×4. Here, J may be a positive integer.
[0758] [Equation 13]
[0759] RQM(x,y)=QM(x,y*F), where x=0,1,…15, y=0,1,…3, F=4
[0760] As in the example of Equation 14, Fig.76 As in the example of (b) of FIG. 1 , subsampling is performed on the reconstructed quantization matrix QM of size 16×16 while skipping K (=F-1) columns at the x position (column, horizontal direction) to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 4×16. Here, K may be a positive integer.
[0761] [Equation 14]
[0762] RQM(x,y)=QM(x*F,y), where x=0,1,…3, y=0,1,…15, F=4
[0763] As in the example of Equation 15, Fig.76 As in the example of (a) of FIG. 1 , subsampling is performed on the reconstructed quantization matrix QM of size 32×32 while skipping J (=F-1) rows at the y position (row, vertical direction) to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 32×8. Here, J may be a positive integer.
[0764] [Equation 15]
[0765] RQM(x,y)=QM(x,y*F), where x=0,1,…31, y=0,1,…7, F=4
[0766] As in the example of Equation 16, Fig.76 As in the example of (b) of FIG. 1 , subsampling is performed on the reconstructed quantization matrix QM of size 32×32 while skipping K (=F-1) columns at the x position (column, horizontal direction) to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 8×32. Here, K may be a positive integer.
[0767] [Equation 16]
[0768] RQM(x,y)=QM(x*F,y), where x=0,1,…7, y=0,1,…31, F=4
[0769] As in the example of Equation 17, Fig.76 As in the example of (a) of FIG. 1 , subsampling is performed on the reconstructed quantization matrix QM of size 64×64 while skipping J (=F-1) rows at the y position (row, vertical direction) to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 64×32. Here, J may be a positive integer.
[0770] [Equation 17]
[0771] RQM(x,y)=QM(x,y*F), where x=0,1,…63, y=0,1,…31, F=2
[0772] As in the example of Equation 18, Fig.76 , as in the example of (b) of , subsampling is performed on the reconstructed quantization matrix QM of size 64×64 while skipping K (=F-1) columns at the x position (column, horizontal direction) to reconstruct the quantization matrix RQM for quantization / inverse quantization of the block of size 32×64. Here, K may be a positive integer.
[0773] [Equation 18]
[0774] RQM(x,y)=QM(x*F,y), where x=0,1,…31, y=0,1,…63, F=2
[0775] That is, subsampling may be performed in at least one of rows or columns for a quantization matrix of size M×N, thereby reconstructing a quantization matrix of size J×K. Here, J, K, M, and N may be positive integers. In addition, J and K may be different values.
[0776] When a quantization matrix having a size of J×K is generated by subsampling in rows, subsampling may be performed while skipping (N / K)-1 rows in a quantization matrix having a size of M×N.
[0777] When a quantization matrix having a size of J×K is generated by subsampling in columns, subsampling may be performed while skipping (M / J)-1 columns in a quantization matrix having a size of M×N.
[0778] Here, F may be an integer that is a multiple of 2. Also, F may include 1.
[0779] In addition, F may be represented by (M / J). Alternatively, F may be represented by (N / K). Here, J may represent the width of the transform block. In addition, K may represent the height of the transform block.
[0780] In addition, as in the example of Equation 18-1, subsampling can be performed for a quantization matrix of size M×N while skipping (Fx-1) columns at the x position (column, horizontal direction), and subsampling can be performed while skipping (Fy-1) rows at the y position (row, vertical direction), thereby reconstructing a quantization matrix RQM for quantization / inverse quantization of a block of size J×K.
[0781] [Equation 18-1]
[0782] RQM(x,y)=QM(x*Fx,y*Fy), where Fx=M / J, Fy=N / K
[0783] Here, each of Fx and Fy may be an integer that is a multiple of 2. In addition, Fx and Fy may be different values.
[0784] The reconstructed quantization matrix QM may represent a primary quantization matrix. That is, by performing predetermined sub-sampling on the primary quantization matrix, a final quantization matrix (eg, RQM) of the current block may be obtained.
[0785] As in Fig.74 In the example of , the quantization matrix coefficients aligned and reconstructed into a two-dimensional quantization matrix can be reconstructed into a non-square two-dimensional quantization matrix to be used for quantization / inverse quantization. At this time, the two-dimensional quantization matrix can be reconstructed using at least one of upsampling, interpolation, DC matrix coefficient or lowest frequency matrix coefficient replacement, subsampling or downsampling, and the quantization matrix can be reconstructed as in the example of Equation 19. At this time, the non-square quantization matrix ScalingFactorR can be reconstructed from the square quantization matrix ScalingFactor.
[0786] [Equation 19]
[0787] ScalingFactorR[sizeIdW][sizeIdH][matrixId][x][y] = ScalingFactor[sId][matrixId][x*rW][y*rH],
[0788] sId = max(sIdW,sIdH), sIdW = 0..6, sIdH = 0..6, matrixId = 0..5 or matrixId = 0..8, x = 0..(1<<sIdW)-1, y = 0..(1<<sIdH)-1, and rW = (1<<sId) / (1<<sIdW), rH = (1<<sId) / (1<<sIdH)
[0789] If, in order to reduce the memory storage space of the default matrices predefined in the encoder and decoder, the default matrix for quantization / inverse quantization of a block of size M×N exists as a default matrix of size J×K, then the quantization matrix of size M×N can be reconstructed by performing at least one of upsampling, interpolation, subsampling, or downsampling when copying from the nearest neighbor matrix coefficients. Here, M, N, J, and K can be positive integers.
[0790] As in the example of Equation 20, the quantization matrix RQM for quantization / inverse quantization of a block of size 2×2 can be reconstructed by subsampling the default DQM of size 4×4.
[0791] [Equation 20]
[0792] RQM(x,y) = DQM(x*F,y*F), where x = 0,1, y = 0,1, F = 2
[0793] As in the example of Equation 21, it can be done by Fig.75 subsampling the default DQM of size 8×8 when copying from the nearest neighbor matrix coefficients as in the example of
[0794] [Equation 21]
[0795] RQM(x,y) = DQM(x / F,y / F), where x = 0,1,…15, y = 0,1,…15, F = 2
[0796] As in the example of Equation 22, it can be done by Fig.75 subsampling the default DQM of size 8×8 when copying from the nearest neighbor matrix coefficients as in the example of
[0797] [Equation 22]
[0798] RQM(x,y)=DQM(x / F,y / F), where x=0,1,…31, y=0,1,…31, F=4
[0799] As in the example of Equation 23, this can be achieved by Fig.75 As in the example of , the quantization matrix RQM for quantization / dequantization of a block of size 64×64 is reconstructed by subsampling the default DQM of size 8×8 when copying is performed from the nearest neighbor matrix coefficients.
[0800] [Equation 23]
[0801] RQM(x,y)=DQM(x / F,y / F), where x=0,1,…63, y=0,1,…63, F=8
[0802] As in the example of Equation 24, this can be achieved by Fig.76 As in the example of (a) of FIG. 1 , the default quantization matrix DQM of size 8×8 is subsampled while skipping J (=F-1) rows at the y position (row, vertical direction) to reconstruct the quantization matrix RQM for quantization / dequantization of the block of size 8×2. Here, J may be a positive integer.
[0803] [Equation 24]
[0804] RQM(x,y)=DQM(x,y*F), where x=0,1,…7, y=0,1, F=4
[0805] As in the example of Equation 25, this can be achieved by Fig.76 As in the example of (b) of FIG. 1 , the default quantization matrix DQM of size 8×8 is subsampled while skipping K (=F-1) columns at the x position (column, horizontal direction) to reconstruct the quantization matrix RQM for quantization / dequantization of the block of size 2×8. Here, K may be a positive integer.
[0806] [Equation 25]
[0807] RQM(x,y)=DQM(x*F,y), where x=0,1, y=0,1,...7, F=4
[0808] As in the example of Equation 26, the quantization matrix RQM for quantization / dequantization of a block of size 16×8 may be reconstructed by subsampling the default quantization matrix DQM of size 8×8 at the x position (column, horizontal direction).
[0809] [Equation 26]
[0810] RQM(x,y)=DQM(x / F,y), where x=0,1,…15, y=0,1,…7, F=2
[0811] As in the example of Equation 27, the quantization matrix RQM for quantization / dequantization of a block of size 8×16 may be reconstructed by subsampling the default quantization matrix DQM of size 8×8 at the y position (row, vertical direction).
[0812] [Equation 27]
[0813] RQM(x,y)=DQM(x,y / F), where x=0,1,…7, y=0,1,…15, F=2
[0814] As in the example of Equation 28, the quantization matrix RQM for quantization / inverse quantization of a block of size 16×4 can be reconstructed by upsampling the default matrix DQM of size 8×8 at the x position (column, horizontal direction) and subsampling the default matrix DQM of size 8×8 at the y position (row, vertical direction) while skipping J (=F-1) rows. Here, J may be a positive integer.
[0815] [Equation 28]
[0816] RQM(x,y)=DQM(x / F,y*F), where x=0,1,…15, y=0,1,…3, F=2
[0817] As in the example of Equation 29, the quantization matrix RQM for quantization / inverse quantization of a block of size 4×16 can be reconstructed by upsampling the default quantization matrix DQM of size 8×8 while skipping K (=F-1) columns at the x position (column, horizontal direction) and subsampling the default quantization matrix DQM of size 8×8 at the y position (row, vertical direction). Here, K may be a positive integer.
[0818] [Equation 29]
[0819] RQM(x,y)=DQM(x*F,y / F), where x=0,1,…3, y=0,1,…15, F=2
[0820] As in the example of Equation 30, the quantization matrix RQM for quantization / dequantization of a block of size 32×4 can be reconstructed by upsampling the default quantization matrix DQM of size 8×8 by Fx at the x position (column, horizontal direction) and subsampling the default quantization matrix DQM of size 8×8 while skipping J (=Fy-1) rows at the y position (row, vertical direction). Here, J may be a positive integer.
[0821] [Equation 30]
[0822] RQM(x,y)=DQM(x / Fx,y*Fy), where,x=0,1,…31,y=0,1,…3,Fx=4,Fy=2
[0823] As in the example of Equation 31, the quantization matrix RQM for quantization / inverse quantization of a block of size 4×32 can be reconstructed by upsampling the default quantization matrix DQM of size 8×8 while skipping K (=Fx-1) columns at the x position (column, horizontal direction) and subsampling the default quantization matrix DQM of size 8×8 by Fy at the y position (row, vertical direction). Here, K may be a positive integer.
[0824] [Equation 31]
[0825] RQM(x,y)=DQM(x*Fx,y / Fy), where x=0,1,…3, y=0,1,…31, Fx=2, Fy=4
[0826] As in the example of Equation 32, the quantization matrix RQM for quantization / dequantization of a block of size 64×32 can be reconstructed by upsampling the default quantization matrix DQM of size 8×8 by Fx and Fy (with factors of different sizes) at the x position (column, horizontal direction) and the y position (row, vertical direction).
[0827] [Equation 32]
[0828] RQM(x,y)=DQM(x / Fx,y / Fy), where x=0,1,…63, y=0,1,…31, Fx=8, Fy=4
[0829] As in the example of Equation 33, the quantization matrix RQM for quantization / dequantization of a block of size 32×64 can be reconstructed by upsampling the default quantization matrix DQM of size 8×8 by Fx and Fy (with factors of different sizes) at the x position (column, horizontal direction) and the y position (row, vertical direction).
[0830] [Equation 33]
[0831] RQM(x,y)=DQM(x / Fx,y / Fy), where x=0,1,…31, y=0,1,…63, Fx=4, Fy=8
[0832] In order to reconstruct the quantization matrix for quantization / dequantization using the default matrix and the encoded / decoded quantization matrix, at least one of the following methods may be used. At this time, at least one of the following methods may be performed based on the size of at least one of the default matrix, the encoded / decoded quantization matrix, or the quantization matrix for quantization / dequantization.
[0833] For example, subsampling / downsampling may be performed on at least one of a default matrix or an encoded / decoded quantization matrix in a row direction and a column direction, thereby reconstructing a square quantization matrix for quantization / inverse quantization.
[0834] In another example, upsampling / interpolation may be performed on at least one of a default matrix or an encoded / decoded quantization matrix in a row direction and a column direction, thereby reconstructing a square quantization matrix for quantization / dequantization.
[0835] In another example, subsampling / downsampling may be performed in the row direction or the column direction for at least one of the default matrix or the encoded / decoded quantization matrix, thereby reconstructing a non-square quantization matrix for quantization / dequantization. In this case, the factors for subsampling / downsampling may be different from each other in the row direction and the column direction.
[0836] In another example, upsampling / interpolation may be performed on at least one of a default matrix or an encoded / decoded quantization matrix in a row direction or a column direction, thereby reconstructing a non-square quantization matrix for quantization / dequantization. In this case, the factors used for upsampling / interpolation may be different from each other in the row direction and the column direction.
[0837] In another example, for at least one of the default matrix or the encoded / decoded quantization matrix, upsampling / interpolation may be performed in the row direction, and subsampling / downsampling may be performed in the column direction, thereby reconstructing a non-square quantization matrix for quantization / inverse quantization. In this case, the factors for upsampling / interpolation and subsampling / downsampling may be different from each other.
[0838] In another example, for at least one of the default matrix or the encoded / decoded quantization matrix, subsampling / downsampling may be performed in the row direction, and upsampling / interpolation may be performed in the column direction, thereby reconstructing a non-square quantization matrix for quantization / inverse quantization. At this time, the factors for upsampling / interpolation and subsampling / downsampling may be different from each other.
[0839] In Equations 1 to 33, QM(x,y) may represent an aligned two-dimensional quantization matrix having a size of 4×4, RQM(x,y) may represent a reconstructed quantization matrix, and DQM(x,y) may represent a default matrix.
[0840] The upsampling method that performs copying from the nearest neighbor matrix coefficients may be referred to as a nearest neighbor interpolation method or a zero-order interpolation method.
[0841] In addition, the quantization matrix may be reconstructed using at least one of the following methods.
[0842] The coefficient ScalingFactor[sizeId][matrixId][][] of the quantization matrix of size 2×2 can be derived as in the example of Equation 34.
[0843] [Equation 34]
[0844] ScalingFactor[sizeId][matrixId][x][y]=ScalingList[sizeId][matrixId][i], where i=0...3, matrixId=0...5 or matrixId=0...8, x=ScanOrder[2][0][i][0], and y=ScanOrder[2][0][i][1]
[0845] The coefficient ScalingFactor[sizeId][matrixId][][] of the quantization matrix of size 4×4 can be derived as in the example of Equation 35.
[0846] [Equation 35]
[0847] ScalingFactor[sizeId][matrixId][x][y]=ScalingList[sizeId][matrixId][i], where i=0...15, matrixId=0...5 or matrixId=0...8, x=ScanOrder[2][0][i][0], and y=ScanOrder[2][0][i][1]
[0848] The coefficient ScalingFactor[sizeId][matrixId][][] of the quantization matrix of size 8×8 can be derived as in the example of Equation 36.
[0849] [Equation 36]
[0850] ScalingFactor[sizeId][matrixId][x][y]=ScalingList[sizeId][matrixId][i], where i=0...63, matrixId=0...5 or matrixId=0...8, x=ScanOrder[3][0][i][0], and y=ScanOrder[3][0][i][1]
[0851] The coefficient ScalingFactor[sizeId][matrixId][][] of the quantization matrix of size 16×16 may be derived as in the examples of Equations 37 and 38.
[0852] [Equation 37]
[0853] ScalingFactor[sizeId][matrixId][x*2+k][y*2+j]=ScalingList[sizeId][matrixId][i], where i=0…63, j=0…1, k=0…1, matrixId=0…5 or matrixId=0…8, x=ScanOrder[3][0][i][0], and y=ScanOrder[3][0][i][1]
[0854] [Equation 38]
[0855] ScalingFactor[sizeId][matrixId][0][0]=scaling_list_dc_coef_minus8[0][matrixId]+8, where matrixId=0...5 or matrixId=0...8
[0856] The coefficient ScalingFactor[sizeId][matrixId][][] of the quantization matrix of size 32×32 may be derived as in the examples of Equations 39 and 40.
[0857] [Equation 39]
[0858] ScalingFactor[sizeId][matrixId][x*4+k][y*4+j]=ScalingList[sizeId][matrixId][i], where i=0…63, j=0…3, k=0…3, matrixId=0…5 or matrixId=0…8, x=ScanOrder[3][0][i][0], and y=ScanOrder[3][0][i][1]
[0859] [Equation 40]
[0860] ScalingFactor[sizeId][matrixId][0][0]=scaling_list_dc_coef_minus8[1][matrixId]+8, where matrixId=0...5 or matrixId=0...8
[0861] The coefficient ScalingFactor[sizeId][matrixId][][] of the quantization matrix of size 64×64 may be derived as in the examples of Equations 41 and 42.
[0862] [Equation 41]
[0863] ScalingFactor[sizeId][matrixId][x*8+k][y*8+j]=ScalingList[sizeId][matrixId][i], where i=0…63, j=0…7, k=0…7, matrixId=0…5 or matrixId=0…8, x=ScanOrder[3][0][i][0], and y=ScanOrder[3][0][i][1]
[0864] [Equation 42]
[0865] ScalingFactor[sizeId][matrixId][0][0]=scaling_list_dc_coef_minus8[1][matrixId]+8, where matrixId=0...5 or matrixId=0...8
[0866] Alternatively, the coefficient ScalingFactor[sizeId][matrixId][][] of a quantization matrix having a size of 64×64 may be derived as in the examples of Equations 43 and 44.
[0867] [Equation 43]
[0868] ScalingFactor[sizeId][matrixId][x*8+k][y*8+j]=ScalingList[sizeId][matrixId][i], where i=0…63, j=0…7, k=0…7, matrixId=0,3 or matrixId=0,3,6, x=ScanOrder[3][0][i][0], and y=ScanOrder[3][0][i][1]
[0869] [Equation 44]
[0870] ScalingFactor[sizeId][matrixId][0][0]=scaling_list_dc_coef_minus8[1][matrixId]+8, where matrixId=0,3 or matrixId=0,3,6
[0871] The size of a quantization matrix used in a quantization / inverse quantization process and the size of an encoded / decoded quantization matrix may be equal to each other.
[0872] For example, when at least one of the width or height of at least one of the block, transform or quantization matrix is less than or equal to M, the size of the quantization matrix used in the quantization / inverse quantization process and the size of the quantization matrix after encoding / decoding may be equal to each other. In this case, M may be a positive integer. For example, M may be 8.
[0873] The size of a quantization matrix used in a quantization / inverse quantization process and the size of an encoded / decoded quantization matrix may be different from each other.
[0874] For example, when at least one of the width or height of at least one of the block, transform or quantization matrix is greater than M, the size of the quantization matrix used in the quantization / inverse quantization process and the size of the quantization matrix after encoding / decoding may be different from each other. In this case, M may be a positive integer. For example, M may be 8.
[0875] When the size of the quantization matrix used in the quantization / inverse quantization process and the size of the encoded / decoded quantization matrix are different from each other, the encoder may perform at least one of upsampling, interpolation, subsampling or downsampling on the quantization matrix and perform entropy encoding on the quantization matrix.
[0876] When the size of the quantization matrix used in the quantization / inverse quantization process and the size of the encoded / decoded quantization matrix are different from each other, the decoder may perform at least one of upsampling, interpolation, subsampling or downsampling on the entropy-encoded quantization matrix in at least one of the horizontal direction (column direction) and the vertical direction (row direction), and reconstruct the quantization matrix.
[0877] When the block size is larger than M×N, a quantization matrix having the same size as the block size may be used in the quantization / inverse quantization process of the block, represented / constructed by a quantization matrix having a size of J×K, and encoded / decoded.
[0878] At this time, M, N, J and K may be positive integers. For example, at least one of M, N, J or K may be 8.
[0879] Furthermore, J may be less than or equal to M, and K may be less than or equal to N.
[0880] In the quantization / inverse quantization process of a block having a size of J×K, a quantization matrix having the same size as the block size is used, represented / constructed by a quantization matrix having a size described below, and encoded and decoded: When at least one of J or K is greater than M in the quantization matrix having a size of J×K, at least one of J or K is replaced with M. At this time, the quantization matrix may be encoded / decoded to have a size of at least one of J×M, M×K, or M×M.
[0881] At this time, M, N, J and K may be positive integers. For example, at least one of M, N, J or K may be 16.
[0882] For example, a quantization matrix of size 16×16, 32×32, or 64×64 may be used in quantization / dequantization for a size of 16×16, 32×32, or 64×64 in quantization / dequantization, represented / constructed by a quantization matrix of size 8×8, and encoded / decoded.
[0883] For example, the encoder may use a quantization matrix of size 16×16, 32×32, or 64×64 in quantization / inverse quantization, and subsample and encode the quantization matrix of size 16×16, 32×32, or 64×64 into a quantization matrix of size 8×8.
[0884] For example, the decoder may decode a quantization matrix of size 8×8, perform interpolation and reconstruct a quantization matrix of size 16×16, 32×32, or 64×64, and use a quantization matrix of size 16×16, 32×32, or 64×64 in inverse quantization.
[0885] In the above example, in the case where the block has a width or height greater than 32 (such as 64×64, 64×32, 64×16, 16×64, or 32×64), the maximum size of the transform may be 32 in the horizontal direction or the vertical direction. In this case, the size of the quantization matrix used in quantization / dequantization may correspond to the size of the transform. In addition, the quantization matrix may be encoded / decoded to have the size of the quantization matrix corresponding to the size of the transform. For example, the coefficient values of the quantization matrix of the current block may be adjusted in consideration of the transform size of the current block. That is, the coefficients of the region other than the first region corresponding to the transform size of the current block in the quantization matrix of the current block may be replaced with 0. Here, the first region may be located on the upper left side of the quantization matrix of the current block.
[0886] For example, when a 32×32 transform is used in a 64×64 block, the size of the quantization matrix used in quantization / inverse quantization may be 32×32. Alternatively, in the case of an area other than the upper left side having a size of 32×32 in the quantization matrix, the coefficients of the area may be replaced with 0.
[0887] In another example, when a 32×32 transform is used in a 64×32 block, the size of the quantization matrix used in quantization / inverse quantization may be 32×32. Alternatively, in the case of an area other than the upper left side having a size of 32×32 in the quantization matrix, the coefficients of the area may be replaced with 0.
[0888] In another example, when a 32×16 transform is used in a 64×16 block, the size of the quantization matrix used in quantization / inverse quantization may be 32×16. Alternatively, in the case of an area other than the upper left side having a size of 32×16 in the quantization matrix, the coefficients of the area may be replaced with 0.
[0889] At least one of representing, constructing, reconstructing, predicting, or encoding / decoding the quantization matrix may be performed by applying at least one of horizontal flipping, vertical flipping, or sign change to at least one of the quantization matrices.
[0890] For example, at least one of horizontal flipping, vertical flipping, or sign change may be performed on at least one of the quantization matrices, and the quantization matrix may be used in the quantization / inverse quantization process.
[0891] In another example, at least one of a horizontal flip, a vertical flip, or a sign change may be performed on at least one of the quantization matrices, and the quantization matrix may be used as a default matrix in a quantization / dequantization process. For example, the quantization matrix may be used as a default matrix in a quantization / dequantization process.
[0892] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be performed on at least one of the quantization matrices, and the quantization matrix may be used as a reference matrix. For example, the quantization matrix may be used as a reference matrix in a quantization / dequantization process.
[0893] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be performed on at least one of the quantization matrices, thereby performing prediction between quantization matrices.
[0894] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be performed on at least one of the quantization matrices, thereby performing predictive encoding / decoding on coefficients in the quantization matrix.
[0895] In addition, for example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one quantization matrix in the quantization matrix used in the DST-7-based transform to derive the quantization matrix used in the DCT-8-based transform, thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in the quantization / inverse quantization process. At this time, horizontal flipping or vertical flipping may be performed.
[0896] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one quantization matrix used in the DCT-8 based transform to derive the quantization matrix used in the DST-7 based transform, thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in a quantization / dequantization process. At this time, horizontal flipping or vertical flipping may be performed.
[0897] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one quantization matrix in the quantization matrix used in the DST-4-based transform to derive the quantization matrix used in the DCT-4-based transform, thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in a quantization / dequantization process. At this time, horizontal flipping or vertical flipping may be performed.
[0898] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one quantization matrix in the quantization matrix used in the DCT-4 based transform to derive the quantization matrix used in the DCT-4 based transform, thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in a quantization / dequantization process. At this time, horizontal flipping or vertical flipping may be performed.
[0899] In addition, for example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one of the quantization matrices used in the horizontal transform and the vertical transform (i.e., the transform based on DST-7 and the transform based on DST-7) to derive the quantization matrix used in the horizontal transform and the vertical transform (i.e., the transform based on DCT-8 and the transform based on DCT-8), thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in the quantization / dequantization process. At this time, horizontal flipping or vertical flipping may also be performed.
[0900] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one of the quantization matrices used in the horizontal transform and the vertical transform (i.e., the transform based on DCT-8 and the transform based on DCT-8) to derive the quantization matrix used in the horizontal transform and the vertical transform (i.e., the transform based on DST-7 and the transform based on DST-7), thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in the quantization / dequantization process. At this time, horizontal flipping or vertical flipping may also be performed.
[0901] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one of the quantization matrices used in the horizontal transform and the vertical transform (i.e., the DCT-8-based transform and the DST-7-based transform) to derive the quantization matrix used in the horizontal transform and the vertical transform (i.e., the DST-7-based transform and the DCT-8-based transform), thereby performing at least one of representing, constructing, reconstructing, predicting, or encoding / decoding the quantization matrix. The quantization matrix may be used in a quantization / dequantization process.
[0902] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one of the quantization matrices used in the horizontal transform and the vertical transform (i.e., the DST-7-based transform and the DCT-8-based transform) to derive the quantization matrix used in the horizontal transform and the vertical transform (i.e., the DCT-8-based transform and the DST-7-based transform), thereby performing at least one of representing, constructing, reconstructing, predicting, or encoding / decoding the quantization matrix. The quantization matrix may be used in a quantization / dequantization process.
[0903] In addition, for example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one of the quantization matrices used in the horizontal transform and the vertical transform (i.e., the DST-4-based transform and the DST-4-based transform) to derive the quantization matrix used in the horizontal transform and the vertical transform (i.e., the DCT-4-based transform and the DCT-4-based transform), thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in the quantization / dequantization process. At this time, horizontal flipping or vertical flipping may also be performed.
[0904] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one of the quantization matrices used in the horizontal transform and the vertical transform (i.e., the DCT-4-based transform and the DCT-4-based transform) to derive the quantization matrix used in the horizontal transform and the vertical transform (i.e., the DST-4-based transform and the DCT-4-based transform), thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in the quantization / dequantization process. At this time, horizontal flipping or vertical flipping may also be performed.
[0905] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one of the quantization matrices used in the horizontal transform and the vertical transform (i.e., the DCT-4-based transform and the DST-4-based transform) to derive the quantization matrix used in the horizontal transform and the vertical transform (i.e., the DST-4-based transform and the DCT-4-based transform), thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in the quantization / dequantization process. At this time, horizontal flipping or vertical flipping may also be performed.
[0906] In another example, at least one of horizontal flipping, vertical flipping, or sign change may be applied to at least one of the quantization matrices used in the horizontal transform and the vertical transform (i.e., the DST-4-based transform and the DCT-4-based transform) to derive the quantization matrix used in the horizontal transform and the vertical transform (i.e., the DCT-4-based transform and the DST-4-based transform), thereby performing at least one of representation, construction, reconstruction, prediction, or encoding / decoding of the quantization matrix. The quantization matrix may be used in the quantization / dequantization process. At this time, horizontal flipping or vertical flipping may also be performed.
[0907] At least one of DST-7, DCT-8, DST-4 or DCT-4 may be a transform using a transform matrix extracted from at least one integer transform based on DCT-J or DST-K (such as DCT-2, DCT-8, DST-7, DCT-4, DST-4, etc.).
[0908] Figures 77 to 88 It is a diagram illustrating syntax element information, semantics of the syntax element information, and encoding / decoding processing required to implement a quantization matrix encoding / decoding method and apparatus and a recording medium for storing a bit stream according to an embodiment of the present invention.
[0909] Figures 89 to 100 is a diagram illustrating a default matrix used in a quantization / dequantization process according to an embodiment of the present invention.
[0910] Reference Figures 89 to 92 , similar to Figure 21 to Figure 22 For example, a default matrix of size J×K predefined in the encoder and decoder may be used in the quantization / dequantization process of a block of size M×N.
[0911] Here, ScalingList[sizeId][matrixId][i] may indicate a default quantization matrix coefficient corresponding to sizeId, matrixId, and i, and sizeId and matrixId may be represented in Fig.55 and Fig.56or Fig.58 and Fig.59 Those defined in .
[0912] Reference Figure 93 to Figure 96 , similar to Figure 21 to Figure 22 For example, a default matrix of size J×K predefined in the encoder and decoder may be used in the quantization / dequantization process of a block of size M×N.
[0913] Here, ScalingList[sizeId][matrixId][i] may indicate a default quantization matrix coefficient corresponding to sizeId, matrixId, and i, and sizeId and matrixId may be represented in Fig.55 and Fig.56 or Fig.58 and Fig.59 Those defined in .
[0914] Reference Figures 97 to 100 , similar to Figure 21 to Figure 22 For example, a default matrix of size J×K predefined in the encoder and decoder may be used in the quantization / dequantization process of a block of size M×N. Matrix coefficient values of the default matrix may all have constant values regardless of the prediction mode, color component, block size, etc.
[0915] Here, ScalingList[sizeId][matrixId][i] may indicate a default quantization matrix coefficient corresponding to sizeId, matrixId, and i, and sizeId and matrixId may be represented in Fig.55 and Fig.56 or Fig.58 and Fig.59 That is, regardless of sizeId and matrixId, the default matrix coefficient values can all be set to fixed values. At this time, the fixed value can be a positive integer including 0, and can be 16.
[0916] Figures 101 to 134 A diagram illustrating syntax element information, semantics of the syntax element information, and encoding / decoding processing required to implement a quantization matrix encoding / decoding method and apparatus and a recording medium for storing a bit stream according to another embodiment of the present invention.
[0917] Reference Figures 124 to 130 Regardless of the prediction mode, color component, and block size, the matrix coefficient values of the default matrix may all have a constant value. For example, the constant value may be 16. The block size may indicate the size of the current block and the transform block.
[0918] In addition, there are three modes in the quantization matrix (off mode, default mode, user-defined mode). In the default mode, the matrix coefficient values of the quantization matrix can all be 16.
[0919] Additionally, the DC matrix coefficient values may be signaled separately for quantization matrices of size 16x16, 32x32, or 64x64.
[0920] In case the transform block has a size smaller than 8x8, all elements of the quantization matrix may be signaled.
[0921] Conversely, in the case where the transform block has a size greater than 8×8 (e.g., 16×16, 32×32, 64×64), 64 elements of one quantization matrix of size 8×8 may be signaled as a basic scaling matrix. In addition, a square matrix having a size greater than 8×8 may be obtained by upsampling the 8×8 basic scaling matrix.
[0922] In a W×H (width×height) non-square transform block, when H is greater than W, as in the example of Equation 45, the quantization matrix of the block may be derived from a reference quantization matrix of size baseL×baseL. Here, baseL may represent min(log2(H), 3).
[0923] [Equation 45]
[0924] ScalingMatrix(i,j)=ScalingList[baseL x int(j / ratioH)+int((ixratioHW) / ratioH)],
[0925] Among them, i=0:W-1, j=0:H-1, and ratioH=H / baseL, ratioHW=H / W.
[0926] Alternatively, in a W×H (width×height) non-square transform block, when W is greater than H, as in the example of Equation 46, the quantization matrix of the block may be derived from a reference quantization matrix of size baseL×baseL. Here, baseL may represent min(log2(W), 3).
[0927] [Equation 46]
[0928] ScalingMatrix(i,j)=ScalingList[baseL x int((jx ratioWH) / ratioW)+int(W)],
[0929] Among them, i=0:W-1, j=0:H-1, and ratioW=W / baseL, ratioWH=W / H.
[0930] In addition, refer to Figure 133 to Figure 134 The quantization matrix may be derived based on information (eg, pic_dep_quant_enabled_flag) about whether dependent quantization is possible for a slice associated with a picture header. Here, the information may be entropy encoded / decoded in a parallel block header.
[0931] Fig.135 is a flowchart illustrating an image decoding method according to another embodiment of the present invention.
[0932] The decoder may decode information about a quantization matrix from a bitstream (S13501).
[0933] A quantization matrix of the current block may be acquired based on the information about the quantization matrix (S13502).
[0934] Here, the step of acquiring the quantization matrix of the current block may mean deriving a single identifier using at least one of a size, a prediction mode, or a color component of the current block and acquiring the quantization matrix of the current block based on the single identifier.
[0935] The information about the quantization matrix includes quantization matrix prediction method information, and the quantization matrix prediction method information may be decoded in an adaptive parameter set.
[0936] The prediction modes include an intra mode, an inter mode, and an IBC (Intra Block Copy) mode, and a single identifier for the inter mode and a single identifier for the IBC mode may be the same.
[0937] The information about the quantization matrix includes information about whether the quantization matrix exists, and when the information about whether the quantization matrix exists indicates that the quantization matrix does not exist, all coefficient values of the quantization matrix of the current block may have a predetermined constant value. For example, the predetermined constant value may be 16.
[0938] Furthermore, the step of acquiring the quantization matrix of the current block means that coefficient values of the quantization matrix of the current block may be adjusted in consideration of the transform size of the current block.
[0939] The step of adjusting the coefficient values of the quantization matrix of the current block may mean that coefficients of a region other than a first region corresponding to a transform size of the current block in the quantization matrix of the current block may be replaced with zero.
[0940] The first area may be located at an upper left side of the quantization matrix of the current block.
[0941] Furthermore, the step of acquiring the quantization matrix of the current block may mean acquiring a default quantization matrix based on the information about the quantization matrix. Regardless of the size of the current block, all coefficient values of the default quantization matrix may have a predetermined constant value.
[0942] In addition, the step of acquiring the quantization matrix of the current block may represent performing subsampling on the reconstructed primary quantization matrix based on the information about the quantization matrix. The subsampling may be performed in at least one of the horizontal direction or the vertical direction of the primary quantization matrix.
[0943] The current block may be inversely quantized using the quantization matrix of the current block ( S13503 ).
[0944] Fig.136 is a flowchart illustrating an image encoding method according to another embodiment of the present invention.
[0945] The encoder may determine a quantization matrix of a current block (S13601).
[0946] The current block may be quantized using a quantization matrix of the current block ( S13602 ).
[0947] Information about a quantization matrix of a current block may be encoded (S13603).
[0948] The step of encoding the information about the quantization matrix of the current block may mean deriving a single identifier using at least one of the size, prediction mode, or color component of the current block, and encoding the information about the quantization matrix of the current block based on the single identifier.
[0949] The information about the quantization matrix includes quantization matrix prediction method information, and the quantization matrix prediction method information may be encoded in an adaptive parameter set.
[0950] The prediction modes include an intra mode, an inter mode, and an IBC (Intra Block Copy) mode, and a single identifier for the inter mode and a single identifier for the IBC mode may be the same.
[0951] When the quantization matrix does not exist, all coefficient values of the quantization matrix of the current block may have predetermined constant values.
[0952] The predetermined constant value may be 16.
[0953] Furthermore, the step of encoding the quantization matrix of the current block means that coefficient values of the quantization matrix of the current block may be adjusted in consideration of the transform size of the current block.
[0954] The step of adjusting the coefficient values of the quantization matrix of the current block may mean that coefficients of a region other than a first region corresponding to a transform size of the current block in the quantization matrix of the current block may be replaced with zero.
[0955] The first area may be located at an upper left side of the quantization matrix of the current block.
[0956] Furthermore, the step of encoding the quantization matrix of the current block may mean encoding information about the quantization matrix of the current block based on a default quantization matrix. Regardless of the size of the current block, all coefficient values of the default quantization matrix may have a predetermined constant value.
[0957] In addition, a non-transitory computer-readable recording medium for storing a bit stream generated by an image encoding method is provided, the image encoding method comprising: determining a quantization matrix of a current block, quantizing the current block using the quantization matrix of the current block, and encoding information about the quantization matrix of the current block, wherein the step of encoding the information about the quantization matrix of the current block comprises: deriving a single identifier using at least one of a size, a prediction mode, or a color component of the current block, and encoding the information about the quantization matrix of the current block based on the single identifier.
[0958] The encoder may perform quantization / dequantization using the quantization matrix in the quantization / dequantization process through the above embodiment. In addition, the decoder may perform dequantization using the reconstructed quantization matrix in the dequantization process through the above embodiment. The reconstructed quantization matrix may be a two-dimensional quantization matrix.
[0959] In the above-mentioned embodiment, at least one of representation, construction, reconstruction, prediction or encoding / decoding of the quantization matrix may be performed so that different quantization matrices are used in the quantization / dequantization process based on at least one of the prediction mode, color component, size, form, one-dimensional transform type, two-dimensional transform combination, or whether the transform is used of the block. At this time, at least one quantization matrix among the quantization matrices that have been represented, constructed, reconstructed, predicted or encoded / decoded may be a quantization matrix in which at least one coefficient of the coefficients in the quantization matrix is different according to the prediction mode, color component, size, form, one-dimensional transform type, two-dimensional transform combination, or whether the transform is used.
[0960] In the above embodiments, the encoder may use a quantization matrix in the transform coefficients to generate transform coefficient levels in the quantization process, and the decoder may use quantization in the transform coefficient levels to generate transform coefficients in the inverse quantization process. In the present invention, for convenience, transform coefficients and transform coefficient levels are collectively referred to as transform coefficients.
[0961] In the above-described embodiment, a quantization matrix of size M×N or N×M can be derived from a square quantization matrix of size M×M, and the representation of the quantization matrix of size M×M in the quantization / inverse quantization process can represent not only a square quantization matrix of size M×M, but also a non-square quantization matrix of size M×N or N×M. Here, M and N may be positive values and may have values between 2 and 64. M and N may be different values.
[0962] For example, since a non-square quantization matrix of size 16×4 or 4×16 in the quantization / inverse quantization process is derived from a square quantization matrix of size 16×16, the representation of the quantization matrix of size 16×16 in the quantization / inverse quantization process can not only represent a square quantization matrix of size 16×16, but also a non-square quantization matrix of size 16×4 or 4×16.
[0963] In the above-mentioned embodiment, the information about the quantization matrix may represent at least one of the quantization matrix or the information required to derive the quantization matrix. At this time, the information required to derive the quantization matrix may include at least one of the following information: information on whether the quantization matrix is used, information on whether the quantization matrix exists, quantization matrix prediction method information, reference matrix identifier, DC matrix coefficient or lowest frequency matrix coefficient, or the difference between the previously encoded / decoded quantization matrix coefficient value and the encoding / decoding target quantization matrix coefficient value in the quantization matrix.
[0964] Embodiments of the present invention may be applied according to the size of at least one of the blocks or units. The size may be defined as the minimum size and / or maximum size for the application of the embodiment, and may be defined as a fixed size for the application of the embodiment. In addition, the first embodiment is applicable to the first size, and the second embodiment is applicable to the second size. In addition, embodiments of the present invention are only applicable to the case of the minimum size or larger and the maximum size or smaller. That is, the embodiment is only applicable when the block size is in a specific range.
[0965] In addition, embodiments of the present invention are only applicable to the case of minimum size or greater and maximum size or less. The minimum size and maximum size can be the size of one of the block or unit. That is, the target block with minimum size and the target block with maximum size can be different from each other. For example, embodiments of the present inventi...
Claims
1. A method for decoding an image, the method comprising: Obtain information about the quantization matrix from the bitstream decoding; determining a plurality of quantization matrices based on the information about the quantization matrix, wherein the plurality of quantization matrices are identified by a single identifier and respectively correspond to values of the single identifier assigned according to a block size, a prediction mode, and a color component; deriving a value of the single identifier indicating a quantization matrix of the current block among the plurality of quantization matrices by using a size of the current block, a prediction mode used to generate a prediction block of the current block, and a color component of the current block; reconstructing quantized transform coefficients from the bitstream; and determining a quantization matrix of the current block based on the value of the single identifier indicating the quantization matrix of the current block and dequantizing the quantized transform coefficients using the quantization matrix of the current block, The information about the quantization matrix includes syntax elements for representing quantization matrix coefficients. The information about the quantization matrix to be used for a block larger than 8×8 includes a maximum of 64 syntax elements corresponding to the 8×8 block. Here, the information on the quantization matrix to be used for the block having a size equal to 64×64 does not include a syntax element corresponding to the lower right 4×4 block in the 8×8 block.
2. The method of claim 1, wherein: The information about the quantization matrix includes quantization matrix prediction method information, and the quantization matrix prediction method information is decoded in an adaptive parameter set.
3. The method according to claim 1, in, The prediction modes include intra mode, inter mode and intra block copy (IBC) mode, and The single identifier for the inter-frame mode and the single identifier for the IBC mode are the same.
4. The method of claim 1, wherein: The method further comprises: acquiring, from a bitstream, first information indicating whether the plurality of quantization matrices are used for quantization; and When the first information indicates that the multiple quantization matrices are not used for quantization, the current block is inversely quantized using a default quantization matrix.
5. The method of claim 4, wherein: The preset value is 16.
6. The method of claim 1, further comprising: When a secondary transform is performed on a current block, a default quantization matrix is determined as a quantization matrix of the current block.
7. The method of claim 6, further comprising: acquiring second information, wherein the second information indicates whether the default quantization matrix is determined as a quantization matrix of a block on which a secondary transform is performed, and When the second information indicates that the default quantization matrix is determined as the quantization matrix of the block on which the secondary transform is performed and the secondary transform is performed on the current block, the default quantization matrix is determined as the quantization matrix of the current block.
8. The method of claim 1, wherein: The step of determining the quantization matrix of the current block is characterized by: It is determined that the size of the quantization matrix of the current block is smaller than the size of the current block.
9. The method of claim 8, wherein: When the size of the current block is greater than 32×32, the size of the quantization matrix of the current block is 32×32.
10. The method according to claim 1, in, The step of determining the quantization matrix of the current block includes: performing subsampling on the quantization matrix of the current block based on the size of the current block, and The subsampling is performed in at least one of a horizontal direction and a vertical direction of a quantization matrix of the current block.
11. A method for encoding an image, the method comprising: determining a plurality of quantization matrices, wherein the plurality of quantization matrices are identified by a single identifier and respectively correspond to values of the single identifier assigned according to a block size, a prediction mode, and a color component; deriving a value of the single identifier indicating a quantization matrix of the current block among the plurality of quantization matrices by using a size of the current block, a prediction mode used to generate a prediction block of the current block, and a color component of the current block; Transforming the residual of the current block to generate transform coefficients; determining a quantization matrix of the current block based on the value of the single identifier indicating the quantization matrix of the current block and quantizing transform coefficients using the quantization matrix of the current block; encoding information about quantization matrices indicating the plurality of quantization matrices, and encoding quantized transform coefficients, The information about the quantization matrix includes syntax elements for representing quantization matrix coefficients. The information about the quantization matrix to be used for a block larger than 8×8 includes a maximum of 64 syntax elements corresponding to the 8×8 block. Among them, the information on the quantization matrix to be used for the block with a size equal to 64×64 does not include the syntax element corresponding to the lower right 4×4 block in the 8×8 block.
12. A method for transmitting a bitstream containing encoded video data, the method comprising: Generate a bitstream by encoding video data; as well as Send the bitstream to the video decoding device, The step of generating a bit stream includes: determining a plurality of quantization matrices, wherein the plurality of quantization matrices are identified by a single identifier and respectively correspond to values of the single identifier assigned according to a block size, a prediction mode, and a color component; deriving a value of the single identifier indicating a quantization matrix of the current block among the plurality of quantization matrices by using a size of the current block, a prediction mode used to generate a prediction block of the current block, and a color component of the current block; Transforming the residual of the current block to generate transform coefficients; determining a quantization matrix of the current block based on the value of the single identifier indicating the quantization matrix of the current block and quantizing transform coefficients using the quantization matrix of the current block; encoding information about quantization matrices indicating the plurality of quantization matrices, and encoding quantized transform coefficients, The information about the quantization matrix includes syntax elements for representing quantization matrix coefficients. The information about the quantization matrix to be used for a block larger than 8×8 includes a maximum of 64 syntax elements corresponding to the 8×8 block. Here, the information on the quantization matrix to be used for the block having a size equal to 64×64 does not include a syntax element corresponding to the lower right 4×4 block in the 8×8 block.