Adaptive in-loop filtering method and apparatus

Filtering video coding tree blocks through an adaptive in-loop filter set solves the problem of increased transmission and storage costs of high-resolution video data, achieves more efficient video encoding and decoding, and reduces computational complexity and storage requirements.

CN118631990APending Publication Date: 2024-09-10ELECTRONICS & TELECOMM RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410671351.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-07-09
Filing Date
2020-06-17
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing video coding technology cannot effectively reduce the cost increase caused by high-resolution and high-quality video data transmission and storage, and existing filtering technologies such as deblocking filtering and sample adaptive offset have limitations in reducing picture distortion.

Method used

The adaptive in-loop filter (ALF) set is used to filter the video coding tree block by obtaining and determining the adaptation parameter set. The brightness and chroma clipping flags and indexes are used to determine the shape and application of the filter, reducing computational complexity. and storage bandwidth.

Benefits of technology

It improves the efficiency of video encoding and decoding, reduces the computational complexity and storage requirements of video encoders and decoders, and optimizes the transmission and storage efficiency of video data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631990A_ABST
    Figure CN118631990A_ABST
Patent Text Reader

Abstract

The invention provides an adaptive in-loop filtering method and device. Disclosed is a video decoding method, comprising: acquiring an adaptive parameter set comprising an adaptive in-loop filter (ALF) set, the ALF set comprising a plurality of ALFs; determining, from the set of adaptive parameters, an adaptive parameter set applied to a current picture or slice and including an ALF set applied to the current picture or slice; determining, from a set of adaptive parameters applied to the current picture or slice, an adaptive parameter set applied to a current coding tree block (CTB) and including an ALF set applied to the current CTB included in the current picture or slice; and filtering the current CTB based on an ALF set of the determined adaptive parameter set applied to the current CTB, where the adaptive parameter set includes chroma ALF number information, and where the ALF set includes chroma ALFs whose number is indicated by the chroma ALF number information.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the patent application filed on June 17, 2020, with application number 202080040649.X and invention title "Adaptive In-Loop Filtering Method and Device". Technical Field

[0002] This invention relates to a video encoding / decoding method, a video encoding / decoding apparatus, and a recording medium for storing bitstreams. Specifically, this invention relates to a video encoding / decoding method and apparatus using in-loop filtering. Background Technology

[0003] Today, the demand for high-resolution, high-quality video (such as high-definition (HD) and ultra-high-definition (UHD) video) is increasing across various applications. Due to the higher resolution and quality of the video, the amount of video data increases compared to existing video data. Therefore, transmission or storage costs increase when video data is transmitted via media such as wired / wireless broadband lines or stored on existing storage media. To address this challenge with high-resolution, high-quality video data, efficient video encoding / decoding technologies are needed.

[0004] Various video compression techniques exist, such as inter-frame prediction for predicting pixel values ​​in the current frame from pixel values ​​in previous or subsequent frames, intra-frame prediction for predicting pixel values ​​in a region of the current frame from another region of the current frame, energy transformation and quantization techniques for compressing residual signals, and entropy coding techniques for assigning shorter codes to frequently occurring pixel values ​​and longer codes to less frequent pixel values. These video compression techniques allow for the efficient compression, transmission, and storage of video data.

[0005] Deblocking aims to reduce block artifacts around block boundaries by performing vertical and horizontal filtering on the block boundaries. However, the problem with deblocking is that when filtering is performed on block boundaries, it cannot minimize the distortion between the original and reconstructed images.

[0006] Sample Adaptive Offset (SAO) is a method that compares the pixel value of a sample with the pixel values ​​of its neighboring samples on a sample-by-sample basis, and then adds the offset to a specific sample, or adds the offset to samples whose pixel values ​​fall within a specific range, in order to reduce ringing artifacts. SAO has the effect of reducing distortion between the original and reconstructed images to a certain extent through rate distortion optimization. However, when the difference between the original and reconstructed images is large, there are limitations in minimizing distortion. Summary of the Invention

[0007] Technical issues

[0008] The purpose of this invention is to provide a video encoding / decoding method and device using adaptive in-loop filtering.

[0009] Another object of the present invention is to provide a recording medium for storing bitstreams generated by video encoding / decoding methods or devices.

[0010] Technical solution

[0011] This disclosure provides a video decoding method, comprising: acquiring an adaptive parameter set including an adaptive in-loop filter (ALF) set, wherein the adaptive in-loop filter (ALF) set includes a plurality of ALFs; determining from the adaptive parameter set an adaptive parameter set applied to a current frame or slice and including an ALF set applied to the current frame or slice; determining from the adaptive parameter set applied to the current frame or slice an adaptive parameter set applied to a current coding tree block (CTB) and including an ALF set applied to the current CTB included in the current frame or slice; and filtering the current CTB based on the determined ALF set of the adaptive parameter set applied to the current CTB, wherein the acquired adaptive parameter set includes chroma ALF quantity information, and wherein the ALF set includes chroma ALFs with a quantity indicated by the chroma ALF quantity information.

[0012] According to an embodiment, the adaptive parameter set may include a luminance clipping flag and a chrominance clipping flag, wherein the luminance clipping flag indicates whether nonlinear adaptive in-loop filtering is performed for the luminance component, and the chrominance clipping flag indicates whether nonlinear adaptive in-loop filtering is performed for the chrominance component.

[0013] According to an embodiment, the adaptive parameter set may include a luminance clipping index and a chrominance clipping index, wherein when the luminance clipping flag indicates that nonlinear adaptive in-loop filtering is performed for the luminance component, the luminance clipping index indicates the clipping value used for nonlinear adaptive in-loop filtering; and when the chrominance clipping flag indicates that nonlinear adaptive in-loop filtering is performed for the chrominance component, the chrominance clipping index indicates the clipping value used for nonlinear adaptive in-loop filtering.

[0014] According to an embodiment, the luminance clipping index and the chrominance clipping index can be encoded using a fixed length of 2 bits.

[0015] According to an embodiment, the luminance clipping value for nonlinear adaptive in-loop filtering of the luminance component may be determined based on the value indicated by the luminance clipping index and the bit depth of the current sequence, and the chrominance clipping value for nonlinear adaptive in-loop filtering of the chrominance component may be determined based on the value indicated by the chrominance clipping index and the bit depth of the current sequence, and the luminance clipping value and the chrominance clipping value may be the same when the value indicated by the luminance clipping index and the value indicated by the chrominance clipping index are the same.

[0016] According to an embodiment, the adaptive parameter set may include an adaptive parameter set identifier and adaptive parameter set type information, wherein the adaptive parameter set identifier indicates an identification number assigned to the adaptive parameter set, and the adaptive parameter set type information indicates the type of encoded information included in the adaptive parameter set.

[0017] According to an embodiment, the step of determining an adaptive parameter set applied to the current frame or strip and including the ALF set applied to the current frame or strip may include: obtaining luminance ALF set quantity information of the current frame or strip, and obtaining a luminance ALF set identifier whose quantity is indicated by the luminance ALF set quantity information.

[0018] According to an embodiment, the step of determining an adaptive parameter set applied to the current frame or strip and including an ALF set applied to the current frame or strip may include: obtaining chroma ALF application information of the current frame or strip, and obtaining a chroma ALF set identifier when the chroma ALF application information is applied to at least one of the Cb component or the Cr component.

[0019] According to an embodiment, the step of obtaining an adaptive parameter set including an ALF set may include: when the adaptive parameter set type information indicates an ALF type, determining an adaptive parameter set including an ALF set.

[0020] According to an embodiment, the adaptive parameter set may include a luminance ALF signaling flag and a chrominance ALF signaling flag, wherein the luminance ALF signaling flag indicates whether the adaptive parameter set includes an ALF for the luminance component, and the chrominance ALF signaling flag indicates whether the adaptive parameter set includes an ALF for the chrominance component.

[0021] According to an embodiment, the adaptive parameter set may include luminance signaling ALF quantity information indicating the number of luminance signaling ALFs, and when the luminance signaling ALF quantity information indicates that the number of luminance signaling ALFs is greater than 1, the adaptive parameter set may include a luminance ALF difference index, wherein the luminance ALF difference index indicates the index of a luminance signaling ALF referenced by a predetermined number of luminance ALFs in the luminance ALF set.

[0022] According to an embodiment, the adaptive parameter set may include one or more luminance signaling ALFs, and the predetermined number of luminance ALFs may be determined from the one or more luminance signaling ALFs according to the luminance ALF difference index.

[0023] According to an embodiment, the adaptive parameter set may include chroma ALF quantity information indicating the number of chroma ALFs, and may include chroma ALFs with a quantity indicated by the chroma ALF quantity information.

[0024] According to an embodiment, the step of determining an adaptive parameter set applied to the current CTB and including an ALF set applied to the current CTB may include: obtaining a first ALF coded tree block flag indicating whether adaptive in-loop filtering is applied to the luminance samples of the current CTB, and determining whether adaptive in-loop filtering is applied to the luminance samples of the current CTB based on the first ALF coded tree block flag; obtaining a second ALF coded tree block flag indicating whether adaptive in-loop filtering is applied to the Cb samples of the current CTB, and determining whether adaptive in-loop filtering is applied to the Cb samples of the current CTB based on the second ALF coded tree block flag; and obtaining a third ALF coded tree block flag indicating whether adaptive in-loop filtering is applied to the Cr samples of the current CTB, and determining whether adaptive in-loop filtering is applied to the Cr samples of the current CTB based on the third ALF coded tree block flag.

[0025] According to an embodiment, the step of determining an adaptive parameter set applied to the current CTB and including an ALF set applied to the current CTB may include: when an adaptive in-loop filter is applied to the luminance samples of the current CTB, obtaining an adaptive parameter set application flag, wherein the adaptive parameter set application flag indicates whether the ALF set of the adaptive parameter set is applied to the current CTB; when the adaptive parameter set application flag indicates that the ALF set of the adaptive parameter set is applied to the current CTB, determining a luminance ALF set applied to the current CTB from one or more adaptive parameter sets including an ALF set applied to the current frame or strip; and when the adaptive parameter set application flag indicates that the ALF set of the adaptive parameter set is not applied to the current CTB, determining a fixed filter applied to the current CTB from a fixed ALF set for luminance samples.

[0026] According to an embodiment, the step of determining an adaptive parameter set applied to the current CTB and including an ALF set applied to the current CTB may include: when adaptive in-loop filtering is applied to Cb samples of the current CTB, obtaining a second ALF coding tree block identifier from one or more adaptive parameter sets including an ALF set applied to the current frame or stripe, wherein the second ALF coding tree block identifier indicates an adaptive parameter set including an ALF set applied to the current CTB; determining an adaptive parameter set including an ALF set applied to the current CTB based on the second ALF coding tree block identifier; when adaptive in-loop filtering is applied to Cr samples of the current CTB, obtaining a third ALF coding tree block identifier from one or more adaptive parameter sets including an ALF set applied to the current frame or stripe, wherein the third ALF coding tree block identifier indicates an adaptive parameter set including an ALF set applied to the current CTB; and determining an adaptive parameter set including an ALF set applied to the current CTB based on the third ALF coding tree block identifier.

[0027] According to an embodiment, the step of filtering the current CTB may further include: assigning a block classification index to the basic filtering unit block of the current CTB, wherein the block classification index may be determined using directional information and activity information.

[0028] According to an embodiment, at least one of the directional information or the activity information may be determined based on the gradient value of at least one of the vertical direction, horizontal direction, first diagonal direction, or second diagonal direction.

[0029] This disclosure provides a video coding method, comprising: determining an adaptive parameter set including an adaptive in-loop filter (ALF) set, wherein the adaptive in-loop filter (ALF) set includes a plurality of ALFs; determining from the adaptive parameter set an adaptive parameter set applied to a current frame or slice and including an ALF set applied to the current frame or slice; determining from the adaptive parameter set applied to the current frame or slice an adaptive parameter set applied to a current coding tree block (CTB) and including an ALF set applied to the current CTB included in the current frame or slice; and filtering the current CTB based on the determined ALF set of the adaptive parameter set applied to the current CTB, wherein the determined adaptive parameter set includes chroma ALF quantity information, and wherein the ALF set includes chroma ALFs with a quantity indicated by the chroma ALF quantity information.

[0030] According to an embodiment, the adaptive parameter set may include a luminance clipping flag and a chrominance clipping flag, wherein the luminance clipping flag indicates whether nonlinear adaptive in-loop filtering is performed for the luminance component, and the chrominance clipping flag indicates whether nonlinear adaptive in-loop filtering is performed for the chrominance component.

[0031] According to an embodiment, the adaptive parameter set may include a luminance clipping index and a chrominance clipping index, wherein when the luminance clipping flag indicates that nonlinear adaptive in-loop filtering is performed for the luminance component, the luminance clipping index indicates the clipping value used for nonlinear adaptive in-loop filtering; and when the chrominance clipping flag indicates that nonlinear adaptive in-loop filtering is performed for the chrominance component, the chrominance clipping index indicates the clipping value used for nonlinear adaptive in-loop filtering.

[0032] According to an embodiment, the luminance clipping index and the chrominance clipping index can be encoded using a fixed length of 2 bits.

[0033] According to an embodiment, the luminance clipping value for nonlinear adaptive in-loop filtering of the luminance component may be determined based on the value indicated by the luminance clipping index and the bit depth of the current sequence, and the chrominance clipping value for nonlinear adaptive in-loop filtering of the chrominance component may be determined based on the value indicated by the chrominance clipping index and the bit depth of the current sequence, and the luminance clipping value and the chrominance clipping value may be the same when the value indicated by the luminance clipping index and the value indicated by the chrominance clipping index are the same.

[0034] According to an embodiment, the adaptive parameter set may include an adaptive parameter set identifier and adaptive parameter set type information, wherein the adaptive parameter set identifier indicates an identification number assigned to the adaptive parameter set, and the adaptive parameter set type information indicates the type of encoded information included in the adaptive parameter set.

[0035] According to an embodiment, the step of determining the adaptive parameter set applied to the current frame or strip may include: determining the number of luminance ALF sets in the current frame or strip, and determining a luminance ALF set identifier whose quantity is indicated by the number of luminance ALF sets.

[0036] According to an embodiment, the step of determining the adaptive parameter set applied to the current frame or strip may include: determining the chroma ALF application information of the current frame or strip, and determining the chroma ALF set identifier when the chroma ALF application information is applied to at least one of the Cb component or Cr component.

[0037] According to an embodiment, the step of determining an adaptive parameter set including an ALF set may include: determining an adaptive parameter set including an ALF set when the adaptive parameter set type information indicates an ALF type.

[0038] According to an embodiment, the adaptive parameter set may include a luminance ALF signaling flag and a chrominance ALF signaling flag, wherein the luminance ALF signaling flag indicates whether the adaptive parameter set includes an ALF for the luminance component, and the chrominance ALF signaling flag indicates whether the adaptive parameter set includes an ALF for the chrominance component.

[0039] According to an embodiment, the adaptive parameter set may include luminance signaling ALF quantity information, wherein the luminance signaling ALF quantity information indicates the number of luminance signaling ALFs, and when the luminance signaling ALF quantity information indicates that the number of luminance signaling ALFs is greater than 1, the adaptive parameter set may include a luminance ALF difference index, wherein the luminance ALF difference index indicates the index of a luminance signaling ALF referenced by a predetermined number of luminance ALFs in the luminance ALF set.

[0040] According to an embodiment, the adaptive parameter set may include one or more luminance signaling ALFs, and the predetermined number of luminance ALFs may be determined from the one or more luminance signaling ALFs according to the luminance ALF difference index.

[0041] According to an embodiment, the adaptive parameter set may include chroma ALF quantity information indicating the number of chroma ALFs, and may include chroma ALFs with a quantity indicated by the chroma ALF quantity information.

[0042] According to an embodiment, the step of determining the adaptive parameter set applied to the current CTB may include: determining a first ALF coded tree block flag indicating whether adaptive in-loop filtering is applied to the luminance samples of the current CTB, and determining whether adaptive in-loop filtering is applied to the luminance samples of the current CTB based on the first ALF coded tree block flag; determining a second ALF coded tree block flag indicating whether adaptive in-loop filtering is applied to the Cb samples of the current CTB, and determining whether adaptive in-loop filtering is applied to the Cb samples of the current CTB based on the second ALF coded tree block flag; and determining a third ALF coded tree block flag indicating whether adaptive in-loop filtering is applied to the Cr samples of the current CTB, and determining whether adaptive in-loop filtering is applied to the Cr samples of the current CTB based on the third ALF coded tree block flag.

[0043] According to an embodiment, the step of determining the adaptive parameter set applied to the current CTB may include: when an adaptive in-loop filter is applied to the luminance samples of the current CTB, determining an adaptive parameter set application flag, wherein the adaptive parameter set application flag indicates whether the ALF set of the adaptive parameter set is applied to the current CTB; when the adaptive parameter set application flag indicates that the ALF set of the adaptive parameter set is applied to the current CTB, determining a luminance ALF set applied to the current CTB from one or more adaptive parameter sets including ALF sets applied to the current frame or strip; and when the adaptive parameter set application flag indicates that the ALF set of the adaptive parameter set is not applied to the current CTB, determining a fixed filter applied to the current CTB from a fixed ALF set for luminance samples.

[0044] According to an embodiment, the step of determining the adaptive parameter set applied to the current CTB may include: when adaptive in-loop filtering is applied to Cb samples of the current CTB, determining a second ALF coding tree block identifier from one or more adaptive parameter sets including the ALF set applied to the current frame or stripe, wherein the second ALF coding tree block identifier indicates an adaptive parameter set including the Cb ALF set applied to the current CTB; determining an adaptive parameter set including the Cb ALF set applied to the current CTB based on the second ALF coding tree block identifier; when adaptive in-loop filtering is applied to Cr samples of the current CTB, determining a third ALF coding tree block identifier from one or more adaptive parameter sets including the ALF set applied to the current frame or stripe, wherein the third ALF coding tree block identifier indicates an adaptive parameter set including the Cr ALF set applied to the current CTB; and determining an adaptive parameter set including the Cr ALF set applied to the current CTB based on the third ALF coding tree block identifier.

[0045] According to an embodiment, the step of filtering the current CTB may further include: assigning a block classification index to the basic filtering unit block of the current CTB, wherein the block classification index may be determined using directional information and activity information.

[0046] According to an embodiment, at least one of the directional information or the activity information may be determined based on the gradient value of at least one of the vertical direction, horizontal direction, first diagonal direction, or second diagonal direction.

[0047] This disclosure provides a non-transitory computer-readable recording medium for storing a bitstream generated by encoding video according to a video coding method, the video coding method comprising: determining an adaptive parameter set including an adaptive in-loop filter (ALF) set, wherein the adaptive in-loop filter (ALF) set includes a plurality of ALFs; determining from the adaptive parameter set an adaptive parameter set applied to a current frame or slice and including an ALF set applied to the current frame or slice; determining from the adaptive parameter set applied to the current frame or slice an adaptive parameter set applied to a current coding tree block (CTB) and including an ALF set applied to the current CTB included in the current frame or slice; and filtering the current CTB based on the determined ALF set of the adaptive parameter set applied to the current CTB, wherein the determined adaptive parameter set includes chroma ALF quantity information, and wherein the ALF set includes chroma ALFs with a quantity indicated by the chroma ALF quantity information.

[0048] Beneficial effects

[0049] According to the present invention, a video encoding / decoding method and apparatus using in-loop filtering can be provided.

[0050] Furthermore, according to the present invention, a method and apparatus for performing in-loop filtering using subsampling-based block classification can be provided to reduce the computational complexity and memory access bandwidth of a video encoder / decoder.

[0051] Furthermore, according to the present invention, a method and apparatus for performing in-loop filtering using multiple filter shapes can be provided to reduce the computational complexity, memory capacity requirements, and memory access bandwidth of video encoders / decoders.

[0052] Furthermore, according to the present invention, a recording medium for storing bitstreams generated by a video encoding / decoding method or device can be provided.

[0053] Furthermore, according to the present invention, video encoding and / or decoding efficiency can be improved. Attached Figure Description

[0054] Figure 1 This is a block diagram illustrating the configuration of an encoding device according to an embodiment of the present invention.

[0055] Figure 2 This is a block diagram illustrating the configuration of a decoding device according to an embodiment of the present invention.

[0056] Figure 3 It is a schematic diagram illustrating the partitioning structure of an image when it is encoded and decoded.

[0057] Figure 4 This is a diagram illustrating intra-frame prediction processing.

[0058] Figure 5 This is a diagram illustrating an embodiment of inter-screen prediction processing.

[0059] Figure 6 This is a diagram illustrating the transformation and quantization processes.

[0060] Figure 7 This is a diagram showing reference samples that can be used for intra-frame prediction.

[0061] Figure 8a and Figure 8b These are flowcharts illustrating video decoding and video encoding methods according to embodiments of the present invention.

[0062] Figure 9 This is a diagram illustrating an exemplary method for determining gradient values ​​for the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction.

[0063] Figures 10 to 12 This is a diagram illustrating an exemplary subsampling-based method for determining gradient values ​​for the horizontal, vertical, first diagonal, and second diagonal directions.

[0064] Figures 13 to 18 This is a diagram illustrating an exemplary subsampling-based method for determining gradient values ​​for the horizontal, vertical, first diagonal, and second diagonal directions.

[0065] Figures 19 to 30 This is a diagram illustrating an exemplary method for determining gradient values ​​at a specific sample location in the horizontal, vertical, first diagonal, and second diagonal directions according to an embodiment of the present invention.

[0066] Figure 31 This is a diagram illustrating an exemplary method for determining gradient values ​​for the horizontal, vertical, first diagonal, and second diagonal directions when the time layer identifier indicates the top layer.

[0067] Figure 32 This is a diagram illustrating various computational techniques that can be used in place of one-dimensional Laplace operations according to embodiments of the present invention.

[0068] Figure 33 This is a diagram illustrating a diamond-shaped filter according to an embodiment of the present invention.

[0069] Figure 34 This is a diagram illustrating a 5×5 tap filter according to an embodiment of the present invention.

[0070] Figure 35aand Figure 35b This is a diagram illustrating various filter shapes according to embodiments of the present invention.

[0071] Figure 36 This is a diagram illustrating a horizontally symmetrical filter and a vertically symmetrical filter according to an embodiment of the present invention.

[0072] Figure 37 This is a diagram illustrating filters generated by geometric transformations of square filters, octagonal filters, snowflake filters, and rhomboid filters according to embodiments of the present invention.

[0073] Figure 38 This is a diagram illustrating the process of transforming a diamond filter with 9×9 coefficients into a square filter with 5×5 coefficients.

[0074] Figures 39 to 55d This is a diagram illustrating an exemplary subsampling-based method for determining the sum of gradient values ​​for the horizontal, vertical, first diagonal, and second diagonal directions.

[0075] Figure 56 This is a diagram illustrating an embodiment of the sequence parameter set syntax required for adaptive in-loop filtering.

[0076] Figure 57 This is a diagram illustrating an embodiment of the sequence parameter set syntax required for adaptive in-loop filtering.

[0077] Figure 58 This is a diagram illustrating an example of an adaptive parameter type for an adaptive parameter set.

[0078] Figure 59 This is a diagram illustrating an embodiment of the stripe header syntax required for adaptive in-loop filtering.

[0079] Figures 60a to 60d This is a diagram illustrating an embodiment of the adaptive in-loop filter data syntax required for adaptive in-loop filtering.

[0080] Figure 61 This is a diagram illustrating an embodiment of the coding tree block syntax required for adaptive in-loop filtering.

[0081] Figure 62a and Figure 62b This is a diagram illustrating an embodiment with fixed filter coefficients.

[0082] Figure 63 This is a diagram illustrating an embodiment of the mapping relationship between the coefficient categories of an adaptive loop filter and the filter.

[0083] Figure 64 This is a diagram illustrating an embodiment of the clipping index of the adaptive in-loop filter data syntax.

[0084] Figure 65 It is shown Figure 64 A diagram illustrating a detailed description of the cropping index of the adaptive in-loop filter data syntax.

[0085] Figure 66 This is a diagram illustrating another embodiment of the clipping index for the adaptive in-loop filter data syntax.

[0086] Figure 67 It is shown Figure 66 A diagram illustrating a detailed description of the cropping index of the adaptive in-loop filter data syntax.

[0087] Figure 68 This is a diagram illustrating another embodiment of the strip header syntax required for adaptive in-loop filtering.

[0088] Figure 69a and Figure 69b This is a diagram illustrating another embodiment of the adaptive in-loop filter data syntax required for adaptive in-loop filtering.

[0089] Figure 70a and Figure 70b This is a diagram illustrating another embodiment of the coding tree block syntax required for adaptive in-loop filtering.

[0090] Figure 71 It is shown Figure 68 A diagram illustrating a detailed description of the striped header syntax.

[0091] Figure 72 and Figure 73 It is shown Figure 69a and Figure 69b A diagram illustrating a detailed description of the adaptive in-loop filter data syntax.

[0092] Figure 74a and Figure 74b This is a diagram illustrating another embodiment of fixed filter coefficients.

[0093] Figure 75 Figure 76 shows Figure 69a and Figure 69b A diagram illustrating a detailed description of the adaptive in-loop filter data syntax.

[0094] Figure 77 and Figure 78 It is shown Figure 61 A diagram illustrating a detailed description of the coding tree block syntax.

[0095] Figures 79 to 91 This is a diagram illustrating the adaptive in-loop filter processing.

[0096] Figure 92This is a flowchart illustrating a video decoding method using an adaptive in-loop filter according to an embodiment.

[0097] Figure 93 This is a flowchart illustrating a video coding method using an adaptive in-loop filter according to an embodiment.

[0098] Best mode

[0099] This disclosure provides a video decoding method, comprising: acquiring an adaptive parameter set including an adaptive in-loop filter (ALF) set, wherein the adaptive in-loop filter (ALF) set includes a plurality of ALFs; determining from the adaptive parameter set an adaptive parameter set applied to a current frame or slice and including an ALF set applied to the current frame or slice; determining from the adaptive parameter set applied to the current frame or slice an adaptive parameter set applied to a current coding tree block (CTB) and including an ALF set applied to the current CTB included in the current frame or slice; and filtering the current CTB based on the determined ALF set of the adaptive parameter set applied to the current CTB, wherein the acquired adaptive parameter set includes chroma ALF quantity information, and wherein the ALF set includes chroma ALFs with a quantity indicated by the chroma ALF quantity information. Detailed Implementation

[0100] Various modifications can be made to this invention, and various embodiments of the invention exist, wherein examples of various embodiments of the invention will now be provided and described in detail with reference to the accompanying drawings. However, the invention is not limited thereto, although exemplary embodiments may be interpreted as including all modifications, equivalents, or substitutions within the technical concept and scope of the invention. In various respects, similar reference numerals refer to the same or similar functions. In the drawings, the shape and size of elements may be exaggerated for clarity. In the following detailed description of the invention, reference is made to the accompanying drawings, which illustrate specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice this disclosure. It should be understood that the various embodiments of this disclosure, though 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 this disclosure. Furthermore, it should be understood that the position or arrangement of various elements within each disclosed embodiment may be modified without departing from the spirit and scope of this disclosure. Therefore, the following detailed description should not be considered limiting, and the scope of this disclosure is defined only by the appended claims (which, where properly interpreted, also include the full scope of the equivalents claimed by the claims).

[0101] The terms "first," "second," etc., used in this specification may be used to describe various components, but the components should not be construed as limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the invention, a "first" component may be named a "second" component, and a "second" component may similarly be named a "first" component. The term "and / or" includes a combination of multiple items or any one of multiple items.

[0102] It will be understood that, in this specification, when an element is simply referred to as "connected to" or "coupled to" another element rather than "directly connected to" or "directly coupled to" another element, the element may be "directly connected to" or "directly coupled to" another element, or may be connected to or coupled to another element where there is another element intervening between the element and the other element. Conversely, it should be understood that when an element is referred to as "directly coupled to" or "directly connected" to another element, there is no intermediate element.

[0103] Furthermore, the constituent parts shown in the embodiments of the present invention are illustrated independently to represent different functional characteristics. Therefore, this does not mean that each constituent part is constructed as a separate hardware or software unit. In other words, for convenience, each constituent part includes each of the listed constituent parts. Thus, at least two constituent parts of each constituent part can be combined to form one constituent part, or a constituent part can be divided into multiple constituent parts to perform each function. Embodiments in which each constituent part is combined and embodiments in which each constituent part is divided are also included within the scope of the present invention without departing from its spirit.

[0104] The terminology used in this specification is for describing particular embodiments only and is not intended to limit the invention. Unless the context clearly distinguishes them, expressions used in the singular include those used in the plural. In this specification, it will be understood that terms such as “comprising,” “having,” etc., are intended to indicate the presence of features, numbers, steps, actions, elements, components, 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, components, or combinations thereof may be present or added. In other words, when a particular element is referred to as “comprising,” it does not exclude elements other than the corresponding element, but rather includes additional elements within the embodiments of the invention or within the scope of the invention.

[0105] Furthermore, some components may not be essential for performing the basic functions of the invention, but rather optional components that only improve its performance. The invention can be implemented by including only the essential components necessary for achieving the essence of the invention, excluding components used to improve performance. Structures that include only the essential components and exclude optional components used only to improve performance are also included within the scope of the invention.

[0106] In the following, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing exemplary embodiments of the invention, well-known functions or structures will not be described in detail, as they may unnecessarily obscure the understanding of the invention. Like constituent elements in the drawings are indicated by like reference numerals, and repeated descriptions of like elements will be omitted.

[0107] In the following text, an image may refer to a frame that constitutes a video, or it may refer to the video itself. For example, "encoding or decoding an image or both" may refer to "encoding or decoding a moving image or both," and may also refer to "encoding or decoding an image within an image of a moving image or both."

[0108] In the following text, the terms "moving images" and "video" are used to mean the same thing and are interchangeable.

[0109] In the following text, the target image can be an encoded target image that serves as an encoding target and / or a decoded target image that serves as a decoding target. Furthermore, the target image can be an input image input to an encoding device and an input image input to a decoding device. Here, the target image may have the same meaning as the current image.

[0110] In the following text, the terms “image,” “picture,” “frame,” and “screen” may be used as having the same meaning and may be used interchangeably with each other.

[0111] In the following text, a target block can be an encoded target block that serves as the encoding target and / or a decoded target block that serves as the decoding target. Furthermore, a target block can be the current block that serves as the target of the current encoding and / or decoding. For example, the terms "target block" and "current block" can be used to mean the same thing and can be used interchangeably.

[0112] In the following text, the terms "block" and "unit" may be used to mean the same thing and may be used interchangeably. Alternatively, "block" may refer to a specific unit.

[0113] In the following text, the terms “region” and “fragment” are used interchangeably.

[0114] In the following text, a specific signal can be a signal representing a specific block. For example, the original signal can be a signal representing the target block. The prediction signal can be a signal representing the prediction block. The residual signal can be a signal representing the residual block.

[0115] In this embodiment, each of the following can have a value: information, data, flags, indexes, elements, and attributes. A value of "0" for information, data, flags, indexes, elements, and attributes can represent logical false or a first predefined value. In other words, the values ​​"0", false, logical false, and the first predefined value can be interchanged. A value of "1" for information, data, flags, indexes, elements, and attributes can represent logical true or a second predefined value. In other words, the values ​​"1", true, logical true, and the second predefined value can be interchanged.

[0116] When variables i or j are used to represent columns, rows, or indices, 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, columns, rows, indices, etc., can be counted starting from 0, or they can be counted starting from 1.

[0117] Description of terms

[0118] Encoder: Represents the device that performs encoding. In other words, it refers to the encoding device.

[0119] Decoder: Represents the device that performs decoding. In other words, it refers to the decoding device.

[0120] A block is an M×N sample array. Here, M and N can represent positive integers, and a block can represent a two-dimensional sample array. A block can refer to a unit. The current block can represent a coding target block that becomes the target during encoding, or a decoding target block that becomes the target during decoding. Furthermore, the current block can be at least one of a coding block, a prediction block, a residual block, and a transform block.

[0121] Samples: These are the basic units that make up a block. Based on bit depth (B... d Sample points can be represented as numbers from 0 to 2. Bd The value is -1. In this invention, a sample point can be used to represent a pixel. That is, a sample point, a pel, and a pixel can have the same meaning.

[0122] Unit: Refers to an encoding and decoding unit. When encoding and decoding an image, a unit can be a region generated by partitioning a single image. Furthermore, a unit can represent a sub-partitioning unit when a single image is partitioned into sub-partitioning units during encoding or decoding. That is, an image can be partitioned into multiple units. When encoding and decoding an image, predetermined processing can be performed for each unit. A single unit can be partitioned into sub-units smaller than the unit's size. Depending on the function, a unit can 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, etc. Furthermore, to distinguish a unit from a block, a unit can include a luma component block, a chroma component block associated with the luma component block, and syntax elements for each chroma component block. Units can have various sizes and shapes; specifically, the shape of a unit can be a two-dimensional geometric shape, such as a square, rectangle, trapezoid, triangle, pentagon, etc. In addition, the cell information may include at least one of the following: cell type indicating coding cell, prediction cell, transform cell, etc., cell size, cell depth, and the order of encoding and decoding of the cell.

[0123] A coding tree unit is a single coding tree block configured with the luminance component Y and two coding tree blocks associated with the chrominance components Cb and Cr. Furthermore, a coding tree unit can represent a block and the syntax elements of each block. Each coding tree unit can be partitioned using at least one of quadtree partitioning, binary tree partitioning, and ternary tree partitioning methods to configure lower-level units such as coding units, prediction units, transform units, etc. A coding tree unit can be used as a term to specify a sample block that becomes a processing unit when encoding / decoding an image as an input image. Here, a quadtree can represent a quaternion tree.

[0124] When the size of the coded block is within a predetermined range, it is possible to partition using only quadtree partitioning. Here, the predetermined range can be defined as at least one of the maximum and minimum sizes of the coded block that can be partitioned using only quadtree partitioning. Information indicating the maximum / minimum size of the coded block that allows quadtree partitioning can be transmitted via a signal in the bitstream, and this information can be transmitted via a signal in at least one unit of sequence, frame parameters, parallel block groups, or stripes (fragments). Optionally, the maximum / minimum size of the coded block can be a predetermined fixed size in the encoder / decoder. For example, when the size of the coded block corresponds to 256×256 to 64×64, it is possible to partition using only quadtree partitioning. Optionally, when the size of the coded block is greater than the size of the maximum transform block, it is possible to partition using only quadtree partitioning. Here, the block to be partitioned can be at least one of a coded block and a transform block. In this case, the information indicating the partitioning of the coded block (e.g., split_flag) can be a flag indicating whether quadtree partitioning is performed. When the size of the coded block falls within a predetermined range, it is possible to partition using only binary or ternary tree partitioning. In this case, the above description of quadtree partitioning can be applied in the same way to binary tree partitioning or ternary tree partitioning.

[0125] Encoding block: Can be used as a term to specify any one of the Y encoding block, Cb encoding block, and Cr encoding block.

[0126] Neighboring blocks: These can represent blocks adjacent to the current block. A block adjacent to the current block can be a block that touches the boundary of the current block, or a block located within a predetermined distance from the current block. A neighboring block can also represent a block adjacent to a vertex of the current block. Here, a block adjacent to a vertex of the current block can be a block that is vertically adjacent to a block horizontally adjacent to the current block, or a block that is horizontally adjacent to a block vertically adjacent to the current block.

[0127] Reconstructing neighboring blocks: This can represent neighboring blocks that are adjacent to the current block and have already been spatially / temporally encoded or decoded. Here, reconstructing neighboring blocks can represent reconstructing neighboring units. Reconstructing spatial neighboring blocks can be blocks within the current frame that have already been reconstructed through encoding or decoding, or both. Reconstructing temporal neighboring blocks are blocks within a reference image that are located at the position corresponding to the current block in the current frame, or are neighboring blocks of said block.

[0128] Cell depth: Represents the degree of cell partitioning. In a tree structure, the highest node (root node) corresponds to the first unpartitioned cell. Furthermore, the highest node can have the minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 represents a cell generated by partitioning the first cell once. A node with a depth of level 2 represents a cell generated by partitioning the first cell twice. A node with a depth of level n represents a cell generated by partitioning the first cell n times. Leaf nodes can be the lowest-level nodes and cannot be further partitioned. The depth of a leaf node can be the highest-level. For example, the predefined value of the highest-level can be 3. The root node can have the lowest depth, and the leaf nodes can have the deepest depth. Additionally, when cells are represented as a tree structure, the level in which the cell exists can represent the cell depth.

[0129] Bitstream: A bitstream that can represent encoded image information.

[0130] Parameter set: Corresponds to the header information in the configuration within the bitstream. At least one of the video parameter set, sequence parameter set, frame parameter set, and adaptive parameter set may be included in the parameter set. Furthermore, the parameter set may include slice headers, tile group headers, and tile header information. The term "tile group" refers to a set of parallel tiles and has the same meaning as a slice.

[0131] Explanation: This could mean determining the value of a syntax element by performing entropy decoding, or it could mean entropy decoding itself.

[0132] Symbols: can represent at least one of the syntax elements, encoding parameters, and transform coefficient values ​​of the encoding / decoding target unit. Additionally, symbols can represent entropy encoding targets or entropy decoding results.

[0133] Prediction mode: This can be information indicating the mode that is encoded / decoded using intra-frame prediction or the mode that is encoded / decoded using inter-frame prediction.

[0134] Prediction Unit: A basic unit that can be represented when performing prediction (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 with smaller sizes, or it can be partitioned into multiple lower-level prediction units. Multiple partitions can be the basic units when performing prediction or compensation. Partitions generated by dividing prediction units can also be prediction units.

[0135] Prediction cell partitioning: can represent the shape obtained by partitioning prediction cells.

[0136] A reference frame list can refer to a list of one or more reference frames used for inter-frame prediction or motion compensation. There are several types of available reference frame lists, including LC (list combination), L0 (list 0), L1 (list 1), L2 (list 2), and L3 (list 3).

[0137] The inter-frame prediction indicator can indicate the direction of inter-frame prediction for the current block (unidirectional prediction, bidirectional prediction, etc.). Optionally, the inter-frame prediction indicator can indicate the number of reference frames used to generate the prediction blocks for the current block. Optionally, the inter-frame prediction indicator can indicate the number of prediction blocks used when performing inter-frame prediction or motion compensation on the current block.

[0138] The prediction list utilization flag indicates whether at least one reference frame from a specific reference frame list is used to generate a prediction block. The prediction list utilization flag can be used to derive an inter-frame prediction indicator, and conversely, the inter-frame 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 a reference frame from the reference frame list is not used to generate a prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it indicates that the reference frame list is used to generate a prediction block.

[0139] The reference screen index can refer to the index of a specific reference screen in the reference screen list.

[0140] A reference frame can refer to a frame referenced by a specific block for the purpose of inter-frame prediction or motion compensation for that specific block. Alternatively, a reference frame can be a frame that includes a reference block referenced by the current block for inter-frame prediction or motion compensation. In the following text, the terms "reference frame" and "reference image" have the same meaning and are interchangeable.

[0141] Motion vectors can be two-dimensional vectors used for inter-frame prediction or motion compensation. A motion vector can represent the offset between the encoded / decoded 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.

[0142] The search range can be a two-dimensional region searched during inter-frame prediction to retrieve motion vectors. For example, the size of the search range can be M×N. Here, M and N are both integers.

[0143] Motion vector candidates can refer to a block of prediction candidates or the motion vectors within a block of prediction candidates when making predictions about motion vectors. Furthermore, motion vector candidates can be included in a list of motion vector candidates.

[0144] A motion vector candidate list can represent a list consisting of one or more motion vector candidates.

[0145] A motion vector candidate index can represent an indicator that points to a motion vector candidate in the motion vector candidate list. Alternatively, it can be an index of a motion vector predictor.

[0146] Motion information may include at least one of the following: motion vector, reference frame index, inter-frame prediction indicator, prediction list utilization flag, reference frame list information, reference frame, motion vector candidate, motion vector candidate index, merge candidate, and merge index.

[0147] A merge candidate list can represent a list consisting of one or more merge candidates.

[0148] Merge candidates can be spatial merge candidates, temporal merge candidates, combined merge candidates, combined double prediction merge candidates, or zero merge candidates. Merge candidates may include motion information such as inter-frame prediction indicators, reference frame indices for each list, motion vectors, prediction list utilization flags, and inter-frame prediction indicators.

[0149] The merge index can represent an indicator pointing to a merge candidate in the merge candidate list. Optionally, the merge index can indicate a block in a reconstructed block that is spatially / temporally adjacent to the current block, from which a merge candidate has been derived. Optionally, the merge index can indicate at least one piece of motion information for a merge candidate.

[0150] Transform unit: This can represent the basic unit used when encoding / decoding (such as transform, inverse transform, quantization, dequantization, transform coefficient encoding / decoding) a residual signal. A single transform unit can be partitioned into multiple lower-level transform units with smaller sizes. Here, the transform / inverse transform may include at least one of a first transform / first inverse transform and a second transform / second inverse transform.

[0151] 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.

[0152] Quantization parameters: These represent values ​​used when transform coefficients are used to generate quantization levels during quantization. Quantization parameters can also represent values ​​used when transform coefficients are generated during dequantization by scaling the quantization levels. Quantization parameters can be values ​​mapped to the quantization step size.

[0153] Incremental quantization parameter: can represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.

[0154] Scan: This can refer to a method of sorting coefficients within a cell, block, or matrix. For example, changing a two-dimensional matrix of coefficients into a one-dimensional matrix can be called a scan, and changing a one-dimensional matrix of coefficients into a two-dimensional matrix can be called a scan or inverse scan.

[0155] Transform coefficients: These represent the coefficient values ​​generated after a transform is performed in the encoder. Transform coefficients can also represent the coefficient values ​​generated after at least one of entropy decoding and dequantization is performed in the decoder. The quantization level obtained by quantizing the transform coefficients or residual signal, or the quantized transform coefficient level, can also fall within the meaning of transform coefficients.

[0156] Quantization level: This can represent the value generated in the encoder by quantizing the transform coefficients or residual signal. Optionally, the quantization level can represent the value of the dequantization target that undergoes dequantization in the decoder. Similarly, the transform coefficient level, as a result of transform and quantization, can also fall within the meaning of quantization level.

[0157] Non-zero transform coefficients: can represent transform coefficients with values ​​other than zero, or transform coefficient levels or quantization levels with values ​​other than zero.

[0158] Quantization matrix: A matrix used in quantization or dequantization processes performed to improve subjective or objective image quality. The quantization matrix can also be referred to as a scaling list.

[0159] Quantization matrix coefficients: These represent each element within the quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.

[0160] Default matrix: can represent a predefined quantization matrix in the encoder or decoder.

[0161] Non-default matrix: can represent a quantization matrix that is not predefined in the encoder or decoder but is sent by the user via signal.

[0162] Statistical value: For at least one of the following variables, coding parameters, constant values, etc., that have a computable specific value, a statistical value can be one or more of the following: mean, summation, weighted average, weighted sum, minimum, maximum, most frequent value, median, interpolation.

[0163] Figure 1 This is a block diagram illustrating the configuration of an encoding device according to an embodiment of the present invention.

[0164] Encoding device 100 may be an encoder, a video encoding device, or an image encoding device. The video may include at least one image. Encoding device 100 may encode at least one image sequentially.

[0165] Reference Figure 1The encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switcher 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy coding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference frame buffer 190.

[0166] Encoding device 100 can encode the input image using intra-frame mode, inter-frame mode, or both. Furthermore, encoding device 100 can generate a bitstream including encoding information by encoding the input image and output the generated bitstream. The generated bitstream can be stored in a computer-readable recording medium or streamed via a wired / wireless transmission medium. When intra-frame mode is used as the prediction mode, switcher 115 can switch to intra-frame mode. Optionally, when inter-frame mode is used as the prediction mode, switcher 115 can switch to inter-frame mode. Here, intra-frame mode can refer to intra-frame prediction mode, and inter-frame mode can refer to inter-frame prediction mode. Encoding device 100 can generate prediction blocks for input blocks of the input image. Furthermore, encoding device 100 can encode residual blocks using the residual between the input block and the prediction block after generating the prediction blocks. The input image can be referred to as the current image as the current encoding target. The input block can be referred to as the current block as the current encoding target, or as the encoding target block.

[0167] When the prediction mode is intra-frame mode, the intra-frame prediction unit 120 can use samples from blocks that have been encoded / decoded and are adjacent to the current block as reference samples. The intra-frame prediction unit 120 can perform spatial prediction on the current block using the reference samples, or generate prediction samples for the input block by performing spatial prediction. Here, intra-frame prediction can refer to prediction within a frame.

[0168] When the prediction mode is inter-frame mode, the motion prediction unit 111 can retrieve the region that best matches the input block from the reference image during motion prediction and derive the motion vector using the retrieved region. In this case, the search region can be used as the region. The reference image can be stored in the reference frame buffer 190. Here, the reference image can be stored in the reference frame buffer 190 when encoding / decoding the reference image is performed.

[0169] The motion compensation unit 112 can generate a prediction block by performing motion compensation on the current block using motion vectors. Here, inter-frame prediction can refer to prediction or motion compensation between frames.

[0170] When the value of the motion vector is not an integer, motion prediction unit 111 and motion compensation unit 112 can generate prediction blocks by applying an interpolation filter to a portion of the reference frame. To perform inter-frame prediction or motion compensation on the coding unit, it can be determined which of the following modes—skip mode, merge mode, Advanced Motion Vector Prediction (AMVP) mode, and current frame reference mode—is used for motion prediction and motion compensation of the prediction unit included in the corresponding coding unit. Then, depending on the determined mode, inter-frame prediction or motion compensation can be performed differently.

[0171] Subtractor 125 generates a residual block by using the difference between the input block and the prediction block. The residual block can be referred to as a residual signal. The residual signal can represent the difference between the original signal and the prediction signal. Furthermore, the residual signal can 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 can be the residual signal of a block cell.

[0172] Transform unit 130 can generate transform coefficients by performing a transform on the residual block and output the generated transform coefficients. Here, the transform coefficients can be coefficient values ​​generated by performing a transform on the residual block. When a transform skip mode is applied, transform unit 130 can skip the transform on the residual block.

[0173] The level of quantization can be generated by applying quantization to the transform coefficients or to the residual signal. In the following examples, the level of quantization may also be referred to as the transform coefficients.

[0174] The quantization unit 140 can generate a quantization level by quantizing the transform coefficients or residual signal according to parameters, and output the generated quantization level. Here, the quantization unit 140 can quantize the transform coefficients using a quantization matrix.

[0175] Entropy coding unit 150 can generate a bitstream by performing entropy coding on the values ​​calculated by quantization unit 140 according to a probability distribution or on the coding parameter values ​​calculated during encoding, and output the generated bitstream. Entropy coding unit 150 can perform entropy coding on sample information of the image and information used for decoding the image. For example, the information used for decoding the image may include syntax elements.

[0176] When entropy coding is applied, symbols are represented such that fewer bits are allocated to symbols with high generation probability and more bits are allocated to symbols with low generation probability, thus reducing the size of the bitstream used to encode the symbols. The entropy coding unit 150 can use coding methods for entropy coding such as exponential Golomb, context-adaptive variable-length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). For example, the entropy coding unit 150 can perform entropy coding by using a variable-length code (VLC) table. Furthermore, the entropy coding unit 150 can derive a binarization method for the target symbol and a probability model for the target symbol / bits, and perform arithmetic coding by using the derived binarization method and context model.

[0177] In order to encode the transform coefficient levels (quantization levels), the entropy coding unit 150 can change the coefficients in two-dimensional block form into one-dimensional vector form by using a transform coefficient scanning method.

[0178] Encoding parameters may include information such as syntax elements (flags, indexes, etc.) encoded in the encoder and signaled to the decoder, as well as information derived during encoding or decoding. Encoding parameters can represent the information required when encoding or decoding an image. For example, at least one value or combination of the following may be included in the encoding parameters: cell / block size, cell / block depth, cell / block partitioning information, cell / block shape, cell / block partitioning structure, whether quadtree partitioning is performed, whether binary tree partitioning is performed, binary tree partitioning direction (horizontal or vertical), binary tree partitioning type (symmetric or asymmetric), whether the current encoded unit is partitioned via ternary tree partitioning, the direction of the ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric or asymmetric), whether the current encoded unit is partitioned via multi-type tree partitioning, and the type of multi-type tree partitioning. Direction (horizontal or vertical), type of multi-type tree partition (symmetric or asymmetric), tree structure of multi-type tree partition (binary or ternary), prediction mode (intra-frame prediction or inter-frame prediction), luma intra-frame prediction mode / direction, chroma intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coded 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 frame index, inter-frame prediction angle, inter-frame prediction indicator, prediction list utilization flag, reference frame list, reference frame, 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 taps, interpolation filter coefficients, motion vector magnitude, motion vector representation accuracy, transform type, transform size, information on whether the primary (first) transform is used, information on whether the secondary transform is used, primary transform index, secondary transform index Information on the presence of residual signals, code block style, code block flag (CBF), quantization parameters, quantization parameter residuals, quantization matrix, whether an intra-loop filter is applied, intra-loop filter coefficients, intra-loop filter taps, intra-loop filter shape / form, whether a deblocking filter is applied, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether adaptive sample offset is applied, adaptive sample offset value, adaptive sample offset type, adaptive sample offset function, whether an adaptive intra-loop filter is applied, 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 bits, bypass binary bits, valid coefficient flag, last valid coefficient flag, encoding flag for the unit of the coefficient group, position of the last valid coefficient, flag indicating whether the coefficient value is greater than 1, flag indicating whether the coefficient value is greater than 2, flag indicating whether the coefficient value is greater than 3, information about the remaining coefficient values, symbol information, reconstructed luminance samples, reconstructed chrominance samples, residual luminance samples, residual chrominance samples, luminance transformation coefficient, chrominance transformation coefficient, quantized luminance level, quantized chrominance level, transformation coefficient level scanning method, motion vector search area on the decoder side. The data includes the domain size, the shape of the motion vector search area on the decoder side, the number of motion vector searches on the decoder side, information about the CTU size, information about the minimum block size, information about the maximum block size, information about the maximum block depth, information about the minimum block depth, image display / output order, stripe identification information, stripe type, stripe partition information, parallel block identification information, parallel block type, parallel block partition information, parallel block group identification information, parallel block group type, parallel block group partition information, image type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantization levels, and information about the luminance signal or the chrominance signal.

[0179] Here, sending a flag or index with a signal can indicate that the encoder entropy-encodes the corresponding flag or index and includes it in the bitstream, and can also indicate that the decoder entropy-decodes the corresponding flag or index from the bitstream.

[0180] When the encoding device 100 performs encoding via inter-frame prediction, the encoded current image can be used as a reference image for another image to be processed subsequently. Therefore, the encoding device 100 can reconstruct or decode the encoded current image, or store the reconstructed or decoded image as a reference image in the reference frame buffer 190.

[0181] The quantization level can be dequantized in dequantization unit 160 or inverse transformed in inverse transform unit 170. The coefficients that have undergone dequantization or inverse transform, or both, can be added to the prediction block by adder 175. A reconstruction block can be generated by adding the coefficients that have undergone dequantization or inverse transform, or both, to the prediction block. Here, the coefficients that have undergone dequantization or inverse transform, or both, can represent coefficients for which at least one of dequantization and inverse transform has been performed, and can represent the reconstructed residual block.

[0182] The reconstructed block can be passed through filter unit 180. Filter unit 180 can apply at least one of deblocking filter, sample adaptive offset (SAO), and adaptive in-loop filter (ALF) to the reconstructed sample, reconstructed block, or reconstructed image. Filter unit 180 may be referred to as an in-loop filter.

[0183] Deblocking filters remove block distortion generated at the boundaries between blocks. To determine whether to apply a deblocking filter, the number of samples included in several rows or columns within the block can be used. When a deblocking filter is applied to a block, another filter can be applied based on the desired deblocking intensity.

[0184] To compensate for coding errors, a suitable offset value can be added to the sample value using a sample-adaptive offset. The sample-adaptive offset corrects the offset between the deblocked image and the original image on a sample-by-sample basis. This can be achieved by considering edge information about each sample point when applying the offset, or by dividing the image's samples into a predetermined number of regions, determining the regions where the offset will be applied, and then applying the offset to those regions.

[0185] The adaptive in-loop filter (ALF) performs filtering based on a comparison between the filtered reconstructed image and the original image. 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 regarding whether to apply the ALF can be transmitted via a signal through the coding unit (CU), and the form and coefficients of the ALF to be applied to each block can vary.

[0186] The reconstructed blocks or reconstructed image that have passed through filter unit 180 can be stored in reference frame buffer 190. The reconstructed blocks processed by filter unit 180 can be a portion of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by filter unit 180. The stored reference image can be used later in inter-frame prediction or motion compensation.

[0187] Figure 2 This is a block diagram illustrating the configuration of a decoding device according to an embodiment and to which the present invention is applied.

[0188] Decoding device 200 can be a decoder, video decoding device, or image decoding device.

[0189] Reference Figure 2 The decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference frame buffer 270.

[0190] Decoding device 200 can receive bitstreams output from encoding device 100. Decoding device 200 can receive bitstreams stored on a computer-readable recording medium, or bitstreams streamed via wired / wireless transmission media. Decoding device 200 can decode the bitstreams using intra-frame mode or inter-frame mode. Furthermore, decoding device 200 can generate and output reconstructed or decoded images generated through decoding.

[0191] When the prediction mode used during decoding is intra-frame mode, the switcher can be switched to intra-frame mode. Optionally, when the prediction mode used during decoding is inter-frame mode, the switcher can be switched to inter-frame mode.

[0192] Decoding device 200 obtains a reconstructed residual block and generates a prediction block by decoding the input bitstream. Once the reconstructed residual block and prediction block are obtained, decoding device 200 generates a reconstructed block that becomes the decoding target by adding the reconstructed residual block and the prediction block. The decoding target block can be referred to as the current block.

[0193] The entropy decoding unit 210 can generate symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols may include symbols in quantized hierarchical form. Here, the entropy decoding method can be the inverse process of the entropy encoding method described above.

[0194] In order to decode the transform coefficient levels (quantization levels), the entropy decoding unit 210 can change the coefficients in unidirectional vector form into two-dimensional block form by using a transform coefficient scanning method.

[0195] The quantization level can be dequantized in the dequantization unit 220, or the quantization level can be inversely transformed in the inverse transform unit 230. The quantization level can be the result of dequantization, inverse transform, or both, and can be generated as a reconstruction residual block. Here, the dequantization unit 220 can apply the quantization matrix to the quantization level.

[0196] When using intra-frame mode, intra-frame prediction unit 240 can generate a prediction block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values ​​of blocks that are adjacent to the target block and have already been decoded.

[0197] When using inter-frame mode, motion compensation unit 250 can generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses motion vectors and a reference image stored in reference frame buffer 270.

[0198] Adder 255 generates a reconstructed block by adding the reconstructed residual block to the prediction block. Filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive in-loop filter to the reconstructed block or reconstructed image. Filter unit 260 can output a reconstructed image. The reconstructed block or reconstructed image can be stored in a reference frame buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by filter unit 260 can be a portion of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by filter unit 260. The stored reference image can be used later in inter-frame prediction or motion compensation.

[0199] Figure 3 It is a schematic diagram illustrating the partitioning structure of an image when it is encoded and decoded. Figure 3 An example of dividing a single cell into multiple sub-cells is illustrated schematically.

[0200] To effectively partition an image, coding units (CUs) are used during encoding and decoding. A coding unit can serve as the basic unit when encoding / decoding an image. Furthermore, a coding unit can be used to distinguish between intra-frame prediction modes and inter-frame prediction modes during image encoding / decoding. A coding unit can be the basic unit used for prediction, transform, quantization, inverse transform, inverse quantization, or encoding / decoding processing of transform coefficients.

[0201] Reference Figure 3 Image 300 is partitioned sequentially according to the Largest Coding Unit (LCU), and the LCU unit is determined as the partitioning structure. Here, LCU can be used with the same meaning as Coding Tree Unit (CTU). Unit partitioning can represent partitioning of the block associated with that unit. The block partitioning information may include information about the unit depth. The depth information may represent the number or degree to which the unit is partitioned, or both the number and degree to which the unit is partitioned. A single unit can 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 the child nodes of that node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information representing the size of the CU and may be stored in each CU. The unit depth represents the number and / or degree associated with partitioning the unit. Therefore, the partitioning information of the lower-level units may include information about the size of the lower-level units.

[0202] The partitioning structure represents the distribution of coding units (CUs) within the LCU 310. This distribution can be determined by whether a single CU is partitioned into multiple CUs (including positive integers equal to or greater than 2, such as 2, 4, 8, 16, etc.). The horizontal and vertical dimensions of the CUs generated by partitioning can be half the horizontal and vertical dimensions of the CUs before partitioning, respectively, or they can have dimensions smaller than the horizontal and vertical dimensions before partitioning, depending on the number of partitions performed. CUs can be recursively partitioned into multiple CUs. Through recursive partitioning, at least one of the height and width of the CU after partitioning can be reduced compared to at least one of the height and width of the CU before partitioning. CU partitioning can be performed recursively until a predefined depth or a predefined size is reached. For example, the depth of the LCU can be 0, and the depth of the minimum coding unit (SCU) can be a predefined maximum depth. Here, as mentioned above, the LCU can be a coding unit with the maximum coding unit size, and the SCU can be a coding unit with the minimum coding unit size. Partitioning begins at LCU 310. The CU depth increases by 1 when the horizontal or vertical dimension of a CU, or both, are reduced through partitioning. For example, for each depth, the size of an unpartitioned CU can be 2N×2N. Furthermore, in the case of partitioned CUs, 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.

[0203] Furthermore, partition information of a CU can be used to indicate whether a CU is partitioned. Partition information can be 1 bit. All CUs except SCUs can include partition information. For example, when the partition information value is the first value, the CU may not be partitioned; when the partition information value is the second value, the CU may be partitioned.

[0204] Reference Figure 3 An LCU with depth 0 can be a 64×64 block. 0 can be the minimum depth. An SCU with depth 3 can be an 8×8 block. 3 can be the maximum depth. CUs with 32×32 blocks and 16×16 blocks can be represented as depth 1 and depth 2, respectively.

[0205] For example, when a single coding unit is partitioned into four coding units, the horizontal and vertical dimensions of the four partitioned coding units can be half the size of the CU before partitioning. In one embodiment, when a 32×32 coding unit is partitioned into four coding units, each of the four partitioned coding units can have a size of 16×16. When a single coding unit is partitioned into four coding units, the coding unit can be said to be partitioned into a quadtree form.

[0206] For example, when a coding unit is partitioned into two sub-coding units, the horizontal or vertical dimension (width or height) of each of the two sub-coding units can be half the horizontal or vertical dimension of the original coding unit. For example, when a coding unit of size 32×32 is vertically partitioned into two sub-coding units, each of the two sub-coding units can have a size of 16×32. For example, when a coding unit of size 8×32 is horizontally partitioned into two sub-coding units, each of the two sub-coding units can have a size of 8×16. When a coding unit is partitioned into two sub-coding units, it can be said that the coding unit is binary partitioned or partitioned according to a binary tree partitioning structure.

[0207] For example, when a coding unit is divided into three sub-coding units, the horizontal or vertical dimensions of the coding unit can be divided in a 1:2:1 ratio, resulting in three sub-coding units with a horizontal or vertical dimension ratio of 1:2:1. For instance, when a 16×32 coding unit is horizontally divided into three sub-coding units, these three sub-coding units, in order from the top to the bottom, can have dimensions of 16×8, 16×16, and 16×8, respectively. Similarly, when a 32×32 coding unit is vertically divided into three sub-coding units, these three sub-coding units, in order from the left to the right, can have dimensions of 8×32, 16×32, and 8×32, respectively. When a coding unit is divided into three sub-coding units, it can be said that the coding unit is tri-partitioned or partitioned according to a ternary tree partitioning structure.

[0208] exist Figure 3 In the example, the coding tree unit (CTU) 320 is an example of a CTU in which quadtree partitioning, binary tree partitioning, and ternary tree partitioning structures are all applied.

[0209] As described above, to partition the CTU, at least one of a quadtree partitioning structure, a binary tree partitioning structure, and a ternary tree partitioning structure can be applied. Various tree partitioning structures can be applied sequentially to the CTU according to a predetermined priority order. For example, a quadtree partitioning structure can be preferentially applied to the CTU. Encoding units that cannot be further partitioned using a quadtree partitioning structure can correspond to leaf nodes of a quadtree. Encoding units corresponding to leaf nodes of a quadtree can be used as root nodes of binary and / or ternary tree partitioning structures. That is, encoding units corresponding to leaf nodes of a quadtree can be further partitioned according to a binary or ternary tree partitioning structure, or they can be left unpartitioned. Therefore, by preventing encoding units obtained from binary or ternary tree partitioning of encoding units corresponding to leaf nodes of a quadtree from undergoing further quadtree partitioning, block partitioning operations and / or the operation of signaling partitioning information can be effectively performed.

[0210] The fact that a coding unit corresponding to a node in a quadtree is partitioned can be signaled using four-partition information. Four-partition information with a first value (e.g., "1") indicates that the current coding unit is partitioned according to the quadtree partitioning structure. Four-partition information with a second value (e.g., "0") indicates that the current coding unit is not partitioned according to the quadtree partitioning structure. The four-partition information can be a flag with a predetermined length (e.g., one bit).

[0211] There may be no priority between binary tree partitions and ternary tree partitions. That is, the coding unit corresponding to the leaf node of the quadtree can further undergo any partition in either binary tree or ternary tree partitions. Furthermore, the coding unit generated by binary tree partitions or ternary tree partitions may undergo further binary tree partitions or further ternary tree partitions, or it may not be further partitioned.

[0212] A tree structure in which there is no priority between binary tree partitions and ternary tree partitions is called a multi-type tree structure. The coding unit corresponding to the leaf node of a quadtree can be used as the root node of a multi-type tree. At least one of 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 a node in the multi-type tree. To partition the coding unit corresponding to a node in the multi-type tree, the multi-type tree partition indication information, partition direction information, and partition tree information can be signaled sequentially.

[0213] A multi-type tree partitioning indication with a first value (e.g., "1") indicates that the current coding unit will undergo a multi-type tree partition. A multi-type tree partitioning indication with a second value (e.g., "0") indicates that the current coding unit will not undergo a multi-type tree partition.

[0214] When the coding unit corresponding to a node of a multi-type tree is further partitioned according to the multi-type tree partitioning structure, the coding unit may include partitioning direction information. The partitioning direction information may indicate in which direction the current coding unit will be partitioned for the multi-type tree partition. Partitioning direction information with a first value (e.g., "1") may indicate that the current coding unit will be vertically partitioned. Partitioning direction information with a second value (e.g., "0") may indicate that the current coding unit will be horizontally partitioned.

[0215] When the coding unit corresponding to a node of a multi-type tree is further partitioned according to the multi-type tree partitioning structure, the current coding unit may include partitioning tree information. The partitioning tree information may indicate the tree partitioning structure that will be used to partition the nodes of the multi-type tree. Partitioning tree information with a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to a binary tree partitioning structure. Partitioning tree information with a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to a ternary tree partitioning structure.

[0216] The partition indication information, partition tree information, and partition direction information can all be flags with a predetermined length (e.g., one bit).

[0217] At least one of the following—quadtree partitioning indication information, multi-type tree partitioning indication information, partitioning direction information, and partitioning tree information—can be entropy encoded / decoded. To entropy encode / decode those types of information, information about neighboring coding units adjacent to the current coding unit can be used. For example, it is highly likely that the partitioning type (partitioned or unpartitioned, partitioning tree, and / or partitioning direction) of the left-hand neighboring coding unit and / or above-hand neighboring coding unit is similar to the partitioning type of the current coding unit. Therefore, contextual information for entropy encoding / decoding of information about the current coding unit can be derived from the information about neighboring coding units. Information about neighboring coding units may include at least one of the following: quadtree partitioning information, multi-type tree partitioning indication information, partitioning direction information, and partitioning tree information.

[0218] As another example, in binary tree partitioning and ternary tree partitioning, binary tree partitioning can be performed first. That is, the current coding unit can first undergo binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree can be set as the root node for 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 can be performed.

[0219] Encoding units that cannot be partitioned according to quadtree, binary tree, and / or ternary tree partitioning structures become the basic units for encoding, prediction, and / or transformation. In other words, these encoding units cannot be further partitioned for prediction and / or transformation. Therefore, partitioning structure information and partitioning information for dividing encoding units into prediction and / or transformation units may not exist in the bitstream.

[0220] However, when the size of the coding unit (i.e., the basic unit used for partitioning) is larger than the size of the maximum transform block, the coding unit can be partitioned recursively 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 can be partitioned into four 32×32 blocks for transformation. 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 can be partitioned into two 32×32 blocks for transformation. In this case, the partitioning of the coding unit for transformation is not sent separately with a signal, and the partitioning of the coding unit for transformation can be determined by comparing the horizontal or vertical dimensions of the coding unit with the horizontal or vertical dimensions of the maximum transform block. For example, when the horizontal dimension (width) of the coding unit is greater than the horizontal dimension (width) of the maximum transform block, the coding unit can be vertically bisected. For example, when the vertical dimension (height) of the coding unit is greater than the vertical dimension (height) of the maximum transform block, the coding unit can be horizontally bisected.

[0221] Information regarding the maximum and / or minimum size of the coding unit and the maximum and / or minimum size of the transform block can be transmitted or determined by signals at the higher level of the coding unit. The higher level can be, for example, a sequence level, a frame level, a stripe level, a parallel block group level, a parallel block level, etc. For example, the minimum size of the coding unit can be determined to be 4×4. For example, the maximum size of the transform block can be determined to be 64×64. For example, the minimum size of the transform block can be determined to be 4×4.

[0222] Information regarding the minimum size of the coding unit corresponding to the leaf node of the quadtree (minimum size of the quadtree) and / or the maximum depth from the root node to the leaf node of the multi-type tree (maximum depth of the multi-type tree) can be signaled or determined at the higher level of the coding unit. For example, the higher level can be the sequence level, frame level, stripe level, parallel block group level, parallel block level, etc. Information regarding the minimum size of the quadtree and / or the maximum depth of the multi-type tree can be signaled or determined for each of the intra-frame stripes and inter-frame stripes.

[0223] The difference between the size of the CTU and the maximum size of the transform block can be signaled or determined at the higher level of the coding unit. For example, the higher level can be a sequence level, frame level, stripe level, parallel block group level, parallel block level, etc. The maximum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the maximum size of the binary tree) can be determined based on the size of the coding tree unit and the difference information. The maximum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the maximum size of the ternary tree) can vary depending on the type of stripe. For example, for an intra-frame stripe, the maximum size of the ternary tree can be 32×32. For example, for an inter-frame stripe, the maximum size of the ternary tree can be 128×128. For example, the minimum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the minimum size of the binary tree) and / or the minimum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the minimum size of the ternary tree) can be set as the minimum size of the coding block.

[0224] As another example, the maximum size of a binary tree and / or the maximum size of a ternary tree can be signaled or determined at the stripe level. Alternatively, the minimum size of a binary tree and / or the minimum size of a ternary tree can be signaled or determined at the stripe level.

[0225] Based on the size and depth information of the various blocks mentioned above, four-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.

[0226] For example, when the size of the coding unit is no greater than the minimum size of the quadtree, the coding unit does not include four-partition information. The four-partition information can be inferred as a second value.

[0227] For example, when the size (horizontal and vertical dimensions) of the coding unit corresponding to a node of a multi-type tree is greater than the maximum size (horizontal and vertical dimensions) of a binary tree and / or a ternary tree, the coding unit may not be divided into two or three partitions. Therefore, multi-type tree partition indication information can be sent without a signal, but the multi-type tree partition indication information can be inferred as a second value.

[0228] Optionally, when the size (horizontal and vertical dimensions) of the coding unit corresponding to a node of a multi-type tree is the same as the maximum size (horizontal and vertical dimensions) of a binary tree and / or twice the maximum size (horizontal and vertical dimensions) of a ternary tree, the coding unit may not be further divided into two or three partitions. Therefore, multi-type tree partitioning indication information does not need to be sent by signal, but the multi-type tree partitioning indication information can be inferred as a second value. This is because when the coding unit is partitioned according to the binary tree partitioning structure and / or the ternary tree partitioning structure, coding units smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree are generated.

[0229] Optionally, binary or ternary partitioning can 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 are not suitable for the pipeline buffer size through binary or ternary partitioning, the corresponding binary or ternary partitioning may be limited. The pipeline buffer size can 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 can be limited.

[0230] - N×M (N and / or M are 128) ternary tree partitions for encoding units

[0231] - 128×N (N<=64) binary tree partitioning for the horizontal direction of the encoding unit

[0232] - N×128 (N<=64) binary tree partitions used in the vertical direction of the encoding unit

[0233] Optionally, when the depth of the coding unit corresponding to a node in the multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further divided into two and / or three partitions. Therefore, multi-type tree partition indication information may not be sent by signal, but the multi-type tree partition indication information can be inferred as a second value.

[0234] Optionally, multi-type tree partitioning indication information may be signaled only if at least one of the vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is possible for the coding unit corresponding to the node of the multi-type tree. Otherwise, the coding unit may not be partitioned into two and / or three partitions. Therefore, multi-type tree partitioning indication information may not be signaled, but the multi-type tree partitioning indication information may be inferred as a second value.

[0235] Optionally, partition direction information may be signaled only if both vertical binary tree partitioning and horizontal binary tree partitioning, or both vertical ternary tree partitioning and horizontal ternary tree partitioning, are possible for the coding units corresponding to nodes of multiple tree types. Otherwise, partition direction information may not be signaled, but the partition direction information may be inferred as a value indicating the possible partition direction.

[0236] Optionally, partition tree information may be signaled only if both vertical binary tree partitions and vertical ternary tree partitions, or both horizontal binary tree partitions and horizontal ternary tree partitions, are possible for the encoded tree corresponding to the nodes of the 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.

[0237] Figure 4 This is a diagram illustrating intra-frame prediction processing.

[0238] Figure 4 The arrows from the center outwards indicate the prediction direction of the intra-frame prediction mode.

[0239] Intra-frame coding and / or decoding can be performed using reference samples from neighboring blocks of the current block. A neighboring block can be a reconstructed neighboring block. For example, intra-frame coding and / or decoding can be performed using values ​​of reference samples or coding parameters included in the reconstructed neighboring block.

[0240] A prediction block can represent a block generated by performing intra-frame prediction. A prediction block can correspond to at least one of CU, PU, ​​and TU. The cells of a prediction block can have the size of one of CU, PU, ​​and TU. A prediction block can be a square block with dimensions such as 2×2, 4×4, 16×16, 32×32, or 64×64, or a rectangular block with dimensions such as 2×8, 4×8, 2×16, 4×16, and 8×16.

[0241] Intra-prediction can be performed based on the intra-prediction mode for the current block. The number of intra-prediction modes that the current block can have can be a fixed value, or it can be a value determined differently depending on the attributes of the predicted block. For example, the attributes of the predicted block can include the size and shape of the predicted block.

[0242] Regardless of the block size, the number of intra-prediction modes can be fixed at N. Alternatively, the number of intra-prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65, or 67, etc. Optionally, the number of intra-prediction modes can vary depending on the block size or the color component type, or both. For example, the number of intra-prediction modes can vary depending on whether the color component is a luma signal or a chrominance signal. For example, the number of intra-prediction modes can increase as the block size increases. Optionally, the number of intra-prediction modes for the luma component block can be greater than the number of intra-prediction modes for the chrominance component block.

[0243] Intra-prediction modes can be non-angular or angular. Non-angular modes can be DC or planar modes, and angular modes can be prediction modes with a specific direction or angle. Intra-prediction modes can be represented by at least one of mode number, mode value, mode number, mode angle, and mode direction. The number of intra-prediction modes can be greater than 1M, including both non-angular and angular modes. To perform intra-prediction on the current block, a step can be performed to determine whether a sample included in the reconstructed neighboring block can be used as a reference sample for the current block. When there are samples that cannot be used as reference samples for the current block, the value obtained by copying or interpolating at least one sample value included in the reconstructed neighboring block, or both, can be used to replace the unavailable sample value, and the replaced sample value is used as the reference sample for the current block.

[0244] Figure 7 This is a diagram showing reference samples that can be used for intra-frame prediction.

[0245] like Figure 7 As shown, at least one of reference sample lines 0 to 3 can be used for intra-frame prediction of the current block. Figure 7 In this process, samples from fragments A and F can be filled using samples from the nearest fragments B and E, respectively, instead of being retrieved from reconstructed neighboring blocks. Index information of the reference sample lines to be used for intra-frame prediction of the current block can be transmitted using signals. For example, in... Figure 7 In this configuration, reference sample line indicators 0, 1, and 2 can 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 can be available. Therefore, in this case, index information does not need to be signaled. When reference sample lines other than reference sample line 0 are used, filtering for the prediction block, which will be described later, is not required.

[0246] When performing intra-frame prediction, filters can be applied to at least one of the reference samples and the prediction samples based on the intra-frame prediction mode and the current block size.

[0247] In planar mode, when generating the prediction block for the current block, the sample value of the target sample is generated by using a weighted sum of the upper and left reference samples, and the upper right and lower left reference samples of the current block, based on the position of the target sample within the prediction block. Furthermore, in DC mode, the average of the upper and left reference samples of the current block can be used when generating the prediction block. Additionally, in angled mode, the prediction block can be generated using the upper, left, upper right, and / or lower left reference samples of the current block. Real-valued interpolation can be performed to generate the prediction sample values.

[0248] In the case of intra-frame prediction between color components, a predicted 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, the parameters of a linear model between the first and second color components can be derived based on a template. The template may include the upper and / or left neighboring samples of the current block and the upper and / or left neighboring samples of the reconstructed block of the corresponding 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 in the template and its corresponding sample value of the second color component, and the sample value of the first color component with the minimum value in the template and its corresponding sample value of the second color component. When deriving the parameters of the linear model, the corresponding reconstructed block can be applied to the linear model to generate a predicted block for the current block. Depending on the video format, subsampling can be performed on the neighboring samples and the corresponding reconstructed block of the reconstructed block of the first color component. For example, when a sample point of the second color component corresponds to four samples of the first color component, the four samples of the first color component can be subsampled to calculate a corresponding sample point. In this case, parameter derivation of the linear model and intra-frame prediction between color components can be performed based on the corresponding subsampled sample points. Whether to perform intra-frame prediction between color components and / or the range of the template can be sent as an intra-frame prediction mode signal.

[0249] The current block can be partitioned into two or four sub-blocks, either horizontally or vertically. The partitioned sub-blocks can be reconstructed sequentially. That is, intra-prediction can be performed on the sub-blocks to generate sub-prediction blocks. Furthermore, inverse quantization and / or inverse transform can be performed on the sub-blocks to generate sub-residual blocks. Reconstructed sub-blocks can be generated by adding the sub-prediction blocks to the sub-residual blocks. The reconstructed sub-blocks can be used as reference samples for intra-prediction of subsequent sub-blocks. A sub-block can be a block comprising a predetermined number (e.g., 16) or more samples. Therefore, for example, when the current block is an 8×4 or 4×8 block, the current block can be partitioned into two sub-blocks. Furthermore, when the current block is a 4×4 block, the current block may not be partitioned into sub-blocks. When the current block has other sizes, the current block can be partitioned into four sub-blocks. Information regarding whether intra-prediction is performed based on sub-blocks and / or partitioning direction (horizontal or vertical) can be signaled. Intra-prediction based on sub-blocks can be limited to being performed only when using reference sample line 0. When performing sub-block-based intra-frame prediction, filtering for the prediction block, which will be described later, may not be performed.

[0250] A final prediction block can be generated by performing filtering on the prediction block that has been intra-predicted. Filtering can be performed by applying predetermined weights to the target sample, the left reference sample, the top reference sample, and / or the top-left reference sample. 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-prediction mode, and the position of the target sample in the prediction block. Filtering can be performed only in a predetermined intra-prediction mode (e.g., DC, planar, vertical, horizontal, diagonal, and / or adjacent diagonal mode). An adjacent diagonal mode can be a mode that is diagonal mode plus k or subtracted from diagonal mode. For example, k can be a positive integer of 8 or less.

[0251] The intra-prediction mode of the current block can be entropy-coded / decoded by predicting the intra-prediction modes of adjacent blocks. When the intra-prediction modes of the current block and its neighboring blocks are the same, information indicating that the intra-prediction modes of the current block and its neighboring blocks are the same can be signaled using predetermined flag information. Furthermore, an indicator of the intra-prediction mode among multiple neighboring blocks that is the same as the intra-prediction mode of the current block can be signaled. When the intra-prediction modes of the current block and its neighboring blocks are different, the intra-prediction mode information of the current block can be entropy-coded / decoded by performing entropy coding / decoding based on the intra-prediction modes of neighboring blocks.

[0252] Figure 5 This is a diagram illustrating an embodiment of inter-screen prediction processing.

[0253] exist Figure 5 In this context, rectangles can represent the image. Figure 5In the image, the arrow indicates the prediction direction. Based on the encoding type of the frame, frames can be classified into intra-frame frames (I-frames), predictive frames (P-frames), and dual-predictive frames (B-frames).

[0254] I-frames can be encoded via intra-frame prediction without requiring inter-frame prediction. P-frames can be encoded via inter-frame prediction using reference frames present in one direction (i.e., forward or backward) relative to the current block. B-frames can be encoded via inter-frame prediction using reference frames present in both directions (i.e., forward and backward) relative to the current block. When using inter-frame prediction, the encoder can perform inter-frame prediction or motion compensation, and the decoder can perform the corresponding motion compensation.

[0255] The following section will describe in detail an embodiment of inter-screen prediction.

[0256] Reference frames and motion information can be used to perform inter-frame prediction or motion compensation.

[0257] Motion information of the current block can be derived by each of the encoding device 100 and the decoding device 200 during inter-frame prediction. The motion information of the current block can be derived using motion information of reconstructed neighboring blocks, motion information of co-located blocks (also called col blocks or co-position blocks), and / or motion information of blocks adjacent to the co-position block. A co-position block can represent a block within a previously reconstructed co-located frame (also called a col frame or co-position frame) that is spatially located at the same position as the current block. A co-position frame can be one of one or more reference frames included in a list of reference frames.

[0258] The methods for deriving motion information can 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 partitioning mode, combined inter-frame-intra-frame prediction mode, affine mode, etc. Here, the merge mode can be referred to as motion merge mode.

[0259] For example, when AMVP is used as a prediction mode, at least one of the motion vectors of reconstructed neighboring blocks, co-located blocks, blocks adjacent to co-located blocks, and (0,0) motion vectors can be identified as motion vector candidates for the current block, and a motion vector candidate list is generated using these motion vector candidates. Motion vector candidates for the current block can be derived using the generated motion vector candidate list. Motion information for the current block can be determined based on the derived motion vector candidates. The motion vectors of co-located blocks or blocks adjacent to co-located blocks can be referred to as temporal motion vector candidates, and the motion vectors of reconstructed neighboring blocks can be referred to as spatial motion vector candidates.

[0260] Encoding device 100 can calculate the motion vector difference (MVD) between the motion vector of the current block and motion vector candidates, and can perform entropy encoding on the motion vector difference (MVD). Furthermore, encoding device 100 can perform entropy encoding on the motion vector candidate index and generate a bitstream. The motion vector candidate index indicates the best motion vector candidate among the motion vector candidates included in the motion vector candidate list. Decoding device 200 can perform entropy decoding on the motion vector candidate index included in the bitstream, and can select motion vector candidates for the target block to be decoded from the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. Furthermore, decoding device 200 can add the entropy-decoded MVD to the motion vector candidate extracted by entropy decoding, thereby deriving the motion vector of the target block to be decoded.

[0261] Additionally, the encoding device 100 can perform entropy encoding on the calculated MVD resolution information. The decoding device 200 can use the MVD resolution information to adjust the resolution of the entropy-decoded MVD.

[0262] Additionally, the encoding device 100 calculates the motion vector difference (MVD) between the motion vectors and motion vector candidates in the current block based on an affine model, and performs entropy encoding on the MVD. The decoding device 200 derives motion vectors based on each sub-block by deriving the affine control motion vector of the decoded target block based on the sum of the entropied MVD and the affine control motion vector candidates.

[0263] The bitstream may include a reference frame index indicating a reference frame. The reference frame index may be entropy encoded by the encoding device 100 and subsequently transmitted as a bitstream to the decoding device 200. The decoding device 200 may generate a predicted block for the decoded target block based on the derived motion vectors and the reference frame index information.

[0264] Another example of a method for deriving motion information for the current block could be a merge pattern. A merge pattern can represent a method for merging the motion of multiple blocks. A merge pattern can represent a pattern for deriving motion information for the current block from the motion information of neighboring blocks. When applying a merge pattern, a list of merge candidates can be generated using reconstructed motion information of neighboring blocks and / or motion information of blocks at the same location. Motion information may include at least one of motion vectors, reference frame indices, and inter-frame prediction indicators. The prediction indicators may indicate unidirectional prediction (L0 prediction or L1 prediction) or bidirectional prediction (L0 prediction and L1 prediction).

[0265] The merge candidate list can be a list of stored motion information. The motion information included in the merge candidate list can be at least one of the following: motion information of neighboring blocks adjacent to the current block (spatial merge candidate), motion information of blocks at the same position in the reference frame of the current block (temporal merge candidate), new motion information generated by combining motion information existing in the merge candidate list, motion information of blocks encoded / decoded before the current block (history-based merge candidate), and zero merge candidate.

[0266] Encoding device 100 can generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and can transmit the bitstream as a signal to decoding device 200. The merge flag may be information indicating whether a merge mode is performed for each block, and the merge index may be information indicating which neighboring block among the current block's neighboring blocks is the target block for merging. 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 time neighboring block that is temporally adjacent to the current block.

[0267] Additionally, the encoding device 100 performs entropy encoding on the correction information for correcting motion vectors in the motion information of the merging candidates and sends it as a signal to the decoding device 200. The decoding device 200 can correct the motion vectors of the merging candidates selected by the merging 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 that corrects the motion vectors of the merging candidates based on the correction information sent as a signal can be referred to as a merging mode with motion vector difference.

[0268] Skip mode can be a mode in which motion information of neighboring blocks is applied to the current block as is. When skip mode is applied, encoding device 100 can perform entropy encoding on information about which block's motion information will be used as the current block's motion information to generate a bitstream, and can send the bitstream to decoding device 200 as a signal. Encoding device 100 may not send syntax elements regarding at least one of motion vector difference information, coded block flags, and transform coefficient levels to decoding device 200 as a signal.

[0269] Sub-block merging patterns can represent a pattern for deriving motion information on a sub-block basis within a coded block (CU). When applying a sub-block merging pattern, a list of sub-block merging candidates can be generated using motion information of sub-blocks at the same position as the current sub-block in a reference image (based on sub-block temporal merging candidates) and / or affine control point motion vector merging candidates.

[0270] A geometric partitioning pattern can be represented as follows: motion information is derived by partitioning the current block in a predetermined direction, each of the derived motion information is used to derive each prediction sample, and the prediction sample of the current block is derived by weighting each of the derived prediction samples.

[0271] The inter-frame-intra-frame combined prediction mode can be represented as a mode for deriving the prediction samples of the current block by weighting the prediction samples generated by inter-frame prediction and the prediction samples generated by intra-frame prediction.

[0272] The decoding device 200 can self-correct the derived motion information. The decoding device 200 can search a predetermined region based on a reference block indicated by the derived motion information and derive motion information with minimum SAD as corrected motion information.

[0273] Decoding device 200 can use optical flow to compensate for prediction samples derived via inter-frame prediction.

[0274] Figure 6 This is a diagram illustrating the transformation and quantization processes.

[0275] like Figure 6 As shown, transform and / or quantization are performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the predicted block (i.e., an intra-frame predicted block or an inter-frame predicted block). The predicted block is generated through intra-frame prediction or inter-frame prediction. The transform can be a primary transform, a secondary transform, or both. The primary transform of the residual signal generates transform coefficients, and the secondary transform of the transform coefficients generates secondary transform coefficients.

[0276] At least one scheme selected from a variety of predefined transform schemes is used to perform the primary transform. Examples of the predefined transform schemes include the Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), and Karhunen-Loève Transform (KLT). The transform coefficients generated by the primary transform may undergo secondary transforms. The transform scheme used for the primary and / or secondary transforms can be determined based on the coding parameters of the current block and / or its neighboring blocks. Optionally, transform information indicating the transform scheme can be transmitted via a signal. DCT-based transforms may include, for example, DCT-2, DCT-8, etc. DST-based transforms may include, for example, DST-7.

[0277] A quantized level signal (quantization coefficients) can be generated by performing quantization on the residual signal or on the result of performing a primary transform and / or a secondary transform. Depending on the intra-frame prediction mode or block size / shape, the quantized level signal can be scanned using at least one of diagonal top-right scan, vertical scan, and horizontal scan. For example, when scanning coefficients according to a diagonal top-right scan, the block-form coefficients change to a one-dimensional vector form. In addition to the diagonal top-right scan, depending on the intra-frame prediction mode and / or the size of the transform block, a horizontal scan that horizontally scans the coefficients in two-dimensional block form or a vertical scan that vertically scans the coefficients in two-dimensional block form can be used. The scanned quantized level coefficients can be entropy-encoded for insertion into the bitstream.

[0278] The decoder performs entropy decoding on the bitstream to obtain the quantized level coefficients. The quantized level coefficients can be arranged in a two-dimensional block format via inverse scanning. For inverse scanning, at least one of the following can be used: diagonal top-right scan, vertical scan, and horizontal scan.

[0279] The quantized level coefficients can then be dequantized, then subjected to a secondary inverse transform as needed, and finally subjected to a primary inverse transform as needed to generate the reconstructed residual signal.

[0280] Inverse mapping in the dynamic range can be performed on the luma components reconstructed via intra-frame or inter-frame prediction prior to intra-loop filtering. The dynamic range can be divided into 16 equal segments, and a mapping function for each segment can be signaled. The mapping function can be signaled at the strip level or parallel block group level. The inverse mapping function used to perform the inverse mapping can be derived based on the mapping function. Intra-loop filtering, reference frame storage, and motion compensation are performed in the inverse mapping region, and the prediction blocks generated via inter-frame prediction are transformed to the mapping region via mapping using the mapping function and then used to generate reconstructed blocks. However, since intra-frame prediction is performed in the mapping region, the prediction blocks generated via intra-frame prediction can be used to generate reconstructed blocks without mapping / inverse mapping.

[0281] When the current block is a residual block for the chroma component, the residual block can be converted to the inverse-mapped region by scaling the chroma components of the mapped region. The availability of scaling can be signaled at the stripe level or the parallel block group level. Scaling can only be applied if 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 of the sample values ​​of the luma prediction block corresponding to the chroma block. In this case, when inter-frame prediction is used for the current block, the luma prediction block can represent the mapped luma prediction block. The required scaling value can be derived by using an index-referenced lookup table of the segment to which the average of the sample values ​​of the luma prediction block belongs. Finally, by scaling the residual block using the derived value, the residual block can be converted to the inverse-mapped region. Chroma component block recovery, intra-frame prediction, inter-frame prediction, intra-loop filtering, and reference frame storage can then be performed in the inverse-mapped region.

[0282] Information indicating whether the mapping / inverse mapping of the luminance and chrominance components is available can be sent via a sequence parameter set using signals.

[0283] A predicted block for the current block can be generated based on a block vector indicating the displacement between the current block and a reference block in the current frame. In this way, the prediction mode used to generate a predicted block with reference to the current frame is called Intra-Block Copy (IBC) mode. IBC mode can be applied to M×N (M<=64, N<=64) coding units. IBC modes can 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 can include at least one of spatial candidates, history-based candidates, candidates based on the average of two candidates, and zero merge candidates. In the case of AMVP mode, a difference block vector can be signaled. Furthermore, the predicted block vector can 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 can be signaled. The predicted block in IBC mode is included in the current CTU or the left CTU and is limited to blocks in the reconstructed region. For example, the value of the block vector can be restricted such that the predicted block of the current block is located in the region of the three 64×64 blocks preceding the 64×64 block to which the current block belongs, in the encoding / decoding order. By restricting the value of the block vector in this way, memory consumption and device complexity can be reduced in implementations according to the IBC mode.

[0284] In the following text, reference will be made to Figures 7 to 55d An in-loop filtering method using subsampling-based block classification is described according to an embodiment of the present invention.

[0285] In this invention, the in-loop filtering methods include deblocking filtering, sample adaptive offset (SAO), bilateral filtering, and adaptive in-loop filtering.

[0286] Blocking and ringing artifacts within the reconstructed frame can be effectively reduced by applying at least one of deblocking filtering and SAO to the reconstructed frame (i.e., video frame) generated by summing the intra / inter-frame predicted blocks and the reconstructed residual blocks. Deblocking filtering aims to reduce blocking artifacts around block boundaries by performing vertical and horizontal filtering on the block boundaries. However, a problem with deblocking filtering is that it cannot minimize distortion between the original and reconstructed frames when block boundaries are filtered. Sample Adaptive Offset (SAO) is a filtering technique that adds an offset to a specific sample after comparing the pixel value of a sample with the pixel values ​​of its neighboring samples, or adds the offset to samples whose pixel values ​​fall within a specific range of pixel values, in order to reduce ringing artifacts. SAO has the effect of reducing distortion between the original and reconstructed frames to a certain extent by using rate distortion optimization. However, it has limitations in minimizing distortion when the difference between the original and reconstructed frames is large.

[0287] Bidirectional filtering refers to a filtering technique that determines filter coefficients based on the distance from the center sample point in the target filtering region to each of the other samples in the target filtering region and based on the difference between the pixel value of the center sample point and the pixel value of each of the other samples.

[0288] Adaptive in-loop filtering refers to a filtering technique that minimizes the distortion between the original and reconstructed images by using a filter that minimizes the distortion between the original and reconstructed images.

[0289] Unless otherwise specifically stated in the description of this invention, in-loop filtering refers to adaptive in-loop filtering. Furthermore, adaptive in-loop filters may have the same meaning as adaptive loop filters.

[0290] In this invention, filtering refers to applying a filter to at least one basic unit selected from the following: samples, blocks, coding units (CUs), prediction units (PUs), transform units (TUs), coding tree units (CTUs), stripes, parallel blocks, groups of parallel blocks (parallel block groups), frames, and sequences. Filtering includes at least one of block classification processing, filter execution processing, and filter information encoding / decoding processing.

[0291] In this invention, the coding unit (CU), prediction unit (PU), transform unit (TU), and coding tree unit (CTU) have the same meaning as the coding block (CB), prediction block (PB), transform block (TB), and coding tree block (CTB), respectively.

[0292] In this invention, a block refers to at least one of CU, PU, ​​TU, CB, PB, and TB, which are used as basic units in encoding / decoding processes.

[0293] In-loop filtering is performed, such that bidirectional filtering, deblocking filtering, sample adaptive offset, and adaptive in-loop filtering are applied sequentially to reconstruct the image to generate the decoded image. However, the order in which the filtering schemes classified as in-loop filtering are applied to the reconstructed image varies.

[0294] For example, in-loop filtering can be performed such that deblocking filtering, sample adaptive offset, and adaptive in-loop filtering are applied sequentially to the reconstructed image in the order of deblocking filtering, sample adaptive offset, and adaptive in-loop filtering.

[0295] Optionally, in-loop filtering can be performed such that bidirectional filtering, adaptive in-loop filtering, deblocking filtering, and sample adaptive offset are applied sequentially to the reconstructed image in the order of bidirectional filtering, adaptive in-loop filtering, deblocking filtering, and sample adaptive offset.

[0296] Further optionally, in-loop filtering can be performed such that adaptive in-loop filtering, deblocking filtering, and sample adaptive offset are applied sequentially to the reconstructed image in the order of adaptive in-loop filtering, deblocking filtering, and sample adaptive offset.

[0297] Further optionally, in-loop filtering can be performed such that adaptive in-loop filtering, sample adaptive offset, and deblocking filtering are applied sequentially to the reconstructed image in the order of adaptive in-loop filtering, sample adaptive offset, and deblocking filtering.

[0298] In this invention, the decoded image refers to the output of the intra-loop filtering or post-processing filtering performed on the reconstructed image. The reconstructed image is composed of reconstructed blocks, each generated by summing the reconstructed residual block and the corresponding intra-frame prediction block, or by summing the reconstructed block and the corresponding inter-frame prediction block. In this invention, the meanings of decoded samples, blocks, CTUs, or images are no different from those of reconstructed samples, blocks, CTUs, or images.

[0299] Adaptive intra-loop filtering is performed on the reconstructed frame to generate the decoded frame. Adaptive intra-loop filtering can be performed on a decoded frame that has already undergone at least one of deblocking filtering, adaptive sample offsetting, and bidirectional filtering. Furthermore, adaptive intra-loop filtering can be performed on a reconstructed frame that has already undergone adaptive intra-loop filtering. In this case, adaptive intra-loop filtering can be performed N times on either the reconstructed frame or the decoded frame. In this case, N is a positive integer.

[0300] Intra-loop filtering can be performed on a decoded image that has already undergone at least one of the intra-loop filtering methods. For example, when at least one of the intra-loop filtering methods is performed on a decoded image that has already undergone at least one of other intra-loop filtering methods, the parameters used for the latter filtering method can be changed, and then the former filtering with the changed parameters can be performed on the decoded image. 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, and / or combinations thereof.

[0301] Filter coefficients refer to the coefficients that constitute a filter. Optionally, filter coefficients refer to coefficient values ​​corresponding to specific mask positions in a mask configuration, and the reconstructed samples are multiplied by these coefficient values.

[0302] The number of filter taps refers to the length of the filter. When a filter is symmetrical about a specific direction, the number of filter coefficients to be encoded / decoded can be reduced by half. Furthermore, a filter tap refers to the width (horizontal dimension) or height (vertical dimension) of the filter. Optionally, a filter tap refers to both the width (lateral dimension) and height (vertical dimension) of a two-dimensional filter. Additionally, a filter can be symmetrical about two or more specific directions.

[0303] When the filter has a mask form, the filter can be a two-dimensional geometric shape with the following shapes: diamond / rhombus shape, non-square rectangular shape, square shape, trapezoidal shape, diagonal shape, snowflake shape, number symbol shape, clover shape, cross shape, triangle shape, pentagonal shape, hexagonal shape, octagonal shape, decagonal shape, dodecagonal shape, or any combination thereof. Alternatively, the filter shape can be a shape obtained by projecting a three-dimensional graphic onto a two-dimensional plane.

[0304] The filter type refers to the filter selected from Wiener filters, low-pass filters, high-pass filters, linear filters, nonlinear filters, and bidirectional filters.

[0305] In this invention, the Wiener filter will be the focus of the description among various filters. However, the invention is not limited thereto, and combinations of the above-described filters may be used in embodiments of the invention.

[0306] Wiener filters can be used as a filter type for adaptive in-loop filtering. Wiener filters are optimal linear filters for effectively removing noise, blur, and distortion within a frame, thereby improving coding efficiency. Wiener filters are designed to minimize distortion between the original frame and the reconstructed / decoded frame.

[0307] At least one of the filtering methods can be performed during encoding or decoding processing. Encoding or decoding processing refers to encoding or decoding performed on a unit of at least one of stripe, parallel block, parallel block group, frame, sequence, CTU, block, CU, PU, ​​and TU. At least one of the filtering methods is performed during encoding or decoding performed on a unit of stripe, parallel block, parallel block group, frame, 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 encoding or decoding processing. When adaptive in-loop filtering is performed, the decoded frame that has undergone adaptive in-loop filtering can be used as a reference frame when encoding or decoding subsequent frames. In this case, since intra-frame prediction or motion compensation is performed on the subsequent frame to be encoded / decoded by referring to the reconstructed frame that has undergone adaptive in-loop filtering, the encoding efficiency of the subsequent frame and the encoding efficiency of the current frame that has undergone in-loop filtering can be improved.

[0308] Furthermore, at least one of the aforementioned filtering methods is performed in CTU-based or block-based encoding or decoding processes. For example, the Wiener filter is used for adaptive intra-loop filtering in CTU-based or block-based encoding or decoding processes. That is, in the phrase "adaptive intra-loop filtering," the term "intra-loop" indicates that filtering is performed during CTU-based or block-based encoding or decoding processes. When adaptive intra-loop filtering is performed on a CTU-by-CTU or block-by-block basis, the decoded CTU or block that has undergone adaptive intra-loop filtering is used as a reference CTU or block for subsequent CTUs or blocks to be encoded / decoded. In this case, since intra-frame prediction or motion compensation is performed on subsequent CTUs or blocks by referencing the current CTU or block to which adaptive intra-loop filtering has been applied, the coding efficiency of the current CTU or block to which intra-loop filtering has been applied is improved, and the coding efficiency of subsequent CTUs or blocks to be encoded / decoded is also improved.

[0309] Furthermore, after the decoding process is performed, at least one of the filtering methods is performed as a post-processing filter. For example, a Wiener filter can be used as a post-processing filter after the decoding process is performed. When a Wiener filter is used after the decoding process, the Wiener filter is applied to the reconstructed / decoded screen before the output (i.e., display) of the reconstructed / decoded screen. When the post-processing filter is performed, the decoded screen that has already undergone post-processing filtering may not be used as a reference screen for subsequent screens to be encoded / decoded.

[0310] Adaptive in-loop filtering cannot be performed on a block-by-block basis. In other words, block-based filter adaptation cannot be performed. Here, block-based filter adaptation means selecting different filters for different blocks. Block-based filter adaptation also implies block classification.

[0311] Figure 8a This is a flowchart illustrating a video decoding method according to an embodiment of the present invention.

[0312] Reference Figure 8a The decoder decodes the filter information for each coding unit (S701).

[0313] Filter information is not limited to filter information at the unit of coding. It also represents filter information at the unit of strip, parallel block, parallel block group, frame, sequence, CTU, block, CU, PU, ​​or TU.

[0314] The filter information includes information about whether filtering was performed, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information about whether fixed filters were used for block classification indexing, and / or filter symmetry type information.

[0315] The filter shape information includes at least one shape selected from rhombus (diamond), rectangle, square, trapezoid, diagonal shape, snowflake, number symbol, clover, cross, triangle, pentagon, hexagon, octagon, decagon and dodecagon.

[0316] The filter coefficient values ​​include the filter coefficient values ​​for the geometric transformation of each block, where samples in each block are classified into multiple categories on a block classification unit basis.

[0317] On the other hand, examples of filter symmetry types include at least one of point symmetry, horizontal symmetry, vertical symmetry, and diagonal symmetry.

[0318] Furthermore, the decoder performs block classification on the samples of the coding unit at the block classification unit level (step S702). Additionally, the decoder assigns the block classification index to the block classification unit within the coding unit.

[0319] Block classification is not limited to classification based on coding units. That is, block classification can be performed on the basis of stripes, parallel blocks, parallel block groups, frames, sequences, CTUs, blocks, CUs, PUs, or TUs.

[0320] The block classification index is determined based on directional and activity information.

[0321] At least one of directional information and activity information is determined based on the gradient value for at least one of the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction.

[0322] On the other hand, gradient values ​​are obtained by using a one-dimensional Laplacian operation on a block classification unit basis.

[0323] The one-dimensional Laplace operation is preferably a one-dimensional Laplace operation where the operation position is a sub-sampling position.

[0324] Alternatively, the gradient value can be determined based on the time layer identifier.

[0325] In addition, the decoder filters the coding units that have been classified into blocks by block classification units using filtering information (S703).

[0326] The target unit for filtering is not limited to the coding unit. That is to say, filtering can be performed on the basis of stripes, parallel blocks, parallel block groups, frames, sequences, CTUs, blocks, CUs, PUs, or TUs.

[0327] Figure 8b This is a flowchart illustrating a video encoding method according to an embodiment of the present invention.

[0328] Reference Figure 8b The encoder classifies the samples in the encoding unit into multiple categories, using block classification units as the unit (step S801). Furthermore, the encoder assigns a block classification index to each block classification unit within the encoding unit.

[0329] The basic unit used for block classification is not limited to the coding unit. That is, block classification can be performed in units of stripe, parallel block, parallel block group, frame, sequence, CTU, block, CU, PU or TU.

[0330] The block classification index is determined based on directional and activity information.

[0331] At least one of directional information and activity information is determined based on gradient values ​​for at least one of the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction.

[0332] Gradient values ​​are obtained using a one-dimensional Laplacian operation on a block-by-block classification unit basis.

[0333] The one-dimensional Laplace operation is preferably a one-dimensional Laplace operation where the operation position is a sub-sampling position.

[0334] Optionally, the gradient value can be determined based on the time layer identifier.

[0335] In addition, the encoder filters the coding units that classify its samples into block classification units by using the filter information of the coding units (S802).

[0336] The basic unit used for filtering is not limited to the coding unit. That is to say, filtering can be performed in units of stripes, parallel blocks, parallel block groups, frames, sequences, CTUs, blocks, CUs, PUs, or TUs.

[0337] The filter information includes information about whether filtering was performed, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information about whether fixed filters were used for block classification indexing, and / or filter symmetry type information.

[0338] Examples of filter shapes include at least one of the following: rhombus (diamond shape), rectangle, square, trapezoid, diagonal shape, snowflake shape, number symbol shape, clover shape, cross shape, triangle, pentagon, hexagon, octagon, decagon and dodecagon.

[0339] The filter coefficient values ​​include those that have undergone geometric transformation on a block classification unit basis.

[0340] Next, the encoder encodes the filter information (S803).

[0341] Filter information is not limited to filter information at the coding unit level. Filter information can be at the strip, parallel block, parallel block group, frame, sequence, CTU, block, CU, PU, ​​or TU level.

[0342] 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.

[0343] More specifically, on the encoder side, adaptive in-loop filtering can be divided into several sub-steps, such as block classification, filter coefficient derivation, filter execution determination, filter shape determination, filter execution, and filter information encoding. Filter coefficient derivation, filter execution determination, and filter shape determination are not within the scope of this invention. Therefore, these sub-steps will not be described in detail, but only briefly. Thus, on the encoder side, the in-loop filtering process is divided into block classification, filtering, and filter information encoding, etc.

[0344] In the filter coefficient derivation step, Wiener filter coefficients that minimize the distortion between the original and filtered images can be derived. In this case, the Wiener filter coefficients are derived on a block-by-block basis. Furthermore, the Wiener filter coefficients are derived based on at least one of the filter taps and filter shape. When deriving the Wiener filter coefficients, the autocorrelation function for the reconstructed samples, the cross-correlation function for the original and reconstructed samples, the autocorrelation matrix, and the cross-correlation matrix can be derived. The filter coefficients are calculated by deriving the Wiener-Hopf equation based on the autocorrelation and cross-correlation matrices. In this case, the filter coefficients are obtained by calculating the Wiener-Hopf equation based on Gaussian elimination or Cholesky decomposition.

[0345] In the filter execution determination step, rate-distortion optimization determines whether to perform adaptive intra-loop filtering on a strip, frame, parallel block, or parallel block group basis, on a block basis, or without performing adaptive intra-loop filtering. Here, the rate includes the filter information to be encoded. Distortion is the difference between the original frame and the reconstructed frame, or the difference between the original frame and the filtered reconstructed frame. Distortion is represented by mean square error (MSE), sum of squared errors (SSE), sum of absolute differences, etc. In the filter execution determination step, it is determined whether to perform filtering on the chroma component and whether to perform filtering on the luminance component.

[0346] In the filter shape determination step, when applying in-loop adaptive filtering, the type of filter shape and the number of taps to be used can be determined based on rate-distortion optimization.

[0347] In addition, on the decoder side, the adaptive in-loop filtering process is divided into filter information decoding, block classification, and filtering steps.

[0348] In the following text, to avoid redundancy, the filter information encoding step and the filter information decoding step will be collectively referred to as the filter information encoding / decoding step.

[0349] The block classification steps will be described first below.

[0350] Block classification indices are assigned within the reconstructed frame based on M×N size blocks (or block classification units), such that blocks within the reconstructed frame can be classified into L categories. Here, block classification indices can be assigned not only to reconstructed / decoded frames, but also to at least one of the following: restored / decoded stripes, restored / decoded parallel block groups, restored / decoded parallel blocks, restored / decoded CTUs, and restored / decoded blocks.

[0351] Here, N, M, and L are all positive integers. For example, N and M are both positive integers chosen from 2, 4, 8, 16, and 32, and L is a positive integer chosen from 4, 8, 16, 20, 25, and 32. When N and M are the same integer 1, block classification is performed based on samples rather than blocks. On the other hand, when N and M are different positive integers, N×M blocks have a non-square shape. Optionally, N and M can be the same positive integer.

[0352] For example, a total of 25 block classification indices can be assigned to the reconstructed screen in 2×2 block units. Alternatively, a total of 25 block classification indices can be assigned to the reconstructed screen in 4×4 block units.

[0353] The block classification index has values ​​in the range from 0 to L-1, or it may have values ​​in the range from 1 to L.

[0354] The block classification index C is a quantified activity value A based on the directionality value D and the activity value A. q It is determined by at least one of them and is represented by Equation 1.

[0355] [Equation 1]

[0356] C = 5D + A q

[0357] In Equation 1, 5 is an exemplary constant value. This constant value can be represented by J. In this case, J is a positive integer with a value less than L.

[0358] For example, in one embodiment where 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 given by g. v This indicates that the sum of the one-dimensional Laplace gradient values ​​for the horizontal direction, the first diagonal direction (135° angle), and the second diagonal direction (45° angle) is respectively given by g. h g d1 and g d2 The Laplace operations for the vertical, horizontal, first diagonal, and second diagonal directions are represented by expressions 2, 3, 4, and 5, respectively. The directional value D and the activity value A are derived by using the sum of gradient values. In one embodiment, the sum of gradient values ​​is used. Alternatively, any statistical value of the gradient values ​​can be used instead of the sum of gradient values.

[0359] [Equation 2]

[0360]

[0361] [Equation 3]

[0362]

[0363] [Equation 4]

[0364]

[0365] [Equation 5]

[0366]

[0367] In Equations 2 to 5, i and j represent the coordinates of the upper left position in the horizontal and vertical directions, respectively, and R(i,j) represents the reconstructed sample value at position (i,j).

[0368] In equations 2 through 5, k and l represent the horizontal and vertical computational ranges, respectively, to produce the result V of a sample-based one-dimensional Laplace operation for each direction. k,l Hk,l D1 k,l D2 k,l The sum of the samples. The result of a sample-based one-dimensional Laplacian operation for a given direction represents the sample-based gradient value for that direction. In other words, the result of the one-dimensional Laplacian operation represents the gradient value. A one-dimensional Laplacian operation is performed for each of the vertical, horizontal, first diagonal, and second diagonal directions, and the one-dimensional Laplacian operation indicates the gradient value for that direction. Furthermore, the results of the one-dimensional Laplacian operations for the vertical, horizontal, first diagonal, and second diagonal directions are respectively represented by V. k,l H k,l D 1k,l D 2k,l express.

[0369] For example, k and l can be the same range. That is, the horizontal and vertical lengths of the range used to calculate a one-dimensional Laplace sum can be the same.

[0370] Optionally, k and l can be different ranges. That is, the horizontal and vertical lengths of the operational range for calculating a one-dimensional Laplace sum can be different.

[0371] As an example, k is the range from i-2 to i+3, and l is the range from j-2 to j+3. In this case, the range for calculating the one-dimensional Laplace sum is 6×6. In this case, the computational range for calculating the one-dimensional Laplace sum is larger than the size of the block classification unit.

[0372] As another example, k is the range from i-1 to i+2, and l is the range from j-1 to j+2. In this case, the operational range for computing a one-dimensional Laplace sum is 4×4. In this case, the operational range for computing a one-dimensional Laplace sum is larger than the size of a block classification unit.

[0373] As another example, k is the range from i to i+1, and l is the range from j to j+1. In this case, the operational range for computing a one-dimensional Laplace sum is 2×2. In this case, the operational range for computing a one-dimensional Laplace sum is equal to the size of the block classification unit.

[0374] For example, the range of operations for summing the results of a one-dimensional Laplacian operation includes two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonal shapes, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0375] For example, the block classification unit has a two-dimensional geometric shape selected from rhombus / diamond, rectangle, square, trapezoid, diagonal shape, snowflake, number symbol shape, clover shape, cross shape, triangle, pentagon, hexagon, octagon, decagon and dodecagon.

[0376] For example, the range for calculating the sum of a one-dimensional Laplace operation has a size of S×T. In this case, both S and T are zero or positive integers.

[0377] Furthermore, D1, representing the first diagonal, and D2, representing the second diagonal, can respectively mean D0, representing the first diagonal, and D1, representing the second diagonal.

[0378] For example, in one embodiment where block classification is performed in units of 4×4 size blocks, the sum of gradient values ​​g with respect to the horizontal direction, vertical direction, first diagonal direction, and second diagonal direction is calculated using equations 6, 7, 8, and 9 based on one-dimensional Laplacian operations. v g h g d1 g d2 The directionality value D and the activity value A are derived by using the sum of gradient values. In one embodiment, the sum of gradient values ​​is used. Alternatively, any statistical value of the gradient values ​​can be used instead of the sum of gradient values.

[0379] [Equation 6]

[0380]

[0381] [Equation 7]

[0382]

[0383] [Equation 8]

[0384]

[0385] [Equation 9]

[0386]

[0387] In Equations 6 to 9, i and j represent the coordinates of the upper left position in the horizontal and vertical directions, respectively, and R(i,j) represents the reconstructed sample value at position (i,j).

[0388] In equations 6 through 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,lThe sum has horizontal and vertical operational ranges. The result of a sample-based one-dimensional Laplacian operation in one direction represents the sample-based gradient value for that direction. In other words, the result of the one-dimensional Laplacian operation represents the gradient value. A one-dimensional Laplacian operation is performed for each of the vertical, horizontal, first diagonal, and second diagonal directions, and the one-dimensional Laplacian operation indicates the gradient value for that direction. Furthermore, the results of the one-dimensional Laplacian operations for the vertical, horizontal, first diagonal, and second diagonal directions are respectively represented as V. k,l H k,l D1 k,l D2 k,l .

[0389] For example, k and l can be the same range. That is, the horizontal and vertical lengths of the range used to calculate the sum of a one-dimensional Laplace operation can be the same.

[0390] Optionally, k and l can be different ranges. That is, the horizontal and vertical lengths of the range used to calculate the sum of a one-dimensional Laplace operation can be different.

[0391] As an example, k ranges from i-2 to i+5, and l ranges from j-2 to j+5. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 8×8. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is larger than the size of the block classification unit.

[0392] As another example, k is the range from i to i+3, and l is the range from j to j+3. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 4×4. Alternatively, the operational range for calculating the sum of one-dimensional Laplace operations is equal to the size of the block classification unit.

[0393] For example, the range of operations for summing the results of a one-dimensional Laplacian operation includes two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonal shapes, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0394] For example, the range of operations for calculating the sum of one-dimensional Laplace operations has a size of S×T. In this case, both S and T are zero or positive integers.

[0395] For example, the block classification unit has a two-dimensional geometric shape selected from rhombus / diamond, rectangle, square, trapezoid, diagonal shape, snowflake, number symbol shape, clover shape, cross shape, triangle, pentagon, hexagon, octagon, decagon and dodecagon.

[0396] Figure 9 This is a diagram illustrating an exemplary method for determining gradient values ​​for the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction, respectively.

[0397] like Figure 9 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction can be calculated. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction, respectively. Figure 9 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range for calculating the one-dimensional Laplacian sum is larger than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

[0398] For example, in one embodiment, block classification is performed in units of 4×4 size blocks, and the one-dimensional Laplace and g of the gradient values ​​for the horizontal direction, vertical direction, first diagonal direction, and second diagonal direction are calculated using Equations 10 to 13, respectively. v g h g d1 g d2 Gradient values ​​are represented based on subsamples to reduce the computational complexity for block classification. The directionality value D and activity value A are derived by using the sum of gradient values. In one embodiment, the sum of gradient values ​​is used. Alternatively, any statistical value of the gradient values ​​can be used instead of the sum of gradient values.

[0399] [Equation 10]

[0400] g v =∑ A ∑ l V k,l V k,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

[0401] [Equation 11]

[0402] g h =∑ k ∑ l Hk,l H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)|,k=i-2,..,i+5,l=j-2,jj+2,j+4

[0403] [Equation 12]

[0404] g d1 =∑ 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

[0405]

[0406] [Equation 13]

[0407] 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

[0408]

[0409] In Equations 10 to 13, i and j represent the coordinates of the upper left position in the horizontal and vertical directions, respectively, and R(i, j) represents the reconstructed sample value at position (i, j).

[0410] In equations 10 to 13, k and 1 represent the results V of calculating the one-dimensional Laplace operation based on the sample points. k,l H k,l D1 k,l D2 k,1 The sum has horizontal and vertical operational ranges. The result of a sample-based one-dimensional Laplacian operation in one direction represents the sample-based gradient value for that direction. In other words, the result of the one-dimensional Laplacian operation represents the gradient value. A one-dimensional Laplacian operation is performed for each of the vertical, horizontal, first diagonal, and second diagonal directions, and the one-dimensional Laplacian operation indicates the gradient value for that direction. Furthermore, the results of the one-dimensional Laplacian operations for the vertical, horizontal, first diagonal, and second diagonal directions are respectively represented as V. k,l Hk,l D1 k,l D2 k,l .

[0411] For example, k and l can be the same range. That is, the horizontal and vertical lengths of the range for calculating the sum of a one-dimensional Laplace operation are the same.

[0412] Optionally, k and l can be different ranges. That is, the horizontal and vertical lengths of the range used to calculate the sum of a one-dimensional Laplace operation can be different.

[0413] As an example, k ranges from i-2 to i+5, and l ranges from j-2 to j+5. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 8×8. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is larger than the size of the block classification unit.

[0414] As another example, k is the range from i to i+3, and l is the range from j to j+3. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 4×4. Alternatively, the operational range for calculating the sum of one-dimensional Laplace operations is equal to the size of the block classification unit.

[0415] For example, the range of operations for summing the results of a one-dimensional Laplacian operation includes two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonal shapes, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0416] For example, the range of operations for calculating the sum of one-dimensional Laplace operations has a size of S×T. In this case, S and T are zero or positive integers.

[0417] For example, the block classification unit has a two-dimensional geometric shape selected from rhombus / diamond, rectangle, square, trapezoid, diagonal shape, snowflake, number symbol shape, clover shape, cross shape, triangle, pentagon, hexagon, octagon, decagon and dodecagon.

[0418] According to an embodiment of the present invention, the gradient value calculation method based on samples can calculate the gradient value by performing a one-dimensional Laplacian operation on samples within a computational range along the corresponding direction. Here, the gradient value can be calculated by calculating the statistical value of the result of performing a one-dimensional Laplacian operation on at least one sample within the computational 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 value.

[0419] For example, to compute the gradient value in the horizontal direction, a one-dimensional Laplace operation is performed at each sample location within the computational range for computing the sum of the one-dimensional Laplace operations. In this case, the gradient value in the horizontal direction can be computed at intervals of P rows within the computational range for computing the sum of the one-dimensional Laplace operations. Here, P is a positive integer.

[0420] Optionally, to compute the gradient value with respect to the vertical direction, a one-dimensional Laplacian operation is performed at each sample location within the operational range of the column where the one-dimensional Laplacian sum is computed. In this case, the gradient value with respect to the vertical direction can be computed at intervals of P columns within the operational range where the one-dimensional Laplacian sum is computed. Here, P is a positive integer.

[0421] Further, optionally, to calculate the gradient value with respect to the first diagonal direction, within the scope of the calculation of the sum of one-dimensional Laplacian operations, a one-dimensional Laplacian operation is performed on the sample point positions at intervals of P rows or Q columns in at least one direction, either horizontal or vertical, to obtain the gradient value with respect to the first diagonal direction. Here, P and Q are zero or positive integers.

[0422] Further, optionally, to calculate the gradient value with respect to the second diagonal direction, within the scope of the calculation of the sum of one-dimensional Laplacian operations, a one-dimensional Laplacian operation is performed on the sample locations at intervals of P rows or Q columns in at least one direction, either horizontal or vertical, to obtain the gradient value with respect to the second diagonal direction. Here, P and Q are zero or positive integers.

[0423] According to an embodiment of the present invention, a sample-based gradient value calculation method can calculate the gradient value by performing a one-dimensional Laplace operation on at least one sample within the operational range of calculating the sum of a one-dimensional Laplace operation. Here, the statistical value of the gradient value can be calculated by calculating the statistical value of the result of the one-dimensional Laplace operation performed on at least one sample within the operational range of calculating the sum of a one-dimensional Laplace operation. In this case, the statistical value is any one of a sum, a weighted sum, and an average value.

[0424] For example, to compute the gradient value, a one-dimensional Laplace operation is performed at each sample location within the computational range for computing the sum of the one-dimensional Laplace operations. In this case, the gradient value can be computed at intervals of P rows within the computational range for computing the sum of the one-dimensional Laplace operations. Here, P is a positive integer.

[0425] Alternatively, to compute the gradient values, a one-dimensional Laplace operation is performed at each sample location within the operational range of the column where the sum of the one-dimensional Laplace operations is computed. In this case, the gradient values ​​can be computed at intervals of P rows within the operational range where the sum of the one-dimensional Laplace operations is computed. Here, P is a positive integer.

[0426] Further, optionally, to calculate the gradient value, within the scope of the calculation of the sum of one-dimensional Laplacian operations, a one-dimensional Laplacian operation is performed on the sample locations at intervals of P rows or Q columns in at least one direction, either horizontal or vertical, to obtain the gradient value. Here, P and Q are zero or positive integers.

[0427] Alternatively, to calculate the gradient values, within the scope of the calculation of the sum of the one-dimensional Laplacian operations, a one-dimensional Laplacian operation is performed on the sample locations at intervals of P rows and Q columns in the horizontal and vertical directions to obtain the gradient values. Here, P and Q are zero or positive integers.

[0428] On the other hand, gradient refers to at least one of the gradient in the horizontal direction, the gradient in the vertical direction, the gradient in the first diagonal direction, and the gradient in the second diagonal direction.

[0429] Figures 10 to 12 This is a diagram illustrating a subsampling-based method for determining gradient values ​​for the horizontal, vertical, first diagonal, and second diagonal directions.

[0430] like Figure 10 As shown, when block classification is performed in units of 2×2 size blocks, the sum of gradient values ​​g for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction can be calculated based on subsampling. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations for the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 for the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operations are performed are sub-sampling positions. Figure 10 In this context, the block classification index C is assigned to a 2×2 block within the shaded area. In this case, the computational range for calculating the one-dimensional Laplace sum is larger than the size of the block classification unit. Here, thin solid rectangles represent the locations of reconstructed sample points, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplace sum.

[0431] In the accompanying drawings of this invention, positions not represented by V, H, D1, or D2 are sample positions where a one-dimensional Laplace operation along the direction has not been performed. That is, a one-dimensional Laplace operation along each direction is performed only at the sample positions represented by V, H, D1, or D2. When a one-dimensional Laplace operation is not performed, the result of the one-dimensional Laplace operation at the corresponding sample position is determined to a specific value, for example, H. Here, H can be at least one of a negative integer, 0, and a positive integer.

[0432] like Figure 11 As shown, when performing block classification based on 4×4 size blocks, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated based on subsampling. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operations are performed are sub-sampling positions. Figure 11 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range for calculating the one-dimensional Laplacian sum is larger than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

[0433] like Figure 12 As shown, when performing block classification based on 4×4 size blocks, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated based on subsampling. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operations are performed are sub-sampling positions. Figure 12In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the one-dimensional Laplacian sum is equal to the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

[0434] According to an embodiment of the present invention, the gradient value can be calculated by performing a one-dimensional Laplace operation on samples at specific locations within a block of size N×M based on subsampling. In this case, the specific location can be at least one of an absolute location and a relative location within the block. Here, the statistical value of the gradient value can be calculated by calculating the statistical value of the result of performing a one-dimensional Laplace operation on at least one sample within the range of the calculation of the one-dimensional Laplace sum. In this case, the statistical value is any one of a sum, a weighted sum, and an average value.

[0435] For example, absolute position refers to the top-left position within an N×M block.

[0436] Optionally, the absolute position represents the lower right position within an N×M block.

[0437] Alternatively, the relative position represents the center position within an N×M block.

[0438] According to an embodiment of the invention, the gradient value can be calculated by performing a one-dimensional Laplace operation on R sample points within an N×M block based on subsampling. In this case, P and Q are zero or positive integers. Furthermore, 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 performing a one-dimensional Laplace operation on at least one sample point within the range of the operation for calculating the one-dimensional Laplace sum. In this case, the statistical value is any one of the sum, weighted sum, and average.

[0439] For example, when R is 1, a one-dimensional Laplace operation is performed only on a single sample point within an N×M block.

[0440] Optionally, when R is 2, a one-dimensional Laplace operation is performed only on two samples within an N×M block.

[0441] Alternatively, when R is 4, a one-dimensional Laplace operation is performed only on the four sample points within each N×M block.

[0442] According to an embodiment of the invention, the gradient value can be calculated by performing a one-dimensional Laplace operation on R sample points within each N×M block based on subsampling. In this case, R is a positive integer. Furthermore, R is equal to or less than the product of N and M. Here, the statistical value of the gradient is obtained by calculating the statistical value of the result of performing a one-dimensional Laplace operation on at least one sample point within the range of the one-dimensional Laplace sum calculation. In this case, the statistical value is any one of the sum, weighted sum, and average.

[0443] For example, when R is 1, the one-dimensional Laplace operation is performed only on one sample point within each N×M block for which the one-dimensional Laplace sum is computed.

[0444] Optionally, when R is 2, the one-dimensional Laplace operation is performed only on two sample points within each N×M block for calculating the one-dimensional Laplace sum.

[0445] Further, optionally, when R is 4, the one-dimensional Laplace operation is performed only on the four sample points within each N×M block for calculating the one-dimensional Laplace sum.

[0446] Figures 13 to 18 This is a diagram illustrating an exemplary subsampling-based method for determining gradient values ​​along the horizontal, vertical, first diagonal, and second diagonal directions.

[0447] like Figure 13 As shown, when block classification is performed in units of 4×4 size blocks, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions is calculated by using samples at specific locations within each N×M size block based on subsampling. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 13 In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the sum of one-dimensional Laplacian operations is equal to the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the sum of one-dimensional Laplacian operations.

[0448] like Figure 14As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using samples at specific locations within each N×M size block based on subsampling. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operations are performed are sub-sampling positions. Figure 14 In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the sum of one-dimensional Laplacian operations is smaller than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the sum of one-dimensional Laplacian operations.

[0449] like Figure 15 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using samples at specific locations within each N×M size block based on subsampling. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 15 In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the one-dimensional Laplacian sum is smaller than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

[0450] like Figure 16 As shown, when block classification is performed in units of 4×4 size blocks, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions is calculated by using samples at specific locations within each N×M size block based on subsampling.v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operations are performed are sub-sampling positions. Figure 16 In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the sum of one-dimensional Laplacian operations is smaller than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the sum of one-dimensional Laplacian operations.

[0451] like Figure 17 As shown, when performing block classification based on 4×4 size blocks, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using samples at specific locations within each N×M size block based on subsampling. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 17 In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the sum of one-dimensional Laplacian operations can be smaller than the size of the block classification unit. Here, since the computational range for calculating the sum of one-dimensional Laplacian operations has a size of 1×1, the gradient value can be calculated without calculating the sum of one-dimensional Laplacian operations. Here, the thin solid-line rectangle represents the location of the reconstructed sample point, and the thick solid-line rectangle represents the computational range for calculating the sum of one-dimensional Laplacian operations.

[0452] like Figure 18 As shown, when performing block classification based on 2×2 size blocks, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using samples at specific locations within each N×M size block based on subsampling. v g h g d1g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 18 In this context, the block classification index C is assigned to a 2×2 block of shaded area. In this case, the computational range for calculating the sum of one-dimensional Laplacian operations can be smaller than the size of the block classification unit. Here, since the computational range for calculating the sum of one-dimensional Laplacian operations has a size of 1×1, the gradient value can be calculated without calculating the sum of one-dimensional Laplacian operations. Here, the thin solid rectangle represents the location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the sum of one-dimensional Laplacian operations.

[0453] Figures 19 to 30 This diagram illustrates a method for determining gradient values ​​at specific sample locations along the horizontal, vertical, first diagonal, and second diagonal directions. The specific sample location can be a sub-sample location within a block classification unit, or a sub-sample location within the computational range for calculating the sum of a one-dimensional Laplacian operation. Furthermore, the specific sample location is a sample location within each block. Optionally, the specific sample location can vary between blocks. Moreover, the specific sample location can be the same regardless of the direction of the one-dimensional Laplacian operation being calculated. Furthermore, the specific sample location can be the same for each block regardless of the direction of the one-dimensional Laplacian operation.

[0454] like Figure 19 As shown, when performing block classification based on 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 19In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range used to calculate the one-dimensional Laplace sum can be larger than the size of the block classification unit. Here, the thin solid rectangle represents the location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplace sum.

[0455] like Figure 19 As shown, regardless of the direction of the one-dimensional Laplace operation, the specific sample point location for performing the one-dimensional Laplace operation is the same. Furthermore, as... Figure 19 As shown, the pattern of sample positions for performing a one-dimensional Laplace calculation can be called a checkerboard pattern or a cloverleaf pattern. Furthermore, all sample positions for performing a one-dimensional Laplace operation are either even-numbered or odd-numbered sample positions in the horizontal (x-axis) and vertical (y-axis) directions within the block classification unit or the operational range of the one-dimensional Laplace sum calculation within the block unit.

[0456] like Figure 20 As shown, when performing block classification based on 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations performed on the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 20 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range for the one-dimensional Laplace sum can be larger than the size of the block classification unit. Here, the thin solid rectangle represents the location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplace sum.

[0457] like Figure 20 As shown, regardless of the direction of the one-dimensional Laplace operation, the specific sample point location for performing the one-dimensional Laplace operation is the same. Furthermore, as... Figure 20 As shown, the pattern of sample positions for performing a one-dimensional Laplace operation can be called a checkerboard pattern or a cloverleaf pattern. Furthermore, the sample positions for performing a one-dimensional Laplace operation are either even-numbered or odd-numbered sample positions in both the horizontal (x-axis) and vertical (y-axis) directions within a block classification unit or the one-dimensional Laplace operation range of a block unit.

[0458] like Figure 21As shown, when performing block classification based on 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations performed along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 21 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational 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 location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplacian sum.

[0459] like Figure 22 As shown, when performing block classification based on 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations performed along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 22 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational 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 location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplacian sum.

[0460] like Figure 23 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 23 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range for calculating the one-dimensional Laplacian sum can be equal to the size of the block classification unit. Here, the thin solid rectangle represents the location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplacian sum.

[0461] like Figure 23 As shown, regardless of the direction of the one-dimensional Laplace operation, the specific sample point location for performing the one-dimensional Laplace operation is the same. Furthermore, as... Figure 23 As shown, the pattern of sample positions for performing a one-dimensional Laplace calculation can be called a checkerboard pattern or a cloverleaf pattern. Furthermore, all sample positions for performing a one-dimensional Laplace operation are either even-numbered or odd-numbered sample positions within the block classification unit or the one-dimensional Laplace operation range of the block unit, in either the horizontal (x-axis direction) or vertical (y-axis direction).

[0462] like Figure 24 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 24 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range for calculating the one-dimensional Laplace sum can be equal to the size of the block classification unit. Here, the thin solid rectangle represents the location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplace sum.

[0463] like Figure 24 As shown, regardless of the direction of the one-dimensional Laplace operation, the specific sample point location for performing the one-dimensional Laplace operation is the same. Furthermore, as... Figure 24As shown, the pattern of sample positions for performing a one-dimensional Laplace operation can be called a checkerboard pattern or a cloverleaf pattern. Furthermore, the sample positions for performing a one-dimensional Laplace operation are either even-numbered or odd-numbered sample positions in either the horizontal (X-axis) or vertical (Y-axis) direction within the one-dimensional Laplace operation range of a block classification unit or a block unit.

[0464] like Figure 25 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 25 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range for calculating the one-dimensional Laplace sum can be equal to the size of the block classification unit. Here, the thin solid rectangle represents the location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplace sum.

[0465] like Figure 26 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Figure 26 In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the one-dimensional Laplace sum can be equal to the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplace sum. The specific sample location can refer to each sample location within the block classification unit.

[0466] like Figure 27As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 27 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range for calculating the one-dimensional Laplace sum can be equal to the size of the block classification unit. Here, the thin solid rectangle represents the location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplace sum.

[0467] like Figure 28 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Figure 28 In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the one-dimensional Laplacian sum can be larger than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum. The specific sample location can refer to each sample location within the block classification unit.

[0468] like Figure 29 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Figure 29 In this context, the block classification index C is assigned to a 4×4 block within the shaded area. In this case, the computational range for calculating the one-dimensional Laplacian sum can be larger than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum. The specific sample location can refer to each sample location within the block classification unit.

[0469] like Figure 30 As shown, when performing block classification in units of 4×4 size blocks, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operation is performed can be sub-sampling positions. Figure 30 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational 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 location of the reconstructed sample point, and the thick solid rectangle represents the computational range for calculating the one-dimensional Laplacian sum.

[0470] According to embodiments of the present invention, at least one of the methods for calculating gradient values ​​can be performed based on a time-level identifier.

[0471] For example, when block classification is performed in units of 2×2 size blocks, equations 2 through 5 can be represented by a single equation as shown in equation 14.

[0472] [Equation 14]

[0473]

[0474] In Equation 14, dir represents the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction, and g dirThis represents the sum of each gradient value along the vertical, horizontal, first diagonal, and second diagonal directions. Furthermore, i and j represent the horizontal and vertical positions within a 2×2 block, respectively, and G... dir This represents each result of a one-way Laplacian operation along the vertical, horizontal, first diagonal, and second diagonal directions.

[0475] In this case, when the time layer identifier of the current frame (or reconstructed frame) indicates the top layer, and block classification is performed in units of 2×2 size blocks within the current frame (or reconstructed frame), Equation 14 can be expressed as Equation 15.

[0476] [Equation 15]

[0477] g 2x2,dir =|G dir (i0, j0)|

[0478] In Equation 15, G dir (i0,j0) represents the gradient value at the top left position within a 2×2 block along the vertical, horizontal, first diagonal, and second diagonal directions.

[0479] Figure 31 This is a diagram illustrating an exemplary method for determining gradient values ​​along the horizontal, vertical, first diagonal, and second diagonal directions when the time layer identifier indicates the top layer.

[0480] Reference Figure 31 The calculation of the sum of gradient values ​​along the vertical, horizontal, first diagonal, and second diagonal directions can be simplified by calculating the gradient only at the top-left sample point location (i.e., the shaded sample point location) within each 2×2 block. v g h g d1 g d2 The operation.

[0481] According to an embodiment of the invention, the statistical value of the gradient is calculated by simultaneously applying weights to the result of a one-dimensional Laplacian operation performed on one or more samples within a range for calculating the sum of the one-dimensional Laplacian operation. In this case, at least one of the weighted average, median, minimum, maximum, and mode can be used instead of the weighted sum.

[0482] The operation of applying weights or calculating weighted sums can be determined based on various conditions or encoding parameters associated with the current block and with neighboring blocks.

[0483] For example, a weighted sum can be calculated on a unit of at least one of sample points, sample groups, lines, and blocks. In this case, the weighted sum can be calculated by changing the weights on a unit of at least one of sample points, sample groups, lines, and blocks.

[0484] For example, the weights can vary based on at least one of the current block size, the current block shape, and the sample point position.

[0485] For example, a weighted sum can be calculated based on conditions preset in the encoder and decoder.

[0486] For example, weights are adaptively determined based on at least one of the coding parameters, such as the block size, block shape, and intra-prediction mode of the current block and at least one of the neighboring blocks.

[0487] For example, whether to compute a weighted sum is adaptively determined based on at least one of the coding parameters (such as the block size, block shape, and intra-prediction mode of the current block and at least one of the neighboring blocks).

[0488] For example, when the range of operations for calculating the sum of one-dimensional Laplacian operations is greater than the size of the block classification unit, at least one weight applied to the sample points within the block classification unit may be greater than at least one weight applied to the sample points outside the block classification unit.

[0489] Alternatively, for example, when the range of operations for calculating the sum of one-dimensional Laplacian operations is equal to the size of the block classification unit, the weights applied to the samples within the block classification unit are all the same.

[0490] Information about whether weights and / or weighted sum calculations are performed can be entropy-encoded in the encoder and then signaled to the decoder.

[0491] According to an embodiment of the present invention, the sum of gradient values ​​g along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction is calculated. v g h g d1 and g d2 For each of the following, when one or more unavailable samples exist around the current sample, padding is performed on the unavailable sample, and the filled sample can be used to calculate the gradient value. Padding refers to the method of copying the sample value of adjacent available sample to the unavailable sample. Optionally, sample values ​​or statistics obtained based on the values ​​of available sample adjacent to the unavailable sample can be used. Padding can be performed repeatedly for column P and row R. Here, M and L are both positive integers.

[0492] Here, an unavailable sample point refers to a sample point located outside the boundary of a CTU, CTB, strip, parallel block, parallel block group, or frame. Optionally, an unavailable sample point may refer to a sample point belonging to at least one of the CTU, CTB, strip, parallel block, parallel block group, and frame that is different from the current sample point.

[0493] According to an embodiment of the present invention, the sum of gradient values ​​g along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction is calculated respectively. v g h g d1 and g d2 When at least one of them.

[0494] For example, in calculating the sum of gradient values ​​g along the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction. v g h g d1 and g d2 When at least one of them is present, filled sample points may not be used.

[0495] Alternatively, for example, in calculating the sum of gradient values ​​g along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. v g h g d1 and g d2 In each of the cases, if there are one or more unavailable samples around the current sample, the unavailable sample may not be used for gradient value calculation.

[0496] Further, alternatively, for example, in calculating the sum of gradient values ​​g along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction... v g h g d1 and g d2 When at least one of the following conditions is met, if the samples surrounding the current sample are located outside the CTU or CTB, the neighboring samples adjacent to the current sample may not be used.

[0497] According to an embodiment of the present invention, when calculating at least one of the one-dimensional Laplace operation values, if there are one or more unavailable samples around the current sample, padding is performed such that the sample value of the available sample adjacent to the unavailable sample is copied to the unavailable sample, and the padded sample is used to perform the one-dimensional Laplace operation.

[0498] According to an embodiment of the present invention, predetermined sample points may not be used in one-dimensional Laplace calculations.

[0499] For example, in a one-dimensional Laplace calculation, filled samples may not be used.

[0500] Alternatively, for example, when calculating at least one of the values ​​of a one-dimensional Laplace operation, if there are one or more unavailable samples around the current sample, the one or more unavailable samples may not be used in the one-dimensional Laplace operation.

[0501] Further optionally, for example, when calculating at least one of the one-dimensional Laplace operation values, neighboring samples may not be used for the one-dimensional Laplace operation when the samples around the current sample are located outside the CTU or CTB.

[0502] According to an embodiment of the present invention, the sum of gradient values ​​g along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction is calculated. v g h g d1 and g d2 In each of the following, or in calculating at least one of the one-dimensional Laplace operation values, at least one of the samples that have undergone at least one of deblocking filtering, adaptive sample offset (SAO), and adaptive in-loop filtering may be used.

[0503] According to an embodiment of the present invention, the sum of gradient values ​​g along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction is calculated. v g h g d1 and g d2 When at least one of the following is used, or when calculating at least one of the one-dimensional Laplace operation values, if the samples around the current block are outside the CTU or CTB, at least one of deblocking filtering, adaptive sample offset (SAO), and adaptive in-loop filtering can be applied to the corresponding sample.

[0504] Optionally, the sum of gradient values ​​g along the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction is calculated. v g h g d1 and g d2 When at least one of the following is used, or when calculating at least one of the one-dimensional Laplace operation values, if the samples around the current block are located outside the CTU or CTB, at least one of the deblocking filter, adaptive sample offset (SAO), and adaptive in-loop filter may not be applied to the corresponding sample.

[0505] According to an embodiment of the present invention, when there are unavailable samples arranged in the computational range for a one-dimensional Laplace sum and arranged outside the CTU or CTB, the unavailable samples can be used to compute a one-dimensional Laplace operation without applying at least one of deblocking filtering, adaptive sample offsetting, and adaptive in-loop filtering.

[0506] According to an embodiment of the present invention, when unavailable samples exist within the block classification unit or outside the CTU or CTB, a one-dimensional Laplace operation can be performed without applying at least one of deblocking filtering, adaptive sample offsetting, and adaptive in-loop filtering to the unavailable samples.

[0507] On the other hand, when calculating gradient values ​​based on subsamples, the one-dimensional Laplace operation is not performed on all samples within the computational range of the operation, but rather on subsamples within that computational range. Therefore, the number of operations required for block classification (such as multiplication, shift operations, addition, and absolute value operations) can be reduced. Furthermore, the memory access bandwidth required for reconstructing samples can be reduced. This also reduces the complexity of the encoder and decoder. Specifically, performing the one-dimensional Laplace operation on subsampled samples is advantageous in terms of encoder and decoder hardware complexity because it reduces the time required for block classification.

[0508] Furthermore, when the computational range for calculating the sum of one-dimensional Laplacian operations is equal to or smaller than the size of the block classification unit, the number of additions required for block classification can be reduced. Additionally, the memory access bandwidth required for using reconstructed samples can be reduced. Therefore, the complexity of the encoder and decoder can also be reduced.

[0509] On the other hand, in the subsampling-based gradient value calculation method, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions is calculated by changing at least one of the sample position, number of samples, and direction of the sample position of the sample points performing the one-dimensional Laplacian operation according to the gradient values ​​for the vertical, horizontal, first diagonal, and second diagonal directions. v g h g d1 and g d2 At least one of them.

[0510] Furthermore, in the subsampling-based gradient value calculation method, the sum of gradient values ​​g for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction is calculated by using at least one identical factor among the sample position, number of samples, and direction of the sample position in which a one-dimensional Laplacian operation is performed. v g h g d1 and g d2At least one of them, regardless of the gradient value for the vertical direction, horizontal direction, first diagonal direction and second diagonal direction.

[0511] Furthermore, by using any combination of the above-mentioned one or more gradient values, a one-dimensional Laplacian operation can be performed with respect to the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, and the sum g of the gradient values ​​with respect to the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction can be calculated. v g h g d1 and g d2 At least one of them.

[0512] According to an embodiment of the present invention, the sum of gradient values ​​along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, g v g h g d1 and g d2 Two or more values ​​in the table are compared with each other.

[0513] For example, after calculating the sum of gradient values, the sum of gradient values ​​in the vertical direction, g, will be... v The sum of the gradient values ​​in the horizontal direction, g h By comparing the values, and deriving the maximum of the sum of the gradient values ​​in the vertical direction and the sum of the gradient values ​​in the horizontal direction according to Equation 16. and minimum value

[0514] [Equation 16]

[0515]

[0516] In this case, in order to sum g the gradient values ​​in the vertical direction v The sum of the gradient values ​​in the horizontal direction, g h The values ​​of the sum are compared according to Equation 17.

[0517] [Equation 17]

[0518]

[0519] Alternatively, for example, the sum of gradient values ​​g along the first diagonal direction can be used. d1 The sum of the gradient values ​​with respect to the second diagonal direction, g d2 By comparing the values, and deriving the maximum value between the sum of the gradient values ​​with respect to the first diagonal direction and the sum of the gradient values ​​with respect to the second diagonal direction according to Equation 18, we can find the answer. and minimum value

[0520] [Equation 18]

[0521]

[0522] In this case, in order to sum g the gradient values ​​with respect to the first diagonal direction d1 The sum of the gradient values ​​with respect to the second diagonal direction, g d2 The values ​​of the sum are compared according to Equation 19.

[0523] [Equation 19]

[0524]

[0525] According to one embodiment of the present invention, in order to calculate the directional value D, the maximum value and the minimum value are compared with two thresholds t1 and t2, as described below.

[0526] The directional value D is a positive integer or zero. For example, the directional value D can have a value in the range from 0 to 4. For example, the directional value D can have a value in the range from 0 to 2.

[0527] Furthermore, the directionality value D can be determined based on the characteristics of the region. For example, directionality values ​​D from 0 to 4 represent the following: 0 represents a textured region; 1 represents strong horizontal / vertical directionality; 2 represents weak horizontal / vertical directionality; 3 represents strong first / second diagonal directionality; and 4 represents weak first / second diagonal directionality. The directionality value D is determined through the steps described below.

[0528] Step 1: When the condition is met and When that happens, set the value D to 0.

[0529] Step 2: When the condition is met At that time, the process proceeded to step 3, but when the conditions were not met... Then proceed to step 4.

[0530] Step 3: When the condition is met When the condition is met, the value D is set to 2, but when the condition is not met... When that happens, set the value D to 1.

[0531] Step 4: When the conditions are met When the condition is not met, the value D is set to 4, but when the condition is not met... When that happens, set the value D to 3.

[0532] In this context, thresholds t1 and t2 are positive integers, and t1 and t2 can 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 yet another example, t1 and t2 are 1 and 9 respectively.

[0533] When performing block classification based on 2×2 size blocks, the activity value A can be represented as in Equation 20.

[0534] [Equation 20]

[0535]

[0536] For example, k and l are the same range. That is, the horizontal and vertical lengths of the range for calculating the sum of a one-dimensional Laplace operation are equal.

[0537] Alternatively, for example, k and l are different ranges. That is, the horizontal and vertical lengths of the range used to calculate the sum of a one-dimensional Laplace operation are different.

[0538] Further alternatively, for example, k is the range from i-2 to i+3, and l is the range from j-2 to j+3. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 6×6.

[0539] Further alternatively, for example, k is the range from i-1 to i+2, and l is the range from j-1 to j+2. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 4×4.

[0540] Further alternatively, for example, k is the range from i to i+1, and l is the range from j to j+1. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 2×2. Alternatively, the operational range for calculating the sum of one-dimensional Laplace operations can be equal to the size of the block classification unit.

[0541] For example, the range of operations for summing the results of a one-dimensional Laplacian operation can include two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonal shapes, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0542] Furthermore, when performing block classification based on 4×4 size blocks, the activity value A can be represented as in Equation 21.

[0543] [Equation 21]

[0544]

[0545] For example, k and l are the same range. That is, the horizontal and vertical lengths of the range for calculating the sum of a one-dimensional Laplace operation are equal.

[0546] Alternatively, for example, k and l are different ranges. That is, the horizontal and vertical lengths of the range used to calculate the sum of a one-dimensional Laplace operation are different.

[0547] Further alternatively, for example, k is the range from i-2 to i+5, and l is the range from j-2 to j+5. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 8×8.

[0548] Further alternatively, for example, k is the range from i to i+3, and l is the range from j to j+3. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 4×4. Alternatively, the operational range for calculating the sum of one-dimensional Laplace operations can be equal to the size of the block classification unit.

[0549] For example, the range of operations for summing the results of a one-dimensional Laplacian operation can include two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonal shapes, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0550] Furthermore, when performing block classification based on 2×2 size blocks, the activity value A can be represented as in Equation 22. Here, at least one of the one-dimensional Laplace operation values ​​for the first and second diagonal directions can be additionally used in the calculation of the activity value A.

[0551] [Equation 22]

[0552]

[0553] For example, k and l are the same range. That is, the horizontal and vertical lengths of the range for calculating the sum of a one-dimensional Laplace operation are equal.

[0554] Alternatively, for example, k and l are different ranges. That is, the horizontal and vertical lengths of the range used to calculate the sum of a one-dimensional Laplace operation are different.

[0555] Further alternatively, for example, k is the range from i-2 to i+3, and l is the range from j-2 to j+3. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 6×6.

[0556] Further alternatively, for example, k is the range from i-1 to i+2, and l is the range from j-1 to j+2. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 4×4.

[0557] Further alternatively, for example, k is the range from i to i+1, and l is the range from j to j+1. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 2×2. Alternatively, the operational range for calculating the sum of one-dimensional Laplace operations can be equal to the size of the block classification unit.

[0558] For example, the range of operations for summing the results of a one-dimensional Laplacian operation can include two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonal shapes, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0559] Furthermore, when performing block classification based on 4×4 size blocks, the activity value A can be represented as in Equation 23. Here, at least one of the one-dimensional Laplace operation values ​​for the first and second diagonal directions can be additionally used in the calculation of the activity value A.

[0560] [Equation 23]

[0561]

[0562] For example, k and l can be the same range. That is, the horizontal and vertical lengths of the range used to calculate the sum of a one-dimensional Laplace operation can be the same.

[0563] Optionally, k and l can be different ranges. That is, the horizontal and vertical lengths of the range used to calculate the sum of a one-dimensional Laplace operation can be different.

[0564] As an example, k ranges from i-2 to i+5, and l ranges from j-2 to j+5. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 8×8. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is larger than the size of the block classification unit.

[0565] As another example, k is the range from i to i+3, and l is the range from j to j+3. In this case, the operational range for calculating the sum of one-dimensional Laplace operations is 4×4. Alternatively, the operational range for calculating the sum of one-dimensional Laplace operations is equal to the size of the block classification unit.

[0566] For example, the range of operations for summing the results of a one-dimensional Laplacian operation includes two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonal shapes, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0567] On the other hand, the activity value A is quantized to produce a quantized activity value A in the range 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.

[0568] A predetermined method can be used to determine the quantitative activity value A. q .

[0569] For example, the quantification activity value A q This can be obtained through Equation 24. In this case, the quantified activity value A is... q It can be included in the range from a specific minimum value X to a specific maximum value Y.

[0570] [Equation 24]

[0571]

[0572] In Equation 24, the quantified activity value A is calculated by multiplying the activity value A by a specific constant W and then performing a right shift operation R 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 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 specifically 8 or 10.

[0573] Further, alternatively, for example, a lookup table (LUT) can be used to calculate the quantified activity value A. q And set the activity value A and the quantified activity value A. q The mapping relationship between them. That is, performing operations on the activity value A and using a lookup table to calculate the quantified activity value A. q In this case, the operation may include at least one of multiplication, division, right shift, left shift, addition, and subtraction.

[0574] On the other hand, in the case of chroma components, filtering is performed on 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. Furthermore, in the case of chroma components, block classification may not be performed on the chroma components, and filtering can be performed using the block classification index derived from the luminance component at the corresponding position of the chroma component. Additionally, in the case of chroma components, filter information for the chroma components may not be transmitted via signal, and fixed-type filters can be used.

[0575] Figure 32 This is a diagram illustrating various computational methods that can be used in place of one-dimensional Laplace operations according to embodiments of the present invention.

[0576] According to embodiments of the present invention, it can be used Figure 32 At least one of the calculation methods shown can be used to replace the one-dimensional Laplace operation. (Refer to...) Figure 32 The computational methods include two-dimensional (two-dimensional) Laplacian, two-dimensional Sobel, two-dimensional edge extraction, and Gaussian two-dimensional Laplacian (LoG) operations. Here, the LoG operation represents applying a combination of a Gaussian filter and a Laplacian filter to the reconstructed samples. In addition to these methods, at least one of a one-dimensional edge extraction filter and a two-dimensional edge extraction filter can be used instead of the one-dimensional Laplacian operation. Optionally, the Difference of Gaussians (DoG) operation can be used. Here, the DoG operation represents applying a combination of Gaussian filters with different intrinsic parameters to the reconstructed samples.

[0577] Furthermore, to calculate the directionality value D or the mobility value A, an N×M LoG operation can be used. Here, M and L are both positive integers. For example, using... Figure 32 The 5×5 two-dimensional LoG shown in (i) and Figure 32 At least one of the 9×9 two-dimensional LoG operations shown in (j). Alternatively, for example, a one-dimensional LoG operation can be used instead of a two-dimensional LoG operation.

[0578] According to embodiments of the invention, each 2×2-sized block of brightness can be classified based on directionality and two-dimensional Laplacian activity. For example, horizontal / vertical gradient characteristics can be obtained using a Sobel filter. The directionality value D can be obtained using equations 25 and 26.

[0579] A representative vector can be computed such that the gradient vector within a predetermined window size (e.g., a 6×6 block) satisfies the condition of Equation 25. Direction and deformation can be identified based on θ.

[0580] [Equation 25]

[0581]

[0582] The similarity between the representative vector within the window and each gradient vector can be calculated using the inner product as shown in Equation 26.

[0583] [Equation 26]

[0584]

[0585] The directional value D can be determined using the S value calculated from Equation 26.

[0586] Step 1: When S>th1 is satisfied, set the value of D to 0.

[0587] Step 2: When θ ∈ (D0 or D1) and S < th2 are satisfied, set the D value to 2, but when not satisfied, set the D value to 1.

[0588] Step 3: When θ ∈ (V or H) and S < th2 are satisfied, set the D value to 4, but when not satisfied, set the D value to 3.

[0589] Here, the number of block classification indexes can be 25 in total.

[0590] According to an embodiment of the present invention, the block classification of the reconstructed sample point s′(i, j) can be represented by Equation 27.

[0591] [Equation 27]

[0592] where k = 0,..., K - 1

[0593] In Equation 27, I represents the set of sample positions of all reconstructed sample points S′(i, j). D is a classifier that assigns the class index k ∈ {0,..., K - 1} to the sample position (i, j). In addition, is the set of all sample points to which the class index is assigned by the classifier D. The class supports four different classifiers, and each classifier can provide K = 25 or 27 classes. The classifier used in the decoder can be specified by the syntax element classification_idx signaled at the slice level. The class with the class index k ∈ {0,..., K - 1} is given Perform the following steps.

[0594] When classification_idx = 0, use the block classifier D based on directionality and activity G . This classifier can provide K = 25 classes.

[0595] When classification_idx = 1, the sample - based feature classifier D S is used as the classifier. D S (i, j) uses the quantized sample value of each sample in the sample point s′(i, j) according to Equation 28.

[0596] [Equation 28]

[0597]

[0598] where B is the sample bit depth, the class number K is set to 27 (K = 27), and the operator specifies the operation of rounding to the nearest integer.

[0599] When classification_idx = 2, a sorted sample-based feature classifier is used. It can be used as a classifier. Equation 30 represents this. r8(i,j) is a classifier that compares s′(i,j) with its 8 neighboring sample points and arranges the sample points in order of their values.

[0600] [Equation 29]

[0601]

[0602] The classifier r8(i,j) has values ​​ranging from 0 to 8. The value of s′(i,j) is zero when the sample s′(i,j) is the largest sample within a 3×3 block centered at (i,j). The value of r8(i,j) is 1 when s′(i,j) is the second largest sample.

[0603] [Equation 30]

[0604]

[0605] In Equation 30, T1 and T2 are predefined thresholds. That is, the dynamic range of the sample points is divided into three segments, and the rank of the local sample points in each segment is used as an additional criterion. The rank-based, sample-based feature classifier provides 27 categories (K=27).

[0606] When classification_idx = 3, a classifier based on ranking and region variation is used. It can be represented by Equation 31.

[0607] [Equation 31]

[0608]

[0609] In Equation 31, T3 or T4 is a predefined threshold. The local variable v(i,j) at each sample location (i,j) can be represented by Equation 32.

[0610] [Equation 32]

[0611] v(i,j)=4*s′(i,j)-(s′(i-1,j)+s′(i+1,j)+s′(i,j+1)+s′(i,j-1))

[0612] Besides each sample point being initially classified into one of three categories based on the local variable |v(i,j)]|, it is related to The same classifier is used. Next, within each category, the ranking of nearby local samples can be used as an additional criterion to provide 27 categories.

[0613] According to embodiments of the invention, at the strip level, a filter set of up to 16 filters using three pixel classification methods (such as intensity classifier, histogram classifier, and directional activity classifier) ​​is used for the current strip. At the CTU level, based on control flags in the strip header transmitted with signals, three modes are used at the CTU level, including a new filter mode, a spatial filter mode, and a strip filter mode.

[0614] Here, the intensity classifier is similar to the band offset of SAO. The intensity range of the sample points is divided into 32 groups, and the group index for each sample point is determined based on the intensity of the sample points to be processed.

[0615] Furthermore, in the case of the similarity classifier, neighboring samples in the 5×5 diamond filter are compared with the target sample, which is the sample to be filtered. The group index of the sample to be filtered can be initialized to 0. When the difference between the neighboring sample and the target sample is greater than a predefined threshold, the group index is incremented by one. Additionally, when the difference between the neighboring sample and the target sample is twice the predefined threshold, an additional 1 is added to the group index. In this case, the similarity classifier has 25 groups.

[0616] Furthermore, in the case of the Rot BA classifier, the computational range for calculating the sum of one-dimensional Laplacian operations over a 2×2 block is reduced from a 6×6 size to a 4×4 size. This classifier has a maximum of 25 groups. A maximum of 25 or 32 groups can exist in multiple classifiers. However, the number of filters in a strip filter set is limited to a maximum of 16 groups. That is, the encoder merges consecutive groups, keeping the number of merged groups at 16 or fewer.

[0617] According to embodiments of the present invention, when determining a block classification index, the block classification index is determined based on at least one of the coding parameters of the current block and neighboring blocks. The block classification index varies according to at least one of the coding parameters. In this case, the coding parameters include at least one of the following: prediction mode (i.e., whether the prediction is intra-frame prediction or inter-frame prediction), inter-frame prediction mode, intra-frame prediction mode, intra-frame prediction indicator, motion vector, reference frame index, quantization parameter, block size of the current block, block shape of the current block, size of the block classification unit, and coding block flag / style.

[0618] In one example, block classification is determined based on quantization parameters. For instance, when the quantization parameter is less than a threshold T, J block classification indices are used. When the quantization parameter is greater than a threshold R, H block classification indices are used. For other cases, G block classification indices are used. Here, T, R, J, H, and G are positive integers or zero. Furthermore, J is greater than or equal to H. The larger the quantization parameter value, the fewer block classification indices are used.

[0619] In another example, the number of block categories is determined based on the size of the current block. For instance, J block category indices are used when the current block size is less than a threshold T. H block category indices are used when the current block size is greater than a threshold R. For other cases, G block category indices are used. Here, T, R, J, H, and G are positive integers or zero. Furthermore, J is greater than or equal to H. The larger the block size, the fewer block category indices are used.

[0620] In another example, the number of block categories is determined based on the size of the block classification unit. For instance, when the size of the block classification unit is less than a threshold T, J block classification indices are used. When the size of the block classification unit is greater than a threshold R, H block classification indices are used. For other cases, G block classification indices are used. Here, T, R, J, H, and G are positive integers or zero. Furthermore, J is greater than or equal to H. The larger the size of the block classification unit, the fewer block classification indices are used.

[0621] According to an embodiment of the present invention, at least one of the sum of gradient values ​​of common locations in the previous frame, the sum of gradient values ​​of neighboring blocks around the current block, and the sum of gradient values ​​of neighboring block classification units around the current block classification unit is determined as at least one of the sum of gradient values ​​of the current block and the sum of gradient values ​​of the current block classification unit. Here, the co-located sample point in the previous frame is the spatial location or neighboring location of the reconstructed sample point in the current frame within the previous frame.

[0622] For example, when the sum of the gradient values ​​g in the vertical and horizontal directions for the current block cell v and g h When the difference between at least one of the gradient values ​​in the vertical and horizontal directions of the current block classification unit and at least one of the gradient values ​​in the vertical and horizontal directions of the neighboring block classification units surrounding the current block classification unit is equal to or less than a threshold E, the sum of the gradient values ​​in the first diagonal direction and the second diagonal direction of the neighboring block classification units for the current block classification unit will be g. d1 and g d2 At least one of the values ​​is determined as at least one of the gradient values ​​of the current block unit. Here, the threshold E is a positive integer or zero.

[0623] In another example, when the sum of the gradient values ​​g in the vertical and horizontal directions for the current block cell... v and gh When the difference between the sum of the gradient values ​​of the current block classification unit and the sum of the gradient values ​​of the neighboring block classification units in the vertical and horizontal directions is equal to or less than a threshold E, at least one of the sums of the gradient values ​​of the neighboring block classification units of the current block classification unit is determined as at least one of the sums of the gradient values ​​of the current block classification unit. Here, the threshold E is a positive integer or zero.

[0624] In another example, when the difference between at least one statistical value of a reconstructed sample within the current block cell and at least one statistical value of a reconstructed sample within neighboring block classification cells surrounding the current block cell is equal to or less than a threshold E, at least one of the sums of gradient values ​​of neighboring block classification cells surrounding the current block cell is determined as at least one of the sums of gradient values ​​of the current block cell. Here, the threshold E is a positive integer or zero. The threshold E is derived from the spatial and / or temporal neighboring blocks of the current block. Furthermore, the threshold E is a predefined value in the encoder and decoder.

[0625] According to an embodiment of the present invention, at least one of the block classification index of the co-position sample point in the previous frame, the block classification index of the neighboring block of the current block, and the block classification index of the neighboring block classification unit of the current block classification unit is determined as at least one of the block classification index of the current block and the block classification index of the current block classification unit.

[0626] For example, when the sum of the gradient values ​​g in the vertical and horizontal directions of the front block element is... v and g h When the difference between at least one of the gradient values ​​in the current block classification unit and at least one of the sums of the vertical and horizontal gradient values ​​of the neighboring block classification units surrounding the current block classification unit is equal to or less than a threshold E, the block classification index of the neighboring block classification units surrounding the current block classification unit is determined as the block classification index of the current block unit. Here, the threshold E is a positive integer or zero.

[0627] Alternatively, for example, when the sum of the gradient values ​​g in the vertical and horizontal directions for the current block cell... v and g h When the difference between the sum of the gradient values ​​of the current block classification unit and the sum of the gradient values ​​of the neighboring block classification units around the current block classification unit in the vertical and horizontal directions is equal to or less than the threshold E, the block classification index of the neighboring block classification units around the current block classification unit is determined as the block classification index of the current block unit. Here, the threshold E is a positive integer or zero.

[0628] Further optionally, for example, when the difference between at least one statistical value of a reconstructed sample point within the current block cell and at least one statistical value of a reconstructed sample point within a neighboring block cell surrounding the current block cell is equal to or less than a threshold E, the block classification index of the neighboring block cells surrounding the current block cell is determined as the block classification index of the current block cell. Here, the threshold E is a positive integer or zero.

[0629] Further, alternatively, for example, at least one of the combinations of the block classification index determination methods described above can be used to determine the block classification index.

[0630] The following sections will describe the filtering execution sub-steps.

[0631] 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 the reconstructed / decoded image. When filtering is performed, one of L filters is selected. L is a positive integer or zero.

[0632] For example, select one of L filters in a block classification unit, and perform filtering on the reconstructed / decoded image in units of reconstructed / decoded samples.

[0633] Alternatively, for example, one of the L filters can be selected on a block classification unit basis, and filtering can be performed on the reconstructed / decoded image on a block classification unit basis.

[0634] Further alternatively, for example, one of the L filters can be selected on a block classification unit basis, and filtering can be performed on the reconstructed / decoded image on a CU basis.

[0635] Further alternatively, for example, one of the L filters can be selected on a block classification unit basis, and filtering can be performed on the reconstructed / decoded image on a block basis.

[0636] Further, alternatively, for example, U filters out of L filters are selected in units of block classification, and filtering is performed on the reconstructed / decoded image in units of reconstructed / decoded samples. Here, U is a positive integer.

[0637] Alternatively, for example, U filters out of L filters can be selected on a block classification unit basis, and filtering can be performed on the reconstructed / decoded image on a block classification unit basis. Here, U is a positive integer.

[0638] Further, alternatively, for example, U filters out of L filters can be selected on a block classification unit basis, and filtering can be performed on the reconstructed / decoded image on a CU basis. Here, U is a positive integer.

[0639] Alternatively, for example, U filters out of L filters can be selected per block classification unit, and filtering can be performed on the reconstructed / decoded image per block. Here, U is a positive integer.

[0640] Here, the L filters are called a filter set.

[0641] According to an embodiment of the invention, the L filters differ from each other in at least one of the following aspects: filter coefficients, number of filter taps (i.e., filter length), filter shape, and filter type.

[0642] For example, L filters are identical in at least one of the following aspects: filter coefficients, number of filter taps (filter length), filter shape, and filter type, in units of block, CU, PU, ​​TU, CTU, strip, parallel block, parallel block group, frame, and sequence.

[0643] Alternatively, for example, the L filters are identical in at least one of the following aspects: filter coefficients, number of filter taps (filter length), filter shape, and filter type, in units of CU, PU, ​​TU, CTU, strip, parallel block, parallel block group, frame, and sequence.

[0644] Filtering can be performed using the same or different filters, in units of CU, PU, ​​TU, CTU, strip, parallel block, parallel block group, frame, and sequence.

[0645] The ability to perform or not perform filtering can be based on filtering execution information, which specifies whether filtering is performed on a per-sample, per-block, per-unit, per-unit, per-unit, per-unit, per-unit, per-unit, per-frame, and per-sequence basis. This filtering execution information refers to the information transmitted from the encoder to the decoder using signals, on a per-sample, per-block, per-unit, per-unit, per-unit, per-unit, per-unit, per-frame, and per-sequence basis.

[0646] According to embodiments of the present invention, N filters with different numbers of filter taps but the same filter shape (i.e., diamond or rhomboid filter shape) are used. Here, N is a positive integer. For example, Figure 33 The diagram shows a diamond filter with 5×5, 7×7, or 9×9 filter taps.

[0647] Figure 33 This is a diagram illustrating a diamond-shaped filter according to an embodiment of the present invention.

[0648] Reference Figure 33In order to send information from the encoder to the decoder about which of the three diamond filters with 5×5, 7×7, or 9×9 filter taps will be used, the filter index is entropy-encoded / entropy-decoded in units of frame / parallel block / parallel block group / strip / sequence. That is, the filter index is entropy-encoded / entropy-decoded in the sequence parameter set, frame parameter set, strip header, strip data, parallel block header, parallel block group header, header, etc. in the bitstream.

[0649] According to an embodiment of the present invention, when the number of filter taps in the encoder / decoder is fixed to 1, the encoder / decoder performs filtering using the filter index without entropy encoding / decoding the filter index. Here, a diamond filter with 7×7 filter taps is used for the luminance component, and a diamond filter with 5×5 filter taps is used for the chrominance component.

[0650] According to an embodiment of the invention, at least one of the three diamond filters is used to filter at least one reconstructed / decoded sample of at least one of the luminance component and the chrominance component.

[0651] For example, Figure 33 At least one of the three diamond-shaped filters shown is used to filter the reconstructed / decoded luminance samples.

[0652] Alternatively, for example, Figure 33 The 5×5 diamond-shaped filter shown is used to filter the reconstructed / decoded chroma samples.

[0653] Further, alternatively, for example, the filter used to filter the luminance sample is used to filter the reconstructed / decoded chrominance sample corresponding to the luminance sample.

[0654] in addition, Figure 33 The numbers in each filter shape shown represent filter coefficient indices, and these indices are symmetrical about the filter center. That is, Figure 33 The filter shown is a point-symmetric filter.

[0655] On the other hand, Figure 33 In the case of the 9×9 diamond filter shown in (a), a total of 21 filter coefficients are entropy encoded / entropy decoded. Figure 33 In the case of the 7×7 diamond filter shown in (b), a total of 13 filter coefficients are entropy encoded / entropy decoded, and Figure 33 In the case of the 5×5 diamond filter shown in (c), a total of 7 filter coefficients are entropy encoded / entropy decoded. That is, a maximum of 21 filter coefficients need to be entropy encoded / entropy decoded.

[0656] In addition, regarding Figure 33 The 9×9 rhombus filter shown in (a) requires a total of 21 multiplications per sample. Figure 33 The 7×7 diamond filter shown in (b) requires a total of 13 multiplications per sample. Figure 33 The 5×5 diamond filter shown in (c) requires a total of 7 multiplications per sample. That is, the maximum number of multiplications per sample is 21 to perform filtering.

[0657] In addition, such as Figure 33 As shown in (a), since the 9×9 diamond filter has a size of 9×9, the hardware implementation requires four line buffers, which is half the length of the vertical filter. That is, a maximum of four line buffers are required.

[0658] According to embodiments of the invention, the filters have the same filter length (representing a 5×5 filter tap), but may have different filter shapes selected from the following: rhombus, rectangle, square, trapezoid, diagonal shape, snowflake shape, number symbol shape, clover shape, cross shape, triangle, pentagon, hexagon, octagon, decagon, and dodecagon. For example, Figure 34 The image shows square-shaped filters, octagonal-shaped filters, snowflake-shaped filters, and diamond-shaped filters with 5×5 filter taps.

[0659] The number of filter taps is not limited to 5×5. Filters with H×V filter taps selected from the following 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 have the same or different values. Furthermore, at least one of H and V is a predefined value in the encoder / decoder and is the value sent from the encoder to the decoder as a signal. Additionally, one of H and V is defined using the other of H and V. Furthermore, the final value of H or V can be defined using the values ​​of H and V.

[0660] On the other hand, in order to send signals from the encoder to the decoder Figure 34 The information of which filter among the filters shown will be used can be entropy-encoded / entropy-decoded for the filter index in units of frame / parallel block / parallel block group / strip / sequence. That is, the filter index is entropy-encoded / entropy-decoded into the sequence parameter set, frame parameter set, strip header, strip data, parallel block header, and parallel block group header within the bitstream.

[0661] on the other hand, Figure 34At least one of the square-shaped filter, octagonal-shaped filter, snowflake-shaped filter, and diamond-shaped filter shown is used to filter at least one reconstructed / decoded sample of at least one of the luminance and chrominance components.

[0662] on the other hand, Figure 34 The numbers in each filter shape shown represent filter coefficient indices, and these indices are symmetrical about the filter center. That is, Figure 34 The filter shown is a point-symmetric filter.

[0663] According to embodiments of the present invention, when filtering a reconstructed image on a sample basis, the appropriate filter shape for each image, strip, parallel block, or group of parallel blocks can be determined for rate-distortion optimization in the encoder. Furthermore, filtering is performed using the determined filter shape. This is because the degree of improvement in coding efficiency and the amount of filter information (the number of filter coefficients) are determined according to... Figure 34 The filter shape varies as shown, so it is necessary to determine the optimal filter shape for each frame, strip, parallel block, or group of parallel blocks. That is, the optimal filter shape is determined based on factors such as video resolution, video characteristics, and bit rate. Figure 34 The optimal filter shape among the filter shapes shown.

[0664] According to embodiments of the present invention, and with the use of, Figure 33 Compared to the filter shown, using a filter like... Figure 34 The filter shown has the advantage of reducing the computational complexity of the encoder / decoder.

[0665] For example, in Figure 34 In the case of the 5×5 square filter shown in (a), a total of 13 filter coefficients are entropy encoded / entropy decoded. Figure 34 In the case of the 5×5 octagonal filter shown in (b), a total of 11 filter coefficients are entropy encoded / entropy decoded. Figure 34 In the case of the 5×5 snowflake filter shown in (c), a total of 9 filter coefficients are entropy encoded / entropy decoded, and... Figure 34 In the case of the 5×5 diamond-shaped filter shown in (c), a total of 7 filter coefficients are entropy-encoded / entropy-decoded. That is, the number of filter coefficients that will be entropy-encoded / entropy-decoded varies depending on the filter shape. Here, Figure 34 The maximum number of filter coefficients in the example (i.e., 13) is less than Figure 33 The maximum number of filter coefficients in the example is 21. Therefore, when using Figure 34In the example of filters, the number of filter coefficients that will be entropy encoded / entropy decoded is reduced. Therefore, in this case, the computational complexity of the encoder / decoder can be reduced.

[0666] Optionally, for example, for Figure 34 The 5×5 square filter shown in (a) requires a total of 13 multiplications per sample. Figure 34 The 5×5 octagonal filter shown in (b) requires a total of 11 multiplications per sample. Figure 34 The 5×5 snowflake filter shown in (c) requires a total of 9 multiplications per sample, and for Figure 34 The 5×5 rhombus filter shown in (d) requires a total of 7 multiplications per sample. Figure 34 The maximum number of filter coefficients in the example (i.e., 13) is less than Figure 33 The maximum number of filter coefficients in the example is 21. Therefore, when using Figure 34 In the example filter, the number of multiplications per sample is reduced. Therefore, in this case, the computational complexity of the encoder / decoder can be reduced.

[0667] Further, alternatively, for example, due to Figure 34 All filters in the examples are 5×5 in size, so the hardware implementation requires two line buffers, which are half the length of the vertical filter. Here, using... Figure 34 The filter in the example requires fewer line buffers (i.e., two line buffers) than using a filter like... Figure 33 The example filter requires the number of line buffers (i.e., four line buffers). Therefore, when using Figure 34 When using filters in examples, the size of line buffers, encoder / decoder hardware complexity, memory capacity requirements, and memory access bandwidth can be reduced.

[0668] According to embodiments of the present invention, as the filter used in the above-described filtering process, a filter having at least one shape selected from the following shapes is used: rhombus, rectangle, square, trapezoid, diagonal shape, snowflake shape, number symbol shape, clover shape, cross shape, triangle, pentagon, hexagon, octagon, decagon, and dodecagon. For example, such as Figure 35a and / or Figure 35b As shown, the filter can have a shape selected from the following shapes: square, octagon, snowflake, rhombus, hexagon, rectangle, cross, number symbol, clover, and diagonal.

[0669] For example, using Figure 35a and / or Figure 35bThe filter set is constructed by using at least one of the filters with a vertical length of 5 shown, and then the filter set is used to perform filtering.

[0670] Alternatively, for example, using Figure 35a and Figure 35b The filter set is constructed by using at least one of the vertical filter lengths of 3 shown in the filter diagram, and then the filter set is used to perform filtering.

[0671] Further, alternatively, for example, using Figure 35a and / or Figure 35b The filter set is constructed using at least one of the vertical filter lengths of 3 or 5 shown, and the filter set is used to perform filtering.

[0672] Figure 35a and Figure 35b The filter shown is designed with a vertical filter length of 3 or 5. However, the filter shape used in embodiments of the invention is not limited to this. The filter can be designed with any vertical filter length M. Here, M is a positive integer.

[0673] On the other hand, using Figure 35a and / or Figure 35b The filters shown are used to prepare H filter sets, and information about which filter to use is sent from the encoder to the decoder via a signal. In this case, the filter indices are entropy encoded / entropy decoded in units of frames, parallel blocks, parallel block groups, stripes, or sequences. Here, H is a positive integer. That is, the filter indices are entropy encoded / entropy decoded into the sequence parameter set, frame parameter set, stripe header, stripe data, parallel block header, and parallel block group header within the bitstream.

[0674] At least one of the following filters—rhombus, rectangle, square, trapezoid, diagonal, snowflake, number symbol, clover, cross, triangle, pentagon, hexagon, octagon, and decagon—is used to filter the reconstructed / decoded samples of at least one of the luminance and chrominance components.

[0675] on the other hand, Figure 35a and / or Figure 35b The numbers in each filter shape shown represent filter coefficient indices, and these indices are symmetrical about the filter center. That is, Figure 35a and / or Figure 35b The filter shape shown is a point-symmetric filter.

[0676] According to embodiments of the present invention, and with the use of, Figure 33 Compared to the filters in the examples, using such Figure 35aand / or Figure 35b The filters in the example have the advantage of reducing the computational complexity of the encoder / decoder.

[0677] For example, when using Figure 35a and / or Figure 35b When using at least one of the filters shown, with the use of Figure 33 Compared to the case of one filter in the 9×9 diamond filter shown, the number of filter coefficients to be entropy encoded / decoded is reduced. Therefore, the computational complexity of the encoder / decoder can be reduced.

[0678] Optionally, for example, when using Figure 35a and / or Figure 35b When using at least one of the filters shown, with the use of Figure 33 Compared to the case of a single filter in the 9×9 diamond filter shown, the number of multiplications required for filtering the filter coefficients is reduced. Therefore, the computational complexity of the encoder / decoder can be reduced.

[0679] Further, alternatively, for example, when using Figure 35a and / or Figure 35b When using at least one of the filters shown, with the use of Figure 33 Compared to the case of a single filter in the 9×9 diamond filter shown, the number of lines in the line buffer required for filtering the filter coefficients is reduced. Furthermore, it reduces hardware complexity, memory requirements, and memory access bandwidth.

[0680] According to embodiments of the present invention, it is possible to use from Figure 36 At least one filter selected from the horizontal / vertical symmetric filters shown is used instead of the point symmetric filter for filtering. Alternatively, in addition to the point symmetric filter and the horizontal / vertical symmetric filter, a diagonal symmetric filter may also be used. Figure 36 In the diagram, the numbers in each filter shape represent the filter coefficient indices.

[0681] For example, using Figure 36 The filter set is constructed by using at least one of the vertical filter lengths of 5 in the filter shown, and then the filter set is used to perform filtering.

[0682] Alternatively, for example, using Figure 36 The filter set is constructed by using at least one of the vertical filter lengths of 3 shown in the filter diagram, and then the filter set is used to perform filtering.

[0683] Further, alternatively, for example, using Figure 36The filter set is constructed using at least one of the vertical filter lengths of 3 or 5 shown, and the filter set is used to perform filtering.

[0684] Figure 36 The filter shape shown is designed with a vertical filter length of 3 or 5. However, the filter shape used in embodiments of the invention is not limited to this. The filter can be designed with any vertical filter length M. Here, M is a positive integer.

[0685] In order to prepare including Figure 36 The filter set of H filters shown is used, and information about which filter from the filter set will be used is sent from the encoder to the decoder via a signal. The filter indexes are entropy-encoded / entropy-decoded in units of frames, parallel blocks, parallel block groups, stripes, or sequences. Here, H is a positive integer. That is, the filter indexes are entropy-encoded / entropy-decoded into the sequence parameter set, frame parameter set, stripe header, stripe data, parallel block header, and parallel block group header within the bitstream.

[0686] At least one of the following filters—rhombus, rectangle, square, trapezoid, diagonal, snowflake, numeral, clover, cross, triangle, pentagon, hexagon, octagon, and decagon—is used to filter the reconstructed / decoded samples of at least one of the luminance and chrominance components.

[0687] According to embodiments of the present invention, and with the use of, Figure 33 Compared to the filter shown, using a filter like... Figure 36 The filter shown has the advantage of reducing the computational complexity of the encoder / decoder.

[0688] For example, when using Figure 36 When using at least one of the filters shown, with the use of Figure 33 Compared to the case of one filter in the 9×9 diamond filter shown, the number of filter coefficients to be entropy encoded / decoded is reduced. Therefore, the computational complexity of the encoder / decoder can be reduced.

[0689] Optionally, for example, when using Figure 36 When using at least one of the filters shown, with the use of Figure 33 Compared to the case of a single filter in the 9×9 diamond filter shown, the number of multiplications required for filtering the filter coefficients is reduced. Therefore, the computational complexity of the encoder / decoder can be reduced.

[0690] Further, alternatively, for example, when using Figure 36 When using at least one of the filters shown, with the use of Figure 33Compared to the case of a single filter in the 9×9 diamond filter shown, the number of lines in the line buffer required for filtering the filter coefficients is reduced. Furthermore, it reduces hardware complexity, memory requirements, and memory access bandwidth.

[0691] According to an embodiment of the present invention, before performing filtering on a block classification unit basis, the sum of gradient values ​​calculated on a block classification unit basis (i.e., the sum of gradient values ​​g for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction) is used. v g h g d1 and g d2 At least one of the following is used to perform a geometric transformation on the filter coefficients f(k, l). In this case, the geometric transformation of the filter coefficients is achieved by performing a 90° rotation, a 180° rotation, a 270° rotation, a second diagonal flip, a first diagonal flip, a vertical flip, a horizontal flip, a vertical and horizontal flip, or a scaling up / down, thereby producing a geometrically transformed filter.

[0692] On the other hand, after performing a geometric transformation on the filter coefficients, the reconstructed / decoded samples are filtered using the geometrically transformed filter coefficients. In this case, a geometric transformation is performed on at least one of the reconstructed / decoded samples that are the filtering targets, and then the reconstructed / decoded samples are filtered using the filter coefficients.

[0693] According to an embodiment of the present invention, geometric transformations are performed according to equations 33 to 35.

[0694] [Equation 33]

[0695] f D (k, l) = f(l, k)

[0696] [Equation 34]

[0697] f V (k, l) = f(k, Kl-1)

[0698] [Equation 35]

[0699] f R (k, l) = f(Kl-1, k)

[0700] Here, Equation 33 is an example showing the formula for flipping the second diagonal, Equation 34 is an example showing the formula for flipping vertically, and Equation 35 is an example showing the formula for rotating 90°. In Equations 34 to 35, K is the number of filter taps (filter length) in the horizontal and vertical directions, and "0 ≤ K and 1 ≤ K-1" represents the coordinates of the filter coefficients. For example, (0, 0) represents the top left corner, and (K-1, K-1) represents the bottom right corner.

[0701] Table 1 shows an example of a geometric transformation applied to the filter coefficients f(k,l) based on the sum of gradient values.

[0702] [Table 1]

[0703] Sum of gradient values Types of geometric transformations <![CDATA[g d2 <g d1 And g h <g v ]]> The transformation was not performed. <![CDATA[g d2 <g d1 And g v <g h ]]> Flip the second diagonal <![CDATA[g d1 <g d2 And g h <g v ]]> Vertical flip <![CDATA[g d1 <g d2 And g v <g h ]]> 90° rotation

[0704] Figure 37 This is a diagram illustrating filters obtained by performing geometric transformations on square filters, octagonal filters, snowflake filters, and rhomboid filters according to embodiments of the present invention.

[0705] Reference Figure 37 The filter coefficients of square, octagonal, snowflake, and rhomboid filters undergo at least one of the following geometric transformations: second diagonal flip, vertical flip, and 90° rotation. The filter coefficients obtained through the geometric transformation can then be used for filtering. Alternatively, after performing a geometric transformation on the filter coefficients, the reconstructed / decoded samples are filtered using the geometrically transformed filter coefficients. In this case, at least one of the reconstructed / decoded samples that are the filtering targets undergoes a geometric transformation, and then the reconstructed / decoded samples are filtered using the filter coefficients.

[0706] According to one embodiment of the present invention, filtering is performed on the reconstructed / decoded sample R(i,j) to produce a filtered decoded sample R′(i,j). The filtered decoded sample can be represented by Equation 36.

[0707] [Equation 36]

[0708]

[0709] In Equation 36, L is the number of filter taps (filter length) in the horizontal or vertical direction, and f(k, l) are the filter coefficients.

[0710] On the other hand, when filtering is performed, the offset value Y can be added to the filtered, decoded sample R′(i,j). Entropy encoding / decoding can be performed on the offset value Y. Furthermore, the offset value Y is calculated using at least one statistical value of the currently reconstructed / decoded sample value and the neighboring reconstructed / decoded sample values. Additionally, the offset value Y is determined based on at least one encoding parameter of the currently reconstructed / decoded sample and the neighboring reconstructed / decoded sample. Here, the threshold E is a positive integer or zero.

[0711] Additionally, the filtered and decoded samples can be truncated to N bits. Here, N is a positive integer. For example, when the filtered and decoded samples generated by filtering the reconstructed / decoded samples are truncated by 10 bits, the final decoded sample value can have a value in the range of 0 to 1023.

[0712] According to an embodiment of the present invention, filtering of the chromaticity component is performed based on filter information of the luminance component.

[0713] For example, filtering of the reconstructed image of the luminance component can be performed only if filtering of the reconstructed image of the chrominance component was performed in a previous stage. Here, chrominance component reconstructed image filtering can be performed on U(Cr), V(Cb), or both of these components.

[0714] Alternatively, for example, in the case of the chroma component, filtering can be performed using at least one of the filter coefficients corresponding to the luminance component, the number of filter taps, the filter shape, and information on whether filtering is performed.

[0715] According to an exemplary embodiment of the present invention, when filtering is performed, if an unavailable sample exists near the current sample, padding is performed, and then the padded sample is used to perform filtering. Padding refers to a method of copying the sample value of an adjacent available sample to an unavailable sample. Optionally, sample values ​​or statistics obtained based on the values ​​of available samples adjacent to the unavailable sample are used. Padding can be performed repeatedly for column P and row R. Here, M and L are both positive integers.

[0716] Here, an unusable sample point refers to a sample point located outside the boundary of a CTU, CTB, strip, parallel block, parallel block group, or screen. Optionally, an unusable sample point refers to a sample point belonging to at least one of the CTU, CTB, strip, parallel block, parallel block group, and screen that is different from the current sample point's CTU, CTB, strip, parallel block, parallel block group, and screen.

[0717] According to an embodiment, the filling method for samples located outside the screen boundary and the filling method for samples located outside a predetermined area may differ, wherein the predetermined area exists within the screen boundary but an adaptive in-loop filter is applied. For samples located outside the screen boundary, the values ​​of available samples located at the screen boundary can be copied, and the values ​​of samples located outside the screen boundary can be determined. For samples located outside the predetermined area, the filling value for unusable samples can be determined by mirroring the values ​​of available samples based on the screen boundary, wherein the predetermined area exists within the screen boundary but an adaptive in-loop filter is applied.

[0718] According to an embodiment, filling of sample points located outside the screen boundary can be performed only in the horizontal direction, and filling of sample points located outside the screen boundary can be omitted in the vertical direction. Conversely, filling of sample points located outside the screen boundary can be performed only in the vertical direction, and filling of sample points located outside the screen boundary can be omitted in the horizontal direction.

[0719] Furthermore, when performing filtering, predetermined samples may not be used.

[0720] For example, when performing filtering, the filled samples may not be used.

[0721] Alternatively, for example, when performing filtering, if there are unavailable samples near the current sample, the unavailable sample may not be used in the filtering.

[0722] Further alternatively, for example, when performing filtering, if the samples near the current sample are located outside the CTU or CTB, the neighboring samples near the current sample may not be used in the filtering.

[0723] In addition, when performing filtering, samples that have been subjected to at least one of deblocking filtering, adaptive sample offset, and adaptive in-loop filtering can be used.

[0724] Furthermore, when performing filtering, if at least one of the samples present near the current sample is located outside the CTU or CTB boundary, at least one of the following can be omitted: deblocking filtering, adaptive sample offset, and adaptive in-loop filtering.

[0725] In addition, the target samples for filtering include unavailable samples located outside the CTU or CTB boundary. At least one of deblocking filtering, adaptive sample offsetting, and adaptive in-loop filtering is not performed on the unavailable samples, and the unavailable samples are used for filtering as is.

[0726] According to an embodiment of the present invention, when filtering is performed, filtering is performed on at least one sample point located near the boundary of at least one of CU, PU, ​​TU, block, block classification unit, CTU, and CTB. In this case, the boundary includes at least one of a vertical boundary, a horizontal boundary, and a diagonal boundary. Furthermore, the sample point located near the boundary can be at least one of U rows, U columns, and U sample points located near the boundary. Here, U is a positive integer.

[0727] According to an embodiment of the present invention, when filtering is performed, filtering is performed on at least one sample point located within a block, but not on sample points located outside the boundary of at least one of CU, PU, ​​TU, block, block classification unit, CTU, and CTB. In this case, the boundary includes at least one of a vertical boundary, a horizontal boundary, and a diagonal boundary. Furthermore, sample points located near the boundary can be at least one of U rows, U columns, and U sample points located near the boundary. Here, U is a positive integer.

[0728] According to an embodiment of the present invention, when filtering is performed, it is determined whether to perform filtering based on at least one of the coding parameters of the current block and neighboring blocks. In this case, the coding parameters include at least one of the following: prediction mode (i.e., whether the prediction is intra-frame prediction or inter-frame prediction), inter-frame prediction mode, intra-frame prediction mode, intra-frame prediction indicator, motion vector, reference frame index, quantization parameter, block size of the current block, block shape of the current block, size of block classification unit, and coding block flag / style.

[0729] Furthermore, when performing filtering, at least one of the following is determined based on at least one of the coding parameters of the current block and neighboring blocks: filter coefficients, number of filter taps (filter length), filter shape, and filter type. At least one of the following—filter coefficients, number of filter taps (filter length), filter shape, and filter type—varies according to at least one of the coding parameters.

[0730] For example, the number of filters used for filtering is determined based on the quantization parameter. For instance, J filters are used when the quantization parameter is less than a threshold T. H filters are used when the quantization parameter is greater than a threshold R. In other cases, G filters are used. Here, T, R, J, H, and G are positive integers or zero. Furthermore, J is greater than or equal to H. Generally, the larger the quantization parameter value, the fewer filters are used.

[0731] Optionally, for example, the number of filters used for filtering is determined based on the size of the current block. For instance, J filters are used when the current block size is less than a threshold T. H filters are used when the current block size is greater than a threshold R. In other cases, G filters are used. Here, T, R, J, H, and G are positive integers or zero. Furthermore, J is greater than or equal to H. Generally, the larger the block size, the fewer block filters are used.

[0732] Optionally, for example, the number of filters used for filtering can be determined based on the size of the block classification unit. For instance, J filters are used when the size of the block classification unit is less than a threshold T. H filters are used when the size of the block classification unit is greater than a threshold R. In other cases, G filters are used. Here, T, R, J, H, and G are positive integers or zero. Furthermore, J is greater than or equal to H. The larger the size of the block classification unit, the fewer block filters are used.

[0733] Further alternatively, filtering can be performed, for example, by using any combination of the filtering methods described above.

[0734] The following section will describe the filter information encoding / decoding steps.

[0735] According to an embodiment of the present invention, the filter information is entropy encoded / entropy decoded to set it within the bitstream between the strip header and the first CTU syntax element of the strip data.

[0736] In addition, the filter information is entropy encoded / entropy decoded to set it in the sequence parameter set, picture parameter set, strip header, strip data, parallel block header, parallel block group header, CTU or CTB within the bitstream.

[0737] On the other hand, the filter information includes at least one of the following: information on whether luma component filtering is performed, information on whether chroma component filtering is performed, filter coefficient values; number of filters, number of filter taps (filter length), filter shape information, filter type information, information on whether filtering is performed in strip, parallel block, parallel block group, frame, CTU, CTB, block or CU units, information on the number of times CU-based filtering is performed, CU maximum depth filtering information, information on whether CU-based filtering is performed, information on whether filters from previous reference frames are used, filter index of previous reference frames, information on whether fixed filters are used for block classification index, index information for fixed filters, filter merging information, information on whether different filters are used for luma and chroma components respectively, and filter symmetry shape information.

[0738] Here, the number of filter taps refers to at least one of the following: 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.

[0739] On the other hand, the filter information includes up to L luminance filters. Here, L is a positive integer, and specifically 25. Furthermore, the filter information includes up to L chroma filters. Here, L is a positive integer, including 0, and can be from 0 to 8. Information regarding the up to L chroma filters can be included in a parameter set or header. The parameter set can be an adaptive parameter set. Information regarding the up to L chroma filters can represent information about the number of chroma ALFs and can be encoded / decoded, for example, as the syntax element `alf_chroma_num_alt_filters_minus1`.

[0740] On the other hand, a filter includes at most K luminance filter coefficients. Here, K is a positive integer, and specifically 13. Furthermore, the filter information includes at most K chrominance filter coefficients. Here, K is a positive integer, and specifically 7.

[0741] For example, information about the symmetry shape of a filter is information about the shape of the filter (such as point symmetry, horizontal symmetry, vertical symmetry, or a combination thereof).

[0742] On the other hand, only some of the filter coefficients are transmitted using a signal. For example, when the filter has a symmetrical form, information about the symmetrical shape of the filter and only one set of filter coefficients in the symmetrical filter coefficient set is transmitted using a signal. Alternatively, for example, the filter coefficients at the center of the filter are not transmitted using a signal, because they can be implicitly derived.

[0743] According to an embodiment of the invention, filter coefficient values ​​in the filter information are quantized in the encoder, and the resulting 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 recover the original filter coefficient values. The filter coefficient values ​​are quantized to a range of values ​​that can be represented by a fixed number of M bits, and then dequantized. Furthermore, at least one filter coefficient is quantized to different bits and dequantized. Conversely, at least one filter coefficient can be quantized to the same number of bits and dequantized. The M bits are determined according to the quantization parameters. Furthermore, M in the M bits is a predefined constant in the encoder and decoder. Here, M can be a positive integer, and specifically 8 or 10. The M bits can be less than or equal to the number of bits required to represent a sample in the encoder / decoder. For example, when the number of bits required to represent a sample is 10, M can be 8. The first filter coefficient in the filter coefficients within the filter can have a value from -2... M to -2 M The values ​​are in the range of -1, and the second filter coefficients can have values ​​from 0 to 2. M Values ​​within the range of -1. Here, the first filter coefficient refers to all filter coefficients except the center filter coefficient, and the second filter coefficient refers to the center filter coefficient.

[0744] The filter coefficient values ​​in the filter information can be cropped by at least one of the encoder and decoder, and at least one of the minimum and maximum values ​​associated with the cropping can be entropy encoded / entropy decoded. The filter coefficient values ​​can be cropped to fall within the range from the minimum to the maximum value. For each filter coefficient, at least one of the minimum and maximum values ​​can have different values. On the other hand, for each filter coefficient, at least one of the minimum and maximum values ​​can have the same value. At least one of the minimum and maximum values ​​can be determined based on quantization parameters. At least one of the minimum and maximum values ​​can be a predefined constant value in the encoder and decoder.

[0745] According to an embodiment of the present invention, at least one piece of filter information in the filter information is entropy encoded / entropy decoded based on at least one of the encoding parameters of the current block and neighboring blocks. In this case, the encoding parameters include at least one of the following: prediction mode (i.e., whether the prediction is intra-frame prediction or inter-frame prediction), inter-frame prediction mode, intra-frame prediction mode, intra-frame prediction indicator, motion vector, reference frame index, quantization parameter, block size of the current block, block shape of the current block, size of block classification unit, and encoding block flag / mode.

[0746] For example, the number of filters in multiple filter information is determined based on the quantization parameters of the frame, strip, parallel block group, parallel block, CTU, CTB, or block. Specifically, when the quantization parameter is less than a threshold T, J filters are entropy encoded / decoded. When the quantization parameter is greater than a threshold R, H filters are entropy encoded / decoded. In other cases, G filters are entropy encoded / decoded. Here, T, R, J, H, and G are positive integers or zero. Furthermore, J is greater than or equal to H. The larger the quantization parameter value, the fewer filters are entropy encoded.

[0747] According to an exemplary embodiment of the present invention, filtering execution information (flags) is used to indicate whether filtering is performed on at least one of the luminance component and the chrominance component.

[0748] For example, filtering execution information (flags) can be used in units of CTU, CTB, CU, or block to indicate whether filtering is performed on at least one of the luma and chroma components. 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, entropy encoding / decoding can be performed on the information regarding whether filtering is performed for each CTB. Optionally, for example, information regarding the maximum depth or minimum size of the CU (maximum depth filtering information of the CU) can be additionally entropy encoded / decoded, and CU-based filtering execution information regarding the CU with the maximum depth or the CU with the minimum size can be entropy encoded / decoded.

[0749] For example, when a block can be partitioned into smaller square sub-blocks and non-square sub-blocks based on its block structure, CU-based flags are entropy-encoded / entropy-decoded until the block has a partition depth that allows it to be partitioned into smaller square sub-blocks. Furthermore, CU-based flags can be entropy-encoded / entropy-decoded until the block has a partition depth that allows it to be partitioned into smaller non-square sub-blocks.

[0750] Optionally, for example, the information regarding whether filtering is performed on at least one of the luminance and chrominance components can be based on block-based flags (i.e., flags on a block-by-block basis). For example, filtering is performed on the corresponding block when the block-based flag has a first value, and no filtering is performed when the corresponding block's block-based flag has a second value. The block size is N×M, where N and M are positive integers.

[0751] Further optionally, for example, the information regarding whether filtering is performed on at least one of the luminance and chrominance components can be a CTU-based flag (i.e., a flag in CTU units). For example, filtering is performed on the corresponding CTU when the CTU-based flag has a first value, and filtering is not performed when the CTU-based flag has a second value. The size of the CTU is N×M, where N and M are positive integers.

[0752] Further, alternatively, for example, the decision to perform filtering on at least one of the luminance and chrominance components can be determined based on the frame, strip, parallel block group, or parallel block type. Information regarding whether filtering is performed on at least one of the luminance and chrominance components can be flags in units of frame, strip, parallel block group, or parallel block.

[0753] According to embodiments of the present invention, filter coefficients belonging to different block categories can be merged to reduce the amount of filter coefficients that will be entropy encoded / entropy decoded. In this case, entropy encoding / entropy decoding is performed on filter merging information regarding whether filter coefficients are merged.

[0754] Furthermore, to reduce the number of filter coefficients that will be entropy-encoded / entropy-decoded, filter coefficients from a reference frame can be used as filter coefficients for the current frame. In this case, the method of using filter coefficients from a reference frame is called temporal filter coefficient prediction. For example, temporal filter coefficient prediction is used for inter-frame prediction frames (B / P frames, stripes, parallel block groups, or parallel blocks). On the other hand, the filter coefficients from the reference frame are stored in memory. Moreover, when filter coefficients from a reference frame are used for the current frame, entropy encoding / entropy decoding of the filter coefficients for the current image is omitted. In this case, the previous reference frame filter index, indicating which reference frame's filter coefficients were used, is entropy-encoded / entropy-decoded.

[0755] For example, when using temporal filter coefficient prediction, a candidate list of filters is constructed. The candidate list is empty before decoding a new sequence. However, each time a frame is decoded, the frame's filter coefficients are added to the candidate list. When the number of filters in the candidate list reaches the maximum number G, new filters can replace the oldest filters in the decoding order. That is, the candidate list is updated in a first-in, first-out (FIFO) manner. Here, G is a positive integer, specifically 6. To prevent filters from being duplicated in the candidate list, filter coefficients from frames that are not predicted using temporal filter coefficients can be added to the candidate list.

[0756] Optionally, for example, when using temporal filter coefficient prediction, a candidate list of filter sets for multiple temporal layer indices is constructed to support temporal scalability. That is, a candidate list of filter sets is constructed for each temporal layer. For example, the candidate list of filter sets for each temporal layer includes the filter sets for decoded frames whose temporal layer indices are equal to or less than the temporal layer indices of previously decoded frames. Furthermore, after decoding each frame, the filter coefficients for the current frame are added to the candidate list of filter sets whose temporal layer indices are equal to or greater than the temporal layer indices of the current frame.

[0757] According to an embodiment of the present invention, a fixed set of filters is used to perform filtering.

[0758] Although temporal filter coefficient prediction cannot be used in intra-frame prediction frames (I-frames, stripes, parallel block groups, or parallel blocks), at least one of up to 16 fixed filters in the filter set can be used for filtering based on the block classification index. To send information from the encoder to the decoder about whether the fixed filter set is used, entropy encoding / decoding is performed on information about whether a fixed filter is used for each block classification index. When a fixed filter is used, the index information about the fixed filter is also entropy encoded / decoded. Even when a fixed filter is used for a specific block classification index, the filter coefficients are entropy encoded / decoded, and the reconstructed frame is filtered using the entropy-encoded / decoded filter coefficients and the fixed filter coefficients.

[0759] In addition, a fixed set of filters is used in inter-frame prediction frames (B / P frames, stripes, parallel block groups, or parallel blocks).

[0760] Furthermore, without entropy encoding / decoding the filter coefficients, adaptive in-loop filtering can be performed using fixed filters. Here, a fixed filter can represent a predefined set of filters in the encoder and decoder. In this case, without entropy encoding / decoding the filter coefficients, the encoder and decoder perform entropy encoding / decoding on fixed filter index information indicating which filter or filter set from a set of multiple predefined filter sets in the encoder and decoder is used. In this case, filtering is performed using fixed filters that differ in at least one aspect of filter coefficient values, filter taps (i.e., the number of filter taps or the filter length), and filter shape, based on at least one of block type, block, CU, strip, parallel block, parallel block group, and frame.

[0761] On the other hand, at least one filter within a fixed filter set can be transformed in terms of filter taps and / or filter shape. For example, such as Figure 38As shown, the coefficients in the 9×9 diamond filter are transformed into the coefficients in the 5×5 square filter. Specifically, the coefficients in the 9×9 diamond filter can be transformed into the coefficients in the 5×5 square filter.

[0762] For example, the sum of the filter coefficients corresponding to filter coefficient indices 0, 2 and 6 in the 9×9 rhombus shape is assigned to filter coefficient index 2 in the 5×5 square shape.

[0763] Alternatively, for example, the sum of filter coefficients corresponding to filter coefficient indices 1 and 5 in the 9×9 rhombus shape is assigned to filter coefficient index 1 in the 5×5 square shape.

[0764] Further optionally, for example, the sum of the filter coefficients corresponding to filter coefficient indices 3 and 7 in the 9×9 rhombus shape is assigned to filter coefficient index 3 in the 5×5 square shape.

[0765] Further, alternatively, for example, the filter coefficient corresponding to filter coefficient index 4 in the 9×9 rhombus shape is assigned to filter coefficient index 0 in the 5×5 square shape.

[0766] Further alternatively, for example, the filter coefficient corresponding to filter coefficient index 8 in the 9×9 rhombus shape is assigned to filter coefficient index 4 in the 5×5 square shape.

[0767] Further optionally, for example, the sum of the filter coefficients corresponding to filter coefficient indices 9 and 10 in the 9×9 rhombus shape is assigned to filter coefficient index 5 in the 5×5 square shape.

[0768] Further optionally, for example, the filter coefficients corresponding to filter coefficient index 11 in the 9×9 rhombus shape a...

Claims

1. A method for decoding a video, the method comprising: decoding an adaptive parameter set; Determine one or more adaptive parameter sets applied to a current picture or slice from the adaptive parameter sets; Determining an adaptive parameter set including one or more adaptive in-loop filters ALF for a current coding tree block CTB included in the current picture or slice; and filtering a luminance component of the current CTB based on an ALF in an adaptive parameter set for the current CTB, The ALF for filtering the luminance component of the current CTB is selected based on a classification index derived from a basic filtering unit in the current CTB, The adaptive parameter set further includes chroma ALF quantity information indicating the number of alternative filters for chroma components of the current CTB, and Wherein, when the chroma ALF quantity information indicates that a plurality of alternative filters for chroma components are included, chroma ALF index information specifying one of the alternative filters for the chroma components of the current CTB is also decoded from the bitstream.

2. The method according to claim 1, wherein: The adaptive parameter set includes a luma clipping flag and a chroma clipping flag, wherein the luma clipping flag indicates whether to perform nonlinear adaptive in-loop filtering on a luma component, and the chroma clipping flag indicates whether to perform nonlinear adaptive in-loop filtering on a chroma component.

3. The method according to claim 2, wherein: The adaptive parameter set includes: a luma clipping index, wherein when the luma clipping flag indicates that nonlinear adaptive in-loop filtering is performed on a luma component, the luma clipping index indicates a clipping value for the nonlinear adaptive in-loop filtering, and A chroma clipping index, wherein when the chroma clipping flag indicates that nonlinear adaptive in-loop filtering is performed on the chroma component, the chroma clipping index indicates a clipping value for the nonlinear adaptive in-loop filtering.

4. The method according to claim 3, wherein: The luma clipping index and the chroma clipping index are decoded based on a 2-bit fixed length without decoding any information about the order of the Exponential Golomb for the luma clipping index and the chroma clipping index.

5. The method according to claim 3, in, A luma clipping value for nonlinear adaptive in-loop filtering of a luma component is determined to be one of the clipping value candidates specified by the luma clipping index, wherein a chroma clipping value for nonlinear adaptive in-loop filtering of a chroma component is determined to be one of the clipping value candidates specified by the chroma clipping index, wherein the composition of the cropping value candidates varies according to the bit depth of the current sequence, and Therein, the clipping value candidates are shared for both luma and chroma components.

6. The method according to claim 1, wherein: The chroma ALF index information is decoded separately for the Cb component and the Cr component.

7. A method for encoding a video, the method comprising: encoding an adaptive parameter set; encoding information about one or more adaptation parameter sets in the adaptation parameter set that are applied to a current picture or slice; encoding information about an adaptive parameter set including one or more adaptive in-loop filters ALF for a current coding tree block CTB included in the current picture or slice; as well as filtering the current CTB based on the ALF included in the adaptive parameter set applied to the current CTB, The ALF for filtering the luminance component of the current CTB is selected based on a classification index derived from a basic filtering unit in the current CTB, The adaptive parameter set further includes chroma ALF quantity information indicating the number of alternative filters for the chroma components of the current CTB, and Wherein, when the chroma ALF quantity information indicates that multiple alternative filters for chroma components are included, chroma ALF index information specifying one of the alternative filters for the chroma components of the current CTB is also encoded in the bitstream.

8. An apparatus for transmitting compressed video data, comprising: a processor configured to obtain the compressed video data, and a sending unit, configured to send the compressed video data, The compressed video data is obtained by: encoding an adaptive parameter set; encoding information about one or more adaptation parameter sets in the adaptation parameter set that are applied to a current picture or slice; encoding information about an adaptive parameter set including one or more adaptive in-loop filters ALF for a current coding tree block CTB included in the current picture or slice; and filtering the current CTB based on the ALF included in the adaptive parameter set applied to the current CTB, The ALF for filtering the luminance component of the current CTB is selected based on a classification index derived from a basic filtering unit in the current CTB, The adaptive parameter set further includes chroma ALF quantity information indicating the number of alternative filters for the chroma components of the current CTB, and Wherein, when the chroma ALF quantity information indicates that multiple alternative filters for chroma components are included, chroma ALF index information specifying one of the alternative filters for the chroma components of the current CTB is also encoded in the bitstream.