Image encoding / decoding method and apparatus using intra-loop filtering
By employing in-loop filtering and subsampling block classification, the problem of low data transmission and storage efficiency in high-resolution video is solved, achieving more efficient video encoding and decoding while reducing computational complexity and storage costs.
Patent Information
- Application Number
- CN202211663497.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-10-29
- Filing Date
- 2018-11-29
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2038-11-29
AI Technical Summary
Existing video coding technologies are inefficient in transmitting and storing high-resolution, high-quality video data, and existing filtering methods cannot effectively reduce the distortion between the original and reconstructed images.
An in-loop filtering method is adopted, which performs filtering through subsampling-based block classification and uses multiple filter shapes and filter information for video encoding and decoding, thereby reducing computational complexity and memory access bandwidth.
It improves video encoding and decoding efficiency, reduces computational complexity and storage requirements, and lowers video data transmission and storage costs.
Smart Images

Figure CN115941941B_ABST
Abstract
Description
[0001] This application is a divisional application of application No. 201880086848.7 titled "Image encoding / decoding method and apparatus using in-loop filtering" filed with the China National Intellectual Property Office on November 29, 2018, which claims priority under Article 8 of the Patent Cooperation Treaty from application No. 10-2018-0154057 filed with the Korean Intellectual Property Office on November 29, 2018. TECHNICAL FIELD
[0002] The present application relates to a video encoding / decoding method, a video encoding / decoding apparatus, and a recording medium storing a bitstream. In particular, the present application relates to a video encoding / decoding method and apparatus using in-loop filtering. BACKGROUND
[0003] Currently, in various applications, there is an increasing demand for high-resolution, high-quality videos such as high definition (HD) videos and ultra-high definition (UHD) videos. As videos have higher resolutions and qualities, the amount of video data increases compared to existing video data. Therefore, when transmitting video data through a medium such as a wired / wireless broadband line or storing video data in an existing storage medium, the transmission or storage cost increases. To address this problem of high-resolution, high-quality video data, an efficient video encoding / decoding technique is required.
[0004] There are various video compression techniques such as an inter prediction technique for predicting pixel values in a current picture from pixel values within a previous picture or a subsequent picture, an intra prediction technique for predicting pixel values in a region of a current picture from another region of the current picture, a transform and quantization technique for compressing the energy of a residual signal, and an entropy encoding technique for assigning shorter codes to frequently occurring pixel values and longer codes to less frequently occurring pixel values. With these video compression techniques, video data can be efficiently compressed, transmitted, and stored.
[0005] Deblocking filtering is intended to reduce blocking artifacts around a block boundary by performing vertical filtering and horizontal filtering on the block boundary. However, the problem of deblocking filtering is that it cannot minimize the distortion between an original picture and a reconstructed picture when filtering is performed on the block boundary.
[0006] Sample adaptive offset (SAO) is a method for reducing ringing artifacts by adding an offset to a certain sample after comparing a pixel value of the sample with pixel values of neighboring samples on a sample-by-sample basis or adding an offset to samples whose pixel values are within a certain pixel value range. SAO has the effect of reducing the distortion between an original picture and a reconstructed picture to some extent by using rate-distortion optimization. However, there is a limit in minimizing the distortion when the difference between the original picture and the reconstructed picture is large. SUMMARY
[0007] TECHNICAL PROBLEM
[0008] An object of the present application is to provide a video encoding / decoding method and apparatus using in-loop filtering.
[0009] Another object of the present application is to provide a method and apparatus for in-loop filtering using sub-sampling based block classification to reduce computational complexity and memory access bandwidth of a video encoder / decoder.
[0010] Another object of the present application is to provide a method and apparatus for in-loop filtering using multiple filter shapes to reduce computational complexity, memory capacity requirement, and memory access bandwidth of a video encoder / decoder.
[0011] Another object of the present application is to provide a recording medium storing a bitstream generated by a video encoding / decoding method or apparatus.
[0012] Technical Solution
[0013] A video decoding method according to the present application can include decoding filter information on a coding unit, classifying samples in the coding unit into classes on a per block classification unit basis, and filtering the coding unit having the samples classified into the classes on a per block classification unit basis by using the filter information.
[0014] In the video decoding method according to the present application, the method can further include assigning a block classification index to the coding unit having the samples classified into a class on a per block classification unit basis, wherein the block classification index is determined according to directionality information and activity information.
[0015] In the video decoding method according to the present application, wherein at least one of the directionality information and the activity information is determined based on gradient values for at least one of a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction.
[0016] In the video decoding method according to the present application, wherein the gradient values are obtained using one-dimensional Laplacian operations for each of the block classification units.
[0017] In the video decoding method according to the present application, wherein the one-dimensional Laplacian operations are one-dimensional Laplacian operations operating on positions that are sub-sampled positions.
[0018] In the video decoding method according to the present application, wherein the gradient values are determined based on a temporal layer identifier.
[0019] In the video decoding method according to the present application, wherein the filter information includes at least one piece of information selected from information on whether to perform filtering, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information on whether to use a fixed filter for a block classification index, and filter symmetry type information.
[0020] In the video decoding method according to the present application, wherein the filter shape information includes at least one of a diamond shape, a rectangular shape, a square shape, a trapezoidal shape, a diagonal line shape, a snowflake shape, a numeral symbol shape, a four-leaf clover shape, a cross shape, a triangular shape, a pentagonal shape, a hexagonal shape, an octagonal shape, a decagonal shape, and a dodecagonal shape.
[0021] In the video decoding method according to the present application, wherein the filter coefficient values include filter coefficient values for a geometric transform of the coding unit having the samples classified into the class based on each block classification unit.
[0022] In the video decoding method according to the present application, wherein the filter symmetry type information includes at least one of point symmetry, horizontal symmetry, vertical symmetry, and diagonal symmetry.
[0023] Further, a video encoding method according to the present application can include classifying samples of a coding unit into a class based on each block classification unit, filtering the coding unit having the samples classified into the class based on each block classification unit by using filter information on the coding unit, and encoding the filter information.
[0024] In the video encoding method according to the present application, the method can further include assigning a block classification index to the coding unit having the samples classified into the class based on each block classification unit, wherein the block classification index is determined based on directionality information and activity information.
[0025] In the video encoding method according to the present application, wherein at least one of the directionality information and the activity information is determined based on gradient values for at least one of a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction.
[0026] In the video encoding method according to the present application, wherein the gradient values are obtained using one-dimensional Laplacian operations for each of the block classification units.
[0027] In the video encoding method according to the present application, wherein the one-dimensional Laplacian operations are one-dimensional Laplacian operations for sub-sampled positions.
[0028] In the video encoding method according to the present application, wherein the gradient value is determined based on a temporal layer identifier.
[0029] In the video encoding method according to the present application, wherein the filter information includes at least one piece of information selected from information on whether to perform filtering, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information on whether to use a fixed filter for a block classification index, and filter symmetry type information.
[0030] In the video encoding method according to the present application, wherein the filter shape information includes at least one of a diamond shape, a rectangle shape, a square shape, a trapezoid shape, a diagonal line shape, a snowflake shape, a numeral symbol shape, a shamrock shape, a cross shape, a triangle shape, a pentagon shape, a hexagon shape, an octagon shape, a decagon shape, and a dodecagon shape.
[0031] In the video encoding method according to the present application, wherein the filter coefficient values include filter coefficients of a geometric transform for each of the block classification units of the coding unit.
[0032] Further, a computer-readable recording medium according to the present application can store a bitstream generated by the video encoding method according to the present application.
[0033] Advantageous Effects
[0034] According to the present application, a video encoding / decoding method and apparatus using in-loop filtering can be provided.
[0035] In addition, according to the present application, a method and apparatus using in-loop filtering based on sub-sampled block classification to reduce the computational complexity and memory access bandwidth of a video encoder / decoder can be provided.
[0036] In addition, according to the present application, a method and apparatus using in-loop filtering using a plurality of filter shapes to reduce the computational complexity, memory capacity requirement, and memory access bandwidth of a video encoder / decoder can be provided.
[0037] In addition, according to the present application, a recording medium storing a bitstream generated by the video encoding / decoding method or apparatus can be provided.
[0038] In addition, according to the present application, video encoding and / or decoding efficiency can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 is a block diagram illustrating a configuration of an encoding apparatus to which an embodiment of the present application is applied;
[0040] Figure 2is a block diagram showing a configuration of a decoding apparatus to which an embodiment of the present application is applied;
[0041] Figure 3 is a schematic diagram showing a picture partition structure for encoding / decoding a video;
[0042] Figure 4 is a diagram showing one embodiment of intra prediction processing;
[0043] Figure 5 is a diagram showing one embodiment of inter prediction processing;
[0044] Figure 6 is a diagram for describing a transform and quantization process.
[0045] Figure 7 is a flowchart showing a video decoding method according to an embodiment of the present application;
[0046] Figure 8 is a flowchart showing a video encoding method according to an embodiment of the present application;
[0047] Figure 9 is a diagram showing an exemplary method of determining gradient values for horizontal, vertical, first diagonal, and second diagonal directions;
[0048] Figures 10 to 12 is a diagram showing an exemplary method of determining gradient values for horizontal, vertical, first diagonal, and second diagonal directions based on sub-sampling;
[0049] Figures 13 to 18 is a diagram showing an exemplary method of determining gradient values for horizontal, vertical, first diagonal, and second diagonal directions based on sub-sampling;
[0050] Figures 19 to 30 is a diagram showing an exemplary method of determining gradient values for horizontal, vertical, first diagonal, and second diagonal directions at a certain sample position according to an embodiment of the present application;
[0051] Figure 31 is a diagram showing an exemplary method of determining gradient values for horizontal, vertical, first diagonal, and second diagonal directions when a temporal layer identifier indicates a top layer;
[0052] Figure 32 is a diagram showing various computing techniques that can be used instead of one-dimensional Laplacian operation according to an embodiment of the present application;
[0053] Figure 33 is a diagram showing a diamond filter according to an embodiment of the present application;
[0054] Figure 34 is a diagram illustrating a 5x5 tap filter according to an embodiment of the present application;
[0055] Figure 35a and Figure 35b is a diagram illustrating various filter shapes according to an embodiment of the present application;
[0056] Figure 36 is a diagram illustrating horizontal and vertical symmetric filters according to an embodiment of the present application;
[0057] Figure 37 is a diagram illustrating filters generated by geometric transformation of a square filter, an octagonal filter, a snowflake filter, and a diamond filter according to an embodiment of the present application;
[0058] Figure 38 is a diagram illustrating a process of transforming a diamond filter including 9x9 coefficients into a square filter including 5x5 coefficients; and
[0059] Figures 39 to 55d is a diagram illustrating an exemplary method of determining gradient values with respect to horizontal, vertical, first diagonal, and second diagonal directions based on sub-sampling. DETAILED DESCRIPTION
[0060] Various modifications can be made to the present application, and there are various embodiments of the present application, and examples of the various embodiments will now be provided with reference to the accompanying drawings and will be described in detail. However, the present application is not limited thereto, although the exemplary embodiments can be interpreted as including all modifications, equivalents, or substitutions within the technical concept and technical scope of the present application. Like reference numerals refer to the same or similar functions throughout. In the drawings, the shapes and sizes of elements can be exaggerated for clarity. In the following detailed description of the present application, reference is made to the accompanying drawings that illustrate a specific embodiment by which the present application can be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the disclosure. It is to be understood that various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics described herein in connection with one embodiment can be practiced in other embodiments without departing from the spirit and scope of the disclosure. In addition, it should be understood that the position or arrangement of individual elements within each disclosed embodiment can be modified without departing from the spirit and scope of the disclosure. Accordingly, the following detailed description is not to be interpreted in a limiting sense, and the scope of the present disclosure is only limited by the appended claims, along with the full range of equivalents that the claims are entitled to in the appropriate jurisdictions.
[0061] The terms "first", "second", etc. used in the specification can be used to describe various components, but the components are not construed as being limited by the terms. The terms are used only to distinguish one component from the other components. For example, a "first" component can be called a "second" component without departing from the scope of the present application, and a "second" component can also be similarly called a "first" component. The term "and / or" includes a combination of a plurality of items or any one of the plurality of items.
[0062] It will be understood that, in the specification, when an element is referred to as being "connected to" or "coupled to" another element, it can be "directly connected to" or "directly coupled to" the other element or connected or coupled to the other element with other elements in between. On the contrary, it should be understood that when an element is referred to as being "directly coupled to" or "directly connected to" another element, there are no other elements interposed therebetween.
[0063] Further, constituent components shown in the embodiments of the present application are independently shown in order to present different characteristic functions from each other. Therefore, this does not mean that each of the constituent components is composed of a separate hardware or software constituent unit. In other words, for convenience, each of the constituent components includes each of the enumerated constituent components. Therefore, at least two of the constituent components in each of the constituent components can be combined to form one constituent component, or one constituent component can be divided into a plurality of constituent components for performing each function. Embodiments in which each of the constituent components is combined and embodiments in which one constituent component is divided are also included in the scope of the present application without departing from the essence of the present application.
[0064] The terms used in the specification only serve to describe specific embodiments and are not intended to limit the present application. Expressions used in the singular include the plural, unless they have obvious different meanings in the context. In the specification, it will be understood that the terms such as "include", "has", "comprise", etc. are intended to indicate the existence of the features, numbers, steps, actions, elements, parts, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility of the existence or addition of one or more other features, numbers, steps, actions, elements, parts, or combinations thereof. In other words, when a certain element is referred to as "included", no other elements other than the corresponding element are excluded, but additional elements can be included in the embodiments of the present application or the scope of the present application.
[0065] Furthermore, some of the constituent elements can not be essential elements to perform the functions essential to the present application, but can be optional elements to improve the performance thereof. The present application can be implemented by including only the essential constituent elements to implement the essence of the present application, excluding the constituent elements used when improving the performance. A structure including only the essential constituent elements, excluding the optional elements used when improving the performance, is also included in the scope of the present application.
[0066] Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings. In describing the exemplary embodiments of the present application, a well-known function or construction will not be described in detail in order not to unnecessarily obscure the understanding of the present application. The same or similar components are denoted by the same reference numerals in the accompanying drawings, and repeated description of the same components will be omitted.
[0067] Hereinafter, an image can refer to a picture constituting a video, or can refer to a video itself. For example, "encoding or decoding or both encoding and decoding an image" can refer to "encoding or decoding or both encoding and decoding a moving picture", and can refer to "encoding or decoding or both encoding and decoding one of the pictures of a moving picture."
[0068] Hereinafter, the terms "moving picture" and "video" can be used as the same meaning and can be replaced with each other.
[0069] Hereinafter, a target image can be an encoding target image as an encoding target and / or a decoding target image as a decoding target. Furthermore, the target image can be an input image input to an encoding apparatus, and an input image input to a decoding apparatus. Here, the target image can have the same meaning as a current image.
[0070] Hereinafter, the terms "image", "picture", "frame", and "screen" can be used as the same meaning and can be replaced with each other.
[0071] Hereinafter, a target block can be an encoding target block as an encoding target and / or a decoding target block as a decoding target. Furthermore, the target block can be a current block as a target of current encoding and / or decoding. For example, the terms "target block" and "current block" can be used as the same meaning and can be replaced with each other.
[0072] Hereinafter, the terms "block" and "unit" can be used as the same meaning and can be replaced with each other. Or, "block" can mean a specific unit.
[0073] Hereinafter, the terms "region" and "segment" can be replaced with each other.
[0074] Hereinafter, a certain signal can be a signal representing a certain block. For example, an original signal can be a signal representing a target block. A prediction signal can be a signal representing a prediction block. A residual signal can be a signal representing a residual block.
[0075] In an embodiment, each of certain information, data, flag, index, element, and attribute, etc. can have a value. A value of information, data, flag, index, element, and attribute equal to "0" can represent a logical false or a first predefined value. In other words, the value "0", false, logical false, and the first predefined value can be replaced with each other. A value of information, data, flag, index, element, and attribute equal to "1" can represent a logical true or a second predefined value. In other words, the value "1", true, logical true, and the second predefined value can be replaced with each other.
[0076] When a variable i or j is used to represent a column, a row, or an index, a value of i can be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, a column, a row, an index, etc. can be counted from 0, or can be counted from 1.
[0077] Term Description
[0078] Encoder: denotes a device performing encoding. That is, denotes an encoding device.
[0079] Decoder: denotes a device performing decoding. That is, denotes a decoding device.
[0080] Block: is an array of samples of MxN. Here, M and N can denote a positive integer, and the block can denote an array of samples in a two-dimensional form. The block can refer to a unit. A current block can denote an encoding target block which becomes a target at the time of encoding, or a decoding target block which becomes a target at the time of decoding. Further, the current block can be at least one of an encoding block, a prediction block, a residual block, and a transform block.
[0081] Sample: is a basic unit constituting a block. According to a bit depth (Bd), a sample can be represented as a value from 0 to 2 Bd In the present invention, a sample can be used as a meaning of a pixel. That is, a sample, a pel, a pixel can have the same meaning as each other.
[0082] Unit: Can refer to a coding and decoding unit. When an image is coded and decoded, the unit can be a region generated by partitioning a single image. Also, when a single image is partitioned into sub-partitioned units during coding or decoding, the unit can mean a sub-partitioned unit. That is, an image can be partitioned into a plurality of units. When an image is coded and decoded, predetermined processing for each unit can be performed. A single unit can be partitioned into sub-units having sizes smaller than that of the unit. Depending on a function, the unit can mean a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, etc. Also, to distinguish the unit from a block, the unit can include a luma component block, a chroma component block associated with the luma component block, and syntax elements of each color component block. The unit can have various sizes and shapes, and specifically, the shape of the unit can be a two-dimensional geometric figure such as a square, a rectangle, a trapezoid, a triangle, a pentagon, etc. Also, unit information can include at least one of a unit type indicating a coding unit, a prediction unit, a transform unit, etc., and a unit size, a unit depth, an order of coding and decoding of the unit, etc.
[0083] Coding tree unit: A single coding tree block configured with a luma component Y and two coding tree blocks related to chroma components Cb and Cr. Also, the coding tree unit can mean to include a block and syntax elements of each block. Each coding tree unit can be partitioned by using at least one of a quad-tree partitioning method, a binary-tree partitioning method, and a ternary-tree partitioning method to configure lower-level units such as coding units, prediction units, transform units, etc. The coding tree unit can be used as a term for designating a block of samples that becomes a processing unit when an image as an input image is coded / decoded. Here, the quad-tree can mean a quad-ary tree.
[0084] Coding tree block: Can be used as a term for designating any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.
[0085] Neighbor block: Can mean a block neighboring a current block. The block neighboring the current block can mean a block contacting a boundary of the current block, or a block located within a predetermined distance from the current block. The neighbor block can mean a block neighboring a vertex of the current block. Here, the block neighboring the vertex of the current block can mean a block vertically neighboring a neighbor block horizontally neighboring the current block, or a block horizontally neighboring a neighbor block vertically neighboring the current block.
[0086] Reconstructed neighboring block: can denote a neighboring block that is adjacent to the current block and has been spatially / temporally encoded or decoded. Here, the reconstructed neighboring block can denote a reconstructed neighboring unit. The reconstructed spatial neighboring block can be a block within the current picture and has been reconstructed by encoding or decoding or both. The reconstructed temporal neighboring block is a block or a neighboring block of the block at a position corresponding to the current block of the current picture within the reference picture.
[0087] Unit depth: can denote a degree of partitioning of a unit. In a tree structure, the highest node (root node) can correspond to a first unit that is not partitioned. Also, the highest node can have a minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 can denote a unit generated by partitioning the first unit once. A node with a depth of level 2 can denote a unit generated by partitioning the first unit twice. A node with a depth of level n can denote a unit generated by partitioning the first unit n times. A leaf node can be a lowest node and is a node that cannot be further partitioned. The depth of the leaf node can be a maximum level. For example, a predefined value of the maximum level can be 3. The depth of the root node can be the lowest, and the depth of the leaf node can be the deepest. Also, when a unit is denoted as a tree structure, a level in which the unit exists can denote a unit depth.
[0088] Bitstream: can denote a bitstream including encoded image information.
[0089] Parameter set: corresponds to header information among configurations within a bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set can be included in the parameter set. Also, the parameter set can include slice header, parallel block group header, and parallel block header information. The term "parallel block group" denotes a group of parallel blocks and has the same meaning as a slice.
[0090] Parsing: can denote determining a value of a syntax element by performing entropy decoding, or can denote entropy decoding itself.
[0091] Symbol: can denote at least one of a syntax element, an encoding parameter, and a transform coefficient value of an encoding / decoding target unit. Also, the symbol can denote an entropy encoding target or an entropy decoding result.
[0092] Prediction mode: can be information indicating a mode encoded / decoded using intra prediction or a mode encoded / decoded using inter prediction.
[0093] Prediction unit: can mean a basic unit when performing prediction such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation. A single prediction unit can be partitioned into multiple partitions having smaller sizes, or can be partitioned into multiple lower-level prediction units. The multiple partitions can be basic units when performing prediction or compensation. The partitions generated by partitioning the prediction unit can also be prediction units.
[0094] Prediction unit partition: can mean a shape obtained by partitioning a prediction unit.
[0095] Reference picture list: can mean a list including one or more reference pictures used for inter prediction or motion compensation. There are several types of available reference picture lists including LC (list combination), L0 (list 0), L1 (list 1), L2 (list 2), L3 (list 3).
[0096] Inter prediction indicator: can mean a direction of inter prediction (uni-prediction, bi-prediction, etc.) of a current block. Alternatively, the inter prediction indicator can mean a number of reference pictures used to generate a prediction block of the current block. Alternatively, the inter prediction indicator can mean a number of prediction blocks used when performing inter prediction or motion compensation on the current block.
[0097] Prediction list utilization flag: can mean whether at least one reference picture in a specific reference picture list is used to generate a prediction block. The prediction list utilization flag can be used to derive the inter prediction indicator, and vice versa. For example, when the prediction list utilization flag has a first value of zero (0), it means that no reference picture in the reference picture list is used to generate the prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it means that the reference picture list is used to generate the prediction block.
[0098] Reference picture index: can mean an index indicating a specific reference picture in a reference picture list.
[0099] Reference picture: can mean a reference picture referred to by a specific block for the purpose of performing inter prediction or motion compensation on the specific block. Alternatively, the reference picture can be a picture including a reference block referred to by a current block for inter prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference image" have the same meaning and can be replaced with each other.
[0100] Motion vector: can be a two-dimensional vector used for inter prediction or motion compensation. The motion vector can mean an offset between a coding / decoding target block and a reference block. For example, (mvX, mvY) can mean a motion vector. Here, mvX can mean a horizontal component, and mvY can mean a vertical component.
[0101] A search range can be a two-dimensional region searched during inter prediction for retrieving a motion vector. For example, a size of the search range can be MxN. Here, M and N are each an integer.
[0102] A motion vector candidate can refer to a prediction candidate block or a motion vector of the prediction candidate block when a motion vector is predicted. Also, the motion vector candidate can be included in a motion vector candidate list.
[0103] A motion vector candidate list can denote a list consisting of one or more motion vector candidates.
[0104] A motion vector candidate index can denote an indicator indicating a motion vector candidate in a motion vector candidate list. Alternatively, the motion vector candidate index can be an index of a motion vector predictor.
[0105] Motion information can denote information including at least one of a motion vector, a reference picture index, an inter prediction indicator, a prediction list utilization flag, reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.
[0106] A merge candidate list can denote a list consisting of one or more merge candidates.
[0107] A merge candidate can denote a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-predictive merge candidate, or a zero merge candidate. The merge candidate can include motion information such as an inter prediction indicator, a reference picture index for each list, a motion vector, a prediction list utilization flag, and an inter prediction indicator.
[0108] A merge index can denote an indicator indicating a merge candidate in a merge candidate list. Alternatively, the merge index can indicate a block in which a merge candidate has been derived among reconstructed blocks spatially / temporally neighboring a current block. Alternatively, the merge index can indicate at least one piece of motion information of the merge candidate.
[0109] A transform unit: can denote a basic unit when encoding / decoding a residual signal such as a transform, an inverse transform, a quantization, a dequantization, a transform coefficient encoding / decoding. A single transform unit can be partitioned into a plurality of lower-level transform units having smaller sizes. Here, the transform / inverse transform can include at least one of a first transform / first inverse transform and a second transform / second inverse transform.
[0110] Scaling: can denote a process of multiplying a quantized level by a factor. A transform coefficient can be generated by scaling a quantized level. Scaling can also be referred to as dequantization.
[0111] Quantization parameter: can denote a value used when using a transform coefficient to generate a quantized level during quantization. The quantization parameter can also denote a value used when generating a transform coefficient by scaling a quantized level during inverse quantization. The quantization parameter can be a value mapped on a quantization step.
[0112] Delta quantization parameter: can denote a difference value between a predicted quantization parameter and a quantization parameter of a coding / decoding target unit.
[0113] Scan: can denote a method of ordering coefficients within a unit, a block, or a matrix. For example, changing a two-dimensional matrix of coefficients into a one-dimensional matrix can be referred to as a scan, and changing a one-dimensional matrix of coefficients into a two-dimensional matrix can be referred to as a scan or inverse scan.
[0114] Transform coefficient: can denote a coefficient value generated after performing a transform in an encoder. The transform coefficient can denote a coefficient value generated after performing at least one of entropy decoding and inverse quantization in a decoder. A quantized level obtained by quantizing a transform coefficient or a residual signal or a quantized transform coefficient level can also fall within the meaning of a transform coefficient.
[0115] Quantized level: can denote a value generated by quantizing a transform coefficient or a residual signal in an encoder. Alternatively, the quantized level can denote a value of an inverse quantization target that has undergone inverse quantization in a decoder. Similarly, a quantized transform coefficient level as a result of a transform and quantization can also fall within the meaning of a quantized level.
[0116] Non-zero transform coefficient: can denote a transform coefficient having a value other than zero, or a transform coefficient level or a quantized level having a value other than zero.
[0117] Quantization matrix: can denote a matrix used in a quantization process or an inverse quantization process performed to improve subjective image quality or objective image quality. The quantization matrix can also be referred to as a scaling list.
[0118] Quantization matrix coefficient: can denote each element within a quantization matrix. The quantization matrix coefficient can also be referred to as a matrix coefficient.
[0119] Default matrix: can denote a predetermined quantization matrix that is predefined in an encoder or a decoder.
[0120] Non-default matrix: can denote a quantization matrix that is not predefined in an encoder or a decoder but is signaled by a user.
[0121] Statistical value: a statistical value for at least one among a variable, a coding parameter, a constant value, etc., having a specific value that can be calculated can be one or more among an average value, a sum value, a weighted average value, a weighted sum value, a minimum value, a maximum value, a most frequently occurring value, a median value, an interpolated value.
[0122] Figure 1 is a block diagram illustrating a configuration of an encoding apparatus according to an embodiment to which the present application is applied.
[0123] The encoding apparatus 100 can be an encoder, a video encoding apparatus, or an image encoding apparatus. The video can include at least one image. The encoding apparatus 100 can sequentially encode the at least one image.
[0124] Referring to Figure 1 , the encoding apparatus 100 can include a motion prediction unit 111, a motion compensation unit 112, an intra prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, a dequantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.
[0125] The encoding apparatus 100 can perform encoding on an input image by using an intra mode or an inter mode or both the intra mode and the inter mode. Further, the encoding apparatus 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 can be streamed through a wired / wireless transmission medium. When the intra mode is used as a prediction mode, the switch 115 can be switched to the intra mode. Alternatively, when the inter mode is used as the prediction mode, the switch 115 can be switched to the inter mode. Here, the intra mode can denote an intra prediction mode, and the inter mode can denote an inter prediction mode. The encoding apparatus 100 can generate a prediction block for an input block of the input image. Further, the encoding apparatus 100 can encode a residual block using a residual of the input block and the prediction block after the prediction block is generated. The input image can be referred to as a current image which is a current encoding target. The input block can be referred to as a current block which is a current encoding target, or as an encoding target block.
[0126] When the prediction mode is the intra mode, the intra prediction unit 120 can use samples of a block which has been encoded / decoded and is adjacent to the current block as reference samples. The intra prediction unit 120 can perform spatial prediction on the current block by using the reference samples, or generate prediction samples of the input block by performing the spatial prediction. Here, the intra prediction can denote prediction within a frame.
[0127] When the prediction mode is the inter mode, the motion prediction unit 111 can retrieve a region that is most matched to the input block from a reference picture when performing motion prediction, and derive a motion vector by using the retrieved region. In this case, a search region can be used as the region. The reference picture can be stored in the reference picture buffer 190. Here, when encoding / decoding of the reference picture is performed, the reference picture can be stored in the reference picture buffer 190.
[0128] The motion compensation unit 112 can generate a prediction block by performing motion compensation on the current block by using the motion vector. Here, the inter prediction can mean prediction between frames or motion compensation.
[0129] When a value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 can generate a prediction block by applying an interpolation filter to a partial region of a reference picture. In order to perform inter-picture prediction or motion compensation on a coding unit, it can be determined which mode among a skip mode, a merge mode, an advanced motion vector prediction (AMVP) mode, and a current picture reference mode is used for motion prediction and motion compensation of a prediction unit included in the corresponding coding unit. Then, depending on the determined mode, inter-picture prediction or motion compensation can be differently performed.
[0130] The subtractor 125 can generate a residual block by using a residual of the input block and the prediction block. The residual block can be referred to as a residual signal. The residual signal can mean a difference between an original signal and a prediction signal. Also, the residual signal can be a signal generated by transforming or quantizing or transforming and quantizing a difference between the original signal and the prediction signal. The residual block can be a residual signal of a block unit.
[0131] The 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, the transform unit 130 can skip the transform on the residual block.
[0132] A quantized level can be generated by applying quantization to the transform coefficients or to the residual signal. Hereinafter, the quantized level can also be referred to as a transform coefficient in an embodiment.
[0133] The quantization unit 140 can generate a quantized level by quantizing the transform coefficients or the residual signal according to a parameter, and output the generated quantized level. Here, the quantization unit 140 can quantize the transform coefficients by using a quantization matrix.
[0134] The entropy encoding unit 150 can generate a bitstream by performing entropy encoding on the values calculated by the quantization unit 140 or on the encoding parameter values calculated when encoding is performed according to a probability distribution, and output the generated bitstream. The entropy encoding unit 150 can perform entropy encoding on the sample information of the image and information used to decode the image. For example, the information used to decode the image can include syntax elements.
[0135] When entropy encoding is applied, symbols are represented such that a smaller number of bits is allocated to symbols having a high generation probability, and a larger number of bits is allocated to symbols having a low generation probability, and thus, the size of a bitstream of the symbols to be encoded can be reduced. The entropy encoding unit 150 can use an encoding method for entropy encoding such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), or the like. For example, the entropy encoding unit 150 can perform entropy encoding by using a variable length coding / code (VLC) table. Also, the entropy encoding unit 150 can derive a binarization method of a target symbol and a probability model of the target symbol / binary bit, and perform arithmetic encoding by using the derived binarization method and context model.
[0136] In order to encode the transform coefficient levels (quantized levels), the entropy encoding unit 150 can change the coefficients in a two-dimensional block form to a one-dimensional vector form by using a transform coefficient scanning method.
[0137] The coding parameters can include information such as syntax elements (flags, indices, etc.) that are coded in the encoder and signaled to the decoder, and information derived when performing encoding or decoding. The coding parameters can represent information needed when encoding or decoding an image. For example, at least one value or combination of the following can be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether or not partitioning in a quad-tree form is performed, whether or not partitioning in a binary tree form is performed, partitioning direction in a binary tree form (horizontal direction or vertical direction), partitioning form in a binary tree form (symmetric partitioning or asymmetric partitioning), whether or not the current coding unit is partitioned by triple tree partitioning, triple tree partitioning direction (horizontal direction or vertical direction), triple tree partitioning type (symmetric type or asymmetric type), whether or not the current coding unit is partitioned by multi-type tree partitioning, multi-type tree partitioning direction (horizontal direction or vertical direction), multi-type tree partitioning type (symmetric type or asymmetric type), and multi-type tree partitioning tree (binary tree or triple tree) structure, prediction mode (intra prediction or inter prediction), luma intra prediction mode / direction, chroma intra prediction mode / direction, intra partition information, inter partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter tap, reference sample filter coefficient, prediction block filtering method, prediction block filter tap, prediction block filter coefficient, prediction block boundary filtering method, prediction block boundary filter tap, prediction block boundary filter coefficient, intra prediction mode, inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether or not to use merge mode, merge index, merge candidate, merge candidate list, whether or not to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation precision of motion vector, transform type, transform size, information whether or not first (primary) transform is used, information whether or not secondary transform is used, first transform index, secondary transform index, information whether or not residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether or not to apply intra loop filter, intra loop filter coefficient, intra loop filter tap, intra loop filter shape / form, whether or not to apply deblocking filter, deblocking filter coefficient, deblocking filter tap, deblocking filter strength, deblocking filter shape / form, whether or not to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset class, adaptive sample offset type, whether or not to apply adaptive loop filter, adaptive loop filter coefficient, adaptive loop filter tap, adaptive loop filter shape / form,binarization / de-binarization method, context model determination method, context model update method, whether to perform normal mode, whether to perform bypass mode, context bin, bypass bin, significant coefficient flag, last significant coefficient flag, coding flag for a unit of a coefficient group, position of last significant coefficient, flag as to whether a value of a coefficient is greater than 1, flag as to whether a value of a coefficient is greater than 2, flag as to whether a value of a coefficient is greater than 3, information on a residual coefficient value, sign information, reconstructed luma sample, reconstructed chroma sample, residual luma sample, residual chroma sample, luma transform coefficient, chroma transform coefficient, quantized luma level, quantized chroma level, transform coefficient level scanning method, size of a motion vector search region at a decoder side, shape of a motion vector search region at a decoder side, number of times of motion vector search at a decoder side, information on a CTU size, information on a minimum block size, information on a maximum block size, information on a maximum block depth, information on a minimum block depth, image display / output order, slice identification information, slice type, slice partition information, parallel block identification information, parallel block type, parallel block partition information, parallel block group indication information, parallel block group type, parallel block group partition information, picture type, bit depth of an input sample, bit depth of a reconstructed sample, bit depth of a residual sample, bit depth of a transform coefficient, bit depth of a quantized level, and information on a luma signal or information on a chroma signal.
[0138] Here, signaling a flag or an index can mean that the corresponding flag or index is entropy-encoded by an encoder and included in a bitstream, and can mean that the corresponding flag or index is entropy-decoded by a decoder from the bitstream.
[0139] When the encoding apparatus 100 performs encoding through inter prediction, the encoded current picture can be used as a reference picture for another picture which is subsequently processed. Accordingly, the encoding apparatus 100 can reconstruct or decode the encoded current picture, or store the reconstructed or decoded picture in the reference picture buffer 190 as a reference picture.
[0140] The quantized level can be dequantized in the dequantization unit 160, or can be inverse-transformed in the inverse transform unit 170. The coefficient which is dequantized or inverse-transformed or both can be added to the prediction block by the adder 175. By adding the coefficient which is dequantized or inverse-transformed or both to the prediction block, a reconstructed block can be generated. Here, the coefficient which is dequantized or inverse-transformed or both can mean a coefficient for which at least one of dequantization and inverse transformation is performed, and can mean a reconstructed residual block.
[0141] The reconstructed block can pass through a filter unit 180. The filter unit 180 can apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed sample, the reconstructed block, or the reconstructed picture. The filter unit 180 can be referred to as an in-loop filter.
[0142] The deblocking filter can remove blocking distortion generated in a boundary between blocks. In order to determine whether to apply the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on samples included in a number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter can be applied according to a required deblocking filter strength.
[0143] In order to compensate for encoding errors, a suitable offset value can be added to a sample value by using a sample adaptive offset. The sample adaptive offset can correct an offset of a deblocked picture from an original picture in units of samples. A method of applying an offset considering edge information about each sample can be used, or a method of partitioning samples of a picture into a predetermined number of regions, determining a region to which an offset is applied, and applying the offset to the determined region can be used.
[0144] The adaptive loop filter can perform filtering based on a comparison result of a filtered reconstructed picture and an original picture. Samples included in a picture can be partitioned into a predetermined group, a filter to be applied to each group can be determined, and differential filtering can be performed on each group. Information on whether to apply the ALF can be signaled through a coding unit (CU), and a form and coefficients of the ALF to be applied to each block can vary.
[0145] The reconstructed block or the reconstructed picture that has passed through the filter unit 180 can be stored in a reference picture buffer 190. The reconstructed block processed by the filter unit 180 can be a part of a reference picture. That is, the reference picture is a reconstructed picture composed of the reconstructed blocks processed by the filter unit 180. The stored reference picture can be used later at inter prediction or motion compensation.
[0146] Figure 2 FIG. 1 is a block diagram illustrating a configuration of a decoding apparatus according to an embodiment of the present application.
[0147] The decoding apparatus 200 can be a decoder, a video decoding apparatus, or a picture decoding apparatus.
[0148] Referring to Figure 2 The decoding apparatus 200 can include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, a summer 225, a filter unit 260, and a reference picture buffer 270.
[0149] The decoding apparatus 200 can receive a bitstream output from the encoding apparatus 100. The decoding apparatus 200 can receive a bitstream stored in a computer-readable recording medium, or can receive a bitstream being streamed through a wired / wireless transmission medium. The decoding apparatus 200 can decode the bitstream by using an intra mode or an inter mode. Furthermore, the decoding apparatus 200 can generate a reconstructed image or a decoded image produced by decoding, and output the reconstructed image or the decoded image.
[0150] When the prediction mode used at the time of decoding is the intra mode, the switch can be switched to the intra. Alternatively, when the prediction mode used at the time of decoding is the inter mode, the switch can be switched to the inter mode.
[0151] The decoding apparatus 200 can obtain a reconstructed residual block by decoding an input bitstream, and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding apparatus 200 can generate a reconstructed block that is a decoding target by adding the reconstructed residual block to the prediction block. The decoding target block can be referred to as a current block.
[0152] The entropy decoding unit 210 can generate a symbol by entropy-decoding a bitstream according to a probability distribution. The generated symbol can include a quantized level form of a symbol. Here, the entropy-decoding method can be an inverse process of the above-described entropy-encoding method.
[0153] In order to decode a transform coefficient level (quantized level), the entropy decoding unit 210 can change a coefficient in a one-dimensional vector form to a two-dimensional block form by using a transform coefficient scanning method.
[0154] The quantized level can be inverse-quantized in the inverse quantization unit 220, or can be inverse-transformed in the inverse transform unit 230. The quantized level can be a result of inverse-quantization or inverse-transformation, or both inverse-quantization and inverse-transformation, and can be generated as a reconstructed residual block. Here, the inverse quantization unit 220 can apply a quantization matrix to the quantized level.
[0155] When the intra mode is used, the intra prediction unit 240 can generate a prediction block by performing spatial prediction on the current block, in which the spatial prediction uses sample values of blocks adjacent to the decoding target block and already decoded.
[0156] When the inter mode is used, the motion compensation unit 250 can generate a prediction block by performing motion compensation on the current block, in which the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270.
[0157] The adder 225 can generate a reconstructed block by adding the reconstructed residual block to the prediction block. The filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or the reconstructed picture. The filter unit 260 can output the reconstructed picture. The reconstructed block or the reconstructed picture can be stored in the reference picture buffer 270 and used when performing inter prediction. The reconstructed block processed by the filter unit 260 can be a part of a reference picture. That is, the reference picture is a reconstructed picture composed of the reconstructed blocks processed by the filter unit 260. The stored reference picture can be used later when performing inter prediction or motion compensation.
[0158] Figure 3 FIG. 1 is a diagram schematically illustrating a partition structure of an image when encoding and decoding the image. Figure 3 FIG. 2 schematically illustrates an example of partitioning a single unit into a plurality of lower-level units.
[0159] To effectively partition an image, a coding unit (CU) can be used when encoding and decoding. The coding unit can be used as a basic unit when encoding / decoding an image. Also, the coding unit can be used as a unit for distinguishing an intra prediction mode from an inter prediction mode when encoding / decoding an image. The coding unit can be a basic unit for prediction, transform, quantization, inverse transform, dequantization, or encoding / decoding processing of transform coefficients.
[0160] Referring to Figure 3 , the image 300 is sequentially partitioned in a maximum coding unit (LCU) and the LCU unit is determined as a partition structure. Here, the LCU can be used in the same meaning as a coding tree unit (CTU). The unit partitioning can denote partitioning of a block associated with the unit. In the block partitioning information, information of a unit depth can be included. The depth information can denote either or both of a number or degree of partitioning of a unit or a number and degree of partitioning of a unit. A single unit can be partitioned into a plurality of lower-level units hierarchically associated with the depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning the unit can correspond to a node and child nodes of the node, respectively. Each of the partitioned lower-level units can have the depth information. The depth information can be information denoting a size of a CU and can be stored in each CU. The unit depth denotes a number and / or degree related to partitioning of a unit. Accordingly, the partitioning information of the lower-level units can include information on sizes of the lower-level units.
[0161] The partition structure can represent a distribution of coding units (CUs) within the LCU 310. The distribution can be determined according to whether a single CU is partitioned into a plurality of (a positive integer equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal and vertical sizes of the CUs generated by the partitioning can be half of the horizontal and vertical sizes of the CU before the partitioning, respectively, or can have sizes smaller than the horizontal and vertical sizes before the partitioning according to the number of times of the partitioning, respectively. The CU can be recursively partitioned into a plurality of CUs. At least one of the height and width of the CU after the partitioning can be reduced compared to at least one of the height and width of the CU before the partitioning by the recursive partitioning. The partitioning of the CU can be performed recursively until a predefined depth or a predefined size. For example, the depth of the LCU can be 0, and the depth of a smallest coding unit (SCU) can be a predefined maximum depth. Here, as described above, the LCU can be a coding unit having a maximum coding unit size, and the SCU can be a coding unit having a minimum coding unit size. The partitioning starts from the LCU 310, and the depth of the CU increases by 1 when the horizontal size or the vertical size, or both, of the CU is reduced by the partitioning. For example, the size of the CU that is not partitioned can be 2Nx2N for each depth. Also, in the case of the CU that is partitioned, the CU having a size of 2Nx2N can be partitioned into four CUs having a size of NxN. As the depth increases by 1, the size of N can be halved.
[0162] Also, information on whether the CU is partitioned can be represented by using partitioning information of the CU. The partitioning information can be 1-bit information. All CUs except for the SCU can include the partitioning information. For example, when the value of the partitioning information is 1, the CU can not be partitioned, and when the value of the partitioning information is 2, the CU can be partitioned.
[0163] Referring to Figure 3 The LCU having a depth of 0 can be a 64x64 block. 0 can be a minimum depth. The SCU having a depth of 3 can be an 8x8 block. 3 can be a maximum depth. The CUs of the 32x32 block and the 16x16 block can be represented as depths 1 and 2, respectively.
[0164] For example, when a single coding unit is partitioned into four coding units, the horizontal and vertical sizes of the partitioned four coding units can be half the size of the horizontal and vertical sizes of the CU before being partitioned. In one embodiment, when a coding unit having a size of 32x32 is partitioned into four coding units, each of the partitioned four coding units can have a size of 16x16. When a single coding unit is partitioned into four coding units, the coding unit can be said to be partitioned in a quad-tree form.
[0165] For example, when one coding unit is partitioned into two sub-coding units, each of the two sub-coding units can have a horizontal size or a vertical size (width or height) that is half of a horizontal size or a vertical size of the original coding unit. For example, when a coding unit having a size of 32x32 is vertically partitioned into two sub-coding units, each of the two sub-coding units can have a size of 16x32. For example, when a coding unit having a size of 8x32 is horizontally partitioned into two sub-coding units, each of the two sub-coding units can have a size of 8x16. When one coding unit is partitioned into two sub-coding units, the coding unit can be referred to as being bipartitioned, or partitioned according to a binary tree partitioning structure.
[0166] For example, when one coding unit is partitioned into three sub-coding units, a horizontal size or a vertical size of the coding unit can be partitioned in a ratio of 1:2:1, thereby resulting in three sub-coding units having a ratio of 1:2:1 in horizontal size or vertical size. For example, when a coding unit having a size of 16x32 is horizontally partitioned into three sub-coding units, the three sub-coding units can have sizes of 16x8, 16x16, and 16x8, in order from a topmost sub-coding unit to a bottommost sub-coding unit. For example, when a coding unit having a size of 32x32 is vertically partitioned into three sub-coding units, the three sub-coding units can have sizes of 8x32, 16x32, and 8x32, in order from a leftmost sub-coding unit to a rightmost sub-coding unit. When one coding unit is partitioned into three sub-coding units, the coding unit can be referred to as being tripartitioned, or partitioned according to a ternary tree partitioning structure.
[0167] In Figure 3 In the above-described example, the coding tree unit (CTU) 320 is an example of a CTU to which all of the quad-tree partitioning structure, the binary tree partitioning structure, and the ternary tree partitioning structure are applied.
[0168] As described above, in order to partition a CTU, at least one of the quad-tree partitioning structure, the binary tree partitioning structure, and the ternary tree partitioning structure can be applied. The various tree partitioning structures can be applied to the CTU sequentially according to a predetermined priority order. For example, the quad-tree partitioning structure can be applied to the CTU first. A coding unit that cannot be partitioned any more using the quad-tree partitioning structure can correspond to a leaf node of the quad-tree. The coding unit corresponding to the leaf node of the quad-tree can be used as a root node of the binary tree and / or the ternary tree partitioning structure. That is, the coding unit corresponding to the leaf node of the quad-tree can be further partitioned according to the binary tree partitioning structure or the ternary tree partitioning structure, or can not be further partitioned. Accordingly, by preventing a coding block resulting from binary tree partitioning or ternary tree partitioning of a coding unit corresponding to a leaf node of the quad-tree from being further quad-tree partitioned, a block partitioning operation and / or an operation of signaling partitioning information can be efficiently performed.
[0169] The fact that a coding unit corresponding to a node of a quadtree is partitioned can be signaled using quad-partition information. The quad-partition information having a first value (e.g., "1") can indicate that the current coding unit is partitioned according to a quadtree partition structure. The quad-partition information having a second value (e.g., "0") can indicate that the current coding unit is not partitioned according to a quadtree partition structure. The quad-partition information can be a flag having a predetermined length (e.g., one bit).
[0170] There can be no priority between binary tree partitioning and ternary tree partitioning. That is, a coding unit corresponding to a leaf node of a quadtree can be further partitioned by any of binary tree partitioning and ternary tree partitioning. Further, a coding unit resulting from binary tree partitioning or ternary tree partitioning can be further partitioned by binary tree partitioning or further partitioned by ternary tree partitioning, or can not be further partitioned.
[0171] A tree structure in which there is no priority between binary tree partitioning and ternary tree partitioning is referred to as a multi-type tree structure. A coding unit corresponding to a leaf node of a quadtree can serve as a root node of a multi-type tree. Whether a coding unit corresponding to a node of a multi-type tree is partitioned can be signaled using at least one of multi-type tree partitioning indication information, partition direction information, and partition tree information. In order to partition a coding unit corresponding to a node of a multi-type tree, the multi-type tree partitioning indication information, the partition direction information, and the partition tree information can be sequentially signaled.
[0172] The multi-type tree partitioning indication information having a first value (e.g., "1") can indicate that the current coding unit is to be partitioned by a multi-type tree partition. The multi-type tree partitioning indication information having a second value (e.g., "0") can indicate that the current coding unit is not to be partitioned by a multi-type tree partition.
[0173] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a multi-type tree partition structure, the coding unit can include partition direction information. The partition direction information can indicate in which direction the current coding unit is to be partitioned according to the multi-type tree partition. The partition direction information having a first value (e.g., "1") can indicate that the current coding unit is to be vertically partitioned. The partition direction information having a second value (e.g., "0") can indicate that the current coding unit is to be horizontally partitioned.
[0174] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a multi-type tree partition structure, the current coding unit can include partition tree information. The partition tree information can indicate a tree partition structure to be used for partitioning a node of a multi-type tree. The partition tree information having a first value (e.g., "1") can indicate that the current coding unit is to be partitioned according to a binary tree partition structure. The partition tree information having a second value (e.g., "0") can indicate that the current coding unit is to be partitioned according to a ternary tree partition structure.
[0175] The partition indication information, the partition tree information, and the partition direction information can each be a flag having a predetermined length (e.g., one bit).
[0176] At least any one of the quad-tree partition indication information, the multi-type tree partition indication information, the partition direction information, and the partition tree information can be entropy coded / entropy decoded. In order to entropy code / entropy decode those types of information, information about neighboring coding units adjacent to the current coding unit can be used. For example, it is highly likely that the partition type (partitioned or not partitioned, partition tree, and / or partition direction) of a left neighboring coding unit and / or an above neighboring coding unit of the current coding unit is similar to the partition type of the current coding unit. Thus, context information for entropy coding / entropy decoding information about the current coding unit can be derived from information about the neighboring coding units. The information about the neighboring coding units can include at least any one of the quad-tree partition information, the multi-type tree partition indication information, the partition direction information, and the partition tree information.
[0177] As another example, in the binary tree partition and the ternary tree partition, the binary tree partition can be preferentially performed. That is, the current coding unit can first undergo the binary tree partition, and then coding units corresponding to leaf nodes of the binary tree can be set as root nodes for the ternary tree partition. In this case, for coding units corresponding to nodes of the ternary tree, neither the quad-tree partition nor the binary tree partition can be performed.
[0178] A coding unit that cannot be partitioned according to the quad-tree partition structure, the binary tree partition structure, and / or the ternary tree partition structure becomes a basic unit for encoding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Thus, in a bitstream, there can be no partition structure information and partition information for partitioning a coding unit into prediction units and / or transformation units.
[0179] However, when the size of a coding unit (i.e., a basic unit for partitioning) is larger than the size of the maximum transform block, the coding unit can be recursively partitioned until the size of the coding unit is reduced to be equal to or smaller than the size of the maximum transform block. For example, when the size of the coding unit is 64x64 and when the size of the maximum transform block is 32x32, the coding unit can be partitioned into four 32x32 blocks for transform. For example, when the size of the coding unit is 32x64 and the size of the maximum transform block is 32x32, the coding unit can be partitioned into two 32x32 blocks for transform. In this case, the partitioning of the coding unit for transform is not signaled separately and can be determined by a comparison between the horizontal size or the vertical size of the coding unit and the horizontal size or the vertical size of the maximum transform block. For example, when the horizontal size (width) of the coding unit is larger than the horizontal size (width) of the maximum transform block, the coding unit can be vertically bisected. For example, when the vertical size (length) of the coding unit is larger than the vertical size (length) of the maximum transform block, the coding unit can be horizontally bisected.
[0180] Information of the maximum size and / or the minimum size of the coding unit and information of the maximum size and / or the minimum size of the transform block can be signaled or determined at a higher level of the coding unit. The higher level can be, for example, a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. For example, the minimum size of the coding unit can be determined to be 4x4. For example, the maximum size of the transform block can be determined to be 64x64. For example, the minimum size of the transform block can be determined to be 4x4.
[0181] Information of the minimum size of the coding unit corresponding to a leaf node of a quad tree (quad tree minimum size) and / or information of the maximum depth of a multi-type tree from a root node to a leaf node (maximum tree depth of the multi-type tree) can be signaled or determined at a higher level of the coding unit. For example, the higher level can be a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. The information of the minimum size of the quad tree and / or the information of the maximum depth of the multi-type tree can be signaled or determined for each of an intra slice and an inter slice.
[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 can be a sequence level, a picture level, a slice level, a parallel block group level, a parallel block level, or the like. Information of the maximum size of the coding unit corresponding to each node of the binary tree (hereinafter, referred to as the maximum size of the binary tree) 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 the slice. For example, for an intra slice, the maximum size of the ternary tree can be 32x32. For example, for an inter slice, the maximum size of the ternary tree can be 128x128. 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 to the minimum size of the coding block.
[0183] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree can be signaled or determined at the slice level. Alternatively, the minimum size of the binary tree and / or the minimum size of the ternary tree can be signaled or determined at the slice level.
[0184] According to the size information and the depth information of the various blocks described above, the quad partition information, the multi-type tree partitioning indication information, the partition tree information, and / or the partition direction information can or can not be included in the bitstream.
[0185] For example, when the size of the coding unit is not greater than the minimum size of the quad tree, the coding unit does not include the quad partition information. Thus, the quad partition information can be derived from the second value.
[0186] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is greater than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit can not be bi-partitioned or tri-partitioned. Thus, the multi-type tree partitioning indication information can not be signaled, but can be derived from the second value.
[0187] Optionally, the multi-type tree partitioning indication information can not be signaled, but can be derived from the second value, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or twice as large as the maximum size (horizontal size and vertical size) of the ternary tree. This is because, when partitioning the coding unit according to the binary tree partitioning structure and / or the ternary tree partitioning structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0188] Optionally, the multi-type tree partitioning indication information can not be signaled, but can be derived from the second value, when the depth of the coding unit corresponding to the node of the multi-type tree is equal to the maximum depth of the multi-type tree. This is because, when partitioning the coding unit according to the binary tree partitioning structure and / or the ternary tree partitioning structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0189] Optionally, the multi-type tree partitioning indication information can not be signaled, but can be derived from the second value, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or twice as large as the maximum size (horizontal size and vertical size) of the ternary tree. This is because, when partitioning the coding unit according to the binary tree partitioning structure and / or the ternary tree partitioning structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0190] Optionally, the partitioning direction information can not be signaled, but can be derived from a value indicating the possible partitioning directions, when both the vertical binary tree partitioning and the horizontal binary tree partitioning or both the vertical ternary tree partitioning and the horizontal ternary tree partitioning are feasible for the coding tree corresponding to the node of the multi-type tree. This is because, when partitioning the coding tree according to the binary tree partitioning structure and / or the ternary tree partitioning structure, a coding tree smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0191] Optionally, the partitioning tree information can not be signaled, but can be derived from a value indicating the possible partitioning tree structures, when both the vertical binary tree partitioning and the vertical ternary tree partitioning or both the horizontal binary tree partitioning and the horizontal ternary tree partitioning are feasible for the coding tree corresponding to the node of the multi-type tree. This is because, when partitioning the coding tree according to the binary tree partitioning structure and / or the ternary tree partitioning structure, a coding tree smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0192] Figure 4 is a diagram illustrating an intra prediction process.
[0193] Figure 4 The arrows from the center to the outside in the diagram of
[0194] Intra coding and / or decoding can be performed by using reference samples of neighboring blocks of a current block. The neighboring blocks can be reconstructed neighboring blocks. For example, the intra coding and / or decoding can be performed by using coding parameters or values of the reference samples included in the reconstructed neighboring blocks.
[0195] A prediction block can represent a block generated by performing intra prediction. The prediction block can correspond to at least one of a CU, a PU, and a TU. A unit of the prediction block can have a size of one of the CU, the PU, and the TU. The prediction block can be a square block having a size of 2x2, 4x4, 16x16, 32x32, or 64x64, etc., or can be a rectangular block having a size of 2x8, 4x8, 2x16, 4x16, and 8x16, etc.
[0196] Intra prediction can be performed according to an intra prediction mode for a current block. The number of the intra prediction modes that the current block can have can be a fixed value, and can be a value determined differently according to properties of the prediction block. For example, the properties of the prediction block can include a size of the prediction block and a shape of the prediction block, etc.
[0197] Regardless of the block size, the number of the intra prediction modes can be fixed to N. Alternatively, the number of the intra prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65, or 67, etc. Alternatively, the number of the intra prediction modes can vary according to the block size or the color component type or both the block size and the color component type. For example, the number of the intra prediction modes can vary according to whether the color component is a luma signal or a chroma signal. For example, as the block size becomes larger, the number of the intra prediction modes can increase. Alternatively, the number of the intra prediction modes for a luma component block can be greater than the number of the intra prediction modes for a chroma component block.
[0198] The intra prediction mode can be a non-angular mode or an angular mode. The non-angular mode can be a DC mode or a planar mode, and the angular mode can be a prediction mode having a specific direction or angle. The intra prediction mode can be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of the intra prediction modes can be M which is greater than or equal to 1, including the non-angular mode and the angular mode.
[0199] In order to perform intra prediction on a current block, a step of determining whether a sample included in a reconstructed neighboring block can be used as a reference sample of the current block can be performed. When there is a sample that cannot be used as the reference sample of the current block, a value obtained by copying or performing interpolation on at least one of the sample values of the samples included in the reconstructed neighboring block, or both copying and interpolation, can be used to replace the unavailable sample value of the sample, and thus the replaced sample value is used as the reference sample of the current block.
[0200] When intra prediction is performed, a filter can be applied to at least one of reference samples and prediction samples based on an intra prediction mode and a size of the current block.
[0201] In the case of the planar mode, when a prediction block of the current block is generated, depending on a position of a prediction target sample within the prediction block, a sample value of the prediction target sample can be generated by using a weighted sum of an upper reference sample and a left reference sample of the current sample and an upper right reference sample and a lower left reference sample of the current block. Also, in the case of the DC mode, when the prediction block of the current block is generated, an average of the upper reference sample and the left reference sample of the current block can be used. Also, in the case of the angular mode, the prediction block can be generated by using the upper reference sample, the left reference sample, the upper right reference sample, and / or the lower left reference sample of the current block. To generate the prediction sample value, interpolation can be performed on real number units.
[0202] An intra prediction mode of a current block can be entropy encoded / decoded by predicting an intra prediction mode of a block that exists adjacent to the current block. When the intra prediction modes of the current block and the adjacent block are the same, information that the intra prediction modes of the current block and the adjacent block are the same can be signaled by using predetermined flag information. Also, indicator information of an intra prediction mode that is the same as the intra prediction mode of the current block among intra prediction modes of a plurality of adjacent blocks can be signaled. When the intra prediction modes of the current block and the adjacent block are not the same, the intra prediction mode information of the current block can be entropy encoded / decoded by performing entropy encoding / decoding based on the intra prediction modes of the adjacent blocks.
[0203] Figure 5 is a diagram illustrating an embodiment of an inter prediction process.
[0204] In Figure 5 , a rectangle can represent a picture. In Figure 5 , an arrow indicates a prediction direction. Depending on an encoding type of a picture, the picture can be classified into an intra picture (I picture), a predicted picture (P picture), and a bi-predicted picture (B picture).
[0205] An I picture can be encoded by intra prediction without inter prediction. A P picture can be encoded by inter prediction by using a reference picture that exists in one direction (i.e., a forward direction or a backward direction) with respect to a current block. A B picture can be encoded by inter prediction by using reference pictures that exist in two directions (i.e., a forward direction and a backward direction) with respect to a current block. When inter prediction is used, an encoder can perform inter prediction or motion compensation, and a decoder can perform corresponding motion compensation.
[0206] Hereinafter, an embodiment of inter prediction will be described in detail.
[0207] Inter prediction or motion compensation can be performed using the reference picture and the motion information.
[0208] The motion information of the current block can be derived during inter prediction by each of the encoding apparatus 100 and the decoding apparatus 200. The motion information of the current block can be derived by using the motion information of the reconstructed neighboring block, the motion information of a collocated block (also referred to as a col block or a collocated block), and / or the motion information of a block neighboring the collocated block. The collocated block can denote a block spatially collocated within a previously reconstructed collocated picture (also referred to as a col picture or a collocated picture) with the current block. The collocated picture can be one of one or more reference pictures included in a reference picture list.
[0209] The method of deriving the motion information of the current block can vary according to a prediction mode of the current block. For example, as the prediction mode for inter prediction, there can be an AMVP mode, a merge mode, a skip mode, a current picture reference mode, etc. The merge mode can be referred to as a motion merge mode.
[0210] For example, when the AMVP is used as the prediction mode, at least one of the motion vector of the reconstructed neighboring block, the motion vector of the collocated block, the motion vector of the block neighboring the collocated block, and a (0, 0) motion vector can be determined as a motion vector candidate for the current block, and a motion vector candidate list is generated by using the motion vector candidate. The motion vector candidate of the current block can be derived by using the generated motion vector candidate list. The motion information of the current block can be determined based on the derived motion vector candidate. The motion vector of the collocated block or the motion vector of the block neighboring the collocated block can be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block can be referred to as a spatial motion vector candidate.
[0211] The encoding apparatus 100 can calculate a motion vector difference (MVD) between the motion vector of the current block and the motion vector candidate, and can perform entropy encoding on the motion vector difference (MVD). In addition, the encoding apparatus 100 can perform entropy encoding on a motion vector candidate index and generate a bitstream. The motion vector candidate index can indicate a best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding apparatus can perform entropy decoding on the motion vector candidate index included in the bitstream, and can select a motion vector candidate of a decoding target block from among the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. In addition, the decoding apparatus 200 can add the entropy-decoded MVD to the motion vector candidate extracted through the entropy decoding, thereby deriving the motion vector of the decoding target block.
[0212] The bitstream can include a reference picture index indicating a reference picture. The reference picture index can be entropy encoded by the encoding apparatus 100 and then signaled to the decoding apparatus 200 as the bitstream. The decoding apparatus 200 can generate a prediction block of a decoded target block based on the derived motion vector and the reference picture index information.
[0213] Another example of a method of deriving motion information of a current block can be a merge mode. The merge mode can denote a method of merging motion of a plurality of blocks. The merge mode can denote a mode of deriving motion information of a current block from motion information of neighboring blocks. When the merge mode is applied, a merge candidate list can be generated using motion information of reconstructed neighboring blocks and / or motion information of collocated blocks. The motion information can include at least one of a motion vector, a reference picture index, and an inter prediction indicator. The prediction indicator can indicate a uni-prediction (L0 prediction or L1 prediction) or bi-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 a zero merge candidate and new motion information, wherein the new motion information is motion information of one neighboring block adjacent to the current block (spatial merge candidate), motion information of a collocated block of the current block included in a reference picture (temporal merge candidate), and a combination of motion information existing in the merge candidate list.
[0215] The encoding apparatus 100 can generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and can signal the bitstream to the decoding apparatus 200. The merge flag can be information indicating whether the merge mode is performed for each block, and the merge index can be information indicating which of the neighboring blocks of the current block is a merge target block. For example, the neighboring blocks of the current block can include a left neighboring block disposed to the left of the current block, an above neighboring block disposed above the current block, and a temporal neighboring block adjacent in time to the current block.
[0216] The skip mode can be a mode of applying motion information of a neighboring block as it is to a current block. When the skip mode is applied, the encoding apparatus 100 can perform entropy encoding on information of a fact that which block's motion information is to be used as motion information of the current block to generate a bitstream, and can signal the bitstream to the decoding apparatus 200. The encoding apparatus 100 can not signal syntax elements regarding at least any one of motion vector difference information, a coded block flag, and transform coefficient levels to the decoding apparatus 200.
[0217] A current picture reference mode can represent a prediction mode in which a previously reconstructed region within a current picture to which the current block belongs is used for prediction. Here, a vector can be used to specify the previously reconstructed region. Information indicating whether the current block is to be encoded in the current picture reference mode can be encoded by using a reference picture index of the current block. A flag or index indicating whether the current block is a block encoded in the current picture reference mode can be signaled, and the flag or index can be derived based on the reference picture index of the current block. In a case where the current block is encoded in the current picture reference mode, the current picture can be added to a reference picture list for the current block so as to be located at a fixed position or an arbitrary position in the reference picture list. The fixed position can be, for example, a position indicated by a reference picture index 0, or a last position in the list. When the current picture is added to the reference picture list so as to be located at the arbitrary position, a reference picture index indicating the arbitrary position can be signaled.
[0218] Figure 6 is a diagram illustrating a transform and quantization process.
[0219] As shown in Figure 6 A transform process and / or a quantization process are performed on a residual signal to generate a quantized level signal. The residual signal is a difference between an original block and a prediction block (i.e., an intra-predicted block or an inter-predicted block). The prediction block is a block generated by intra-prediction or inter-prediction. The transform can be a primary transform, a secondary transform, or both the primary transform and the secondary transform. The primary transform of the residual signal generates transform coefficients, and the secondary transform of the transform coefficients generates secondary transform coefficients.
[0220] At least one scheme selected from various pre-defined transform schemes is used to perform the primary transform. For example, examples of the pre-defined transform schemes include a discrete cosine transform (DCT), a discrete sine transform (DST), and a Karhunen-Loève transform (KLT). The transform coefficients generated by the primary transform can be subjected to the secondary transform. The transform scheme used for the primary transform and / or the secondary transform can be determined according to an encoding parameter of the current block and / or a neighboring block of the current block. Alternatively, the transform scheme can be determined through signaling of transform information.
[0221] Since the residual signal is quantized by the first transform and the second transform, a quantized level signal (quantization coefficient) is generated. Depending on the intra prediction mode or the block size / shape of the block, the quantized level signal can be scanned according to at least one of diagonal up-right scanning, vertical scanning, and horizontal scanning. For example, when the coefficients are scanned according to diagonal up-right scanning, the coefficients in the form of a block become in the form of a one-dimensional vector. In addition to diagonal up-right scanning, horizontal scanning that horizontally scans the coefficients in the form of a two-dimensional block or vertical scanning that vertically scans the coefficients in the form of a two-dimensional block can be used depending on the intra prediction mode and / or size of the transformed block. The scanned quantized level coefficients can be entropy encoded to be inserted into a bitstream.
[0222] The decoder entropy-decodes the bitstream to obtain the quantized level coefficients. The quantized level coefficients can be arranged in the form of a two-dimensional block by inverse scanning. For the inverse scanning, at least one of diagonal up-right scanning, vertical scanning, and horizontal scanning can be used.
[0223] Then, the quantized level coefficients can be dequantized, and then, if necessary, a second inverse transform is performed, and finally, if necessary, a first inverse transform is performed, to generate a reconstructed residual signal.
[0224] Hereinafter, a method of in-loop filtering using sub-sampling-based block classification according to an embodiment of the present application will be described with reference to Figures 7 to 5 5.
[0225] In the present application, the in-loop filtering method includes deblocking filtering, sample adaptive offset (SAO), bilateral filtering, and adaptive in-loop filtering, etc.
[0226] By applying at least one of deblocking filtering and SAO to a reconstructed picture (i.e., a video frame) generated by summing a reconstructed intra / inter prediction block and a reconstructed residual block, it is possible to effectively reduce blocking artifacts and ringing artifacts within the reconstructed picture. Deblocking filtering is intended to reduce blocking artifacts around a block boundary by performing vertical filtering and horizontal filtering on the block boundary. However, deblocking filtering has a problem in that it cannot minimize distortion between an original picture and a reconstructed picture when the block boundary is filtered. Sample adaptive offset (SAO) is a filtering technique to reduce ringing artifacts by adding an offset to a certain sample after comparing a pixel value of the sample with pixel values of neighboring samples on a sample-by-sample basis, or by adding an offset to samples whose pixel values are within a certain pixel value range. SAO has an effect of reducing distortion between an original picture and a reconstructed picture to some extent by using rate-distortion optimization. However, there is a limitation in minimizing distortion when a difference between the original picture and the reconstructed picture is large.
[0227] Bi-directional filtering refers to a filtering technique that determines filter coefficients based on a distance from a center sample in a filtering target region to each of other samples in the filtering target region and based on a difference between a pixel value of the center sample and a pixel value of each of the other samples.
[0228] Adaptive in-loop filtering refers to a filtering technique that minimizes a distortion between an original picture and a reconstructed picture by using a filter that can minimize the distortion.
[0229] Unless specifically stated otherwise in the description of the present invention, in-loop filtering refers to adaptive in-loop filtering.
[0230] In the present invention, filtering refers to a process of applying a filter to at least one basic unit selected from a sample, a block, a coding unit (CU), a prediction unit (PU), a transform unit (TU), a coding tree unit (CTU), a slice, a parallel block, a group of parallel blocks (a parallel block group), a picture, and a sequence. The filtering includes at least one of a block classification process, a filter execution process, and a filter information encoding / decoding process.
[0231] In the present invention, a coding unit (CU), a prediction unit (PU), a transform unit (TU), and a coding tree unit (CTU) respectively have the same meaning as a coding block (CB), a prediction block (PB), a transform block (TB), and a coding tree block (CTB).
[0232] In the present invention, a block refers to at least one of a CU, a PU, a TU, a CB, a PB, and a TB used as a basic unit at the time of encoding / decoding processing.
[0233] The in-loop filtering is performed so that bi-directional filtering, deblocking filtering, sample adaptive offset, and adaptive in-loop filtering are sequentially applied to a reconstructed picture to generate a decoded picture. However, the order in which filtering schemes to be classified as in-loop filtering are applied to the reconstructed picture is varied.
[0234] For example, the in-loop filtering can be performed so that deblocking filtering, sample adaptive offset, and adaptive in-loop filtering are sequentially applied to the reconstructed picture in this order.
[0235] Alternatively, the in-loop filtering can be performed so that bi-directional filtering, adaptive in-loop filtering, deblocking filtering, and sample adaptive offset are sequentially applied to the reconstructed picture in this order.
[0236] Further alternatively, the in-loop filtering can be performed so that adaptive in-loop filtering, deblocking filtering, and sample adaptive offset are sequentially applied to the reconstructed picture in this order.
[0237] Further alternatively, the in-loop filtering can be performed such that the adaptive in-loop filtering, the sample adaptive offset and the deblocking filtering are sequentially applied to the reconstructed picture in this order.
[0238] In the present disclosure, a decoded picture refers to an output from performing in-loop filtering or post-processing filtering on a reconstructed picture composed of reconstructed blocks, wherein each reconstructed block is generated by summing a reconstructed residual block and a corresponding intra prediction block or summing a reconstructed block and a corresponding inter prediction block. In the present disclosure, the meaning of a decoded sample, a decoded block, a decoded CTU or a decoded picture is the same as that of a reconstructed sample, a reconstructed block, a reconstructed CTU or a reconstructed picture, respectively.
[0239] The adaptive in-loop filtering is performed on the reconstructed picture to generate a decoded picture. The adaptive in-loop filtering can be performed on the decoded picture that has already undergone at least one of the deblocking filtering, the sample adaptive offset and the bi-directional filtering. In addition, the adaptive in-loop filtering can be performed on the reconstructed picture that has already undergone the adaptive in-loop filtering. In this case, the adaptive in-loop filtering can be repeatedly performed N times on the reconstructed picture or the decoded picture. In this case, N is a positive integer.
[0240] The in-loop filtering can be performed on the decoded picture that has already undergone at least one of the in-loop filtering methods. For example, when at least one of the in-loop filtering methods is performed on the decoded picture that has already undergone at least one of the other in-loop filtering methods, a parameter for a latter filtering method can be changed, and then a former filtering can be performed on the decoded picture using the changed parameter. In this case, the parameter includes an encoding parameter, a filter coefficient, a number of filter taps (filter length), a filter shape, a filter type, a number of filtering executions, a filter strength, a threshold value and / or a combination of these parameters.
[0241] The filter coefficient indicates a coefficient constituting a filter. Alternatively, the filter coefficient indicates a coefficient value corresponding to a specific mask position in a mask form, and a reconstructed sample is multiplied by the coefficient value.
[0242] The number of filter taps refers to a length of a filter. When a filter is symmetrical with respect to one specific direction, the filter coefficients to be encoded / decoded can be reduced by half. In addition, the filter tap refers to a width (horizontal dimension) or a height (vertical dimension) of a filter. Alternatively, the filter tap refers to both a width (dimension in a transverse direction) and a height (dimension in a longitudinal direction) of a two-dimensional filter. In addition, the filter can be symmetrical with respect to two or more specific directions.
[0243] When the filter has a mask form, the filter can be a two-dimensional geometric figure having a square / diamond shape, a non-square rectangular shape, a square shape, a trapezoidal shape, a diagonal line shape, a snowflake shape, a numeral symbol shape, a shamrock shape, a cross shape, a triangular shape, a pentagonal shape, a hexagonal shape, an octagonal shape, a decagonal shape, a dodecagonal shape, or any combination of these shapes. Alternatively, the filter shape can be a shape obtained by projecting a three-dimensional figure onto a two-dimensional plane.
[0244] The filter type indicates a filter selected from among a Wiener filter, a low-pass filter, a high-pass filter, a linear filter, a non-linear filter, and a bidirectional filter.
[0245] In the present disclosure, a Wiener filter will be described in detail among various filters. However, the present disclosure is not limited thereto, and a combination of the above-described filters can be used in an embodiment of the present disclosure.
[0246] As a filter type for adaptive in-loop filtering, a Wiener filter can be used. The Wiener filter is an optimal linear filter for effectively removing noise, blur, and distortion within a picture, thereby improving coding efficiency. The Wiener filter is designed to minimize distortion between an original picture and a reconstructed / decoded picture.
[0247] At least one of the filtering methods can be performed at the time of encoding processing or decoding processing. The encoding processing or the decoding processing refers to encoding or decoding performed in units of at least one of a slice, a parallel block, a parallel block group, a picture, a sequence, a CTU, a block, a CU, a PU, and a TU. At least one of the filtering methods is performed during encoding or decoding performed in units of a slice, a parallel block, a parallel block group, a picture, and the like. For example, the Wiener filter is used for adaptive in-loop filtering during encoding or decoding. That is, in the phrase "adaptive in-loop filtering", the term "in-loop" indicates that filtering is performed during encoding or decoding processing. When adaptive in-loop filtering is performed, a decoded picture that has undergone adaptive in-loop filtering can be used as a reference picture when a subsequent picture is encoded or decoded. In this case, since intra prediction or motion compensation is performed on a subsequent picture to be encoded / decoded by referring to a reconstructed picture that has undergone adaptive in-loop filtering, coding efficiency of the subsequent picture and coding efficiency of a current picture that has undergone in-loop filtering can be improved.
[0248] In addition, at least one of the above-described filtering methods is performed when a CTU-based or block-based encoding or decoding process is performed. For example, a Wiener filter is used for adaptive in-loop filtering when a CTU-based or block-based encoding or decoding process is performed. That is, in the phrase "adaptive in-loop filtering", the term "in-loop" indicates that filtering is performed during a CTU-based or block-based encoding or decoding process. When adaptive in-loop filtering is performed on a per-CTU or per-block basis, a decoded CTU or block that has undergone adaptive in-loop filtering is used as a reference CTU or block for a subsequent CTU or block to be encoded / decoded. In this case, since intra prediction or motion compensation is performed on the subsequent CTU or block by referring to the current CTU or block to which adaptive in-loop filtering is applied, the coding efficiency of the current CTU or block to which in-loop filtering is applied is improved, and the coding efficiency of the subsequent CTU or block to be encoded / decoded is improved.
[0249] In addition, at least one of the filtering methods can be performed as post-processing filtering after a decoding process is performed. For example, a Wiener filter can be used as a post-processing filter after a decoding process is performed. When a Wiener filter is used after a decoding process, the Wiener filter is applied to a reconstructed / decoded picture before the reconstructed / decoded picture is output (i.e., displayed). When post-processing filtering is performed, a decoded picture that has undergone post-processing filtering can not be used as a reference picture for a subsequent picture to be encoded / decoded.
[0250] Adaptive in-loop filtering cannot be performed on a per-block basis. That is, block-based filter adaptation cannot be performed. Here, block-based filter adaptation indicates that different filters are selected for different blocks, respectively. Block-based filter adaptation also indicates block classification.
[0251] Figure 7 is a flowchart illustrating a video decoding method according to an embodiment of the present application.
[0252] Referring to Figure 7 , the decoder decodes filter information for each coding unit (S701).
[0253] The filter information is not limited to filter information on a per-coding unit basis. The filter information also indicates filter information on a per-slice, parallel block, parallel block group, picture, sequence, CTU, block, CU, PU, or TU basis.
[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 a fixed filter is used for a block classification index, and / or filter symmetry type information.
[0255] The filter shape information includes at least one shape selected from a diamond (square) shape, a rectangular shape, a square shape, a trapezoidal shape, a diagonal line shape, a snowflake shape, a numeral symbol shape, a shamrock shape, a cross shape, a triangular shape, a pentagonal shape, a hexagonal shape, an octagonal shape, a decagonal shape, and a dodecagonal shape.
[0256] The filter coefficient value includes a filter coefficient value of a geometric transform for each block classification unit.
[0257] On the other hand, examples of the filter symmetry type 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 a block classification index to the block classification unit in the coding unit.
[0259] The block classification is not limited to classification based on each coding unit. That is, the block classification can be performed in units of a slice, a parallel block, a parallel block group, a picture, a sequence, a CTU, a block, a CU, a PU, or a TU.
[0260] At least one of the directionality information and the activity information is determined based on the directionality information and the activity information.
[0261] At least one of the directionality information and the activity information is determined based on a gradient value with respect to at least one of a vertical, a horizontal, a first diagonal, and a second diagonal direction.
[0262] On the other hand, the gradient value is obtained based on each block classification unit using a one-dimensional Laplacian operation.
[0263] The one-dimensional Laplacian operation is preferably a one-dimensional Laplacian operation in which an operation position is a sub-sampled position.
[0264] Optionally, the gradient value can be determined according to a temporal layer identifier.
[0265] In addition, the decoder filters the coding unit on which the block classification has been performed based on each block classification unit by using the filter information (S703).
[0266] The filtering target unit is not limited to the coding unit. That is, the filtering can be performed in units of a slice, a parallel block, a parallel block group, a picture, a sequence, a CTU, a block, a CU, a PU, or a TU.
[0267] Figure 8 is a flowchart illustrating a video encoding method according to an embodiment of the present application;
[0268] Referring to Figure 8The encoder classifies the samples in the coding unit into classes based on each block classification unit (step S801). In addition, the encoder assigns a block classification index to the block classification unit in each coding unit.
[0269] The basic unit for block classification is not limited to a coding unit. That is, block classification can be performed in units of a slice, a parallel block, a parallel block group, a picture, a sequence, a CTU, a block, a CU, a PU, or a TU.
[0270] The block classification index is determined based on directionality information and activity information.
[0271] At least one of the directionality information and the activity information is determined based on gradient values with respect to at least one of a vertical, a horizontal, a first diagonal, and a second diagonal direction.
[0272] The gradient values are obtained based on each block classification unit using a one-dimensional Laplacian operation.
[0273] The one-dimensional Laplacian operation is preferably a one-dimensional Laplacian operation in which the operation position is a sub-sampled position.
[0274] Optionally, the gradient values are determined according to a temporal layer identifier.
[0275] In addition, the encoder filters the coding unit samples classified based on each block classification unit by using filter information of the coding unit (S802).
[0276] The basic unit for filtering is not limited to a coding unit. That is, filtering can be performed in units of a slice, a parallel block, a parallel block group, a picture, a sequence, a CTU, a block, a CU, a PU, or a TU.
[0277] The filter information includes information on whether to perform filtering, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information on whether to use a fixed filter for a block classification index, and / or filter symmetry type information.
[0278] Examples of the filter shape include at least one of a diamond (square) shape, a rectangular shape, a square shape, a trapezoidal shape, a diagonal shape, a snowflake shape, a numeral symbol shape, a shamrock shape, a cross shape, a triangular shape, a pentagonal shape, a hexagonal shape, an octagonal shape, a decagonal shape, and a dodecagonal shape.
[0279] The filter coefficient values include filter coefficient values that are geometrically transformed based on each block classification unit.
[0280] Next, the encoder encodes the filter information (S803).
[0281] The filter information is not limited to the filter information on a per coding unit basis. The filter information can be filter information on a per slice, parallel block, parallel block group, picture, sequence, CTU, block, CU, PU, or TU basis.
[0282] At the encoder side, the adaptive in-loop filtering process can be divided into several sub-steps, such as block classification, filtering, and filter information encoding.
[0283] More specifically, at the encoder side, the adaptive in-loop filtering can be divided into several sub-steps, such as block classification, filter coefficient derivation, filtering execution determination, filter shape determination, filtering execution, and filter information encoding. The filter coefficient derivation, filtering execution determination, and filter shape determination do not fall within the scope of the present application. Therefore, these sub-steps are not described in depth, but are merely briefly described. Thus, at the encoder side, the in-loop filtering process is divided into block classification, filtering, filter information encoding, etc.
[0284] At the filter coefficient derivation step, the Wiener filter coefficients that minimize the distortion between the original picture and the filtered picture are derived. In this case, the Wiener filter coefficients are derived on a per block classification basis. In addition, the Wiener filter coefficients are derived according to at least one of the number of filter taps and the filter shape. When the Wiener filter coefficients are derived, the autocorrelation function for the reconstructed samples, the cross-correlation function for the original samples and the reconstructed samples, the autocorrelation matrix, and the cross-correlation matrix can be derived. The filter coefficients are calculated by deriving the Wiener-Hopf equation based on the autocorrelation matrix and the cross-correlation matrix. In this case, the filter coefficients are obtained by calculating the Wiener-Hopf equation based on Gaussian elimination or Cholesky decomposition.
[0285] At the filtering execution determination step, whether to perform the adaptive in-loop filtering on a per slice, picture, parallel block, or parallel block group basis, whether to perform the adaptive in-loop filtering on a per block basis, or whether not to perform the adaptive in-loop filtering is determined according to rate-distortion optimization. Here, the rate includes the filter information to be encoded. The distortion is the difference between the original picture and the reconstructed picture or the difference between the original picture and the filtered reconstructed picture. The distortion is represented by mean square error (MSE), sum of squared error (SSE), sum of absolute difference, etc. At the filtering execution determination step, whether to perform filtering on a chroma component and whether to perform filtering on a luma component are determined.
[0286] At the filter shape determination step, when the in-loop adaptive filtering is applied, which filter shape to use, what tap number filter to use, etc. can be determined according to rate-distortion optimization.
[0287] In addition, at the decoder side, the adaptive in-loop filtering process is divided into the filter information decoding, block classification, and filtering steps.
[0288] Hereinafter, for the sake of avoiding redundant explanation, the filter information encoding step and the filter information decoding step will be collectively referred to as a filter information encoding / decoding step.
[0289] Hereinafter, the block classification step will be first described.
[0290] The block classification index is assigned on a block-by-block basis within the reconstructed picture, so that the blocks within the reconstructed picture can be classified into L classes. Here, the block classification index can be assigned not only to the reconstructed / decoded picture, but also to at least one of a reconstructed / decoded slice, a reconstructed / decoded parallel block group, a reconstructed / decoded parallel block, a reconstructed / decoded CTU, and a reconstructed / decoded block.
[0291] Here, N, M, and L are each a positive integer. For example, N and M are each a positive integer selected from 2, 4, 8, 16, and 32, and L is a positive integer selected from 4, 8, 16, 20, 25, and 32. When N and M are the same integer 1, the block classification is performed on a sample-by-sample basis rather than on a block-by-block basis. On the other hand, when N and M are different positive integers, the N x M size block is a non-square shape. Alternatively, N and M can be the same positive integer.
[0292] For example, a total of 25 block classification indexes can be assigned to the reconstructed picture on a 2 x 2 size block-by-block basis. For example, a total of 25 block classification indexes can be assigned to the reconstructed picture on a 4 x 4 size block-by-block basis.
[0293] The block classification index is a value in a range from 0 to L - 1, or can be a value in a range from 1 to L.
[0294] The block classification index C is determined based on at least one of a quantized activity value A of a directionality value D and an activity value A, and is represented by Equation 1. q
[0295] [Equation 1]
[0296] C = 5D + A q
[0297] In Equation 1, 5 is an exemplary constant value. The constant value can be represented by J. In this case, J is a positive integer having a value smaller than L.
[0298] For example, in one embodiment in which the block classification is performed on a 2 x 2 size block-by-block basis, the sum of the one-dimensional Laplacian gradient values for the vertical direction is represented by gv, and the sum of the one-dimensional Laplacian gradient values for the horizontal direction, a first diagonal direction (angle 135°), and a second diagonal direction (angle 45°) are represented by g h , g d1 , and g d2 The Laplacian operations in the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction are represented by Expression 2, Expression 3, Expression 4, and Expression 5, respectively. The directionality value D and the activity value A are derived by using the sum of the gradient values. In one embodiment, the sum of the gradient values is used. Alternatively, any statistical value of the gradient values can be used instead of the sum of the gradient values.
[0299] [Equation 2]
[0300]
[0301] [Equation 3]
[0302]
[0303] [Equation 4]
[0304]
[0305] [Equation 5]
[0306]
[0307] In Equations 2 to 5, i and j represent the coordinates of the upper-left position in the horizontal direction and the vertical direction, respectively, and R(i,j) represents the reconstructed sample value at position (i,j).
[0308] In Equations 2 to 5, k and l represent the horizontal operation range and the vertical operation range of the sum of the results V k,l , H k,l , D1 k,l , D2 k,l of the sample-based one-dimensional Laplacian operation for each direction, respectively. The result of the sample-based one-dimensional Laplacian operation for one direction represents the sample-based gradient value for the corresponding direction. That is, the result of the one-dimensional Laplacian operation represents the gradient value. The 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 the corresponding direction. In addition, the results of the one-dimensional Laplacian operations for the vertical, horizontal, first diagonal, and second diagonal directions are represented by V k,l , H k,l , D1 k,l , D2 k,l , respectively.
[0309] For example, k and l can be the same range. That is, the horizontal length and the vertical length of the operation range for which the one-dimensional Laplacian sum is calculated can be the same.
[0310] 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.
[0311] 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.
[0312] 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.
[0313] 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.
[0314] 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.
[0315] 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.
[0316] 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.
[0317] 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.
[0318] For example, in one embodiment of performing block classification for each 4×4 block, the sum of gradient values g with respect to the vertical direction, horizontal direction, first diagonal direction, and second diagonal direction is calculated based on the one-dimensional Laplacian operation via Equations 6, 7, 8, and 9. v g h g d1 g d2The directionality value D and the activity value A are derived by using a sum of gradient values. In one embodiment, a sum of gradient values is used. Alternatively, any statistical value of gradient values can be used instead of a sum of gradient values.
[0319] [Equation 6]
[0320]
[0321] [Equation 7]
[0322]
[0323] [Equation 8]
[0324]
[0325] [Equation 9]
[0326]
[0327] In Equations 6 to 9, i and j represent coordinates of a top-left position in a horizontal direction and a vertical direction, respectively, and R(i, j) represents a reconstructed sample value at a position (i, j).
[0328] In Equations 6 to 9, k and l represent a horizontal operation range and a vertical operation range for calculating a result V k,1 , H k,1 , D1 k,1 , D2 k,1 of a sample-based one-dimensional Laplacian operation for each direction. The result of the sample-based one-dimensional Laplacian operation for one direction represents a sample-based gradient value for the corresponding direction. That is, the result of the one-dimensional Laplacian operation represents a gradient value. The 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 a gradient value for the corresponding direction. In addition, the results of the one-dimensional Laplacian operations for the vertical, horizontal, first diagonal, and second diagonal directions are represented as V k,1 , H k,1 , D1 k,1 , D2 k,1 , respectively.
[0329] For example, k and l can be the same range. That is, a horizontal length and a vertical length of an operation range for calculating a sum of one-dimensional Laplacian operations can be the same.
[0330] Alternatively, k and l can be different ranges. That is, a horizontal length and a vertical length of an operation range for calculating a sum of one-dimensional Laplacian operations can be different.
[0331] As an example, k is a range from i-2 to i+5, and 1 is a range from j-2 to j+5. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 8x8 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is greater than the size of the block classification unit.
[0332] As another example, k is a range from i to i+3, and 1 is a range from j to j+3. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 4x4 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit.
[0333] For example, the operation range for calculating the sum of the results of the one-dimensional Laplacian operation has a two-dimensional geometric shape selected from a diamond, a rectangle, a square, a trapezoid, a diagonal line, a snowflake, a numeral symbol, a shamrock, a cross, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0334] For example, the operation range for calculating the sum of the one-dimensional Laplacian operation is SxT size. In this case, S and T are each zero or a positive integer.
[0335] For example, the block classification unit has a two-dimensional geometric shape selected from a diamond / square, a rectangle, a square, a trapezoid, a diagonal line, a snowflake, a numeral symbol, a shamrock, a cross, a triangle, a pentagon, a hexagon, an octagon, a decagon, and a dodecagon.
[0336] Figure 9 is a diagram illustrating an exemplary method of determining gradient values for horizontal, vertical, first diagonal, and second diagonal directions, respectively.
[0337] As shown in Figure 9 As shown in v h d1 d2 at least one of g v , g h , g d1 , g d2 Here, V, H, D1, and D2 respectively denote results of a sample-based one-dimensional Laplacian operation for a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction. That is, the one-dimensional Laplacian operation is performed for the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. Figure 9 In, a block classification index C is assigned to the shaded 4x4 size block. In this case, the operation range for calculating the one-dimensional Laplacian sum is greater than the size of the block classification unit. Here, the thin solid line rectangle denotes a reconstructed sample position, and the thick solid line rectangle denotes the operation range for calculating the one-dimensional Laplacian sum.
[0338] 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.
[0339] [Equation 10]
[0340]
[0341] [Equation 11]
[0342] g h =∑ k ∑ l H k,l H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)|,k=i-2,…,i+5,l=j-2,j,j+2,j+4
[0343] [Equation 12]
[0344] g d1 =∑ k ∑ l m k,l D1 k,l ,
[0345] D1 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)|,
[0346] k=i-2,…,i+5, l=j-2,…,j+5
[0347]
[0348] [Equation 13]
[0349] g d2 =∑ k ∑ l n k,l D2 k,l ,
[0350] D2 k,l= |2R(k,l) - R(k-1,l+1) - R(k+1,l-1)|,
[0351] k = i-2,..., i+5, l = j-2,..., j+5
[0352]
[0353] In Equation 10 to Equation 13, i and j represent coordinates of a top-left position in a horizontal direction and a vertical direction, respectively, and R(i,j) represents a reconstructed sample value at a position (i,j).
[0354] In Equation 10 to 13, k and l represent a horizontal operation range and a vertical operation range in which a sum of results V k,l , H k,l , D1 k,l , D2 k,l of sample-based one-dimensional Laplacian operations are calculated, respectively. The result of the sample-based one-dimensional Laplacian operation for one direction represents a sample-based gradient value for the corresponding direction. That is, the result of the one-dimensional Laplacian operation represents a gradient value. The 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 a gradient value for the corresponding direction. In addition, the results of the one-dimensional Laplacian operations for the vertical, horizontal, first diagonal, and second diagonal directions are represented as V k,l , H k,l , D1 k,l , D2 k,l , respectively.
[0355] For example, k and l can be the same range. That is, a horizontal length and a vertical length of an operation range in which a sum of one-dimensional Laplacian operations is calculated are the same.
[0356] Alternatively, k and l can be different ranges. That is, a horizontal length and a vertical length of an operation range in which a sum of one-dimensional Laplacian operations is calculated can be different.
[0357] As an 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, an operation range in which a sum of one-dimensional Laplacian operations is calculated is 8x8 size. In this case, the operation range in which the one-dimensional Laplacian sum is calculated is greater than the size of the block classification unit.
[0358] As another example, k is a range from i to i+3, and l is a range from j to j+3. In this case, an operation range in which a sum of one-dimensional Laplacian operations is calculated is 4x4 size. In this case, the operation range in which the sum of one-dimensional Laplacian operations is calculated is equal to the size of the block classification unit.
[0359] For example, the operation range in which the sum of the results of the one-dimensional Laplacian operation is calculated has a two-dimensional geometric shape selected from a diamond, a rectangle, a square, a trapezoid, a diagonal line, a snowflake, a numeral symbol, a four-leaf clover, a cross, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0360] For example, the operation range in which the sum of the results of the one-dimensional Laplacian operation is calculated has an SxT size. In this case, S and T are zero or a positive integer.
[0361] For example, the block classification unit has a two-dimensional geometric shape selected from a diamond / square, a rectangle, a square, a trapezoid, a diagonal line, a snowflake, a numeral symbol, a four-leaf clover, a cross, a triangle, a pentagon, a hexagon, an octagon, a decagon, and a dodecagon.
[0362] According to an embodiment of the present application, the sample-based gradient value calculation method can calculate a gradient value by performing a one-dimensional Laplacian operation on samples in an operation range in a corresponding direction. Here, a statistical value of the gradient value can be calculated by calculating a statistical value of the results of the one-dimensional Laplacian operation performed on at least one of the samples in the operation range in which the sum of the one-dimensional Laplacian operation is calculated. In this case, the statistical value is any one of a sum, a weighted sum, and an average.
[0363] For example, in order to calculate a gradient value for a horizontal direction, a one-dimensional Laplacian operation is performed at each sample position in an operation range in which the sum of the one-dimensional Laplacian operation is calculated. In this case, the gradient value for the horizontal direction can be calculated at intervals of P rows in the operation range in which the sum of the one-dimensional Laplacian operation is calculated. Here, P is a positive integer.
[0364] Alternatively, in order to calculate a gradient value for a vertical direction, a one-dimensional Laplacian operation is performed at each sample position on a column in an operation range in which the sum of the one-dimensional Laplacian operation is calculated. In this case, the gradient value for the vertical direction can be calculated at intervals of P columns in the operation range in which the sum of the one-dimensional Laplacian operation is calculated. Here, P is a positive integer.
[0365] Further alternatively, in order to calculate a gradient value for a first diagonal line direction, a one-dimensional Laplacian operation is performed on sample positions at intervals of P columns or Q rows in at least one of a horizontal direction and a vertical direction in an operation range in which the sum of the one-dimensional Laplacian operation is calculated, thereby obtaining the gradient value for the first diagonal line direction. Here, P and Q are zero or a positive integer.
[0366] Further alternatively, to calculate the gradient value for the second diagonal direction, the one-dimensional Laplacian operation is performed on the sample positions at intervals of P columns or Q rows in at least one of the horizontal direction and the vertical direction within the operation range for calculating the sum of the one-dimensional Laplacian operation, thereby obtaining the gradient value for the second diagonal direction. Here, P and Q are zero or positive integers.
[0367] According to embodiments of the present application, the sample-based gradient value calculation method can calculate the gradient value by performing the one-dimensional Laplacian operation on at least one sample within the operation range for calculating the sum of the one-dimensional Laplacian operation. Here, the statistical value of the gradient value can be calculated by calculating the statistical value of the result of the one-dimensional Laplacian operation performed on at least one of the samples within the operation range for calculating the sum of the one-dimensional Laplacian operation. In this case, the statistical value is any one of the sum, the weighted sum, and the average.
[0368] For example, to calculate the gradient value, the one-dimensional Laplacian operation is performed at each sample position within the operation range for calculating the sum of the one-dimensional Laplacian operation. In this case, the gradient value can be calculated at intervals of P rows within the operation range for calculating the sum of the one-dimensional Laplacian operation. Here, P is a positive integer.
[0369] Alternatively, to calculate the gradient value, the one-dimensional Laplacian operation is performed at each sample position on the column within the operation range for calculating the sum of the one-dimensional Laplacian operation. In this case, the gradient value can be calculated at intervals of P rows within the operation range for calculating the sum of the one-dimensional Laplacian operation. Here, P is a positive integer.
[0370] Further alternatively, to calculate the gradient value, the one-dimensional Laplacian operation is performed on the sample positions at intervals of P columns or Q rows in at least one of the horizontal direction and the vertical direction within the operation range for calculating the sum of the one-dimensional Laplacian operation, thereby obtaining the gradient value for the second diagonal direction. Here, P and Q are zero or positive integers.
[0371] Further alternatively, to calculate the gradient value, the one-dimensional Laplacian operation is performed on the sample positions at intervals of P columns or Q rows in at least one of the horizontal direction and the vertical direction within the operation range for calculating the sum of the one-dimensional Laplacian operation, thereby obtaining the gradient value for the second diagonal direction. Here, P and Q are zero or positive integers.
[0372] On the other hand, the gradient refers to at least one of a gradient with respect to the horizontal direction, a gradient with respect to the vertical direction, a gradient with respect to the first diagonal direction, and a gradient with respect to the second diagonal direction.
[0373] Figures 10 to 12 is a diagram illustrating a sub-sampling-based method of determining gradient values for horizontal, vertical, first diagonal, and second diagonal directions.
[0374] As shown in Figure 10 When block classification is performed based on each 2x2 stored block, at least one of sums g v , g h , g d1 , g d2 of gradient values for vertical, horizontal, first diagonal, and second diagonal directions can be calculated based on sub-sampling. Here, V, H, D1, and D2 respectively denote results of sample-based one-dimensional Laplacian operations for vertical, horizontal, first diagonal, and second diagonal directions. That is, one-dimensional Laplacian operations are performed for vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, positions at which one-dimensional Laplacian operations are performed are positions of sub-sampling. In Figure 10 , a block classification index C is assigned to a 2x2-sized block that is shaded. In this case, an operation range for calculating one-dimensional Laplacian sums is greater than a size of a block classification unit. Here, a thin solid rectangle denotes a reconstructed sample position, and a thick solid rectangle denotes an operation range for calculating one-dimensional Laplacian sums.
[0375] In the drawings of the present disclosure, positions not indicated by V, H, D1, or D2 are sample positions at which one-dimensional Laplacian operations are not performed in a direction. That is, one-dimensional Laplacian operations are performed in each direction only at sample positions indicated by V, H, D1, or D2. When a one-dimensional Laplacian operation is not performed, a result of the one-dimensional Laplacian operation at the corresponding sample position is determined as a certain value, for example, H. Here, H can be at least one of a negative integer, 0, and a positive integer.
[0376] As shown in Figure 11 When block classification is performed based on a 4x4-sized block, at least one of sums g v , g h , g d1 , g d2 of gradient values for vertical, horizontal, first diagonal, and second diagonal directions can be calculated based on sub-sampling. Here, V, H, D1, and D2 respectively denote results of sample-based one-dimensional Laplacian operations for vertical, horizontal, first diagonal, and second diagonal directions. That is, one-dimensional Laplacian operations are performed in vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, positions at which one-dimensional Laplacian operations are performed are positions of sub-sampling. In Figure 11 , a block classification index C is assigned to a 4x4-sized block that is shaded. In this case, an operation range for calculating one-dimensional Laplacian sums is greater than a size of a block classification unit. Here, a thin solid rectangle denotes a reconstructed sample position, and a thick solid rectangle denotes an operation range for calculating one-dimensional Laplacian sums.
[0377] As shown in Figure 12 When block classification is performed based on a 4x4 size block, the sum g of gradient values for vertical, horizontal, first diagonal, and second diagonal directions can be calculated based on sub-sampling as shown in v h d1 d2 Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations for vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed along the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, the positions at which the one-dimensional Laplacian operations are performed are the positions of sub-sampling. In Figure 12 In this case, the operation range for calculating the sum of one-dimensional Laplacian operations is equal to the size of the block classification unit. Here, the thin solid line rectangle represents the reconstructed sample positions, and the thick solid line rectangle represents the operation range for calculating the one-dimensional Laplacian sum.
[0378] According to an embodiment of the present application, a gradient value can be calculated by performing a one-dimensional Laplacian operation on a sample disposed at a specific position in an NxM size block based on sub-sampling. In this case, the specific position can be at least one of an absolute position and a relative position within the block. Here, a statistical value of the gradient value can be calculated by calculating a statistical value of the results of one-dimensional Laplacian operations performed on at least one of the samples within the operation range for calculating the one-dimensional Laplacian sum. In this case, the statistical value is any one of a sum, a weighted sum, and an average.
[0379] For example, the absolute position indicates a top-left position within the NxM block.
[0380] Alternatively, the absolute position indicates a bottom-right position within the NxM block.
[0381] Further alternatively, the relative position indicates a center position within the NxM block.
[0382] According to an embodiment of the present application, a gradient value can be calculated by performing a one-dimensional Laplacian operation on R samples within an NxM size block based on sub-sampling. In this case, P and Q are zero or positive integers. In addition, R is equal to or smaller than the product of N and M. Here, a statistical value of the gradient value can be calculated by calculating a statistical value of the results of one-dimensional Laplacian operations performed on at least one of the samples within the operation range for calculating the one-dimensional Laplacian sum. In this case, the statistical value is any one of a sum, a weighted sum, and an average.
[0383] For example, when R is 1, one-dimensional Laplacian operation is performed only on one sample within the NxM block.
[0384] Optionally, when R is 2, one-dimensional Laplacian operation is performed only on two samples within the NxM block.
[0385] Further optionally, when R is 4, one-dimensional Laplacian operation is performed only on 4 samples within each NxM-sized block.
[0386] According to embodiments of the present application, gradient values can be calculated by performing one-dimensional Laplacian operation on R samples within each NxM-sized block based on subsampling. In this case, R is a positive integer. Also, R is equal to or smaller than the product of N and M. Here, the statistical value of the gradient values is obtained by calculating a statistical value of results of one-dimensional Laplacian operation performed on at least one of the samples within the operation range for calculating one-dimensional Laplacian sum. In this case, the statistical value is any one of sum, weighted sum, and average.
[0387] For example, when R is 1, one-dimensional Laplacian operation is performed only on one sample within each NxM-sized block for which one-dimensional Laplacian sum is calculated.
[0388] Optionally, when R is 2, one-dimensional Laplacian operation is performed only on two samples within each NxM-sized block for which one-dimensional Laplacian sum is calculated.
[0389] Further optionally, when R is 4, one-dimensional Laplacian operation is performed only on 4 samples within each NxM-sized block for which one-dimensional Laplacian sum is calculated.
[0390] Figures 13 to 18 is a diagram illustrating an exemplary method for determining gradient values along horizontal, vertical, first diagonal, and second diagonal directions based on subsampling.
[0391] As Figure 13 illustrated in FIG. 6, when block classification is performed based on each 4x4-sized block, at least one of sums g v , g h , g d1 , g d2 for gradient values for vertical, horizontal, first diagonal, and second diagonal directions is calculated based on subsampling using samples at specific positions within each NxM-sized block. Here, V, H, D1, and D2 respectively denote results of one-dimensional Laplacian operation based on samples for vertical, horizontal, first diagonal, and second diagonal directions. That is, one-dimensional Laplacian operation is performed along the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, the positions at which one-dimensional Laplacian operation is performed can be positions of subsampling.Figure 13 In the case of FIG. 10B, the block classification index C is assigned to the 4x4 size block with a hatched pattern. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit. Here, the thin solid line rectangle represents the reconstructed sample position, and the thick solid line rectangle represents the operation range for calculating the sum of the one-dimensional Laplacian operation.
[0392] As shown in FIG. 11B, when the block classification is performed based on each 4x4 size block, the sum g Figure 14 of the gradient values for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using the samples at specific positions within each NxM size block based on the subsampling. Here, V, H, D1, and D2 represent the results of the sample-based one-dimensional Laplacian operation for the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, the one-dimensional Laplacian operation is performed along the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, the positions at which the one-dimensional Laplacian operation is performed can be the positions of the subsampling. In the case of FIG. 11B, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit. Here, the thin solid line rectangle represents the reconstructed sample position, and the thick solid line rectangle represents the operation range for calculating the sum of the one-dimensional Laplacian operation. v h d1 d2 of the gradient values for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using the samples at specific positions within each NxM size block based on the subsampling. Here, V, H, D1, and D2 represent the results of the sample-based one-dimensional Laplacian operation for the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, the one-dimensional Laplacian operation is performed along the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, the positions at which the one-dimensional Laplacian operation is performed can be the positions of the subsampling. In the case of FIG. 11B, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit. Here, the thin solid line rectangle represents the reconstructed sample position, and the thick solid line rectangle represents the operation range for calculating the sum of the one-dimensional Laplacian operation. Figure 14 In the case of FIG. 10B, the block classification index C is assigned to the 4x4 size block with a hatched pattern. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit. Here, the thin solid line rectangle represents the reconstructed sample position, and the thick solid line rectangle represents the operation range for calculating the sum of the one-dimensional Laplacian operation.
[0393] As shown in FIG. 11B, when the block classification is performed based on each 4x4 size block, the sum g Figure 15 of the gradient values for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using the samples at specific positions within each NxM size block based on the subsampling. Here, V, H, D1, and D2 represent the results of the sample-based one-dimensional Laplacian operation for the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, the one-dimensional Laplacian operation is performed along the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, the positions at which the one-dimensional Laplacian operation is performed can be the positions of the subsampling. In the case of FIG. 11B, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit. Here, the thin solid line rectangle represents the reconstructed sample position, and the thick solid line rectangle represents the operation range for calculating the sum of the one-dimensional Laplacian operation. v h d1 d2 of the gradient values for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using the samples at specific positions within each NxM size block based on the subsampling. Here, V, H, D1, and D2 represent the results of the sample-based one-dimensional Laplacian operation for the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, the one-dimensional Laplacian operation is performed along the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, the positions at which the one-dimensional Laplacian operation is performed can be the positions of the subsampling. In the case of FIG. 11B, the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the size of the block classification unit. Here, the thin solid line rectangle represents the reconstructed sample position, and the thick solid line rectangle represents the operation range for calculating the sum of the one-dimensional Laplacian operation. 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.
[0394] 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.
[0395] like Figure 17 As shown, when performing block classification based on 4×4 size blocks, the sum of gradient values g for the vertical, horizontal, first diagonal, and second diagonal directions can be calculated by using samples at specific locations within each N×M size block based on subsampling. v g h g d1 g d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Furthermore, the position where the one-dimensional Laplacian operation is performed can be the position of a subsample. Figure 17In 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.
[0396] 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.
[0397] Figures 19 to 30 This 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.
[0398] 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 h d1 d2 Here, V, H, D1, and D2 respectively denote results of one-dimensional Laplacian operation based on samples with respect to a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction. That is, one-dimensional Laplacian operations are respectively performed at positions V, H, D1, and D2 along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. In addition, the positions at which the one-dimensional Laplacian operations are performed can be positions of sub-sampling. In Figure 19 In this case, the operation range for calculating the one-dimensional Laplacian sum can be greater than the size of the block classification unit. Here, the thin solid rectangle denotes a reconstructed sample position, and the thick solid rectangle denotes the operation range for calculating the one-dimensional Laplacian sum.
[0399] As shown in Figure 19 , regardless of the direction of the one-dimensional Laplacian operation, the specific sample positions at which the one-dimensional Laplacian operation is performed are the same. In addition, as shown in Figure 19 , the pattern of the sample positions at which the one-dimensional Laplacian operation is performed can be referred to as a checkerboard pattern or a quincunx pattern. In addition, all of the sample positions at which the one-dimensional Laplacian operation is performed are even or odd sample positions in both a horizontal direction (X-axis direction) and a vertical direction (Y-axis direction) within the operation range for calculating the one-dimensional Laplacian sum within the block classification unit or the block unit.
[0400] As shown in Figure 20 , when block classification is performed based on a 4x4-sized block, at least one of the sum g v h d1 d2 Here, V, H, D1, and D2 respectively denote results of one-dimensional Laplacian operation based on samples with respect to a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction. That is, one-dimensional Laplacian operations are respectively performed at positions V, H, D1, and D2 along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. In addition, the positions at which the one-dimensional Laplacian operations are performed can be positions of sub-sampling. In Figure 20 In this case, the operation range for calculating the one-dimensional Laplacian sum can be greater than the size of the block classification unit. Here, the thin solid rectangle denotes a reconstructed sample position, and the thick solid rectangle denotes the operation range for calculating the one-dimensional Laplacian sum.
[0401] As shown in Figure 20 As shown in FIG. 10, the specific sample positions at which the sum of gradient values g Figure 20 As shown in FIG. 10, the pattern of sample positions at which the one-dimensional Laplacian calculation is performed can be referred to as a checkerboard pattern or a quincunx pattern. Also, the sample positions at which the one-dimensional Laplacian operation is performed are even or odd sample positions in both the horizontal direction (X-axis direction) and the vertical direction (Y-axis direction) within the one-dimensional Laplacian operation range of the block classification unit or the block unit.
[0402] As shown in FIG. 11, when block classification is performed based on a block of 4x4 size, at least one of the sum of gradient values g Figure 21 As shown in FIG. 11, when block classification is performed based on a block of 4x4 size, at least one of the sum of gradient values g v , g h , g d1 , g d2 is calculated at one or more specific sample positions. Here, V, H, D1, and D2 respectively denote the results of the sample-based one-dimensional Laplacian operation for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. That is, the one-dimensional Laplacian operation is performed along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction at positions V, H, D1, and D2, respectively. Also, the positions at which the one-dimensional Laplacian operation is performed can be sub-sampled positions. In Figure 21 In FIG. 12, a block classification index C is assigned to the 4x4 size block which is shaded. In this case, the operation range for calculating the one-dimensional Laplacian sum can be larger than the size of the block classification unit. Here, the thin solid line rectangle denotes the reconstructed sample positions, and the thick solid line rectangle denotes the operation range for calculating the one-dimensional Laplacian sum.
[0403] As shown in FIG. 13, when block classification is performed based on a block of 4x4 size, at least one of the sum of gradient values g Figure 22 As shown in FIG. 13, when block classification is performed based on a block of 4x4 size, at least one of the sum of gradient values g v , g h , g d1 , g d2 is calculated at one or more specific sample positions. Here, V, H, D1, and D2 respectively denote the results of the sample-based one-dimensional Laplacian operation for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. That is, the one-dimensional Laplacian operation is performed along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction at positions V, H, D1, and D2, respectively. Also, the positions at which the one-dimensional Laplacian operation is performed can be sub-sampled positions. In Figure 22 In FIG. 14, a block classification index C is assigned to the 4x4 size block which is shaded. In this case, the operation range for calculating the one-dimensional Laplacian sum can be larger than the size of the block classification unit. Here, the thin solid line rectangle denotes the reconstructed sample positions, and the thick solid line rectangle denotes the operation range for calculating the one-dimensional Laplacian sum.
[0404] As shown in Figure 23 When block classification is performed based on each 4x4 size block, at least one of sums g v , g h , g d1 , and g d2 of gradient values are calculated at one or more specific sample positions. Here, V, H, D1, and D2 respectively denote results of sample-based one-dimensional Laplacian operations for vertical, horizontal, first diagonal, and second diagonal directions. That is, one-dimensional Laplacian operations are performed along the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, the positions at which the one-dimensional Laplacian operations are performed can be sub-sampled positions. In Figure 23 , a block classification index C is assigned to the 4x4 size block which is hatched. In this case, the operation range for calculating the one-dimensional Laplacian sum can be equal to the size of the block classification unit. Here, the thin solid rectangle denotes the reconstructed sample position, and the thick solid rectangle denotes the operation range for calculating the sum of the one-dimensional Laplacian operations.
[0405] As shown in Figure 23 , regardless of the one-dimensional Laplacian operation direction, the specific sample positions at which the one-dimensional Laplacian operations are performed are the same. In addition, as shown in Figure 23 , the pattern of the sample positions at which the one-dimensional Laplacian operations are performed can be referred to as a checkerboard pattern or a quincunx pattern. In addition, in the one-dimensional Laplacian operation range in the block classification unit or the block unit, all of the sample positions at which the one-dimensional Laplacian operations are performed are even or odd sample positions in either one of or both of the horizontal (X-axis direction) and vertical (Y-axis direction).
[0406] As shown in Figure 24 When block classification is performed based on each 4x4 size block, at least one of sums g v , g h , g d1 , and g d2 of gradient values are calculated at one or more specific sample positions. Here, V, H, D1, and D2 respectively denote results of sample-based one-dimensional Laplacian operations for vertical, horizontal, first diagonal, and second diagonal directions. That is, one-dimensional Laplacian operations are performed along the vertical, horizontal, first diagonal, and second diagonal directions at positions V, H, D1, and D2, respectively. In addition, the positions at which the one-dimensional Laplacian operations are performed can be sub-sampled positions. In Figure 24In this case, the block classification index C is assigned to the 4x4 size block which is shaded. In this case, the operation range for calculating the one-dimensional Laplacian sum can be equal to the size of the block classification unit. Here, the thin solid line rectangle indicates the reconstructed sample position, and the thick solid line rectangle indicates the operation range for calculating the one-dimensional Laplacian sum.
[0407] As shown in Figure 24 , the specific sample position at which the one-dimensional Laplacian operation is performed is the same regardless of the one-dimensional Laplacian operation direction. Also, as shown in Figure 24 , the pattern of the sample position at which the one-dimensional Laplacian operation is performed can be referred to as a checkerboard pattern or a quincunx pattern. Also, the sample position at which the one-dimensional Laplacian operation is performed is an even or odd sample position in either one of the horizontal direction (X-axis direction) and the vertical direction (Y-axis direction) in the one-dimensional Laplacian operation range of the block classification unit or the block unit.
[0408] As shown in Figure 25 , when the block classification is performed based on each 4x4 size block, at least one of the sums g v , g h , g d1 , and g d2 of the gradient values is calculated at one or more specific sample positions. Here, V, H, D1, and D2 respectively indicate the results of the sample-based one-dimensional Laplacian operation with respect to the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. That is, the one-dimensional Laplacian operation is performed along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction at positions V, H, D1, and D2, respectively. Also, the positions at which the one-dimensional Laplacian operation is performed can be the positions of sub-sampling. In Figure 25 , the block classification index C is assigned to the 4x4 size block which is shaded. In this case, the operation range for calculating the one-dimensional Laplacian sum can be equal to the size of the block classification unit. Here, the thin solid line rectangle indicates the reconstructed sample position, and the thick solid line rectangle indicates the operation range for calculating the one-dimensional Laplacian sum.
[0409] As shown in Figure 26 , when the block classification is performed based on each 4x4 size block, at least one of the sums g v , g h , g d1 , and g d2 of the gradient values is calculated at one or more specific sample positions. Here, V, H, D1, and D2 respectively indicate the results of the sample-based one-dimensional Laplacian operation with respect to the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. That is, the one-dimensional Laplacian operation is performed along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction at positions V, H, D1, and D2, 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.
[0410] 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.
[0411] 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 d2 At least one of them. Here, V, H, D1, and D2 represent the results of sample-based one-dimensional Laplacian operations along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. That is, one-dimensional Laplacian operations are performed at positions V, H, D1, and D2 along the vertical, horizontal, first diagonal, and second diagonal directions, respectively. Figure 28 In this context, the block classification index C is assigned to a 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.
[0412] like Figure 29As 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.
[0413] 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 30 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.
[0414] 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.
[0415] 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.
[0416] [Equation 14]
[0417]
[0418] In Equation 14, dir denotes a horizontal direction, a vertical direction, a first diagonal direction, and a second diagonal direction, and g dir represents each of sums of gradient values along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. In addition, i and j respectively represent a horizontal position and a vertical position in a 2x2-sized block, and G dir represents each of results of one-dimensional Laplacian operations along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction.
[0419] In this case, in a case where the temporal layer identifier of the current picture (or the reconstructed picture) indicates the top layer, Equation 14 can be expressed as Equation 15 in a case where the block classification is performed on a per 2x2-sized block basis within the current picture (or the reconstructed picture).
[0420] [Equation 15]
[0421] g 2×2,dir = |G dir (i0, j0)|
[0422] In Equation 15, G dir (i0, j0) represents gradient values at a top-left position within a 2x2-sized block along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction.
[0423] Figure 31 is a diagram illustrating an exemplary method of determining gradient values along horizontal, vertical, first diagonal, and second diagonal directions for a case where the temporal layer identifier indicates the top layer.
[0424] Referring to Figure 31 , a sum g v , g h , g d1 , and g d2 of gradient values along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction is calculated.
[0425] According to an embodiment of the present invention, a statistical value of gradient values is calculated by calculating a weighted sum while applying a weight to a result of a one-dimensional Laplacian operation, which is performed on one or more samples within a range of a Laplacian sample calculation sample. In this case, at least one of a weighted average value, a median value, a minimum value, a maximum value, and a mode value can be used instead of the weighted sum.
[0426] Applying the weight or calculating the weighted sum can be determined based on various conditions or encoding parameters associated with the current block and the neighboring blocks.
[0427] For example, the weighted sum can be calculated in units of at least one of a sample, a group of samples, a line, and a block. In this case, the weighted sum can be calculated by changing the weight in units of at least one of a sample, a group of samples, a line, and a block.
[0428] For example, the weight can vary according to at least one of a size of the current block, a shape of the current block, and a position of the sample.
[0429] For example, the weighted sum can be calculated according to a condition preset in the encoder and the decoder.
[0430] For example, the weight is adaptively determined based on at least one of encoding parameters such as a size of a block, a shape of a block, and an intra prediction mode of at least one of the current block and a neighboring block.
[0431] For example, whether to calculate the weighted sum is adaptively determined based on at least one of encoding parameters such as a size of a block, a shape of a block, and an intra prediction mode of at least one of the current block and a neighboring block.
[0432] For example, when a calculation range of a sum of a one-dimensional Laplacian operation is greater than a size of a block classification unit, at least one of the weights applied to the samples within the block classification unit can be greater than at least one of the weights applied to the samples outside the block classification unit.
[0433] Alternatively, for example, when a calculation range of a sum of a one-dimensional Laplacian operation is equal to a size of a block classification unit, the weights applied to the samples within the block classification unit are all the same.
[0434] The information of the weight and / or whether to perform the weighted sum calculation can be entropy-encoded in the encoder and then signaled to the decoder.
[0435] According to an embodiment of the present invention, when each of sums g v , g h , g d1 , and g d2 of gradient values along a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction is calculated, padding is performed on an unavailable sample when one or more unavailable samples exist around a current sample, and the gradient value can be calculated using the padded sample. The padding refers to a method of copying a sample value of a neighboring available sample to the unavailable sample. Alternatively, a sample value or a statistical value obtained based on the sample value of the available sample adjacent to the unavailable sample can be used. The padding can be repeatedly performed with respect to P columns and R rows. Here, P and R are each a positive integer.
[0436] Here, the unavailable sample refers to a sample disposed outside a boundary of a CTU, a CTB, a slice, a parallel block, a parallel block group, or a picture. Alternatively, the unavailable sample can refer to a sample belonging to at least one of a CTU, a CTB, a slice, a parallel block, a parallel block group, and a picture, wherein the at least one of the CTU, the CTB, the slice, the parallel block, the parallel block group, and the picture is different from at least one of a CTU, a CTB, a slice, a parallel block, a parallel block group, and a picture to which the current sample belongs.
[0437] According to an embodiment of the present application, in calculating at least one of sums g v , g h , g d1 , and g d2 of gradient values along a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction, respectively, a predetermined sample can not be used.
[0438] For example, in calculating at least one of sums g v , g h , g d1 , and g d2 of gradient values along a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction, respectively, a padded sample can not be used.
[0439] Alternatively, for example, in calculating each of sums g v , g h , g d1 , and g d2 of gradient values along a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction, respectively, when there is one or more unavailable samples around the current sample, the unavailable sample can not be used for calculating the gradient value.
[0440] Further alternatively, for example, in calculating at least one of sums g v , g h , g d1 , and g d2 of gradient values along a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction, respectively, when a sample around the current sample is located outside a CTU or a CTB, a neighboring sample adjacent to the current sample can not be used.
[0441] According to an embodiment of the present application, in calculating at least one of one-dimensional Laplacian operation values, when there is one or more unavailable samples around the current sample, padding is performed so that a sample value of an available sample adjacent to the unavailable sample is copied to the unavailable sample, and the one-dimensional Laplacian operation is performed using the padded sample.
[0442] According to an embodiment of the present application, in one-dimensional Laplacian calculation, a predetermined sample can not be used.
[0443] For example, in the one-dimensional Laplacian calculation, the padded samples can not be used.
[0444] Optionally, for example, in the calculation of at least one of the one-dimensional Laplacian values, when there is one or more unavailable samples around the current sample, the one or more unavailable samples can not be used for the one-dimensional Laplacian operation.
[0445] Further optionally, for example, in the calculation of at least one of the one-dimensional Laplacian values, when the samples around the current sample are located outside the CTU or CTB, the neighboring samples can not be used for the one-dimensional Laplacian operation.
[0446] According to embodiments of the present application, in the calculation of each of the sums g v , g h , g d1 , and g d2 of the gradient values along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, or in the calculation of at least one of the one-dimensional Laplacian 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 can be used.
[0447] According to embodiments of the present application, in the calculation of at least one of the sums g v , g h , g d1 , and g d2 of the gradient values along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, or in the calculation of at least one of the one-dimensional Laplacian 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.
[0448] Optionally, in the calculation of at least one of the sums g v , g h , g d1 , and g d2 of the gradient values along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, or in the calculation of at least one of the one-dimensional Laplacian 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 not be applied to the corresponding samples.
[0449] According to embodiments of the present invention, when there is an unavailable sample arranged within an operation range for a one-dimensional Laplacian sum operation and arranged outside a CTU or a CTB, the unavailable sample can be used for the calculation of the one-dimensional Laplacian operation without applying at least one of a deblocking filter, an adaptive sample offset, and an adaptive in-loop filter.
[0450] According to embodiments of the present invention, when there is an unavailable sample within a block classification unit or outside a CTU or a CTB, a one-dimensional Laplacian operation can be performed without applying at least one of a deblocking filter, an adaptive sample offset, and an adaptive in-loop filter to the unavailable sample.
[0451] On the other hand, when calculating gradient values based on sub-sampling, a one-dimensional Laplacian operation is performed not on all samples within an operation range for which the one-dimensional Laplacian operation is calculated but on sub-samples within the operation range. Thus, the number of operations (such as multiplication, shift operation, addition, and absolute value operation) required for block classification can be reduced. In addition, the memory access bandwidth required using reconstructed samples can also be reduced. Thus, the complexity of the encoder and the decoder is also reduced. Specifically, because the time required for block classification can be reduced, performing a one-dimensional Laplacian operation on sub-sampled samples is beneficial in terms of hardware complexity of the encoder and the decoder.
[0452] In addition, when the operation range for which the sum of the one-dimensional Laplacian operation is calculated is equal to or smaller than the size of the block classification unit, the number of additions required for block classification can be reduced. In addition, the memory access bandwidth required using reconstructed samples can also be reduced. Thus, the complexity of the encoder and the decoder can also be reduced.
[0453] On the other hand, in the sub-sampling-based gradient value calculation method, at least one of the sum g v , g h , g d1 , and g d2 for the gradient values for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction is calculated by changing at least one of the sample position, the number of samples, and the direction of the sample position of the samples on which the one-dimensional Laplacian operation is performed according to the gradient values for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction.
[0454] In addition, in the sub-sampling-based gradient value calculation method, regardless of the gradient values for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, the sum g v , g h , g d1 , and gd2 at least one of g
[0455] In addition, by using an arbitrary combination of the one or more gradient values calculated above, a one-dimensional Laplacian operation can be performed with respect to the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction, and a sum g v , g h , g d1 , and g d2 of the gradient values with respect to the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction can be calculated.
[0456] According to an embodiment of the present invention, two or more values of the sum g v , g h , g d1 , and g d2 of the gradient values along the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction are compared with each other.
[0457] For example, after the sum of the gradient values is calculated, the sum g v of the gradient values with respect to the vertical direction is compared with the sum g h of the gradient values with respect to the horizontal direction, and a maximum value and a minimum value of the sum of the gradient values with respect to the vertical direction and the sum of the gradient values with respect to the horizontal direction are derived according to Equation 16.
[0458] [Equation 16]
[0459]
[0460] In this case, in order to compare the sum g v of the gradient values with respect to the vertical direction with the sum g h of the gradient values with respect to the horizontal direction, the values of the sums are compared according to Equation 17.
[0461] [Equation 17]
[0462]
[0463] Alternatively, for example, the sum g d1 of the gradient values with respect to the first diagonal direction is compared with the sum g d2 of the gradient values with respect to the second diagonal direction, and a maximum value and a minimum 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 are derived according to Equation 18.
[0464] [Equation 18]
[0465]
[0466] In this case, in order to compare the sum g d1 with the sum g d2 of gradient values for the second diagonal direction, the value of the sum g
[0467] [Equation 19]
[0468]
[0469] According to one embodiment of the present application, in order to calculate the directionality value D, the maximum value is compared with the minimum value using two threshold values t1 and t2 as follows.
[0470] The directionality value D is a positive integer or zero. For example, the directionality value D can be a value in the range from 0 to 4. For example, the directionality value D can be a value in the range from 0 to 2.
[0471] In addition, the directionality value D can be determined according to the characteristics of the region. For example, the directionality values Ds 0 to Ds 4 are expressed as follows: 0 indicates a texture region; 1 indicates strong horizontal / vertical directionality; 2 indicates weak horizontal / vertical directionality; 3 indicates strong first / second diagonal directionality; and 4 indicates weak first / second diagonal directionality. The directionality value D is determined through the steps described below.
[0472] Step 1: When the following conditions are satisfied and the value D is set to 0
[0473] Step 2: When the following condition is satisfied Step 3 is entered, and when it is not satisfied, Step 4 is entered
[0474] Step 3: When the following condition is satisfied the value D is set to 2, and when it is not satisfied, the value D is set to 1
[0475] Step 4: When the following condition is satisfied the value D is set to 4, and when it is not satisfied, the value D is set to 3
[0476] where the threshold values t1 and t2 are positive integers, and t1 and t2 can be the same value or different values. For example, t1 and t2 are 2 and 9, respectively. In another example, t1 and t2 are both 1. In another example, t1 and t2 are 1 and 9, respectively.
[0477] When block classification is performed based on a 2x2 size block, the activity value A can be expressed as Equation 20.
[0478] [Equation 20]
[0479]
[0480] For example, k and l are the same range. That is, the horizontal length and the vertical length of the operation range for calculating the sum of the one-dimensional Laplacian operation are equal.
[0481] Alternatively, for example, k and l are different ranges from each other. That is, the horizontal length and the vertical length of the operation range for calculating the sum of the one-dimensional Laplacian operation are different.
[0482] Further alternatively, 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 operation range for calculating the sum of the one-dimensional Laplacian operation is 6x6 size.
[0483] 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 operation range for calculating the sum of the one-dimensional Laplacian operation is 4x4 size.
[0484] Further alternatively, for example, k is a range from i to i+1, and l is a range from j to j+1. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 2x2 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation can be equal to the size of the block classification unit.
[0485] For example, the operation range for calculating the sum of the result of the one-dimensional Laplacian operation can have a two-dimensional geometric shape selected from a rhombus, a rectangle, a square, a trapezoid, a diagonal line, a snowflake, a numeral symbol, a shamrock, a cross, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0486] In addition, when the block classification is performed based on a 4x4 size block, the activity value A can be expressed as Equation 21.
[0487] [Equation 21]
[0488]
[0489] For example, k and l are the same range. That is, the horizontal length and the vertical length of the operation range for calculating the sum of the one-dimensional Laplacian operation are equal.
[0490] Alternatively, for example, k and l are different ranges from each other. That is, the horizontal length and the vertical length of the operation range for calculating the sum of the one-dimensional Laplacian operation are different.
[0491] 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 operation range for calculating the sum of the one-dimensional Laplacian operation is 8x8 size.
[0492] Further alternatively, for example, k is a range from i to i+3 and l is a range from j to j+3. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 4x4 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation can be equal to the size of the block classification unit.
[0493] For example, the operation range for calculating the sum of the result of the one-dimensional Laplacian operation can have a two-dimensional geometric shape selected from a rhombus, a rectangle, a square, a trapezoid, a diagonal line, a snowflake, a numeral symbol, a shamrock, a cross, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0494] In addition, when the block classification is performed based on a 2x2 size block, the activity value A can be expressed as Equation 22. Here, at least one of the one-dimensional Laplacian operation values for the first diagonal direction and the second diagonal direction can be additionally used for the calculation of the activity value A.
[0495] [Equation 22]
[0496]
[0497] For example, k and l are the same range. That is, the horizontal length of the operation range for calculating the sum of the one-dimensional Laplacian operation is equal to the vertical length.
[0498] Alternatively, for example, k and l are different ranges from each other. That is, the horizontal length of the operation range for calculating the sum of the one-dimensional Laplacian operation is different from the vertical length.
[0499] Further alternatively, 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 operation range for calculating the sum of the one-dimensional Laplacian operation is 6x6 size.
[0500] 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 operation range for calculating the sum of the one-dimensional Laplacian operation is 4x4 size.
[0501] Further alternatively, for example, k is a range from i to i+1 and l is a range from j to j+1. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation is 2x2 size. In this case, the operation range for calculating the sum of the one-dimensional Laplacian operation can be equal to the size of the block classification unit.
[0502] For example, the operation range of the sum of the results of the one-dimensional Laplacian operation can have a two-dimensional geometric shape selected from a diamond, a rectangle, a square, a trapezoid, a diagonal line, a snowflake, a numeral symbol, a shamrock, a cross, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0503] In addition, when the block classification is performed based on the 4x4 size block, the activity value A can be expressed as Equation 23. Here, at least one of the one-dimensional Laplacian operation values for the first diagonal direction and the second diagonal direction can be additionally used to calculate the activity value A.
[0504] [Equation 23]
[0505]
[0506] For example, k and l are the same range. That is, the horizontal length and the vertical length of the operation range of the sum of the one-dimensional Laplacian operation are equal.
[0507] Alternatively, for example, k and l are different ranges from each other. That is, the horizontal length and the vertical length of the operation range of the sum of the one-dimensional Laplacian operation are different.
[0508] 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 operation range of the sum of the one-dimensional Laplacian operation is 8x8 size.
[0509] Further alternatively, for example, k is a range from i to i+3, and l is a range from j to j+3. In this case, the operation range of the sum of the one-dimensional Laplacian operation is 4x4 size. In this case, the operation range of the sum of the one-dimensional Laplacian operation can be equal to the size of the block classification unit.
[0510] For example, the operation range of the sum of the results of the one-dimensional Laplacian operation can have a two-dimensional geometric shape selected from a diamond, a rectangle, a square, a trapezoid, a diagonal line, a snowflake, a numeral symbol, a shamrock, a cross, a triangle, a pentagon, a hexagon, a decagon, and a dodecagon.
[0511] On the other hand, the activity value A can be quantized to generate quantized activity values A q in a range from I to J. Here, I and J are each a positive integer or zero. For example, I and J are 0 and 4, respectively.
[0512] The quantized activity values A q may be determined using a predetermined method.
[0513] For example, the quantized activity values A qIn 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.
[0514] [Equation 24]
[0515]
[0516] 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.
[0517] 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.
[0518] 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.
[0519] 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.
[0520] 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 calculation method includes a two-dimensional Laplacian, a two-dimensional Sobel, a two-dimensional edge extraction, and a two-dimensional Gaussian Laplacian (LoG) operation. Here, the LoG operation indicates that a combination of a Gaussian filter and a Laplacian filter is applied to the reconstructed samples. In addition to these operation 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. Alternatively, a Difference of Gaussian (DoG) operation can be used. Here, the DoG operation indicates that a combination of Gaussian filters having different internal parameters is applied to the reconstructed samples.
[0521] In addition, in order to calculate the directionality value D or the activity value A, an LoG operation of an N x M size can be used. Here, M and L are each a positive integer. For example, at least one of a two-dimensional LoG of a 5 x 5 size as shown in (i) of FIG. 10 and a two-dimensional LoG operation of a 9 x 9 size as shown in (j) of FIG. 10 can be used. Figure 32 Figure 32 Alternatively, for example, a one-dimensional LoG operation can be used instead of a two-dimensional LoG operation.
[0522] According to an embodiment of the present invention, each 2 x 2 size block of the luminance block can be classified based on the directionality and the two-dimensional Laplacian activity. For example, horizontal / vertical gradient characteristics can be obtained by using a Sobel filter. The directionality value D can be obtained using Equations 25 to 26.
[0523] A representative vector can be calculated such that the condition of Equation 25 is satisfied for gradient vectors within a predetermined window size (e.g., a 6 x 6 size block). The direction and the deformation can be identified according to θ.
[0524] [Equation 25]
[0525]
[0526] The similarity between the representative vector and each gradient vector within the window can be calculated using an inner product as shown in Equation 26.
[0527] [Equation 26]
[0528]
[0529] The directionality value D can be determined using the S value calculated by Equation 26.
[0530] Step 1: When S > th1 is satisfied, the D value is set to 0.
[0531] Step 2: When θ ∈ (D0 or D1) and S > th2 are satisfied, the D value is set to 2, and when not satisfied, the D value is set to 1.
[0532] Step 3: When θ∈(V or H) and S<th2 are satisfied, the D value is set to 4, and when they are not satisfied, the D value is set to 3.
[0533] Here, the number of block classification indexes can be 25 in total.
[0534] According to an embodiment of the present application, the block classification of the reconstructed sample s'(i,j) can be represented by Equation 27.
[0535] [Equation 27]
[0536]
[0537] In Equation 27, I denotes a set of sample positions of all reconstructed samples s'(i,j). D is a classifier that assigns a classification index k∈{0,...,K-1} to a sample position (i,j). In addition, is a set of all samples to which a 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 a syntax element classification_idx signaled at the slice level. Given a class with a classification index k∈{0,...,K-1} The following steps are performed.
[0538] When classification_idx=0, a block classifier D G based on directionality and activity is used. The classifier can provide K=25 classes.
[0539] When classification_idx=1, a sample-based feature classifier D S is used as the classifier. D S (i,j) uses the quantized sample value of each of the samples s'(i,j) according to Equation 28.
[0540] [Equation 28]
[0541]
[0542] where B is the sample bit depth, the classification number K is set to 27 (K=27), and the operator designates the operation of rounding to the nearest integer.
[0543] When classification_idx=2, a sample-based feature classifier D based on ranking can be used as the classifier. is represented by Equation 30. r8(i,j) is a classifier that compares s'(i,j) with the neighboring 8 samples and arranges the samples in order of values.
[0544] [Equation 29]
[0545]
[0546] The value of the classifier r8(i,j) is in the range from 0 to 8. When the sample s'(i,j) is the largest sample in the 3x3 size 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.
[0547] [Equation 30]
[0548]
[0549] In Equation 30, T1 and T2 are predefined thresholds. That is, the sample dynamic range is divided into three bands, and the ordering of the local samples in each band is used as an additional criterion. The ordering-based sample-based feature classifier provides 27 classes (K=27).
[0550] When classification_idx=3, a classifier based on ordering and region variation is used Equation 31.
[0551] [Equation 31]
[0552]
[0553] In Equation 31, T3 or T4 is a predefined threshold. The local variation v(i,j) at each sample position (i,j) can be represented by Equation 32.
[0554] [Equation 32]
[0555] v(i,j) = 4 * s'(i,j) - (s'(i-1,j) + s'(i+1,j) + s'(i,j+1) + s'(i,j-1))
[0556] In addition to each sample being first classified into one of three classes based on the local variable |v(i,j)|, is the same classifier as Next, within each class, the ordering of the nearby local samples can be used as an additional criterion to provide 27 classes.
[0557] According to embodiments of the present application, at slice level, a filter set including up to 16 filters using three pixel classification methods such as intensity classifier, histogram classifier, and direction activity classifier is used for a current slice. At CTU level, based on a control flag in a signaled slice header, three modes including a new filter mode, a spatial filter mode, and a slice filter mode are used on a per-CTU basis.
[0558] Here, the intensity classifier is similar to the band offset of SAO. The sample intensity range is divided into 32 groups, and the group index for each sample is determined based on the intensity of the sample to be processed.
[0559] In addition, in the case of the similarity classifier, neighboring samples in a 5x5 diamond filter are compared with a filter target sample which is a sample to be filtered. The group index of the sample to be filtered can be initialized to 0. When the difference between the neighboring sample and the filter target sample is greater than a predefined threshold, the group index is increased by 1. Furthermore, when the difference between the neighboring sample and the filter target sample is greater than twice the predefined threshold, the group index is additionally added by one. In this case, the similarity classifier has 25 groups.
[0560] In addition, in the case of the Rot BA classifier, the calculation range of the sum of one-dimensional Laplacian operations for a 2x2 block is reduced from a 6x6 size to a 4x4 size. This classifier has up to 25 groups. There can be up to 25 groups or 32 groups among the plurality of classifiers. However, the number of filters in the slice filter set is limited to up to 16 groups. That is, the encoder merges consecutive groups so that the number of merged groups remains 16 or less.
[0561] According to embodiments of the present application, when determining a block classification index, the block classification index is determined based on at least one of encoding parameters of a current block and a neighboring block. The block classification index varies according to at least one of the encoding parameters. In this case, the encoding parameters include at least one of a prediction mode (i.e., whether prediction is intra prediction or inter prediction), an inter prediction mode, an intra prediction mode, an intra prediction indicator, a motion vector, a reference picture index, a quantization parameter, a block size of the current block, a block shape of the current block, a size of a block classification unit, and an encoding block flag / style.
[0562] In one example, the block classification is determined according to a quantization parameter. For example, when the quantization parameter is less than a threshold T, J block classification indexes are used. When the quantization parameter is greater than a threshold R, H block classification indexes are used. For other cases, G block classification indexes are used. Here, T, R, J, H, and G are positive integers or zero. Furthermore, J is greater than or equal to H. Here, the greater the quantization parameter value, the fewer the number of block classification indexes used.
[0563] In another example, the number of block classification is determined according to the size of the current block. For example, J block classification indices are used when the size of the current block is smaller than a threshold T. H block classification indices are used when the size of the current block is larger than a threshold R. G block classification indices are used for other cases. Here, T, R, J, H and G are positive integers or zero. In addition, J is larger than or equal to H. Here, the larger the size of the block, the fewer the number of block classification indices used.
[0564] In another example, the number of block classification is determined according to the size of the block classification unit. For example, J block classification indices are used when the size of the block classification unit is smaller than a threshold T. H block classification indices are used when the size of the block classification unit is larger than a threshold R. G block classification indices are used for other cases. Here, T, R, J, H and G are positive integers or zero. In addition, J is larger than or equal to H. Here, the larger the size of the block classification unit, the fewer the number of block classification indices used.
[0565] According to an embodiment of the present application, at least one of the sum of gradient values of co-located samples within a previous picture, 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 samples within the previous picture are spatially or adjacently located to the reconstructed samples in the current picture within the previous picture.
[0566] For example, when the difference between at least one of the sum of gradient values g v and g h for the vertical and horizontal directions of the current block unit and at least one of the sum of gradient values for the vertical and horizontal directions of the neighboring block classification units around the current block classification unit is equal to or smaller than a threshold E, at least one of the sum of gradient values g d1 and g d2 for the first and second diagonal directions of the neighboring block classification units of the current block classification unit is determined as at least one of the gradient values of the current block unit. Here, the threshold E is a positive integer or zero.
[0567] In another example, when the sum of the sum of gradient values g v and g h for the vertical and horizontal directions of the current block unit and the sum of the sum of gradient values for the vertical and horizontal directions of the neighboring block classification units around the current block classification unit is equal to or smaller than a threshold E, at least one of the sum of gradient values of the neighboring block classification units of the current block classification unit is determined as at least one of the sum of gradient values of the current block unit. Here, the threshold E is a positive integer or zero.
[0568] In another example, at least one of the sums of gradient values of neighboring block classification units around the current block classification unit is determined as at least one of the sums of gradient values of the current block unit, when a difference between at least one statistic value of the reconstructed samples within the current block unit and at least one statistic value of the reconstructed samples within the neighboring block classification units around the current block classification unit is equal to or smaller than a threshold value E. Here, the threshold value E is a positive integer or zero. The threshold value E is derived from spatial neighboring blocks and / or temporal neighboring blocks of the current block. Further, the threshold value E is a value predefined in the encoder and the decoder.
[0569] According to embodiments of the present application, at least one of the block classification index of the co-located samples within the previous picture, the block classification index of the neighboring blocks of the current block, and the block classification index of the neighboring block classification units 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.
[0570] For example, at least one of the sums of gradient values g v and g h for the vertical direction and the horizontal direction of the current block unit and at least one of the sums of gradient values for the vertical direction and the horizontal direction of the neighboring block classification units around the current block classification unit is equal to or smaller than a threshold value E, the block classification index of the neighboring block classification units around the current block classification unit is determined as the block classification index of the current block unit. Here, the threshold value E is a positive integer or zero.
[0571] Optionally, for example, a difference between the sum of the sums of gradient values g v and g h for the vertical direction and the horizontal direction of the current block unit and the sum of the sums of gradient values for the vertical direction and the horizontal direction of the neighboring block classification units around the current block classification unit is equal to or smaller than a threshold value E, the block classification index of the neighboring block classification units around the current block classification unit is determined as the block classification index of the current block unit. Here, the threshold value E is a positive integer or zero.
[0572] Further optionally, for example, at least one of the block classification index of the neighboring block classification units around the current block classification unit is determined as the block classification index of the current block unit, when a difference between at least one statistic value of the reconstructed samples within the current block unit and at least one statistic value of the reconstructed samples within the neighboring block classification units around the current block classification unit is equal to or smaller than a threshold value E. Here, the threshold value E is a positive integer or zero.
[0573] Further optionally, for example, at least one of the block classification index determination methods described above can be used to determine the block classification index.
[0574] In the following, the filter execution sub-step will be described.
[0575] According to an example embodiment of the present application, a filter corresponding to a determined block classification index is used to perform filtering on a sample or a block in a reconstructed / decoded picture. When performing filtering, one of L filters is selected. L is a positive integer or zero.
[0576] For example, one of L filters is selected based on each block classification unit, and filtering is performed on the reconstructed / decoded picture based on each reconstructed / decoded sample.
[0577] Optionally, for example, one of L filters is selected based on each block classification unit, and filtering is performed on the reconstructed / decoded picture based on each block classification unit.
[0578] Further optionally, for example, one of L filters is selected based on each block classification unit, and filtering is performed on the reconstructed / decoded picture based on each CU.
[0579] Further optionally, for example, one of L filters is selected based on each block classification unit, and filtering is performed on the reconstructed / decoded picture based on each block.
[0580] Further optionally, for example, U of L filters are selected based on each block classification unit, and filtering is performed on the reconstructed / decoded picture based on each reconstructed / decoded sample. Here, U is a positive integer.
[0581] Further optionally, for example, U of L filters are selected based on each block classification unit, and filtering is performed on the reconstructed / decoded picture based on each block classification unit. Here, U is a positive integer.
[0582] Further optionally, for example, U of L filters are selected based on each block classification unit, and filtering is performed on the reconstructed / decoded picture based on each CU. Here, U is a positive integer.
[0583] Further optionally, for example, U of L filters are selected based on each block classification unit, and filtering is performed on the reconstructed / decoded picture based on each block. Here, U is a positive integer.
[0584] Here, the L filters are referred to as a filter set.
[0585] According to an embodiment of the present application, the L filters differ from each other in at least one of filter coefficients, a number of filter taps (i.e., filter length), filter shape, and filter type.
[0586] For example, L filters are common in at least one of filter coefficients, number of filter taps (filter length), filter coefficients, filter shape, and filter type, in units of block, CU, PU, TU, CTU, slice, parallel block, parallel block group, picture, and sequence.
[0587] Optionally, L filters are common in at least one of filter coefficients, number of filter taps (filter length), filter shape, and filter type, in units of CU, PU, TU, CTU, slice, parallel block, parallel block group, picture, and sequence.
[0588] Filtering can be performed using the same filter or different filters in units of CU, PU, TU, CTU, slice, parallel block, parallel block group, picture, and sequence.
[0589] Filtering can or can not be performed based on filter execution information whether filtering is performed in units of sample, block, CU, PU, TU, CTU, slice, parallel block, parallel block group, picture, and sequence. The filter execution information whether filtering is performed is information signaled from an encoder to a decoder in units of sample, block, CU, PU, TU, CTU, slice, parallel block, parallel block group, picture, and sequence.
[0590] According to an embodiment of the present application, N filters using different number of filter taps and having the same filter shape (i.e., square or diamond filter shape) are used. Here, N is a positive integer. For example, in Figure 33 a diamond filter of 5x5, 7x7, or 9x9 filter taps is shown.
[0591] Figure 33 is a diagram showing a diamond filter according to an embodiment of the present application.
[0592] Referring to Figure 33 , in order to signal information of filters in three diamond filters of 5x5, 7x7, or 9x9 filter taps from an encoder to a decoder, filter indices are entropy coded / decoded on a per picture / parallel block / parallel block group / slice / sequence basis. That is, the filter indices are entropy coded / decoded in a sequence parameter set, a picture parameter set, a slice header, slice data, a parallel block header, a parallel block group header, a header, and the like in a bitstream.
[0593] According to an embodiment of the present application, when the number of filter taps is fixed to 1 in an encoder / decoder, the encoder / decoder performs filtering using filter indices without entropy coding / decoding the filter indices. Here, a diamond filter of 7x7 filter taps is used for a luma component, and a diamond filter of 5x5 filter taps is used for a chroma component.
[0594] According to embodiments of the present application, at least one of the three diamond filters is used for filtering at least one reconstructed / decoded sample of at least one of the luma component and the chroma component.
[0595] For example, at least one of the three diamond type filters shown in Figure 33 is used for filtering the reconstructed / decoded luma samples.
[0596] Optionally, for example, the 5x5 diamond shaped filter shown in Figure 33 is used for filtering the reconstructed / decoded chroma samples.
[0597] Further optionally, for example, the filter used for filtering the luma samples is used for filtering the reconstructed / decoded chroma samples corresponding to the luma samples.
[0598] In addition, the numbers in each filter shape shown in Figure 33 indicate filter coefficient indices, and the filter coefficient indices are symmetric with respect to the filter center. That is, the filter shown in Figure 33 is a point-symmetric filter.
[0599] On the other hand, in the case of the 9x9 diamond filter shown in (a) of Figure 33 , a total of 21 filter coefficients are entropy encoded / decoded, in the case of the 7x7 diamond filter illustrated in (b) of Figure 33 , a total of 13 filter coefficients are entropy encoded / decoded, and in the case of the 5x5 diamond filter illustrated in (c) of Figure 33 , a total of 7 filter coefficients are entropy encoded / decoded. That is, at most 21 filter coefficients need to be entropy encoded / decoded.
[0600] Furthermore, for the 9x9 diamond filter shown in (a) of Figure 33 , a total of 21 multiplications are needed per sample, for the 7x7 diamond filter shown in (b) of Figure 33 , a total of 13 multiplications are needed per sample, and for the 5x5 diamond filter shown in (c) of Figure 33 , a total of 7 multiplications are needed per sample. That is, at most 21 multiplications are used per sample to perform filtering.
[0601] In addition, as shown in (a) of Figure 33 , since the size of the 9x9 diamond filter is 9x9, four line buffers for half the length of the vertical filter are needed for hardware implementation. That is, at most four line buffers are needed.
[0602] According to embodiments of the present application, the filters have the same filter length representing 5x5 filter taps, but can have different filter shapes selected from a diamond, a rectangle, a square, a trapezoid, a diagonal, a snowflake, a numeral symbol, a shamrock, a cross, a triangle, a pentagon, a hexagon, an octagon, a decagon, and a dodecagon. For example, square, octagonal, snowflake, and diamond filters with 5x5 filter taps are shown in Figure 33
[0603] The number of filter taps is not limited to 5x5. Filters with HxV filter taps selected from 3x3, 4x4, 5x5, 6x6, 7x7, 8x8, 9x9, 5x3, 7x3, 9x3, 7x5, 9x5, 9x7, and 11x7 can be used. Here, H and V are positive integers and are the same value or different values. In addition, at least one of H and V is a value predefined in the encoder / decoder and a value signaled from the encoder to the decoder. In addition, one of H and V is defined using the other of H and V. Furthermore, a final value of H or V can be defined using a value of H or V.
[0604] On the other hand, in order to signal information of which filter among the filters shown in Figure 34
[0605] On the other hand, at least one filter among the square, octagonal, snowflake, and diamond filters shown in Figure 34
[0606] On the other hand, the numbers in each filter shape shown in Figure 34 Figure 34
[0607] According to embodiments of the present application, when filtering a reconstructed picture on a per-sample basis, which filter shape to use for each picture, slice, tile, or tile group can be determined in terms of rate-distortion optimization in the encoder. In addition, filtering is performed using the determined filter shape. As Figure 34 The optimal filter shape among the filter shapes shown in FIG. 1 is determined for each picture, slice, parallel block, or parallel block group, 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. That is, the optimal filter shape is determined differently depending on the video resolution, the video characteristics, the bit rate, and the like. Figure 34 The optimal filter shape among the filter shapes shown in FIG. 1 is determined for each picture, slice, parallel block, or parallel block group, 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. That is, the optimal filter shape is determined differently depending on the video resolution, the video characteristics, the bit rate, and the like.
[0608] According to the embodiment of the present application, compared with the use of the filter shown in FIG. 1, the use of the filter shown in FIG. 2 has the advantage of reducing the computational complexity of the encoder / decoder. Figure 34 According to the embodiment of the present application, compared with the use of the filter shown in FIG. 1, the use of the filter shown in FIG. 2 has the advantage of reducing the computational complexity of the encoder / decoder. Figure 33 According to the embodiment of the present application, compared with the use of the filter shown in FIG. 1, the use of the filter shown in FIG. 2 has the advantage of reducing the computational complexity of the encoder / decoder.
[0609] For example, in the case of the 5x5 square filter shown in (a) of FIG. 1, a total of 13 filter coefficients are entropy encoded / decoded, in the case of the 5x5 octagonal filter shown in (b) of FIG. 1, a total of 11 filter coefficients are entropy encoded / decoded, in the case of the 5x5 snowflake filter shown in (c) of FIG. 1, a total of 9 filter coefficients are entropy encoded / decoded, and in the case of the 5x5 diamond filter shown in (d) of FIG. 1, 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, the maximum number of filter coefficients of the filters in the example of FIG. 1 (i.e., 13) is smaller than the maximum number of filter coefficients of the filters in the example of FIG. 2 (i.e., 21). Therefore, when the filters in the example of FIG. 2 are used, the number of filter coefficients to be entropy encoded / decoded is reduced. Thus, in this case, the computational complexity of the encoder / decoder can be reduced. Figure 34 Figure 34 Figure 34 Figure 34 Figure 34 Figure 34 Figure 33
[0610] Optionally, for example, for the 5x5 square filter shown in (a) of FIG. 1, a total of 13 multiplications are required for each sample, for the 5x5 octagonal filter shown in (b) of FIG. 1, a total of 11 multiplications are required for each sample, for the 5x5 snowflake filter shown in (c) of FIG. 1, a total of 9 multiplications are required for each sample, and for the 5x5 diamond filter shown in (d) of FIG. 1, a total of 7 multiplications are required for each sample. In the example of FIG. 1, the maximum number of filter coefficients of the filters (i.e., 13) is smaller than the maximum number of filter coefficients of the filters in the example of FIG. 2 (i.e., 21). Therefore, when the filters in the example of FIG. 2 are used, the number of multiplications required for each sample is reduced. Thus, in this case, the computational complexity of the encoder / decoder can be reduced. Figure 34 Figure 34 Figure 34 Figure 34 Figure 34 Figure 33 the maximum number of filter coefficients of the filter in the example of Figure 35a The number of multiplications per sample is reduced when using the filter in the example of
[0611] Additionally, for example, since the size of all filters in the example of Figure 35b is 5x5, the hardware implementation requires two line buffers that are half the length of the vertical filter. Here, the number of line buffers required when using the filter in the example of Figure 35a is less than the number of line buffers required when using the filter in the example of Figure 35b Thus, when using the filter in the example of Figure 35a , the size of the line buffers, the hardware complexity of the encoder / decoder, the memory capacity requirements, and the memory access bandwidth can be reduced.
[0612] According to an embodiment of the present application, as the filter used in the above-mentioned filtering process, a filter having at least one shape selected from a diamond shape, a rectangular shape, a square shape, a trapezoidal shape, a diagonal line shape, a snowflake shape, a numeral symbol shape, a shamrock shape, a cross shape, a triangular shape, a pentagonal shape, a hexagonal shape, an octagonal shape, a decagonal shape, and a dodecagonal shape is used. For example, as shown in Figure 35b and / or Figure 35a , the filter can have a shape selected from a square shape, an octagonal shape, a snowflake shape, a diamond shape, a hexagonal shape, a rectangular shape, a cross shape, a numeral symbol shape, a shamrock shape, and a diagonal line shape.
[0613] For example, at least one of the filters having a vertical length of 5 among the filters shown in Figure 35b and / or Figure 35a is used to construct a filter set, and then filtering is performed using the filter set.
[0614] Alternatively, for example, at least one of the filters having a vertical filter length of 3 among the filters shown in Figure 35b and Figure 35a is used to construct a filter set, and then filtering is performed using the filter set.
[0615] Further alternatively, for example, at least one of the filters having a vertical filter length of 3 or 5 among the filters shown in Figure 35b and / or Figure 35a is used to construct a filter set, and then filtering is performed using the filter set.
[0616] In the example of Figure 35b and Figure 35aThe filter shown in
[0617] On the other hand, the filters shown in Figure 35b and / or Figure 33 are used to prepare H filter sets, and information about which filter is used is signaled from the encoder to the decoder. In this case, the filter index is entropy coded / decoded on a per picture, parallel block, parallel block group, slice, or sequence basis. Here, H is a positive integer. That is, the filter index is entropy coded / decoded into the sequence parameter set, picture parameter set, slice header, slice data, parallel block header, and parallel block group header within the bitstream.
[0618] At least one of a diamond, rectangle, square, trapezoid, diagonal, snowflake, numeral symbol, shamrock, cross, triangle, pentagon, hexagon, octagon, and decagon filter is used to filter the reconstructed / decoded samples of at least one of the luma and chroma components.
[0619] On the other hand, the numbers in each filter shape shown in Figure 35a and / or Figure 35b represent filter coefficient indices, and the filter coefficient indices are symmetric with respect to the filter center. That is, Figure 35a and / or Figure 35b The filter shapes shown in
[0620] According to embodiments of the present invention, using the filters as in the examples of Figure 33 and / or Figure 35a and / or Figure 35b has the advantage of reducing the computational complexity of the encoder / decoder compared to using the filters as in the examples of
[0621] For example, when using at least one of the filters shown in Figure 33 and / or Figure 35a compared to the case of using one of the 9x9 diamond filters shown in Figure 35b the number of filter coefficients that are entropy coded / decoded is reduced. Thus, the computational complexity of the encoder / decoder can be reduced.
[0622] Optionally, for example, when using at least one of the filters shown in Figure 33 and / or Figure 36 compared to the case of using one of the 9x9 diamond filters shown in Figure 36The number of multiplications required for filtering the filter coefficients is reduced compared to the case where one of the 9x9 diamond filters shown in
[0623] Further optionally, at least one of the filters shown in Figure 36 and / or Figure 36 is used, the number of lines of the line buffer required for filtering the filter coefficients is reduced compared to the case where one of the 9x9 diamond filters shown in Figure 36 is used. Furthermore, the hardware complexity, memory requirement and memory access bandwidth can also be reduced.
[0624] According to embodiments of the present application, at least one filter selected from the horizontal / vertical symmetric filters shown in Figure 36 may be used instead of the point symmetric filter for filtering. Optionally, in addition to the point symmetric filter and the horizontal / vertical symmetric filter, a diagonal symmetric filter can also be used. In Figure 36 , the numbers in each filter shape represent filter coefficient indices.
[0625] For example, at least one of the filters having a vertical filter length of 5 among the filters shown in Figure 33 is used to construct a filter set, and then the filter set is used for filtering.
[0626] Optionally, for example, at least one of the filters having a vertical filter length of 3 among the filters shown in Figure 36 is used to construct a filter set, and then the filter set is used for filtering.
[0627] Further optionally, for example, at least one of the filters having a vertical filter length of 3 or 5 among the filters shown in Figure 36 is used to construct a filter set, and then the filter set is used for filtering.
[0628] The filter shapes shown in Figure 33 are designed to have a vertical filter length of 3 or 5. However, the filter shapes used in embodiments of the present application are not limited thereto. The filters can be designed to have an arbitrary vertical filter length M. Here, M is a positive integer.
[0629] In order to prepare the filter set to be used in Figure 36The 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.
[0630] 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.
[0631] 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.
[0632] For example, when used in Figure 33 When at least one of the filters shown is used, it is similar to the filter used in Figure 37 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.
[0633] Alternatively, for example, when used in Figure 37 When at least one of the filters shown is used, it is similar to the filter used in Figure 38 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.
[0634] Further, alternatively, for example, when used in Figures 39 to 5 When at least one of the filters shown is used, it is similar to the filter used in Figures 39 to 5 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.
[0635] 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 d2at least one of the gradient values is applied to the filter coefficients f(k, l). In this case, the geometric transformation of the filter coefficients is implemented 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 zoom-in / zoom-out on the filter, thereby generating a geometrically transformed filter.
[0636] On the other hand, after the geometric transformation is performed on the filter coefficients, the reconstructed / decoded samples are filtered using the geometrically transformed filter coefficients. In this case, at least one of the reconstructed / decoded samples as a filtering target is geometrically transformed, and then the reconstructed / decoded samples are filtered using the filter coefficients.
[0637] According to an embodiment of the present application, the geometric transformation is performed according to Equations 33 to 35.
[0638] [Equation 33]
[0639] f D (k, l) = f(l, k)
[0640] [Equation 34]
[0641] f V (k, l) = f(k, K-l-1)
[0642] [Equation 35]
[0643] f R (k, l) = f(K-l-1, k)
[0644] Here, Equation 33 is an example showing an equation for a second diagonal flip, Equation 34 is an example showing a vertical flip, and Equation 35 is an example showing a 90° rotation. In Equations 34 to 35, K is the number of filter taps in the horizontal and vertical directions (filter length), and "0≤K and 1≤K-1" indicate the coordinates of the filter coefficients. For example, (0, 0) indicates the upper left corner, and (K-1, K-1) indicates the lower right corner.
[0645] Table 1 shows an example of the geometric transformation applied to the filter coefficients f(k, l) according to the sum of the gradient values.
[0646] [Table 1]
[0647]
[0648]
[0649] Figure 39is a diagram showing filters obtained by performing geometric transformation on a square filter, an octagonal filter, a snowflake filter, and a diamond filter according to an embodiment of the present application.
[0650] Referring to Figure 39 At least one geometric transformation among a second diagonal flip, a vertical flip, and a 90° rotation is performed on the filter coefficients of the square filter, the octagonal filter, the snowflake filter, and the diamond filter. Then, the filter coefficients obtained by the geometric transformation can be used for filtering. On the other hand, after performing the geometric transformation on the filter coefficients, the reconstructed / decoded samples are filtered using the filter coefficients of the geometric transformation. In this case, at least one of the reconstructed / decoded samples as a filtering target is subjected to the geometric transformation, and then the reconstructed / decoded samples are filtered using the filter coefficients.
[0651] According to one embodiment of the present application, 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.
[0652] [Equation 36]
[0653]
[0654] In Equation 36, L is the number of filter taps in the horizontal or vertical direction (filter length), and f(k,l) is a filter coefficient.
[0655] On the other hand, when filtering is performed, an offset value Y can be added to the filtered decoded sample R'(i,j). The offset value Y can be entropy encoded / decoded. Furthermore, the offset value Y is calculated using at least one of a current reconstructed / decoded sample value and a neighboring reconstructed / decoded sample value. In addition, the offset value Y is determined based on at least one encoding parameter of the current reconstructed / decoded sample and the neighboring reconstructed / decoded sample. Here, the threshold value E is a positive integer or zero.
[0656] In addition, the filtered decoded sample can be clipped to be expressed in N bits. Here, H is a positive integer. For example, when the filtered decoded sample generated by performing filtering on the reconstructed / decoded sample is clipped in 10 bits, the final decoded sample value can be a value in the range from 0 to 1023.
[0657] According to an embodiment of the present application, filtering on a chrominance component is performed based on filter information of a luminance component.
[0658] For example, filtering on a reconstructed picture of a chrominance component can be performed only when filtering on a reconstructed picture of a luminance component is performed in a previous stage. Here, the reconstructed picture filtering of the chrominance component can be performed on U(Cr), V(Cb), or both components.
[0659] Optionally, at least one of the filter coefficient of the corresponding luminance component, the number of filter taps, the filter shape, and the information of whether to filter is used to perform the filtering, for example, in the case of the chroma component.
[0660] According to an exemplary embodiment of the present application, when performing the filtering, when there is an unavailable sample in the vicinity of the current sample, padding is performed, and then the filtering is performed using the padded sample. The padding refers to a method of copying the sample value of the neighboring available sample to the unavailable sample. Optionally, a sample value or a statistical value obtained based on the available sample value adjacent to the unavailable sample is used. The padding can be repeatedly performed for P columns and R rows. Here, M and L are each a positive integer.
[0661] Here, the unavailable sample refers to a sample disposed outside the boundary of the CTU, CTB, slice, parallel block, parallel block group, or picture. Optionally, the unavailable sample refers to a sample belonging to at least one of the CTU, CTB, slice, parallel block, parallel block group, and picture different from at least one of the CTU, CTB, slice, parallel block, parallel block group, and picture to which the current sample belongs.
[0662] In addition, when performing the filtering, the predetermined sample can not be used.
[0663] For example, when performing the filtering, the padded sample can not be used.
[0664] Optionally, for example, when performing the filtering, when there is an unavailable sample in the vicinity of the current sample, the unavailable sample can not be used when performing the filtering.
[0665] Further optionally, for example, when performing the filtering, when the sample in the vicinity of the current sample is located outside the CTU or CTB, the neighboring sample in the vicinity of the current sample can not be used when performing the filtering.
[0666] In addition, when performing the filtering, a sample to which at least one of deblocking filtering, adaptive sample offset, and adaptive in-loop filtering is applied can be used.
[0667] In addition, when performing the filtering, when at least one of the samples existing in the vicinity of the current sample is located outside the CTU or CTB boundary, at least one of the deblocking filtering, the adaptive sample offset, and the adaptive in-loop filtering can not be applied.
[0668] In addition, the filtering target sample includes an unavailable sample located outside the CTU or CTB boundary, at least one of the deblocking filtering, the adaptive sample offset, and the adaptive in-loop filtering is not performed on the unavailable sample, and the unavailable sample is used as it is for the filtering.
[0669] According to embodiments of the present application, when performing the filtering, the filtering is performed on at least one of the samples located in the vicinity of a boundary of at least one of the 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. In addition, the sample located in the vicinity of the boundary can be at least one of U rows, U columns and U samples adjacent to the boundary. Here, U is a positive integer.
[0670] According to embodiments of the present application, when performing the filtering, the filtering is performed on at least one of the samples located in the block, and the filtering is not performed on the samples located outside a boundary of at least one of the 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. In addition, the sample located in the vicinity of the boundary can be at least one of U rows, U columns and U samples adjacent to the boundary. Here, U is a positive integer.
[0671] According to embodiments of the present application, when performing the filtering, it is determined whether to perform the filtering based on at least one of the encoding parameters of the current block and the neighboring block. In this case, the encoding parameters include at least one of a prediction mode (i.e., whether the prediction is intra prediction or inter prediction), an inter prediction mode, an intra prediction mode, an intra prediction indicator, a motion vector, a reference picture index, a quantization parameter, a block size of the current block, a block shape of the current block, a size of the block classification unit and an encoding block flag / style.
[0672] In addition, when performing the filtering, at least one of a filter coefficient, a number of filter taps (filter length), a filter shape and a filter type is determined based on at least one of the encoding parameters of the current block and the neighboring block. At least one of the filter coefficient, the number of filter taps (filter length), the filter shape and the filter type varies according to at least one of the encoding parameters.
[0673] For example, the number of filters used for the filtering is determined according to the quantization parameter. For example, when the quantization parameter is less than a threshold T, J filters are used. When the quantization parameter is greater than a threshold R, H filters are used. In other cases, G filters are used. Here, T, R, J, H and G are positive integers or zero. In addition, J is greater than or equal to H. Here, the greater the quantization parameter value, the fewer the number of filters used.
[0674] Optionally, the number of filters used for filtering is determined, for example, according to the size of the current block. For example, J filters are used when the size of the current block is smaller than a threshold T. H filters are used when the size of the current block is larger than a threshold R. In other cases, G filters are used. Here, T, R, J, H and G are positive integers or zero. In addition, J is larger than or equal to H. Here, the larger the size of the block, the fewer the number of block filters used.
[0675] Optionally, the number of filters used for filtering is determined, for example, according to the size of the block classification unit. For example, J filters are used when the size of the block classification unit is smaller than a threshold T. H filters are used when the size of the block classification unit is larger than a threshold R. In other cases, G filters are used. Here, T, R, J, H and G are positive integers or zero. In addition, J is larger than or equal to H. Here, the larger the size of the block classification unit, the fewer the number of block filters used.
[0676] Further optionally, filtering is performed, for example, by using any combination of the above filtering methods.
[0677] In the following, the filter information encoding / decoding step will be described.
[0678] According to embodiments of the present application, the filter information is entropy encoded / decoded to be arranged between a slice header and a first CTU syntax element of slice data within a bitstream.
[0679] In addition, the filter information is entropy encoded / decoded to be arranged in a sequence parameter set, a picture parameter set, a slice header, slice data, a parallel block header, a parallel block group header, a CTU or a CTB within a bitstream.
[0680] On the other hand, the filter information includes at least one piece of information selected from the following information: information on whether to perform filtering of a luma component, information on whether to perform filtering of a chroma component, filter coefficient values, the number of filters, the number of filter taps (filter length), filter shape information, filter type information, information on whether to perform filtering on a per slice, parallel block, parallel block group, picture, CTU, CTB, block or CU basis, information on the number of times of performing CU-based filtering, CU maximum depth filtering information, information on whether to perform CU-based filtering, information on whether to use a filter of a previous reference picture, information of a filter index of a previous reference picture, information on whether to use a fixed filter for block classification index information, index information for a fixed filter, filter merge information, information on whether to use different filters for a luma component and a chroma component, respectively, and filter symmetric shape information.
[0681] Here, the number of filter taps refers to at least one of a horizontal length of the filter, a vertical length of the filter, a first diagonal length of the filter, a second diagonal length of the filter, a horizontal length and a vertical length of the filter, and a number of filter coefficients within the filter.
[0682] On the other hand, the filter information includes at most L luma filters. Here, L is a positive integer and specifically 25. In addition, the filter information includes at most L chroma filters. Here, L is a positive integer and specifically 1.
[0683] On the other hand, one filter includes at most K luma filter coefficients. Here, K is a positive integer and specifically 13. In addition, the filter information includes at most K chroma filter coefficients. Here, K is a positive integer and specifically 7.
[0684] For example, the information on the filter symmetry shape is information on a filter shape such as a point symmetry shape, a horizontal symmetry shape, a vertical symmetry shape, or a combination of the point symmetry shape, the horizontal symmetry shape, and the vertical symmetry shape.
[0685] On the other hand, only some of the filter coefficients are signaled. For example, when the filter is in a symmetric form, information on only one of the filter symmetry shape and a group of symmetric filter coefficients is signaled. Alternatively, for example, a filter coefficient at a filter center is not signaled because it can be implicitly derived.
[0686] According to an embodiment of the present invention, filter coefficient values in filter information are quantized in an encoder, and the resulting quantized filter coefficient values are entropy encoded. Likewise, quantized filter coefficient values are entropy decoded in a decoder, and the quantized filter coefficient values are dequantized to be restored to original filter coefficient values. The filter coefficient values are quantized to a range of values representable by a fixed number of M bits, and then dequantized. In addition, at least one filter coefficient is quantized to a different number of 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 a quantization parameter. Further, M of the number of M bits is a constant predefined in the encoder and the decoder. Here, M can be a positive integer and specifically can be 8 or 10. The number of M bits can be smaller than or equal to a 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. A first filter coefficient among the filter coefficients within the filter can be a value in a range of -2 M to 2 M -1, and a second filter coefficient can be a value in a range of 0 to 2 Ma value within a range of -1 to 1. Here, the first filter coefficient refers to a filter coefficient other than the center filter coefficient among the filter coefficients, and the second filter coefficient refers to the center filter coefficient among the filter coefficients.
[0687] The filter coefficient values in the filter information can be clipped by at least one of the encoder and the decoder, and at least one of a minimum value and a maximum value related to the clipping can be entropy encoded / decoded. The filter coefficient values can be clipped to fall within a range of the minimum value to the maximum value. At least one of the minimum value and the maximum value can be a different value for each filter coefficient. On the other hand, at least one of the minimum value and the maximum value can be the same value for each filter coefficient. At least one of the minimum value and the maximum value can be determined according to a quantization parameter. At least one of the minimum value and the maximum value can be a constant value predefined in the encoder and the decoder.
[0688] According to an embodiment of the present application, at least one piece of filter information is entropy encoded / decoded based on at least one of encoding parameters of the current block and the neighboring block. In this case, the encoding parameters include at least one of a prediction mode (i.e., whether the prediction is intra prediction or inter prediction), an inter prediction mode, an intra prediction mode, an intra prediction indicator, a motion vector, a reference picture index, a quantization parameter, a block size of the current block, a block shape of the current block, a size of a block classification unit, and a coding block flag / style.
[0689] For example, the number of filters in the plurality of pieces of filter information is determined according to a quantization parameter of a picture, a slice, a parallel block group, a parallel block, a CTU, a CTB, or a 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. Also, J is greater than or equal to H. Here, the greater the quantization parameter value, the fewer the number of entropy-encoded filters.
[0690] According to an exemplary embodiment of the present application, whether to perform filtering on at least one of a luma component and a chroma component is indicated by using filter execution information (a flag).
[0691] For example, whether to perform filtering on at least one of the luma component and the chroma component is indicated by using filtering execution information (flag) on a per-CTU, CTB, CU, or block basis. For example, when the filtering execution information is a first value, filtering is performed on a per-CTB basis, and when the filtering execution information is a second value, filtering is not performed on the corresponding CTB. In this case, information on whether to perform filtering on each CTB can be entropy encoded / decoded. Alternatively, for example, information on the maximum depth or the minimum size of a CU (maximum depth filter information of the CU) can be additionally entropy encoded / decoded, and CU-based filtering execution information on a CU having the maximum depth or on a CU having the minimum size can be entropy encoded / decoded.
[0692] For example, when a block can be partitioned into smaller square sub-blocks and non-square sub-blocks according to a block structure, a CU-based flag can be entropy encoded / decoded up to a partitioning depth at which the block has a block structure that can be partitioned into smaller square sub-blocks. In addition, the CU-based flag can be entropy encoded / decoded up to a partitioning depth at which the block has a block structure that can be partitioned into smaller non-square sub-blocks.
[0693] Alternatively, for example, information on whether to perform filtering on at least one of the luma component and the chroma component can be a block-based flag (i.e., a flag on a per-block basis). For example, when a block-based flag of a corresponding block is a first value, filtering is performed on the block, and when the block-based flag of the corresponding block is a second value, filtering is not performed. The size of the block is N x M, where N and M are positive integers.
[0694] Further alternatively, for example, information on whether to perform filtering on at least one of the luma component and the chroma component can be a CTU-based flag (i.e., a flag on a per-CTU basis). For example, when a CTU-based flag of a corresponding CTU is a first value, filtering is performed on the CTU, and when the CTU-based flag of the corresponding CTU is a second value, filtering is not performed. The size of the CTU is N x M, where N and M are positive integers.
[0695] Further alternatively, for example, whether to perform filtering on at least one of the luma and chroma components is determined according to a picture, slice, parallel block group, or parallel block type. Information on whether to perform filtering on at least one of the luma component and the chroma component can be a flag on a per-picture, slice, parallel block group, or parallel block basis.
[0696] According to an embodiment of the present application, filter coefficients belonging to different block categories can be merged to reduce the amount of filter coefficients to be entropy encoded / decoded. In this case, filter merge information on whether to merge filter coefficients is entropy encoded / decoded.
[0697] In addition, in order to reduce the amount of filter coefficients to be entropy coded / decoded, the filter coefficients of a reference picture can be used as the filter coefficients of the current picture. In this case, the method of using the filter coefficients of the reference picture is referred to as temporal filter coefficient prediction. For example, the temporal filter coefficient prediction is used for inter-predicted pictures (B / P pictures, slices, parallel block groups, or parallel blocks). On the other hand, the filter coefficients of the reference picture are stored in a memory. In addition, when the filter coefficients of the reference picture are used for the current picture, the entropy coding / decoding of the filter coefficients of the current picture is omitted. In this case, a previous reference picture filter index indicating which filter coefficients of the reference picture are used is entropy coded / decoded.
[0698] For example, when the temporal filter coefficient prediction is used, a filter set candidate list is constructed. The filter set candidate list is empty before a new sequence is decoded. However, whenever a picture is decoded, the filter coefficients of the picture are added to the filter set candidate list. When the number of filters in the filter set candidate list reaches the maximum number of filters G, a new filter can replace the oldest filter in the decoding order. That is, the filter set candidate list is updated in a first-in first-out (FIFO) manner. Here, G is a positive integer and is specifically 6. In order to prevent duplication of filters in the filter set candidate list, the filter coefficients of a picture for which the temporal filter coefficient prediction is not used can be added to the filter set candidate list.
[0699] Alternatively, for example, when the temporal filter coefficient prediction is used, filter set candidate lists for a plurality of temporal layer indices are constructed to support temporal scalability. That is, the filter set candidate list is constructed for each temporal layer. For example, the filter set candidate list for the corresponding temporal layer contains a filter set used to decode a picture whose temporal layer index is equal to or smaller than the temporal layer index of a previously decoded picture. In addition, after each picture is decoded, the filter coefficients for the current picture are added to the filter set candidate list for the temporal layer indices equal to or greater than the temporal layer index of the current picture.
[0700] According to an embodiment of the present invention, a fixed filter set is used to perform filtering.
[0701] Although time filter coefficient prediction cannot be used in intra predicted pictures (I-pictures, slices, parallel block groups or parallel blocks), at least one filter out of a maximum of 16 fixed filters in the filter set can be used for filtering according to the block classification index. In order to signal from the encoder to the decoder information about whether the fixed filter set is used, information about whether a fixed filter is used for each block classification index is entropy coded / decoded. When a fixed filter is used, index information about the fixed filter is also entropy coded / decoded. Even when a fixed filter is used for a certain block classification index, filter coefficients are entropy coded / decoded and the reconstructed picture is filtered using the entropy coded / decoded filter coefficients and the fixed filter coefficients.
[0702] Furthermore, the fixed filter set is also used in inter predicted pictures (B / P-pictures, slices, parallel block groups or parallel blocks).
[0703] Additionally, adaptive in-loop filtering can be performed with the fixed filter without entropy coding / decoding of filter coefficients. Here, the fixed filter can denote a filter set which is predefined in the encoder and the decoder. In this case, without entropy coding / decoding of filter coefficients, the encoder and the decoder entropy code / decode fixed filter index information which indicates which filter out of the filter set or which filter set out of the filter set which is predefined in the encoder and the decoder is used. In this case, filtering is performed with the fixed filter which differs in at least one of filter coefficient values, filter taps (i.e. number of filter taps or filter length) and filter shape based on at least one of block classification, block, CU, slice, parallel block, parallel block group and picture.
[0704] On the other hand, at least one filter out of the fixed filter set can be transformed in terms of filter taps and / or filter shape. For example, as shown in Figures 40a to 40d the coefficients in the 9x9 diamond filter are transformed into coefficients in the 5x5 square filter. Specifically, the coefficients in the 9x9 diamond filter can be transformed into coefficients in the 5x5 square filter.
[0705] For example, the sum of the filter coefficients corresponding to filter coefficient indices 0, 2 and 6 in the 9x9 diamond shape is assigned to filter coefficient index 2 in the 5x5 square shape.
[0706] Alternatively, for example, the sum of the filter coefficients corresponding to filter coefficient indices 1 and 5 in the 9x9 diamond shape is assigned to filter coefficient index 1 in the 5x5 square shape.
[0707] Further alternatively, for example, a sum of filter coefficients corresponding to filter coefficient indices 3 and 7 in the 9x9 diamond shape is assigned to filter coefficient index 3 in the 5x5 square shape.
[0708] Further alternatively, for example, a filter coefficient corresponding to filter coefficient index 4 in the 9x9 diamond shape is assigned to filter coefficient index 0 in the 5x5 square shape.
[0709] Further alternatively, for example, a filter coefficient corresponding to filter coefficient index 8 in the 9x9 diamond shape is assigned to filter coefficient index 4 in the 5x5 square shape.
[0710] Further alternatively, for example, a sum of filter coefficients corresponding to filter coefficient indices 9 and 10 in the 9x9 diamond shape is assigned to filter coefficient index 5 in the 5x5 square shape.
[0711] Further alternatively, for example, a filter coefficient corresponding to filter coefficient index 11 in the 9x9 diamond shape is assigned to filter coefficient index 6 in the 5x5 square shape.
[0712] Further alternatively, for example, a filter coefficient corresponding to filter coefficient index 12 in the 9x9 diamond shape is assigned to filter coefficient index 7 in the 5x5 square shape.
[0713] Further alternatively, for example, a filter coefficient corresponding to filter coefficient index 13 in the 9x9 diamond shape is assigned to filter coefficient index 8 in the 5x5 square shape.
[0714] Further alternatively, for example, a sum of filter coefficients corresponding to filter coefficient indices 14 and 15 in the 9x9 diamond shape is assigned to filter coefficient index 9 in the 5x5 square shape.
[0715] Further alternatively, for example, a sum of filter coefficients corresponding to filter coefficient indices 16, 17, and 18 in the 9x9 diamond shape is assigned to filter coefficient index 10 in the 5x5 square shape.
[0716] Further alternatively, for example, a filter coefficient corresponding to filter coefficient index 19 in the 9x9 diamond shape is assigned to filter coefficient index 11 in the 5x5 square shape.
[0717] Further alternatively, for example, a filter coefficient corresponding to filter coefficient index 20 in the 9x9 diamond shape is assigned to filter coefficient index 12 in the 5x5 square shape.
[0718] Table 2 shows an exemplary method of generating filter coefficients by transforming 9x9 diamond filter coefficients into 5x5 square filter coefficients.
[0719] [Table 2]
[0720]
[0721]
[0722] In Table 2, the sum of at least one of the filter coefficients of the 9x9 diamond filter is equal to the sum of at least one of the filter coefficients of the corresponding 5x5 square filter.
[0723] On the other hand, when a maximum of 16 fixed filter sets are used for the 9x9 diamond filter coefficients, a maximum of 21 filter coefficients x 25 filters x 16 filter types of data need to be stored in the memory. When a maximum of 16 fixed filter sets are used for the filter coefficients of the 5x5 square filter, a maximum of 13 filter coefficients x 25 filters x 16 filter types of data need to be stored in the memory. Here, since the size of the memory required to store the fixed filter coefficients in the 5x5 square filter is smaller than the size of the memory required to store the fixed filter coefficients in the 9x9 diamond filter, the memory capacity requirement and the memory access bandwidth are reduced.
[0724] On the other hand, filtering can be performed on the reconstructed / decoded chrominance components using filters obtained by transforming the filters used for the co-located luminance components in terms of filter taps and / or filter shape.
[0725] According to an embodiment of the present application, the filter coefficients are prohibited from being predicted from the filter coefficients of the predefined fixed filters.
[0726] According to an embodiment of the present application, the multiplication operation is replaced by a shift operation. 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 the 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 include only the coefficient values {-64, -32, -16, -8, -4, 0, 4, 8, 16, 32, and 64}. In this case, the multiplication of the filter coefficients included in the first group and the reconstructed / decoded samples can be performed by a single bit shift operation. Accordingly, the filter coefficients included in the first group are mapped to pre-binaryzed bit shift values to reduce the overhead of signaling.
[0727] According to an embodiment of the present application, as a result of the determination of whether to perform block classification and / or filtering on the chroma component, the determination result of whether to perform block classification and / or filtering on the corresponding luma component is used as it is. In addition, as the filter coefficients for the chroma component, the filter coefficients that have been used for the corresponding luma component are used. For example, a predetermined 5x5 diamond filter is used.
[0728] As an example, the filter coefficients in the 9x9 filter for the luma component can be transformed into the filter coefficients in the 5x5 filter for the chroma component. In this case, the outermost filter coefficients are set to zero.
[0729] As another example, when filter coefficients in the form of a 5x5 filter are used for the luma component, the filter coefficients for the luma component are the same as the filter coefficients for the chroma component. That is, the filter coefficients for the luma component can be used as the filter coefficients for the chroma component as it is.
[0730] As another example, in order to maintain the 5x5 filter shape for filtering the chroma component, the filter coefficients other than the 5x5 diamond filter are arranged in place of the coefficients at the boundary of the 5x5 diamond filter.
[0731] On the other hand, in-loop filtering for a luma block and in-loop filtering for a chroma block can be performed separately. A control flag is signaled at a picture, slice, parallel block group, parallel block, CTU, or CTB level to inform whether adaptive in-loop filtering for a chroma component is separately supported. A flag indicating a mode in which adaptive in-loop filtering is commonly performed for a luma block and a chroma block or a mode in which adaptive in-loop filtering for a luma block and adaptive in-loop filtering for a chroma block are separately performed can be signaled.
[0732] According to an embodiment of the present application, when entropy encoding / decoding at least one piece of filter information, at least one of the following binarization methods can be used:
[0733] Truncated Rice binarization method;
[0734] Kth-order exponential Golomb binarization method;
[0735] Finite Kth-order exponential Golomb binarization method;
[0736] Fixed length binarization method;
[0737] Unary binarization method; and
[0738] Truncated unary binarization method.
[0739] As an example, filter coefficient values of a luma filter and filter coefficient values of a chroma filter are entropy encoded / decoded using different binarization methods for the luma filter and the chroma filter.
[0740] As another example, filter coefficient values of a luma filter are entropy encoded / decoded using different binarization methods. As another example, filter coefficient values of one luma filter are entropy encoded / decoded using the same binarization method.
[0741] As another example, filter coefficient values of one chroma filter are entropy encoded / decoded using different binarization methods. As another example, filter coefficient values of one chroma filter are entropy encoded / decoded using the same binarization method.
[0742] As an example, when entropy encoding / decoding at least one piece of filter information, at least one piece of filter information of at least one of the neighboring blocks, or at least one previously encoded / decoded filter information, or encoded / decoded filter information in a previous picture is used to determine a context model.
[0743] As another example, when entropy encoding / decoding at least one piece of filter information, at least one piece of filter information of different components is used to determine a context model.
[0744] As another example, when entropy encoding / decoding filter coefficients, at least one of the filter coefficients in the filter is used to determine a context model.
[0745] As another example, when entropy encoding / decoding at least one piece of filter information, at least one piece of filter information of at least one of the neighboring blocks, or at least one previously encoded / decoded filter information, or encoded / decoded filter information in a previous picture is used to determine a context model.
[0746] As another example, when entropy encoding / decoding at least one piece of filter information, at least one piece of filter information of different components is used as a prediction value of the filter information to perform entropy encoding / decoding.
[0747] As another example, when entropy encoding / decoding filter coefficients, at least one of the filter coefficients in the filter is used as a prediction value to perform entropy encoding / entropy decoding.
[0748] As another example, filter information is entropy encoded / decoded using any combination of the filter information entropy encoding / decoding methods.
[0749] According to embodiments of the present application, the adaptive in-loop filtering is performed in units of at least one of a block, a CU, a PU, a TU, a CB, a PB, a TB, a CTU, a CTB, a slice, a parallel block, a parallel block group, and a picture. When the adaptive in-loop filtering is performed on each of the above units, it means that a block classification step, a filter execution step, and a filter information encoding / step are performed in units of at least one of a block, a CU, a PU, a TU, a CB, a PB, a TB, a CTU, a CTB, a slice, a parallel block, a parallel block group, and a picture.
[0750] According to embodiments of the present application, it is determined whether to perform the adaptive in-loop filtering based on a determination of whether to perform at least one of deblocking filtering, sample adaptive offset, and bi-directional filtering.
[0751] As an example, the adaptive in-loop filtering is performed on samples of reconstructed / decoded samples in a current picture that have undergone at least one of deblocking filtering, sample adaptive offset, and bi-directional filtering.
[0752] As another example, the adaptive in-loop filtering is not performed on samples of reconstructed / decoded samples in a current picture that have undergone at least one of deblocking filtering, sample adaptive offset, and bi-directional filtering.
[0753] As another example, for samples of reconstructed / decoded samples in a current picture that have undergone at least one of deblocking filtering, sample adaptive offset, and bi-directional filtering, the adaptive in-loop filtering is performed on the reconstructed / decoded samples in the current picture using L filters without performing a block classification. Here, L is a positive integer.
[0754] According to embodiments of the present application, it is determined whether to perform the adaptive in-loop filtering according to a slice or parallel block group type of a current picture.
[0755] As an example, the adaptive in-loop filtering is performed only when the slice or parallel block group type of the current picture is an I slice or an I parallel block group.
[0756] As another example, the adaptive in-loop filtering is performed when the slice or parallel block group type of the current picture is at least one of an I slice, a B slice, a P slice, an I parallel block group, a B parallel block group, and a P parallel block group.
[0757] As an example, when the slice or parallel block group type of the current picture is at least one of an I slice, a B slice, a P slice, an I parallel block group, a B parallel block group, and a P parallel block group, the adaptive in-loop filtering is performed on the reconstructed / decoded samples in the current picture using L filters without performing a block classification when the adaptive in-loop filtering is performed on the current picture. Here, L is a positive integer.
[0758] As another example, when the slice or parallel block group type of the current picture is at least one of an I slice, a B slice, a P slice, an I parallel block group, a B parallel block group, and a P parallel block group, adaptive in-loop filtering is performed using one filter shape.
[0759] As another example, when the slice or parallel block group type of the current picture is at least one of an I slice, a B slice, a P slice, an I parallel block group, a B parallel block group, and a P parallel block group, adaptive in-loop filtering is performed using one filter tap.
[0760] As another example, when the slice or parallel block group type of the current picture is at least one of an I slice, a B slice, a P slice, an I parallel block group, a B parallel block group, and a P parallel block group, at least one of block classification and adaptive in-loop filtering is performed on a per MxN size block. In this case, M and N are each a positive integer. M and N are each specifically 4.
[0761] According to an embodiment of the present invention, whether to perform adaptive in-loop filtering is determined according to a determination of whether the current picture is used as a reference picture.
[0762] For example, when the current picture is used as a reference picture in a process of encoding / decoding a subsequent picture, adaptive in-loop filtering is performed on the current picture.
[0763] As another example, when the current picture is not used as a reference picture in a process of encoding / decoding a subsequent picture, adaptive in-loop filtering is not performed on the current picture.
[0764] As another example, when the current picture is not used in a process of a subsequent picture, in performing adaptive in-loop filtering on the current picture, adaptive in-loop filtering is performed on reconstructed / decoded samples within the current picture using L filters without performing block classification. Here, L is a positive integer.
[0765] As another example, when the current picture is not used in a process of a subsequent picture, adaptive in-loop filtering is performed using one filter shape.
[0766] As another example, when the current picture is not used in a process of a subsequent picture, adaptive in-loop filtering is performed using one filter tap.
[0767] As another example, when the current picture is not used in a process of a subsequent picture, at least one of block classification and filtering is performed on a per NxM size block. In this case, M and N are each a positive integer. M and N are each specifically 4.
[0768] According to an embodiment of the present application, whether to perform adaptive in-loop filtering is determined according to the temporal layer identifier.
[0769] As an example, when the temporal layer identifier of the current picture is zero indicating the bottom layer, adaptive in-loop filtering is performed on the current picture.
[0770] As another example, when the temporal layer identifier of the current picture is 4 indicating the top layer, adaptive in-loop filtering is performed.
[0771] As another example, the temporal layer identifier of the current picture is 4 indicating the top layer, and when adaptive in-loop filtering is performed on the current picture, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using L filters without performing block classification. Here, L is a positive integer.
[0772] As another example, when the temporal layer identifier of the current picture is 4 indicating the top layer, adaptive in-loop filtering is performed using one filter shape.
[0773] As another example, when the temporal layer identifier of the current picture is 4 indicating the top layer, adaptive in-loop filtering is performed using one filter tap.
[0774] As another example, when the temporal layer identifier of the current picture is 4 indicating the top layer, at least one of block classification and adaptive in-loop filtering is performed based on each NxM size block. In this case, M and N are both positive integers. M and N are both specifically 4.
[0775] According to an embodiment of the present application, at least one of the block classification methods is performed according to the temporal layer identifier.
[0776] For example, when the temporal layer identifier of the current picture is zero indicating the bottom layer, at least one of the above-mentioned block classification methods is performed on the current picture.
[0777] Optionally, when the temporal layer identifier of the current picture is 4 indicating the top layer, at least one of the above-mentioned block classification methods is performed on the current picture.
[0778] According to an embodiment of the present application, at least one of the above-mentioned block classification methods is performed according to the value of the temporal layer identifier.
[0779] As another example, when the temporal layer identifier of the current picture is 4 indicating the top layer, when adaptive in-loop filtering is performed on the current picture, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using L filters without performing block classification. Here, L is a positive integer.
[0780] As another example, when the temporal layer identifier of the current picture is 4 indicating the top layer, adaptive in-loop filtering is performed using one filter shape.
[0781] As another example, when the temporal layer identifier of the current picture is 4 indicating a top layer, adaptive in-loop filtering is performed using one filter tap.
[0782] As another example, when the temporal layer identifier of the current picture is 4 indicating a top layer, at least one of block classification and adaptive in-loop filtering is performed on a per NxM size block. In this case, M and N are both positive integers. Specifically, M and N are both 4.
[0783] As another example, when performing adaptive in-loop filtering on the current picture, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using L filters without performing block classification. Here, L is a positive integer. Optionally, in this case, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using L filters without performing block classification and without depending on the temporal layer identifier.
[0784] On the other hand, when performing adaptive in-loop filtering on the current picture, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using L filters without depending on whether block classification is performed. Here, L is a positive integer. In this case, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using L filters without performing block classification and without depending on the temporal layer identifier and whether block classification is performed.
[0785] On the other hand, adaptive in-loop filtering is performed using one filter shape. In this case, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using one filter shape without performing block classification. Optionally, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using one filter shape without depending on whether block classification is performed.
[0786] On the other hand, adaptive in-loop filtering is performed using one filter tap. In this case, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using one filter tap without performing block classification. Optionally, adaptive in-loop filtering is performed on the reconstructed / decoded samples within the current picture using one filter tap without depending on whether block classification is performed.
[0787] On the other hand, adaptive in-loop filtering can be performed based on a certain unit. For example, the certain unit can be at least one of a picture, a slice, a parallel block, a group of parallel blocks, a CTU, a CTB, a CU, a PU, a TU, a CB, a PB, a TB, and a block of MxN size. Here, M and N are each a positive integer. M and N are the same integer or different integers. Further, M, N, or both M and N are values pre-defined in an encoder / decoder. Alternatively, M, N, or both M and N can be values signaled from the encoder to the decoder.
[0788] Figures 41a to 41d 5 is a diagram illustrating an exemplary method of determining a sum of gradient values for a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction based on sub-sampling.
[0789] Referring to Figures 42a to 42d 5, filtering is performed based on each 4x4-sized luma block. In this case, filtering can be performed using different filter coefficients for each 4x4-sized luma block. A Laplacian operation of sub-sampling can be performed to classify the 4x4-sized luma block. Further, filter coefficients used for filtering vary for each 4x4-sized luma block. In addition, the 4x4-sized luma block is classified into at most 25 classifications. Further, a classification index corresponding to a filter index of the 4x4-sized luma block can be derived based on a directionality value and / or a quantization activity value of the block. Here, to calculate the directionality value and / or the quantization activity value for each 4x4-sized luma block, a sum of gradient values for a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction is calculated by adding results of one-dimensional Laplacian operations calculated at positions of sub-sampling within the 8x8-sized block, respectively.
[0790] In particular, referring to Figure 43 In a case where block classification is performed based on each 4x4-sized block, a sum of gradient values for a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction is calculated based on sub-sampling, g v , g h , g d1 , and g d2 (at least one of which is hereinafter referred to as "a first method"). Here, V, H, D1, and D2 respectively denote results of sample-based one-dimensional Laplacian operations for a vertical direction, a horizontal direction, a first diagonal direction, and a second diagonal direction. That is, one-dimensional Laplacian operations are performed along a horizontal direction, a vertical direction, a first diagonal direction, and a second diagonal direction at positions V, H, D1, and D2, respectively. In addition, the positions at which the one-dimensional Laplacian operations are performed can be positions of sub-sampling. In Figure 43In the case of block classification based on each 4x4 size block (i.e., the hatched), a block classification index C is assigned. In this case, the operation range for calculating the one-dimensional Laplacian sum can be greater than the size of the block classification unit. Here, the thin solid line rectangle indicates the reconstructed sample position, and the thick solid line rectangle indicates the operation range for calculating the one-dimensional Laplacian sum.
[0791] Here, Figure 43 An exemplary block classification based encoding / decoding process using the first method is illustrated. Figures 44a to 44d Another exemplary block classification based encoding / decoding process using the first method is illustrated one-dimensionally. Figures 45a to 45d Another exemplary block classification based encoding / decoding process using the first method is illustrated two-dimensionally.
[0792] Referring to Figures 46a to 46d In the case of block classification based on each 4x4 size block, the sum g v , g h , g d1 and g d2 of the gradient values for the vertical direction, the horizontal direction, the first diagonal direction and the second diagonal direction are calculated based on sub-sampling (hereinafter, referred to as "the second method"). Here, V, H, D1 and D2 respectively indicate the results of the sample based one-dimensional Laplacian operation for the vertical direction, the horizontal direction, the first diagonal direction and the second diagonal direction. That is, the one-dimensional Laplacian operation is performed along the horizontal direction, the vertical direction, the first diagonal direction and the second diagonal direction at positions V, H, D1 and D2, respectively. In addition, the positions for performing the one-dimensional Laplacian operation can be the positions of the sub-sampling. In Figures 47a to 47d In the case of block classification based on each 4x4 size block (i.e., the hatched), a block classification index C is assigned. In this case, the operation range for calculating the one-dimensional Laplacian sum can be greater than the size of the block classification unit. Here, the thin solid line rectangle indicates the reconstructed sample position, and the thick solid line rectangle indicates the operation range for calculating the one-dimensional Laplacian sum.
[0793] Specifically, the second method indicates that when both the coordinate x value and the coordinate y value are even, or when both the coordinate x value and the coordinate y value are odd, the one-dimensional Laplacian operation is performed at the position (x, y). When both the coordinate x value and the coordinate y value are not even, or when both the coordinate x value and the coordinate y value are not odd, the one-dimensional Laplacian operation result at the position (x, y) is assigned zero. That is, it means that the one-dimensional Laplacian operation is performed in a checkerboard pattern according to the coordinate x value and the coordinate y value.
[0794] Referring to Figure 48, the positions of performing the one-dimensional Laplacian operation for the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction are the same. That is, the one-dimensional Laplacian operation for each direction is performed using a uniform sub-sampled one-dimensional Laplacian operation position regardless of the direction of the vertical, horizontal, first diagonal, and second diagonal directions.
[0795] Here, Figure 48 An exemplary block classification-based encoding / decoding process using the second method is illustrated. Figure 48 Another exemplary block classification-based encoding / decoding process using the second method is illustrated. Figures 49a to 49d Another exemplary block classification-based encoding / decoding process using the first method is illustrated. Figures 50a to 50d Another exemplary block classification-based encoding / decoding process using the first method is illustrated.
[0796] Referring to Figures 51a to 51d , in the case of block classification based on each 4x4 size block, the sum g v , g h , g d1 , and g d2 of gradient values for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction are calculated based on sub-sampling (hereinafter, referred to as "the third method"). Here, V, H, D1, and D2 respectively denote the results of sample-based one-dimensional Laplacian operations for the vertical direction, the horizontal direction, the first diagonal direction, and the second diagonal direction. That is, one-dimensional Laplacian operations are performed along the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction at positions V, H, D1, and D2, respectively. In addition, the positions of performing the one-dimensional Laplacian operations can be the positions of sub-sampling. In Figure 52 , a block classification index C is assigned based on each 4x4 size block (i.e., a shadow). In this case, the operation range for calculating the one-dimensional Laplacian sum can be greater than the size of the block classification unit. Here, the thin solid line rectangle denotes a reconstructed sample position, and the thick solid line rectangle denotes the operation range for calculating the one-dimensional Laplacian sum.
[0797] Specifically, the third method refers to performing a one-dimensional Laplacian operation at a position (x, y) when either a coordinate x value or a coordinate y value is even and the other is odd. When both the coordinate x value and the coordinate y value are even or odd, the result of the one-dimensional Laplacian operation a...
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 a gradient value for 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 point are both even-numbered positions or both odd-numbered positions, and The filter information is decoded for each of the luminance and chrominance components.
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 a gradient value for 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 point are both even-numbered positions or both odd-numbered positions, and The filter information is encoded for each of the luminance and chrominance components.
3. A method for transmitting a bitstream generated by an image encoding method, the 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 a gradient value for 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 point are both even-numbered positions or both odd-numbered positions, and The filter information is encoded for each of the luminance and chrominance components.
Citation Information
Patent Citations
Image encoding / decoding apparatus and method to which filter selection by precise units is applied
CN103733624A
Video encoding method and video encoding apparatus and video decoding method and video decoding apparatus for signaling SAO parameter
CN104641640A