Image encoding / decoding method and apparatus using intra-loop filtering

By using in-loop filtering and subsampling block classification, and optimizing filter parameters using multiple filter shapes and one-dimensional Laplacian operations, the problems of high computational complexity and difficulty in minimizing distortion in high-resolution video coding are solved, achieving more efficient video coding and decoding.

CN116055748BActive Publication Date: 2026-07-14INTELLECTUAL DISCOVERY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INTELLECTUAL DISCOVERY CO LTD
Filing Date
2018-11-29
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing video coding technologies suffer from high computational complexity, large memory access bandwidth requirements, and difficulty in minimizing distortion when processing high-resolution, high-quality video. In particular, block boundary filtering and sample adaptive offset methods have limitations in reducing distortion.

Method used

An in-loop filtering method is adopted, which performs filtering through subsampling-based block classification, uses multiple filter shapes and filter information for video encoding and decoding, reduces computational complexity and memory access bandwidth, and optimizes filter parameters by determining gradient values ​​through one-dimensional Laplacian operations.

Benefits of technology

It effectively reduces the computational complexity and memory access bandwidth of video encoders and decoders, improves video encoding and decoding efficiency, and reduces distortion between the original and reconstructed images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116055748B_ABST
    Figure CN116055748B_ABST
Patent Text Reader

Abstract

The present invention provides an image encoding / decoding method and apparatus employing in-loop filtering, wherein the image encoding / decoding method and apparatus employs a plurality of filter modes in order to reduce computational complexity, required memory capacity, and memory access bandwidth. The image decoding method according to the present disclosure includes a step of decoding filter information on a coding unit, a step of classifying the coding unit by a block classification unit, and a step of filtering the coding unit classified by the block classification unit by using the filter information.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of application No. 201880086848.7 entitled "Image Encoding / Decoding Method and Apparatus Using In-Loop Filtering", filed with the State Intellectual Property Office of the People's Republic of China on November 29, 2018. 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] Currently, there is an increasing demand for high-resolution, high-quality video, such as High Definition (HD) and Ultra High Definition (UHD), across various applications. As video achieves higher resolution and quality, the amount of video data increases compared to existing video data. Therefore, transmission or storage costs increase when transmitting video data via media such as wired / wireless broadband lines or storing video data in existing storage media. To address this challenge of handling high-resolution, high-quality video data, highly efficient video encoding / decoding technologies are needed.

[0004] Various video compression techniques exist, such as inter-frame prediction techniques for predicting pixel values ​​in the current frame from pixel values ​​in previous or subsequent frames, intra-frame prediction techniques for predicting pixel values ​​within 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 frequently occurring 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 to reduce ringing artifacts by adding an offset to a specific sample after comparing its pixel value with those of its neighboring samples, or by adding the offset to samples whose pixel values ​​fall within a specific range. SAO can reduce distortion between the original and reconstructed images to some extent through rate distortion optimization. However, it has limitations in minimizing distortion when the difference between the original and reconstructed images is large. Summary of the Invention

[0007] Technical issues

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

[0009] Another object of the present invention is to provide a method and apparatus for using subsampling-based block classification for in-loop filtering to reduce the computational complexity and memory access bandwidth of a video encoder / decoder.

[0010] Another object of the present invention is to provide a method and apparatus for using multiple filter shapes to perform in-loop filtering in order to reduce the computational complexity, memory capacity requirements and memory access bandwidth of a video encoder / decoder.

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

[0012] Technical solution

[0013] According to a video decoding method of the present invention, the method may include: decoding filter information about coding units; classifying samples in the coding units into classes based on each block classification unit; and filtering the coding units having samples classified into the classes based on each block classification unit using the filter information.

[0014] In the video decoding method according to the present invention, the method may further include assigning a block classification index to the encoding unit having samples classified as classes based on each block classification unit, wherein the block classification index is determined based on directional information and activity information.

[0015] In the video decoding method according to the present invention, at least one of the directional information and the activity information is determined based on a gradient value for at least one of the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction.

[0016] In the video decoding method according to the invention, the gradient value is obtained using a one-dimensional Laplacian operation for each block classification unit in the block classification unit.

[0017] In the video decoding method according to the present invention, the one-dimensional Laplacian operation is a one-dimensional Laplacian operation with the operation position being the position of the subsample.

[0018] In the video decoding method according to the present invention, the gradient value is determined based on the time layer identifier.

[0019] In the video decoding method according to the present invention, the filter information includes at least one piece of information selected from information on whether filtering is performed, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information on whether a fixed filter is used for block classification indexing, and filter symmetry type information.

[0020] In the video decoding method according to the present invention, the filter shape information includes at least one of rhombus, rectangle, square, trapezoid, diagonal, snowflake, number symbol, four-leaf clover, cross, triangle, pentagon, hexagon, octagon, decagon and dodecagon.

[0021] In the video decoding method according to the present invention, the filter coefficient values ​​include filter coefficient values ​​for the geometric transformation of the coding unit, wherein the coding unit has samples based on each block classification unit being classified into the class.

[0022] In the video decoding method according to the present invention, the filter symmetry type information includes at least one of point symmetry, horizontal symmetry, vertical symmetry and diagonal symmetry.

[0023] Furthermore, according to a video coding method of the present invention, the method may include: classifying samples of a coding unit into classes based on each block classification unit; filtering the coding unit having samples classified into the class based on each block classification unit by using filter information about the coding unit; and encoding the filter information.

[0024] In the video coding method according to the present invention, the method may further include: assigning a block classification index to the coding unit having samples classified as the class based on each block classification unit, wherein the block classification index is determined based on directional information and activity information.

[0025] In the video coding method according to the present invention, at least one of the directional information and the activity information is determined based on a gradient value for at least one of the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction.

[0026] In the video coding method according to the invention, the gradient value is obtained using a one-dimensional Laplacian operation for each block classification unit in the block classification unit.

[0027] In the video encoding method described in this invention, the one-dimensional Laplacian operation is a one-dimensional Laplacian operation with the operation position being the position of the subsample.

[0028] In the video coding method according to the present invention, the gradient value is determined based on the time layer identifier.

[0029] In the video coding method according to the present invention, the filter information includes at least one piece of information selected from information on whether filtering is performed, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information on whether a fixed filter is used for block classification indexing, and filter symmetry type information.

[0030] In the video encoding method according to the present invention, the filter shape information includes at least one of rhombus, rectangle, square, trapezoid, diagonal, snowflake, number symbol, four-leaf clover, cross, triangle, pentagon, hexagon, octagon, decagon and dodecagon.

[0031] In the video coding method according to the present invention, the filter coefficient values ​​include filter coefficients for the geometric transformation of each block classification unit in the block classification unit of the coding unit.

[0032] Furthermore, a computer-readable recording medium according to the present invention can store a bitstream generated by the video encoding method according to the present invention.

[0033] Beneficial effects

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

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

[0036] In addition, according to the present invention, a method and apparatus for using multiple filter shapes to perform in-loop filtering to reduce the computational complexity, memory capacity requirements and memory access bandwidth of a video encoder / decoder can be provided.

[0037] In addition, according to the present invention, a recording medium for storing bit streams generated by a video encoding / decoding method or device can be provided.

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

[0039] Figure 1 This is a block diagram illustrating the configuration of an encoding device to which an embodiment of the present invention is applied;

[0040] Figure 2This is a block diagram illustrating the configuration of a decoding device to which an embodiment of the present invention is applied;

[0041] Figure 3 It is a schematic diagram showing the screen partitioning structure used for encoding / decoding video;

[0042] Figure 4 This is a diagram illustrating one embodiment of intra-frame prediction processing;

[0043] Figure 5 This is a diagram illustrating one embodiment of inter-frame prediction processing;

[0044] Figure 6 It is a diagram used to describe transformation and quantization processes.

[0045] Figure 7 This is a flowchart illustrating a video decoding method according to an embodiment of the present invention;

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

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

[0048] 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;

[0049] 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;

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

[0051] 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;

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

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

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

[0055] Figure 35a and Figure 35b These are diagrams illustrating various filter shapes according to embodiments of the present invention;

[0056] Figure 36 This is a diagram illustrating horizontal and vertical symmetrical filters according to an embodiment of the present invention;

[0057] 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;

[0058] 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; and

[0059] Figures 39 to 55d This is a diagram illustrating an exemplary method for determining gradient values ​​based on subsampling in the horizontal, vertical, first diagonal, and second diagonal directions. Detailed Implementation

[0060] Various modifications can be made to this invention, and various embodiments of the invention exist, wherein examples of these various embodiments will now be provided with reference to the accompanying drawings, and examples of these various embodiments will be described in detail. 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. Similar reference numerals refer to functions that are identical or similar in various respects. In the drawings, the shapes and sizes 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 connection 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 construed in a limiting sense, and the scope of this disclosure is defined only by the appended claims (and, where appropriate, the full scope of the equivalents claimed in the claims).

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

[0062] It will be understood that, in this specification, when an element is referred to only as "connected to" or "joined to" another element rather than "directly connected to" or "directly joined to" another element, the element may be "directly connected to" or "directly joined to" the other element, or connected to or joined to the other element if there are other elements between the element and the other element. Conversely, it should be understood that when an element is referred to as "directly joined" or "directly connected" to another element, there are no intermediate elements.

[0063] Furthermore, the components shown in the embodiments of the present invention are illustrated independently to present distinct functionalities. Therefore, this does not imply that each component is composed as a separate hardware or software unit. In other words, for convenience, each component includes every one of the enumerated components. Thus, at least two components in each component may be combined to form a single component, or a single component may be divided into multiple components for performing each function. Embodiments where each component is combined and embodiments where a component is divided are also included within the scope of the invention without departing from its spirit.

[0064] The terminology used in this specification is for describing particular embodiments only and is not intended to limit the invention. Expressions used in the singular include plural expressions unless they have a distinct meaning in the context. In this specification, it will be understood that terms such as “comprising,” “having,” etc., are intended to indicate the presence of the features, quantities, 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, quantities, steps, actions, elements, components, or combinations thereof may be present or added. In other words, when a particular element is referred to as “comprising,” elements other than the corresponding element are not excluded; rather, additional elements may be included in embodiments of the invention or within the scope of the invention.

[0065] Furthermore, some components may not be essential for performing the necessary functions of the invention, but rather optional components that merely enhance its performance. The invention can be implemented by including only the essential components necessary for carrying out the invention, excluding components used to enhance performance. Structures that include only the essential components and exclude optional components used solely for enhancing performance are also included within the scope of the invention.

[0066] 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 would unnecessarily obscure the understanding of the invention. The same constituent elements in the drawings are denoted by the same reference numerals, and repeated descriptions of the same elements will be omitted.

[0067] 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."

[0068] In the following text, the terms "moving images" and "video" may be used to mean the same thing and may be used interchangeably.

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

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

[0071] 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 are interchangeable.

[0072] In the following text, the terms “block” and “unit” may be used to mean the same thing and are interchangeable. Alternatively, “block” may refer to a specific unit.

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

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

[0075] In this embodiment, each of the specific information, data, flags, indexes, elements, and attributes may have a value. A value equal to "0" for information, data, flags, indexes, elements, and attributes may 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 with each other. A value equal to "1" for information, data, flags, indexes, elements, and attributes may 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 with each other.

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

[0077] Terminology Description

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

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

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

[0081] Samples are the basic units that make up a block. Based on the bit depth (Bd), samples 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.

[0082] Unit: Refers to an encoding and decoding unit. When encoding and decoding an image, a unit can be a region created 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 figure, 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.

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

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

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

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

[0087] Cell depth: Represents the degree of cell partitioning. In a tree structure, the highest node (root node) corresponds to the first cell that is not partitioned. 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 created by partitioning the first cell once. A node with a depth of level 2 represents a cell created by partitioning the first cell twice. A node with a depth of level n represents a cell created 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, a predefined value for 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 at which the cell exists can represent the cell depth.

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

[0089] Parameter set: Corresponds to the header information in the configuration within the bitstream. At least one of the video parameter set, sequence parameter set, picture parameter set, and adaptive parameter set may be included in the parameter set. Furthermore, the parameter set may include a stripe header, a parallel block group header, and parallel block header information. The term "parallel block group" refers to a set of parallel blocks and has the same meaning as a stripe.

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

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

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

[0093] 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 created by dividing prediction units can also be prediction units.

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

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

[0096] The inter-frame prediction indicator can indicate the direction of inter-frame prediction (one-way prediction, two-way prediction, etc.) for the current block. 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.

[0097] 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 reference frames from the reference frame list are not used to generate the prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it indicates that the reference frame list is used to generate the prediction block.

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

[0099] A reference frame can refer to a frame referenced by a specific block for the purpose of inter-frame prediction or motion compensation of 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.

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

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

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

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

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

[0105] Motion information may represent information including 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.

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

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

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

[0109] Transform unit: This can represent the basic unit used when performing encoding / decoding (such as transform, inverse transform, quantization, dequantization, transform coefficient encoding / decoding) on ​​the 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.

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

[0111] 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 by scaling the quantization levels during dequantization. Quantization parameters can be values ​​mapped to the quantization step size.

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

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

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

[0115] Quantization level: This can represent the value produced in the encoder by quantizing the transform coefficients or residual signal. Optionally, the quantization level can represent the value of the dequantized target that will be dequantized in the decoder. Similarly, the level of the quantized transform coefficients, as a result of transform and quantization, can also fall within the meaning of quantization level.

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

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

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

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

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

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

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

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

[0124] Reference Figure 1 The encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a 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.

[0125] 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 encoded 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-prediction mode, and inter-frame mode can refer to inter-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.

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

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

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

[0129] When the value of the motion vector is not an integer, the motion prediction unit 111 and the 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 mode—skip mode, merge mode, advanced motion vector prediction (AMVP) mode, or current frame reference mode—will be used for motion prediction and motion compensation on 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.

[0130] Subtractor 125 can generate a residual block by using the residual 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 predicted 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 predicted signal. The residual block can be the residual signal of a block cell.

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

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

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

[0134] The entropy coding unit 150 can generate a bitstream by performing entropy coding on the values ​​calculated by the quantization unit 140 according to a probability distribution or on the coding parameter values ​​calculated during encoding, and output the generated bitstream. The 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.

[0135] When entropy coding is applied, symbols are represented such that fewer bits are allocated to symbols with a high probability of generation, and more bits are allocated to symbols with a low probability of generation. Therefore, the size of the bitstream used to encode the symbols can be reduced. 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.

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

[0137] 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 encoding unit is partitioned via ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric or asymmetric), whether the current encoding unit is partitioned via multi-type tree partitioning, and the direction of multi-type tree partitioning. This includes the following: orientation (horizontal or vertical), type of multi-type tree partitions (symmetric or asymmetric), tree structure of multi-type tree partitions (binary or ternary), prediction mode (intra-frame prediction or inter-frame prediction), intra-frame prediction mode / direction for luma, intra-frame prediction mode / direction for chroma, 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, and 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 first (first) transform is used, information on whether the second transform is used, first transform index, second 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 category, adaptive sample offset type, whether an adaptive loop filter is applied, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form.Binarization / debinarization method, context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary 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 transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, motion vector search on the decoder side. The data includes the size of the region, the shape of the motion vector search region 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 representation information, parallel block group type, parallel block group partition information, picture type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantization levels, and information about the luminance signal or the chrominance signal.

[0138] Here, sending a flag or index with a signal can represent the encoder entropy encoding the corresponding flag or index and including it in the bitstream, and can also represent the decoder entropy decoding the corresponding flag or index from the bitstream.

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

[0140] 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 reconstructed 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.

[0141] The reconstructed block pass-through filter unit 180 can apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to reconstructed samples, reconstructed blocks, or reconstructed images. The filter unit 180 may be referred to as an in-loop filter.

[0142] Deblocking filters remove block distortion that occurs 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.

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

[0144] Adaptive loop filters (ALFs) can perform 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 an ALF can be transmitted via a coding unit (CU), and the form and coefficients of the ALF to be applied to each block can vary.

[0145] 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 for inter-frame prediction or motion compensation.

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

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

[0148] 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 225, a filter unit 260, and a reference frame buffer 270.

[0149] 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 produced by decoding.

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

[0151] Decoding device 200 can obtain a reconstructed residual block and generate a prediction block by decoding the input bitstream. When the reconstructed residual block and the prediction block are obtained, decoding device 200 can generate 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.

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

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

[0154] 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 or inverse transform, or both, and can be generated as a reconstructed residual block. Here, the dequantization unit 220 can apply the quantization matrix to the quantization level.

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

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

[0157] Adder 225 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 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 during inter-frame prediction or motion compensation.

[0158] 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 partitioning a single cell into multiple lower-level cells is illustrated.

[0159] To effectively partition an image, coding units (CUs) can be 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.

[0160] 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 that 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.

[0161] 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 (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.). The horizontal and vertical dimensions of the CUs resulting from 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. 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 the coding unit with the maximum coding unit size, and the SCU can be the coding unit with the minimum coding unit size. Partitioning begins at the LCU 310, and the CU depth increases by 1 as the horizontal or vertical dimension of the CU, or both the horizontal and vertical dimensions, decrease 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.

[0162] 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 1, the CU may not be partitioned; when the partition information value is 2, the CU may be partitioned.

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

[0164] 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, the size of each of the four partitioned coding units can be 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.

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

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

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

[0168] 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 the encoded blocks 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.

[0169] 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).

[0170] 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 be further partitioned by any partition in either binary tree or ternary tree. In addition, the coding unit generated by binary tree partitions or ternary tree partitions can be further partitioned by binary tree partitions or ternary tree partitions, or it may not be further partitioned.

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

[0172] A multi-type tree partitioning indication with a first value (e.g., "1") indicates that the current coding unit will traverse 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 traverse a multi-type tree partition.

[0173] 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 according to the multi-type tree partitioning. 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.

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

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

[0176] 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, there is a high probability that the partitioning type (partitioned or unpartitioned, partitioning tree, and / or partitioning direction) of the left-hand neighboring coding unit and / or the upper-hand neighboring coding unit of the current 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.

[0177] 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 go through 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.

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

[0179] 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 partitions of the coding unit for transformation are not sent separately by signal, and the partitions 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 (length) of the coding unit is greater than the vertical dimension (length) of the maximum transform block, the coding unit can be horizontally bisected.

[0180] 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 at a higher level than the coding unit. This higher level can be, for example, the sequence level, the frame level, the strip level, the parallel block group level, the 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.

[0181] 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 of the multi-type tree from the root node to the leaf node (maximum depth of the multi-type tree) can be signaled or determined at a higher level of the coding unit. For example, the higher level could be 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.

[0182] The difference information between the size of the CTU and the maximum size of the transform block can be signaled or determined at a higher level of the coding unit. For example, the higher level could be 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 could be 32×32. For example, for an inter-frame stripe, the maximum size of the ternary tree could 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.

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

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

[0185] For example, when the size of the coding unit is no greater than the minimum size of the quadtree, the coding unit does not contain four-partition information. Therefore, the four-partition information can be derived from the second value.

[0186] 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 derived from a second value instead of being sent by signal.

[0187] 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 can be derived from a second value instead of being sent via signal transmission. 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.

[0188] 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, further binary and / or ternary partitioning of the coding unit is not required. Therefore, multi-type tree partitioning indication information can be derived from a second value instead of being sent via signal transmission.

[0189] 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 feasible for the coding unit corresponding to the node of the multi-type tree. Otherwise, it may not be possible to partition the coding unit into two and / or three partitions. Therefore, multi-type tree partitioning indication information may not be signaled, but rather derived from a second value.

[0190] 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 feasible for the coding units corresponding to the nodes of the multi-type tree. Otherwise, partition direction information may not be signaled; instead, it may be derived from values ​​indicating possible partition directions.

[0191] Optionally, partition tree information may be signaled only if both vertical binary tree partitioning and vertical ternary tree partitioning, or both horizontal binary tree partitioning and horizontal ternary tree partitioning, are feasible for the coded tree corresponding to the nodes of the multi-type tree. Otherwise, partition tree information may not be signaled; instead, it may be derived from values ​​indicating possible partition tree structures.

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

[0193] Figure 4 The arrows from the center to the outside in the image can indicate the prediction direction of the intra-frame prediction mode.

[0194] 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 coding parameters or values ​​of reference samples included in the reconstructed neighboring block.

[0195] A prediction block can represent a block generated by performing intra-frame prediction. A prediction block can correspond to at least one of a CU, PU, ​​and TU. The cells of a prediction block can have the size of one of a 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.

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

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

[0198] Intra-frame 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-frame 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-frame prediction modes can be greater than or equal to 1, M, including non-angular and angular modes.

[0199] To perform intra-frame prediction on the current block, a step can be performed to determine whether a sample included in a 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, a value obtained by copying or interpolating at least one sample value included in a reconstructed neighboring block, or by performing both copying and interpolation, can be used to replace the unavailable sample value of the sample. Thus, the replaced sample value is used as a reference sample for the current block.

[0200] 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 size of the current block.

[0201] 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 of the current sample, 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, when generating the prediction block for the current block, the average value of the upper and left reference samples of the current block can be used. 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. Interpolation can be performed on real cells to generate the prediction sample values.

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

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

[0204] exist Figure 5 In this context, rectangles can represent the image. Figure 5 In 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).

[0205] I-frames can be encoded via intra-frame prediction without requiring inter-frame prediction. P-frames can be encoded via inter-frame prediction using a reference frame 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.

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

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

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

[0209] The method for deriving motion information for the current block can be based on changes in the prediction mode of the current block. For example, prediction modes used for inter-frame prediction may include AMVP mode, merge mode, skip mode, and current frame reference mode. The merge mode can be called the motion merge mode.

[0210] 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 list of motion vector candidates. 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.

[0211] 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 can indicate 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 to derive the motion vector of the target block.

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

[0213] 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 a merge pattern is applied, the reconstructed motion information of neighboring blocks and / or the motion information of co-located blocks can be used to generate a list of merge candidates. Motion information may include at least one of motion vectors, reference frame indices, and inter-frame prediction indicators. Prediction indicators may indicate unidirectional prediction (L0 prediction or L1 prediction) or bidirectional prediction (L0 prediction and L1 prediction).

[0214] 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 zero merge candidates and new motion information, wherein the new motion information is a combination of motion information of a neighboring block adjacent to the current block (spatial merge candidate), motion information of a co-located block of the current block included in the reference frame (temporal merge candidate), and motion information existing in the merge candidate list.

[0215] 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, neighboring blocks of the current block may include a left-hand neighboring block to the left of the current block, an upper-hand neighboring block positioned above the current block, and a time-adjacent neighboring block.

[0216] 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 as a signal to decoding device 200. Encoding device 100 may not send syntax elements regarding at least one of motion vector difference information, coded block flags, and transform coefficient levels as signals to decoding device 200.

[0217] The current frame reference mode can represent the prediction mode in which the previously reconstructed region within the current frame to which the current block belongs was used for prediction. Here, a vector can be used to specify the previously reconstructed region. Information indicating whether the current block will be encoded in the current frame reference mode can be encoded using the current block's reference frame index. A flag or index indicating whether the current block is a block encoded in the current frame reference mode can be signaled, and the flag or index can be derived based on the current block's reference frame index. When the current block is encoded in the current frame reference mode, the current frame can be added to the reference frame list for the current block so that the current frame is located at a fixed position or an arbitrary position in the reference frame list. The fixed position can be, for example, the position indicated by reference frame index 0, or the last position in the list. When the current frame is added to the reference frame list so that the current frame is located at an arbitrary position, a reference frame index indicating the arbitrary position can be signaled.

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

[0219] like Figure 6 As shown, a transform and / or quantization process is performed on the residual signal to produce 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 a block generated through intra-frame prediction or inter-frame prediction. The transform can be a first transform, a second transform, or both. The first transform of the residual signal produces transform coefficients, and the second transform of the transform coefficients produces second transform coefficients.

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

[0221] Since the residual signal is quantized through the first and second transforms, a quantized level signal (quantization coefficients) is generated. 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 using a diagonal top-right scan, the block-form coefficients become a one-dimensional vector form. In addition to the diagonal top-right scan, a horizontal scan of two-dimensional block-form coefficients or a vertical scan of two-dimensional block-form coefficients can be used, depending on the intra-frame prediction mode and / or size of the transform block. The scanned quantized level coefficients can be entropy-encoded for insertion into the bitstream.

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

[0223] Then, the quantization level coefficients can be dequantized, followed by a second inverse transform as needed, and finally a first inverse transform as needed to generate the reconstructed residual signal.

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

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

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

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

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

[0229] Unless otherwise specifically stated in the description of this invention, in-loop filtering refers to adaptive in-loop filtering.

[0230] In this invention, filtering refers to the processing of applying a filter to at least one basic unit selected from 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.

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

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

[0233] Performing in-loop filtering involves sequentially applying bidirectional filtering, deblocking filtering, sample adaptive offsetting, and adaptive in-loop filtering to the reconstructed image to produce the decoded image. However, the order in which filtering schemes classified as in-loop filtering are applied to the reconstructed image varies.

[0234] For example, the ability to perform in-loop filtering allows deblocking filtering, sample adaptive offsetting, and adaptive in-loop filtering to be applied sequentially to the reconstructed image.

[0235] Optionally, the 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.

[0236] Alternatively, 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.

[0237] Alternatively, in-loop filtering can be performed such that adaptive in-loop filtering, sample adaptive offsetting, and deblocking filtering are applied sequentially to the reconstructed image.

[0238] In this invention, a decoded frame refers to the output of an in-loop filter or post-processing filter performed on a reconstructed frame composed of reconstructed blocks. Each reconstructed block is generated by summing the reconstructed residual block with the corresponding intra-prediction block or by summing the reconstructed block with the corresponding inter-prediction block. In this invention, the meanings of decoded sample, decoded block, decoded CTU, or decoded frame are the same as those of reconstructed sample, reconstructed block, reconstructed CTU, or reconstructed frame.

[0239] Adaptive intra-loop filtering is performed on the reconstructed frame to generate the decoded frame. Adaptive intra-loop filtering can be performed on the decoded frame that has already undergone at least one of deblocking filtering, adaptive sample offsetting, and bidirectional filtering. Alternatively, adaptive intra-loop filtering can be performed on the 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 or decoded frame. In this case, N is a positive integer.

[0240] Intra-loop filtering can be performed on a decoded screen that has already undergone at least one of the intra-loop filtering methods. For example, when performing at least one of the intra-loop filtering methods on a decoded screen that has already undergone at least one of the other intra-loop filtering methods, the parameters used for the later filtering method can be changed, and then the previous filtering can be performed on the decoded screen using the changed parameters. In this case, the parameters include encoding parameters, filter coefficients, the number of filter taps (filter length), filter shape, filter type, the number of filtering operations, filter strength, threshold, and / or combinations of these parameters.

[0241] The filter coefficients represent the coefficients that make up the filter. Optionally, the filter coefficients represent coefficient values ​​corresponding to specific mask positions in the mask form, and the reconstructed samples are multiplied by these coefficient values.

[0242] 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 halved. Additionally, a filter tap refers to either the width (horizontal dimension) or the height (vertical dimension) of the filter. Optionally, a filter tap refers to both the width (horizontal dimension) and the height (vertical dimension) of a two-dimensional filter. Furthermore, a filter can be symmetrical about two or more specific directions.

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

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

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

[0246] 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 the frame, thereby improving coding efficiency. Wiener filters are designed to minimize distortion between the original frame and the reconstructed / decoded frame.

[0247] At least one filtering method can be performed during encoding or decoding. Encoding or decoding 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 filtering method 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 intra-loop filtering during encoding or decoding. That is, in the phrase "adaptive intra-loop filtering," the term "intra-loop" indicates that filtering is performed during encoding or decoding. When adaptive intra-loop filtering is performed, a decoded frame that has already undergone adaptive intra-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 already undergone adaptive intra-loop filtering, the encoding efficiency of the subsequent frame and the encoding efficiency of the current frame that has already undergone intra-loop filtering can be improved.

[0248] Additionally, at least one of the above filtering methods is performed during CTU-based or block-based encoding or decoding processing. For example, a Wiener filter is used for adaptive intra-loop filtering during CTU-based or block-based encoding or decoding processing. 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 processing. When adaptive intra-loop filtering is performed based on each CTU or each block, 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.

[0249] Additionally, at least one of the filtering methods can be performed as a post-processing filter after the decoding process is executed. For example, a Wiener filter can be used as a post-processing filter after the decoding process is executed. 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 performing post-processing filtering, the decoded screen that has already undergone post-processing filtering can be excluded from being used as a reference screen for subsequent screens to be encoded / decoded.

[0250] Adaptive in-loop filtering cannot be performed on a per-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.

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

[0252] Reference Figure 7 The decoder decodes the filter information for each coding unit (S701).

[0253] Filter information is not limited to filter information based on each coding unit. Filter information also represents filter information based on each strip, parallel block, parallel block group, frame, sequence, CTU, block, CU, PU, ​​or TU.

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

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

[0256] The filter coefficient values ​​include filter coefficient values ​​for the geometric transformation of each block, where samples are classified into classes based on each block classification unit.

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

[0258] In addition, the decoder performs block classification on the samples of the coding unit based on each block classification unit (step S702). Furthermore, the decoder assigns the block classification index to the block classification units in the coding unit.

[0259] Block classification is not limited to classification based on each coding unit. 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.

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

[0261] At least one of directional information and activity information is determined based on the gradient value relative to at least one of the vertical, horizontal, first diagonal, and second diagonal directions.

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

[0263] The preferred one-dimensional Laplace operation is the one-dimensional Laplace operation where the operation position is the position of the subsample.

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

[0265] In addition, the decoder filters the coding units that have already performed block classification based on each block classification unit by using filter information (S703).

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

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

[0268] Reference Figure 8The encoder classifies the samples in the encoding unit into classes based on each block classification unit (step S801). Furthermore, the encoder assigns a block classification index to each block classification unit within the encoding unit.

[0269] The basic unit 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.

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

[0271] At least one of directional information and activity information is determined based on the gradient value relative to at least one of the vertical, horizontal, first diagonal, and second diagonal directions.

[0272] The gradient value is obtained by using a one-dimensional Laplacian operation for each block classification unit.

[0273] The preferred one-dimensional Laplace operation is the one-dimensional Laplace operation where the operation position is the position of the subsample.

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

[0275] In addition, the encoder filters the coding unit samples that are classified based on each block classification unit by using the filter information of the coding unit (S802).

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

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

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

[0279] The filter coefficient values ​​include those based on the geometric transformation performed on each block classification unit.

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

[0281] Filter information is not limited to filter information based on each coding unit. Filter information can be based on each strip, parallel block, parallel block group, frame, sequence, CTU, block, CU, PU, ​​or TU.

[0282] At the encoder end, adaptive in-loop filtering can be divided into several sub-steps, such as block classification, filtering, and filter information encoding.

[0283] More specifically, at the encoder end, 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 are not described in detail, but only briefly. Thus, at the encoder end, in-loop filtering is divided into block classification, filtering, and filter information encoding, etc.

[0284] In the filter coefficient derivation step, Wiener filter coefficients that minimize the distortion between the original and filtered images are derived. In this case, the Wiener filter coefficients are derived based on each block classification. Additionally, the Wiener filter coefficients are derived based on at least one of the following: the number of filter taps and the 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 are derived. The filter coefficients are calculated by deriving the Wiener-Hopf equation based on the autocorrelation and cross-correlation matrices. In this case, the Wiener-Hopf equation is calculated based on Gaussian elimination or Cholesky decomposition to obtain the filter coefficients.

[0285] In the filtering execution determination step, rate-distortion optimization determines whether to perform adaptive in-loop filtering on a per-strip, per-frame, per-block, or per-block basis, or whether to perform adaptive in-loop filtering at all. Here, 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 squared error (MSE), sum of mean squared errors (SSE), sum of absolute differences, etc. In the filtering execution determination step, it is determined whether to perform filtering on the chroma component and whether to perform filtering on the luminance component.

[0286] In the filter shape determination step, when applying in-loop adaptive filtering, the filter shape and tap count can be determined based on rate-distortion optimization.

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

[0288] To avoid unnecessary explanation, the filter information encoding step and the filter information decoding step will be collectively referred to as the filter information encoding / decoding step.

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

[0290] Within the reconstructed frame, block classification indices are assigned to blocks of size M×N (or to each block classification unit), such that blocks within the reconstructed frame can be classified into L classes. Here, block classification indices can be assigned not only to the reconstructed / decoded frame, but also to at least one of the following: recovery / decoded stripe, recovery / decoded parallel block group, recovery / decoded parallel block, recovery / decoded CTU, and recovery / decoded block.

[0291] 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 both 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 size blocks are non-square shapes. Optionally, N and M can be the same positive integer.

[0292] For example, a total of 25 block classification indices can be assigned to the reconstructed screen based on each 2×2 block. Alternatively, a total of 25 block classification indices can be assigned to the reconstructed screen based on each 4×4 block.

[0293] The block classification index is a value in the range from 0 to L-1, or it can be a value in the range from 1 to L.

[0294] Block classification index C is based on the quantized activity value A of the directionality value D and the activity value A. q At least one of them is determined and is represented by Equation 1.

[0295] [Equation 1]

[0296] C = 5D + A q

[0297] In Equation 1, 5 is an example constant value. A constant value can be represented by J. In this case, J is a positive integer less than L.

[0298] For example, in one embodiment of performing block classification based on each 2×2-sized block, the sum of the one-dimensional Laplacian gradient values ​​in the vertical direction is given by g. v Let g represent the sum of the one-dimensional Laplace gradient values ​​for the horizontal direction, the first diagonal direction (angle 135°), and the second diagonal direction (angle 45°), respectively, as expressed by g. h g d1 and gd2 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 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 the gradient values.

[0299] [Equation 2]

[0300]

[0301] [Equation 3]

[0302]

[0303] [Equation 4]

[0304]

[0305] D1 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)|

[0306] [Equation 5]

[0307]

[0308] D2 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)|

[0309] 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).

[0310] In equations 2 through 5, k and l represent the results V of generating a sample-based one-dimensional Laplacian operation for each direction. k,l H k,l D1 k,l D2 k,l The horizontal and vertical operational ranges of the sum are defined. The result of a sample-based one-dimensional Laplacian operation in 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 in 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 in the vertical, horizontal, first diagonal, and second diagonal directions are respectively represented by V... k,l H k,l D1k,l D2 k,l To express.

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

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

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

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

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

[0316] For example, the range of operations for calculating the sum of the results of a one-dimensional Laplace operation has two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonals, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

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

[0318] For example, the sum of a one-dimensional Laplace operation can be calculated over a range of size S × T. In this case, both S and T are zero or positive integers.

[0319] In addition, D1, which represents the first diagonal, and D2, which represents the second diagonal, can refer to D0, which represents the first diagonal, and D1, which represents the second diagonal, respectively.

[0320] For example, in one embodiment of performing block classification for each 4×4 block, the sums of gradient values ​​gv, gh, gd1, and gd2 for the vertical, horizontal, first diagonal, and second diagonal directions are calculated based on a one-dimensional Laplacian operation using Equations 6, 7, 8, and 9. The directional value D and the activity value A are derived using the sum of the 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 the gradient values.

[0321] [Equation 6]

[0322]

[0323] [Equation 7]

[0324]

[0325] [Equation 8]

[0326]

[0327] D1 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)|

[0328] [Equation 9]

[0329]

[0330] D2 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)|

[0331] 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).

[0332] In equations 6 through 9, k and l represent the results V used to calculate the sample-based one-dimensional Laplacian operation for each direction. k,l H k,l D1 k,l D2 k,l The horizontal and vertical operational ranges of the sum are defined. The result of a sample-based one-dimensional Laplacian operation in 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 in 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 .

[0333] 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 can be the same.

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

[0335] As an 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 a one-dimensional Laplace operation is 8×8. In this case, the operational range for calculating the sum of a one-dimensional Laplace operation is larger than the size of the block classification unit.

[0336] 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 a one-dimensional Laplace operation is 4×4. In this case, the operational range for calculating the sum of a one-dimensional Laplace operation is equal to the size of the block classification unit.

[0337] For example, the range of operations for calculating the sum of the results of a one-dimensional Laplace operation has two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonals, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

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

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

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

[0341] like Figure 9 As shown, when block classification is performed based on each 4×4 block, the sum of gradient values ​​g with respect to the vertical, horizontal, first diagonal, and second diagonal directions can be calculated. v g h g d1 gd2 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. 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.

[0342] For example, in one embodiment of performing block classification based on each 4×4 block, the one-dimensional Laplacian gradient value with respect to the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction is 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 of block classification. The directionality value D and activity value A are derived 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.

[0343] [Equation 10]

[0344] g v =∑ k ∑ l V k,l V k,l =|2R(k,l)-R(k,l-1)-R(k,l+1)|,

[0345] k=i-2,i,i+2,i+4,l=j-2,…,j+5

[0346] [Equation 11]

[0347] g h =∑ k ∑ l H k,l H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)|,

[0348] k=i-2,…,i+5,l=j-2,j,j+2,j+4

[0349] [Equation 12]

[0350] g d1 =∑k ∑ l m k,l D1 k,l ,

[0351] D1 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)|,

[0352] k=i-2,…,i+5,l=j-2,…,j+5

[0353]

[0354] [Equation 13]

[0355] g d2 =∑ k ∑ l n k,l D2 k,l ,

[0356] D2 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)|,

[0357] k=i-2,…,i+5,l=j-2,…,j+5

[0358]

[0359] 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).

[0360] In equations 10 to 13, k and l represent the results V of calculating the one-dimensional Laplacian operation based on the sample points. k,l H k,l D1 k,l D2 k,l The horizontal and vertical operational ranges of the sum are defined. The result of a sample-based one-dimensional Laplace operation in a given direction represents the sample-based gradient value for that direction. In other words, the result of the one-dimensional Laplace operation represents the gradient value. A one-dimensional Laplace operation is performed for each of the vertical, horizontal, first diagonal, and second diagonal directions, and the one-dimensional Laplace operation indicates the gradient value for that direction. Furthermore, the results of the one-dimensional Laplace operations in 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 .

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

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

[0363] As an 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 a one-dimensional Laplace operation is 8×8. In this case, the operational range for calculating the sum of a one-dimensional Laplace operation is larger than the size of the block classification unit.

[0364] 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 a one-dimensional Laplace operation is 4×4. In this case, the operational range for calculating the sum of a one-dimensional Laplace operation is equal to the size of the block classification unit.

[0365] For example, the range of operations for calculating the sum of the results of a one-dimensional Laplace operation has two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonals, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

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

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

[0368] 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 Laplace operation on samples within the computational range along the corresponding direction. 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 computational range of the samples for calculating the sum of the one-dimensional Laplace operation. In this case, the statistical value is any one of the sum, weighted sum, and average.

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

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

[0371] Further, optionally, to calculate the gradient value with respect to the first diagonal direction, 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 point positions at intervals of P columns or Q rows along at least one of the horizontal and vertical directions, thereby obtaining the gradient value with respect to the first diagonal direction. Here, P and Q are zero or positive integers.

[0372] Further, optionally, to calculate the gradient value with respect to the second diagonal direction, 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 columns or Q rows along at least one of the horizontal and vertical directions, thereby obtaining the gradient value with respect to the second diagonal direction. Here, P and Q are zero or positive integers.

[0373] According to an embodiment of the present invention, the 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 the one-dimensional Laplace operation. Here, the statistical value of the gradient value can be calculated by calculating the statistical value of the result of performing the one-dimensional Laplace operation on at least one sample within the operational range of calculating the sum of the one-dimensional Laplace operation. In this case, the statistical value is any one of the sum, weighted sum, and average.

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

[0375] Alternatively, to compute the gradient value, a one-dimensional Laplace operation is performed at each sample location on a column within the operational range of the one-dimensional Laplace operation summation. In this case, the gradient value can be computed at intervals of P rows within the operational range of the one-dimensional Laplace operation summation. Here, P is a positive integer.

[0376] Further, optionally, to calculate the gradient value, 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 columns or Q rows along at least one of the horizontal and vertical directions to obtain the gradient value. Here, P and Q are zero or positive integers.

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

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

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

[0380] like Figure 10 As shown, when block classification is performed based on each 2×2 stored block, 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 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 the sub-sampling positions. Figure 10 In this context, the block classification index C is assigned to a shaded 2×2 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.

[0381] In the accompanying drawings of this invention, the locations not indicated by V, H, D1, or D2 are sample locations where a one-dimensional Laplace operation is not performed along the direction. That is, a one-dimensional Laplace operation is performed only at the sample locations indicated by V, H, D1, or D2 along each direction. When a one-dimensional Laplace operation is not performed, the result of the one-dimensional Laplace operation at the corresponding sample location 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.

[0382] 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 gh 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 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operations are performed are the 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.

[0383] 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 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 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the positions where the one-dimensional Laplacian operations are performed are the sub-sampling positions. Figure 12 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the operational 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 operational range for calculating the one-dimensional Laplacian sum.

[0384] According to an embodiment of the present invention, the gradient value can be calculated by performing a one-dimensional Laplace operation on sample points located at specific positions within a block of size N×M based on subsampling. In this case, the specific position can be at least one of an absolute position and a relative position within the block. Here, 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 calculation of the one-dimensional Laplace sum. In this case, the statistical value is any one of the sum, weighted sum, and average.

[0385] For example, an absolute position represents the top-left position within an N×M block.

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

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

[0388] 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 operational range of calculating the one-dimensional Laplace sum. In this case, the statistical value is any one of the sum, weighted sum, and average.

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

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

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

[0392] 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 calculation of the one-dimensional Laplace sum. In this case, the statistical value is any one of the sum, weighted sum, and average.

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

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

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

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

[0397] like Figure 13As shown, when block classification is performed based on each 4×4 block, 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 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. Figure 13 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 sum of the one-dimensional Laplacian operation 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 the one-dimensional Laplacian operation.

[0398] like Figure 14 As shown, when performing block classification based on each 4×4 block, 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 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 the sub-sampling positions. Figure 14 In this context, the block classification index C is assigned to a shaded 4×4 block. In this case, the computational range for calculating the sum of the one-dimensional Laplacian operation 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 the one-dimensional Laplacian operation.

[0399] like Figure 15 As shown, when performing block classification based on each 4×4 block, 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 block based on subsampling. v gh 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. Figure 15 In this context, the block classification index C is assigned to a shaded 4×4 block. 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.

[0400] like Figure 16 As shown, when block classification is performed based on each 4×4 block, 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 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 the sub-sampling positions. Figure 16 In this context, the block classification index C is assigned to a shaded 4×4 block. In this case, the computational range for calculating the sum of the one-dimensional Laplacian operation 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 the one-dimensional Laplacian operation.

[0401] 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 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. Figure 17 In this example, the block classification index C is assigned to a shaded 4×4 block. In this case, the computational range for calculating the sum of the 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 the one-dimensional Laplacian operations is 1×1, the gradient value can be calculated without calculating the sum of the one-dimensional Laplacian operations. Here, thin solid rectangles represent the reconstructed sample point locations, and thick solid rectangles represent the computational range for calculating the sum of the one-dimensional Laplacian operations.

[0402] 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 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 the positions of sub-sampling. Figure 18 In this context, the block classification index C is assigned to a shaded 2×2 block. In this case, the computational range for calculating the sum of the 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 the one-dimensional Laplacian operations is 1×1, the gradient value can be calculated without calculating the sum of the one-dimensional Laplacian operations. Here, thin solid rectangles represent the reconstructed sample point locations, and thick solid rectangles represent the computational range for calculating the sum of the one-dimensional Laplacian operations.

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

[0404] 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. Figure 19 In this context, the block classification index C is assigned to a 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, thin solid rectangles represent the reconstructed sample point locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplace sum.

[0405] like Figure 19 As shown, regardless of the direction of the one-dimensional Laplace operation, the specific sample point position for performing the one-dimensional Laplace operation is the same. Additionally, as... Figure 19 The pattern of sample positions for performing a one-dimensional Laplace calculation, as shown, can be referred to as a checkerboard pattern or a cloverleaf pattern. Furthermore, all sample positions for performing a one-dimensional Laplace operation are even or odd sample positions in both the horizontal (X-axis) and vertical (Y-axis) directions within the operational range of the block classification unit or block unit for calculating the one-dimensional Laplace sum.

[0406] 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 d2At 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 the positions of the subsamples. Figure 20 In this context, the block classification index C is assigned to the shaded 4×4 block. In this case, the computational range of the one-dimensional Laplace sum can be larger than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample point locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplace sum.

[0407] like Figure 20 As shown, regardless of the direction of the one-dimensional Laplace operation, the specific sample point position for performing the one-dimensional Laplace operation is the same. Additionally, as... Figure 20 The pattern of sample point positions for performing a one-dimensional Laplace calculation, as shown, can be referred to as a checkerboard pattern or a cloverleaf pattern. Furthermore, the sample point positions for performing a one-dimensional Laplace operation are the even or odd number of sample point positions in both the horizontal (X-axis) and vertical (Y-axis) directions within the block classification unit or the one-dimensional Laplace operation range of the block unit.

[0408] like Figure 21 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. Figure 21 In this context, the block classification index C is assigned to a 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, thin solid rectangles represent the reconstructed sample point locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

[0409] 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 hg 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. Figure 22 In this context, the block classification index C is assigned to a 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, thin solid rectangles represent the reconstructed sample point locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

[0410] like Figure 23 As shown, when performing block classification based on each 4×4 block, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 and 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. 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.

[0411] 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 The pattern of sample positions for performing a one-dimensional Laplace calculation, as shown, can be referred to as a checkerboard pattern or a cloverleaf pattern. Furthermore, within the scope of the one-dimensional Laplace operation in a block classification unit or block unit, all sample positions for performing the one-dimensional Laplace operation are either even or odd in either the horizontal (X-axis) or vertical (Y-axis) direction.

[0412] like Figure 24As shown, when performing block classification based on each 4×4 block, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 and 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. 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 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.

[0413] 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 24 The pattern of sample positions for performing a one-dimensional Laplace operation, as shown, can be referred to as a checkerboard pattern or a cloverleaf pattern. Furthermore, the sample positions for performing a one-dimensional Laplace operation are even or odd numbers of sample positions in either the horizontal (X-axis) or vertical (Y-axis) direction, or any one of the directions within the one-dimensional Laplace operation range of the block classification unit or block unit.

[0414] like Figure 25 As shown, when performing block classification based on each 4×4 block, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 and 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. 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 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.

[0415] like Figure 26 As shown, when performing block classification based on each 4×4 block, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 and 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 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, thin solid rectangles represent the reconstructed sample locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplace sum. A specific sample location can refer to each sample location within the block classification unit.

[0416] like Figure 27 As shown, when performing block classification based on each 4×4 block, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 and 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. 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 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.

[0417] like Figure 28 As shown, when performing block classification based on each 4×4 size block, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 and 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 28 In this context, the block classification index C is assigned to a shaded 4×4 block. In this case, the computational range for calculating the one-dimensional Laplace 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 Laplace sum. A specific sample location can refer to each sample location within the block classification unit.

[0418] like Figure 29 As shown, when performing block classification based on each 4×4 size block, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 and 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 29 In this context, the block classification index C is assigned to a shaded 4×4 block. In this case, the computational range for calculating the one-dimensional Laplace 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 Laplace sum. A specific sample location can refer to each sample location within the block classification unit.

[0419] like Figure 30 As shown, when performing block classification based on each 4×4 size block, the sum of gradient values ​​g is calculated at one or more specific sample locations. v g h g d1 and 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 position where the one-dimensional Laplacian operation is performed can be the position of a subsample. Figure 30In this context, the block classification index C is assigned to a 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, thin solid rectangles represent the reconstructed sample point locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

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

[0421] For example, when block classification is performed based on each 2×2 size block, equations 2 through 5 can be expressed by a single equation as shown in equation 14.

[0422] [Equation 14]

[0423]

[0424] In Equation 14, dir represents the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction, and g dir This represents the sum of gradient values ​​along the vertical, horizontal, first diagonal, and second diagonal directions. Additionally, i and j represent the horizontal and vertical positions within a 2×2 block, respectively, and G... dir This represents each of the results of a one-dimensional Laplacian operation along the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction.

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

[0426] [Equation 15]

[0427] g 2×2,dir =|G dir (i0,j0)|

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

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

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

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

[0432] The application of weights or the calculation of weighted sums can be determined based on various conditions or coding parameters associated with the current block and neighboring blocks.

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

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

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

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

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

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

[0439] Alternatively, for example, when the range of the sum of the one-dimensional Laplacian operation 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.

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

[0441] 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 steps, when one or more unavailable samples exist around the current sample, padding is performed on the unavailable sample, and the padded sample can be used to compute 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 P columns and R rows. Here, P and R are both positive integers.

[0442] Here, an unavailable sample point refers to a sample point located outside the boundaries of a CTU, CTB, strip, parallel block, parallel block group, or screen. Optionally, an unavailable sample point may refer to a sample point belonging to at least one of a CTU, CTB, strip, parallel block, parallel block group, and screen, wherein at least one of the CTU, CTB, strip, parallel block, parallel block group, and screen is different from at least one of the CTU, CTB, strip, parallel block, parallel block group, and screen to which the current sample point belongs.

[0443] 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 is selected, predetermined sample points may not be used.

[0444] 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 true, filling samples may not be used.

[0445] 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 to calculate the gradient value.

[0446] 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 gh g d1 and g d2 When at least one of the following conditions is met, if the samples around the current sample point are located outside the CTU or CTB, the neighboring samples adjacent to the current sample point may not be used.

[0447] 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 values ​​of available samples adjacent to the unavailable samples are copied to the unavailable samples, and the one-dimensional Laplace operation is performed using the padded samples.

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

[0449] For example, in one-dimensional Laplace calculations, filled samples may not be used.

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

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

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

[0453] 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, when the samples around the current block are arranged 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 samples.

[0454] 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 arranged outside the CTU or CTB, at least one of deblocking filtering, adaptive sample offset (SAO), and adaptive in-loop filtering may not be applied to the corresponding samples.

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

[0456] According to an embodiment of the present invention, when unusable samples exist within a block classification unit or outside a 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 unusable samples.

[0457] On the other hand, when calculating gradient values ​​based on subsampling, the one-dimensional Laplace operation is performed on subsamples within the computational range, rather than on all samples within the 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, because the time required for block classification can be reduced, performing the one-dimensional Laplace operation on subsampled samples is beneficial in terms of the hardware complexity of the encoder and decoder.

[0458] Furthermore, when the range of operations for calculating the sum of a one-dimensional Laplacian operation 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.

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

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

[0461] 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, horizontal direction, first diagonal direction, and second diagonal direction, and the sum g of the gradient values ​​with respect to the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction can be calculated. v g h g d1 and g d2 At least one of them.

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

[0463] For example, after calculating the sum of the gradient values, the sum of the gradient values ​​in the vertical direction, g, will be calculated. v The sum of the gradient values ​​with respect to the horizontal direction, g h The values ​​are compared, and the maximum and minimum values ​​of the sum of the gradient values ​​in the vertical direction and the sum of the gradient values ​​in the horizontal direction are derived according to Equation 16.

[0464] [Equation 16]

[0465]

[0466] In this case, in order to sum g of the gradient values ​​in the vertical direction v The sum of the gradient values ​​with respect to the horizontal direction, g h Compare the values ​​of the sum according to Equation 17.

[0467] [Equation 17]

[0468]

[0469] Alternatively, for example, the sum of the gradient values ​​g along the first diagonal direction d1 The sum of the gradient values ​​with respect to the second diagonal direction, g d2 By comparison, and based on Equation 18, the maximum value of 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 is derived. and minimum value

[0470] [Equation 18]

[0471]

[0472] In this case, in order to sum g of 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 Compare the values ​​of the sum according to Equation 19.

[0473] [Equation 19]

[0474]

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

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

[0477] Additionally, the directionality value D can be determined based on the characteristics of the region. For example, directionality values ​​Ds 0 to Ds 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.

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

[0479] Step 2: When the condition is met If the condition is met, proceed to step 3; otherwise, proceed to step 4.

[0480] Step 3: When the condition is met When the condition is met, the value D is set to 2; when the condition is not met, the value D is set to 1.

[0481] Step 4: When the conditions are met When the condition is met, the value D is set to 4; when the condition is not met, the value D is set to 3.

[0482] In this example, thresholds t1 and t2 are positive integers, and t1 and t2 can be the same 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.

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

[0484] [Equation 20]

[0485]

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

[0487] Optionally, for example, k and l are different ranges from each other. That is, the horizontal length and vertical length of the range for calculating the sum of a one-dimensional Laplace operation are different.

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

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

[0490] Further optionally, 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 a one-dimensional Laplace operation is 2×2. In this case, the operational range for calculating the sum of a one-dimensional Laplace operation can be equal to the size of the block classification unit.

[0491] For example, the range of operations for calculating the sum of the results of a one-dimensional Laplace operation can have two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonals, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0492] Additionally, when performing block classification based on 4×4 size blocks, the activity value A can be represented as expression 21.

[0493] [Equation 21]

[0494]

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

[0496] Optionally, for example, k and l are different ranges from each other. That is, the horizontal length and vertical length of the range for calculating the sum of a one-dimensional Laplace operation are different.

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

[0498] 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 a one-dimensional Laplace operation is 4×4. In this case, the operational range for calculating the sum of a one-dimensional Laplace operation can be equal to the size of the block classification unit.

[0499] For example, the range of operations for calculating the sum of the results of a one-dimensional Laplace operation can have two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonals, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

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

[0501] [Equation 22]

[0502]

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

[0504] Optionally, for example, k and l are different ranges from each other. That is, the horizontal length and vertical length of the range for calculating the sum of a one-dimensional Laplace operation are different.

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

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

[0507] Further optionally, 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 a one-dimensional Laplace operation is 2×2. In this case, the operational range for calculating the sum of a one-dimensional Laplace operation can be equal to the size of the block classification unit.

[0508] For example, the range of operations for calculating the sum of the results of a one-dimensional Laplace operation can have two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonals, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0509] Additionally, when performing block classification based on 4×4 size blocks, the activity value A can be expressed as expression 23. Here, at least one of the one-dimensional Laplace operation values ​​for the first and second diagonal directions can be additionally used to calculate the activity value A.

[0510] [Equation 23]

[0511]

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

[0513] Optionally, for example, k and l are different ranges from each other. That is, the horizontal length and vertical length of the range for calculating the sum of a one-dimensional Laplace operation are different.

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

[0515] 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 a one-dimensional Laplace operation is 4×4. In this case, the operational range for calculating the sum of a one-dimensional Laplace operation can be equal to the size of the block classification unit.

[0516] For example, the range of operations for calculating the sum of the results of a one-dimensional Laplace operation can have two-dimensional geometric shapes selected from rhombuses, rectangles, squares, trapezoids, diagonals, snowflakes, numeral symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, decagons, and dodecagons.

[0517] On the other hand, the activity value A can be quantized to generate 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.

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

[0519] For example, the quantified activity value A can be determined using Equation 24. q In this case, the quantified activity value Aq can be included in the range from a specific minimum value X to a specific maximum value Y.

[0520] [Equation 24]

[0521]

[0522] 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, specifically 8 or 10. In another example, W is 32 and R is 3+N (bits). Alternatively, for example, N is a positive integer, specifically 8 or 10.

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

[0524] 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 1. Furthermore, in the case of chroma components, block classification can be omitted, 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 can be transmitted without signal transmission, and fixed-type filters can be used.

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

[0526] According to an embodiment 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 Laplacian, two-dimensional Sobel, two-dimensional edge extraction, and two-dimensional Laplacian of Gaussian (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 Gaussian (DoG) operation can be used. Here, the DoG operation represents applying a combination of Gaussian filters with different intrinsic parameters to the reconstructed samples.

[0527] Additionally, 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.

[0528] 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 to 26.

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

[0530] [Equation 25]

[0531]

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

[0533] [Equation 26]

[0534]

[0535] [[ID=!3]]The directivity value D can be determined using the S value calculated by Equation 26.

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

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

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

[0539] Here, the total number of block classification indices can be 25.

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

[0541] [Equation 27]

[0542] For k = 0, …, K - 1

[0543] In Equation 27, I represents the set of sample positions of all reconstructed sample points s′(i, j). D is a classifier that assigns a classification index k ∈ {0, …, K - 1} to the sample position (i, j). Additionally, is the set of all samples to which the classification index is assigned by the classifier D. The classification 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. Given a class with a classification index k ∈ {0, …, K - 1} Perform the following steps.

[0544] When classification_idx = 0, use the block classifier D based on directivity and activity G . The classifier can provide K = 25 classes.

[0545] When classification_idx = 1, the feature classifier D based on sample points... S It is used as a classifier. D S (i,j) uses the quantized sample value of each of the sample points s′(i,j) according to Equation 28.

[0546] [Equation 28]

[0547]

[0548] Where B is the sample bit depth, the classification number K is set to 27 (K=27), and the operator... Specify the operation to round to the nearest integer.

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

[0550] [Equation 29]

[0551]

[0552] The value of classifier r8(i,j) ranges from 0 to 8. When sample s′(i,j) is the largest sample within a 3×3 block centered at (i,j), the value of r8(i,j) is zero. When s′(i,j) is the second largest sample, the value of r8(i,j) is 1.

[0553] [Equation 30]

[0554]

[0555] In Equation 30, T1 and T2 are predefined thresholds. That is, the dynamic range of the sample points is divided into three bands, and the ranking of local samples in each band is used as an additional criterion. The ranking-based sample-based feature classifier provides 27 classes (K=27).

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

[0557] [Equation 31]

[0558]

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

[0560] [Equation 32]

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

[0562] In addition to each sample point being first classified into one of three classes based on the local variable |v(i,j)|, Is with The same classifier is used. Next, within each class, the ranking of nearby local samples can be used as an additional criterion to provide the 27 classes.

[0563] According to embodiments of the invention, at the strip level, a filter bank comprising 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 for each CTU, including a new filter mode, a spatial filter mode, and a strip filter mode.

[0564] Here, the intensity classifier is similar to the band offset in 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 point to be processed.

[0565] In the case of a similarity classifier, neighboring samples in a 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 a neighboring sample and the target sample is greater than a predefined threshold, the group index is incremented by 1. Furthermore, when the difference between a neighboring sample and the target sample is twice the predefined threshold, the group index is incremented by another 1. In this case, the similarity classifier has 25 groups.

[0566] Furthermore, in the case of the Rot BA classifier, the computational range for calculating the sum of a one-dimensional Laplacian operation 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. Multiple classifiers can have a maximum of 25 or 32 groups. However, the number of filters in a strip filter bank is limited to a maximum of 16 groups. That is, the encoder will continuously combine and merge, ensuring that the number of merged groups remains 16 or fewer.

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

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

[0569] In another example, the number of block classifications is determined based on the size of the current block. For instance, J block classification indices are used when the current block size is less than a threshold T. H block classification indices are used when the current block size is greater than a threshold R. 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 block size, the fewer block classification indices are used.

[0570] In another example, the number of block classifications 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. Additionally, J is greater than or equal to H. The larger the size of the block classification unit, the fewer block classification indices are used.

[0571] According to an embodiment of the present invention, at least one of the sum of gradient values ​​at the same location 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.

[0572] For example, the sum of the gradient values ​​g in the vertical and horizontal directions for the current block cell. v and g hWhen 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 neighboring block classification units around 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 to be at least one of the gradient values ​​of the current block unit. Here, the threshold E is a positive integer or zero.

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

[0574] 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 value predefined in the encoder and decoder.

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

[0576] For example, the sum of the gradient values ​​g in the vertical and horizontal directions for the current block cell. v and g h If the difference between at least one of the gradient values ​​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, then 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.

[0577] Alternatively, for example, the sum of the gradient values ​​g in the vertical and horizontal directions for the current block cell. v and g hWhen the difference between the sum of the values ​​of the current block classification unit and the sum of the sums of the gradient values ​​of the neighboring block classification units 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 surrounding the current block classification unit is determined as the block classification unit of the current block classification unit. Here, the threshold E is a positive integer or zero.

[0578] Further optionally, for example, if 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 cell 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.

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

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

[0581] According to an exemplary embodiment of the present invention, a filter corresponding to a determined block classification index is used to perform filtering on samples or blocks in the reconstructed / decoded image. When performing filtering, one of L filters is selected. L is a positive integer or zero.

[0582] For example, one of L filters is selected based on each block classification unit, and filtering is performed on the reconstructed / decoded image based on each reconstructed / decoded sample.

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

[0584] Further, alternatively, for example, one of the L filters is selected based on each block classification unit, and filtering is performed on the reconstructed / decoded image based on each CU.

[0585] Further, alternatively, for example, one of the L filters is selected based on each block classification unit, and filtering is performed on the reconstructed / decoded image based on each block.

[0586] Further, alternatively, for example, U filters out of L filters are selected based on each block classification unit, and filtering is performed on the reconstructed / decoded image based on each reconstructed / decoded sample. Here, U is a positive integer.

[0587] Further, alternatively, for example, U filters out of L filters are selected based on each block classification unit, and filtering is performed on the reconstructed / decoded image based on each block classification unit. Here, U is a positive integer.

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

[0589] Further, alternatively, for example, U filters out of L filters are selected based on each block classification unit, and filtering is performed on the reconstructed / decoded image for each block pair. Here, U is a positive integer.

[0590] Here, L filters are called a filter bank.

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

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

[0593] Optionally, for example, in units of CU, PU, ​​TU, CTU, strip, parallel block, parallel block group, frame, and sequence, L filters are common in at least one aspect of filter coefficients, number of filter taps (filter length), filter shape, and filter type.

[0594] Filtering can be performed using the same or different filters at the unit level of CU, PU, ​​TU, CTU, strip, parallel block, parallel block group, frame, and sequence.

[0595] The decision to perform filtering is based on whether filtering is performed on a per-sample, per-block, per-block, per-unit, per-unit, per-unit, per-unit, per-unit, per-unit, per-frame, or per-sequence basis. This filtering execution information refers to the information transmitted from the encoder to the decoder using signals, per-sample, per-block, per-unit, per-block, per-unit, per-unit, per-unit, per-frame, and per-sequence basis.

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

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

[0598] Reference Figure 33 To transmit filter information from the encoder to the decoder using signals from three diamond-shaped filters with 5×5, 7×7, or 9×9 filter taps, the filter index is entropy-encoded / decoded based on each frame / parallel block / parallel block group / strip / sequence. In other words, the filter index is entropy-encoded / decoded in the bitstream using sequence parameter sets, frame parameter sets, strip headers, strip data, parallel block headers, parallel block group headers, and so on.

[0599] According to an embodiment of the present invention, when the number of filter taps in the encoder / decoder is fixed at 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.

[0600] According to an embodiment of the present 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.

[0601] For example, in Figure 33 At least one of the three diamond-shaped filters shown is used to filter the luminance samples for reconstruction / decoding.

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

[0603] Further alternatively, for example, the filter used to filter the luminance sample can be used to filter the reconstructed / decoded chrominance sample corresponding to the luminance sample.

[0604] 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, in Figure 33 The filter shown is a point-symmetric filter.

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

[0606] In addition, regarding Figure 33 The 9×9 diamond 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, filtering is performed using a maximum of 21 multiplications per sample.

[0607] 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 are half the length of the vertical filter. That is, a maximum of four line buffers are required.

[0608] According to embodiments of the invention, the filter has the same filter length representing 5×5 filter taps, but may have different filter shapes selected from rhombuses, rectangles, squares, trapezoids, diagonals, snowflakes, digit symbols, cloverleaf shapes, crosses, triangles, pentagons, hexagons, octagons, decagons, and dodecagons. For example, in Figure 34 The image shows square, octagonal, snowflake, and diamond filters with 5×5 filter taps.

[0609] The number of filter taps is not limited to 5×5. A filter with H×V filter taps selected from 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 can be used. Here, H and V are positive integers and can be the same or different values. Additionally, at least one of H and V is a predefined value in the encoder / decoder and a value transmitted from the encoder to the decoder via signal transmission. Furthermore, one of H and V is used to define the other of H and V. Moreover, the final value of H or V can be defined using the values ​​of H and V.

[0610] On the other hand, in order to Figure 34 The information of which filter will be used, as shown in the diagram, is transmitted from the encoder to the decoder via a signal. This can be achieved by encoding / decoding the filter index entropy based on each frame / parallel block / parallel block group / strip / sequence. In other words, the filter index entropy is encoded / decoded into the sequence parameter set, frame parameter set, strip header, strip data, parallel block header, and parallel block group header within the bitstream.

[0611] On the other hand, will Figure 34At least one of the square, octagonal, snowflake, and rhombus filters shown is used to filter at least one reconstructed / decoded sample of at least one of the luminance and chrominance components.

[0612] 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, in Figure 34 The filter shown is a point-symmetric filter.

[0613] According to embodiments of the present invention, when filtering the reconstructed image based on each sample point, the filter shape to be used for each image, strip, parallel block, or group of parallel blocks can be determined in terms of rate-distortion optimization in the encoder. Furthermore, filtering is performed using the determined filter shape. Figure 34 As shown, because the degree of improvement in coding efficiency and the amount of filter information (the number of filter coefficients) vary depending on the filter shape, it is necessary to determine the optimal filter shape for each frame, strip, parallel block, or group of parallel blocks. In other words, the optimal filter shape must be determined based on factors such as video resolution, video characteristics, and bit rate. Figure 34 The optimal filter shape among the filter shapes shown.

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

[0615] For example, in Figure 34 In the case of the 5×5 square filter shown in (a), entropy encoding / decoding is performed on a total of 13 filter coefficients. Figure 34 In the case of the 5×5 octagonal filter shown in (b), entropy encoding / decoding is performed on a total of 11 filter coefficients. Figure 34 In the case of the 5×5 snowflake filter shown in (c), entropy encoding / decoding is performed on a total of 9 filter coefficients, 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 / decoded. That is, the number of filter coefficients to be entropy encoded / decoded varies depending on the filter shape. Here, in Figure 34 The maximum number of filter coefficients in the example (i.e., 13) is less than in Figure 33 The maximum number of filter coefficients in the example is 21. Therefore, when using Figure 34When using filters in the example, the number of filter coefficients that will be entropy encoded / decoded is reduced. Therefore, in this case, the computational complexity of the encoder / decoder can be reduced.

[0616] 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 in Figure 33 The maximum number of filter coefficients in the example is 21. Therefore, when using Figure 34 When using filters in the example, the number of multiplications per sample is reduced. Therefore, in this case, the computational complexity of the encoder / decoder can be reduced.

[0617] Alternatively, for example, due to in Figure 34 All filters in the example are 5×5 in size, so the hardware implementation requires two line buffers, each half the length of a 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 as an example, the size of the line buffer, the hardware complexity of the encoder / decoder, memory capacity requirements, and memory access bandwidth can be reduced.

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

[0619] For example, using Figure 35a and / or Figure 35bThe filter bank is constructed by using at least one of the filters shown, which has a vertical length of 5, and then filtering is performed using the filter bank.

[0620] Alternatively, for example, using Figure 35a and Figure 35b The filter bank is constructed using at least one of the vertical filter lengths of 3 shown in the filter diagram, and then filtering is performed using the filter bank.

[0621] Further, alternatively, for example, using Figure 35a and / or Figure 35b The filter bank is constructed using at least one of the vertical filter lengths of 3 or 5 shown, and filtering is performed using the filter bank.

[0622] exist 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.

[0623] On the other hand, used in Figure 35a and / or Figure 35b The filters shown are used to prepare H filter banks, and information about which filter to use is transmitted from the encoder to the decoder via a signal. In this case, the filter index is entropy encoded / decoded based on each frame, parallel block, parallel block group, stripe, or sequence. Here, H is a positive integer. That is, the filter index is entropy encoded / decoded into the sequence parameter set, frame parameter set, stripe header, stripe data, parallel block header, and parallel block group header within the bitstream.

[0624] At least one of the following filters—rhombus, rectangle, square, trapezoid, diagonal, snowflake, number symbol, four-leaf 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.

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

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

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

[0628] Alternatively, for example, when used in Figure 35a and / or Figure 35b When at least one of the filters shown is used, it is similar to the filter used in Figure 33 Compared to the case of one of the 9×9 diamond filters shown, the number of multiplications required to filter the filter coefficients is reduced. Therefore, the computational complexity of the encoder / decoder can be reduced.

[0629] Further, alternatively, for example, when used in Figure 35a and / or Figure 35b When at least one of the filters shown is used, it is similar to the filter used in Figure 33 Compared to one of the 9×9 diamond filters shown, the number of lines in the line buffer required to filter the filter coefficients is reduced. Furthermore, hardware complexity, memory requirements, and memory access bandwidth are also reduced.

[0630] According to an embodiment of the present invention, it can be derived from Figure 36 At least one filter selected from the horizontal / vertical symmetric filters shown is used in place 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.

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

[0632] Optionally, for example, using in Figure 36 At least one of the vertical filters with a length of 3 shown in the filter diagram constitutes a filter group, which is then used for filtering.

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

[0634] exist 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.

[0635] In order to prepare for including Figure 36 The diagram shows a filter bank of H filters, and information about which filter in the filter bank will be used is transmitted from the encoder to the decoder via a signal. The filter indices are entropy-encoded / decoded based on each frame, parallel block, parallel block group, stripe, or sequence. Here, H is a positive integer. That is, the filter indices are entropy-encoded / decoded into sequence parameter sets, frame parameter sets, stripe headers, stripe data, parallel block headers, and parallel block group headers within the bitstream.

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

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

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

[0639] Alternatively, for example, when used in Figure 36 When at least one of the filters shown is used, it is similar to the filter used in Figure 33 Compared to the case of one of the 9×9 diamond filters shown, the number of multiplications required to filter the filter coefficients is reduced. Therefore, the computational complexity of the encoder / decoder can be reduced.

[0640] Further, alternatively, for example, when used in Figure 36 When at least one of the filters shown is used, it is similar to the filter used in Figure 33Compared to one of the 9×9 diamond filters shown, the number of lines in the line buffer required to filter the filter coefficients is reduced. Furthermore, hardware complexity, memory requirements, and memory access bandwidth are also reduced.

[0641] According to an embodiment of the present invention, before performing filtering based on each block classification unit, the sum of gradient values ​​calculated based on each block classification unit (i.e., the sum of gradient values ​​in the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction, g) is used. v g h g d1 and g d2 At least one of the following performs 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 operation on the filter, thereby producing a geometrically transformed filter.

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

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

[0644] [Equation 33]

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

[0646] [Equation 34]

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

[0648] [Equation 35]

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

[0650] Here, Equation 33 is an example of the equation used for the second diagonal flip, Equation 34 is an example of the equation used for the vertical flip, and Equation 35 is an example of the equation used for the 90° rotation. 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.

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

[0652] [Table 1]

[0653]

[0654]

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

[0656] Reference Figure 37 The filter coefficients of square, octagonal, snowflake, and diamond filters undergo at least one geometric transformation, including a second diagonal flip, a vertical flip, and a 90° rotation. The filter coefficients obtained through this 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, 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.

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

[0658] [Equation 36]

[0659]

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

[0661] 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 from the current 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 from the current reconstructed / decoded sample and the neighboring reconstructed / decoded sample. Here, the threshold E is a positive integer or zero.

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

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

[0664] For example, filtering of the reconstructed image of the luminance component can only be performed if filtering of the reconstructed image of the luminance 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.

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

[0666] 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 filtering is performed using the padded sample. Padding refers to a method of copying the sample value of an adjacent available sample to the unavailable sample. Optionally, sample values ​​or statistical values ​​obtained based on the values ​​of available samples adjacent to the unavailable sample are used. Padding can be performed repeatedly for P columns and R rows. Here, M and L are both positive integers.

[0667] Here, an unavailable sample point refers to a sample point located outside the boundaries of a CTU, CTB, strip, parallel block, parallel block group, or screen. Optionally, an unavailable 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.

[0668] In addition, when performing filtering, predetermined samples may not be used.

[0669] For example, when performing filtering, it is possible to omit the filler samples.

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

[0671] Further alternatively, for example, when performing filtering, if a sample near the current sample is located outside the CTU or CTB, the neighboring samples near the current sample may not be used during filtering.

[0672] Additionally, when performing filtering, samples that have been subjected to at least one of deblocking filtering, adaptive sample offsetting, and adaptive in-loop filtering can be used.

[0673] Additionally, when performing filtering, if at least one of the samples present near the current sample is outside the CTU or CTB boundary, at least one of deblocking filtering, adaptive sample offset, and adaptive in-loop filtering may not be applied.

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

[0675] 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. Additionally, the sample point located near the boundary can be at least one of U rows, U columns, and U sample points adjacent to the boundary. Here, U is a positive integer.

[0676] 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, and filtering is not performed on sample points located outside the boundaries 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. Additionally, sample points located near the boundary can be at least one of U rows, U columns, and U sample points adjacent to the boundary. Here, U is a positive integer.

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

[0678] Additionally, 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, the number of filter taps (filter length), filter shape, and filter type. At least one of the following—filter coefficients, the number of filter taps (filter length), filter shape, and filter type—varies according to at least one of the coding parameters.

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

[0680] Optionally, for example, the number of filters used for filtering can be 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. The larger the block size, the fewer block filters are used.

[0681] Optionally, for example, the number of filters used for filtering is 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. Additionally, J is greater than or equal to H. The larger the size of the block classification unit, the fewer block filters are used.

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

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

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

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

[0686] On the other hand, the filter information includes at least one piece of information selected from 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 based on each strip, parallel block, parallel block group, frame, CTU, CTB, block, or CU, 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, information on the filter index of previous reference frames, information on whether fixed filter information is used for block classification index information, 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.

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

[0688] On the other hand, the filter information includes up to L luminance filters. Here, L is a positive integer, specifically 25. Additionally, the filter information includes up to L chromatic aberration filters. Here, L is a positive integer, specifically 1.

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

[0690] For example, information about the symmetry shape of a filter is information about filter shapes such as point symmetry, horizontal symmetry, vertical symmetry, or combinations of point symmetry, horizontal symmetry, and vertical symmetry.

[0691] On the other hand, only some of the filter coefficients are transmitted using a signal. For example, when the filter is symmetrical, information about only one filter coefficient group in the symmetrical filter coefficient set is transmitted using a signal. Alternatively, for example, since the filter coefficients at the center of the filter can be implicitly derived, the filter coefficients at the center of the filter are not transmitted using a signal.

[0692] According to an embodiment of the invention, filter coefficient values ​​in filter information are quantized in the encoder, and the quantized filter coefficient values ​​are entropy encoded as a result. Similarly, the quantized filter coefficient values ​​are entropy decoded in the decoder, 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. Additionally, at least one filter coefficient is quantized to different bits and dequantized. Conversely, at least one of the filter coefficients can be quantized to the same number of bits and dequantized. The number of M bits is determined according to the quantization parameters. Furthermore, M in the M bits is a constant predefined in the encoder and decoder. Here, M can be a positive integer, specifically 8 or 10. The number of 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, then M can be 8. The first filter coefficient in the filter coefficients within the filter can be from -2... M Up to 2 M The values ​​are in the range of -1, and the second filter coefficients can be from 0 to 2. M Values ​​within the range of -1. Here, the first filter coefficient refers to the filter coefficients excluding the center filter coefficient, and the second filter coefficient refers to the center filter coefficient.

[0693] 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 / decoded. The filter coefficient values ​​can be cropped to fall within the range of minimum to maximum. For each filter coefficient, at least one of the minimum and maximum values ​​can be different. On the other hand, for each filter coefficient, at least one of the minimum and maximum values ​​can be the same. 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 constant value predefined in the encoder and decoder.

[0694] According to an embodiment of the present invention, at least one piece of filter information is entropy encoded / 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 / style.

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

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

[0697] For example, filtering execution information (flags) is used based on each 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 is a first value, filtering is performed based on each CTB, and when the filtering execution information is a second value, no filtering is performed on the corresponding CTB. In this case, entropy encoding / decoding can be performed on the information regarding whether filtering is performed on each CTB. Alternatively, for example, entropy encoding / decoding can be performed on information regarding the maximum depth or minimum size of the CU (maximum depth filter information of the CU), and entropy encoding / decoding can be performed on CU-based filtering execution information regarding the CU with the maximum depth or the CU with the minimum size.

[0698] 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 flag entropy encoding / decoding can be performed until the block has a partition depth that allows it to be partitioned into smaller square sub-blocks. Conversely, CU-based flag entropy encoding / decoding can be performed until the block has a partition depth that allows it to be partitioned into smaller non-square sub-blocks.

[0699] 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 based on each block). For example, filtering is performed on a block when the block-based flag for the corresponding block is a first value, and filtering is not performed when the block-based flag for the corresponding block is a second value. The block size is N×M, where N and M are positive integers.

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

[0701] Further, alternatively, for example, the determination of whether to perform filtering on at least one of the luminance and chrominance components can be based on the frame, strip, parallel block group, or parallel block type. Information regarding whether to perform filtering on at least one of the luminance and chrominance components can be based on flags for each frame, strip, parallel block group, or parallel block.

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

[0703] Furthermore, to reduce the amount of filter coefficients that will be entropy encoded / decoded, the filter coefficients of a reference frame can be used as the filter coefficients of the current frame. In this case, the method of using the filter coefficients of the 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 of the reference frame are stored in memory. Additionally, when the filter coefficients of the reference frame are used for the current frame, entropy encoding / decoding of the filter coefficients of the current frame is omitted. In this case, entropy encoding / decoding is performed on the filter index of the previous reference frame that indicates which reference frame's filter coefficients are used.

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

[0705] Optionally, for example, when using temporal filter coefficient prediction, a filter bank candidate list is constructed for multiple temporal layer indices to support temporal scalability. That is, a filter bank candidate list is constructed for each temporal layer. For example, the filter bank candidate list for a given temporal layer contains filter banks for decoding frames, where the temporal layer index of the decoded frame is equal to or less than the temporal layer index of previously decoded frames. Additionally, after decoding each frame, the filter coefficients for the current frame are added to a filter bank candidate list with a temporal layer index equal to or greater than the current frame's temporal layer index.

[0706] According to an embodiment of the present invention, a fixed filter bank is used to perform filtering.

[0707] 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 the up to 16 fixed filters within the filter bank can be used for filtering based on the block classification index. To transmit information from the encoder to the decoder regarding whether a fixed filter bank is used, entropy encoding / decoding is performed on information regarding whether a fixed filter is used for each block classification index. When a fixed filter is used, entropy encoding / decoding is also performed on the index information regarding the fixed filter. 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.

[0708] In addition, fixed filter banks are also used in inter-frame prediction frames (B / P frames, stripes, parallel block groups, or parallel blocks).

[0709] Alternatively, adaptive in-loop filtering can be performed using fixed filters without entropy encoding / decoding the filter coefficients. Here, a fixed filter may represent a filter bank predefined in the encoder and decoder. In this case, without entropy encoding / decoding the filter coefficients, the encoder and decoder entropy encode / decode the fixed filter index information, which indicates which filter in the filter bank or which filter bank predefined 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 classification, block, CU, stripe, parallel block, parallel block group, and frame.

[0710] On the other hand, at least one filter within a fixed filter bank can be transformed in terms of filter taps and / or filter shape. For example, such as Figure 38The diagram illustrates the transformation of coefficients in a 9×9 diamond filter into coefficients in a 5×5 square filter. Specifically, the coefficients in a 9×9 diamond filter can be transformed into coefficients in a 5×5 square filter.

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

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

[0713] Further alternatively, 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.

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

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

[0716] Further alternatively, 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.

[0717] Further, alternatively, for example, the filter coefficients corresponding to filter coefficient index 11 in the 9×9 rhombus shape are assigned to filter coefficient index 6 in the 5×5 square shape.

[0718] Further, alternatively, for example, the filter coefficients corresponding to filter coefficient index 12 in the 9×9 rhombus shape are assigned to filter coefficient index 7 in the 5×5 square shape.

[0719] Further, alternatively, for example, the filter coefficients corresponding to filter coefficient index 13 in the 9×9 rhombus shape are assigned to filter coefficient index 8 in the 5×5 square shape.

[0720] Further, alternatively, for example, the sum of the filter coefficients corresponding to filter coefficient indices 14 and 15 in the 9×9 rhombus shape is assigned to filter coefficient index 9 in the 5×5 square shape.

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

[0722] Further, alternatively, for example, the filter coefficients corresponding to filter coefficient index 19 in the 9×9 rhombus shape are assigned to filter coefficient index 11 in the 5×5 square shape.

[0723] Further, alternatively, for example, the filter coefficients corresponding to filter coefficient index 20 in the 9×9 rhombus shape are assigned to filter coefficient index 12 in the 5×5 square shape.

[0724] Table 2 illustrates an exemplary method for generating filter coefficients by transforming 9×9 diamond filter coefficients into 5×5 square filter coefficients.

[0725] [Table 2]

[0726]

[0727]

[0728]

[0729] In Table 2, the sum of at least one of the filter coefficients of a 9×9 diamond filter is equal to the sum of at least one of the filter coefficients of the corresponding 5×5 square filter.

[0730] On the other hand, when using a maximum of 16 fixed filter banks for the coefficients of a 9×9 diamond filter, a maximum of 21 filter coefficients × 25 filters × 16 filter types need to be stored in memory. When a maximum of 16 fixed filter banks are used for the filter coefficients of a 5×5 square filter, a maximum of 13 filter coefficients × 25 filters × 16 filter types need to be stored in memory. Here, since the memory size required to store fixed filter coefficients in a 5×5 square filter is smaller than the memory size required to store fixed filter coefficients in a 9×9 diamond filter, the memory capacity requirement and memory access bandwidth are reduced.

[0731] On the other hand, the chroma component of the reconstructed / decoded component can be filtered using a filter obtained by transforming the filter for the co-occurring luminance component in terms of filter taps and / or filter shape.

[0732] According to an embodiment of the present invention, it is prohibited to predict filter coefficients from the filter coefficients of a predefined fixed filter.

[0733] According to an embodiment of the invention, multiplication is replaced by shift operations. First, the filter coefficients used to perform filtering on the luminance and / or chrominance blocks are divided into two groups. For example, the filter coefficients are divided into a first group including coefficients {L0, L1, L2, L3, L4, L5, L7, L8, L9, L10, L14, L15, L16, and L17} and a second group including the remaining coefficients. The first group is limited to including only coefficient values ​​{-64, -32, -16, -8, -4, 0, 4, 8, 16, 32, and 64}. In this case, the multiplication of the filter coefficients included in the first group and the reconstructed / decoded samples can be performed with a single bit shift operation. Therefore, the filter coefficients included in the first group are mapped to pre-bindified bit shift values ​​to reduce the overhead of signal transmission.

[0734] According to an embodiment of the present invention, as a result of determining whether to perform block classification and / or filtering on the chroma component, the result of determining whether to perform block classification and / or filtering on the corresponding luminance component is used as is. Furthermore, as filter coefficients for the chroma component, filter coefficients already used for the corresponding luminance component are used. For example, a predetermined 5×5 diamond filter is used.

[0735] As an example, the filter coefficients in a 9×9 filter used for the luminance component can be transformed into the filter coefficients in a 5×5 filter used for the chrominance component. In this case, the outermost filter coefficients are set to zero.

[0736] As another example, when filter coefficients in the form of a 5×5 filter are used for the luminance component, the filter coefficients used for the luminance component are the same as those used for the chrominance component. That is, the filter coefficients used for the luminance component can be used as filter coefficients for the chrominance component without modification.

[0737] As another example, in order to maintain the shape of the 5×5 filter used to filter the chromaticity components, the filter coefficients outside the 5×5 diamond filter are replaced by coefficients arranged at the boundaries of the 5×5 diamond filter.

[0738] On the other hand, intra-loop filtering for the luma block and intra-loop filtering for the chroma block can be performed separately. Control flags are transmitted via signals at the picture, strip, parallel block group, parallel block, CTU, or CTB level to indicate whether adaptive intra-loop filtering for the chroma component is supported independently. Flags indicating whether adaptive intra-loop filtering is performed jointly for both luma and chroma blocks, or individually for both luma and chroma blocks, can be transmitted via signals.

[0739] According to embodiments of the present invention, when entropy encoding / decoding at least one piece of filter information, at least one of the following binarization methods can be used:

[0740] Truncation Rice binarization method;

[0741] K-order exponential Columbus binarization method;

[0742] Finite K-order exponential Columbus binarization method;

[0743] Fixed-length binarization method;

[0744] Univariate binarization methods; and

[0745] A truncated univariate binarization method.

[0746] As an example, entropy encoding / decoding of the filter coefficients of the luminance filter and the filter coefficients of the chrominance filter are performed using different binarization methods for the luminance filter and the chrominance filter.

[0747] As another example, entropy encoding / decoding of the filter coefficients of a luminance filter is performed using different binarization methods. As yet another example, entropy encoding / decoding of the filter coefficients of a luminance filter is performed using the same binarization method.

[0748] As another example, entropy encoding / decoding of the filter coefficients of a chroma filter is performed using different binarization methods. As yet another example, entropy encoding / decoding of the filter coefficients of a chroma filter is performed using the same binarization method.

[0749] When entropy encoding / decoding at least one filter information, as an example, at least one filter information of at least one neighboring block in a neighboring block, or at least one previously encoded / decoded filter information, or the encoded / decoded filter information in a previous frame, is used to determine the context model.

[0750] As another example, when entropy encoding / decoding at least one filter piece of information, the context model is determined using at least one filter piece of information with different components.

[0751] As another example, when entropy encoding / decoding filter coefficients, at least one of the filter coefficients in the filter is used to determine the context model.

[0752] As another example, when entropy encoding / decoding at least one filter information, at least one filter information of at least one neighboring block in a neighboring block, or at least one previously encoded / decoded filter information, or the encoded / decoded filter information in a previous frame, is used to determine the context model.

[0753] As another example, when entropy encoding / decoding is performed on at least one filter information, at least one filter information with different components is used as the predicted value of the filter information to perform entropy encoding / decoding.

[0754] As another example, when entropy encoding / decoding filter coefficients, at least one of the filter coefficients within the filter is used as a prediction value to perform entropy encoding / decoding.

[0755] As another example, any combination of filter information entropy encoding / decoding methods can be used to entropy encode / decode filter information.

[0756] According to embodiments of the present invention, adaptive in-loop filtering is performed on a unit consisting of at least one of the following: block, CU, PU, ​​TU, CB, PB, TB, CTU, CTB, strip, parallel block, parallel block group, and frame. When adaptive in-loop filtering is performed on each of the above units, it means that a block classification step, a filtering execution step, and a filter information encoding / step are performed on a unit consisting of at least one of the following: block, CU, PU, ​​TU, CB, PB, TB, CTU, CTB, strip, parallel block, parallel block group, and frame.

[0757] According to an embodiment of the present invention, whether to perform adaptive in-loop filtering is determined based on whether at least one of deblocking filtering, sample adaptive offsetting, and bidirectional filtering is performed.

[0758] As an example, adaptive in-loop filtering is performed on samples in the current frame that have undergone at least one of deblocking filtering, adaptive sample offsetting, and bidirectional filtering.

[0759] As another example, adaptive in-loop filtering is not performed on samples in the current frame that have already undergone at least one of deblocking filtering, sample adaptive offsetting, and bidirectional filtering.

[0760] As another example, for reconstructed / decoded samples in the current frame that have already undergone at least one of deblocking filtering, adaptive sample offsetting, and bidirectional filtering, adaptive in-loop filtering is performed on the reconstructed / decoded samples in the current frame using L filters, without performing block classification. Here, L is a positive integer.

[0761] According to an embodiment of the present invention, whether to perform adaptive in-loop filtering is determined based on the strip or parallel block group type of the current frame.

[0762] As an example, adaptive in-loop filtering is only performed when the current frame's strip or parallel block group type is I strip or I parallel block group.

[0763] As another example, adaptive in-loop filtering is performed when the current frame's strip or parallel block group type is at least one of I strip, B strip, P strip, I parallel block group, B parallel block group, and P parallel block group.

[0764] As an example, when the current frame's stripe or parallel block group type is at least one of I-strip, B-strip, P-strip, I-parallel block group, B-parallel block group, and P-parallel block group, adaptive intra-loop filtering is performed on the reconstructed / decoded samples within the current frame using L filters, without performing block classification. Here, L is a positive integer.

[0765] As another example, when the current frame's strip or parallel block group type is at least one of I strip, B strip, P strip, I parallel block group, B parallel block group, and P parallel block group, a filter shape is used to perform adaptive in-loop filtering.

[0766] As another example, when the current frame's strip or parallel block group type is at least one of I strip, B strip, P strip, I parallel block group, B parallel block group, and P parallel block group, a filter tap is used to perform adaptive in-loop filtering.

[0767] As another example, when the current frame's stripe or parallel block group type is at least one of I-strip, B-strip, P-strip, I-parallel block group, B-parallel block group, and P-parallel block group, at least one of block classification and adaptive in-loop filtering is performed based on each M×N block. In this case, both M and N are positive integers. Specifically, both M and N are 4.

[0768] According to an embodiment of the present invention, whether to perform adaptive in-loop filtering is determined based on whether the current frame is used as a reference frame.

[0769] For example, when using the current frame as a reference frame when encoding / decoding subsequent frames, adaptive in-loop filtering is performed on the current frame.

[0770] As another example, when the current frame is not used as a reference frame during the encoding / decoding of subsequent frames, adaptive in-loop filtering is not performed on the current frame.

[0771] As another example, when the current frame is not used in processing subsequent frames, adaptive intra-loop filtering is performed on the reconstructed / decoded samples within the current frame using L filters, without performing block classification. Here, L is a positive integer.

[0772] As another example, when the current frame is not used when encoding / decoding subsequent frames, adaptive in-loop filtering is performed using a filter shape.

[0773] As another example, when the current image is not used when encoding / decoding subsequent frames, an adaptive in-loop filtering is performed using a filter tap.

[0774] As another example, when the current frame is not used during encoding / decoding of subsequent frames, at least one of block classification and filtering is performed based on each N×M block. In this case, both M and N are positive integers. Specifically, both M and N are 4.

[0775] According to an embodiment of the present invention, whether to perform adaptive in-loop filtering is determined based on the time layer identifier.

[0776] As an example, when the time layer identifier of the current frame is zero, representing the underlying layer, adaptive in-loop filtering is performed on the current frame.

[0777] As another example, when the time layer identifier of the current frame is 4, representing the top layer, adaptive in-loop filtering is performed.

[0778] As another example, the temporal layer identifier for the current frame is 4, representing the top layer. When performing adaptive intra-loop filtering on the current frame, L filters are used to perform adaptive intra-loop filtering on the reconstructed / decoded samples within the current frame, without performing block classification. Here, L is a positive integer.

[0779] As another example, when the time layer identifier of the current frame is 4, representing the top layer, adaptive in-loop filtering is performed using a filter shape.

[0780] As another example, when the time layer identifier of the current frame is 4, representing the top layer, an adaptive in-loop filtering is performed using a filter tap.

[0781] As another example, when the time layer identifier of the current frame is 4, representing the top layer, at least one of block classification and adaptive in-loop filtering is performed based on each N×M block. In this case, both M and N are positive integers. Specifically, both M and N are 4.

[0782] According to an embodiment of the present invention, at least one of the block classification methods is performed based on a time layer identifier.

[0783] For example, when the time layer identifier of the current frame is zero, representing the bottom layer, at least one of the block classification methods described above is performed on the current frame.

[0784] Optionally, when the time layer identifier of the current frame is 4, representing the top layer, at least one of the block classification methods described above is performed on the current frame.

[0785] According to an embodiment of the present invention, at least one of the above-described block classification methods is performed based on the value of the time layer identifier.

[0786] As another example, when the time layer identifier of the current frame is 4, representing the top layer, adaptive intra-loop filtering is performed on the reconstructed / decoded samples within the current frame using L filters, without performing block classification. Here, L is a positive integer.

[0787] As another example, when the time layer identifier of the current frame is 4, representing the top layer, adaptive in-loop filtering is performed using a filter shape.

[0788] As another example, when the time layer identifier of the current frame is 4, representing the top layer, an adaptive in-loop filtering is performed using a filter tap.

[0789] As another example, when the time layer identifier of the current frame is 4, representing the top layer, at least one of block classification and adaptive in-loop filtering is performed based on each N×M block. In this case, both M and N are positive integers. Specifically, both M and N are 4.

[0790] As another example, when performing adaptive intra-loop filtering on the current frame, L filters are used to perform adaptive intra-loop filtering on the reconstructed / decoded samples within the current frame, without performing block classification. Here, L is a positive integer. Optionally, in this case, adaptive intra-loop filtering is performed on the reconstructed / decoded samples within the current frame using L filters, without performing block classification and regardless of the temporal layer identifier.

[0791] On the other hand, when performing adaptive intra-loop filtering on the current frame, L filters are used to perform adaptive intra-loop filtering on the reconstructed / decoded samples within the current frame, regardless of whether block classification is performed. Here, L is a positive integer. In this case, L filters can be used to perform adaptive intra-loop filtering on the reconstructed / decoded samples within the current frame without performing block classification, and regardless of the temporal layer identifier or whether block classification is performed.

[0792] On the other hand, an adaptive intra-loop filtering can be performed using a filter shape. In this case, an adaptive intra-loop filtering can be performed on the reconstructed / decoded samples within the current image using a filter shape, without requiring block classification. Alternatively, an adaptive intra-loop filtering can be performed on the reconstructed / decoded samples within the current image using a filter shape, regardless of whether block classification is performed.

[0793] On the other hand, an adaptive intra-loop filtering can be performed using a single filter tap. In this case, adaptive intra-loop filtering can be performed on the reconstructed / decoded samples within the current image using a single filter tap, without requiring block classification. Alternatively, adaptive intra-loop filtering can be performed on the reconstructed / decoded samples within the current image using a single filter tap, regardless of whether block classification is performed.

[0794] On the other hand, adaptive in-loop filtering can be performed based on specific units. For example, a specific unit can be at least one of a frame, strip, parallel block, parallel block group, CTU, CTB, CU, PU, ​​TU, CB, PB, TB, and M×N sized blocks. Here, M and N are both positive integers. M and N can be the same integer or different integers. Furthermore, M, N, or both M and N are predefined values ​​in the encoder / decoder. Optionally, M, N, or both M and N can be values ​​transmitted from the encoder to the decoder via signals.

[0795] Figures 39 to 5 5 is a diagram illustrating an exemplary method for determining the sum of gradient values ​​for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction based on subsampling.

[0796] Reference Figures 39 to 5 5. Perform filtering based on each 4×4 lumen block. In this case, different filter coefficients can be used to perform filtering for each 4×4 lumen block. A subsampled Laplacian operation can be performed to classify the 4×4 lumen blocks. Furthermore, the filter coefficients used for filtering vary for each 4×4 lumen block. Additionally, the 4×4 lumen blocks are classified into up to 25 categories. Furthermore, a classification index corresponding to the filter index of the 4×4 lumen block can be derived based on the block's directionality value and / or quantization activity value. Here, to calculate the directionality value and / or quantization activity value for each 4×4 lumen block, the sum of gradient values ​​for the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction is calculated by summing the results of the one-dimensional Laplacian operation calculated at the subsampled positions within the 8×8 block.

[0797] Specifically, refer to Figure 39 In the case of block classification based on each 4×4 block, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions is calculated based on subsampling. v g h g d1 and g d2At least one of the following (hereinafter referred to as the "first method"). Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplace operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplace operations are performed at positions V, H, D1, and D2 along the horizontal, vertical, first diagonal, and second diagonal directions, respectively. Furthermore, the position where the one-dimensional Laplace operation is performed can be the position of a subsample. Figure 39 In this approach, a block classification index C is assigned based on each 4×4 block (i.e., the shaded area). In this case, the computational range for calculating the one-dimensional Laplace sum can be larger than the size of the block classification unit. Here, thin solid rectangles represent the reconstructed sample point locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplace sum.

[0798] here, Figures 40a to 40d An exemplary block-based encoding / decoding process using the first method is shown. Figures 41a to 41d Another exemplary block-based encoding / decoding process using the first method is shown in one dimension. Figures 42a to 42d Another exemplary block-based encoding / decoding process using the first method is shown in two dimensions.

[0799] Reference Figure 43 In the case of block classification based on each 4×4 block, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions is calculated based on subsampling. v g h g d1 and g d2 At least one of the following (hereinafter referred to as the "second method"). Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplace operations for the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplace operations are performed at positions V, H, D1, and D2 along the horizontal, vertical, first diagonal, and second diagonal directions, respectively. Furthermore, the position where the one-dimensional Laplace operation is performed can be the position of a subsample. Figure 43 In this approach, a block classification index C is assigned based on each 4×4 block (i.e., the shaded area). In this case, the computational range for calculating the one-dimensional Laplace 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 Laplace sum.

[0800] Specifically, the second method means that when both x and y values ​​are even, or when both x and y values ​​are odd, a one-dimensional Laplace operation is performed at position (x, y). When neither x nor y value is even, or neither x nor y value is odd, the result of the one-dimensional Laplace operation at position (x, y) is assigned zero. In other words, it means performing a one-dimensional Laplace operation using a chessboard pattern based on the x and y values.

[0801] Reference Figure 43 The position for performing the one-dimensional Laplace operation is the same for the horizontal, vertical, first diagonal, and second diagonal directions. In other words, regardless of the direction of the vertical, horizontal, first diagonal, and second diagonal directions, a uniform subsampled position is used to perform the one-dimensional Laplace operation for each direction.

[0802] here, Figures 44a to 44d An exemplary block-based encoding / decoding process using the second method is shown. Figures 45a to 45d Another exemplary block-based encoding / decoding process using the second method is shown. Figures 46a to 46d Another exemplary block-based encoding / decoding process using the first method is shown. Figures 47a to 47d Another exemplary block-based encoding / decoding process using the first method is shown.

[0803] Reference Figure 48 In the case of block classification based on each 4×4 block, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions is calculated based on subsampling. v g h g d1 and g d2 At least one of the following (hereinafter referred to as the "third method"). Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplace operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplace operations are performed at positions V, H, D1, and D2 along the horizontal, vertical, first diagonal, and second diagonal directions, respectively. Furthermore, the position where the one-dimensional Laplace operation is performed can be the position of a subsample. Figure 48 In this context, a block classification index C is assigned based on each 4×4 block (i.e., 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 point locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

[0804] Specifically, the third method involves performing a one-dimensional Laplace operation at position (x, y) when either the x-coordinate or the y-coordinate is even and the other is odd. When both the x-coordinate and the y-coordinate are even or odd, the result of the one-dimensional Laplace operation at position (x, y) is assigned zero. In other words, it means performing a one-dimensional Laplace operation using a chessboard pattern based on the x-coordinate and the y-coordinate.

[0805] Reference Figure 48 The positions for performing one-dimensional Laplace operations in the horizontal, vertical, first diagonal, and second diagonal directions are the same. In other words, regardless of the direction, a uniform subsampled one-dimensional Laplace operation position is used to perform the one-dimensional Laplace operation for each direction.

[0806] here, Figures 49a to 49d An exemplary block-based encoding / decoding process using a third method is shown. Figures 50a to 50d This illustrates another exemplary block-based encoding / decoding process using a third method. Figures 51a to 51d Another exemplary block-based encoding / decoding process using a third method is shown in one dimension.

[0807] Reference Figure 52 In the case of block classification based on each 4×4 block, the sum of gradient values ​​g for the vertical, horizontal, first diagonal, and second diagonal directions is calculated based on subsampling. v g h g d1 and g d2 At least one of the following (hereinafter referred to as the "fourth method"). Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplace operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplace operations are performed at positions V, H, D1, and D2 along the horizontal, vertical, first diagonal, and second diagonal directions, respectively. Furthermore, the position where the one-dimensional Laplace operation is performed can be the position of a subsample. Figure 52 In this approach, a block classification index C is assigned based on each 4×4 block (i.e., 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 point locations, and thick solid rectangles represent the computational range for calculating the one-dimensional Laplacian sum.

[0808] Specifically, the fourth method means performing a one-dimensional Laplace operation along the vertical direction at the subsampled position (x,y), instead of performing subsampling along the horizontal direction. In other words, it means skipping one row when performing a one-dimensional Laplace operation.

[0809] Reference Figure 52 The positions for performing one-dimensional Laplace operations in the horizontal, vertical, first diagonal, and second diagonal directions are the same. In other words, regardless of the direction, a uniform subsampled one-dimensional Laplace operation position is used to perform the one-dimensional Laplace operation for each direction.

[0810] here, Figures 53a to 53d An exemplary block-based encoding / decoding process using the fourth method is shown. Figures 54a to 54d Another exemplary block-based encoding / decoding process using the fourth method is shown. Figures 55a to 55d Another exemplary block-based encoding / decoding process using the fourth method is shown.

[0811] On the other hand, by using Figures 39 to 5 The gradient value calculated by the method shown in Figure 5 is used to derive the quantized activity value A of the directionality value and the activity value A. q At least one of the methods is similar to the in-loop filtering method described above.

[0812] On the other hand, in subsampling-based gradient value calculation methods, the one-dimensional Laplacian operation is not calculated for all samples within the operational range (e.g., an 8×8 block) used to compute the one-dimensional Laplacian sum, but rather for the positions of subsamples within that operational range. This reduces the number of computations required for block classification (e.g., multiplication, shift operations, addition, and absolute value calculations). Consequently, the computational complexity in both the encoder and decoder is reduced.

[0813] According to methods one through four, in the case of 4×4 block classification based on one-dimensional Laplacian operations using subsampling, the results V, H, D1, and D2 of the one-dimensional Laplacian operations calculated at the sample locations within an 8×8 block are added to a 4×4 lumen block to derive gradient values ​​for the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Therefore, to calculate all gradient values ​​within the 8×8 range, 720+240 additions, 288 comparisons, and 144 shifts are required.

[0814] On the other hand, according to the traditional in-loop filtering method, in the case of 4×4 block classification, V, H, D1, and D2, which are the results of the one-dimensional Laplacian operation calculated at all positions within an 8×8 range, are used for the 4×4 lumen block to derive the gradient values ​​in the vertical, horizontal, first diagonal, and second diagonal directions. Therefore, to calculate all gradient values ​​within the 8×8 range, 1586+240 additions, 576 comparisons, and 144 shifts are required.

[0815] Then, the gradient value is used to derive the quantized activity value A of the directionality value D and the activity value A. q The processing requires 8 additions, 28 comparisons, 8 multiplications, and 20 shifts.

[0816] Therefore, the block classification methods using the first to fourth methods within an 8×8 area require a total of 968 additions, 316 comparisons, 8 multiplications, and 164 shifts. Consequently, each sample point requires 15.125 additions, 4.9375 comparisons, 0.125 multiplications, and 2.5625 shifts.

[0817] On the other hand, block classification methods using traditional in-loop filtering techniques within an 8×8 range require a total of 1832 additions, 604 comparisons, 8 multiplications, and 164 shifts. Therefore, each sample point requires 28.625 additions, 9.4375 comparisons, 0.125 multiplications, and 2.5625 shifts.

[0818] Therefore, compared to traditional block classification based on in-loop filtering, block classification using the first to fourth methods can reduce the computational complexity for a given block size (e.g., an 8×8 range). That is, the number of computations is reduced by 44.17%. Furthermore, compared to traditional block classification based on in-loop filtering, the block classification methods using the first to fourth methods according to the present invention can reduce the number of hardware operations by 17.02%.

[0819] The computer-readable recording medium according to the present invention stores a bitstream generated by a video coding method, wherein the video coding method includes classifying coding units into classes based on each block classification unit, filtering the coding units classified based on each block classification unit, and encoding filter information. The block classification unit is not limited to a coding unit. That is, block classification can be performed on a unit of stripe, parallel block, parallel block group, frame, sequence, CTU, block, CU, PU, ​​or TU. Furthermore, the target to be filtered is not a coding unit. That is, filtering can be performed on stripes, parallel blocks, parallel block groups, frames, sequences, CTUs, blocks, CUs, PUs, or TUs. Additionally, the filter information is not limited to filter information for each coding unit. The filter information can be filter information for each stripe, parallel block, parallel block group, frame, sequence, CTU, block, CU, PU, ​​or TU.

[0820] The above embodiments can be performed in the same way in both the encoder and decoder.

[0821] At least one or a combination of the above embodiments can be used to encode / decode video.

[0822] The sequences applied in the above embodiments may be different between the encoder and the decoder, or the sequences applied in the above embodiments may be the same in the encoder and the decoder.

[0823] The above embodiments can be performed on ...

Claims

1. A video decoding method, comprising: Decode the filter information; The basic blocks in the coding tree unit are classified into one of several classes, and a block classification index is assigned to the basic block; and A filter is applied to samples of the basic block in the coding tree unit using the filter information and the block classification index. The block classification index is determined based on directional and activity information. Wherein, at least one of the directional information and the activity information is determined based on the gradient value of at least one of the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. The gradient value is obtained by applying the Laplace operation to the basic block. The Laplace operation is performed only on specific samples included in the basic block. Wherein, the horizontal and vertical positions of the specific sample points are both even-numbered positions or both odd-numbered positions, and The filter is diamond-shaped.

2. A video encoding method, comprising: The basic blocks in the coding tree unit are classified into one of several classes to assign a block classification index to the basic block; A filter is applied to samples of the basic blocks in the coding tree unit using filter information and the block classification index; and The filter information is encoded. The block classification index is determined based on directional and activity information. Wherein, at least one of the directional information and the activity information is determined based on the gradient value of at least one of the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. The gradient value is obtained by applying the Laplace operation to the basic block. The Laplace operation is performed only on specific samples included in the basic block. Wherein, the horizontal and vertical positions of the specific sample points are both even-numbered positions or both odd-numbered positions, and The filter is diamond-shaped.

3. A method for transmitting a bit stream, the method comprising: Generate the bit stream; as well as Send the bit stream, Generating the bitstream includes: The basic blocks in the coding tree unit are classified into one of several classes to assign a block classification index to the basic block; A filter is applied to samples of the basic blocks in the coding tree unit using filter information and the block classification index; and The filter information is encoded. The block classification index is determined based on directional and activity information. Wherein, at least one of the directional information and the activity information is determined based on the gradient value of at least one of the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. The gradient value is obtained by applying the Laplace operation to the basic block. The Laplace operation is performed only on specific samples included in the basic block. Wherein, the horizontal and vertical positions of the specific sample points are both even-numbered positions or both odd-numbered positions, and The filter is diamond-shaped.