Image encoding / decoding method and bit stream transmission method using adaptive loop filter
By using a video coding method and device with cross-component adaptive in-loop filtering, the problem of increased data volume in high-definition and ultra-high-definition images is solved, achieving more efficient image encoding and decoding while reducing computational complexity and storage requirements.
Patent Information
- Application Number
- CN202411923812.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-11-22
- Filing Date
- 2020-11-23
- Publication Date
- 2025-02-21
AI Technical Summary
With the increasing demand for high-definition and ultra-high-definition images, existing video coding technologies face the problem of increased data volume during transmission and storage, leading to higher transmission and storage costs.
A video coding method and device employing cross-component adaptive in-loop filtering reduces computational complexity and memory access bandwidth by processing image blocks through an adaptive loop filter.
It improves the efficiency of image encoding and decoding, and reduces the computational complexity and memory requirements of image encoders and decoders.
Smart Images

Figure CN119496892A_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with an application date of November 23, 2020, application number 202080079501.7, and invention name “Image encoding / decoding method and bit stream sending method using adaptive loop filter”. Technical Field
[0002] The present invention relates to a video encoding / decoding method, a video encoding / decoding device, and a recording medium storing a bit stream. In particular, the present invention relates to a video encoding / decoding method and device using in-loop filtering. 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 and storage costs 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 with high-resolution and high-quality image data, efficient image encoding / decoding technology is needed.
[0004] There are various video compression techniques, such as inter-frame prediction techniques that predict the values of pixels within a current picture from the values of pixels within a previous picture or a subsequent picture, intra-frame prediction techniques that predict the values of pixels within an area of the current picture from the values of pixels within another area of the current picture, transformation and quantization techniques that compress the energy of residual signals, and entropy coding techniques that assign shorter codes to frequently occurring pixel values and longer codes to less frequently occurring pixel values. Summary of the Invention
[0005] Technical issues
[0006] The object of the present invention is to provide a video encoding / decoding method and device using adaptive in-loop filtering.
[0007] An object of the present invention is to provide a video encoding / decoding method and apparatus using cross-component adaptive in-loop filtering.
[0008] Another object of the present invention is to provide a recording medium storing a bit stream generated by a video encoding / decoding method or apparatus.
[0009] Technical Solution
[0010] According to an embodiment of the present disclosure, an image decoding method includes: obtaining a reconstructed luminance block of a current block, determining whether a cross-component adaptive loop filter is applied to the current block, when a cross-component adaptive loop filter is applied to the current block, obtaining a reconstructed chroma block of the current block to which the adaptive loop filter is applied, and using the reconstructed luminance block and the reconstructed chroma block to which the adaptive loop filter is applied to obtain a final reconstructed chroma block of the current block to which the cross-component loop filter is applied.
[0011] The step of determining whether a cross-component adaptive loop filter is applied to the current block includes: obtaining information indicating whether a cross-component adaptive loop filter is available for the current block, and wherein the information indicating whether the cross-component adaptive loop filter is available is signaled through a sequence parameter set.
[0012] The image decoding method further includes: when a cross-component adaptive loop filter is applicable to the current block, obtaining information indicating whether the cross-component adaptive loop filter is applied to the Cb component of the current block.
[0013] Here, information indicating whether a cross-component adaptive loop filter is applied to the Cb component is signaled through a picture header.
[0014] The image decoding method further includes: when a cross-component adaptive loop filter is applied to the Cb component, acquiring an adaptive parameter set indicator referenced by the Cb component.
[0015] The image decoding method further includes: when a cross-component adaptive loop filter is applicable to the current block, obtaining information indicating whether the cross-component adaptive loop filter is applied to the Cr component of the current block.
[0016] Here, information indicating whether a cross-component adaptive loop filter is applied to the Cr component is signaled through a picture header.
[0017] The image decoding method further includes: when a cross-component adaptive loop filter is available for the Cr component, obtaining an adaptive parameter set indicator referenced by the Cr component.
[0018] Wherein, when the information indicating whether the cross-component adaptive loop filter is available is not signaled, it is determined that the cross-component adaptive loop filter is not available for the current block.
[0019] The image decoding method further includes: acquiring a reconstructed chroma block of the current block; and determining whether an adaptive loop filter is applied to the reconstructed chroma block.
[0020] Wherein, the step of determining whether an adaptive loop filter is applied to the reconstructed chroma block comprises: obtaining information indicating whether an adaptive loop filter is applicable to the reconstructed chroma block, and wherein the information indicating whether the adaptive loop filter is applicable is signaled via a picture header.
[0021] Here, the information indicating whether the adaptive loop filter is available is signaled for each of the Cb component and the Cr component.
[0022] The image decoding method further includes: acquiring information indicating a type of an adaptive loop filter applied to the reconstructed chroma block, wherein the type of the adaptive loop filter includes a linear adaptive loop filter and a nonlinear adaptive loop filter.
[0023] The information indicating the type of the adaptive loop filter applied to the reconstructed chroma block is a single syntax element.
[0024] The final reconstructed chroma block is derived using a luminance block to which a cross-component adaptive loop filter is applied and a reconstructed chroma block to which an adaptive loop filter is applied, wherein the luminance block to which the cross-component adaptive loop filter is applied is obtained by applying the cross-component adaptive loop filter to the reconstructed luminance block.
[0025] According to an embodiment of the present disclosure, an image encoding method includes: obtaining a reconstructed luminance block of a current block, determining whether a cross-component adaptive loop filter is applied to the current block, and when a cross-component adaptive loop filter is applied to the current block, obtaining a reconstructed chroma block of the current block to which the adaptive loop filter is applied; and using the reconstructed luminance block and the reconstructed chroma block to which the adaptive loop filter is applied to obtain a final reconstructed chroma block of the current block to which the cross-component adaptive loop filter is applied.
[0026] The image encoding method further includes encoding information indicating whether a cross-component adaptive loop filter is applicable to the current block, wherein the information on whether the cross-component adaptive loop filter is applicable is encoded through a sequence parameter set.
[0027] The final reconstructed chroma block is derived using a luminance block to which a cross-component adaptive loop filter is applied and a reconstructed chroma block to which an adaptive loop filter is applied, wherein the luminance block to which the cross-component adaptive loop filter is applied is obtained by applying the cross-component adaptive loop filter to the reconstructed luminance block.
[0028] According to an embodiment of the present disclosure, a computer-readable recording medium is provided, wherein the computer-readable recording medium stores a bit stream received by an image decoding device and used to reconstruct a current block included in a current picture, wherein the bit stream is generated by an image encoding method, and the image encoding method includes: obtaining a reconstructed luminance block of the current block, determining whether a cross-component adaptive loop filter is applied to the current block, when a cross-component adaptive loop filter is applied to the current block, obtaining a reconstructed chroma block of the current block to which the adaptive loop filter is applied, and using the reconstructed luminance block and the reconstructed chroma block to which the adaptive loop filter is applied to obtain a final reconstructed chroma block of the current block to which the cross-component adaptive loop filter is applied.
[0029] The image encoding method further includes encoding information indicating whether a cross-component adaptive loop filter is applicable to the current block, and the information indicating whether the cross-component adaptive loop filter is applicable is encoded through a sequence parameter set.
[0030] Beneficial effects
[0031] According to the present invention, an image encoding / decoding method and apparatus using adaptive in-loop filtering can be provided.
[0032] According to the present invention, an image encoding / decoding method and apparatus using cross-component adaptive in-loop filtering can be provided.
[0033] According to the present invention, an in-loop filtering method and apparatus using subsampling-based block classification can be provided to reduce the computational complexity and memory access bandwidth of an image encoder / decoder.
[0034] According to the present invention, a method and apparatus for in-loop filtering using multiple filter types can be provided to reduce computational complexity, memory requirements, and memory access bandwidth of an image encoder / decoder.
[0035] 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.
[0036] According to the present invention, image encoding and / or decoding efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0038] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment to which the present invention is applied.
[0039] Figure 3is a diagram schematically illustrating a partition structure of an image when encoding and decoding the image.
[0040] Figure 4 is a diagram illustrating an intra prediction process.
[0041] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0042] Figure 6 is a diagram illustrating transform and quantization processing.
[0043] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0044] Figure 8a and Figure 8b is a flowchart illustrating an image decoding and encoding method according to an embodiment of the present invention.
[0045] Figure 9 is a diagram illustrating an example of determining slope values according to horizontal, vertical, first diagonal, and second diagonal directions based on subsampling.
[0046] Figures 10 to 12 is a diagram illustrating an example of determining a slope value according to horizontal, vertical, first diagonal, and second diagonal directions at a specific sample point position according to an embodiment of the present invention.
[0047] Figure 13 is a diagram illustrating a diamond filter according to an embodiment of the present invention.
[0048] Figure 14 : is a diagram showing a filter having a filter tap number of 5×5 according to an embodiment of the present invention.
[0049] Figure 15a and 15b is a diagram illustrating various filter types according to an embodiment of the present invention.
[0050] Figure 16 is a diagram illustrating an embodiment of a sequence parameter set syntax required for adaptive in-loop filtering.
[0051] Figure 17 is a diagram illustrating an embodiment of an adaptation parameter set syntax required for adaptive in-loop filtering.
[0052] Figure 18 is a diagram illustrating an embodiment of an adaptation parameter type of an adaptation parameter set.
[0053] Figure 19 is a diagram illustrating an embodiment of a slice header syntax required for adaptive in-loop filtering.
[0054] Figures 20a to 20d is a diagram illustrating an embodiment of an adaptive in-loop filter data syntax required for adaptive in-loop filtering.
[0055] Figure 21 is a diagram illustrating an embodiment of a coding tree block syntax required for adaptive in-loop filtering.
[0056] Figure 22a and Figure 22b is a diagram illustrating an embodiment of fixed filter coefficients.
[0057] Figure 23 is a diagram illustrating an embodiment of a mapping relationship between adaptive in-loop filter coefficient categories and filters.
[0058] Figure 24 is a diagram illustrating an embodiment of a tailoring index for an adaptive in-loop filter data syntax.
[0059] Figure 25 It is shown in detail Figure 24 Schematic diagram of the pruning index of the adaptive in-loop filter data syntax.
[0060] Figure 26 is a diagram illustrating another embodiment of a tailored index for an adaptive in-loop filter data syntax.
[0061] Figure 27 It is shown in detail Figure 26 Schematic diagram of the pruning index of the adaptive in-loop filter data syntax.
[0062] Figure 28 is a diagram illustrating another embodiment of a slice header syntax required for adaptive in-loop filtering.
[0063] Figure 29a and Figure 29b is a diagram illustrating another embodiment of an adaptive in-loop filter data syntax required for adaptive in-loop filtering.
[0064] Figure 30a and Figure 30b is a diagram illustrating another embodiment of a coding tree block syntax required for adaptive in-loop filtering.
[0065] Figure 31 It is shown in detail Figure 28 An illustration of the strip header syntax.
[0066] Figure 32 and Figure 33 It is shown in detail Figure 29a and Figure 29b Figure 2 is a diagram of the adaptive in-loop filter data syntax.
[0067] Figures 34 to 35b It is shown in detail Figure 29a and Figure 29b Figure 2 is a diagram of the adaptive in-loop filter data syntax.
[0068] Figure 36 and Figure 37 It is shown in detail Figure 31 Diagram of the coding tree block syntax.
[0069] Figure 38 is a diagram illustrating a video decoding method using an adaptive in-loop filter according to an embodiment.
[0070] Figure 39 is a diagram illustrating a video encoding method using an adaptive in-loop filter according to an embodiment.
[0071] Figure 40 is a diagram illustrating an image decoding method according to another embodiment of the present disclosure.
[0072] Figure 41 is a diagram illustrating an image encoding method according to another embodiment of the present disclosure.
[0073] Figure 42 is a diagram illustrating a sequence parameter set according to another embodiment of the present disclosure.
[0074] Figure 43 is a diagram illustrating an adaptive parameter set according to another embodiment of the present disclosure.
[0075] Figure 44 is a diagram illustrating adaptive parameters according to another embodiment of the present disclosure.
[0076] Figure 45 is a diagram illustrating a picture header according to another embodiment of the present disclosure.
[0077] Figure 46 is a diagram illustrating a slice header according to another embodiment of the present disclosure.
[0078] Figure 47a and Figure 47b is a diagram illustrating ALF data according to another embodiment of the present disclosure.
[0079] Figure 48 is a diagram illustrating a coding tree unit (CTU) according to another embodiment of the present disclosure.
[0080] Figure 49 and Figure 50 2 is another diagram illustrating ALF data according to another embodiment of the present disclosure.
[0081] Figure 51 and Figure 522 is another diagram illustrating ALF data according to another embodiment of the present disclosure. DETAILED DESCRIPTION
[0082] The present invention may be modified in various ways, and there are various embodiments of the present invention, of which examples of various embodiments 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 alternatives 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 drawings, the shapes and sizes of 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 in which the present invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics described herein in conjunction with one embodiment may be implemented in other embodiments without departing from the spirit and scope of the present disclosure. In addition, it should be understood that the position or arrangement of the various elements 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 taken as having a limiting meaning, and the scope of the present disclosure is limited solely by the appended claims (and, when appropriately interpreted, together with the full scope of equivalents claimed by the claims).
[0083] The terms "first," "second," and the like used in the specification may be used to describe various components, but the components should not be construed as being limited to these terms. These terms are used only to distinguish one component from other components. For example, a "first" component may be named a "second" component, and a "second" component may be similarly named a "first" component without departing from the scope of the present invention. The term "and / or" includes a combination of a plurality of items or any one of the plurality of items.
[0084] 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 intervening 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.
[0085] In addition, the components shown in the embodiments of the present invention are shown independently to represent different characteristic functions 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.
[0086] 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 expressions used in the singular include the expressions 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 be present or may be added. In other words, when a particular element is referred to as "comprising", it does not exclude elements other than the corresponding element, but other elements may be included in embodiments of the present invention or in the scope of the present invention.
[0087] Furthermore, some components may not be essential components for performing the basic functions of the present invention, but may be optional components that only enhance its performance. The present invention may be implemented by including only the essential components for achieving the essence of the present invention without including components that enhance its performance. Structures that include only the essential components without including optional components that enhance its performance are also within the scope of the present invention.
[0088] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing 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.
[0089] Hereinafter, an image may refer to a frame constituting a video, or may refer to the video itself. For example, "encoding or decoding an image, or both encoding and decoding the image" may refer to "encoding or decoding a moving picture, or both encoding and decoding the image," and may refer to "encoding or decoding one of the images in the moving picture, or both encoding and decoding the image."
[0090] Hereinafter, the terms "moving picture" and "video" may be used as the same meaning and may be replaced with each other.
[0091] Hereinafter, a target image may be an encoding target image and / or a decoding target image. Furthermore, a target image may be an input image to an encoding device or an input image to a decoding device. Here, the target image may have the same meaning as the current image.
[0092] Hereinafter, the terms "image," "picture," "frame," and "screen" may be used as the same meaning and may be replaced with each other.
[0093] Hereinafter, a target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. In addition, a 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 having the same meaning and may be used interchangeably.
[0094] Hereinafter, the terms "block" and "unit" may be used as the same meaning and may be replaced with each other. Alternatively, "block" may refer to a specific unit.
[0095] Hereinafter, the terms "region" and "segment" may be used interchangeably.
[0096] 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.
[0097] In an embodiment, each of the specific information, data, flags, indexes, elements, and attributes may have a value. A value of "0" for the information, data, flags, indexes, elements, and attributes may represent a logical false value or a first predefined value. In other words, the values "0," false, logical false, and the first predefined value may be interchangeable. A value of "1" for the information, data, flags, indexes, elements, and attributes may represent a logical true value or a second predefined value. In other words, the values "1," true, logical true, and the second predefined value may be interchangeable.
[0098] When the variable i or j is used to represent a column, row, or index, the value of i can 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. can be counted from 0 or 1.
[0099] Description of terms
[0100] Encoder: This refers to the device that performs encoding. In other words, it refers to the encoding device.
[0101] Decoder: This refers to a device that performs decoding. In other words, it refers to a decoding device.
[0102] Block: An M×N array of samples. Here, M and N may represent positive integers, and a block may represent a two-dimensional array of samples. A block may refer to a unit. The current block may refer to an encoding target block that is targeted during encoding, or a decoding target block that is targeted during decoding. Furthermore, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.
[0103] Sample: It is the basic unit of a block. According to the bit depth (Bd), the sample can be represented from 0 to 2 Bd In the present invention, the term "sample point" may be used to mean a pixel. That is, the terms "sample point", "pel", and "pixel" may have the same meaning as each other.
[0104] Unit: This refers to an encoding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. Furthermore, when a single image is partitioned into sub-partitioned units during encoding or decoding, a unit may represent a sub-partitioned unit. In other words, an image may be partitioned into multiple units. When encoding and decoding an image, predetermined processing may be performed on each unit. A single unit may be partitioned into sub-units smaller than the unit. Depending on its function, a unit may represent a block, macroblock, coding tree unit, coding tree block, coding unit, coding block, prediction unit, prediction block, residual unit, residual block, transform unit, transform block, and so on. Furthermore, to distinguish a unit from a block, a unit may include a luma component block, chroma component blocks associated with the luma component block, and syntax elements for each color component block. A unit may have various sizes and shapes. Specifically, the shape of a unit may be a two-dimensional geometric figure such as a square, rectangle, trapezoid, triangle, pentagon, and so on. 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.
[0105] Coding tree unit: A single coding tree block configured with the luma component Y and two coding tree blocks associated with the chroma 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 lower-level units such as coding units, prediction units, and transform units. 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.
[0106] When the size of a coding block is within a predetermined range, partitioning using only quadtree partitioning is possible. Here, the predetermined range may be defined as at least one of the maximum and minimum sizes of the coding block that can be partitioned using only quadtree partitioning. Information indicating the maximum / minimum sizes of the coding block that allow quadtree partitioning may be signaled via the bitstream and may be signaled in at least one of a sequence, a picture parameter, a tile group, or a slice (segment). Alternatively, the maximum / minimum sizes of the coding block may be fixed sizes predetermined in the encoder / decoder. For example, when the size of the coding block corresponds to 256×256 to 64×64, partitioning using only quadtree partitioning is possible. Alternatively, when the size of the coding block is larger than the size of the largest transform block, partitioning using only quadtree partitioning is possible. Here, the block to be partitioned may be at least one of a coding block and a transform block. In this case, the information indicating the partitioning of the coding block (e.g., split_flag) may be a flag indicating whether quadtree partitioning is performed. When the size of the coding block falls within a predetermined range, partitioning using only binary or ternary tree partitioning is possible. 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.
[0107] Coding tree block: may be used as a term for designating any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.
[0108] Neighboring blocks: These may represent blocks adjacent to the current block. These blocks may be blocks that touch the boundary of the current block or are located within a predetermined distance from the current block. These blocks may be blocks adjacent to vertices of the current block. Here, blocks adjacent to vertices of the current block may be blocks that are vertically adjacent to a neighboring block horizontally adjacent to the current block, or blocks that are horizontally adjacent to a neighboring block vertically adjacent to the current block.
[0109] Reconstructed Neighboring Block: This refers to a neighboring block that is adjacent to the current block and has already been spatially or temporally encoded or decoded. Here, a reconstructed neighboring block may refer to a reconstructed neighboring unit. A reconstructed spatial neighboring block may be a block within the current picture that has been reconstructed through encoding or decoding, or both. A reconstructed temporal neighboring block is a block within a reference image that is located at a position corresponding to the current block in the current picture, or a neighboring block of the current block.
[0110] Unit depth: may represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) may correspond to the first unit that has not been partitioned. In addition, the highest node may have the minimum depth value. In this case, the depth of the highest node may be level 0. A node with a depth of level 1 may represent a unit generated by partitioning the first unit once. A node with a depth of level 2 may represent a unit generated by partitioning the first unit twice. A node with a depth of level n may represent a unit generated by partitioning the first unit n times. A leaf node may be the lowest node and a node that cannot be further partitioned. The depth of a leaf node may be the maximum level. For example, the predefined value of the maximum level may be 3. The depth of the root node may be the lowest, and the depth of the leaf node may be the deepest. In addition, when a unit is represented as a tree structure, the level at which the unit exists may represent the unit depth.
[0111] Bitstream: can represent a bit stream containing coded image information.
[0112] Parameter set: This corresponds to header information within the bitstream configuration. A parameter set may include at least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set. Furthermore, a parameter set may include a slice header, a tile group header, and tile header information. The term "tile group" refers to a group of tiles and has the same meaning as a slice.
[0113] Parsing: may refer to determining the value of a syntax element by performing entropy decoding, or may refer to the entropy decoding itself.
[0114] Symbol: can represent at least one of the syntax elements, coding parameters, and transform coefficient values of the encoding / decoding target unit. In addition, the symbol can represent the entropy encoding target or the entropy decoding result.
[0115] Prediction mode: may be information indicating a mode for encoding / decoding using intra-frame prediction or a mode for encoding / decoding using inter-frame prediction.
[0116] Prediction unit: This refers to the basic unit used when performing predictions such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation. A single prediction unit can be partitioned into multiple partitions of smaller sizes, or into multiple lower-level prediction units. Multiple partitions can be the basic unit used when performing prediction or compensation. Partitions generated by splitting a prediction unit can also be prediction units.
[0117] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.
[0118] A reference picture list may refer to a list including one or more reference pictures used for inter prediction or motion compensation. There are several types of reference picture lists available, including LC (List Combination), L0 (List 0), L1 (List 1), L2 (List 2), and L3 (List 3).
[0119] The inter-frame prediction indicator may indicate the direction of inter-frame prediction for the current block (unidirectional prediction, bidirectional prediction, etc.). Alternatively, the inter-frame prediction indicator may indicate the number of reference pictures used to generate the prediction block for the current block. Alternatively, the inter-frame prediction indicator may indicate the number of prediction blocks used when performing inter-frame prediction or motion compensation on the current block.
[0120] 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 can be used to derive the inter prediction indicator, and conversely, the inter prediction indicator can 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 pictures in the reference picture list are 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.
[0121] The reference picture index may refer to an index indicating a specific reference picture in a reference picture list.
[0122] 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.
[0123] A motion vector can be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector can represent the offset between the encoding / decoding target block and the reference block. For example, (mvX, mvY) can represent a motion vector. Here, mvX can represent the horizontal component, and mvY can represent the vertical component.
[0124] The search range may be a two-dimensional area that is searched during inter-frame 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.
[0125] 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.
[0126] The motion vector candidate list may mean a list consisting of one or more motion vector candidates.
[0127] 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.
[0128] 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, reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.
[0129] The merge candidate list may mean a list consisting of one or more merge candidates.
[0130] The merge candidate may represent a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-predictive 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.
[0131] 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.
[0132] Transform unit: This refers to a basic unit used when encoding / decoding a residual signal (such as transform, inverse transform, quantization, inverse quantization, and transform coefficient encoding / decoding). A single transform unit can be partitioned into multiple lower-level transform units of smaller size. The transform / inverse transform may include at least one of a first transform / first inverse transform and a second transform / second inverse transform.
[0133] Scaling: This refers to the process of multiplying the quantization level by a factor. Transform coefficients can be generated by scaling the quantization level. Scaling can also be called inverse quantization.
[0134] Quantization parameter: This may indicate the value used when generating the quantization level using the transform coefficient during quantization. It may also indicate the value used when generating the transform coefficient by scaling the quantization level during inverse quantization. The quantization parameter may be a value mapped to the quantization step size.
[0135] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.
[0136] Scan: This refers to a method of sorting coefficients within a cell, block, or matrix. For example, changing a two-dimensional matrix of coefficients to a one-dimensional matrix can be called a scan, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix can be called a scan or an inverse scan.
[0137] Transform coefficient: This term may refer to a coefficient value generated after a transform is performed in an encoder. A transform coefficient may refer to a coefficient value generated after at least one of entropy decoding and inverse quantization is performed in a decoder. A transform coefficient also includes a quantization level obtained by quantizing a transform coefficient or a residual signal, or a quantized transform coefficient level.
[0138] Quantization level: This refers to the value generated by quantizing transform coefficients or residual signals in an encoder. Alternatively, the quantization level may refer to a value that is a target for inverse quantization in a decoder. Similarly, the level of quantized transform coefficients, which are the result of transformation and quantization, also falls within the meaning of the quantization level.
[0139] 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.
[0140] Quantization Matrix: This refers to a matrix used in a quantization process or an inverse quantization process performed to improve subjective or objective image quality. The quantization matrix may also be referred to as a scaling list.
[0141] Quantization matrix coefficients: These represent each element in the quantization matrix. Quantization matrix coefficients are also called matrix coefficients.
[0142] Default matrix: may represent a predetermined quantization matrix predefined in an encoder or decoder.
[0143] Non-default matrix: may represent a quantization matrix that is not pre-defined in the encoder or decoder but is signaled by the user.
[0144] Statistical value: The statistical value for at least one of a variable, coding parameter, constant value, etc. having a calculable specific value can be one or more of the average value, sum 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.
[0145] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0146] 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.
[0147] 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.
[0148] The encoding device 100 can perform encoding of an input image by using intra mode or inter mode, or both intra mode and inter mode. In addition, the encoding device 100 can generate a bit stream including encoding information by encoding the input image, and output the generated bit stream. The generated bit stream can be stored in a computer-readable recording medium, or can be streamed via a wired / wireless transmission medium. When intra mode is used as the prediction mode, the switch 115 can switch to intra mode. Alternatively, when inter mode is used as the prediction mode, the switch 115 can switch to inter mode. Here, intra mode may refer to intra prediction mode, and inter mode may refer to inter prediction mode. The encoding device 100 can generate a prediction block for an input block of the input image. In addition, after generating the prediction block, the encoding device 100 can encode a residual block using the residual of the input block and the prediction block. The input image can be referred to as the current image that is the current encoding target. The input block can be referred to as the current block that is the current encoding target, or as the encoding target block.
[0149] When the prediction mode is 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 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.
[0150] When the prediction mode is 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, the reference image may be stored in the reference picture buffer 190.
[0151] The motion compensation unit 112 may generate a prediction block by performing motion compensation on the current block using a motion vector. Here, inter prediction may refer to prediction or motion compensation between frames.
[0152] 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. To perform inter-picture prediction or motion compensation on a coding unit, it may be determined which mode among skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode is used for motion prediction and motion compensation of the prediction unit included in the corresponding coding unit. Then, inter-picture prediction or motion compensation may be performed differently depending on the determined mode.
[0153] 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, or 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.
[0154] 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 transforming the residual block.
[0155] The quantization level may be generated by applying quantization to a transform coefficient or to a residual signal. Hereinafter, the quantization level may also be referred to as a transform coefficient in embodiments.
[0156] 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.
[0157] The entropy coding unit 150 may generate a bitstream by performing entropy coding on the value calculated by the quantization unit 140 or the coding parameter value calculated when performing coding according to the probability distribution, and output the generated bitstream. The entropy coding unit 150 may perform entropy coding on sample information of an image and information for decoding the image. For example, the information for decoding the image may include syntax elements.
[0158] When entropy coding is applied, symbols are represented so that a smaller number of bits are allocated to symbols with a high probability of generation, and a larger number of bits are allocated to symbols with a low probability of generation, thereby reducing the size of the bit stream for the symbols to be encoded. 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 the target symbol and a probability model of the target symbol / binary bit, and perform arithmetic coding by using the derived binarization method and context model.
[0159] In order to encode transform coefficient levels (quantized levels), the entropy encoding unit 150 may change coefficients in a two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.
[0160] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and sent to the decoder using a signal, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether quadtree partitioning is performed, whether binary tree partitioning is performed, binary tree partitioning direction (horizontal or vertical), binary tree partitioning form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, the 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-frame prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter-frame prediction angle, inter-frame 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-loop filter, intra-loop filter coefficients, intra-loop filter taps, intra-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 intra-loop filter, adaptive intra-loop filter coefficients, adaptive intra-loop filter taps, adaptive intra-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, significant coefficient flag, last significant coefficient flag, coding flag for unit of coefficient group, position of last significant 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, positive and negative sign (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 at decoder side the size of a motion vector search area, the shape of a motion vector search area at the decoder side, the number of motion vector searches at the decoder side, information about a CTU size, information about a minimum block size, information about a maximum block size, information about a maximum block depth, information about a minimum block depth, an image display / output order, slice identification information, a slice type, slice partition information, tile identification information, a tile type, tile partition information, tile group identification information, a tile group type, tile group partition information, a picture type, a bit depth of input samples, a bit depth of reconstructed samples, a bit depth of residual samples, a bit depth of transform coefficients, a bit depth of a quantization level, and information about a luminance signal or information about a chrominance signal.
[0161] 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.
[0162] When the encoding apparatus 100 performs encoding by inter-frame prediction, the current image being encoded can be used as a reference image for another image to be processed subsequently. Therefore, the encoding apparatus 100 can reconstruct or decode the current image being encoded, or store the reconstructed or decoded image as a reference image in the reference picture buffer 190.
[0163] The quantization level may be inversely quantized in the inverse quantization unit 160 or inversely transformed in the inverse transform unit 170. The inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient may be added to the prediction block by the adder 175. By adding the inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient to the prediction block, a reconstructed block may be generated. Here, the inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient may mean a coefficient on which at least one of inverse quantization and inverse transformation has been performed, and may mean a reconstructed residual block.
[0164] 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 in-loop filter (ALF) to the reconstructed samples, the reconstructed block, or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.
[0165] A deblocking filter can remove block distortion generated at the boundaries between blocks. To determine whether to apply the deblocking filter, the determination of whether to apply the deblocking filter to the current block can be made based on the samples included in a number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter can be applied according to the desired deblocking filter strength.
[0166] To compensate for coding errors, sample adaptive offset can be used to add an appropriate offset value to the sample value. Sample adaptive offset can correct the offset between the deblocked image and the original image on a sample-by-sample basis. A method can be used to apply the offset by considering edge information about each sample, or a method can be used in which the samples of the image are partitioned into a predetermined number of regions, the regions to which the offset is applied are determined, and the offset is applied to the determined regions.
[0167] The adaptive in-loop filter can perform filtering based on the comparison result of the filtered reconstructed image and the original image. The samples included in the image can be partitioned into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed on each group. Information on whether to apply ALF can be signaled by the coding unit (CU), and the form and coefficients of the ALF to be applied to each block can be varied.
[0168] The reconstructed block or 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 part of a 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.
[0169] 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.
[0170] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0171] Reference Figure 2 , the decoding apparatus 200 may include an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , a motion compensation unit 250 , an adder 255 , a filter unit 260 , and a reference picture buffer 270 .
[0172] The decoding device 200 may receive the bitstream output from the encoding device 100. The decoding device 200 may receive the bitstream stored in a computer-readable recording medium, or may receive the bitstream streamed via a wired / wireless transmission medium. The decoding device 200 may decode the bitstream using an intra-frame mode or an inter-frame mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.
[0173] When the prediction mode used at the time of decoding is the intra mode, the switch may be switched to the intra mode. Alternatively, when the prediction mode used at the time of decoding is the inter mode, the switch may be switched to the inter mode.
[0174] 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 the decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as the current block.
[0175] 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.
[0176] In order to decode transform coefficient levels (quantized levels), the entropy decoding unit 210 may change coefficients in a unidirectional vector form into a two-dimensional block form by using a transform coefficient scanning method.
[0177] The quantized levels may be inversely quantized in the inverse quantization unit 220, or inversely transformed in the inverse transform unit 230. The quantized levels may be the result of inverse quantization or inverse transformation, or both, and may be generated as a reconstructed residual block. Here, the inverse quantization unit 220 may apply a quantization matrix to the quantized levels.
[0178] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values of blocks that are adjacent to the decoding target block and have already been decoded.
[0179] 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 .
[0180] 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 reconstructed image. The filter unit 260 can output the reconstructed image. The reconstructed block or 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 part of a 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.
[0181] Figure 3 is a diagram schematically illustrating a partition structure of an image when encoding and decoding the image. Figure 3 An example of partitioning a single unit into multiple lower-level units is schematically shown.
[0182] In order to efficiently 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 between an intra-frame prediction mode and an inter-frame 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.
[0183] Reference Figure 3 , the image 300 is partitioned sequentially according to the largest coding unit (LCU), and the LCU unit is determined as a partition structure. Here, LCU can be used with the same meaning as the coding tree unit (CTU). Unit partitioning may mean partitioning the block associated with the unit. In the block partition information, information on the unit depth may be included. The depth information may indicate the number or degree of partitioning of the unit or both the number and degree of partitioning of the unit. A single unit may be partitioned into multiple 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.
[0184] The partition structure may indicate the distribution of coding units (CUs) within LCU 310. This distribution may be determined based on whether a single CU is partitioned into multiple CUs (including 2, 4, 8, 16, and other positive integers equal to or greater than 2). The horizontal and vertical sizes of the CU generated by partitioning may be half the horizontal and vertical sizes of the CU before partitioning, or may be smaller than the horizontal and vertical sizes before partitioning, depending on the number of partitioning operations. A CU may be recursively partitioned into multiple CUs. Recursive partitioning may reduce at least one of the height and width of the CU after partitioning compared to at least one of the height and width of the CU before partitioning. CU partitioning may be recursively performed until a predefined depth or a predefined size is reached. For example, the depth of an LCU may be 0, and the depth of a smallest coding unit (SCU) may be a predefined maximum depth. As described above, an LCU may be a coding unit with the largest coding unit size, and an SCU may be a coding unit with the smallest coding unit size. Partitioning starts from the LCU 310. When the horizontal size or vertical size, or both the horizontal size and the vertical size of the CU are reduced by partitioning, the CU depth increases by 1. For example, the size of a non-partitioned CU can be 2N×2N for each depth. In addition, in the case of a partitioned CU, a CU of size 2N×2N can be partitioned into four CUs of size N×N. As the depth increases by 1, the size of N can be halved.
[0185] In addition, information on whether a CU is partitioned can be indicated by using its partition information. The partition information can be 1-bit information. All CUs except the SCU can include partition information. For example, when the partition information value is a first value, the CU may not be partitioned, and when the partition information value is a second value, the CU may be partitioned.
[0186] Reference Figure 3 , an LCU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. An SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. CUs with a 32×32 block and a 16×16 block may be denoted as depth 1 and depth 2, respectively.
[0187] For example, when a single coding unit is partitioned into four coding units, the horizontal and vertical sizes of the four partitioned coding units may be half the horizontal and vertical sizes of the CU before partitioning. In one embodiment, when a coding unit of size 32×32 is partitioned into four coding units, each of the four partitioned coding units 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.
[0188] 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 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.
[0189] For example, when a coding unit is partitioned into three sub-coding units, the horizontal size or vertical size of the coding unit may be partitioned in a ratio of 1:2:1, thereby generating three sub-coding units having a ratio of 1:2:1 in terms of the horizontal size or 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 a coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned into three or partitioned according to a ternary tree partition structure.
[0190] 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.
[0191] As described above, 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. The various tree partition structures may be sequentially applied to the CTU according to a predetermined priority order. For example, the quadtree partition structure may be preferentially applied to the CTU. Coding units that can no longer be partitioned using the quadtree partition structure may correspond to leaf nodes of the quadtree. Coding units corresponding to leaf nodes of the quadtree may serve as root nodes of the binary and / or ternary tree partition structures. In other words, coding units corresponding to leaf nodes of the quadtree may be further partitioned according to the binary or ternary tree partition structure, or may not be further partitioned. Therefore, by preventing coding blocks resulting from binary or ternary tree partitioning of coding units corresponding to leaf nodes of the quadtree from undergoing further quadtree partitioning, block partitioning operations and / or operations for signaling partition information may be efficiently performed.
[0192] The fact that the coding unit corresponding to the node of the quadtree is partitioned can be signaled using the four partition information. The four partition information having a first value (e.g., "1") can 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") can indicate that the current coding unit is not partitioned according to the quadtree partition structure. The four partition information can be a flag with a predetermined length (e.g., one bit).
[0193] 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 be further partitioned by either binary tree partitioning or ternary tree partitioning. In addition, the coding unit generated by binary tree partitioning or ternary tree partitioning may be further partitioned by binary tree partitioning or ternary tree partitioning, or may not be further partitioned.
[0194] A tree structure in which there is no priority between binary tree partitioning and ternary tree partitioning is called a multi-type tree structure. The coding unit corresponding to the leaf node of the quadtree can be used as the root node of the multi-type tree. At least one of the multi-type tree partition indication information, partition direction information, and partition tree information can be used to signal whether to partition the coding unit corresponding to the node of the multi-type tree. In order to partition the coding unit corresponding to the node of the multi-type tree, the multi-type tree partition indication information, partition direction information, and partition tree information can be sequentially signaled.
[0195] The multi-type tree partition indication information having a first value (e.g., '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 (e.g., '0') may indicate that the current coding unit will not undergo multi-type tree partitioning.
[0196] 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. Partition direction information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned vertically. Partition direction information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned horizontally.
[0197] 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 the 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 the 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 the ternary tree partition structure.
[0198] The partition indication information, partition tree information and partition direction information may all be flags with a predetermined length (eg, one bit).
[0199] At least any one of quadtree partition indication information, multi-type tree partition indication information, partition direction information, and 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 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 quadtree partition information, multi-type tree partition indication information, partition direction information, and partition tree information.
[0200] As another example, between binary tree partitioning and ternary tree partitioning, binary tree partitioning may be performed preferentially. 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.
[0201] 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 prediction units and / or transformation units may not exist in the bitstream.
[0202] However, when the size of a 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 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 transform-specific partitioning of the coding unit is not separately signaled and may be determined by comparing the horizontal or vertical size of the coding unit with the horizontal 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 bisected. 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 bisected.
[0203] Information about the maximum and / or minimum size of a coding unit and information about the maximum and / or minimum size of a transform block may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, a sequence level, a picture level, a slice level, a tile group level, a tile level, or the like. For example, the minimum size of a coding unit may be determined to be 4×4. For example, the maximum size of a transform block may be determined to be 64×64. For example, the minimum size of a transform block may be determined to be 4×4.
[0204] Information about the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information about the maximum depth from the root node to the leaf node of the multi-type tree (maximum tree depth of the multi-type tree) may be signaled or determined at an upper level of the coding unit. For example, the upper level may be a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. Information about the minimum size of the quadtree and / or information about the maximum depth of the multi-type tree may be signaled or determined for each of the intra-picture slices and the inter-picture slices.
[0205] The difference 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 the sequence level, picture level, slice level, tile group level, tile level, etc. Information regarding the maximum size of the coding units 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 units corresponding to each node of the ternary tree (hereinafter referred to as the maximum size of the ternary tree) may vary depending on the slice type. For example, for intra-picture slices, the maximum size of the ternary tree may be 32×32. For example, for inter-picture slices, the maximum size of the ternary tree may be 128×128. For example, the minimum size of the coding units 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 units 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.
[0206] 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.
[0207] According to the size and depth information of the various blocks described above, 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.
[0208] 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. The quad partition information may be inferred as the second value.
[0209] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is larger 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 as the second value.
[0210] 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 the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but the multi-type tree partition indication information may be inferred as 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.
[0211] Optionally, binary tree partitioning or ternary tree partitioning may be limited based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when a coding unit is divided into sub-coding units that do not fit in the pipeline buffer size by binary tree partitioning or ternary tree partitioning, the corresponding binary tree partitioning or ternary tree partitioning may be limited. The pipeline buffer size may be the size of the largest transform block (e.g., 64×64). For example, when the pipeline buffer size is 64×64, the following partitioning may be limited.
[0212] - N×M (N and / or M is 128) ternary tree partitions for coding units
[0213] - 128×N (N<=64) binary tree partitions in the horizontal direction for coding units
[0214] - N×128 (N<=64) binary tree partitions in the vertical direction for the coding unit
[0215] Optionally, when the depth of the coding unit corresponding to a 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 signaled, but the multi-type tree partition indication information may be inferred as the second value.
[0216] Optionally, multi-type tree partition indication information may be signaled 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. Otherwise, the coding unit may not be partitioned into two or three partitions. Therefore, multi-type tree partition indication information may not be signaled, but the multi-type tree partition indication information may be inferred as the second value.
[0217] 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 the partition direction information may be inferred as a value indicating a possible partition direction.
[0218] 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 the partition tree information may be inferred as a value indicating a possible partition tree structure.
[0219] Figure 4 is a diagram illustrating an intra prediction process.
[0220] Figure 4 The arrows from the center to the outside in FIG. 1 represent the prediction direction of the intra prediction mode.
[0221] Intra-frame encoding and / or decoding may be performed by using reference samples of a neighboring block of the current block. The neighboring block may be a reconstructed neighboring block. For example, intra-frame encoding and / or decoding may be performed by using values of reference samples or coding parameters included in the reconstructed neighboring block.
[0222] A prediction block may represent a block generated by performing intra prediction. A prediction block may correspond to at least one of a CU, a PU, and a TU. A unit of a prediction block may have the size of one of a CU, a PU, and a TU. A prediction block may be a square block of a size of 2×2, 4×4, 16×16, 32×32, or 64×64, or a rectangular block of a size of 2×8, 4×8, 2×16, 4×16, or 8×16, etc.
[0223] Intra-frame prediction may be performed based on an intra-frame prediction mode for the current block. The number of intra-frame prediction modes that the current block may have may be a fixed value or may be a value determined differently depending on the properties of the prediction block. For example, the properties of the prediction block may include the size and shape of the prediction block.
[0224] 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. Alternatively, the number of intra-frame prediction modes can vary depending on the block size or the color component type, or both. 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 increases, the number of intra-frame prediction modes can increase. Alternatively, the number of intra-frame prediction modes for a luminance component block can be greater than the number of intra-frame prediction modes for a chrominance component block.
[0225] The intra prediction mode may be a non-angle mode or an angle mode. The non-angle mode may be a DC mode or a planar mode, and the angle mode may be a prediction mode having a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of intra prediction modes may be M, which is greater than 1, including non-angle modes and angle modes. In order to perform intra prediction on a current block, a step of determining whether a sample included in a reconstructed neighboring block can be used as a reference sample for the current block may be performed. When there are samples that cannot be used as reference samples for the current block, a value obtained by copying or interpolating at least one sample value of the samples included in the reconstructed neighboring block, or performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, so that the replaced sample value is used as the reference sample for the current block.
[0226] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0227] like Figure 7 As shown in , 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 fragments A and F can be filled with the samples of the closest fragments B and E, respectively, instead of retrieving them from the reconstructed neighboring blocks. The index information indicating the reference sample line to be used for intra prediction of the current block can be signaled. For example, in Figure 7 In the example, reference sample line indicators 0, 1, and 2 may be signaled as index information indicating reference sample line 0, reference sample line 1, and reference sample line 2. When the upper boundary of the current block is the boundary of the CTU, only reference sample line 0 may be available. Therefore, in this case, index information may not be signaled. When reference sample lines other than reference sample line 0 are used, filtering for the prediction block, which will be described later, may not be performed.
[0228] 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.
[0229] In the case of planar mode, when generating a prediction block for the current block, the sample value of the prediction target sample may be generated by using a weighted sum of the upper and left reference samples of the current block, and the upper right and lower left reference samples of the current block, depending on the position of the prediction target sample within the prediction block. Furthermore, in the case of DC mode, when generating a prediction block for the current block, the average of the upper and left reference samples of the current block may be used. Furthermore, in the case of angular mode, the prediction block may be generated by using the upper, left, upper right, and / or lower left reference samples of the current block. To generate the prediction sample values, interpolation of real units may be performed.
[0230] In the case of intra-frame prediction between color components, a prediction block for the current block of the second color component can be generated based on the corresponding reconstructed block of the first color component. For example, the first color component can be a luma component, and the second color component can be a chroma component. For intra-frame prediction between color components, parameters of a linear model between the first and second color components can be derived based on a template. The template can include the upper and / or left neighboring samples of the current block and the upper and / or left neighboring samples of the corresponding reconstructed block of the first color component. For example, the parameters of the linear model can be derived using the sample value of the first color component with the maximum value and the corresponding sample value of the second color component among the samples in the template, as well as the sample value of the first color component with the minimum value and the corresponding sample value of the second color component among the samples in the template. Once the parameters of the linear model are derived, the corresponding reconstructed block can be applied to the linear model to generate a prediction block for the current block. Depending on the video format, subsampling can be performed on the neighboring samples of the reconstructed block of the first color component and the corresponding reconstructed block. For example, when one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component may be subsampled to calculate one corresponding sample. In this case, parameter derivation of a linear model and intra prediction between color components may be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of the template may be signaled as an intra prediction mode.
[0231] The current block may be partitioned into two subblocks or four subblocks in the horizontal or vertical direction. The partitioned subblocks may be reconstructed sequentially. That is, intra prediction may be performed on the subblocks to generate sub-prediction blocks. Furthermore, inverse quantization and / or inverse transformation may be performed on the subblocks to generate sub-residual blocks. A reconstructed subblock may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed subblock may be used as a reference sample for intra prediction of a subsequent subblock. A subblock 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 subblocks. Furthermore, when the current block is a 4×4 block, the current block may not be partitioned into subblocks. When the current block has other sizes, the current block may be partitioned into four subblocks. Information regarding whether intra prediction is performed based on subblocks and / or the partition direction (horizontal or vertical) may be signaled. Subblock-based intra prediction may be limited to only when using reference sample line 0. When subblock-based intra prediction is performed, filtering for a prediction block, which will be described later, may not be performed.
[0232] The final prediction block can be generated by performing filtering on the prediction block predicted by the intra-frame. The filtering can be performed by applying predetermined weights to the filtering target samples, the left reference samples, the upper reference samples and / or the upper left reference samples. The weights and / or reference samples (range, position, etc.) used for filtering can be determined based on at least one of the block size, the intra-frame prediction mode and the position of the filtering target sample in the prediction block. The filtering can be performed only in the case of a predetermined intra-frame prediction mode (e.g., DC, plane, vertical, horizontal, diagonal and / or adjacent diagonal mode). The adjacent diagonal mode can be a mode in which k is added to the diagonal mode or subtracted from the diagonal mode. For example, k can be a positive integer of 8 or less.
[0233] The intra-frame prediction mode of the current block can be entropy encoded / decoded by predicting the intra-frame prediction mode of a block 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 indicating that the intra-frame prediction mode of the current block and the neighboring block is the same can be signaled using predetermined flag information. In addition, indicator information of an intra-frame prediction mode that is the same as the intra-frame prediction mode of the current block among the intra-frame prediction modes of multiple neighboring blocks can be 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 can be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.
[0234] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0235] exist Figure 5 In , a rectangle can represent a picture. Figure 5In FIG, the arrow indicates the prediction direction. According to the encoding type of a picture, the picture can be classified into an intra picture (I picture), a predicted picture (P picture), and a bi-predictive picture (B picture).
[0236] I-pictures can be encoded using intra-frame prediction without requiring inter-picture prediction. P-pictures can be encoded using inter-picture prediction using reference pictures in one direction (i.e., forward or backward) relative to the current block. B-pictures can be encoded using inter-picture prediction using reference pictures in two directions (i.e., forward and backward) relative to the current block. When using inter-picture prediction, the encoder can perform inter-picture prediction or motion compensation, and the decoder can perform corresponding motion compensation.
[0237] Hereinafter, embodiments of inter-picture prediction will be described in detail.
[0238] Reference pictures and motion information may be used to perform inter-picture prediction or motion compensation.
[0239] Motion information of the current block may be derived during inter-picture prediction by each of the encoding apparatus 100 and the decoding apparatus 200. The motion information of the current block may be derived by using motion information of a reconstructed neighboring block, motion information of a co-located block (also referred to as a col block or co-located block), and / or motion information of a block adjacent to the co-located block. The co-located block may refer to a block in a previously reconstructed co-located picture (also referred to as a col picture or co-located picture) that is spatially co-located with the current block. The co-located picture may be one of one or more reference pictures included in a reference picture list.
[0240] The method of deriving motion information may vary depending on the prediction mode of the current block. For example, prediction modes applied to inter-frame prediction include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, geometric partition mode, combined inter-frame and intra-frame prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.
[0241] For example, when AMVP is used as a prediction mode, at least one of the motion vector of the reconstructed neighboring block, the motion vector of the co-located block, the motion vector of the block adjacent to the co-located block, and the (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 candidates. 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 the block adjacent to the co-located block may be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block may be referred to as a spatial motion vector candidate.
[0242] The encoding device 100 may calculate a motion vector difference (MVD) between the motion vector of the current block and the motion vector candidate, and may perform entropy encoding on the motion vector difference (MVD). In addition, the encoding device 100 may perform entropy encoding on the 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 for the 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 the motion vector of the decoding target block.
[0243] In addition, the encoding apparatus 100 may perform entropy encoding on the calculated resolution information of the MVD. The decoding apparatus 200 may adjust the resolution of the entropy-decoded MVD using the MVD resolution information.
[0244] 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 subblock by deriving an affine controlled motion vector of a decoding target block from the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.
[0245] 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.
[0246] Another example of a method for deriving motion information of a current block may be a merge mode. Merge mode may indicate a method for merging the motion of multiple blocks. Merge mode may indicate a mode for deriving motion information of a current block from motion information of neighboring blocks. When merge mode is applied, the motion information of reconstructed neighboring blocks and / or the motion information of co-located blocks 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).
[0247] 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 (history-based merge candidate), and a zero merge candidate.
[0248] 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 transmit the bitstream to the decoding device 200 using a signal. 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 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 to the left of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.
[0249] In addition, the encoding device 100 performs entropy encoding on correction information for correcting the motion vector in the motion information of the merge candidate and transmits the correction information to the decoding device 200 using a 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 correction is performed, 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 signaled correction information may be referred to as a merge mode with a motion vector difference.
[0250] The skip mode may be a mode in which the motion information of the neighboring blocks is applied to the current block as is. When the skip mode is applied, the encoding device 100 may perform entropy encoding on information indicating 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 device 200. The encoding device 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 device 200.
[0251] The subblock merge mode may indicate a mode for deriving motion information in units of subblocks of a coding block (CU). When the subblock merge mode is applied, the subblock merge candidate list may be generated using motion information of subblocks co-located with the current subblock in the reference image (subblock-based temporal merge candidates) and / or affine control point motion vector merge candidates.
[0252] The geometric partition mode may indicate a mode in which motion information is derived by partitioning the current block in a predetermined direction, each prediction sample is derived using each of the derived motion information, and the prediction sample of the current block is derived by weighting each of the derived prediction samples.
[0253] The inter-intra combined prediction mode may mean a mode of deriving prediction samples of a current block by weighting prediction samples generated by inter prediction and prediction samples generated by intra prediction.
[0254] 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.
[0255] The decoding apparatus 200 may compensate for prediction samples derived through inter-frame prediction using optical flow.
[0256] Figure 6 is a diagram illustrating transform and quantization processing.
[0257] like Figure 6 As shown in , a transform process and / or a quantization process is performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the prediction block (i.e., an intra-frame prediction block or an inter-frame prediction block). The prediction block is a block generated by intra-frame prediction or inter-frame prediction. The transform can be a primary transform, a secondary transform, or both a primary transform and a secondary transform. The primary transform of the residual signal generates transform coefficients, and the secondary transform of the transform coefficients generates secondary transform coefficients.
[0258] 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 used for the primary transform and / or secondary transform may be determined based on coding parameters of the current block and / or neighboring blocks of the current block. Optionally, transform information indicating the transform scheme may be signaled. DCT-based transforms may include, for example, DCT-2, DCT-8, etc. DST-based transforms may include, for example, DST-7.
[0259] 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 or block size / shape of the block, the quantized level signal may be scanned according to at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning. For example, when the coefficients are scanned according to diagonal upper right scanning, the coefficients in block form are changed to a one-dimensional vector form. In addition to diagonal upper right scanning, horizontal scanning for horizontally scanning the coefficients in two-dimensional block form or vertical scanning for vertically scanning the coefficients in two-dimensional block form may be used depending on the intra prediction mode and / or the size of the transform block. The scanned quantized level coefficients may be entropy coded for insertion into the bitstream.
[0260] The decoder entropy decodes the bitstream to obtain quantized level coefficients. The quantized level coefficients can be arranged in a two-dimensional block form by inverse scanning. For inverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning can be used.
[0261] The quantized level coefficients may then be dequantized, then inversely transformed secondary-wise as needed, and finally inversely transformed primary-wise as needed to generate a reconstructed residual signal.
[0262] Inverse mapping in the dynamic range can be performed for the luminance component reconstructed by intra prediction or inter 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 the parallel block group level. The inverse mapping function for performing inverse mapping can be derived based on the mapping function. In-loop filtering, reference picture storage and motion compensation are performed in the inverse mapping area, and the prediction block generated by inter prediction is converted to the mapping area via mapping using the mapping function, and then used to generate the reconstructed block. However, since intra prediction is performed in the mapping area, the prediction block generated by intra prediction can be used to generate the reconstructed block without mapping / inverse mapping.
[0263] 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 only be applied when mapping for the luma component is available and the partitioning of the luma component and the partitioning of the chroma component follow the same tree structure. Scaling can be performed based on the average value of the sample values of the luma prediction block corresponding to the chroma block. In this case, when the current block uses inter-frame prediction, the luma prediction block can represent the mapped luma prediction block. The value required for scaling can be derived by referencing a lookup table using the index of the segment to which the average value of the sample values of the luma prediction block belongs. Finally, the residual block can be converted to the 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.
[0264] Information indicating whether mapping / inverse mapping of luma components and chroma components is available may be signaled through a sequence parameter set.
[0265] The prediction block of the current block can be generated based on a block vector indicating the displacement between the current block and the reference block in the current picture. In this way, the prediction mode for generating the prediction block with reference to the current picture is called intra block copy (IBC) mode. The IBC mode can be applied to M×N (M<=64, N<=64) coding units. The IBC mode may include skip mode, merge mode, AMVP mode, etc. In the case of skip mode or 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 can be used as the block vector of the current block. The merge candidate list may include at least one of a spatial candidate, a history-based candidate, a candidate based on the average of two candidates, and a zero merge candidate. In the case of AMVP mode, a difference block vector may be signaled. In addition, the 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 IBC mode is included in the current CTU or the left CTU and is limited to blocks in the already reconstructed area. For example, the block vector value may be limited so that the prediction block of the current block is located within 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 block vector value in this manner, memory consumption and device complexity of an implementation according to the IBC mode can be reduced.
[0266] Hereinafter, an in-loop filtering method using subsampling-based block classification according to an embodiment of the present invention will be described with reference to FIG. 8 to FIG. 15 .
[0267] In the present invention, the in-loop filtering method includes deblocking filtering, sample adaptive offset (SAO), bilateral filtering, adaptive in-loop filtering, and the like.
[0268] By applying at least one of deblocking filtering and SAO to a reconstructed picture (i.e., a video frame) generated by summing reconstructed intra / inter prediction blocks and reconstructed residual blocks, blocking and ringing artifacts within the reconstructed picture can be effectively reduced. Deblocking filtering aims to reduce blocking artifacts around block boundaries by performing vertical and horizontal filtering on block boundaries. However, a problem with deblocking filtering is that when block boundaries are filtered, deblocking filtering cannot minimize the distortion between the original picture and the reconstructed picture. Sample adaptive offset (SAO) is a filtering technique that compares the pixel value of a specific sample with the pixel values of adjacent samples on a sample-by-sample basis and then adds an offset to the sample, or adds an offset to samples whose pixel values are within a specific pixel value range, to reduce ringing artifacts. SAO has the effect of reducing the distortion between the original picture and the reconstructed picture to a certain extent by using rate-distortion optimization. However, when the difference between the original picture and the reconstructed picture is large, there are limitations in minimizing distortion.
[0269] Bidirectional filtering refers to a filtering technique that determines a filter coefficient based on a distance from a central sample point in a filtering target area to each of the other sample points in the filtering target area and based on a difference between a pixel value of the central sample point and a pixel value of each of the other sample points.
[0270] Adaptive in-loop filtering refers to a filtering technique that minimizes distortion between an original picture and a reconstructed picture by using a filter that can minimize the distortion between the original picture and the reconstructed picture.
[0271] Unless otherwise specifically stated in the description of the present invention, in-loop filtering means adaptive in-loop filtering. In addition, adaptive in-loop filter can have the same meaning as adaptive in-loop filter.
[0272] In the present invention, filtering refers to a process of applying a filter to at least one basic unit selected from a sample, a block, a coding unit (CU), a prediction unit (PU), a transform unit (TU), a coding tree unit (CTU), a slice, a tile, a group of tiles (tile group), a picture, and a sequence. Filtering includes at least one of a block classification process, a filtering execution process, and a filter information encoding / decoding process.
[0273] In the present invention, coding unit (CU), prediction unit (PU), transform unit (TU) and coding tree unit (CTU) have the same meanings as coding block (CB), prediction block (PB), transform block (TB) and coding tree block (CTB), respectively.
[0274] In the present invention, a block refers to at least one of a CU, a PU, a TU, a CB, a PB, and a TB used as a basic unit in an encoding / decoding process.
[0275] In-loop filtering is performed such that bidirectional filtering, deblocking filtering, sample adaptive offset, and adaptive in-loop filtering are sequentially applied to a reconstructed picture to generate a decoded picture. However, the order in which filtering schemes classified as in-loop filtering are applied to the reconstructed picture varies.
[0276] For example, in-loop filtering may be performed such that deblocking filtering, sample adaptive offset, and adaptive in-loop filtering are sequentially applied to the reconstructed picture in the order of deblocking filtering, sample adaptive offset, and adaptive in-loop filtering.
[0277] Optionally, in-loop filtering may be performed such that bidirectional filtering, adaptive in-loop filtering, deblocking filtering, and sample adaptive offset are sequentially applied to the reconstructed picture in the order of bidirectional filtering, adaptive in-loop filtering, deblocking filtering, and sample adaptive offset.
[0278] Further optionally, in-loop filtering may be performed such that adaptive in-loop filtering, deblocking filtering, and sample adaptive offset are sequentially applied to the reconstructed picture in the order of adaptive in-loop filtering, deblocking filtering, and sample adaptive offset.
[0279] Further optionally, in-loop filtering may be performed such that adaptive in-loop filtering, sample adaptive offset, and deblocking filtering are sequentially applied to the reconstructed picture in the order of adaptive in-loop filtering, sample adaptive offset, and deblocking filtering.
[0280] In the present invention, a decoded picture refers to the output from in-loop filtering or post-processing filtering performed on a reconstructed picture composed of reconstructed blocks, each of which is generated by summing a reconstructed residual block and a corresponding intra-frame prediction block or summing a reconstructed block and a corresponding inter-frame prediction block. In the present invention, the meaning of a decoded sample, block, CTU, or picture does not differ from the meaning of a reconstructed sample, block, CTU, or picture, respectively.
[0281] Adaptive in-loop filtering is performed on the reconstructed picture to generate a decoded picture. Adaptive in-loop filtering may be performed on the decoded picture that has undergone at least one of deblocking filtering, sample adaptive offset, and bidirectional filtering. Furthermore, adaptive in-loop filtering may be performed on the reconstructed picture that has undergone adaptive in-loop filtering. In this case, adaptive in-loop filtering may be repeatedly performed N times on the reconstructed picture or the decoded picture. In this case, N is a positive integer.
[0282] In-loop filtering may be performed on a decoded picture that has been subjected to at least one of the in-loop filtering methods. For example, when at least one of the in-loop filtering methods is performed on a decoded picture that has been subjected to at least one of the other in-loop filtering methods, parameters for the latter filtering method may be changed, and then the former filtering with the changed parameters may be performed on the decoded picture. In this case, the parameters include encoding parameters, filter coefficients, the number of filter taps (filter length), filter shape, filter type, number of filtering executions, filter strength, threshold value, and / or a combination thereof.
[0283] The filter coefficient refers to a coefficient constituting a filter. Alternatively, the filter coefficient refers to a coefficient value corresponding to a specific mask position of the mask form, and the reconstructed sample point is multiplied by the coefficient value.
[0284] The number of filter taps refers to the length of the filter. When the filter is symmetrical with respect to a particular direction, the filter coefficients to be encoded / decoded can be reduced by half. In addition, the filter taps refer to the width (horizontal dimension) or height (vertical dimension) of the filter. Alternatively, the filter taps refer to both the width (lateral dimension) and height (vertical dimension) of a two-dimensional filter. In addition, the filter can be symmetrical with respect to two or more particular directions.
[0285] When the filter has a mask form, the filter may be a two-dimensional geometric figure having the following shapes: a diamond / rhombus shape, a non-square rectangular shape, a square shape, a trapezoidal shape, a diagonal shape, a snowflake shape, a number symbol shape, a clover shape, a cross shape, a triangle shape, a pentagonal shape, a hexagonal shape, an octagonal shape, a decagonal shape, a dodecagonal shape, or any combination thereof. Alternatively, the filter shape may be a shape obtained by projecting a three-dimensional figure onto a two-dimensional plane.
[0286] The filter type refers to a filter selected from a Wiener filter, a low-pass filter, a high-pass filter, a linear filter, a nonlinear filter, and a bidirectional filter.
[0287] In the present invention, among various filters, the description will be focused on the Wiener filter. However, the present invention is not limited thereto, and a combination of the above filters may be used in an embodiment of the present invention.
[0288] As a filter type for adaptive in-loop filtering, a Wiener filter can be used. The Wiener filter is an optimal linear filter for effectively removing noise, blur, and distortion within a picture, thereby improving coding efficiency. The Wiener filter is designed to minimize distortion between the original picture and the reconstructed / decoded picture.
[0289] At least one of the filtering methods may be performed during the encoding or decoding process. The encoding or decoding process refers to encoding or decoding performed in units of at least one of a slice, tile, tile group, picture, sequence, CTU, block, CU, PU, and TU. At least one of the filtering methods is performed during encoding or decoding performed in units of slices, tiles, tile groups, pictures, etc. For example, a Wiener filter is used for adaptive in-loop filtering during encoding or decoding. That is, in the phrase "adaptive in-loop filtering," the term "in-loop" indicates that filtering is performed during the encoding or decoding process. When adaptive in-loop filtering is performed, a decoded picture that has undergone adaptive in-loop filtering can be used as a reference picture when encoding or decoding a subsequent picture. In this case, since intra-frame prediction or motion compensation is performed on the subsequent picture to be encoded / decoded by referencing the reconstructed picture that has undergone adaptive in-loop filtering, the coding efficiency of the subsequent picture as well as the coding efficiency of the current picture that has undergone in-loop filtering can be improved.
[0290] In addition, at least one of the above-mentioned filtering methods is performed in a CTU-based or block-based encoding or decoding process. For example, a Wiener filter is used for adaptive in-loop filtering in a CTU-based or block-based encoding or decoding process. That is, in the phrase "adaptive in-loop filtering", the term "in-loop" means that filtering is performed during a CTU-based or block-based encoding or decoding process. When adaptive in-loop filtering is performed on a CTU-by-CTU or block-by-block basis, the decoded CTU or block that has undergone adaptive in-loop filtering is used as a reference CTU or block for a subsequent CTU or block to be encoded / decoded. In this case, since intra-frame prediction or motion compensation is performed on the subsequent CTU or block by referring to the current CTU or block to which adaptive in-loop filtering is applied, the coding efficiency of the current CTU or block to which in-loop filtering is applied is improved, and the coding efficiency of the subsequent CTU or block to be encoded / decoded is improved.
[0291] In addition, after the decoding process is performed, at least one of the filtering methods is performed as post-processing filtering. For example, a Wiener filter can be used as a post-processing filter after the decoding process is performed. When the Wiener filter is used after the decoding process, the Wiener filter is applied to the reconstructed / decoded picture before outputting (i.e., displaying) the reconstructed / decoded picture. When post-processing filtering is performed, the decoded picture that has undergone post-processing filtering may not be used as a reference picture for a subsequent picture to be encoded / decoded.
[0292] Adaptive in-loop filtering cannot be performed on a block-by-block basis. That is, block-based filter adaptation cannot be performed. Here, block-based filter adaptation refers to selecting different filters for different blocks. Block-based filter adaptation also refers to block classification.
[0293] Figure 8a is a flowchart illustrating a video decoding method according to an embodiment of the present invention.
[0294] Reference Figure 8a , the decoder decodes the filter information for each coding unit (S701).
[0295] The filter information is not limited to filter information in units of coding units, but also refers to filter information in units of slices, tiles, tile groups, pictures, sequences, CTUs, blocks, CUs, PUs, or TUs.
[0296] The filter information includes information about whether filtering is performed, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information about whether a fixed filter is used for block classification indexing and / or filter symmetry type information.
[0297] The filter shape information includes at least one shape selected from rhombus (diamond), rectangle, square, trapezoid, diagonal shape, snowflake shape, number symbol shape, clover shape, cross shape, triangle, pentagon, hexagon, octagon, decagon and dodecagon.
[0298] The filter coefficient values include geometrically transformed filter coefficient values for each block in which samples are classified into a plurality of classes in units of block classification units.
[0299] On the other hand, examples of the filter symmetry type include at least one of point symmetry, horizontal symmetry, longitudinal symmetry, and diagonal symmetry.
[0300] In addition, the decoder performs block classification on samples of the coding unit in units of block classification units (step S702). In addition, the decoder assigns a block classification index to the block classification unit in the coding unit.
[0301] Block classification is not limited to classification in units of coding units. That is, block classification can be performed in units of slices, tiles, tile groups, pictures, sequences, CTUs, blocks, CUs, PUs, or TUs.
[0302] A block sort index is determined based on the directionality information and the activity information.
[0303] At least one of the directionality information and the activity information is determined according to a gradient value for at least one of a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction.
[0304] On the other hand, a one-dimensional Laplacian operation is used in units of block classification units to obtain the gradient value.
[0305] The one-dimensional Laplacian operation is preferably a one-dimensional Laplacian operation in which the operation position is a sub-sampling position.
[0306] Alternatively, the gradient value may be determined based on a temporal layer identifier.
[0307] Furthermore, the decoder filters the coding units on which block classification has been performed in units of block classification units by using the filtering information ( S703 ).
[0308] The filtering target unit is not limited to the coding unit. That is, filtering can be performed in units of slices, tiles, tile groups, pictures, sequences, CTUs, blocks, CUs, PUs, or TUs.
[0309] Figure 8b is a flowchart illustrating a video encoding method according to an embodiment of the present invention.
[0310] Reference Figure 8b The encoder classifies samples in a coding unit into a plurality of categories in units of block classification units (step S801). In addition, the encoder assigns a block classification index to the block classification unit in each coding unit.
[0311] The basic unit for block classification is not limited to the coding unit. That is, block classification can be performed in units of slices, tiles, tile groups, pictures, sequences, CTUs, blocks, CUs, PUs, or TUs.
[0312] A block sort index is determined based on the directionality information and the activity information.
[0313] At least one of the directionality information and the activity information is determined based on a gradient value for at least one of a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction.
[0314] The gradient value is obtained using a one-dimensional Laplacian operation in units of block classification units.
[0315] The one-dimensional Laplacian operation is preferably a one-dimensional Laplacian operation in which the operation position is a sub-sampling position.
[0316] Optionally, the gradient value is determined according to a temporal layer identifier.
[0317] Furthermore, the encoder filters the coding units whose samples are classified in units of block classification units by using filter information of the coding units ( S802 ).
[0318] The basic unit for filtering is not limited to the coding unit. That is, filtering can be performed in units of slices, tiles, tile groups, pictures, sequences, CTUs, blocks, CUs, PUs, or TUs.
[0319] The filter information includes information about whether filtering is performed, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information about whether a fixed filter is used for block classification indexing and / or filter symmetry type information.
[0320] Examples of the filter shape include at least one of rhombus (diamond), rectangle, square, trapezoid, diagonal shape, snowflake, number sign, clover, cross, triangle, pentagon, hexagon, octagon, decagon, and dodecagon.
[0321] The filter coefficient values include filter coefficient values geometrically transformed in units of block classification units.
[0322] Next, the encoder encodes the filter information (S803).
[0323] The filter information is not limited to filter information in units of coding units, but may be filter information in units of slices, tiles, tile groups, pictures, sequences, CTUs, blocks, CUs, PUs, or TUs.
[0324] On the encoder side, the adaptive in-loop filtering process can be divided into several sub-steps, such as block classification, filtering, and filter information encoding.
[0325] In addition, on the decoder side, the adaptive in-loop filtering process is divided into filter information decoding, block classification and filtering steps.
[0326] Hereinafter, in order to avoid redundant description, the filter information encoding step and the filter information decoding step are collectively referred to as a filter information encoding / decoding step.
[0327] In the following, the block classification step will be described first.
[0328] Block classification indices are allocated within the reconstructed picture based on M×N blocks (or in units of block classification units) so that blocks within the reconstructed picture can be classified into L categories. Here, the block classification index can be allocated not only to the reconstructed / decoded picture but also to at least one of a restored / decoded slice, a restored / decoded tile group, a restored / decoded tile, a restored / decoded CTU, and a restored / decoded block.
[0329] Here, N, M, and L are all positive integers. For example, N and M are both positive integers selected from 2, 4, 8, 16, and 32, and L is a positive integer selected from 4, 8, 16, 20, 25, and 32. When N and M are the same integer, 1, block classification is performed on a sample basis rather than a block basis. On the other hand, when N and M are different positive integers, blocks of size N×M have a non-square shape. Alternatively, N and M may be the same positive integer.
[0330] For example, a total of 25 block class indices may be allocated to a reconstructed picture in units of 2×2 sized blocks. For example, a total of 25 block class indices may be allocated to a reconstructed picture in units of 4×4 sized blocks.
[0331] The block classification index has a value ranging from 0 to L-1, or may have a value ranging from 1 to L.
[0332] The block classification index C is based on the directionality value D and the quantized activity value A. q is determined by at least one of and is expressed by Equation 1.
[0333] [Equation 1]
[0334] C=5D+A q
[0335] In Equation 1, 5 is an exemplary constant value. The constant value may be represented by J. In this case, J is a positive integer having a value smaller than L.
[0336] For example, in one embodiment in which block classification is performed in units of 2×2 size blocks, the sum of the one-dimensional Laplacian gradient values in the vertical direction is represented by g v The sum of the one-dimensional Laplace gradient values for the horizontal direction, the first diagonal direction (angle of 135°) and the second diagonal direction (angle of 45°) is represented by g h 、g d1 and g d2 The Laplace operations for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction are represented by Expressions 2, 3, 4, and 5, respectively. The directionality value D and the activity value A are derived by using the sum of the gradient values. In one embodiment, the sum of the gradient values is used. Alternatively, any statistical value of the gradient values can be used instead of the sum of the gradient values.
[0337] [Equation 2]
[0338]
[0339] [Equation 3]
[0340]
[0341] [Equation 4]
[0342]
[0343] [Equation 5]
[0344]
[0345] In Equations 2 to 5, i and j represent coordinates of an upper left position in the horizontal and vertical directions, respectively, and R(i, j) represents a reconstructed sample value at the position (i, j).
[0346] In equations 2 to 5, k and l represent the horizontal operation range and the vertical operation range, respectively, to generate the result V of the sample-based one-dimensional Laplace operation for each direction. k,l 、H k,l 、D1 k,l 、D2 k,l The result of the one-dimensional Laplace operation based on the sample points in one direction represents the gradient value based on the sample points in the corresponding direction. That is, the result of the one-dimensional Laplace operation represents the gradient value. The one-dimensional Laplace operation is performed on each of the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, and the one-dimensional Laplace operation indicates the gradient value for the corresponding direction. In addition, the results of the one-dimensional Laplace operation for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction are respectively represented by V k,l 、H k,l 、D1 k,l 、D2 k,l express.
[0347] For example, k and l may be in the same range. That is, the horizontal length and vertical length of the operation range for calculating the one-dimensional Laplace sum may be the same.
[0348] Alternatively, k and l may have different ranges. That is, the horizontal length and vertical length of the operation range for calculating the one-dimensional Laplace sum may be different.
[0349] As an example, k ranges from i-2 to i+3, and l ranges from j-2 to j+3. In this case, the range for calculating the one-dimensional Laplacian sum is 6×6 size. In this case, the operation range for calculating the one-dimensional Laplacian sum is larger than the size of the block classification unit.
[0350] As another example, k ranges from i-1 to i+2, and l ranges from j-1 to j+2. In this case, the operation range for calculating the one-dimensional Laplacian sum is 4×4 size. In this case, the operation range for calculating the one-dimensional Laplacian sum is larger than the size of the block classification unit.
[0351] As another example, k ranges from i to i+1, and l ranges from j to j+1. In this case, the operation range for calculating the one-dimensional Laplace sum is 2×2 size. In this case, the operation range for calculating the one-dimensional Laplace sum is equal to the size of the block classification unit.
[0352] For example, an operation range for calculating the sum of results of one-dimensional Laplace operations has a two-dimensional geometric shape selected from a rhombus, a rectangle, a square, a trapezoid, a diagonal shape, a snowflake shape, a number sign shape, a clover shape, a cross shape, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0353] For example, the block classification unit has a two-dimensional geometric shape selected from rhombus / diamond, rectangle, square, trapezoid, diagonal shape, snowflake, number sign, clover, cross, triangle, pentagon, hexagon, octagon, decagon and dodecagon.
[0354] For example, the range for calculating the sum of one-dimensional Laplacian operations has a size of S × T. In this case, S and T are both zero or positive integers.
[0355] In addition, D1 indicating the first diagonal line and D2 indicating the second diagonal line may respectively mean D0 indicating the first diagonal line and D1 indicating the second diagonal line.
[0356] For example, in one embodiment where block classification is performed in units of 4×4 blocks, the sum of the gradient values g for the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction is calculated by equations 6, 7, 8, and 9 based on a one-dimensional Laplacian operation. v 、g h 、g d1 、g d2 The directionality value D and the activity value A are derived by using the sum of the gradient values. In one embodiment, the sum of the gradient values is used. Alternatively, any statistical value of the gradient values may be used instead of the sum of the gradient values.
[0357] [Equation 6]
[0358]
[0359] [Equation 7]
[0360]
[0361] [Equation 8]
[0362]
[0363] [Equation 9]
[0364]
[0365] In Equations 6 to 9, i and j represent coordinates of an upper left position in horizontal and vertical directions, respectively, and R(i, j) represents a reconstructed sample value at the position (i, j).
[0366] In equations 6 to 9, k and l represent the results V used to calculate the sample-based one-dimensional Laplace operation for each direction. k,l 、H k,l 、D1 k,l 、D2 k,l The horizontal operation range and vertical operation range of the sum of the two. The result of the one-dimensional Laplace operation based on the sample points in one direction represents the gradient value based on the sample points in the corresponding direction. That is, the result of the one-dimensional Laplace operation represents the gradient value. The one-dimensional Laplace operation is performed for each of the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, and the one-dimensional Laplace operation indicates the gradient value for the corresponding direction. In addition, the results of the one-dimensional Laplace operation for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction are respectively represented as V k,l 、H k,l 、D1 k,l 、D2 k,l .
[0367] For example, k and l may have the same range. That is, the horizontal length and vertical length of the operation range for calculating the sum of the one-dimensional Laplace operations may be the same.
[0368] Alternatively, k and l may have different ranges. That is, the horizontal length and vertical length of the operation range for calculating the sum of the one-dimensional Laplace operations may be different.
[0369] As an example, k ranges from i-2 to i+5, and l ranges from j-2 to j+5. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 8×8 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is larger than the size of the block classification unit.
[0370] As another example, k ranges from i to i+3, and l ranges from j to j+3. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 4×4 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit.
[0371] For example, an operation range for calculating the sum of results of one-dimensional Laplace operations has a two-dimensional geometric shape selected from a rhombus, a rectangle, a square, a trapezoid, a diagonal shape, a snowflake shape, a number sign shape, a clover shape, a cross shape, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0372] For example, the operation range for calculating the sum of one-dimensional Laplacian operations has a size of S × T. In this case, S and T are both zero or positive integers.
[0373] For example, the block classification unit has a two-dimensional geometric shape selected from rhombus / diamond, rectangle, square, trapezoid, diagonal shape, snowflake, number sign, clover, cross, triangle, pentagon, hexagon, octagon, decagon and dodecagon.
[0374] For example, in one embodiment in which block classification is performed in units of 4×4 blocks, the one-dimensional Laplacian and g of the gradient values for the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction are calculated by Equations 10 to 13, respectively. v 、g h 、g d1 、g d2 The gradient values are represented based on subsample points to reduce the computational complexity for block classification. The directionality value D and the activity value A are derived by using the sum of the gradient values. In one embodiment, the sum of the gradient values is used. Alternatively, any statistical value of the gradient values can be used instead of the sum of the gradient values.
[0375] [Equation 10]
[0376] g v =∑ k ∑ l V k,l , Vk,l =|2R(k,l)-R(k,l-1)-R(k,l+1)|,k=i-2,i,i+2,i+4,l=j-2,...,j+5
[0377] [Equation 11]
[0378] g h =∑ k ∑ l H k,l , H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)|,k=i-2,...,+5,l=j-2,j,j+2,j+4
[0379] [Equation 12]
[0380] gd1 =∑ k ∑ l m k,l D1 k,l , D1 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)|,k=i-2,...,i+5,l=j-2,...,j+5
[0381]
[0382] [Equation 13]
[0383] g d2 =∑ k ∑ l n k,l D2 k,l , D2 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)|,k=i-2,...,i+5,l=j-2,...,j+5
[0384]
[0385] In Equations 10 to 13, i and j represent coordinates of an upper left position in horizontal and vertical directions, respectively, and R(i, j) represents a reconstructed sample value at the position (i, j).
[0386] In equations 10 to 13, k and l represent the results of the one-dimensional Laplace operation based on the sample points, V k,l 、H k,l 、D1 k,l 、D2 k,l The horizontal operation range and vertical operation range of the sum of the two. The result of the one-dimensional Laplace operation based on the sample points in one direction represents the gradient value based on the sample points in the corresponding direction. That is, the result of the one-dimensional Laplace operation represents the gradient value. The one-dimensional Laplace operation is performed for each of the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, and the one-dimensional Laplace operation indicates the gradient value for the corresponding direction. In addition, the results of the one-dimensional Laplace operation for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction are respectively represented as V k,l 、H k,l 、D1 k,l 、D2 k,l .
[0387] For example, k and l may have the same range. That is, the horizontal length and vertical length of the operation range for calculating the sum of the one-dimensional Laplace operations are the same.
[0388] Alternatively, k and l may have different ranges. That is, the horizontal length and vertical length of the operation range for calculating the sum of the one-dimensional Laplace operations may be different.
[0389] As an example, k ranges from i-2 to i+5, and l ranges from j-2 to j+5. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 8×8 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is larger than the size of the block classification unit.
[0390] As another example, k ranges from i to i+3, and l ranges from j to j+3. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 4×4 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit.
[0391] For example, an operation range for calculating the sum of results of one-dimensional Laplace operations has a two-dimensional geometric shape selected from a rhombus, a rectangle, a square, a trapezoid, a diagonal shape, a snowflake shape, a number sign shape, a clover shape, a cross shape, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0392] For example, the operation range for calculating the sum of one-dimensional Laplacian operations has a size of S × T. In this case, S and T are zero or positive integers.
[0393] For example, the block classification unit has a two-dimensional geometric shape selected from rhombus / diamond, rectangle, square, trapezoid, diagonal shape, snowflake, number sign, clover, cross, triangle, pentagon, hexagon, octagon, decagon and dodecagon.
[0394] According to an embodiment of the present invention, a sample-based gradient value calculation method can calculate a gradient value by performing a one-dimensional Laplacian operation on sample points within an operation range along a corresponding direction. Here, the statistical value of the gradient value can be calculated by calculating a statistical value of the result of a one-dimensional Laplacian operation performed on at least one sample point within the operation range for calculating the sum of the one-dimensional Laplacian operations. In this case, the statistical value is any one of a sum, a weighted sum, and an average.
[0395] For example, to calculate the gradient value in the horizontal direction, a one-dimensional Laplacian operation is performed at each sample point within the operation range for calculating the sum of the one-dimensional Laplacian operations. In this case, the gradient value in the horizontal direction can be calculated at intervals of P rows within the operation range for calculating the sum of the one-dimensional Laplacian operations. Here, P is a positive integer.
[0396] Alternatively, to calculate the gradient value in the vertical direction, a one-dimensional Laplacian operation is performed at each sample point within the operation range on the column where the sum of the one-dimensional Laplacian operations is calculated. In this case, the gradient value in the vertical direction may be calculated at intervals of P columns within the operation range where the sum of the one-dimensional Laplacian operations is calculated. Here, P is a positive integer.
[0397] Further optionally, to calculate the gradient value for the first diagonal direction, within the operation range for calculating the sum of the one-dimensional Laplace operations, a one-dimensional Laplace operation is performed on the sample positions at intervals of P rows or Q columns in at least one of the horizontal direction and the vertical direction, thereby obtaining the gradient value for the first diagonal direction. Here, P and Q are zero or positive integers.
[0398] Further optionally, to calculate the gradient value for the second diagonal direction, within the operation range for calculating the sum of the one-dimensional Laplace operations, a one-dimensional Laplace operation is performed on the sample positions at intervals of P rows or Q columns in at least one of the horizontal and vertical directions, thereby obtaining the gradient value for the second diagonal direction. Here, P and Q are zero or positive integers.
[0399] According to an embodiment of the present invention, a sample-based gradient value calculation method can calculate a gradient value by performing a one-dimensional Laplacian operation on at least one sample within a calculation range for calculating a one-dimensional Laplacian sum. Here, the statistical value of the gradient value can be calculated by calculating a statistical value of the result of the one-dimensional Laplacian operation performed on at least one sample within the calculation range for calculating the one-dimensional Laplacian sum. In this case, the statistical value is any one of a sum, a weighted sum, and an average.
[0400] For example, to calculate the gradient value, a one-dimensional Laplacian operation is performed at each sample point within the operation range for calculating the sum of the one-dimensional Laplacian operations. In this case, the gradient value can be calculated at intervals of P rows within the operation range for calculating the sum of the one-dimensional Laplacian operations. Here, P is a positive integer.
[0401] Alternatively, to calculate the gradient value, a one-dimensional Laplacian operation is performed at each sample point within an operation range on the column where the one-dimensional Laplacian sum is calculated. In this case, the gradient value may be calculated at intervals of P rows within the operation range where the one-dimensional Laplacian sum is calculated. Here, P is a positive integer.
[0402] Further optionally, to calculate the gradient value, within the operation range for calculating the sum of the one-dimensional Laplacian operations, a one-dimensional Laplacian operation is performed on the sample positions at intervals of P rows or Q columns in at least one of the horizontal and vertical directions, thereby obtaining the gradient value. Here, P and Q are zero or positive integers.
[0403] Further optionally, to calculate the gradient value, within the operation range for calculating the sum of the one-dimensional Laplacian operations, a one-dimensional Laplacian operation is performed on the sample positions at intervals of P rows and Q columns in the horizontal and vertical directions, thereby obtaining the gradient value. Here, P and Q are zero or positive integers.
[0404] On the other hand, the gradient refers to at least one of a gradient for a horizontal direction, a gradient for a vertical direction, a gradient for a first diagonal direction, and a gradient for a second diagonal direction.
[0405] Figure 9 is a diagram illustrating an example of determining slope values according to horizontal, vertical, first diagonal, and second diagonal directions based on subsampling.
[0406] like Figure 9 As shown in , when block classification is performed in units of 4×4 size blocks, the sum of the gradient values g for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction may be calculated based on subsampling. v 、g h 、g d1 、g d2 At least one of. Here, V, H, D1 and D2 represent the results of the one-dimensional Laplace operation based on the sample points for the vertical direction, horizontal direction, first diagonal direction and second diagonal direction, respectively. That is, the one-dimensional Laplace operation is performed at the positions V, H, D1 and D2 along the vertical direction, horizontal direction, first diagonal direction and second diagonal direction, respectively. In addition, the position where the one-dimensional Laplace operation is performed is the subsampling position. Figure 9 In the example, the block classification index C is assigned to the shaded 4×4 blocks. In this case, the operation range for calculating the one-dimensional Laplacian sum is larger than the size of the block classification unit. Here, the thin solid rectangle represents the reconstruction sample point position, and the thick solid rectangle represents the operation range for calculating the one-dimensional Laplacian sum.
[0407] According to an embodiment of the present invention, a gradient value can be calculated by performing a one-dimensional Laplacian operation on samples arranged at specific positions in an N×M block based on subsampling. In this case, the specific position can be at least one of an absolute position and a relative position within the block. Here, a statistical value of the gradient value can be calculated by calculating a statistical value of the result of the one-dimensional Laplacian operation performed on at least one sample point within the operation range for calculating the one-dimensional Laplacian sum. In this case, the statistical value is any one of a sum, a weighted sum, and an average.
[0408] For example, the absolute position indicates the upper left position within an N×M block.
[0409] Optionally, the absolute position indicates a lower right position within an N×M block.
[0410] Further optionally, the relative position represents a center position within an N×M block.
[0411] According to an embodiment of the present invention, the gradient value can be calculated by performing a one-dimensional Laplacian operation on R samples within an N×M block based on subsampling. In this case, P and Q are zero or positive integers. In addition, R is equal to or less than the product of N and M. Here, the statistical value of the gradient value can be calculated by calculating the statistical value of the result of the one-dimensional Laplacian operation performed on at least one sample within the operation range for calculating the one-dimensional Laplacian sum. In this case, the statistical value is any one of a sum, a weighted sum, and an average.
[0412] For example, when R is 1, a one-dimensional Laplacian operation is performed on only one sample point within an N×M block.
[0413] Optionally, when R is 2, a one-dimensional Laplacian operation is performed only on two sample points within an N×M block.
[0414] Further optionally, when R is 4, the one-dimensional Laplacian operation is performed only on the four sample points in each N×M block.
[0415] According to an embodiment of the present invention, the gradient value can be calculated by performing a one-dimensional Laplacian operation on R samples within each N×M block based on subsampling. In this case, R is a positive integer. In addition, R is equal to or less than the product of N and M. Here, the statistical value of the gradient value is obtained by calculating the statistical value of the result of the one-dimensional Laplacian operation performed on at least one sample within the operation range for calculating the one-dimensional Laplacian sum. In this case, the statistical value is any one of a sum, a weighted sum, and an average.
[0416] For example, when R is 1, a one-dimensional Laplacian operation is performed only on one sample point within each N×M-sized block for calculating a one-dimensional Laplacian sum.
[0417] Alternatively, when R is 2, the one-dimensional Laplacian operation is performed only on two sample points within each N×M-sized block for calculating the one-dimensional Laplacian sum.
[0418] Further optionally, when R is 4, the one-dimensional Laplacian operation is performed only on 4 sample points in each N×M-sized block for calculating the one-dimensional Laplacian sum.
[0419] Figures 10 to 121 is a diagram illustrating a method for determining gradient values at specific sample points for the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction. The specific sample points may be subsampled sample points within a block classification unit, or may be subsampled sample points within a calculation range for calculating the sum of one-dimensional Laplacian operations. Furthermore, the specific sample points are sample points within each block. Optionally, the specific sample points may vary from block to block. Furthermore, the specific sample points may be the same regardless of the direction of the one-dimensional Laplacian operation to be calculated. Furthermore, the specific sample points may be the same for each block regardless of the direction of the one-dimensional Laplacian operation.
[0420] like Figure 10 As shown in FIG, when block classification is performed based on a 4×4 size block, the sum of the gradient values g is calculated at one or more specific sample positions. v 、g h 、g d1 、g d2 At least one of. Here, V, H, D1 and D2 represent the results of the one-dimensional Laplace operation based on the sample points for the vertical direction, horizontal direction, first diagonal direction and second diagonal direction, respectively. That is, the one-dimensional Laplace operation is performed along the vertical direction, horizontal direction, first diagonal direction and second diagonal direction at positions V, H, D1 and D2, respectively. In addition, the position where the one-dimensional Laplace operation is performed may be a subsampling position. Figure 10 In the example, the block classification index C is assigned to the shaded 4×4 blocks. In this case, the operation range for calculating the one-dimensional Laplacian sum can be larger than the size of the block classification unit. Here, the thin solid rectangle represents the reconstruction sample point position, and the thick solid rectangle represents the operation range for calculating the one-dimensional Laplacian sum.
[0421] like Figure 10 As shown in , regardless of the direction of the one-dimensional Laplace operation, the specific sample point locations for performing the one-dimensional Laplace operation are the same. Figure 10 As shown in , the pattern of sample point positions for performing one-dimensional Laplace calculations can be called a checkerboard pattern or a quincunx pattern. In addition, all sample point positions for performing one-dimensional Laplace calculations are even-numbered sample point positions or odd-numbered sample point positions in the horizontal direction (x-axis direction) and the vertical direction (y-axis direction) within the block classification unit or the calculation range of the one-dimensional Laplace sum within the block unit.
[0422] like Figure 11 As shown in FIG, when block classification is performed based on a 4×4 size block, the sum of the gradient values g is calculated at one or more specific sample positions. v 、g h 、g d1 、g d2At least one of. Here, V, H, D1 and D2 represent the results of the one-dimensional Laplace operation based on the sample points for the vertical direction, the horizontal direction, the first diagonal direction and the second diagonal direction, respectively. That is, the one-dimensional Laplace operation is performed along the vertical direction, the horizontal direction, the first diagonal direction and the second diagonal direction at the positions V, H, D1 and D2, respectively. In addition, the position where the one-dimensional Laplace operation is performed may be a subsampling position. Figure 11 In the example, the block classification index C is assigned to the shaded 4×4 blocks. In this case, the computation range for the one-dimensional Laplacian sum can be larger than the size of the block classification unit. Here, the thin solid rectangle represents the reconstruction sample point position, and the thick solid rectangle represents the computation range for computing the one-dimensional Laplacian sum.
[0423] like Figure 11 As shown in , regardless of the direction of the one-dimensional Laplace operation, the specific sample point position for performing the one-dimensional Laplace operation is the same. In addition, as Figure 11 As shown in , the pattern of sample point positions for performing one-dimensional Laplace calculations can be called a checkerboard pattern or a quincunx pattern. In addition, the sample point positions for performing one-dimensional Laplace calculations are even-numbered sample point positions or odd-numbered sample point positions in both the horizontal direction (x-axis direction) and the vertical direction (y-axis direction) within the block classification unit or the one-dimensional Laplace calculation range within the block unit.
[0424] like Figure 12 As shown in FIG, when block classification is performed based on a 4×4 size block, the sum of the gradient values g is calculated at one or more specific sample positions. v 、g h 、g d1 、g d2 At least one of. Here, V, H, D1 and D2 represent the results of the sample-based one-dimensional Laplace operation performed on the sample-based direction for the vertical direction, horizontal direction, first diagonal direction and second diagonal direction, respectively. That is, the one-dimensional Laplace operation is performed along the vertical direction, horizontal direction, first diagonal direction and second diagonal direction at positions V, H, D1 and D2, respectively. In addition, the position where the one-dimensional Laplace operation is performed may be a subsampling position. Figure 12 In the example, the block classification index C is assigned to the shaded 4×4 blocks. In this case, the operation range for calculating the one-dimensional Laplacian sum can be larger than the size of the block classification unit. Here, the thin solid rectangle represents the reconstruction sample point position, and the thick solid rectangle represents the operation range for calculating the one-dimensional Laplacian sum.
[0425] According to an embodiment of the present invention, the sum of the gradient values g along the vertical direction, the horizontal direction, the first diagonal direction and the second diagonal direction is calculated. v 、g h 、gd1 and g d2 Compares two or more values in a to each other.
[0426] For example, after calculating the sum of the gradient values, the sum of the gradient values in the vertical direction g v and the sum of the gradient values in the horizontal direction g h Compare and derive the maximum value of the sum of the gradient values for the vertical direction and the sum of the gradient values for the horizontal direction according to Equation 14 and minimum value
[0427] [Equation 14]
[0428]
[0429] In this case, in order to sum the vertical gradient values g v and the sum of the gradient values in the horizontal direction g h Compare and compare the values of the sum according to Equation 15.
[0430] [Equation 15]
[0431]
[0432] Optionally, for example, the sum of the gradient values in the first diagonal direction g d1 and the sum of the gradient values for the second diagonal direction g d2 Compare and derive the maximum value of the sum of the gradient values for the first diagonal direction and the sum of the gradient values for the second diagonal direction according to Equation 16 and minimum value
[0433] [Equation 16]
[0434]
[0435] In this case, in order to sum the gradient values g for the first diagonal direction d1 and the sum of the gradient values for the second diagonal direction g d2 Compare, and compare the values of the sum according to Equation 17.
[0436] [Equation 17]
[0437]
[0438] According to one embodiment of the present invention, in order to calculate the directivity value D, the maximum value and the minimum value are compared with two thresholds t1 and t2 as described below.
[0439] The directivity value D is a positive integer or 0. For example, the directivity value D may have a value in the range from 0 to 4. For example, the directivity value D may have a value in the range from 0 to 2.
[0440] Furthermore, the directivity value D can be determined based on the characteristics of the region. For example, directivity values D 0 to 4 are represented as follows: 0 represents a textured region; 1 represents strong horizontal / vertical directivity; 2 represents weak horizontal / vertical directivity; 3 represents strong first / second diagonal directivity; and 4 represents weak first / second diagonal directivity. The directivity value D is determined through the steps described below.
[0441] Step 1: When satisfied and , set the value D to 0.
[0442] Step 2: When satisfied When , the process proceeds to step 3, but when it does not meet , proceed to step 4.
[0443] Step 3: When satisfied When the value D is set to 2, but when it does not meet , set the value D to 1.
[0444] Step 4: When satisfied When the value D is set to 4, but when it does not meet , set the value D to 3.
[0445] Wherein, threshold values t1 and t2 are positive integers, and t1 and t2 may have the same value or different values. For example, t1 and t2 are 2 and 9, respectively. In another example, t1 and t2 are both 1. In another example, t1 and t2 are 1 and 9, respectively.
[0446] When block classification is performed based on a 2×2 sized block, the activity value A may be expressed as in Equation 18.
[0447] [Equation 18]
[0448]
[0449] For example, k and l have the same range. That is, the horizontal length and vertical length of the operation range for calculating the sum of the one-dimensional Laplace operation are equal.
[0450] Alternatively, for example, k and l are different ranges from each other. That is, the horizontal length and vertical length of the operation range for calculating the sum of the one-dimensional Laplace operations are different.
[0451] Further alternatively, for example, k ranges from i-2 to i+3, and l ranges from j-2 to j+3. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 6×6 size.
[0452] Further alternatively, for example, k ranges from i-1 to i+2, and l ranges from j-1 to j+2. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operations is a 4×4 size.
[0453] Further alternatively, for example, k ranges from i to i+1, and l ranges from j to j+1. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operations is 2×2 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operations may be equal to the size of the block classification unit.
[0454] For example, the operation range for calculating the sum of the results of the one-dimensional Laplace operation may have a two-dimensional geometric shape selected from a rhombus, a rectangle, a square, a trapezoid, a diagonal shape, a snowflake shape, a number sign shape, a clover shape, a cross shape, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0455] Furthermore, when block classification is performed based on a 4×4 sized block, the activity value A may be expressed as in Equation 19.
[0456] [Equation 19]
[0457]
[0458] For example, k and l have the same range. That is, the horizontal length and vertical length of the operation range for calculating the sum of the one-dimensional Laplace operation are equal.
[0459] Alternatively, for example, k and l are different ranges from each other. That is, the horizontal length and vertical length of the operation range for calculating the sum of the one-dimensional Laplace operations are different.
[0460] Further alternatively, for example, k ranges from i-2 to i+5, and l ranges from j-2 to j+5. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 8×8 size.
[0461] Further alternatively, for example, k ranges from i to i+3, and l ranges from j to j+3. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operations is 4×4 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operations may be equal to the size of the block classification unit.
[0462] For example, the operation range for calculating the sum of the results of the one-dimensional Laplace operation may have a two-dimensional geometric shape selected from a rhombus, a rectangle, a square, a trapezoid, a diagonal shape, a snowflake shape, a number sign shape, a clover shape, a cross shape, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0463] On the other hand, the activity value A is quantized to generate a quantized activity value A ranging from I to J. q Here, I and J are both positive integers or zero. For example, I and J are 0 and 4 respectively.
[0464] A predetermined method may be used to determine the quantitative activity value A. q .
[0465] For example, the quantified activity value A q It can be obtained by Equation 20. In this case, the quantized activity value A q Can be included within a range from a specific minimum value X to a specific maximum value Y.
[0466] [Equation 20]
[0467]
[0468] In Equation 20, the quantized activity value A is calculated by multiplying the activity value A by a specific constant W and performing a right shift R operation on the product of A and W. q In this case, X, Y, W, and R are all positive integers or zero. For example, W is 24, and R is 13. Alternatively, for example, W is 64, and R is 3+N (bits). For example, N is a positive integer and is specifically 8 or 10. In another example, W is 32, and R is 3+N (bits). Alternatively, for example, N is a positive integer and is specifically 8 or 10.
[0469] Further optionally, for example, a lookup table (LUT) is used to calculate the quantized activity value A q , and set the activity value A and the quantized activity value A q That is, the operation is performed on the activity value A, and the quantized activity value A is calculated using the lookup table. q In this case, the operation may include at least one of multiplication, division, right shift operation, left shift operation, addition, and subtraction.
[0470] On the other hand, in the case of chroma components, filtering is performed for each chroma component using K filters without performing block classification processing. Here, K is a positive integer or zero. For example, K is one of 0 to 7. In addition, in the case of chroma components, block classification may not be performed on the chroma components, and filtering may be performed using a block classification index derived from the luma component at the corresponding position of the chroma component. In addition, in the case of chroma components, filter information for the chroma components may not be signaled, and fixed-type filters may be used.
[0471] Further optionally, for example, at least one of a combination of the above-mentioned block classification index determination methods may be used to determine the block classification index.
[0472] In the following, the filtering execution sub-step will be described.
[0473] According to an exemplary embodiment of the present invention, a filter corresponding to the determined block classification index is used to perform filtering on samples or blocks in a reconstructed / decoded picture. When filtering is performed, one of L filters is selected. L is a positive integer or zero.
[0474] For example, one of L filters is selected in units of block classification units, and filtering is performed on a reconstructed / decoded picture in units of reconstructed / decoded samples.
[0475] Alternatively, for example, one filter among L filters is selected in units of block classification units, and filtering is performed on the reconstructed / decoded picture in units of block classification units.
[0476] Further alternatively, for example, one filter among L filters is selected in units of block classification units, and filtering is performed on a reconstructed / decoded picture in units of CUs.
[0477] Further alternatively, for example, one filter among L filters is selected in units of block classification units, and filtering is performed on the reconstructed / decoded picture in units of blocks.
[0478] Further optionally, for example, U filters among the L filters are selected in units of block classification units, and filtering is performed on the reconstructed / decoded picture in units of reconstructed / decoded samples. Here, U is a positive integer.
[0479] Further optionally, for example, U filters among the L filters are selected in units of block classification units, and filtering is performed on the reconstructed / decoded picture in units of block classification units. Here, U is a positive integer.
[0480] Further optionally, for example, U filters among the L filters are selected in units of block classification units, and filtering is performed on the reconstructed / decoded picture in units of CUs. Here, U is a positive integer.
[0481] Further optionally, for example, U filters among the L filters are selected in units of block classification units, and filtering is performed on the reconstructed / decoded picture in units of blocks. Here, U is a positive integer.
[0482] Here, the L filters are called a filter set.
[0483] According to an embodiment of the present invention, the L filters are different from each other in at least one of filter coefficients, the number of filter taps (ie, filter length), filter shape, and filter type.
[0484] For example, the L filters are identical in at least one of filter coefficients, the number of filter taps (filter length), filter coefficients, filter shape, and filter type in units of blocks, CUs, PUs, TUs, CTUs, slices, tile blocks, tile groups, pictures, and sequences.
[0485] Optionally, for example, the L filters are identical in at least one of filter coefficients, number of filter taps (filter length), filter shape, and filter type in units of CU, PU, TU, CTU, slice, tile, tile group, picture, and sequence.
[0486] Filtering may be performed using the same filter or different filters in units of CU, PU, TU, CTU, slice, tile, tile group, picture, and sequence.
[0487] Filtering may be performed or not performed based on filtering performance information indicating whether filtering is performed in units of samples, blocks, CUs, PUs, TUs, CTUs, slices, tiles, tile groups, pictures, and sequences. The filtering performance information indicating whether filtering is performed is information signaled from an encoder to a decoder in units of samples, blocks, CUs, PUs, TUs, CTUs, slices, tiles, tile groups, pictures, and sequences.
[0488] According to an embodiment of the present invention, N filters with different numbers of filter taps and the same filter shape (ie, diamond or rhombus filter shape) are used. Here, N is a positive integer. For example, Figure 13 Diamond filters with 5×5, 7×7 or 9×9 filter taps are shown in .
[0489] Figure 13 is a diagram illustrating a diamond filter according to an embodiment of the present invention.
[0490] Reference Figure 13 In order to signal from the encoder to the decoder which of the three diamond filters with 5×5, 7×7, or 9×9 filter taps is to be used, the filter index is entropy encoded / decoded in units of picture / tile / tile group / slice / sequence. That is, the filter index is entropy encoded / decoded in the sequence parameter set, picture parameter set, slice header, slice data, tile header, tile group header, header, etc. in the bitstream.
[0491] According to an embodiment of the present invention, when the number of filter taps is fixed to 1 in an encoder / decoder, the encoder / decoder performs filtering using a filter index without entropy encoding / decoding the filter index. Here, a diamond filter with 7×7 filter taps is used for the luma component, and a diamond filter with 5×5 filter taps is used for the chroma component.
[0492] According to an embodiment of the present invention, at least one of three diamond filters is used to filter at least one reconstructed / decoded sample of at least one of the luma component and the chroma component.
[0493] For example, Figure 13 At least one of the three diamond-type filters shown in is used to filter the reconstructed / decoded luma samples.
[0494] Alternatively, for example, Figure 13 The 5×5 diamond shaped filter shown in FIG is used to filter the reconstructed / decoded chroma samples.
[0495] Further optionally, for example, the filter used to filter the luma samples is used to filter the reconstructed / decoded chroma samples corresponding to the luma samples.
[0496] According to an embodiment of the present invention, the filters have the same filter length (representing 5×5 filter taps), but may have different filter shapes selected from the following shapes: diamond, rectangle, square, trapezoid, diagonal, snowflake, number sign, clover, cross, triangle, pentagon, hexagon, octagon, decagon, and dodecagon. For example, Figure 14 A square-shaped filter, an octagonal-shaped filter, a snowflake-shaped filter, and a diamond-shaped filter with 5×5 filter taps are shown in FIG.
[0497] The number of filter taps is not limited to 5×5. A filter having an H×V filter tap selected from the following items can be used: 3×3, 4×4, 5×5, 6×6, 7×7, 8×8, 9×9, 5×3, 7×3, 9×3, 7×5, 9×5, 9×7, and 11×7. Here, H and V are positive integers and can have the same value or different values. In addition, at least one of H and V is a value predefined in the encoder / decoder and is a value sent by the encoder to the decoder. In addition, one of H and V is defined using the other of H and V. In addition, the final value of H or V can be defined using the values of H and V.
[0498] On the other hand, in order to send a signal from the encoder to the decoder Figure 14 In order to know which filter among the filters shown in [ ] is to be used, the filter index can be entropy encoded / decoded in units of picture / tile / tile group / slice / sequence. That is, the filter index is entropy encoded / decoded into the sequence parameter set, picture parameter set, slice header, slice data, tile header, and tile group header in the bitstream.
[0499] on the other hand, Figure 14 At least one of the square shape filter, octagonal shape filter, snowflake filter, and diamond filter shown in is used to filter at least one reconstructed / decoded sample of at least one of the luma component and the chroma component.
[0500] According to an embodiment of the present invention, as the filter used in the above-mentioned filtering process, a filter having at least one shape selected from the following shapes is used: a rhombus, a rectangle, a square, a trapezoid, a diagonal shape, a snowflake shape, a numeric symbol shape, a clover shape, a cross shape, a triangle, a pentagon, a hexagon, an octagon, a decagon, and a dodecagon. For example, Figure 15a and / or Figure 15b As shown in , the filter may have a shape selected from the following shapes: square, octagon, snowflake, diamond, hexagon, rectangle, cross, number sign, cloverleaf, and diagonal.
[0501] For example, using Figure 15a and / or Figure 15b A filter set is constructed by using at least one filter of the filters having a vertical length of 5 among the filters shown in , and filtering is then performed using the filter set.
[0502] Alternatively, for example, use Figure 15a and Figure 15b A filter set is constructed by using at least one filter having a vertical filter length of 3 among the filters shown in , and filtering is then performed using the filter set.
[0503] Further optionally, for example, using Figure 15a and / or Figure 15b A filter set is constructed by using at least one of the filters having a vertical filter length of 3 or 5 shown in , and filtering is performed using the filter set.
[0504] Figure 15a and Figure 15b The filter shown in FIG is designed to have a vertical filter length of 3 or 5. However, the filter shape used in the embodiments of the present invention is not limited thereto. The filter can be designed to have an arbitrary vertical filter length M. Here, M is a positive integer.
[0505] On the other hand, using Figure 15a and / or Figure 15b , the information about which filter to use is signaled from the encoder to the decoder. In this case, the filter index is entropy encoded / decoded in units of picture, tile, tile group, slice, or sequence. Here, H is a positive integer. That is, the filter index is entropy encoded / decoded into the sequence parameter set, picture parameter set, slice header, slice data, tile header, and tile group header in the bitstream.
[0506] At least one of diamond, rectangular, square, trapezoidal, diagonal, snowflake, numeric sign, trefoil, cross, triangle, pentagonal, hexagonal, octagonal, and decagonal filters is used to filter the reconstructed / decoded samples of at least one of the luma component and the chroma component.
[0507] on the other hand, Figure 15a and / or Figure 15b The numbers in each filter shape shown in represent the filter coefficient index, and the filter coefficient index is symmetric with respect to the filter center. That is, Figure 15a and / or Figure 15b The filter shape shown in is a point-symmetric filter.
[0508] At least one of diamond, rectangular, square, trapezoidal, diagonal, snowflake, numeric sign, trefoil, cross, triangle, pentagonal, hexagonal, octagonal, and decagonal filters is used to filter the reconstructed / decoded samples of at least one of the luma component and the chroma component.
[0509] According to one embodiment of the present invention, filtering is performed on the reconstructed / decoded samples R(i, j) to generate filtered decoded samples R′(i, j). The filtered decoded samples can be expressed as Equation 21.
[0510] [Equation 21]
[0511]
[0512] In Equation 21, L is the number of filter taps in the horizontal direction or the vertical direction (filter length), and f(k, l) is a filter coefficient.
[0513] On the other hand, when filtering is performed, an offset value Y may be added to the filtered, decoded sample R'(i, j). The offset value Y may be entropy encoded / decoded. Furthermore, the offset value Y may be calculated using at least one statistical value of the current reconstructed / decoded sample value and the adjacent reconstructed / decoded sample value. Furthermore, the offset value Y may be determined based on at least one encoding parameter of the current reconstructed / decoded sample and the adjacent reconstructed / decoded sample. Here, the threshold E is a positive integer or zero.
[0514] In addition, the filtered decoded samples may be clipped to be represented by N bits. Here, N is a positive integer. For example, when the filtered decoded samples generated by filtering the reconstructed / decoded samples are clipped by 10 bits, the final decoded sample values may have values within a range from 0 to 1023.
[0515] According to an embodiment of the present invention, filtering of the chrominance component is performed based on the filter information of the luminance component.
[0516] For example, filtering of the reconstructed picture of the chrominance component may be performed only when filtering of the reconstructed picture of the luminance component has been performed in the previous stage. Here, filtering of the reconstructed picture of the chrominance component may be performed on U (Cr), V (Cb), or both components.
[0517] Alternatively, for example, in the case of a chroma component, filtering is performed using at least one of a filter coefficient of a corresponding luminance component, the number of filter taps, a filter shape, and information on whether filtering is performed.
[0518] According to an exemplary embodiment of the present invention, when filtering is performed, if unavailable samples exist near a current sample, padding is performed, and then filtering is performed using the padded samples. Padding refers to a method of copying the sample values of adjacent available samples to the unavailable samples. Alternatively, sample values or statistical values obtained based on the available sample values adjacent to the unavailable samples are used. Padding can be repeated for P columns and R rows. Here, M and L are both positive integers.
[0519] Here, the unavailable samples refer to samples arranged outside the boundary of a CTU, CTB, slice, tile, tile group, or picture. Alternatively, the unavailable samples refer to samples belonging to at least one of a CTU, CTB, slice, tile, tile group, and picture that is different from at least one of the CTU, CTB, slice, tile, tile group, and picture to which the current sample belongs.
[0520] According to an embodiment, a filling method for samples located outside a picture boundary and a filling method for samples located outside a predetermined area, where the predetermined area exists within the picture boundary but adaptive in-loop filtering is applied, may be different. For samples located outside the picture boundary, the values of available samples located at the picture boundary may be copied, and the values of samples located outside the picture boundary may be determined. For samples located outside the predetermined area, the filling values of unavailable samples may be determined by mirroring the values of available samples based on the picture boundary, where the predetermined area exists within the picture boundary but adaptive in-loop filtering is applied.
[0521] According to an embodiment, padding of samples located outside the screen boundary may be performed only in the horizontal direction, and may not be performed in the vertical direction. Conversely, padding of samples located outside the screen boundary may be performed only in the vertical direction, and may not be performed in the horizontal direction.
[0522] Furthermore, when filtering is performed, predetermined samples may not be used.
[0523] For example, when performing filtering, the padded samples may not be used.
[0524] Alternatively, for example, when filtering is performed, when an unavailable sample exists near a current sample, the unavailable sample may not be used in filtering.
[0525] Further optionally, for example, when filtering is performed, when samples near the current sample are located outside the CTU or CTB, neighboring samples near the current sample may not be used in filtering.
[0526] Also, when filtering is performed, samples to which at least one of deblocking filtering, adaptive sample offset, and adaptive in-loop filtering is applied may be used.
[0527] Furthermore, when filtering is performed, when at least one of samples existing near a current sample is located outside a CTU or CTB boundary, at least one of deblocking filtering, adaptive sample offset, and adaptive in-loop filtering may not be applied.
[0528] Furthermore, the filtering target samples include unavailable samples located outside a CTU or CTB boundary, at least one of deblocking filtering, adaptive sample shifting, and adaptive in-loop filtering is not performed on the unavailable samples, and the unavailable samples are used for filtering as they are.
[0529] According to an embodiment of the present invention, when filtering is performed, at least one sample located near a boundary of at least one of a CU, a PU, a TU, a block, a block classification unit, a CTU, and a CTB is filtered. In this case, the boundary includes at least one of a vertical boundary, a horizontal boundary, and a diagonal boundary. In addition, the sample located near the boundary may be at least one of U rows, U columns, and U samples located near the boundary. Here, U is a positive integer.
[0530] According to an embodiment of the present invention, when filtering is performed, at least one sample located within a block is filtered, and filtering is not performed on samples located outside a boundary of at least one of a CU, a PU, a TU, a block, a block classification unit, a CTU, and a CTB. In this case, the boundary includes at least one of a vertical boundary, a horizontal boundary, and a diagonal boundary. In addition, the samples located near the boundary may be at least one of U rows, U columns, and U samples located near the boundary. Here, U is a positive integer.
[0531] Further optionally, filtering is performed, for example, by using any combination of the above filtering methods.
[0532] Hereinafter, the filter information encoding / decoding steps will be described.
[0533] According to an embodiment of the present invention, the filter information is entropy encoded / decoded to be placed between the slice header and the first CTU syntax element of the slice data within the bitstream.
[0534] In addition, the filter information is entropy encoded / decoded to be set in a sequence parameter set, a picture parameter set, a slice header, a slice data, a tile header, a tile group header, a CTU, or a CTB within a bitstream.
[0535] On the other hand, the filter information includes at least one piece of information selected from the following items: information about whether luminance component filtering is performed, information about whether chrominance component filtering is performed, filter coefficient values; the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information about whether filtering is performed in units of slices, parallel blocks, parallel block groups, pictures, CTUs, CTBs, blocks or CUs, information about the number of times CU-based filtering is performed, CU maximum depth filtering information, information about whether CU-based filtering is performed, information about whether a filter of a previous reference picture is used, a filter index of a previous reference picture, information about whether a fixed filter is used for a block classification index, index information for a fixed filter, filter merging information, information about whether different filters are used for luminance components and chrominance components, respectively, and filter symmetry shape information.
[0536] Here, the number of filter taps refers to at least one of the horizontal length of the filter, the vertical length of the filter, the first diagonal length of the filter, the second diagonal length of the filter, the horizontal and vertical lengths of the filter, and the number of filter coefficients within the filter.
[0537] On the other hand, the filter information includes a maximum of L luma filters. Here, L is a positive integer, specifically 25. Furthermore, the filter information includes a maximum of L chroma filters. Here, L is a positive integer, including 0, and can be 0 to 8. Information about the maximum of L chroma filters can be included in a parameter set or header. The parameter set can be an adaptive parameter set. The information about the maximum of L chroma filters can represent information about the number of chroma ALFs and can be encoded / decoded as, for example, the syntax element alf_chroma_num_alt_filters_minus1.
[0538] On the other hand, one filter includes a maximum of K luminance filter coefficients. Here, K is a positive integer, and is specifically 13. In addition, the filter information includes a maximum of K chrominance filter coefficients. Here, K is a positive integer, and is specifically 7.
[0539] For example, the information about the symmetric shape of the filter is information about a filter shape such as a point-symmetric shape, a horizontally symmetric shape, a vertically symmetric shape, or a combination thereof.
[0540] Alternatively, only some of the filter coefficients may be signaled. For example, when the filter has a symmetric form, information about the filter's symmetric shape and only one of the symmetric filter coefficient sets may be signaled. Alternatively, for example, the filter coefficients at the center of the filter may not be signaled, as they may be implicitly derived.
[0541] According to an embodiment of the present invention, the filter coefficient values in the filter information are quantized in the encoder, and the obtained quantized filter coefficient values are entropy encoded. Similarly, the quantized filter coefficient values in the decoder are entropy decoded, and the quantized filter coefficient values are dequantized to be restored to the original filter coefficient values. The filter coefficient values are quantized to a range of values that can be represented by a fixed M bits, and then dequantized. In addition, at least one filter coefficient among the filter coefficients is quantized to different bits and dequantized. Conversely, at least one filter coefficient among the filter coefficients may be quantized to the same bit and dequantized. The M bits are determined according to the quantization parameter. In addition, M in the M bits is a constant predefined in the encoder and decoder. Here, M can be a positive integer, and can specifically be 8 or 10. The M bits can be less than or equal to the number of bits required to represent a sample point in the encoder / decoder. For example, when the number of bits required to represent a sample point is 10, M can be 8. The first filter coefficient among the filter coefficients within the filter can have a value from -2 M to -2 M -1, and the second filter coefficient can have a value from 0 to 2 M Here, the first filter coefficient refers to the filter coefficients excluding the center filter coefficient among the filter coefficients, and the second filter coefficient refers to the center filter coefficient among the filter coefficients.
[0542] At least one of an encoder and a decoder may clip filter coefficient values in the filter information, and at least one of a minimum value and a maximum value associated with the clipping may be entropy encoded / decoded. The filter coefficient values may be clipped to fall within a range from the minimum value to the maximum value. At least one of the minimum value and the maximum value may have different values for each filter coefficient. Alternatively, at least one of the minimum value and the maximum value may have the same value for each filter coefficient. At least one of the minimum value and the maximum value may be determined based on a quantization parameter. At least one of the minimum value and the maximum value may be a constant value predefined in the encoder and the decoder.
[0543] According to an exemplary embodiment of the present invention, whether filtering is performed on at least one of a luminance component and a chrominance component is indicated by using filtering performance information (flag).
[0544] For example, whether filtering is performed on at least one of the luma component and the chroma component is indicated by using filtering execution information (flag) in units of CTU, CTB, CU, or block. For example, when the filtering execution information has a first value, filtering is performed in units of CTB, and when the filtering execution information has a second value, filtering is not performed on the corresponding CTB. In this case, information on whether filtering is performed for each CTB can be entropy encoded / decoded. Alternatively, for example, information on the maximum depth or minimum size of a CU (maximum depth filtering information of a CU) is additionally entropy encoded / decoded, and CU-based filtering execution information on a CU having the maximum depth or a CU having the minimum size can be entropy encoded / decoded.
[0545] For example, when a block can be partitioned into smaller square sub-blocks and non-square sub-blocks according to a block structure, the CU-based flag is entropy encoded / decoded until the block has a partition depth of a block structure that can be partitioned into smaller square sub-blocks. In addition, the CU-based flag can be entropy encoded / decoded until the block has a partition depth of a block structure that can be partitioned into smaller non-square sub-blocks.
[0546] Alternatively, for example, the information on whether filtering is performed on at least one of the luminance component and the chrominance component may be a block-based flag (i.e., a flag in units of blocks). For example, when the block-based flag of a block has a first value, filtering is performed on the corresponding block, and when the block-based flag of the corresponding block has a second value, filtering is not performed. The size of the block is N×M, where N and M are positive integers.
[0547] Further optionally, for example, the information about whether filtering is performed on at least one of the luma component and the chroma component may be a CTU-based flag (i.e., a flag in units of CTUs). For example, when the CTU-based flag of the CTU has a first value, filtering is performed on the corresponding CTU, and when the CTU-based flag of the corresponding CTU has a second value, filtering is not performed. The size of the CTU is N×M, where N and M are positive integers.
[0548] Further optionally, for example, whether filtering is performed on at least one of the luma component and the chroma component is determined according to a picture, a slice, a tile group, or a tile type. The information on whether filtering is performed on at least one of the luma component and the chroma component may be a flag in units of a picture, a slice, a tile group, or a tile.
[0549] According to an embodiment of the present invention, filtering is performed using a fixed filter set.
[0550] Although temporal filter coefficient prediction cannot be used in intra-frame prediction pictures (I pictures, slices, tile groups, or tile blocks), at least one filter from a maximum of 16 fixed filters in a filter set can be used for filtering according to the block class index. In order to signal whether the fixed filter set is used from the encoder to the decoder, information about whether a fixed filter is used for each block class index in the block class index is entropy encoded / decoded. When a fixed filter is used, index information about the fixed filter is also entropy encoded / decoded. Even when a fixed filter is used for a specific block class index, the filter coefficients are entropy encoded / decoded, and the reconstructed picture is filtered using the entropy encoded / decoded filter coefficients and the fixed filter coefficients.
[0551] Furthermore, a fixed filter set is also used in inter-predicted pictures (B / P pictures, slices, tile groups, or tiles).
[0552] In addition, without entropy encoding / decoding the filter coefficients, adaptive in-loop filtering can be performed using fixed filters. Here, the fixed filter may represent a filter set predefined in the encoder and decoder. In this case, without entropy encoding / decoding the filter coefficients, the encoder and decoder entropy encode / decode fixed filter index information indicating which filter or filter set is used in a filter set of multiple filter sets predefined in the encoder and decoder. In this case, filtering is performed using fixed filters that differ in at least one of filter coefficient values, filter taps (i.e., the number of filter taps or filter length), and filter shape based on at least one of a block class, a block, a CU, a slice, a tile, a tile group, and a picture.
[0553] According to an embodiment of the present invention, prediction of filter coefficients from filter coefficients of a predefined fixed filter is prohibited.
[0554] According to an embodiment of the present invention, the multiplication operation is replaced by a shift operation. First, the filter coefficients used to perform filtering on the luminance block and / or the chrominance block are divided into two groups. For example, the filter coefficients are divided into a first group including coefficients {L0, L1, L2, L3, L4, L5, L7, L8, L9, L10, L14, L15, L16, and L17} and a second group including the remaining coefficients. The first group is limited to only include coefficient values {-64, -32, -16, -8, -4, 0, 4, 8, 16, 32, and 64}. In this case, the multiplication of the filter coefficients included in the first group and the reconstructed / decoded samples can be performed by a single bit shift operation. Therefore, the filter coefficients included in the first group are mapped to pre-binarized bit-shifted values to reduce signaling overhead.
[0555] A computer-readable recording medium according to the present invention stores a bitstream generated by a video coding method, wherein the video coding method includes: classifying coding units into multiple categories in units of block classification units, filtering the coding units classified in units of block classification units, and encoding filter information. The block classification unit is not limited to the coding unit. That is, block classification can be performed in units of slices, parallel blocks, parallel block groups, pictures, sequences, CTUs, blocks, CUs, PUs, or TUs. In addition, the target to be filtered is not a coding unit. That is, filtering can be performed on slices, parallel blocks, parallel block groups, pictures, sequences, CTUs, blocks, CUs, PUs, or TUs. In addition, the filter information is not limited to filter information for each coding unit. The filter information can be filter information for each slice, parallel block, parallel block group, picture, sequence, CTU, block, CU, PU, or TU.
[0556] The following shows examples of syntax element information required to implement adaptive in-loop filtering in an encoder / decoder, semantics of the syntax element information, and encoding / decoding processes. In the present disclosure, syntax may refer to syntax elements.
[0557] Figures 16 to 21 An example of syntax element information required for adaptive in-loop filtering is shown. At least one syntax element among the syntax elements required for the adaptive in-loop filter may be entropy encoded / decoded in at least one of a parameter set, a header, a partition, a CTU, or a CU.
[0558] At this time, the parameter set, header, block, CTU or CU can be at least one of a video parameter set, a decoding parameter set, a sequence parameter set, an adaptation parameter set, a picture parameter set, a picture header, a sub-picture header, a slice header, a parallel block group header, a parallel block header, a block, a coding tree unit (CTU) or a coding unit (CU).
[0559] Here, the signaled parameter set, header, partition, CTU, or CU may be used for adaptive in-loop filtering using syntax elements for adaptive in-loop filtering.
[0560] For example, when entropy encoding / decoding of syntax elements for adaptive in-loop filtering is performed in a sequence parameter set, adaptive in-loop filtering may be performed using syntax elements for adaptive in-loop filtering having the same syntax element values in a sequence unit.
[0561] In another example, when entropy encoding / decoding syntax elements for adaptive in-loop filtering in a picture parameter set, adaptive in-loop filtering may be performed using syntax elements for adaptive in-loop filtering having the same syntax element values in a picture unit.
[0562] In another example, when a syntax element for adaptive in-loop filtering is entropy encoded / decoded in a picture header, adaptive in-loop filtering may be performed using a syntax element for adaptive in-loop filtering having the same syntax element value in a picture unit.
[0563] In another example, when entropy encoding / decoding a syntax element for adaptive in-loop filtering in a slice header, adaptive in-loop filtering may be performed using a syntax element for adaptive in-loop filtering having the same syntax element value in a slice unit.
[0564] In another example, when entropy encoding / decoding syntax elements for adaptive in-loop filtering in an adaptive parameter set, adaptive in-loop filtering may be performed using syntax elements for adaptive in-loop filtering having the same syntax element values in units referring to the same adaptive parameter set.
[0565] An adaptation parameter set may refer to a parameter set that can be referenced and shared across different pictures, sub-pictures, slices, tile groups, tiles, or partitions. Furthermore, information in an adaptation parameter set can be used by referencing different adaptation parameter sets within a sub-picture, slice, tile group, tile, or partition within a picture.
[0566] Furthermore, in a sub-picture, a slice, a tile group, a tile, or a partition in a picture, different adaptation parameter sets may be referenced using identifiers of different adaptation parameter sets.
[0567] Furthermore, in a slice, a tile group, a tile, or a partition in a sub-picture, different adaptation parameter sets may be referenced using identifiers of different adaptation parameter sets.
[0568] Furthermore, in tiles or partitions in a slice, different adaptation parameter sets may be referenced using identifiers of different adaptation parameter sets.
[0569] Furthermore, in partitions within a tile, different adaptation parameter sets may be referenced using identifiers of different adaptation parameter sets.
[0570] An adaptation parameter set identifier may refer to an identification number assigned to an adaptation parameter set.
[0571] Information about the adaptation parameter set identifier may be included in a header of a parameter set or a sequence. An adaptation parameter set corresponding to the adaptation parameter set identifier may be used in a sequence.
[0572] Information about the adaptation parameter set identifier may be included in a header of a parameter set or a picture. In addition, an adaptation parameter set corresponding to the adaptation parameter set identifier may be used in a picture.
[0573] Information about the adaptation parameter set identifier may be included in a header of a parameter set or a sub-picture. In addition, an adaptation parameter set corresponding to the adaptation parameter set identifier may be used in a sub-picture.
[0574] Information about the adaptation parameter set identifier may be included in a header of a parameter set or a tile. In addition, an adaptation parameter set corresponding to the adaptation parameter set identifier may be used in the tile.
[0575] Information about the adaptation parameter set identifier may be included in a header of a parameter set or a slice. In addition, an adaptation parameter set corresponding to the adaptation parameter set identifier may be used in a slice.
[0576] Information about the adaptation parameter set identifier may be included in a header of a parameter set or a partition. In addition, an adaptation parameter set corresponding to the adaptation parameter set identifier may be used in a partition.
[0577] A picture may be partitioned into one or more tile rows and one or more tile columns.
[0578] A sub-picture can be partitioned into one or more tile rows and one or more tile columns within a picture. A sub-picture is a rectangular / square area within a picture and can include one or more CTUs. In addition, at least one tile / block / slice can be included in a sub-picture.
[0579] A tile is a rectangular / square area in a picture and may include one or more CTUs. In addition, a tile may be partitioned into one or more partitions.
[0580] A partition may refer to one or more CTU rows in a tile. A tile may be partitioned into one or more partitions, and each partition may have one or more CTU rows. In addition, a partition may refer to a tile that has not been partitioned further.
[0581] A slice may include one or more tiles in a picture and may include one or more partitions in a tile.
[0582] As in Figure 16 In the example of , sps_alf_enabled_flag may represent information indicating whether adaptive in-loop filtering is performed in sequence units.
[0583] For example, when sps_alf_enabled_flag has a first value (eg, 0), adaptive in-loop filtering may not be performed in sequence units. In addition, when sps_alf_enabled_flag has a second value (eg, 1), adaptive in-loop filtering may be performed in sequence units.
[0584] When sps_alf_enabled_flag is not present in the bitstream, sps_alf_enabled_flag may be inferred to be a first value (eg, 0).
[0585] As in Figure 17 In the example of , adaptation_parameter_set_id may represent an identifier of an adaptation parameter set referenced by another syntax element. When adaptation_parameter_set_id is not present in the bitstream, adaptation_parameter_set_id may be inferred to be a first value (eg, 0).
[0586] As in Figure 18 In the example of , aps_params_type may indicate the type information of the adaptation parameter set present in the adaptation parameter set. Furthermore, aps_params_type may indicate the type of encoding information included in the adaptation parameter set. For example, when aps_params_type has a first value (e.g., 0), the data / content / syntax element values in the adaptation parameter set may indicate parameters for adaptive in-loop filtering (ALF type). When aps_params_type has a second value (e.g., 1), the data / content / syntax element values in the adaptation parameter set may indicate parameters for luma mapping and chroma scaling (luma mapping and chroma scaling type). When aps_params_type has a third value (e.g., 2), the data / content / syntax element values in the adaptation parameter set may indicate parameters for a quantization matrix set (quantization matrix type). Here, SL refers to a scaling list representing a quantization matrix. When aps_params_type is not present in the bitstream, aps_params_type may be inferred to be a value other than the first value (e.g., 0), the second value (e.g., 1), and the third value (e.g., 2).
[0587] An adaptation parameter set identifier identical to that of a previously signaled adaptation parameter set may be newly signaled for the current adaptation parameter set. Furthermore, an adaptation parameter set having the same adaptation parameter set identifier and adaptation parameter type as the previously signaled adaptation parameter set may be newly signaled. In this case, the data / content / syntax element values of the previously signaled adaptation parameter set may be replaced with the data / content / syntax element values of the newly signaled adaptation parameter set. This replacement process represents an update process of the adaptation parameter set.
[0588] That is, in an encoder / decoder, at least one of adaptive in-loop filtering, luma mapping and chroma scaling (LMCS), and quantization / dequantization using a quantization matrix may be performed by referring to data / content / syntax element values of a previously signaled adaptive parameter set. From a point in time when an adaptive parameter set having the same adaptive parameter set identifier as that of the previously signaled adaptive parameter set is newly signaled for a current adaptive parameter set, in an encoder / decoder, at least one of adaptive in-loop filtering, luma mapping and chroma scaling (LMCS), and quantization / dequantization using a quantization matrix may be performed by referring to data / content / syntax element values in the newly signaled adaptive parameter set.
[0589] Furthermore, in the encoder / decoder, at least one of adaptive in-loop filtering, luma mapping and chroma scaling (LMCS), and quantization / dequantization using a quantization matrix may be performed by referring to data / content / syntax element values of a previously signaled adaptive parameter set. From a point in time when an adaptive parameter set having the same adaptive parameter set identifier and adaptive parameter type as the previously signaled adaptive parameter set is newly signaled, in the encoder / decoder, at least one of adaptive in-loop filtering, luma mapping and chroma scaling (LMCS), and quantization / dequantization using a quantization matrix may be performed by referring to data / content / syntax element values in the newly signaled adaptive parameter set.
[0590] According to an embodiment, chroma component presence information aps_chroma_present_flag indicating whether encoding information related to chroma components is included in an adaptation parameter set may be included in the adaptation parameter set and encoded / decoded. When the chroma component presence information indicates that encoding information related to chroma components is included in the adaptation parameter set, the adaptation parameter set may include encoding information of chroma components for adaptive in-loop filtering, luma mapping and chroma scaling, or a quantization matrix. If not, the adaptation parameter set may not include encoding information of chroma components for adaptive in-loop filtering, luma mapping and chroma scaling, or a quantization matrix.
[0591] Based on the chroma component presence information, it can be determined whether a quantization matrix for the chroma component exists. Furthermore, based on the chroma component presence information, it can be determined whether adaptive in-loop filter information for the chroma component exists. Furthermore, based on the chroma component presence information, it can be determined whether luma mapping and chroma scaling information for the chroma component exists.
[0592] According to an embodiment, when the chroma format of the current video, sequence, picture, or slice is 4:0:0 (in the case of monochrome), the chroma component presence information may indicate that the chroma component is not present. Therefore, when the chroma format is 4:0:0, the picture header or slice header may not include an adaptation parameter set identifier for the chroma component. That is, when the chroma format is 4:0:0, the picture header or slice header may not include quantization matrix information, adaptive in-loop filter information, and luma mapping and chroma scaling (LMCS) for the chroma component.
[0593] chroma_format_idc or ChromaArrayType can indicate the chroma format. Chroma format can indicate the format of the chroma component.
[0594] For example, when chroma_format_idc has a first value (eg, 0), the chroma format may be set to 4:0:0. When the chroma format of the current picture is 4:0:0, the current picture may be determined to be monochrome without a chroma component.
[0595] In addition, when chroma_format_idc has a second value (e.g., 1), the chroma format may be set to 4:2:0. When chroma_format_idc has a third value (e.g., 2), the chroma format may be set to 4:2:2. When chroma_format_idc has a fourth value (e.g., 3), the chroma format may be set to 4:4:4.
[0596] In addition, when the chroma format is 4:0:0, the chroma component presence information in the adaptation parameter set referenced in the current picture or the current slice can be determined as the first value (e.g., 0) representing the encoding information of the absence of the chroma component.
[0597] In addition, when the chroma format is not 4:0:0, the chroma component presence information in the adaptation parameter set referenced in the current picture or the current slice can be determined as a second value (e.g., 1) indicating the presence of encoding information of the chroma component.
[0598] In addition, when the chroma format is 4:0:0, the chroma component presence information in the adaptive parameter set referenced in the current picture or the current slice can be determined as the first value (e.g., 0) of the quantization matrix information indicating that the chroma component does not exist.
[0599] In addition, when the chroma format is not 4:0:0, the chroma component presence information in the adaptive parameter set referenced in the current picture or the current slice can be determined as a second value (e.g., 1) of the quantization matrix information indicating the presence of the chroma component.
[0600] As in Figure 19In the example of , slice_alf_enabled_flag may represent information indicating whether adaptive in-loop filtering is performed on at least one of Y, Cb, or Cr components in a slice unit.
[0601] For example, when slice_alf_enabled_flag has a first value (e.g., 0), adaptive in-loop filtering may not be performed in slice units for all Y, Cb, and Cr components. Furthermore, when slice_alf_enabled_flag has a second value (e.g., 1), adaptive in-loop filtering may be performed in slice units for at least one of the Y, Cb, or Cr components.
[0602] When slice_alf_enabled_flag is not present in the bitstream, slice_alf_enabled_flag may be inferred to be a first value (eg, 0).
[0603] slice_num_alf_aps_ids_luma may be slice luma ALF set number information, where the slice luma ALF set number information indicates the number of adaptive parameter sets for adaptive in-loop filtering referenced in the slice. Here, an ALF set may represent a filter set including multiple adaptive in-loop filters (ALFs). In this case, a luma ALF may represent an adaptive in-loop filter for the luma component.
[0604] slice_num_alf_aps_ids_luma may have a value from 0 to N. Here, N may be a positive integer, and may be 6, for example.
[0605] When slice_num_alf_aps_ids_luma is not present in the bitstream, slice_num_alf_aps_ids_luma may be inferred to be a first value (eg, 0).
[0606] Furthermore, the maximum number of adaptive parameter sets for adaptive in-loop filtering and the maximum number of adaptive parameter sets for luma mapping and chroma scaling preset in the encoder / decoder may be equal to each other. Furthermore, the maximum number of adaptive parameter sets for adaptive in-loop filtering and the maximum number of adaptive parameter sets for quantization matrix sets preset in the encoder / decoder may be equal to each other. Furthermore, the maximum number of adaptive parameter sets for luma mapping and chroma scaling and the maximum number of adaptive parameter sets for quantization matrix sets preset in the encoder / decoder may be equal to each other.
[0607] Furthermore, the maximum number of adaptive parameter sets for adaptive in-loop filtering and the maximum number of adaptive parameter sets for luma mapping and chroma scaling preset in the encoder / decoder may differ from each other. Furthermore, the maximum number of adaptive parameter sets for quantization matrix sets and the maximum number of adaptive parameter sets for luma mapping and chroma scaling preset in the encoder / decoder may differ from each other. Furthermore, the maximum number of adaptive parameter sets for adaptive in-loop filtering and the maximum number of adaptive parameter sets for quantization matrix sets preset in the encoder / decoder may differ from each other.
[0608] The sum of the maximum number of adaptive parameter sets for adaptive in-loop filtering, the maximum number of adaptive parameter sets for luma mapping and chroma scaling, and the maximum number of adaptive parameter sets for quantization matrix sets may be the maximum number of adaptive parameter sets that may be included in the encoder / decoder.
[0609] The number of adaptive parameter sets for adaptive in-loop filtering may be a maximum of K in the case of intra slices and a maximum of L in the case of inter slices. Here, K and L may be positive integers, and for example, K may be 1 and L may be 6.
[0610] The number of adaptive parameter sets for luma mapping and chroma scaling may be a maximum of K in the case of intra slices and a maximum of L in the case of inter slices. Here, K and L may be positive integers, and for example, K may be 1 and L may be 6.
[0611] The number of adaptive parameter sets for the quantization matrix set may be a maximum of K in the case of an intra slice and a maximum of L in the case of an inter slice. Here, K and L may be positive integers, and for example, K may be 1 and L may be 6.
[0612] Optionally, the number of adaptive parameter sets for luma mapping and chroma scaling may be at most J, regardless of the type of slice. Here, J may be a positive integer from 1 to 8, and for example, J may be 4.
[0613] Alternatively, the number of adaptive parameter sets for the adaptive in-loop filter may be a maximum of J, regardless of the type of slice. Here, J may be a positive integer from 1 to 8, and for example, J may be 8.
[0614] Alternatively, the number of adaptive parameter sets for the quantization matrix set may be a maximum of J, regardless of the type of slice. Here, J may be a positive integer from 1 to 8, and for example, J may be 8.
[0615] According to an embodiment, the adaptation parameter set identifier may have an N-bit positive integer value. The N value is a positive integer greater than 1. For example, the N value may be 5. Therefore, the adaptation parameter set identifier may indicate one of 0 to 31. That is, a maximum of 32 adaptation parameter sets may be defined.
[0616] Of the 32 adaptive parameter sets, eight can indicate information about the quantization matrix, eight can indicate information about the adaptive in-loop filter, and four can indicate information about luma mapping and chroma scaling.
[0617] The adaptation parameter set identifier for the quantization matrix may have a value from 0 to N. At this time, N is a positive integer and may be 7.
[0618] In addition, the adaptation parameter set identifier for the adaptive in-loop filter may have a value from 0 to N. At this time, N is a positive integer and may be 7.
[0619] In addition, the adaptation parameter set identifier for luma mapping and chroma scaling may have a value from 0 to N. Here, N is a positive integer and may be 3.
[0620] Adaptation parameter set identifiers for quantization matrix, adaptive in-loop filter, and luma mapping and chroma scaling may be encoded as fixed-length codes according to the adaptation parameter set type.
[0621] Depending on the embodiment, the maximum number of adaptive parameter sets referenced by a slice included in a picture may be one or more. For example, a slice included in a picture may reference at most one adaptive parameter set for a quantization matrix, at most one adaptive parameter set for luma mapping and chroma scaling, and at most N adaptive parameter sets for an adaptive in-loop filter. N is an integer equal to or greater than 2. For example, N may be 8 or 9.
[0622] slice_alf_aps_id_luma[i] may represent a slice luma ALF set identifier indicating an i-th adaptation parameter set for adaptive in-loop filtering referenced in a slice.
[0623] When slice_alf_aps_id_luma[i] is not present in the bitstream, slice_alf_aps_id_luma[i] may be inferred to be a first value (eg, 0).
[0624] Here, the temporal layer identifier of the adaptation parameter set having the same adaptation_parameter_set_id as slice_alf_aps_id_luma[i] may be less than or equal to the temporal layer identifier of the current slice. In the present disclosure, adaptation_parameter_set_id may represent an adaptation parameter set identifier.
[0625] When two or more sub-pictures / slices / tile groups / partitions have the same adaptation_parameter_set_id in one picture and there are two or more adaptation parameter sets for adaptive in-loop filtering with the adaptation_parameter_set_id, the two or more adaptation parameter sets for adaptive in-loop filtering with the same adaptation_parameter_set_id may have the same data / content / syntax element value.
[0626] In case of intra slices, slice_alf_aps_id_luma[i] may not refer to an adaptation parameter set for adaptive in-loop filtering for pictures other than intra pictures or pictures including intra slices.
[0627] According to an embodiment, slice_alf_aps_id_luma[i] may refer only to an adaptive parameter set including an adaptive in-loop filter set for a luma component.
[0628] According to an embodiment, slice_alf_aps_id_luma[i] may refer to an adaptive parameter set for adaptive in-loop filtering among the adaptive parameter sets referenced in a picture header or a slice header. Furthermore, the picture header or the slice header may include encoding information indicating the adaptive parameter set for adaptive in-loop filtering applicable to the picture or slice. Here, the temporal layer identifier of the adaptation parameter set having the adaptation_parameter_set_id indicated by the encoding information may be less than or equal to the temporal layer identifier of the current picture.
[0629] When the adaptation parameter set type of a predetermined adaptation parameter set is a parameter for adaptive in-loop filtering (ALF type) and the adaptation parameter set identifier adaptation_parameter_set_id is equal to alf_aps_id_luma[i] which is the identifier of the adaptation parameter set referenced in the current picture or picture header, the temporal layer identifier of the predetermined adaptation parameter set may be less than or equal to the temporal layer identifier of the current picture.
[0630] When slice_alf_chroma_idc has a first value (eg, 0), adaptive in-loop filtering may not be performed on Cb and Cr components.
[0631] Furthermore, when slice_alf_chroma_idc has a second value (eg, 1), adaptive in-loop filtering may be performed on the Cb component.
[0632] Also, when slice_alf_chroma_idc has a third value (eg, 2), adaptive in-loop filtering may be performed on the Cr component.
[0633] Also, when slice_alf_chroma_idc has a fourth value (eg, 3), adaptive in-loop filtering may be performed on Cb and Cr components.
[0634] When slice_alf_chroma_idc is not present in the bitstream, slice_alf_chroma_idc may be inferred to be a first value (eg, 0).
[0635] According to an embodiment, a picture header or a slice header may include encoding information indicating whether adaptive in-loop filtering is performed on the Cb and Cr components in a slice included in a picture or a slice. In addition, for the chroma components Cb and Cr allowed by the encoding information of the picture header or the slice header, slice_alf_chroma_idc may be chroma ALF application information indicating whether the chroma components are allowed in the slice. For example, when adaptive in-loop filtering of only the Cb component of the picture header or the slice header is allowed, slice_alf_chroma_idc may indicate only whether adaptive in-loop filtering of the Cb component is allowed in the slice. Conversely, when adaptive in-loop filtering of only the Cr component of the picture header or the slice header is allowed, slice_alf_chroma_idc may indicate only whether adaptive in-loop filtering of the Cr component is allowed in the slice. Furthermore, when both the Cb component and the Cr component are not allowed, slice_alf_chroma_idc may be inferred to be a first value (eg, 0) without being encoded / decoded / acquired.
[0636] According to an embodiment, as an alternative to slice_alf_chroma_idc, slice_alf_cb_flag indicating whether adaptive in-loop filtering is performed on the Cb component and slice_alf_cr_flag indicating whether adaptive in-loop filtering is performed on the Cr component may be encoded / decoded / acquired. When slice_alf_cb_flag has a first value (e.g., 0), adaptive in-loop filtering may not be performed on the Cb component. In addition, when slice_alf_cb_flag has a second value (e.g., 1), adaptive in-loop filtering may be performed on the Cb component. When slice_alf_cr_flag has a first value (e.g., 0), adaptive in-loop filtering may not be performed on the Cr component. In addition, when slice_alf_cr_flag has a second value (e.g., 1), adaptive in-loop filtering may be performed on the Cr component. When slice_alf_cb_flag and slice_alf_cr_flag are not present in the bitstream, slice_alf_cb_flag and slice_alf_cr_flag may be inferred to be a first value (eg, 0).
[0637] According to an embodiment, a picture header or a slice header may include encoding information indicating whether adaptive in-loop filtering is performed on a slice included in a picture or a Cb component in a slice. In addition, when the encoding information of the picture header or the slice header allows adaptive in-loop filtering of the Cb component, slice_alf_cb_flag may be encoded / decoded / acquired. In addition, based on slice_alf_cb_flag, it may be determined whether the Cb component in the picture or the slice is filtered. If the encoding information of the picture header or the slice header does not allow adaptive in-loop filtering of the Cb component, slice_alf_cb_flag may not be encoded / decoded / acquired, and slice_alf_cb_flag may be inferred to be a first value (e.g., 0).
[0638] Similarly, a picture header or a slice header may include encoding information indicating whether adaptive in-loop filtering is performed on a slice included in a picture or a Cr component in a slice. In addition, when the encoding information of the picture header or the slice header allows adaptive in-loop filtering of Cr components, slice_alf_cr_flag may be encoded / decoded / acquired. In addition, based on slice_alf_cr_flag, it may be determined whether to filter the Cr components in the picture or the slice. If the encoding information of the picture header or the slice header does not allow adaptive in-loop filtering of Cr components, slice_alf_cr_flag may not be encoded / decoded / acquired, and slice_alf_cr_flag may be inferred to be a first value (e.g., 0).
[0639] slice_alf_cb_flag and slice_alf_cr_flag are examples of information indicating whether adaptive in-loop filtering is performed on chroma components, which is signaled in a slice, and when information indicating whether adaptive in-loop filtering is performed on chroma components in a picture is signaled, slice_alf_cb_flag and slice_alf_cr_flag may be changed to ph_alf_cb_flag and ph_alf_cr_flag.
[0640] slice_alf_aps_id_chroma may indicate an identifier of an adaptation parameter set referenced in a chroma component of a slice. That is, slice_alf_aps_id_chroma may indicate a slice chroma ALF set identifier indicating an adaptation parameter set for adaptive in-loop filtering referenced in a slice.
[0641] When at least one of slice_alf_cb_flag or slice_alf_cr_flag has a second value (eg, 1), slice_alf_aps_id_chroma may be encoded / decoded.
[0642] When slice_alf_aps_id_chroma is not present in the bitstream, slice_alf_aps_id_chroma may be inferred to be a first value (eg, 0).
[0643] Here, the temporal layer identifier of the adaptation parameter set having the same adaptation_parameter_set_id as slice_alf_aps_id_chroma may be less than or equal to the temporal layer identifier of the current slice.
[0644] In case of intra slices, slice_alf_aps_id_chroma or slice_alf_aps_id_chroma[i] may not refer to an adaptation parameter set for adaptive in-loop filtering for a picture other than an intra picture or a picture including an intra slice.
[0645] According to an embodiment, slice_alf_aps_id_chroma[i] may refer only to an adaptive parameter set including an adaptive in-loop filter set for chroma components.
[0646] In addition, slice_alf_aps_id_chroma[i] may be used instead of slice_alf_aps_id_chroma. That is, one of two or more adaptive parameter sets including adaptive in-loop filter information may be selected during adaptive in-loop filtering for chroma components. The adaptive in-loop filter information (slice_alf_aps_id_chroma[i]) in the adaptive parameter set may be used in adaptive in-loop filtering for chroma components.
[0647] slice_alf_aps_id_chroma[i] may represent an identifier of an i-th adaptation parameter set for adaptive in-loop filtering referenced in a slice. That is, slice_alf_aps_id_chroma[i] may represent a slice chroma ALF set identifier indicating an i-th adaptation parameter set for adaptive in-loop filtering referenced in a slice.
[0648] When slice_alf_aps_id_chroma[i] is not present in the bitstream, slice_alf_aps_id_chroma[i] may be inferred to be a first value (eg, 0).
[0649] Here, the temporal layer identifier of the adaptation parameter set having the same adaptation_parameter_set_id as slice_alf_aps_id_chroma[i] may be less than or equal to the temporal layer identifier of the current slice.
[0650] When two or more sub-pictures / slices / tile groups / tiles / partitions have the same adaptation_parameter_set_id in one picture and there are two or more adaptation parameter sets for adaptive in-loop filtering with the adaptation_parameter_set_id, the two or more adaptation parameter sets for adaptive in-loop filtering with the same adaptation_parameter_set_id may have the same data / content / syntax element value.
[0651] In case of intra slices, slice_alf_aps_id_chroma[i] may not refer to an adaptation parameter set for adaptive in-loop filtering for pictures other than intra pictures or pictures including intra slices.
[0652] When the adaptation parameter set type of the predetermined adaptation parameter set is a parameter for adaptive in-loop filtering (ALF type) and the adaptation parameter set identifier adaptation_parameter_set_id is equal to alf_aps_id_chroma or alf_aps_id_chroma[i] which is the identifier of the adaptation parameter set referenced in the current picture or picture header, the temporal layer identifier of the predetermined adaptation parameter set may be less than or equal to the temporal layer identifier of the current picture.
[0653] As in Figures 20a to 20d In the example of , alf_luma_filter_signal_flag may represent a luma ALF signaling flag indicating whether the adaptive in-loop filter set for the luma component is included in the adaptation parameter set. In addition, alf_luma_filter_signal_flag may represent a luma ALF signaling flag indicating whether the adaptive in-loop filter set for the luma component is encoded / decoded.
[0654] For example, when alf_luma_filter_signal_flag has a first value (e.g., 0), the adaptive in-loop filter set for the luma component may not be entropy encoded / decoded. When alf_luma_filter_signal_flag has a second value (e.g., 1), the adaptive in-loop filter set for the luma component may be entropy encoded / decoded.
[0655] When alf_luma_filter_signal_flag is not present in the bitstream, alf_luma_filter_signal_flag may be inferred to be a first value (eg, 0).
[0656] In an embodiment, when the chroma component presence information encoded / decoded / acquired in the adaptive parameter set indicates that information about the chroma component is not included in the adaptive parameter set, alf_luma_filter_signal_flag may not be included in the adaptive in-loop filter data and may be inferred to be a second value (e.g., 1). That is, alf_luma_filter_signal_flag may not be encoded / decoded in the adaptive in-loop filter data.
[0657] In addition, when the chroma component presence information indicates that information about the chroma component is included in the adaptive parameter set, alf_luma_filter_signal_flag may be included in the adaptive in-loop filter data. That is, alf_luma_filter_signal_flag may be encoded / decoded in the adaptive in-loop filter data.
[0658] When the adaptation parameter set type of the predetermined adaptation parameter set is a parameter for adaptive in-loop filtering (ALF type) and the adaptation parameter set identifier adaptation_parameter_set_id is equal to slice_alf_aps_id_luma[i], the luma ALF signaling flag alf_luma_filter_signal_flag may be determined to be a second value (e.g., 1). That is, when the parameters for adaptive in-loop filtering exist in the adaptation parameter set and the adaptation parameter set is referenced in the current picture or the current slice, since adaptive in-loop filter information for the luma component is signaled, the luma ALF signaling flag (alf_luma_filter_signal_flag) may have a second value (e.g., 1).
[0659] alf_chroma_filter_signal_flag may represent a chroma ALF signaling flag indicating whether the adaptive in-loop filter set for the chroma component is included in the adaptation parameter set. In addition, alf_chroma_filter_signal_flag may represent a chroma ALF signaling flag indicating whether the adaptive in-loop filter set for the chroma component is encoded / decoded.
[0660] For example, when alf_chroma_filter_signal_flag has a first value (e.g., 0), the adaptive in-loop filter set for the chroma component may not be entropy encoded / decoded. In addition, when alf_chroma_filter_signal_flag has a second value (e.g., 1), the adaptive in-loop filter set for the chroma component may be entropy encoded / decoded.
[0661] When alf_chroma_filter_signal_flag is not present in the bitstream, alf_chroma_filter_signal_flag may be inferred to be a first value (eg, 0).
[0662] When the adaptation parameter set type of the predetermined adaptation parameter set is a parameter for adaptive in-loop filtering (ALF type) and the adaptation parameter set identifier adaptation_parameter_set_id is equal to slice_alf_aps_id_chroma or slice_alf_aps_id_chroma[i], the chroma ALF signaling flag alf_chroma_filter_signal_flag may be determined to be a second value (e.g., 1). That is, when the parameters for adaptive in-loop filtering exist in the adaptation parameter set and the adaptation parameter set is referenced in the current picture or the current slice, since adaptive in-loop filter information of the chroma component is signaled, the chroma ALF signaling flag alf_chroma_filter_signal_flag may have a second value (e.g., 1).
[0663] NumAlfFilters, which is the maximum value of the number of different adaptive in-loop filters included in the adaptive in-loop filter set, may be N. Here, N may be a positive integer and may be, for example, 25.
[0664] alf_luma_clip_flag may be a luma clipping flag, where the luma clipping flag indicates whether linear adaptive in-loop filtering or nonlinear adaptive in-loop filtering is performed on the luma component.
[0665] For example, when alf_luma_clip_flag has a first value (eg, 0), linear adaptive in-loop filtering may be performed on the luma component. In addition, when alf_luma_clip_flag has a second value (eg, 1), nonlinear adaptive in-loop filtering may be performed on the luma component.
[0666] When alf_luma_clip_flag is not present in the bitstream, alf_luma_clip_flag may be inferred to be a first value (eg, 0).
[0667] alf_luma_num_filters_signalled_minus1 may represent luma signaling ALF number information indicating the number of luma ALFs signaled. In addition, a value of alf_luma_num_filters_signalled_minus1+1 may represent the number of luma signaling ALFs.
[0668] alf_luma_num_filters_signalled_minus1 may have a value from 0 to NumAlfFilters-N. Here, N may be a positive integer, and may be 1, for example.
[0669] When alf_luma_num_filters_signalled_minus1 is not present in the bitstream, alf_luma_num_filters_signalled_minus1 may be inferred to have the value 0.
[0670] alf_luma_coeff_delta_idx[filtIdx] may indicate the index of the luma signaling adaptive in-loop filter referenced by the luma adaptive in-loop filter corresponding to filtIdx. alf_luma_coeff_delta_idx[filtIdx] may represent the luma ALF delta index. The luma ALF delta index may represent the filter coefficient difference index for the luma component.
[0671] filtIdx may have a value from 0 to NumAlfFilters - N. Here, N may be a positive integer and may be, for example, 1.
[0672] When alf_luma_coeff_delta_idx[filtIdx] is not present in the bitstream, alf_luma_coeff_delta_idx[filtIdx] may be inferred to have a value of 0.
[0673] alf_luma_use_fixed_filter_flag may indicate whether a fixed filter is used when the adaptive in-loop filter coefficients are signaled.
[0674] For example, when alf_luma_use_fixed_filter_flag has a first value (e.g., 0), a fixed filter may not be used when adaptive in-loop filter coefficients are signaled. In addition, when alf_luma_use_fixed_filter_flag has a second value (e.g., 1), a fixed filter may be used when adaptive in-loop filter coefficients are signaled.
[0675] When alf_luma_use_fixed_filter_flag is not present in the bitstream, alf_luma_use_fixed_filter_flag may be inferred to be a first value (eg, 0).
[0676] alf_luma_fixed_filter_set_idx may represent a fixed filter set index.
[0677] alf_luma_fixed_filter_set_idx may have a value from 0 to N. Here, N may be a positive integer and may be, for example, 15.
[0678] When alf_luma_fixed_filter_set_idx is not present in the bitstream, alf_luma_fixed_filter_set_idx may be inferred to have a value of 0.
[0679] alf_luma_fixed_filter_pred_present_flag may indicate whether alf_luma_fixed_filter_pred_flag[i] is present in the bitstream.
[0680] For example, when alf_luma_fixed_filter_pred_present_flag has a first value (eg, 0), alf_luma_fixed_filter_pred_flag[i] may not be present in the bitstream. In addition, when alf_luma_fixed_filter_pred_present_flag has a second value (eg, 1), alf_luma_fixed_filter_pred_flag[i] may be present in the bitstream.
[0681] In addition, alf_luma_fixed_filter_pred_present_flag may indicate whether all adaptive in-loop filter coefficient types for the luma component are predicted from a fixed filter and signaled. For example, when alf_luma_fixed_filter_pred_present_flag has a first value (e.g., 0), all adaptive in-loop filter coefficient types for the luma component may not be predicted from a fixed filter and signaled. When alf_luma_fixed_filter_pred_present_flag has a second value (e.g., 1), at least one of the adaptive in-loop filter coefficient types for the luma component may be predicted from a fixed filter and signaled.
[0682] When alf_luma_fixed_filter_pred_present_flag is not present in the bitstream, alf_luma_fixed_filter_pred_present_flag may be inferred to be a first value (eg, 0).
[0683] alf_luma_fixed_filter_pred_flag[i] may indicate whether the i-th adaptive in-loop filter coefficient category (type) is predicted from a fixed filter and signaled.
[0684] For example, when alf_luma_fixed_filter_pred_flag[i] has a first value (e.g., 0), the i-th adaptive in-loop filter coefficient category (type) may not be predicted from the fixed filter. Furthermore, when alf_luma_fixed_filter_pred_flag[i] has a second value (e.g., 1), the i-th adaptive in-loop filter coefficient category (type) may be predicted from the fixed filter.
[0685] When alf_luma_fixed_filter_pred_flag[i] is not present in the bitstream, alf_luma_fixed_filter_pred_flag[i] may be inferred to be the second value (eg, 1).
[0686] According to an embodiment, Figures 20a to 20d Unlike the adaptive in-loop filter data syntax, the information about the fixed filter (alf_luma_use_fixed_filter_flag, alf_luma_fixed_filter_set_idx, alf_luma_fixed_filter_pred_present_flag, and alf_luma_fixed_filter_pred_flag) may not be included. Therefore, information about the fixed filter may not be signaled. Therefore, in the encoder / decoder, a predetermined fixed filter may be used in adaptive in-loop filtering. In addition, the filter coefficients may not be predicted and signaled from the fixed filter. In the encoder / decoder, only the predetermined fixed filter may be used in adaptive in-loop filtering, and the filter coefficients predicted from the fixed filter may not be used in adaptive in-loop filtering.
[0687] alf_luma_coeff_delta_flag may indicate whether alf_luma_coeff_delta_prediction_flag is signaled.
[0688] For example, when alf_luma_coeff_delta_flag has a first value (eg, 0), alf_luma_coeff_delta_prediction_flag may be signaled, and when alf_luma_coeff_delta_flag has a second value (eg, 1), alf_luma_coeff_delta_prediction_flag may not be signaled.
[0689] When alf_luma_coeff_delta_flag is not present in the bitstream, alf_luma_coeff_delta_flag may be inferred to be a second value (eg, 1).
[0690] alf_luma_coeff_delta_prediction_flag may indicate whether the signaled adaptive in-loop filter coefficients for the luma component are predicted from previously signaled adaptive in-loop filter coefficients for the luma component.
[0691] For example, when alf_luma_coeff_delta_prediction_flag has a first value (e.g., 0), the signaled adaptive in-loop filter coefficient for the luma component may not be predicted from the previously signaled adaptive in-loop filter coefficient for the luma component. In addition, when alf_luma_coeff_delta_prediction_flag has a second value (e.g., 1), the signaled adaptive in-loop filter coefficient for the luma component may be predicted from the previously signaled adaptive in-loop filter coefficient for the luma component.
[0692] When alf_luma_coeff_delta_prediction_flag is not present in the bitstream, alf_luma_coeff_delta_prediction_flag may be inferred to be a first value (eg, 0).
[0693] The value of alf_luma_min_eg_order_minus1+1 may represent the minimum order of the exponential Golomb code used when the adaptive in-loop filter coefficients for the luma component are signaled.
[0694] alf_luma_eg_order_increase_flag[i] may indicate that the order of the exponential Golomb code used when the adaptive in-loop filter coefficients for the luma component are signaled is increased by 1.
[0695] The order expGoOrderY[i] of the exponential Golomb code used for entropy encoding / decoding the value of alf_luma_coeff_delta_abs[sfIdx][j] may be derived as follows.
[0696] expGoOrderY[i]=(i==0?alf_luma_min_eg_order_minus1+1:expGoOrderY[i-1])+alf_luma_eg_order_increase_flag[i]
[0697] alf_luma_coeff_flag[sfIdx] may indicate whether the adaptive in-loop filter for the luma component indicated by sfIdx is signaled.
[0698] For example, when alf_luma_coeff_flag[sfIdx] has a first value (e.g., 0), the adaptive in-loop filter for the luma component indicated by sfIdx may be set to a value of 0. Also, when alf_luma_coeff_flag[sfIdx] has a second value (e.g., 1), the adaptive in-loop filter for the luma component indicated by sfIdx may be signaled.
[0699] When alf_luma_coeff_flag[sfIdx] is not present in the bitstream, alf_luma_coeff_flag[sfIdx] may be inferred to be a second value (eg, 1).
[0700] According to an embodiment, Figures 20a to 20d Unlike, alf_luma_coeff_flag[sfIdx] may not be included in the adaptive in-loop filter data syntax. That is, alf_luma_coeff_flag[sfIdx] may not be encoded / decoded in the adaptive in-loop filter data syntax. Therefore, it can be determined that the coefficient information of the adaptive in-loop filter is encoded / decoded / acquired without encoding / decoding / acquiring alf_luma_coeff_flag[sfIdx].
[0701] alf_luma_coeff_delta_abs[sfIdx][j] may represent an absolute value of a j-th coefficient difference (delta) of the adaptive in-loop filter for the luma component indicated by sfIdx.
[0702] When alf_luma_coeff_delta_abs[sfIdx][j] is not present in the bitstream, alf_luma_coeff_delta_abs[sfIdx][j] may be inferred to have the value 0.
[0703] The order k of the exponential Golomb code (binarization) uek(v) can be derived as follows.
[0704] golombOrderIdxY[]={0,0,1,0,0,1,2,1,0,0,1,2}
[0705] k=expGoOrderY[golombOrderIdxY[j]]
[0706] According to an embodiment, the order k of the exponential Golomb code uek(v) used for entropy encoding / decoding / binarization of alf_luma_coeff_delta_abs[sfIdx][j] may be fixed to 0. Therefore, for entropy encoding / decoding / binarization of alf_luma_coeff_delta_abs[sfIdx][j], the 0-order exponential Golomb code ue(v) is available. The value of alf_luma_coeff_delta_abs[sfIdx][j] may be a positive integer including 0 and may have a value within a range from 0 to 128.
[0707] alf_luma_coeff_delta_sign[sfIdx][j] may represent the sign of the j-th coefficient or coefficient difference of the adaptive in-loop filter for the luma component indicated by sfIdx. In addition, alf_luma_coeff_delta_sign[sfIdx][j] may be derived as follows.
[0708] When alf_luma_coeff_delta_sign[sfIdx][j] has a first value (eg, 0), the adaptive filter coefficient or coefficient difference for the corresponding luma component may have a positive sign.
[0709] When alf_luma_coeff_delta_sign[sfIdx][j] has a second value (eg, 1), the adaptive filter coefficient or coefficient difference for the corresponding luma component may have a negative sign.
[0710] When alf_luma_coeff_delta_sign[sfIdx][j] is not present in the bitstream, alf_luma_coeff_delta_sign[sfIdx][j] may be inferred to be a first value (eg, 0).
[0711] According to an embodiment, the value of the filter coefficient can be directly sent with a signal instead of the coefficient difference of the adaptive loop filter. For example, the sign information and absolute value information of the filter coefficient can be included in the adaptive loop filter data syntax. That is to say, the sign information and absolute value information of the filter coefficient can be encoded / decoded in the adaptive loop filter data syntax. For the encoding / decoding of the absolute value information of the filter coefficient, the 0th order exponential Golomb code ue(v) can be used. The value of the absolute value information of the filter coefficient can be a positive integer including 0, and can have a value within the range of 0 to 128. The filter coefficient of the adaptive loop filter may include at least one of the filter coefficient of the adaptive loop filter for the luminance component or the filter coefficient of the adaptive loop filter for the chrominance component.
[0712] filtCoeff[sfIdx][j] as the luma signaling ALF may be derived as follows: At this time, sfIdx may have a value from 0 to alf_luma_num_filters_signalled_minus1. Also, j may have a value from 0 to N. Here, N may be a positive integer, and may be, for example, 11.
[0713] filtCoeff[sfIdx][j]=alf_luma_coeff_delta_abs[sfIdx][j]*(1-2*alf_luma_coeff_delta_sign[sfIdx][j])
[0714] When alf_luma_coeff_delta_prediction_flag has a first value (e.g., 1), filtCoeff[sfIdx][j] may be derived as follows. At this time, sfIdx may have a value from 1 to alf_luma_num_filters_signalled_minus1. Furthermore, j may have a value from 0 to N. Here, N may be a positive integer, and may be, for example, 11.
[0715] filtCoeff[sfIdx][j]+=filtCoeff[sfIdx-1][j]
[0716] According to an embodiment, Figures 20a to 20dUnlike the alf_luma_coeff_delta_prediction_flag, the alf_luma_coeff_delta_prediction_flag may not be included in the adaptive in-loop filter data syntax. That is, the alf_luma_coeff_delta_prediction_flag may not be encoded / decoded in the adaptive in-loop filter data syntax. Therefore, the luma component filter coefficient difference value of the adaptive in-loop filter may be directly signaled without being predictively encoded / decoded.
[0717] The adaptive in-loop filter coefficient AlfCoeffL[adaptation_parameter_set_id][filtIdx][j] for the luma component may be derived as follows. At this time, filtIdx may have a value from 0 to NumAlfFilters-1. Furthermore, j may have a value from 0 to N. Here, N may be a positive integer and may be, for example, 11.
[0718] AlfCoeffL[adaptation_parameter_set_id][filtIdx][j]=filtCoeff[alf_luma_coeff_delta_idx[filtIdx]][j]
[0719] When alf_luma_use_fixed_filter_flag has the second value (e.g., 1) and alf_luma_fixed_filter_pred_flag[filtIdx] has the second value (e.g., 1), AlfCoeffL[adaptation_parameter_set_id][filtIdx][j] may be derived as in the following example. In this case, filtIdx may have a value from 0 to NumAlfFilters-1. In addition, j may have a value from 0 to N. Here, N may be a positive integer and may be, for example, 11.
[0720] Alf Coeff L [adaptation_parameter_set_id][filtIdx][j]+=
[0721] AlfFixFiltCoeff[AlfClassToFiltMap[alf_luma_fixed_filter_set_idx][filtIdx]][j]
[0722] But as in Figure 22a and Figure 22bIn the example of , the fixed filter coefficients AlfFixFiltCoeff[i][j] are derived. At this time, i can have a value from 0 to imax. In addition, j can have a value from 0 to N. Here, imax can be a positive integer and can be, for example, 64. Here, N can be a positive integer and can be, for example, 11.
[0723] But as in Figure 23 In the example of , the mapping relationship between the adaptive in-loop filter coefficient class and the filter is derived AlfClassToFiltMap[m][n]. In this case, m can have a value from 0 to mmax. In addition, n can have a value from 0 to nmax. Here, mmax can be a positive integer and can be, for example, 15. Here, nmax can be a positive integer and can be, for example, 24.
[0724] AlfCoeffL[adaptation_parameter_set_id][filtIdx][j] can have values from -2 M to 2 M In this case, filtIdx may have a value from 0 to NumAlfFilters-1. In addition, j may have a value from 0 to N. Here, N may be a positive integer and may be, for example, 11. In this case, M may be a positive integer and may be, for example, 7.
[0725] The value of alf_luma_clip_min_eg_order_minus1+1 may represent the minimum order of the exponential Golomb code used when the adaptive in-loop filter clipping index for the luma component is signaled. In the case of a nonlinear adaptive in-loop filter, the clipping index may be signaled or used.
[0726] alf_luma_clip_eg_order_increase_flag[i] may indicate whether the order of the exponential Golomb code used when the adaptive in-loop filter clipping index for the luma component is signaled is increased by 1.
[0727] The order kClipY[i] of the exponential Golomb code used for entropy encoding / decoding alf_luma_clip_idx[sfIdx][j] may be derived as follows.
[0728] kClipY[i]=(i==0?alf_luma_clip_min_eg_order_minus1+1:kClipY[i-1])+alf_luma_clip_eg_order_increase_flag[i]
[0729] alf_luma_clip_idx[sfIdx][j] may represent a luma clipping index for a clipping value before multiplying the j-th coefficient of the adaptive in-loop filter for the luma component indicated by sfIdx by the reconstructed / decoded sample. The clipping value may be determined by the luma clipping index indicated by alf_luma_clip_idx[sfIdx][j] and the bit depth of the image. Here, the bit depth may represent a bit depth determined in at least one of a sequence, a picture, a slice, a tile group, a tile, or a CTU unit.
[0730] When alf_luma_clip_idx[sfIdx][j] is not present in the bitstream, alf_luma_clip_idx[sfIdx][j] may be inferred to be a first value (eg, 0).
[0731] alf_luma_clip_idx[sfIdx][j] may have a value from 0 to M. Here, M may be a positive integer, for example, 3. At this time, sfIdx may have a value from 0 to alf_luma_num_filters_signalled_minus1. Also, j may have a value from 0 to N. Here, N may be a positive integer, for example, 11.
[0732] The order k of the exponential Golomb code (binarization) uek(v) can be derived as follows.
[0733] k=kClipY[golombOrderIdxY[j]]
[0734] filterClips[sfIdx][j] may be derived as follows: At this time, sfIdx may have a value from 0 to alf_luma_num_filters_signalled_minus1. Also, j may have a value from 0 to N. Here, N may be a positive integer, and may be, for example, 11.
[0735] filterClips[sfIdx][j]=Round(2(BitDepthY*(M+1-alf_luma_clip_idx[sfIdx][j]) / (M+1)) or filterClips[sfIdx][j]=Round(2(BitDepthY-8)*2(8*(M-alf_luma_clip_idx[sfIdx][j]) / M))
[0736] Here, BitDepthY may represent an input bit depth / depth for a luma component. Here, the bit depth may represent a bit depth determined in at least one of a sequence, a picture, a slice, a tile group, a tile, or a CTU unit.
[0737] Here, M may be a positive integer, and may be, for example, 3. Also, M may represent a maximum value of alf_luma_clip_idx[sfIdx][j].
[0738] The adaptive in-loop filter clipping value AlfClipL[adaptation_parameter_set_id][filtIdx][j] for the luma component may be derived as follows. At this time, filtIdx may have a value from 0 to NumAlfFilters-1. Furthermore, j may have a value from 0 to N. Here, N may be a positive integer and may be, for example, 11.
[0739] AlfClipL[adaptation_parameter_set_id][filtIdx][j]=filterClips[alf_luma_coeff_delta_idx[filtIdx]][j]
[0740] If the range of the value of the exponential Golomb code used in alf_luma_clip_idx[sfIdx][j] is large, the exponential Golomb code used in alf_luma_clip_idx[sfIdx][j] can be efficiently entropy encoded / decoded. However, as in the above example, when the range of the value of alf_luma_clip_idx[sfIdx][j] (from 0 to 3) is relatively small, the exponential Golomb code used in alf_luma_clip_idx[sfIdx][j] may be inefficient in terms of entropy encoding / decoding.
[0741] Therefore, instead of using at least one of alf_luma_clip_min_eg_order_minus1 or alf_luma_clip_eg_order_increase_flag[i], if the range of values of alf_luma_clip_idx[sfIdx][j] (from 0 to 3) is relatively small, alf_luma_clip_idx[sfIdx][j] may be entropy encoded / decoded using the entropy encoding / decoding method of at least one of tu(3), f(2), u(2), or tb(3).
[0742] alf_chroma_clip_flag may be a chroma clipping flag indicating whether linear or nonlinear adaptive in-loop filtering is performed on the chroma components. That is, alf_chroma_clip_flag is not signaled and applied for each signaled chroma ALF, but may be signaled and applied only once for all signaled chroma ALFs. In this case, the chroma ALF may indicate an adaptive in-loop filter for the chroma components.
[0743] For example, when alf_chroma_clip_flag has a first value (eg, 0), linear adaptive in-loop filtering may be performed on the chroma component. In addition, when alf_chroma_clip_flag has a second value (eg, 1), nonlinear adaptive in-loop filtering may be performed on the chroma component.
[0744] When alf_chroma_clip_flag is not present in the bitstream, alf_chroma_clip_flag may be inferred to be a first value (eg, 0).
[0745] The value of alf_chroma_min_eg_order_minus1+1 may represent the minimum order of the exponential Golomb code used when adaptive in-loop filter coefficients for chroma components are signaled.
[0746] alf_chroma_eg_order_increase_flag[i] may indicate whether the order of the exponential Golomb code used when the adaptive in-loop filter coefficients for the chroma component are signaled is increased by 1.
[0747] The order expGoOrderC[i] of the exponential Golomb code used for entropy encoding / decoding the value of alf_chroma_coeff_abs[j] may be derived as follows.
[0748] expGoOrderC[i]=(i==0?alf_chroma_min_eg_order_minus1+1:expGoOrderC[i-1])+alf_chroma_eg_order_increase_flag[i]
[0749] alf_chroma_coeff_abs[j] may represent the absolute value of the j-th coefficient of the adaptive in-loop filter for the chroma component.
[0750] When alf_chroma_coeff_abs[j] is not present in the bitstream, alf_chroma_coeff_abs[j] may be inferred to have the value 0.
[0751] alf_chroma_coeff_abs[j] can have a value from 0 to 2 M At this time, M may be a positive integer, and may be, for example, 7.
[0752] The order k of the exponential Golomb code (binarization) uek(v) can be derived as follows.
[0753] golombOrderIdxC[]={0,0,1,0,0,1}
[0754] k=expGoOrderC[golombOrderIdxC[j]]
[0755] According to an embodiment, the order k of the exponential Golomb code uek(v) used for entropy encoding / decoding / binarization of alf_chroma_coeff_abs[j] may be fixed to 0. Therefore, the 0-order exponential Golomb code ue(v) may be used for entropy encoding / decoding / binarization of alf_chroma_coeff_abs[j]. The value of alf_chroma_coeff_abs[j] may be a positive integer including 0 and may have a value within a range from 0 to 128.
[0756] alf_chroma_coeff_sign[j] may represent the sign of the j-th coefficient or coefficient difference of the adaptive in-loop filter for the chroma component. In addition, alf_chroma_coeff_sign[j] may be derived as follows.
[0757] When alf_chroma_coeff_sign[j] has a first value (eg, 0), the adaptive in-loop filter coefficient or coefficient difference for the corresponding chroma component may have a positive sign.
[0758] When alf_chroma_coeff_sign[j] has a second value (eg, 1), the adaptive in-loop filter coefficient or coefficient difference for the corresponding chroma component may have a negative sign.
[0759] When alf_chroma_coeff_sign[j] is not present in the bitstream, alf_chroma_coeff_sign[j] may be inferred to be a first value (eg, 0).
[0760] An adaptive in-loop filter for a chroma component coefficient (chroma signaling ALF) AlfCoeffC[adaptation_parameter_set_id][j] may be derived as follows: At this time, j may have a value from 0 to N. Here, N may be a positive integer, and may be, for example, 5.
[0761] AlfCoeffC[adaptation_parameter_set_id][j]=alf_chroma_coeff_abs[j]*(1-2*alf_chroma_coeff_sign[j])
[0762] AlfCoeffC[adaptation_parameter_set_id][j] can have values from -2 M -1 to 2 M At this time, j may have a value from 0 to N. Here, N may be a positive integer, and may be, for example, 5. At this time, M may be a positive integer, and may be, for example, 7. Alternatively, AlfCoeffC[adaptation_parameter_set_id][j] may have a value from -2^M to 2^M-1.
[0763] The value of alf_chroma_clip_min_eg_order_minus1+1 may represent the minimum order of the exponential Golomb code used when the adaptive in-loop filter clipping index for the chroma component is signaled.In the case of a nonlinear adaptive in-loop filter, the clipping index may be signaled or used.
[0764] alf_chroma_clip_eg_order_increase_flag[i] may indicate whether the order of the exponential Golomb code used when the adaptive in-loop filter clipping index for the chroma component is signaled is increased by 1.
[0765] The order kClipC[i] of the exponential Golomb code used for entropy encoding / decoding alf_chroma_clip_idx[j] may be derived as follows.
[0766] kClipC[i]=(i==0?alf_chroma_clip_min_eg_order_minus1+1:kClipC[i-1])+alf_chroma_clip_eg_order_increase_flag[i]
[0767] alf_chroma_clip_idx[j] may indicate a chroma clipping index for a clipping value used to perform clipping before multiplying the j-th coefficient of the adaptive in-loop filter for the chroma component by the reconstructed / decoded samples. The clipping value may be determined by the chroma clipping index indicated by alf_chroma_clip_idx[j] and the bit depth of the image. Here, the bit depth may indicate a bit depth determined in at least one of a sequence, a picture, a slice, a tile group, a tile, or a CTU unit.
[0768] When alf_chroma_clip_idx[j] is not present in the bitstream, alf_chroma_clip_idx[j] may be inferred to be a first value (eg, 0).
[0769] alf_chroma_clip_idx[j] may have a value from 0 to M. Here, M may be a positive integer, and may be, for example, 3. At this time, j may have a value from 0 to N. Here, N may be a positive integer, and may be, for example, 5.
[0770] The order k of the exponential Golomb code (binarization) uek(v) can be derived as follows.
[0771] k=kClipC[golombOrderIdxC[j]]
[0772] According to an embodiment, the clipping value indicated by the clipping index of the chroma component may be determined using the same method as the clipping value indicated by the clipping index of the luma component. That is, the clipping value for the chroma component and the clipping value for the luma component may be determined using the same method based on at least one of the clipping index or the bit depth. For example, the clipping value when the clipping index of the chroma component is 3 may be determined to be the same as the clipping value when the clipping index of the luma component is 3. Therefore, when the clipping index and the bit depth are the same, the clipping process for the luma component samples and the clipping process for the chroma component samples may be performed based on the same clipping value.
[0773] In addition, the cropping value can be set based on the bit depth. For example, the cropping value can be set to a value of 2<<(BitDepth-N). Here, N can be a positive integer including 0. N can be determined based on the cropping index value. As the cropping index increases, N can increase. Here, BitDepth can represent the bit depth.
[0774] The adaptive in-loop filter clipping value AlfClipC[adaptation_parameter_set_id][j] for the chroma component may be derived as follows: At this time, j may have a value from 0 to N. Here, N may be a positive integer, and may be 5, for example.
[0775] AlfClipC[adaptation_parameter_set_id][j]=Round(2 (BitDepthC-8) *2 (8*(M- alf_chroma_clip_idx[j]) / M)) or AlfClipC[adaptation_parameter_set_id][j]=Round(2 (BitDepthC*(M+1-alf_chroma_clip_idx[j]) / (M+1) )
[0776] Here, BitDepthC may represent an input bit depth / depth for a chroma component. Here, the bit depth may represent a bit depth determined in at least one of a sequence, a picture, a slice, a tile group, a tile, or a CTU unit.
[0777] Here, M may be a positive integer, and may be, for example, 3. Also, M may represent a maximum value of alf_chroma_clip_idx[j].
[0778] If the range of the value of the exponential Golomb code used in alf_chroma_clip_idx[j] is large, the exponential Golomb code used in alf_chroma_clip_idx[j] can be efficiently entropy encoded / decoded. However, as in the above example, when the range of the value of alf_chroma_clip_idx[j] (from 0 to 3) is relatively small, the exponential Golomb code used in alf_chroma_clip_idx[j] may be inefficient in terms of entropy encoding / decoding.
[0779] Therefore, instead of using at least one of the syntax elements alf_chroma_clip_min_eg_order_minus1 or alf_chroma_clip_eg_order_increase_flag[i], if the range of values of alf_chroma_clip_idx[j] (from 0 to 3) is relatively small, alf_chroma_clip_idx[j] may be entropy encoded / decoded using the entropy encoding / decoding method of at least one of tu(3), f(2), u(2), or tb(3).
[0780] As in Figure 21 In the example of , alf_ctb_flag[cIdx][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may indicate whether adaptive in-loop filtering is used in the color component (Y, Cb, or Cr) coding tree block indicated by cIdx at the luma component position (xCtb, yCtb).
[0781] For example, alf_ctb_flag[0][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be a first ALF coding tree block flag indicating whether adaptive in-loop filtering is applied to luma samples of the current coding tree block. When alf_ctb_flag[0][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] has a first value (e.g., 0), adaptive in-loop filtering may not be applied to the luma component coding tree block at the luma component position (xCtb, yCtb). Additionally, when alf_ctb_flag[0][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] has a second value (e.g., 1), adaptive in-loop filtering may be applied to the luma component coding tree block at the luma component position (xCtb, yCtb).
[0782] When alf_ctb_flag[0][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] is not present in the bitstream, alf_ctb_flag[0][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be inferred to be a first value (eg, 0).
[0783] For example, alf_ctb_flag[1][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be a second ALF coding tree block flag indicating whether adaptive in-loop filtering is applied to the Cb samples of the current coding tree block. When alf_ctb_flag[1][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] has a first value (e.g., 0), adaptive in-loop filtering may not be applied to the Cb component coding tree block at the luma component position (xCtb, yCtb). In addition, when alf_ctb_flag[1][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] has a second value (e.g., 1), adaptive in-loop filtering may be applied to the Cb component coding tree block at the luma component position (xCtb, yCtb).
[0784] When alf_ctb_flag[1][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] is not present in the bitstream, alf_ctb_flag[1][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be inferred to be a first value (eg, 0).
[0785] For example, alf_ctb_flag[2][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be a third ALF coding tree block flag indicating whether adaptive in-loop filtering is applied to Cr samples of the current coding tree block. When alf_ctb_flag[2][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] has a first value (e.g., 0), adaptive in-loop filtering may not be used in the Cr coding tree block at the luma component position (xCtb, yCtb). In addition, when alf_ctb_flag[2][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] has a second value (e.g., 1), adaptive in-loop filtering may be used in the Cr coding tree block at the luma component position (xCtb, yCtb).
[0786] When alf_ctb_flag[2][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] is not present in the bitstream, alf_ctb_flag[2][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be inferred to be a first value (eg, 0).
[0787] alf_ctb_use_first_aps_flag may indicate whether adaptive in-loop filter information in an adaptation parameter set indicated by adaptation_parameter_set_id having the same value as slice_alf_aps_id_luma[0] is used.
[0788] For example, when alf_ctb_use_first_aps_flag has a first value (e.g., 0), the adaptive in-loop filter information in the adaptation parameter set indicated by the adaptation_parameter_set_id having the same value as slice_alf_aps_id_luma[0] may not be used. In addition, when alf_ctb_use_first_aps_flag has a second value (e.g., 1), the adaptive in-loop filter information in the adaptation parameter set indicated by the adaptation_parameter_set_id having the same value as slice_alf_aps_id_luma[0] may be used.
[0789] When alf_ctb_use_first_aps_flag is not present in the bitstream, alf_ctb_use_first_aps_flag may be inferred to be a first value (eg, 0).
[0790] According to an embodiment, Figure 21 Unlike the example of , alf_ctb_use_first_aps_flag may not be included in the adaptive in-loop filter data syntax. That is, alf_ctb_use_first_aps_flag may not be encoded / decoded in the adaptive in-loop filter data syntax. Therefore, without encoding / decoding / obtaining alf_ctb_use_first_aps_flag, alf_luma_prev_filter_idx may be used to determine the adaptive in-loop filter set applied to the current luma coding tree block.
[0791] alf_use_aps_flag may represent an adaptation parameter set application flag indicating whether an ALF set of an adaptation parameter set is applied to a current coding tree block.
[0792] For example, when alf_use_aps_flag has a first value (e.g., 0), at least one fixed filter among the fixed filters may be used in the luma component coding tree block. That is, at least one fixed filter in the fixed ALF set may be used in the current coding tree block. Furthermore, when alf_use_aps_flag has a second value (e.g., 1), adaptive in-loop filter information in at least one adaptive parameter set may be used in the luma component coding tree block.
[0793] When alf_use_aps_flag is not present in the bitstream, alf_use_aps_flag may be inferred to be a first value (eg, 0).
[0794] The value of alf_luma_prev_filter_idx_minus1 may represent an index indicating which adaptive in-loop filter information in an adaptive parameter set used in at least one picture / sub-picture / slice / tile / partition of a previous picture is used.
[0795] alf_luma_prev_filter_idx_minus1 may have a value from 0 to slice_num_alf_aps_ids_luma-N. Here, N may be a positive integer and may be, for example, 1. Figure 21Since alf_ctb_use_first_aps_flag indicates whether the index value of the adaptive in-loop filter applied to the current coding tree block is 1, alf_luma_prev_filter_idx_minus1 indicates one of at least two adaptive in-loop filters with index values of 2 or greater. Therefore, N may be determined to be 2. Therefore, when slice_num_alf_aps_ids_luma is 2 and the number of adaptive in-loop filters with index values of 2 or greater is 1, alf_luma_prev_filter_idx_minus1 may not be signaled.
[0796] When alf_luma_prev_filter_idx_minus1 is not present in the bitstream, alf_luma_prev_filter_idx_minus1 may be inferred to have the value 0.
[0797] According to an embodiment, Figure 21 Unlike the example of , when alf_ctb_use_first_aps_flag is not included in the syntax structure of the coding tree block, alf_luma_prev_filter_idx may be included in the syntax structure of the coding tree block instead of alf_luma_prev_filter_idx_minus1. That is, alf_luma_prev_filter_idx may be encoded / decoded in the syntax structure of the coding tree block. alf_luma_prev_filter_idx may represent an index indicating which adaptive in-loop filter information in the adaptive parameter set used in at least one picture / sub-picture / slice / tile group / partition in the previous picture / sub-picture / slice / tile group / partition is used.
[0798] alf_luma_prev_filter_idx may have a value from 0 to slice_num_alf_aps_ids_luma-N. Here, N may be a positive integer and may be, for example, 1. When alf_ctb_use_first_aps_flag is not included in the syntax structure of the coding tree block, alf_luma_prev_filter_idx indicates one of the at least two adaptive in-loop filters, regardless of the index value. Therefore, N may be determined to be 1. Therefore, when slice_num_alf_aps_ids_luma is 1, since the total number of adaptive in-loop filters is 1, alf_luma_prev_filter_idx_minus1 may not be signaled.
[0799] When at least one of a case where alf_use_aps_flag has the second value (for example, 1) or a case where slice_num_alf_aps_ids_luma is 2 or greater is satisfied, alf_luma_prev_filter_idx may be encoded / decoded.
[0800] When alf_luma_prev_filter_idx is not present in the bitstream, alf_luma_prev_filter_idx may be inferred to have the value 0.
[0801] The adaptive in-loop filter index AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] used in the luma component coding tree block at the luma component position (xCtb, yCtb) may be derived as follows.
[0802] When alf_ctb_use_first_aps_flag has the second value (e.g., 1), AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be determined to be a value F. Furthermore, F may represent the maximum number of fixed filters used in the encoder / decoder. That is, F may be the maximum value of alf_luma_fixed_filter_idx+1.
[0803] When alf_ctb_use_first_aps_flag has the first value (eg, 0) and alf_use_aps_flag has the first value (eg, 0), AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be determined as alf_luma_fixed_filter_idx.
[0804] In other cases, when (alf_ctb_use_first_aps_flag has a first value (eg, 0) and alf_use_aps_flag has a second value (eg, 1)), AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be determined as 17+alf_luma_prev_filter_idx_minus1.
[0805] Alternatively, the adaptive in-loop filter index AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] used in the luma component coding tree block at the luma component position (xCtb, yCtb) may be derived as follows.
[0806] When alf_use_aps_flag has the first value (for example, 0), AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be determined as alf_luma_fixed_filter_idx.
[0807] If not (when alf_use_aps_flag has the second value (e.g., 1)), AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] may be determined as F+alf_luma_prev_filter_idx. Here, F may be a positive integer and may be 16. In addition, F may represent the maximum number of fixed filters used in the encoder / decoder. That is, F may be the maximum value of alf_luma_fixed_filter_idx+1.
[0808] alf_luma_fixed_filter_idx may represent the fixed filter index used in the luma component coding tree block. That is, when at least one fixed filter in the fixed ALF set is used in the current coding tree block, alf_luma_fixed_filter_idx may be used to select a fixed filter from the fixed ALF set.
[0809] alf_luma_fixed_filter_idx may have a value from 0 to N. Here, N may be a positive integer, and may be 15, for example.
[0810] When alf_luma_fixed_filter_idx is not present in the bitstream, alf_luma_fixed_filter_idx may be inferred to have a value of 0.
[0811] Figure 21The syntax structure of the coding tree block may further include chroma adaptive in-loop filter index information alf_ctb_filter_alt_idx, where the chroma adaptive in-loop filter index information alf_ctb_filter_alt_idx indicates one of the multiple adaptive in-loop filters included in the adaptive parameter set. When the chroma ALF number information is a positive integer greater than 1, the chroma adaptive in-loop filter index information may be signaled.
[0812] For example, when alf_ctb_flag[1][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] indicates that a Cb adaptive in-loop filter is used in a current coding tree block and two or more Cb adaptive in-loop filters are included in an adaptation parameter set, Cb adaptive in-loop filter index information alf_ctb_filter_alt_idx indicating the Cb adaptive in-loop filter used in the current coding tree block may be included in the syntax structure of the coding tree block. That is, the Cb adaptive in-loop filter index information alf_ctb_filter_alt_idx indicating the Cb adaptive in-loop filter used in the current coding tree block may be encoded / decoded in the syntax structure of the coding tree block.
[0813] In addition, when alf_ctb_flag[2][xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] indicates that a Cr adaptive in-loop filter is used in the current coding tree block and two or more Cr adaptive in-loop filters are included in the adaptation parameter set, Cr adaptive in-loop filter index information alf_ctb_filter_alt_idx indicating the Cr adaptive in-loop filter used in the current coding tree block may be included in the syntax structure of the coding tree block. That is, the Cr adaptive in-loop filter index information alf_ctb_filter_alt_idx indicating the Cr adaptive in-loop filter used in the current coding tree block may be encoded / decoded in the syntax structure of the coding tree block.
[0814] The Cb adaptive in-loop filter index information and the Cr adaptive in-loop filter index information may be signaled for each chroma component and may indicate different filter indices or the same filter index.
[0815] In the following, one embodiment of an adaptive in-loop filtering process will be described. In the following, reconstruction may refer to decoding.
[0816] The luminance component picture sample array recPictureL reconstructed before adaptive in-loop filtering is performed may be input. In addition, when ChromaArrayType does not have the first value (eg, 0), the chrominance component picture sample arrays recPictureCb and recPictureCr reconstructed before adaptive in-loop filtering may be input.
[0817] In addition, the luminance component picture sample array alfPictureL changed and reconstructed after the adaptive in-loop filtering is performed may be output according to the adaptive in-loop filtering process. In addition, when ChromaArrayType does not have the first value (for example, 0), the chrominance component picture sample arrays alfPictureCb and alfPictureCr reconstructed before the adaptive in-loop filtering is performed may be output.
[0818] The luma component picture sample array alfPictureL changed and reconstructed after performing adaptive in-loop filtering may be initialized to the luma component picture sample array recPictureL reconstructed before performing adaptive in-loop filtering.
[0819] When ChromaArrayType does not have the first value (eg, 0), picture sample arrays alfPictureCb and alfPictureCr reconstructed before adaptive in-loop filtering is performed may be initialized to picture sample arrays recPictureCb and recPictureCr reconstructed before adaptive in-loop filtering is performed.
[0820] When slice_alf_enabled_flag has a second value (e.g., 1), the following process may be performed for all coding tree units having a luma coding tree block position (rx, ry). Here, rx may have a value from 0 to PicWidthInCtbs-1, and ry may have a value from 0 to PicHeightInCtbs-1.
[0821] When alf_ctb_flag[0][rx][ry] has a second value (eg, 1), a coding tree block filtering process for a luma component may be performed.
[0822] Inputs to the luminance component coding tree block filtering process: recPictureL, alfPictureL, the luminance component coding tree block position (xCtb, yCtb) can be set to (rx < <CtbLog2SizeY,ry<<CtbLog2SizeY)。
[0823] alfPictureL may be output through a coding tree block filtering process for the luma component.
[0824] When ChromaArrayType does not have the first value (eg, 0) and alf_ctb_flag[1][rx][ry] has the second value (eg, 1), a coding tree block filtering process for the chroma component Cb may be performed.
[0825] The input of the coding tree block filtering process for the chroma component Cb can be set to recPictureCb, alfPictureCb, and the chroma component Cb coding tree block position (xCtbC, yCtbC) can be set to ((rx < <CtbLog2SizeY) / SubWidthC,(ry<<CtbLog2SizeY) / SubHeightC)。
[0826] alfPictureCb may be output through a coding tree block filtering process on the chroma component Cb.
[0827] According to an embodiment, when adaptive in-loop filtering is applied to the Cb samples of the current coding tree block, a second ALF coding tree block identifier may be encoded / decoded / acquired, wherein the second ALF coding tree block identifier indicates an adaptive parameter set including the Cb adaptive in-loop filter set (Cb ALF set) applied to the current coding tree block, among one or more adaptive parameter sets including the adaptive in-loop filter set applied to the current picture or current slice. Furthermore, based on the second ALF coding tree block identifier, the adaptive parameter set including the Cb adaptive in-loop filter set applied to the current coding tree block may be determined. Furthermore, the Cb adaptive in-loop filter set may be encoded / decoded / acquired in the adaptive parameter set.
[0828] When ChromaArrayType does not have the first value (eg, 0) and alf_ctb_flag[2][rx][ry] has the second value (eg, 1), a coding tree block filtering process for the chroma component Cr may be performed.
[0829] Inputs to the chroma component Cr coding tree block filtering process: recPictureCr, alfPictureCr, the chroma component Cr coding tree block position (xCtbC, yCtbC) can be set to ((rx < <CtbLog2SizeY) / SubWidthC,(ry<<CtbLog2SizeY) / SubHeightC)。
[0830] alfPictureCr may be output through a coding tree block filtering process on the chrominance component Cr.
[0831] According to an embodiment, when adaptive in-loop filtering is applied to Cr samples of a current coding tree block, a third ALF coding tree block identifier may be encoded / decoded / acquired, wherein the third ALF coding tree block identifier indicates an adaptive parameter set including a Cr adaptive in-loop filter set (Cr ALF set) applied to the current coding tree block, among one or more adaptive parameter sets including an adaptive in-loop filter set applied to a current picture or current slice. Based on the third ALF coding tree block identifier, the adaptive parameter set including the Cr adaptive in-loop filter set applied to the current coding tree block may be determined. In addition, the Cr adaptive in-loop filter set may be encoded / decoded / acquired in the adaptive parameter set.
[0832] Hereinafter, an embodiment of a coding treeblock filtering process for a luma component will be described.
[0833] For coding tree block filtering, the luminance component picture sample array recPictureL reconstructed before performing adaptive in-loop filtering, the luminance component picture sample array alfPictureL changed after performing adaptive in-loop filtering, and the position (xCtb, yCtb) of the upper left sample point of the current luminance component coding tree block based on the upper left sample point of the current picture can be input.
[0834] Furthermore, a changed luma component picture sample array alfPictureL may be output according to coding treeblock filtering.
[0835] The filter index derivation process for coding treeblock filtering may be performed as follows.
[0836] For the filter index derivation process, the reconstructed luminance component picture sample array recPictureL before performing adaptive in-loop filtering and the position (xCtb, yCtb) of the upper left sample of the current luminance component coding tree block based on the upper left sample of the current picture can be input.
[0837] According to the filter index derivation process, a classification filter index array filtIdx and a transpose index array transposeIdx may be output.
[0838] At this time, x and y may have values from 0 to CtbSizeY-1.
[0839] To derive alfPictureL[x][y], each reconstructed luma component sample in the current luma component coding tree block in recPictureL[x][y] may be filtered as follows: At this time, x and y may have values from 0 to CtbSizeY-1.
[0840] The luma component filter coefficient array f[j] and the luma component clipping value array c[j] for the filter indicated by filtIdx[x][y] can be derived as follows. Here, j can have a value from 0 to N, and for example, N can be a positive integer and can be, for example, 11.
[0841] When AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] has a value less than F, the following operations may be performed. Here, F may be a positive integer and may be 16. In addition, F may represent the maximum number of fixed filters used in the encoder / decoder. That is, F may be the maximum value of alf_luma_fixed_filter_idx+1.
[0842] i=AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize]
[0843] f[j]=AlfFixFiltCoeff[AlfClassToFiltMap[i][filtIdx[x][y]]][j]
[0844] c[j] = 2BitdepthY or c[j] = AlfClipL[i][filtIdx[x][y]][j]
[0845] Here, assigning AlfClipL[i][filtIdx[x][y]][j] to c[j] may indicate the use of a clipping method as a nonlinear adaptive in-loop filtering method in a fixed filter.
[0846] When AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize] is greater than or equal to F, the following operations can be performed.
[0847] i=slice_alf_aps_id_luma[AlfCtbFiltSetIdxY[xCtb>>Log2CtbSize][yCtb>>Log2CtbSize]-F]
[0848] f[j]=AlfCoeffL[i][filtIdx[x][y]][j]
[0849] c[j]=AlfClipL[i][filtIdx[x][y]][j]
[0850] Here, f[j] may represent a luma ALF, and c[j] may represent a luma clipping value.
[0851] The index idx for the luma component filter coefficient and the clipping value can be derived from transposeIdx[x][y] as follows.
[0852] When transposeIndex[x][y] has the second value (eg, 1), the following operations may be performed.
[0853] idx[]={9,4,10,8,1,5,11,7,3,0,2,6}
[0854] When transposeIndex[x][y] has a third value (for example, 2), the following operations may be performed.
[0855] idx[]={0,3,2,1,8,7,6,5,4,9,10,11}
[0856] When transposeIndex[x][y] has a fourth value (eg, 3), the following operations may be performed.
[0857] idx[]={9,8,10,4,3,7,11,5,1,0,2,6}
[0858] If not (when transposeIndex[x][y] has a first value (eg, 0)), the following operations may be performed.
[0859] idx[]={0,1,2,3,4,5,6,7,8,9,10,11}
[0860] The position (h) of each corresponding luminance component sample (x, y) in recPicture can be derived as follows x+i ,v y+j ). At this time, i and j may have values from -N to N. Here, N may be a positive integer, and may be, for example, 3. In addition, (N*2)+1 may represent the width or height of the luminance component filter.
[0861] h x+i =Clip3(0,pic_width_in_luma_samples-1,xCtb+x+i)
[0862] v y+j =Clip3(0,pic_height_in_luma_samples-1,yCtb+y+j)
[0863] The variable applyVirtualBoundary indicating whether the virtual boundary is applied may be derived as follows.
[0864] applyVirtualBoundary may be set to 0 when at least one of the following conditions is true.
[0865] When the lower boundary of the current coding tree block is the lower boundary of the picture, applyVirtualBoundary may be set to 0.
[0866] When the lower boundary of the current coding tree block is the lower boundary of the partition and loop_filter_across_bricks_enabled_flag has a first value (eg, 0), applyVirtualBoundary may be set to 0.
[0867] Here, loop_filter_across_bricks_enabled_flag may indicate whether filtering can be performed across block boundaries using at least one of the loop filtering methods. In other words, this may indicate whether filtering can be performed at block boundaries using at least one of the loop filtering methods.
[0868] When a lower boundary of the current coding tree block is a lower boundary of a slice and loop_filter_across_slices_enabled_flag has a first value (eg, 0), applyVirtualBoundary may be set to 0.
[0869] Here, loop_filter_across_slices_enabled_flag may indicate whether filtering may be performed across slice boundaries using at least one of the loop filtering methods. That is, this may indicate whether filtering may be performed at a slice boundary using at least one of the loop filtering methods.
[0870] When the lower boundary of the current coding tree block is the lower boundary of the tile and loop_filter_across_tiles_enabled_flag has a first value (eg, 0), applyVirtualBoundary may be set to 0.
[0871] Optionally, when the lower boundary of the current coding tree block is the lower boundary of the parallel block and loop_filter_across_tiles_enabled_flag has a first value (e.g., 0), the position of the y coordinate of the lower boundary of the area (parallel block) to which the adaptive in-loop filter is applied can be determined based on the position of the y coordinate of the lower boundary of the current coding tree block.
[0872] Here, loop_filter_across_tiles_enabled_flag may indicate whether filtering may be performed across tile boundaries using at least one of the loop filtering methods. In other words, this may indicate whether filtering may be performed at a tile boundary using at least one of the loop filtering methods.
[0873] According to an embodiment, applyVirtualBoundary may be set to 1 even if the lower boundary of the current coding tree block is the lower boundary of the slice.
[0874] Furthermore, even if the lower boundary of the current coding tree block is the lower boundary of the tile, applyVirtualBoundary may be set to 1. Furthermore, even if the lower boundary of the current coding tree block is the lower boundary of the sub-picture, applyVirtualBoundary may be set to 1.
[0875] When a lower boundary of the current coding treeblock is a lower boundary of a sub-picture and loop_filter_across_subpictures_enabled_flag has a first value (eg, 0), applyVirtualBoundary may be set to 0.
[0876] Optionally, when the lower boundary of the current coding tree block is the lower boundary of the sub-picture and loop_filter_across_subpictures_enabled_flag has a first value (e.g., 0), the y coordinate position of the lower boundary of the area (sub-picture) to which the adaptive in-loop filter is applied can be determined based on the y coordinate position of the lower boundary of the current coding tree block.
[0877] Here, loop_filter_across_subpictures_enabled_flag may indicate whether filtering may be performed across sub-picture boundaries using at least one of the loop filtering methods. In other words, this may indicate whether filtering may be performed at sub-picture boundaries using at least one of the loop filtering methods.
[0878] When a lower boundary of the current coding tree block is a lower virtual boundary of the picture and pps_loop_filter_across_virtual_boundaries_disabled_flag has a second value (eg, 1), applyVirtualBoundary may be set to 0.
[0879] If not (if the above condition is not true), applyVirtualBoundary may be set to 1.
[0880] As shown in Table 1, the reconstructed sample offsets r1, r2, and r3 may be determined according to the vertical luma component sample positions and applyVirtualBoundary.
[0881] [Table 1]
[0882] condition rt r2 r3 (y==CtbSizeY-5||y==CtbSizeY-4)&&(applyVirtualBoundary==1) 0 0 0 (y==CtbSizeY-6||y==CtbSizeY-3)&&(applyVirtualBoundary==1) 1 1 1 (y==CtbSizeY-7||y==CtbSizeY-2)&&(applyVirtualBoundary==1) 1 2 2 If not (if the above conditions do not apply) 1 2 3
[0883] The sample value curr for the current sample position can be derived as follows.
[0884] curr=recPictureL[h x ,v y ]
[0885] The value sum obtained by performing filtering on the current sample point can be derived as follows.
[0886] Equation 22
[0887]
[0888] alfPictureL[xCtb+x][yCtb+y] can be derived as follows.
[0889] When pcm_loop_filter_disabled_flag has the second value (eg, 1) and pcm_flag[xCtb+x][yCtb+y] has the second value (eg, 1), the following operations may be performed.
[0890] alfPictureL[xCtb+x][yCtb+y]=recPictureL[h x ,v y ]
[0891] If not (when pcm_loop_filter_disabled_flag has the first value (eg, 0) and pcm_flag[xCtb+x][yCtb+y] has the first value (eg, 0)), the following operations may be performed. alfPictureL[xCtb+x][yCtb+y]=Clip3(0, (1< <BitDepthY)-1,sum)
[0892] Hereinafter, an embodiment of a coding treeblock filtering process for chroma components will be described.
[0893] The reconstructed picture, recPicture, and the adaptive in-loop filtered alfPicture may be input. Furthermore, the position (xCtbC, yCtbC) of the top-left sample of the current chroma component coding treeblock based on the top-left sample of the current picture may be input. Furthermore, the adaptive in-loop filtered alfPicture may be output.
[0894] The width ctbWidthC and height ctbHeightC of the current chroma component coding tree block can be derived as follows.
[0895] ctbWidthC=CtbSizeY / SubWidthC
[0896] ctbHeightC=CtbSizeY / SubHeightC
[0897] To derive alfPicture[x][y], each reconstructed chroma component sample in the current chroma component coding tree block in recPicture[x][y] may be filtered as follows. In this case, x may have a value from 0 to ctbWidthC-1. Furthermore, y may have a value from 0 to ctbHeightC-1.
[0898] The position (h) of each corresponding chrominance component sample (x, y) in recPicture can be derived as follows x+i ,v y+j ). At this time, i and j may have values from -N to N. Here, N may be a positive integer, and may be, for example, 2. In addition, (N*2)+1 may represent the width or height of the chroma component filter.
[0899] h x+i =Clip3(0,pic_width_in_luma_samples / SubWidthC-1,xCtbC+x+i)
[0900] v y+j =Clip3(0,pic_height_in_luma_samples / SubHeightC-1,yCtbC+y+j)
[0901] The variable applyVirtualBoundary indicating whether the virtual boundary is applied may be derived as follows.
[0902] applyVirtualBoundary may be set to 0 when at least one of the following conditions is true.
[0903] When the lower boundary of the current coding tree block is the lower boundary of the picture, applyVirtualBoundary may be set to 0.
[0904] When the lower boundary of the current coding tree block is the lower boundary of the partition and loop_filter_across_bricks_enabled_flag has a first value (eg, 0), applyVirtualBoundary may be set to 0.
[0905] Here, loop_filter_across_bricks_enabled_flag may indicate whether filtering can be performed across block boundaries using at least one of the loop filtering methods. In other words, this may indicate whether filtering can be performed at block boundaries using at least one of the loop filtering methods.
[0906] When a lower boundary of the current coding tree block is a lower boundary of a slice and loop_filter_across_slices_enabled_flag has a first value (eg, 0), applyVirtualBoundary may be set to 0.
[0907] Here, loop_filter_across_slices_enabled_flag may indicate whether filtering may be performed across slice boundaries using at least one of the loop filtering methods. That is, this may indicate whether filtering may be performed at a slice boundary using at least one of the loop filtering methods.
[0908] When the lower boundary of the current coding tree block is the lower boundary of the tile and loop_filter_across_tiles_enabled_flag has a first value (eg, 0), applyVirtualBoundary may be set to 0.
[0909] Optionally, when the lower boundary of the current coding tree block is the lower boundary of the parallel block and loop_filter_across_tiles_enabled_flag has a first value (e.g., 0), the position of the y coordinate of the lower boundary of the area (parallel block) to which the adaptive in-loop filter is applied can be determined based on the position ...
Claims
1. An image decoding method, comprising: Get the reconstructed chroma block of the current block; determining whether an adaptive loop filter is enabled for a chroma component; and In response to enabling an adaptive loop filter for a chroma component, obtaining a final reconstructed chroma block of the current block by applying the adaptive loop filter to the reconstructed chroma block, Wherein, whether to enable an adaptive loop filter for a chroma component is determined based on a first flag, wherein the first flag indicates whether to enable an adaptive loop filter for a chroma component, Wherein the first flag is signaled via the picture header, wherein the type of adaptive loop filter for the chroma component is determined based on a second flag, wherein the second flag indicates whether a linear adaptive loop filter is applied to the chroma component or a nonlinear adaptive loop filter is applied to the chroma component, The types of the adaptive loop filter include linear adaptive loop filter and nonlinear adaptive loop filter, and The current block is obtained by partitioning the coding tree block using at least one of a ternary tree partitioning method or a binary tree partitioning method.
2. The image decoding method according to claim 1, further comprising: Obtaining a reconstructed luminance block of the current block; as well as determining whether a cross-component adaptive loop filter is applied to the current block, The step of determining whether a cross-component adaptive loop filter is applied to the current block comprises: obtaining information indicating whether a cross-component adaptive loop filter is applicable to the current block, and Wherein, the information indicating whether the cross-component adaptive loop filter is available is signaled through a sequence parameter set.
3. The image decoding method according to claim 2, further comprising: When a cross-component adaptive loop filter is available for the current block, information indicating whether the cross-component adaptive loop filter is applied to the Cb component of the current block is obtained.
4. The image decoding method according to claim 3, wherein: Information indicating whether a cross-component adaptive loop filter is applied to the Cb component is signaled through a picture header.
5. The image decoding method according to claim 3, further comprising: When a cross-component adaptive loop filter is applied to the Cb component, an adaptive parameter set indicator referenced by the Cb component is acquired.
6. The image decoding method according to claim 2, further comprising: When a cross-component adaptive loop filter is available for the current block, information indicating whether the cross-component adaptive loop filter is applied to the Cr component of the current block is obtained.
7. The image decoding method according to claim 6, wherein: Information indicating whether a cross-component adaptive loop filter is applied to the Cr component is signaled through a picture header.
8. The image decoding method according to claim 6, further comprising: When a cross-component adaptive loop filter is available for the Cr component, an adaptive parameter set indicator referenced by the Cr component is obtained.
9. The image decoding method according to claim 2, wherein: When the information indicating whether the cross-component adaptive loop filter is available is not signaled, it is determined that the cross-component adaptive loop filter is not available for the current block.
10. The image decoding method according to claim 1, wherein: The second flag indicating whether a linear adaptive loop filter is applied to the chroma component or a non-linear adaptive loop filter is applied to the chroma component is a single syntax element.
11. An image encoding method, comprising: Get the reconstructed chroma block of the current block; determining whether an adaptive loop filter is enabled for a chroma component; and In response to enabling an adaptive loop filter for a chroma component, obtaining a final reconstructed chroma block of the current block by applying the adaptive loop filter to the reconstructed chroma block, wherein the first flag is encoded based on whether an adaptive loop filter is enabled for a chroma component, wherein the first flag indicates whether an adaptive loop filter is enabled for a chroma component, Among them, the first flag is encoded into the picture header, wherein the second flag is encoded based on a type of adaptive loop filter for the chroma component, wherein the second flag indicates whether a linear adaptive loop filter is applied to the chroma component or a non-linear adaptive loop filter is applied to the chroma component, The types of the adaptive loop filter include linear adaptive loop filter and nonlinear adaptive loop filter, and The current block is obtained by partitioning the coding tree block using at least one of a ternary tree partitioning method or a binary tree partitioning method.
12. A method for sending a bit stream, comprising: Get the reconstructed chroma block of the current block; determining whether an adaptive loop filter is enabled for a chroma component; In response to enabling an adaptive loop filter for a chroma component, obtaining a final reconstructed chroma block of the current block by applying the adaptive loop filter to the reconstructed chroma block; encoding a first flag and a second flag into the bitstream; and sending the bit stream, The first flag is encoded based on whether an adaptive loop filter is enabled for a chroma component, wherein the first flag indicates whether an adaptive loop filter is enabled for a chroma component, wherein the first flag is encoded into a picture header of the bitstream, wherein the second flag is encoded based on a type of adaptive loop filter for a chroma component, wherein the second flag indicates whether a linear adaptive loop filter is applied to the chroma component or a nonlinear adaptive loop filter is applied to the chroma component, The types of the adaptive loop filter include linear adaptive loop filter and nonlinear adaptive loop filter, and The current block is obtained by partitioning the coding tree block using at least one of a ternary tree partitioning method or a binary tree partitioning method.