Image encoding, decoding method and recording medium storing bit stream
By selecting an appropriate filtering method according to image features during the image encoding/decoding process, the problem of limited filtering methods in the prior art is solved, and the efficiency and quality of image encoding/decoding are improved.
Patent Information
- Application Number
- CN202211279195.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-10-20
- Filing Date
- 2018-10-19
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2038-10-19
AI Technical Summary
The prior art filtering methods are limited in the image encoding/decoding process, resulting in insufficiency of encoding/decoding, especially when processing high-resolution and high-quality images, with increased transmission and storage costs.
Using an image encoding/decoding method that performs various filtering methods at each step, the appropriate filter is selected based on the characteristics of the area where it is located (uniform area, edge area or pseudo-edge area) ( Smoothing filter, edge retention filter or method to eliminate noise samples) filter.
Improves the encoding/decoding efficiency of the image, generates predicted images close to the original image, reduces the computational complexity of the image encoder and decoder, and improves the ringing effect in the target boundary area of the image and the contour effect in direction prediction. .
Smart Images

Figure CN115442599B_ABST
Abstract
Description
[0001] This application is a divisional application of an invention patent application with an application date of October 19, 2018, application number "201880068209.8", and title "Image encoding / decoding method and device and recording medium for storing bit stream". Technical Field
[0002] The present invention relates to an image encoding / decoding method and apparatus and a recording medium storing a bit stream. More particularly, the present invention relates to an image encoding / decoding method and apparatus using various filtering methods. Background Art
[0003] Recently, the demand for high-resolution and high-quality images such as high-resolution (HD) images and ultra-high-definition (UHD) images has increased in various application fields. However, higher-resolution and higher-quality image data has an increased amount of data compared to conventional image data. Therefore, when image data is transmitted by using a medium such as conventional wired and wireless broadband networks, or when image data is stored by using conventional storage media, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data increase, efficient image encoding / decoding technology is required for higher-resolution and higher-quality images.
[0004] The image compression technology includes various technologies, including: an inter-frame prediction technology for predicting pixel values included in a current picture from a previous picture or a subsequent picture of the current picture; an intra-frame prediction technology for predicting pixel values included in the current picture by using pixel information in the current picture; a transform and quantization technology for compressing the energy of a residual signal; an entropy coding technology for assigning a short code to a value with a high frequency of occurrence and a long code to a value with a low frequency of occurrence; etc. Image data can be effectively compressed by using such an image compression technology, and can be transmitted or stored.
[0005] The types of filtering methods used in conventional image encoding / decoding methods and apparatuses and methods of applying the types are limited, and thus encoding / decoding is limited. Summary of the invention
[0006] Technical issues
[0007] The present invention provides various filtering methods performed at each step when performing image encoding / decoding to improve the encoding / decoding efficiency of the image.
[0008] Technical Solution
[0009] A method for decoding an image according to the present invention may include: determining a reference sample of a current block; performing filtering on the reference sample based on characteristics of an area including the reference sample; and performing intra-frame prediction by using the reference sample on which filtering is performed.
[0010] In the method for decoding an image, the feature of the region including the reference sample is any one of a uniform region, an edge region and a pseudo edge region.
[0011] In the method of decoding an image, wherein in the step of performing filtering on the reference sample, when a feature of a region including the reference sample is a uniform region, filtering is performed by using a smoothing filter.
[0012] In the method of decoding an image, wherein in the step of performing filtering on the reference sample, when a feature of a region including the reference sample is an edge region, filtering is performed by using an edge-preserving filter.
[0013] In the method of decoding an image, wherein in the step of performing filtering on reference samples, when a feature of a region including the reference samples is a pseudo edge region, filtering is performed by excluding samples determined to be noise.
[0014] In a method for decoding an image, a feature of a region including a reference sample is determined based on a uniformity of the region.
[0015] In the method for decoding an image, it also includes: determining whether to perform filtering on the reference sample based on at least one of the size of the current block, the shape of the current block, the intra-frame prediction mode of the current block, the division depth of the current block and the pixel component of the current block, wherein the operation of performing filtering on the reference sample is performed based on the determined result.
[0016] In a method for decoding an image, the step of performing filtering on a reference sample includes: determining a filter length based on at least one of a size of a current block, a shape of the current block, an intra prediction mode of the current block, a partition depth of the current block, and a pixel component of the current block; and performing filtering on the reference sample based on the determined filter length.
[0017] In the method for decoding an image, the reference sample of the current block is at least one of at least one reconstructed sample line located on the left side of the current block and at least one reconstructed sample line located on the upper side of the current block.
[0018] A method for encoding an image according to the present invention may include: determining a reference sample of a current block; performing filtering on the reference sample based on characteristics of an area including the reference sample; and performing intra-frame prediction by using the reference sample on which filtering is performed.
[0019] In the method for encoding an image, the feature of the region including the reference sample is any one of a uniform region, an edge region and a pseudo edge region.
[0020] In the method of encoding an image, wherein in the step of performing filtering on the reference sample, when a feature of a region including the reference sample is a uniform region, filtering is performed by using a smoothing filter.
[0021] In the method of encoding an image, wherein in the step of performing filtering on the reference sample, when a feature of a region including the reference sample is an edge region, filtering is performed by using an edge-preserving filter.
[0022] In the method of encoding an image, wherein in the step of performing filtering on the reference sample, when a feature of a region including the reference sample is a pseudo edge region, filtering is performed by excluding pixels determined to be noise.
[0023] In a method for encoding an image, a feature of a region including a reference sample is determined based on a uniformity of the region.
[0024] In the method for encoding an image, it also includes: determining whether to perform filtering on the reference sample based on at least one of the size of the current block, the shape of the current block, the intra-frame prediction mode of the current block, the division depth of the current block, and the pixel component of the current block, wherein the filtering on the reference sample is performed based on the determined result.
[0025] In a method for encoding an image, the step of performing filtering on a reference sample includes: determining a filter length based on at least one of a size of a current block, a shape of the current block, an intra prediction mode of the current block, a partition depth of the current block, and a pixel component of the current block; and performing filtering on the reference sample based on the determined filter length.
[0026] In the method for encoding an image, the reference sample of the current block is at least one of at least one reconstructed sample line located on the left side of the current block and at least one reconstructed sample line located on the upper side of the current block.
[0027] A recording medium according to the present invention stores a bit stream generated by performing an image encoding method, wherein the image encoding method includes: determining a reference sample of a current block; performing filtering on the reference sample based on characteristics of an area including the reference sample; and performing intra-frame prediction by using the reference sample on which filtering is performed.
[0028] Beneficial Effects
[0029] The present invention can provide various filtering methods performed at each step when performing image encoding / decoding to improve the encoding / decoding efficiency of the image.
[0030] The present invention can improve prediction efficiency by generating a predicted image using reference samples close to the original image.
[0031] The present invention can improve the ringing effect in the object boundary area of the image and the contour effect occurring when performing direction prediction.
[0032] According to the present invention, the encoding and decoding efficiency of images can be improved.
[0033] According to the present invention, the computational complexity of an image encoder and a decoder can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.
[0035] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.
[0036] Figure 3 is a diagram schematically showing a partition structure of an image when encoding and decoding the image.
[0037] Figure 4 is a diagram illustrating an intra prediction process.
[0038] Figure 5 is a diagram illustrating an inter-frame prediction process.
[0039] Figure 6 is a diagram illustrating transform and quantization processing.
[0040] Figure 7 is a diagram showing an example of an embodiment in which reference samples are configured by using a plurality of reconstruction sample lines.
[0041] Figure 8 is a diagram illustrating image characteristics of a region including reference samples according to an embodiment of the present invention.
[0042] Fig. 9is a diagram illustrating a method of deriving uniformity of an image according to an embodiment of the present invention.
[0043] Fig.10 is a diagram illustrating a method of deriving uniformity of an image by using a gradient according to an embodiment of the present invention.
[0044] Fig.11 is a diagram illustrating a direction in which filtering is applied according to an embodiment of the present invention.
[0045] Fig.12 is a diagram illustrating a pixel area used for filtering according to an embodiment of the present invention.
[0046] Fig.13 is a diagram showing an example of an embodiment in which filtering is applied in 1 / 4 (or quarter pel) units.
[0047] Fig.14 : is a diagram showing an embodiment example in which filtering is performed when a region for filtering is located outside a boundary at a part thereof.
[0048] Fig.15 is a diagram illustrating a 1D filter according to an embodiment of the present invention.
[0049] Fig.16 is a diagram illustrating a 2D filter according to an embodiment of the present invention.
[0050] Fig.17 is a flowchart illustrating an image decoding method according to an embodiment of the present invention.
[0051] Fig.18 is a flowchart illustrating an image decoding method according to another embodiment of the present invention. DETAILED DESCRIPTION
[0052] Various modifications may be made to the present invention, and there are various embodiments of the present invention, wherein examples of the various embodiments will now be provided with reference to the accompanying drawings and examples of the various embodiments will be described in detail. However, the present invention is not limited thereto, although the exemplary embodiments may be interpreted as including all modifications, equivalents or replacement forms within the technical concept and technical scope of the present invention. Similar reference numerals refer to functions that are identical or similar in all respects. In the accompanying drawings, the shapes and sizes of the elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that illustrate specific embodiments in which the present invention may be implemented by way of illustration. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, without departing from the spirit and scope of the present disclosure, the specific features, structures and characteristics described herein in conjunction with one embodiment may be implemented in other embodiments. In addition, it should be understood that without departing from the spirit and scope of the present disclosure, the position or arrangement of each element within each disclosed embodiment may be modified. Therefore, the following detailed description should not be understood in a limiting sense, and the scope of the present disclosure is limited only by the appended claims (with the full range of equivalents claimed by the claims, in the case of appropriate interpretation).
[0053] The terms "first", "second", etc. used in the specification may be used to describe various components, but these components are not interpreted as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, the "first" component may be referred to as the "second" component, and the "second" component may also be similarly referred to as the "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.
[0054] It will be understood that, in this specification, when an element is merely referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, the element may be “directly connected to” or “directly coupled to” the other element, or connected to or coupled to the other element with other elements between the element and the other element. Conversely, it should be understood that when an element is referred to as being “directly coupled to” or “directly coupled to” another element, there are no intervening elements.
[0055] In addition, the components shown in the embodiments of the present invention are shown independently to present characteristic functions different from each other. Therefore, this does not mean that each component is composed of a component unit of separate hardware or software. In other words, for convenience, each component includes each of the enumerated components. Therefore, at least two components in each component can be combined to form a component, or a component can be divided into a plurality of components for performing each function. Without departing from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is divided are also included in the scope of the present invention.
[0056] The terms used in this specification are only used to describe specific embodiments, and are not intended to limit the present invention. Expressions used in the singular include plural expressions, unless it has a significantly different meaning in the context. In this specification, it will be understood that terms such as "including ... ", "having ... ", etc. are intended to indicate that there are features, quantities, steps, actions, elements, parts, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, quantities, steps, actions, elements, parts, or combinations thereof may exist or may be added. In other words, when a particular element is referred to as "included", the elements other than the corresponding elements are not excluded, but additional elements may be included in embodiments of the present invention or in the scope of the present invention.
[0057] In addition, some components may not be indispensable components for performing the necessary functions of the present invention, but optional components that only improve their performance. The present invention can be implemented by only including the indispensable components for implementing the essence of the present invention and excluding the components used when improving performance. The structure that only includes the indispensable components and excludes the optional components used when only improving performance is also included in the scope of the present invention.
[0058] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing the exemplary embodiments of the present invention, well-known functions or structures will not be described in detail because they will unnecessarily obscure the understanding of the present invention. The same components in the accompanying drawings are represented by the same reference numerals, and repeated descriptions of the same components will be omitted.
[0059] Hereinafter, an image may refer to a picture constituting a video, or may refer to the video itself. For example, “encoding or decoding an image or both encoding and decoding” may refer to “encoding or decoding a moving picture or both encoding and decoding”, and may refer to “encoding or decoding one of the images of the moving picture or both encoding and decoding.”
[0060] Hereinafter, the terms "motion picture" and "video" may be used as the same meaning and may be replaced with each other.
[0061] Hereinafter, a target image may be an encoding target image as an encoding target and / or a decoding target image as a decoding target. In addition, a target image may be an input image input to an encoding device, and an input image input to a decoding device. Here, the target image may have the same meaning as the current image.
[0062] Hereinafter, the terms "image", "picture", "frame" and "screen" may be used as the same meaning and replaced with each other.
[0063] Hereinafter, the target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. In addition, the target block may be a current block as a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used as the same meaning and may be replaced with each other.
[0064] Hereinafter, the terms "block" and "unit" may be used as the same meaning and replaced with each other. Alternatively, a "block" may refer to a specific unit.
[0065] In the following, the terms "region" and "segment" are used interchangeably.
[0066] Hereinafter, a specific signal may be a signal representing a specific block. For example, an original signal may be a signal representing a target block. A prediction signal may be a signal representing a prediction block. A residual signal may be a signal representing a residual block.
[0067] In an embodiment, each of the specific information, data, flags, indexes, elements, attributes, etc. may have a value. The value of the information, data, flags, indexes, elements, and attributes equal to "0" may represent a logical false or a first predefined value. In other words, the value "0", false, logical false, and the first predefined value may be replaced with each other. The value of the information, data, flags, indexes, elements, and attributes equal to "1" may represent a logical true or a second predefined value. In other words, the value "1", true, logical true, and the second predefined value may be replaced with each other.
[0068] When the variable i or j is used to represent a column, row, or index, the value of i may be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, the columns, rows, indexes, etc. may be counted from 0 or 1.
[0069] Terminology Description
[0070] Encoder: This refers to a device that performs encoding. In other words, it refers to an encoding device.
[0071] Decoder: Refers to a device that performs decoding. In other words, it refers to a decoding device.
[0072] Block: is an M×N sample array. Here, M and N may represent positive integers, and a block may represent a sample array in a two-dimensional form. A block may refer to a unit. A current block may represent an encoding target block that becomes a target at the time of encoding, or a decoding target block that becomes a target at the time of decoding. In addition, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.
[0073] Sample: It is the basic unit of a block. According to the bit depth (Bd), a sample can be represented from 0 to 2 Bd In the present invention, a sample point may be used as the meaning of a pixel. That is, a sample point, a pel, and a pixel may have the same meaning as each other.
[0074] Unit: may refer to a coding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. In addition, when a single image is partitioned into sub-division units during encoding or decoding, a unit may represent a sub-division unit. That is, an image may be partitioned into a plurality of units. When encoding and decoding an image, a predetermined process for each unit may be performed. A single unit may be partitioned into sub-units having a size smaller than that of the unit. Depending on the function, a unit may represent a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, and the like. In addition, in order to distinguish a unit from a block, a unit may include a luminance component block, a chrominance component block associated with the luminance component block, and a syntax element for each color component block. A unit may have various sizes and shapes, and specifically, the shape of a unit may be a two-dimensional geometric figure such as a square, a rectangle, a trapezoid, a triangle, a pentagon, and the like. Also, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transformation unit, etc., and a unit size, a unit depth, an order of encoding and decoding of the unit, and the like.
[0075] Coding tree unit: A single coding tree block configured with a luminance component Y and two coding tree blocks associated with chrominance components Cb and Cr. In addition, the coding tree unit may represent a syntax element including a block and each block. Each coding tree unit may be partitioned by using at least one of a quadtree partitioning method, a binary tree partitioning method, and a ternary tree partitioning method to configure a lower-level unit such as a coding unit, a prediction unit, a transform unit, etc. The coding tree unit may be used as a term for specifying a sample block that becomes a processing unit when encoding / decoding an image as an input image. Here, the quadtree may represent a quadtree.
[0076] Coding tree block: may be used as a term used to designate any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.
[0077] Neighboring block: may refer to a block adjacent to the current block. The block adjacent to the current block may refer to a block that touches the boundary of the current block or a block that is located within a predetermined distance from the current block. The neighboring block may refer to a block adjacent to a vertex of the current block. Here, the block adjacent to a vertex of the current block may refer to a block that is vertically adjacent to a neighboring block that is horizontally adjacent to the current block or a block that is horizontally adjacent to a neighboring block that is vertically adjacent to the current block.
[0078] Reconstructed neighboring block: may refer to a neighboring block that is adjacent to the current block and has been encoded or decoded in space / time. Here, the reconstructed neighboring block may refer to a reconstructed neighboring unit. The reconstructed spatial neighboring block may be a block that is within the current picture and has been reconstructed by encoding or decoding or both encoding and decoding. The reconstructed temporal neighboring block is a block at a position corresponding to the current block of the current picture within the reference image or a neighboring block of the block.
[0079] Unit depth: can represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) can correspond to the first unit that is not partitioned. In addition, the highest node can have a minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 can represent a unit generated by partitioning the first unit once. A node with a depth of level 2 can represent a unit generated by partitioning the first unit twice. A node with a depth of level n can represent a unit generated by partitioning the first unit n times. A leaf node can be the lowest node and a node that cannot be further partitioned. The depth of a leaf node can be the maximum level. For example, the predefined value of the maximum level can be 3. The depth of the root node can be the lowest, and the depth of the leaf node can be the deepest. In addition, when a unit is represented as a tree structure, the level at which the unit exists can represent the unit depth.
[0080] Bitstream: can represent a stream of bits including coded image information.
[0081] Parameter set: corresponds to header information in the configuration within the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set may be included in the parameter set. In addition, the parameter set may include slice header and tile header information.
[0082] Parsing: may mean determining the value of a syntax element by performing entropy decoding, or may mean the entropy decoding itself.
[0083] Symbol: At least one of a syntax element, a coding parameter, and a transform coefficient value that can represent a coding / decoding target unit. In addition, the symbol can represent an entropy coding target or an entropy decoding result.
[0084] Prediction mode: may be information indicating a mode for encoding / decoding using intra prediction or a mode for encoding / decoding using inter prediction.
[0085] Prediction unit: may represent a basic unit when performing prediction (such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation). A single prediction unit may be partitioned into multiple partitions of smaller size, or may be partitioned into multiple prediction units of lower levels. Multiple partitions may be basic units when performing prediction or compensation. Partitions generated by splitting a prediction unit may also be prediction units.
[0086] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.
[0087] Reference picture list: may refer to a list including one or more reference pictures used for inter prediction or motion compensation. There are several types of available reference picture lists, including LC (List Combination), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3).
[0088] Inter prediction indicator: may refer to the direction of inter prediction (unidirectional prediction, bidirectional prediction, etc.) of the current block. Optionally, the inter prediction indicator may refer to the number of reference pictures used to generate the prediction block of the current block. Optionally, the inter prediction indicator may refer to the number of prediction blocks used when performing inter prediction or motion compensation on the current block.
[0089] Prediction list utilization flag: indicates whether at least one reference picture in a specific reference picture list is used to generate a prediction block. The prediction list utilization flag may be used to derive the inter prediction indicator, and conversely, the inter prediction indicator may be used to derive the prediction list utilization flag. For example, when the prediction list utilization flag has a first value of zero (0), it indicates that the reference picture in the reference picture list is not used to generate the prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it indicates that the reference picture list is used to generate the prediction block.
[0090] Reference picture index: may refer to an index indicating a specific reference picture in a reference picture list.
[0091] Reference picture: may refer to a reference picture referenced by a specific block for the purpose of inter-frame prediction or motion compensation for the specific block. Alternatively, the reference picture may be a picture including a reference block referenced by the current block for inter-frame prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference image" have the same meaning and may be replaced with each other.
[0092] Motion vector: can be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector can represent the offset between an encoding / decoding target block and a reference block. For example, (mvX, mvY) can represent a motion vector. Here, mvX can represent a horizontal component, and mvY can represent a vertical component.
[0093] Search range: may be a two-dimensional area searched during inter prediction to retrieve a motion vector. For example, the size of the search range may be M×N. Here, M and N are both integers.
[0094] Motion vector candidate: may refer to a prediction candidate block or a motion vector of a prediction candidate block when predicting a motion vector. In addition, the motion vector candidate may be included in a motion vector candidate list.
[0095] Motion vector candidate list: may represent a list consisting of one or more motion vector candidates.
[0096] Motion vector candidate index: may represent an indicator indicating a motion vector candidate in a motion vector candidate list. Alternatively, the motion vector candidate index may be an index of a motion vector predictor.
[0097] Motion information: may represent information including at least one of the following items: motion vector, reference picture index, inter prediction indicator, prediction list utilization flag, reference picture list information, reference picture, motion vector candidate, motion vector candidate index, merge candidate, and merge index.
[0098] Merge candidate list: may represent a list consisting of one or more merge candidates.
[0099] Merge candidate: can represent spatial merge candidate, temporal merge candidate, combined merge candidate, combined bi-prediction merge candidate or zero merge candidate. Merge candidate can include motion information such as inter prediction indicator, reference picture index for each list, motion vector, prediction list utilization flag and inter prediction indicator.
[0100] Merge index: may represent an indicator indicating a merge candidate in a merge candidate list. Optionally, the merge index may indicate a block from which a merge candidate has been derived among reconstructed blocks that are spatially / temporally adjacent to the current block. Optionally, the merge index may indicate at least one piece of motion information of the merge candidate.
[0101] Transform unit: may represent a basic unit when encoding / decoding (such as transform, inverse transform, quantization, inverse quantization, transform coefficient encoding / decoding) is performed on a residual signal. A single transform unit may be partitioned into a plurality of lower-level transform units having a smaller size. Here, the transform / inverse transform may include at least one of a first transform / first inverse transform and a second transform / second inverse transform.
[0102] Scaling: may refer to the process of multiplying the level of quantization by a factor. Transform coefficients may be generated by scaling the level of quantization. Scaling may also be referred to as inverse quantization.
[0103] Quantization parameter: may indicate a value used when a transform coefficient is used to generate a quantized level during quantization. The quantization parameter may also indicate a value used when a transform coefficient is generated by scaling the quantized level during inverse quantization. The quantization parameter may be a value mapped to a quantization step size.
[0104] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.
[0105] Scan: may refer to a method of ordering coefficients within a cell, block, or matrix. For example, changing a two-dimensional matrix of coefficients to a one-dimensional matrix may be called scanning, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix may be called scanning or inverse scanning.
[0106] Transform coefficient: may refer to a coefficient value generated after performing a transform in an encoder. Transform coefficient may refer to a coefficient value generated after performing at least one of entropy decoding and inverse quantization in a decoder. A quantization level obtained by quantizing a transform coefficient or a residual signal or a quantized transform coefficient level may also fall within the meaning of a transform coefficient.
[0107] Quantization level: may represent a value generated by quantizing a transform coefficient or a residual signal in an encoder. Alternatively, the quantization level may represent a value that is a dequantization target to be subjected to dequantization in a decoder. Similarly, the quantized transform coefficient level as a result of transformation and quantization may also fall within the meaning of the quantization level.
[0108] Non-zero transform coefficient: may refer to a transform coefficient having a value other than zero, or a transform coefficient level or quantization level having a value other than zero.
[0109] Quantization matrix: may refer to a matrix used in a quantization process or an inverse quantization process performed to improve subjective image quality or objective image quality. The quantization matrix may also be referred to as a scaling list.
[0110] Quantization matrix coefficients: can represent each element in the quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.
[0111] Default matrix: may represent a predetermined quantization matrix predefined in an encoder or a decoder.
[0112] Non-default matrix: may denote a quantization matrix that is not predefined in the encoder or decoder but is signaled by the user.
[0113] Statistical value: The statistical value for at least one of a variable, a coding parameter, a constant value, etc. having a calculable specific value can be one or more of the average value, weighted average value, weighted sum value, minimum value, maximum value, most frequently occurring value, median value, and interpolated value of the corresponding specific value.
[0114] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0115] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include at least one image. The encoding device 100 may sequentially encode at least one image.
[0116] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.
[0117] The encoding device 100 may perform encoding on the input image by using an intra mode or an inter mode or both the intra mode and the inter mode. In addition, the encoding device 100 may generate a bit stream including encoding information by encoding the input image, and output the generated bit stream. The generated bit stream may be stored in a computer-readable recording medium, or may be streamed through a wired / wireless transmission medium. When the intra mode is used as a prediction mode, the switch 115 may switch to the intra mode. Alternatively, when the inter mode is used as a prediction mode, the switch 115 may switch to the inter mode. Here, the intra mode may represent an intra prediction mode, and the inter mode may represent an inter prediction mode. The encoding device 100 may generate a prediction block for an input block of the input image. In addition, the encoding device 100 may encode the residual block using the residual of the input block and the prediction block after generating the prediction block. The input image may be referred to as a current image as a current encoding target. The input block may be referred to as a current block as a current encoding target, or may be referred to as an encoding target block.
[0118] When the prediction mode is the intra mode, the intra prediction unit 120 may use samples of a block that has been encoded / decoded and is adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block by using the reference samples, or may generate prediction samples of the input block by performing spatial prediction. Here, intra prediction may refer to prediction within a frame.
[0119] When the prediction mode is the inter mode, the motion prediction unit 111 may retrieve the area that best matches the input block from the reference image when performing motion prediction, and derive a motion vector by using the retrieved area. In this case, the search area may be used as the area. The reference image may be stored in the reference picture buffer 190. Here, when encoding / decoding the reference image is performed, the reference image may be stored in the reference picture buffer 190.
[0120] The motion compensation unit 112 may generate a predicted block by performing motion compensation on the current block using a motion vector. Here, inter prediction may refer to prediction or motion compensation between frames.
[0121] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial area of a reference picture. In order to perform inter-picture prediction or motion compensation on a coding unit, it may be determined which mode among the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode is used for motion prediction and motion compensation of a prediction unit included in the corresponding coding unit. Then, depending on the determined mode, inter-picture prediction or motion compensation may be performed differently.
[0122] The subtractor 125 may generate a residual block by using the residual of the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may represent the difference between the original signal and the prediction signal. In addition, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal, or by transforming and quantizing. The residual block may be a residual signal of a block unit.
[0123] The transform unit 130 may generate a transform coefficient by performing a transform on the residual block and output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip the transform on the residual block.
[0124] The quantized level may be generated by applying quantization to a transform coefficient or to a residual signal. Hereinafter, the quantized level may also be referred to as a transform coefficient in an embodiment.
[0125] The quantization unit 140 may generate a quantization level by quantizing the transform coefficient or the residual signal according to the parameter and output the generated quantization level. Here, the quantization unit 140 may quantize the transform coefficient by using a quantization matrix.
[0126] The entropy encoding unit 150 may generate a bitstream by performing entropy encoding on the value calculated by the quantization unit 140 or the encoding parameter value calculated when encoding is performed according to the probability distribution, and output the generated bitstream. The entropy encoding unit 150 may perform entropy encoding on sample information of the image and information for decoding the image. For example, the information for decoding the image may include a syntax element.
[0127] When entropy coding is applied, symbols are represented so that a smaller number of bits are allocated to symbols with a high probability of generation, and a larger number of bits are allocated to symbols with a low probability of generation, and therefore, the size of the bit stream for the symbol to be encoded can be reduced. The entropy coding unit 150 may use a coding method for entropy coding such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 may perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 may derive a binarization method of a target symbol and a probability model of a target symbol / binary bit, and perform arithmetic coding by using the derived binarization method and context model.
[0128] In order to encode a transform coefficient level (quantized level), the entropy encoding unit 150 may change a coefficient in a two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.
[0129] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and sent to the decoder with a signal, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partition direction (horizontal or vertical), binary tree partition form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, the direction of multi-type tree partitioning direction (horizontal or vertical), type of multi-type tree partitions (symmetric or asymmetric) and tree (binary tree or ternary tree) structure of multi-type tree partitions, prediction mode (intra-frame prediction or inter-frame prediction), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter taps, reference sample filter coefficients, prediction block filtering method, prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, intra-frame prediction mode, Inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation accuracy of motion vector, transform type, transform size, information on whether the first (first) transform is used, information on whether the second transform is used, first transform index, second transform index , information on whether a residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an intra-frame loop filter, intra-frame loop filter coefficients, intra-frame loop filter taps, intra-frame loop filter shape / form, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form,Binarization / debinarization method, context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag for unit of coefficient group, position of last valid coefficient, flag on whether the value of coefficient is greater than 1, flag on whether the value of coefficient is greater than 2, flag on whether the value of coefficient is greater than 3, information on remaining coefficient value, sign information, reconstructed luminance sample, reconstructed chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, The size of the motion vector search area at the decoder side, the shape of the motion vector search area at the decoder side, the number of motion vector searches at the decoder side, information about the CTU size, information about the minimum block size, information about the maximum block size, information about the maximum block depth, information about the minimum block depth, image display / output order, slice identification information, slice type, slice partition information, tile identification information, tile type, tile partition information, picture type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantization levels, and information about a luminance signal or information about a chrominance signal.
[0130] Here, signaling a flag or an index may mean entropy encoding the corresponding flag or index by an encoder and including it in a bitstream, and may mean entropy decoding the corresponding flag or index from the bitstream by a decoder.
[0131] When the encoding apparatus 100 performs encoding by inter-frame prediction, the encoded current image may be used as a reference image for another image that is subsequently processed. Therefore, the encoding apparatus 100 may reconstruct or decode the encoded current image, or store the reconstructed or decoded image as a reference image in the reference picture buffer 190.
[0132] The quantized level may be dequantized in the dequantization unit 160 or may be inversely transformed in the inverse transform unit 170. The dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may be added to the prediction block by the adder 175. By adding the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient to the prediction block, a reconstructed block may be generated. Here, the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may mean a coefficient on which at least one of dequantization and inverse transformation is performed, and may mean a reconstructed residual block.
[0133] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed sample, the reconstructed block, or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.
[0134] The deblocking filter may remove block distortion generated in the boundary between blocks. In order to determine whether to apply the deblocking filter, it may be determined whether to apply the deblocking filter to the current block based on the samples included in the number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter may be applied according to the required deblocking filter strength.
[0135] In order to compensate for the coding error, a suitable offset value may be added to the sample value by using sample adaptive offset. Sample adaptive offset can correct the offset of the deblocked image from the original image in units of samples. A method of applying the offset in consideration of edge information about each sample may be used, or a method of partitioning the samples of the image into a predetermined number of regions, determining the region to which the offset is applied, and applying the offset to the determined region may be used.
[0136] The adaptive loop filter may perform filtering based on a comparison result of a filtered reconstructed image and an original image. Samples included in an image may be partitioned into predetermined groups, a filter to be applied to each group may be determined, and differential filtering may be performed on each group. Information on whether ALF is applied may be signaled by a coding unit (CU), and the form and coefficient of ALF to be applied to each block may vary.
[0137] The reconstructed block or the reconstructed image that has passed through the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed block processed by the filter unit 180 may be a part of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 180. The stored reference image may be used later in inter-frame prediction or motion compensation.
[0138] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment and to which the present invention is applied.
[0139] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0140] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 225, a filter unit 260 and a reference picture buffer 270.
[0141] The decoding device 200 may receive a bit stream output from the encoding device 100. The decoding device 200 may receive a bit stream stored in a computer-readable recording medium, or may receive a bit stream streamed through a wired / wireless transmission medium. The decoding device 200 may decode the bit stream by using an intra mode or an inter mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.
[0142] When the prediction mode used in decoding is the intra mode, the switch may be switched to the intra mode. Alternatively, when the prediction mode used in decoding is the inter mode, the switch may be switched to the inter mode.
[0143] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block that becomes a decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as a current block.
[0144] The entropy decoding unit 210 may generate symbols by entropy decoding the bit stream according to the probability distribution. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be an inverse process of the above entropy encoding method.
[0145] In order to decode the transform coefficient levels (quantized levels), the entropy decoding unit 210 may change the coefficients in the form of a one-way vector into a two-dimensional block form by using a transform coefficient scanning method.
[0146] The quantized level may be dequantized in the dequantization unit 220, or the quantized level may be inversely transformed in the inverse transform unit 230. The quantized level may be a result of dequantization or inverse transformation or both, and may be generated as a reconstructed residual block. Here, the dequantization unit 220 may apply a quantization matrix to the quantized level.
[0147] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values of a block that is adjacent to the decoding target block and has been decoded.
[0148] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270 .
[0149] 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 image. The filter unit 260 can output the reconstructed image. The reconstructed block or the reconstructed image can be stored in the reference picture buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by the filter unit 260 can be a part of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference image can be used later in inter-frame prediction or motion compensation.
[0150] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded. Figure 3 An example of partitioning a single cell into a plurality of lower-level cells is schematically shown.
[0151] In order to effectively partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing an intra prediction mode from an inter prediction mode when encoding / decoding an image. A coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of a transform coefficient.
[0152] Reference Figure 3 , the image 300 is partitioned sequentially according to the maximum coding unit (LCU), and the LCU unit is determined as a partition structure. Here, the LCU may be used in the same meaning as the coding tree unit (CTU). Unit partitioning may mean partitioning a block associated with the unit. In the block partition information, information about the unit depth may be included. The depth information may indicate the number or degree of the unit being partitioned or both the number and degree of the unit being partitioned. A single unit may be partitioned into a plurality of lower-level units hierarchically associated with the depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning the unit may correspond to a node and a child node of the node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information indicating the size of a CU and may be stored in each CU. The unit depth indicates the number and / or degree associated with partitioning the unit. Therefore, the partition information of the lower-level unit may include information about the size of the lower-level unit.
[0153] The partition structure may represent the distribution of coding units (CUs) within the LCU 310. Such distribution may be determined according to whether a single CU is partitioned into a plurality of (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal size and vertical size of the CU generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning, respectively, or may have sizes smaller than the horizontal size and vertical size before partitioning, respectively, according to the number of partitioning times. The CU may be recursively partitioned into a plurality of CUs. By recursive partitioning, at least one of the height and width of the CU after partitioning may be reduced compared to at least one of the height and width of the CU before partitioning. The partitioning of the CU may be recursively performed until a predefined depth or a predefined size. For example, the depth of the LCU may be 0, and the depth of the smallest coding unit (SCU) may be a predefined maximum depth. Here, as described above, the LCU may be a coding unit having a maximum coding unit size, and the SCU may be a coding unit having a minimum coding unit size. Partitioning starts from the LCU 310, and when the horizontal size or vertical size or both the horizontal size and the vertical size of the CU are reduced by partitioning, the CU depth increases by 1. For example, for each depth, the size of the non-partitioned CU may be 2N×2N. Also, in the case of a partitioned CU, a CU of size 2N×2N may be partitioned into four CUs of size N×N. As the depth increases by 1, the size of N may be halved.
[0154] In addition, information on whether a CU is partitioned may be indicated by using the partition information of the CU. The partition information may be 1-bit information. All CUs except the SCU may include partition information. For example, when the value of the partition information is 1, the CU may not be partitioned, and when the value of the partition information is 2, the CU may be partitioned.
[0155] Reference Figure 3 , an LCU with a depth of 0 may be a block of 64×64. 0 may be the minimum depth. An SCU with a depth of 3 may be a block of 8×8. 3 may be the maximum depth. A CU of a block of 32×32 and a CU of a block of 16×16 may be represented as depth 1 and depth 2, respectively.
[0156] For example, when a single coding unit is partitioned into four coding units, the horizontal size and vertical size of the four coding units partitioned may be half the size of the horizontal size and vertical size of the CU before being partitioned. In one embodiment, when a coding unit of size 32×32 is partitioned into four coding units, each of the four coding units partitioned may have a size of 16×16. When a single coding unit is partitioned into four coding units, it can be said that the coding unit can be partitioned into a quadtree form.
[0157] For example, when one coding unit is partitioned into two sub-coding units, the horizontal size or vertical size (width or height) of each of the two sub-coding units may be half of the horizontal size or vertical size of the original coding unit. For example, when a coding unit of size 32×32 is partitioned vertically into two sub-coding units, each of the two sub-coding units may have a size of 16×32. For example, when a coding unit of size 8×32 is partitioned horizontally into two sub-coding units, each of the two sub-coding units may have a size of 8×16. When one coding unit is partitioned into two sub-coding units, the coding unit may be said to be partitioned into two, or partitioned according to a binary tree partition structure.
[0158] For example, when one coding unit is partitioned into three sub-coding units, the horizontal size or the vertical size of the coding unit may be partitioned at a ratio of 1:2:1, thereby generating three sub-coding units having a ratio of the horizontal size or the vertical size of 1:2:1. For example, when a coding unit having a size of 16×32 is partitioned horizontally into three sub-coding units, the three sub-coding units may have sizes of 16×8, 16×16, and 16×8, respectively, in order from the uppermost sub-coding unit to the lowermost sub-coding unit. For example, when a coding unit having a size of 32×32 is vertically divided into three sub-coding units, the three sub-coding units may have sizes of 8×32, 16×32, and 8×32, respectively, in order from the left sub-coding unit to the right sub-coding unit. When one coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned into three sub-coding units or partitioned according to a ternary tree partition structure.
[0159] exist Figure 3 , a coding tree unit (CTU) 320 is an example of a CTU to which a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure are all applied.
[0160] As described above, in order to partition a CTU, at least one of a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure may be applied. Various tree partition structures may be sequentially applied to a CTU according to a predetermined priority order. For example, a quadtree partition structure may be preferentially applied to a CTU. Coding units that can no longer be partitioned using a quadtree partition structure may correspond to leaf nodes of a quadtree. Coding units corresponding to leaf nodes of a quadtree may be used as root nodes of a binary and / or ternary tree partition structure. That is, coding units corresponding to leaf nodes of a quadtree may be further partitioned according to a binary tree partition structure or a ternary tree partition structure, or may not be further partitioned. Therefore, by preventing a coding block obtained from a binary tree partition or a ternary tree partition of a coding unit corresponding to a leaf node of a quadtree from undergoing further quadtree partitioning, a block partitioning operation and / or an operation of sending partition information with a signal may be effectively performed.
[0161] The fact that the coding unit corresponding to the node of the quadtree is partitioned may be signaled using the four partition information. The four partition information having a first value (e.g., '1') may indicate that the current coding unit is partitioned according to the quadtree partition structure. The four partition information having a second value (e.g., '0') may indicate that the current coding unit is not partitioned according to the quadtree partition structure. The four partition information may be a flag having a predetermined length (e.g., one bit).
[0162] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, the coding unit corresponding to the leaf node of the quadtree may further undergo any partitioning of the binary tree partitioning and the ternary tree partitioning. In addition, the coding unit generated by the binary tree partitioning or the ternary tree partitioning may undergo further binary tree partitioning or further ternary tree partitioning, or may not be further partitioned.
[0163] A tree structure in which there is no priority between binary tree partitions and ternary tree partitions is called a multi-type tree structure. A coding unit corresponding to a leaf node of a quadtree may be used as a root node of a multi-type tree. At least one of multi-type tree partition indication information, partition direction information, and partition tree information may be used to signal whether to partition a coding unit corresponding to a node of a multi-type tree. In order to partition a coding unit corresponding to a node of a multi-type tree, multi-type tree partition indication information, partition direction information, and partition tree information may be sequentially signaled.
[0164] The multi-type tree partition indication information having a first value (eg, '1') may indicate that the current coding unit will undergo multi-type tree partitioning. The multi-type tree partition indication information having a second value (eg, '0') may indicate that the current coding unit will not undergo multi-type tree partitioning.
[0165] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a multi-type tree partition structure, the coding unit may include partition direction information. The partition direction information may indicate in which direction the current coding unit will be partitioned according to the multi-type tree partition. The partition direction information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned vertically. The partition direction information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned horizontally.
[0166] When the coding unit corresponding to the node of the multi-type tree is further partitioned according to the multi-type tree partition structure, the current coding unit may include partition tree information. The partition tree information may indicate a tree partition structure to be used to partition the node of the multi-type tree. The partition tree information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to a binary tree partition structure. The partition tree information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to a ternary tree partition structure.
[0167] The partition indication information, the partition tree information and the partition direction information may all be flags having a predetermined length (eg, one bit).
[0168] At least any one of the quadtree partition indication information, the multi-type tree partition indication information, the partition direction information, and the partition tree information may be entropy encoded / decoded. In order to entropy encode / decode those types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, there is a high probability that the partition type (partitioned or not partitioned, partition tree, and / or partition direction) of the left neighboring coding unit and / or the upper neighboring coding unit of the current coding unit is similar to the partition type of the current coding unit. Therefore, context information for entropy encoding / decoding the information about the current coding unit may be derived from the information about the neighboring coding units. The information about the neighboring coding units may include at least any one of the quadtree partition information, the multi-type tree partition indication information, the partition direction information, and the partition tree information.
[0169] As another example, among binary tree partitioning and ternary tree partitioning, binary tree partitioning may be preferentially performed. That is, the current coding unit may first undergo binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree may be set as the root node for the ternary tree partitioning. In this case, for the coding unit corresponding to the node of the ternary tree, neither quadtree partitioning nor binary tree partitioning may be performed.
[0170] A coding unit that cannot be partitioned according to a quadtree partition structure, a binary tree partition structure, and / or a ternary tree partition structure becomes a basic unit for encoding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Therefore, partition structure information and partition information for partitioning a coding unit into a prediction unit and / or a transformation unit may not exist in the bitstream.
[0171] However, when the size of the coding unit (i.e., the basic unit for partitioning) is larger than the size of the maximum transform block, the coding unit may be recursively partitioned until the size of the coding unit is reduced to be equal to or smaller than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and when the size of the maximum transform block is 32×32, the coding unit may be partitioned into four 32×32 blocks for transforming. For example, when the size of the coding unit is 32×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into two 32×32 blocks for transforming. In this case, the partition of the coding unit for transforming is not separately signaled, and the partition of the coding unit for transforming may be determined by comparison between the horizontal size or vertical size of the coding unit and the horizontal size or vertical size of the maximum transform block. For example, when the horizontal size (width) of the coding unit is larger than the horizontal size (width) of the maximum transform block, the coding unit may be vertically divided into two equal parts. For example, when the vertical size (length) of the coding unit is larger than the vertical size (length) of the maximum transform block, the coding unit may be horizontally divided into two equal parts.
[0172] Information of the maximum and / or minimum size of the coding unit and information of the maximum and / or minimum size of the transform block may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, a sequence level, a picture level, a slice level, etc. For example, the minimum size of the coding unit may be determined to be 4×4. For example, the maximum size of the transform block may be determined to be 64×64. For example, the minimum size of the transform block may be determined to be 4×4.
[0173] Information of the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information of the maximum depth of the multi-type tree from the root node to the leaf node (maximum tree depth of the multi-type tree) may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, etc. Information of the minimum size of the quadtree and / or information of the maximum depth of the multi-type tree may be signaled or determined for each of the intra-picture slice and the inter-picture slice.
[0174] The difference information between the size of the CTU and the maximum size of the transform block may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, etc. Information on the maximum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the maximum size of the binary tree) may be determined based on the size of the coding tree unit and the difference information. The maximum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the maximum size of the ternary tree) may vary depending on the type of the slice. For example, for an intra-picture slice, the maximum size of the ternary tree may be 32×32. For example, for an inter-picture slice, the maximum size of the ternary tree may be 128×128. For example, the minimum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the minimum size of the binary tree) and / or the minimum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the minimum size of the ternary tree) may be set as the minimum size of the coding block.
[0175] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree may be signaled or determined at the slice level. Alternatively, the minimum size of the binary tree and / or the minimum size of the ternary tree may be signaled or determined at the slice level.
[0176] Depending on the size information and depth information of the above-mentioned various blocks, quad partition information, multi-type tree partition indication information, partition tree information and / or partition direction information may be included in the bitstream or may not be included in the bitstream.
[0177] For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not include the quad partition information. Therefore, the quad partition information can be derived from the second value.
[0178] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is greater than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but may be derived from the second value.
[0179] Optionally, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or is twice as large as the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be sent by signal, but the multi-type tree partition indication information may be derived from the second value. This is because, when the coding unit is partitioned according to the binary tree partition structure and / or the ternary tree partition structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0180] Optionally, when the depth of the coding unit corresponding to the node of the multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be sent by a signal, but may be derived from the second value.
[0181] Optionally, the multi-type tree partition indication information can be sent by signal only when at least one of the vertical binary tree partition, the horizontal binary tree partition, the vertical ternary tree partition, and the horizontal ternary tree partition is feasible for the coding unit corresponding to the node of the multi-type tree. Otherwise, the coding unit may not be partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be sent by signal, but may be derived from the second value.
[0182] Optionally, partition direction information may be signaled only when both vertical binary tree partitioning and horizontal binary tree partitioning or both vertical ternary tree partitioning and horizontal ternary tree partitioning are feasible for the coding unit corresponding to the node of the multi-type tree. Otherwise, partition direction information may not be signaled, but may be derived from a value indicating a possible partition direction.
[0183] Optionally, the partition tree information may be signaled only when both vertical binary tree partitioning and vertical ternary tree partitioning or both horizontal binary tree partitioning and horizontal ternary tree partitioning are feasible for the coding tree corresponding to the node of the multi-type tree. Otherwise, the partition tree information may not be signaled, but may be derived from a value indicating a possible partition tree structure.
[0184] Figure 4 is a diagram illustrating an intra prediction process.
[0185] Figure 4 The arrows from the center to the outside in may represent the prediction direction of the intra prediction mode.
[0186] Intra-frame encoding and / or decoding may be performed by using reference samples of neighboring blocks of the current block. The neighboring blocks may be reconstructed neighboring blocks. For example, intra-frame encoding and / or decoding may be performed by using encoding parameters or values of reference samples included in the reconstructed neighboring blocks.
[0187] The prediction block may represent a block generated by performing intra prediction. The prediction block may correspond to at least one of a CU, a PU, and a TU. The unit of the prediction block may have a size of one of a CU, a PU, and a TU. The prediction block may be a square block of a size of 2×2, 4×4, 16×16, 32×32, or 64×64, etc., or may be a rectangular block of a size of 2×8, 4×8, 2×16, 4×16, and 8×16, etc.
[0188] Intra-prediction may be performed according to an intra-prediction mode for the current block. The number of intra-prediction modes that the current block may have may be a fixed value, and may be a value determined differently according to properties of the prediction block. For example, the properties of the prediction block may include the size of the prediction block, the shape of the prediction block, and the like.
[0189] Regardless of the block size, the number of intra-frame prediction modes can be fixed to N. Alternatively, the number of intra-frame prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65 or 67, etc. Optionally, the number of intra-frame prediction modes can vary according to the block size or the color component type or both the block size and the color component type. For example, the number of intra-frame prediction modes can vary depending on whether the color component is a luminance signal or a chrominance signal. For example, as the block size becomes larger, the number of intra-frame prediction modes can increase. Optionally, the number of intra-frame prediction modes of the luminance component block can be greater than the number of intra-frame prediction modes of the chrominance component block.
[0190] The intra prediction mode may be a non-angle mode or an angle mode. The non-angle mode may be a DC mode or a planar mode, and the angle mode may be a prediction mode with a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of intra prediction modes may be M greater than or equal to 1, including non-angle modes and angle modes.
[0191] In order to perform intra prediction on the current block, a step of determining whether a sample included in the reconstructed neighboring block can be used as a reference sample of the current block may be performed. When there are samples that cannot be used as reference samples of the current block, a value obtained by copying or interpolating at least one sample value among the samples included in the reconstructed neighboring block, or performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, so that the replaced sample value is used as the reference sample of the current block.
[0192] When intra prediction is performed, a filter may be applied to at least one of a reference sample and a prediction sample based on an intra prediction mode and a current block size.
[0193] In the case of the planar mode, when generating the prediction block of the current block, according to the position of the prediction target sample in the prediction block, the sample value of the prediction target sample may be generated by using the weighted sum of the upper reference sample and the left reference sample of the current sample and the upper right reference sample and the lower left reference sample of the current block. In addition, in the case of the DC mode, when generating the prediction block of the current block, the average value of the upper reference sample and the left reference sample of the current block may be used. In addition, in the case of the angular mode, the prediction block may be generated by using the upper reference sample, the left reference sample, the upper right reference sample and / or the lower left reference sample of the current block. In order to generate the prediction sample value, interpolation of real number units may be performed.
[0194] The intra-frame prediction mode of the current block can be entropy encoded / decoded by predicting the intra-frame prediction mode of the block adjacent to the current block. When the intra-frame prediction mode of the current block is the same as that of the neighboring block, the information that the intra-frame prediction mode of the current block is the same as that of the neighboring block can be sent by signaling using predetermined flag information. In addition, indicator information of the intra-frame prediction mode that is the same as the intra-frame prediction mode of the current block among the intra-frame prediction modes of multiple neighboring blocks can be sent by signaling. When the intra-frame prediction mode of the current block is different from that of the neighboring block, the intra-frame prediction mode information of the current block can be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.
[0195] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0196] exist Figure 5 In , a rectangle can represent a picture. Figure 5 In FIG. 1 , the arrow indicates the prediction direction. According to the encoding type of the picture, the picture can be classified into an intra picture (I picture), a predicted picture (P picture) and a bi-predicted picture (B picture).
[0197] An I picture may be encoded by intra prediction without requiring inter-picture prediction. A P picture may be encoded by inter-picture prediction using a reference picture existing in one direction (i.e., forward or backward) relative to the current block. A B picture may be encoded by inter-picture prediction using a reference picture existing in two directions (i.e., forward and backward) relative to the current block. When inter-picture prediction is used, the encoder may perform inter-picture prediction or motion compensation, and the decoder may perform corresponding motion compensation.
[0198] Hereinafter, embodiments of inter-picture prediction will be described in detail.
[0199] Reference pictures and motion information may be used to perform inter-picture prediction or motion compensation.
[0200] The motion information of the current block may be derived during inter-picture prediction by each of the encoding device 100 and the decoding device 200. The motion information of the current block may be derived by using the motion information of a reconstructed neighboring block, the motion information of a co-located block (also referred to as a col block or a co-located block), and / or the motion information of a block adjacent to the co-located block. The co-located block may represent a block in a previously reconstructed co-located picture (also referred to as a col picture or a co-located picture) that is spatially located at the same position as the current block. The co-located picture may be one of one or more reference pictures included in a reference picture list.
[0201] The method of deriving motion information of the current block may vary according to the prediction mode of the current block. For example, as a prediction mode for inter-picture prediction, there may be AMVP mode, merge mode, skip mode, current picture reference mode, etc. The merge mode may be referred to as motion merge mode.
[0202] For example, when AMVP is used as a prediction mode, at least one of a motion vector of a reconstructed neighboring block, a motion vector of a co-located block, a motion vector of a block adjacent to the co-located block, and a (0,0) motion vector may be determined as a motion vector candidate for the current block, and a motion vector candidate list may be generated by using the motion vector candidate. The motion vector candidate of the current block may be derived by using the generated motion vector candidate list. The motion information of the current block may be determined based on the derived motion vector candidate. The motion vector of the co-located block or the motion vector of the block adjacent to the co-located block may be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block may be referred to as a spatial motion vector candidate.
[0203] The encoding device 100 may calculate a motion vector difference (MVD) between a motion vector of a current block and a motion vector candidate, and may perform entropy coding on the motion vector difference (MVD). In addition, the encoding device 100 may perform entropy coding on a motion vector candidate index and generate a bitstream. The motion vector candidate index may indicate the best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding device may perform entropy decoding on the motion vector candidate index included in the bitstream, and may select a motion vector candidate of a decoding target block from the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. In addition, the decoding device 200 may add the entropy-decoded MVD to the motion vector candidate extracted by entropy decoding, thereby deriving a motion vector of the decoding target block.
[0204] The bitstream may include a reference picture index indicating a reference picture. The reference picture index may be entropy encoded by the encoding apparatus 100 and then signaled as a bitstream to the decoding apparatus 200. The decoding apparatus 200 may generate a prediction block of a decoding target block based on the derived motion vector and the reference picture index information.
[0205] Another example of a method of deriving motion information of a current block may be a merge mode. The merge mode may indicate a method of merging motions of a plurality of blocks. The merge mode may indicate a mode of deriving motion information of a current block from motion information of a neighboring block. When the merge mode is applied, a merge candidate list may be generated using motion information of a reconstructed neighboring block and / or motion information of a co-located block. The motion information may include at least one of a motion vector, a reference picture index, and an inter-picture prediction indicator. The prediction indicator may indicate unidirectional prediction (L0 prediction or L1 prediction) or bidirectional prediction (L0 prediction and L1 prediction).
[0206] The merge candidate list may be a list of stored motion information. The motion information included in the merge candidate list may be at least one of a zero merge candidate and new motion information, wherein the new motion information is a combination of motion information of a neighboring block adjacent to the current block (spatial merge candidate), motion information of a co-located block of the current block included in a reference picture (temporal merge candidate), and motion information present in the merge candidate list.
[0207] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and may signal the bitstream to the decoding device 200. The merge flag may be information indicating whether a merge mode is performed for each block, and the merge index may be information indicating which neighboring block among neighboring blocks of the current block is a merge target block. For example, the neighboring blocks of the current block may include a left neighboring block on the left side of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.
[0208] The skip mode may be a mode in which the motion information of the neighboring blocks is applied to the current block as it is. When the skip mode is applied, the encoding apparatus 100 may perform entropy encoding on information of the fact of which block's motion information is to be used as the motion information of the current block to generate a bitstream, and may signal the bitstream to the decoding apparatus 200. The encoding apparatus 100 may not signal a syntax element regarding at least any one of the motion vector difference information, the coded block flag, and the transform coefficient level to the decoding apparatus 200.
[0209] The current picture reference mode may indicate a prediction mode in which a previously reconstructed region within the current picture to which the current block belongs is used for prediction. Here, a vector may be used to specify a previously reconstructed region. Information indicating whether the current block will be encoded in the current picture reference mode may 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 may be sent by a signal, and the flag or index may be derived based on the reference picture index of the current block. In the case where the current block is encoded in the current picture reference mode, the current picture may be added to a reference picture list for the current block so that the current picture is located at a fixed position or an arbitrary position in the reference picture list. The fixed position may be, for example, a position indicated by a reference picture index 0, or the last position in the list. When the current picture is added to the reference picture list so that the current picture is located at an arbitrary position, a reference picture index indicating the arbitrary position may be sent by a signal.
[0210] Figure 6 is a diagram illustrating transform and quantization processing.
[0211] like Figure 6 As shown in , a transform process and / or a quantization process is performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the prediction block (i.e., an intra-frame prediction block or an inter-frame prediction block). The prediction block is a block generated by intra-frame prediction or inter-frame prediction. The transform can be a first transform, a second transform, or both a first transform and a second transform. The first transform of the residual signal produces a transform coefficient, and the second transform of the transform coefficient produces a second transform coefficient.
[0212] At least one scheme selected from various predefined transform schemes is used to perform the first transform. For example, examples of the predefined transform schemes include discrete cosine transform (DCT), discrete sine transform (DST) and Karhunen-Loève transform (KLT). The transform coefficients generated by the first transform may undergo a secondary transform. The transform scheme used for the first transform and / or the secondary transform may be determined based on the coding parameters of the current block and / or the neighboring blocks of the current block. Optionally, the transform scheme may be determined by signaling of transform information.
[0213] Since the residual signal is quantized through the first transform and the second transform, a quantized level signal (quantization coefficient) is generated. Depending on the intra-frame prediction mode or block size / shape of the block, the quantized level signal can be scanned according to at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning. For example, when the coefficients are scanned according to the diagonal upper right scanning, the coefficients in the block form become a one-dimensional vector form. In addition to the diagonal upper right scanning, horizontal scanning that scans the coefficients in the form of two-dimensional blocks horizontally and vertical scanning that scans the coefficients in the form of two-dimensional blocks vertically can be used according to the intra-frame prediction mode and / or size of the transform block. The scanned quantized level coefficients can be entropy encoded to be inserted into the bitstream.
[0214] The decoder entropy decodes the bit stream to obtain quantization level coefficients. The quantization level coefficients may be arranged in a two-dimensional block form by inverse scanning. For the inverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning may be used.
[0215] The quantization level coefficients may then be dequantized, then inverse transformed a second time as required, and finally inverse transformed a first time as required to generate a reconstructed residual signal.
[0216] In the following, reference will be described in detail Figure 7 A method for configuring reference samples for intra prediction is described.
[0217] When intra prediction is performed for a current block or for a subblock having a size or shape or both a size and a shape smaller than the current block based on the derived intra prediction mode, the encoder / decoder may configure reference samples for performing prediction. In the following description, the current block may refer to a current subblock.
[0218] Available Figure 7 The reference sample may be configured by using at least one sample included in at least one reconstructed sample line shown in , or by combining a plurality of samples. Here, the encoder / decoder may use each of the plurality of reconstructed sample lines as it is, or may use it as a reference sample after performing filtering between samples on the same reconstructed sample line or after performing filtering between samples on different reconstructed sample lines.
[0219] When through Figure 7 When selecting at least one line from a plurality of reconstructed sample lines to configure reference samples, an indicator of the selected reconstructed sample line may be signaled from the encoder to the decoder.
[0220] Optionally, the prediction value from the current block may be calculated based on at least one of the distance from the current block or the intra prediction mode of the current block. Figure 7 The statistical values of multiple reconstruction sample points selected by the multiple reconstruction sample point lines can be calculated, and the calculated statistical values can be used as reference sample points.
[0221] In an example, when the statistical value is calculated by using a weighted sum, the weight of the weighted sum may be adaptively determined according to the distance from the current block to the reference sample point line.
[0222] In an example, when the statistical value is calculated by using a weighted sum, the weight of the weighted sum may be adaptively determined according to the intra prediction mode of the current block.
[0223] In addition, at least one of the number, position, and configuration method of reconstruction sample lines used to configure reference samples may be determined according to whether an upper boundary or a left boundary of the current block corresponds to at least one of a picture, a slice, a tile, and a coding tree block (CTB).
[0224] In an example, when the upper boundary of the current block corresponds to at least one of a picture, a slice, a tile, and a CTB, reference samples may be configured as described in Table 1 below.
[0225] [Table 1]
[0226]
[0227] Additionally, information configuring the reference samples may be signaled.
[0228] For example, at least one of information indicating whether to use a plurality of reconstruction sample point lines and information of a selected reconstruction sample point line may be transmitted by a signal.
[0229] Neighboring reconstruction samples for configuring reference samples for intra prediction may be configured as reference samples by determining whether the neighboring reconstruction samples are available.
[0230] In an example, when the neighboring reconstruction sample is not located outside a region of at least one of a picture, a slice, a tile, and a CTU including the current block, it may be determined that the neighboring reconstruction sample is unavailable.
[0231] In an example, when constrained intra prediction is performed for the current block or the neighboring reconstruction samples are located in a block encoded / decoded by inter prediction, it may be determined that the neighboring reconstruction samples are unavailable.
[0232] In addition, when the neighboring reconstruction samples are determined to be unavailable, the encoder / decoder may replace the samples determined to be unavailable by using available neighboring reconstruction samples.
[0233] In an example, the operation of replacing the unavailable sample point may be performed by using an available reconstruction sample point adjacent to the unavailable sample point or by using a statistical value of a plurality of available reconstruction sample points. Here, when there are consecutive unavailable sample points, the available reconstruction sample point used for replacement may be at least one available reconstruction sample point adjacent to the consecutive unavailable sample points.
[0234] When the current block is divided into a plurality of sub-blocks and each sub-block has a separate intra prediction mode, a reference sample may be configured for each sub-block. Here, according to a scanning order for predicting the plurality of sub-blocks, at least one reconstructed sub-block adjacent to the left, top, top right, and bottom left of the sub-block to be predicted may be used. Here, the scanning order may be at least one of raster scanning, zigzag scanning, zigzag scanning, vertical scanning, and horizontal scanning.
[0235] Hereinafter, performing filtering on reference samples for intra prediction will be described in detail.
[0236] Whether to perform filtering may be determined based on at least one of a block size, a block shape, an intra prediction mode, a split depth, and a pixel component.
[0237] According to an embodiment of the present invention, whether to perform filtering on the reference sample may be determined based on the size of the current block. Here, the size N of the current block may be defined by at least one of the horizontal size (W) of the block, the vertical size (H) of the block, the sum of the horizontal size and the vertical size of the block (W+H), and the number of pixels in the block (W×H) (here, N is a positive integer).
[0238] In an example, when the size N of the current block is equal to or greater than a predetermined value T (here, T is a positive integer), filtering may be performed.
[0239] In another example, when the size N of the current block is equal to or less than a predetermined value T (here, T is a positive integer), filtering may be performed.
[0240] In another example, when the size N of the current block is equal to or greater than a predetermined value T1 and equal to or less than T2, filtering may be performed. (Here, T1 and T2 are positive integers, and T2>T1.)
[0241] In another example, when the size N of the current block is equal to or less than a predetermined value T1 and equal to or greater than T2, filtering may be performed. (Here, T1 and T2 are positive integers, and T2>T1.)
[0242] According to an embodiment of the present invention, it can be determined whether to perform filtering on a reference sample based on the shape of the current block. Here, the block shape may include a square block and a non-square block. In addition, the non-square block can be classified into a horizontally long non-square block and a vertically long non-square block.
[0243] In an example, when the current block is a square block, filtering may be performed.
[0244] In another example, when the current block is a non-square block, filtering may be performed.
[0245] In addition, when the current block is a non-square block, whether to perform filtering on the upper reference sample and the left reference sample may be determined based on a horizontal value (W) of the current block or a vertical value (H) of the current block.
[0246] In an example, whether to perform filtering on an upper reference sample may be determined according to a horizontal value (W) of the current block, and whether to perform filtering on a left reference sample may be determined according to a vertical value (H) of the current block.
[0247] In another example, whether to perform filtering on the upper reference sample and the left reference sample may be determined based on a larger value between a horizontal value (W) of the current block and a vertical value (H) of the current block.
[0248] In another example, whether to perform filtering on the upper reference sample and the left reference sample may be determined based on a smaller value between a horizontal value (W) of the current block and a vertical value (H) of the current block.
[0249] According to an embodiment of the present invention, whether to perform filtering on reference samples may be determined based on an intra prediction mode of a current block.
[0250] In an example, filtering may be performed for the PLANAR mode or the DC mode as a non-directional mode, or both the PLANAR mode and the DC mode.
[0251] In another example, filtering may not be performed for the PLANAR mode or the DC mode, or both the PLANAR mode and the DC mode, which are non-directional modes.
[0252] In another example, for the vertical mode or the horizontal mode, or both the vertical mode and the horizontal mode among the direction modes, filtering may not be performed for all block sizes.
[0253] When the intra prediction mode of the current block is defined as CurMode, the number or index of the horizontal direction mode is defined as Hor_Idx, and the number or index of the vertical direction mode is defined as Ver_Idx, reference sample filtering can be performed for CurMode when min{abs(CurMode-Hor_Idx), abs(CurMode-Ver_Idx)}>Th is satisfied. Here, the threshold Th can be any positive integer and can be a value adaptively determined according to the size of the current block. In the example, when the size of the current block becomes larger, the threshold Th can become smaller. When min{abs(CurMode-Hor_Idx), abs(CurMode-Ver_Idx)}>Th, reference sample filtering is performed, and thus min{abs(CurMode-Hor_Idx), abs(CurMode-Ver_Idx)}>Th may represent a condition for performing reference sample filtering according to the intra prediction mode. In other words, when the above conditions are met, reference sample filtering can be performed.
[0254] Whether to perform reference sample filtering may be determined according to the split depth of the current block.
[0255] Whether to perform reference sample filtering may be determined according to a pixel component of the current block. Here, the pixel component may include at least one of a luminance component and a chrominance component (Chroma, Cb and Cr in this example).
[0256] In an example, reference sample filtering may be performed on luma components, and reference sample filtering may not be performed on chroma components.
[0257] In addition, regardless of the luminance component or the chrominance component, reference sample filtering may be performed on all components.
[0258] As described above, whether to perform final filtering on the upper reference sample or the left reference sample or both the upper reference sample and the left reference sample of the current block can be determined by combining each filtering execution condition based on at least one of the size, shape, intra prediction mode, partition depth, and pixel component of the current block.
[0259] The filter type may be determined based on at least one of image characteristics, block size, block shape, intra prediction mode, split depth, whether a condition for performing reference sample filtering according to the intra prediction mode is satisfied, and pixel components. Here, the filter type may refer to a filter shape.
[0260] The filter type may be determined as any one of an n-tap filter, a linear filter, a nonlinear filter, a bilateral filter, a smoothing filter, an edge-preserving filter, and an order-statistics filter. At least one of a filter length, a number of filter taps, and a filter coefficient may be pre-set according to the filter type. N may represent a positive integer.
[0261] The filter type may be determined based on an image feature of an area including the reference sample. Here, the image feature may be determined as any one of a uniform area, an edge area, and a pseudo edge area. The image feature may be determined based on the uniformity of the image or the texture of the image. The image uniformity and the image texture may be indicators with opposite meanings, and the image uniformity may be calculated as K*[1 / image texture] (K is a positive integer).
[0262] Figure 8 is a diagram showing image characteristics of a region including a reference sample.
[0263] Reference Figure 8 When the image feature of the region including the reference sample is (1) an edge region, the filter type may be determined as an edge-preserving filter. Here, the edge region may be a boundary region.
[0264] When the image characteristic of the region including the reference sample is (2) a uniform region, the filter type may be determined as a smoothing filter.
[0265] When the image feature of the region including the reference sample is (3) a pseudo edge region, the reference sample may be determined as noise and a filtering abnormality process may be performed.
[0266] A method of determining noise pixels among pixels to be filtered may be one of the following methods.
[0267] In the method for determining noise according to an embodiment of the present invention, when the absolute value of the difference between the statistical values of the N target pixel values adjacent to the current target pixel value is greater than a predetermined threshold value Th, the current target pixel can be determined as a noise pixel. Here, N and Th can be positive integers, and the statistical value can be any one of an average value, a median value, a maximum value, and a minimum value.
[0268] In an example, when the reference sample (or current target pixel) value is defined as Vcur, the value of the target pixel immediately before the reference sample (or current target pixel) is defined as Vpre, and the value of the target pixel immediately after the reference sample (or current target pixel) is defined as Vaft, and filtering is performed for a 1D line, the reference sample (or current target pixel) may be determined as a noise pixel when the following conditions are met: (Vcur-Vpre)*(Vafr-Vcur)<0 and max{abs(Vcur-Vpre),abs(Vafr-Vcur)}>=Th. Here, Th may be a positive integer satisfying Th>=0.
[0269] In an example, when the reference sample (or current target pixel) value is defined as Vcur, the values of each of the N target pixels adjacent to the reference sample (or current target pixel) are defined as Vi (here, i=1, 2, ..., N, and N is a positive integer), and filtering is performed for a 2D line, the reference sample (or current target pixel) may be determined as a noise pixel when the following conditions are met: for all N, Vcur-Vi> or Vcur-Vi<0, and max{abs(Vcur-V1), abs(Vcur-V2), ..., abs(Vafr-VN)}>=Th. Here, Th may be a positive integer satisfying Th>=0.
[0270] In addition, the reference sample determined to be noise when filtering is performed (or the target pixel to be filtered) may be processed in any of the following ways. In an example, filtering may not be performed for the noise target pixel. In another example, filtering may be performed after excluding the noise target pixel from the target area to be filtered.
[0271] As described above, when filtering is performed in consideration of image features of a region including reference samples, prediction efficiency can be improved since a prediction block is generated by using reference samples close to an original image. Specifically, since an edge-preserving filter may be applied to an edge region, a residual signal value may be reduced. In addition, ringing artifacts in an object boundary region of an image and contour artifacts occurring when performing directional prediction may be improved.
[0272] Image uniformity or image texture used in determining image features may be derived as follows.
[0273] In an example, the following formula may be used to calculate the Fig. 9 The image uniformity for the upper reference sample or the left reference sample of the image may be independently derived in the block of FIG. 1 , or the image uniformity for the upper reference sample or the left reference sample of the image may be derived for both the left reference sample and the upper reference sample.
[0274] The uniformity of the upper (top) reference point can be derived by using Equation 1 or Equation 2.
[0275] [Formula 1]
[0276]
[0277] [Formula 2]
[0278]
[0279]
[0280] The uniformity of the left reference sample point can be derived by using Equation 3 or Equation 4.
[0281] [Formula 3]
[0282]
[0283] [Formula 4]
[0284]
[0285] Optionally, the overall uniformity of the current block may be derived by using the weighted sum of the left uniformity and the upper uniformity calculated as above.
[0286] As another example of calculating image uniformity, a change degree or gradient of reference pixels may be used.
[0287] In the example, Fig.10 As shown in , the gradient (Pixel_Gradient) of the reference pixel (Cur) currently being filtered can be derived according to Formula 5 or Formula 6. Here, in Formula 5 or Formula 6, N can be any positive integer, and W in Formula 6 is k Can be any real number.
[0288] [Formula 5]
[0289] Pixel_Gradient=abs(Prev_N-Aft_N)
[0290] [Formula 6]
[0291]
[0292] When the number of upper reference points or left reference points or the number of upper reference points and left reference points is M (ie, M is W, H, W+H or W×H), the average gradient of the entire reference point group is calculated according to Formula 7.
[0293] [Formula 7]
[0294] Where M=W or H or W+H
[0295] When filtering is applied for a plurality of reference sample lines, each uniformity may be derived for each line, or a weighted sum of uniformities calculated in the respective sample lines may be used as an overall uniformity.
[0296] The filter type may be determined based on the pixel components of the current block.
[0297] In an example, the filter type of the chroma component may be set to be the same as the filter type of the luma component.
[0298] In addition, a filter type of a luma component and a filter type of a chroma component may be independently determined.
[0299] At least one of the filter length and the filter coefficient may be determined according to the filter type. However, even if the filter type for reference sample filtering is determined, at least one of the filter length and the filter coefficient may be adaptively changed.
[0300] The filter length may be determined based on at least one of image characteristics, block size, block shape, intra prediction mode and partition depth, whether reference sample filtering is performed, whether a condition for performing reference sample filtering according to an intra prediction mode is satisfied, and pixel components. Here, the filter length may refer to the number of filter taps.
[0301] According to an embodiment of the present invention, the filter length applied to the reference sample filtering may be determined based on the size of the current block. Here, the size N of the current block (where N is a positive integer) may be defined as at least one of the horizontal size (W) of the block, the vertical size (H) of the block, the sum of the horizontal size and the vertical size of the block (W+H), and the number of pixels in the block (W×H). Here, the reference sample may represent at least one of an upper reference sample and a left reference sample.
[0302] The filter length can be adaptively determined according to the value of the block size N.
[0303] In an example, when the value of N is less than Th_1, filtering with a length of L_1 can be applied; when the value of N is equal to or greater than Th_1 and less than Th_2, filtering with a length of L_2 can be applied; and when the value of N is equal to or greater than Th_(K - 1) and less than Th_K, filtering with a length of L_K can be applied. Here, L_1 to L_K can be positive integers satisfying L_1 < L_2 <... < L_K, and Th_1 to Th_K can be positive integers satisfying Th_1 < Th_2 <... < Th_K. Optionally, L_1 to L_K can be positive integers satisfying L_1 < L_2 <... < L_K, and Th_1 to Th_K can be positive integers satisfying Th_K < Th_K - 1 <... < Th_1.
[0304] In addition, a fixed filter length can be used regardless of the value of the block size N.
[0305] When filtering is applied to multiple reference sample lines, the filter length determined according to the above conditions can be applied identically to all reference sample lines, or independent filter lengths can be applied to each sample line.
[0306] In an example, the filter length to be applied to the first upper reference sample line or the first left reference sample line or both the first upper reference sample line and the first left reference sample line can be determined according to the above conditions, and the filter length to be applied to the second upper reference sample line or the second left reference sample line or both the second upper reference sample line and the second left reference sample line can be determined as a filter length reduced compared to the filter length applied to the first reference sample line. Conversely, the filter length of the second and subsequent upper reference sample lines or left reference sample lines or both the second and subsequent upper reference sample lines and left reference sample lines can be determined as a filter length increased compared to the filter length applied to the first reference sample line.
[0307] According to an embodiment of the present invention, the filter length applied to reference sample filtering can be determined based on the image features of the region including the reference sample. Since the image features have been described in detail above, the description of the image features will be omitted.
[0308] Specifically, the filter length applied to the upper reference sample or the left reference sample or both the upper reference sample and the left reference sample can be adaptively determined according to the uniformity of the region including the reference sample.
[0309] In an example, when the value of the uniformity is less than Th_1, filtering with a length of L_1 can be applied. When the value of the uniformity is equal to or greater than Th_1 and less than Th_2, filtering with a length of L_2 can be applied. When the value of the uniformity is equal to or greater than Th_(K - 1) and less than Th_K, filtering with a length of L_K can be applied. Here, L_1 to L_K can be positive integers satisfying L_1 < L_2 < … < L_K, and Th_1 to Th_K can be positive integers satisfying Th_1 < Th_2 < … < Th_K. Optionally, L_1 to L_K can be positive integers satisfying L_1 < L_2 < … < L_K, and Th_1 to Th_K can be positive integers satisfying Th_K < Th_K - 1 < … < Th_1. K can be a predetermined positive integer.
[0310] In addition, a fixed filter length can be used regardless of the value of the uniformity of the region including the reference sample points.
[0311] According to an embodiment of the present invention, the filter length applied to the upper reference sample point or the left reference sample point or both the upper reference sample point and the left reference sample point can be determined based on the shape of the current block.
[0312] In an example, when the shape of the current block is square (i.e., when the horizontal size (W) of the current block is the same as the vertical size (H) of the current block), the same length of filter can be applied to the upper reference sample point and the left reference sample point. In addition, when the shape of the current block is non-square, filters with different lengths can be applied to the upper reference sample point and the left reference sample point.
[0313] In an example, when the horizontal size (W) of the current block is greater than the vertical size (H) of the current block, a filter length larger than the filter length applied to the left reference sample point can be applied to the upper reference sample point, and when the horizontal size (W) of the current block is less than the vertical size (H) of the current block, a filter length larger than the filter length applied to the upper reference sample point can be applied to the left reference sample point.
[0314] In addition, the filter lengths applied to the upper reference sample point and the left reference sample point can be determined independently according to the horizontal size (W) and the vertical size (H) of the current block.
[0315] In addition, even when the shape of the current block is square, filters with different lengths can be applied to the upper reference sample point and the left reference sample point.
[0316] In addition, the same filter length can be applied to the upper reference sample point and the left reference sample point regardless of the block shape.
[0317] According to an embodiment of the present invention, a filter length applied to an upper reference sample or a left reference sample or both the upper reference sample and the left reference sample may be determined based on an intra prediction mode of a current block.
[0318] In an example, when the intra prediction mode of the current block is one of the vertical direction modes, a filter length greater than the filter length applied to the left reference sample may be applied to the upper reference sample. In addition, when the intra prediction mode of the current block is one of the horizontal direction modes, a filter length greater than the filter length applied to the upper reference sample may be applied to the left reference sample.
[0319] On the contrary, when the intra prediction mode of the current block is one of the vertical direction modes, a filter length larger than the filter length applied to the upper reference sample may be applied to the left reference sample. In addition, when the intra prediction mode of the current block is one of the horizontal direction modes, a filter length larger than the filter length applied to the left reference sample may be applied to the upper reference sample.
[0320] In addition, the same filter length may be applied to the upper reference samples and the left reference samples regardless of the intra prediction mode of the current block.
[0321] The filter length may be determined based on the pixel components of the current block.
[0322] In an example, the filter length of the chroma component may be set to be the same as the filter length of the luma component.
[0323] In addition, the filter length of the luma component and the filter length of the chroma component may be independently determined.
[0324] The filter coefficient may be determined based on at least one of image characteristics, block size, block shape, intra prediction mode and partition depth, whether reference sample filtering is performed, whether a condition for performing reference sample filtering according to an intra prediction mode is satisfied, and pixel components. Here, the filter coefficient may represent the number of filter sets.
[0325] As described above, reference sample filtering for intra prediction has been described in detail. In addition to reference sample filtering for intra prediction, the method of determining whether to perform filtering, the method of determining the filter type, the method of determining the filter length, and the method of determining the filter coefficient described above can also be applied to Figure 1 The encoder or Figure 2 The following steps of the decoder.
[0326] -Interpolation filtering in intra prediction units and boundary area filtering for intra prediction blocks
[0327] - Interpolation filtering for generating prediction blocks in motion compensation units and boundary area filtering for inter-frame prediction blocks
[0328] -Interpolation filtering used to generate prediction blocks in motion prediction units
[0329] - Deblocking filter, SAO (sample adaptive offset) filter and ALF (adaptive loop filter) in the filter unit
[0330] - At least one of OBMC (Overlapped Block Motion Compensation), FRUC (Frame Rate Upscaling), and BIO (Bidirectional Optical Flow) filtering performed in the encoder or decoder to correct (or refine or fine-tune) motion information
[0331] Therefore, in the following description, filtering may represent at least one of the following filtering: reference sample filtering / interpolation filtering / boundary area filtering in an intra-frame prediction unit, boundary area filtering of an interpolation filter / generated prediction block generated for a prediction block in a motion prediction unit and a motion compensation unit, in-loop filtering in a filter unit, and OBMC, FRUC, and BIO for correcting motion information in an encoder and a decoder.
[0332] According to an embodiment of the present invention, whether to perform filtering, at least one of the filter type, the filter length and the filter coefficient can be determined based on at least one of the block size, block shape, prediction mode, intra-frame prediction mode, inter-frame prediction mode, local characteristics of the image, global characteristics of the image, whether to perform reference sample filtering, whether the conditions for performing reference sample filtering according to the intra-frame prediction mode are met, pixel components, and other encoding parameters.
[0333] In an example, the type of filter used in the interpolation filtering in the intra prediction unit may be determined based on image features, block size, block shape, intra prediction mode, partition depth, whether reference sample filtering is performed, whether conditions for performing reference sample filtering according to the intra prediction mode are satisfied, and at least one of the pixel components.
[0334] In addition, the filter coefficients used in the interpolation filtering in the intra prediction unit can be determined based on image characteristics, block size, block shape, intra prediction mode, partition depth, whether reference sample filtering is performed, whether conditions for performing reference sample filtering according to the intra prediction mode are satisfied, and at least one of the pixel components.
[0335] For example, when reference sample filtering is performed or a condition for performing reference sample filtering according to an intra prediction mode is satisfied, a first filter coefficient set may be used during interpolation filtering. When reference sample filtering is not performed or a condition for performing reference sample filtering according to an intra prediction mode is not satisfied, a second filter coefficient set may be used during interpolation filtering.
[0336] In other words, a filter coefficient may be determined from a filter coefficient set including at least one filter coefficient according to whether reference sample filtering is performed or whether a condition for performing reference sample filtering according to an intra prediction mode is satisfied.
[0337] The filter coefficient set used in interpolation filtering in the intra prediction unit may be filter coefficients set to be the same as the interpolation filter coefficient set used when generating a luma prediction block or a chroma prediction block in the motion compensation unit.
[0338] Also, when filtering for reference samples targeted for interpolation filtering in an intra prediction unit is not performed, interpolation filter coefficients different from each other may be used depending on whether a condition for performing reference sample filtering according to an intra prediction mode is satisfied.
[0339] In another example, when filtering is performed on reference samples targeted for interpolation filtering in an intra prediction unit, interpolation filter coefficients different from each other may be used depending on whether a condition for performing reference sample filtering according to an intra prediction mode is satisfied.
[0340] Here, the filter coefficient set may represent a set configured using K filter coefficients that are different from each other. In addition, K may be a positive integer. In addition, the filter coefficient set or filter coefficient may represent an interpolation filter coefficient set or an interpolation filter coefficient.
[0341] The filtering according to an embodiment of the present invention may be applied to a pixel component including at least one of a luminance component and a chrominance component (eg, Cb, Cr) by using one of the following methods.
[0342] In an example, filtering may be applied to the luma component without applying filtering to the chroma component. Conversely, filtering may not be applied to the luma component but may be applied to the chroma component. Additionally, filtering may be applied to both the luma component and the chroma component.
[0343] In an example, the same filtering may be applied to the luma component and the chroma component. In addition, different filtering may be applied to the luma component and the chroma component.
[0344] In an example, the same filtering may be applied to Cb and Cr of the chroma components. In addition, different filtering may be applied to Cb and Cr of the chroma components.
[0345] Hereinafter, an application direction of filtering, a pixel area used for filtering, and a pixel unit applied for filtering according to an embodiment of the present invention will be described.
[0346] The application direction of the filtering according to the embodiment of the present invention may be any one of a horizontal direction, a vertical direction, and a direction having an arbitrary angle.
[0347] Fig.11 is a diagram illustrating a direction in which filtering is applied according to an embodiment of the present invention.
[0348] Reference Fig.11 , (a) represents the horizontal direction, (b) represents the vertical direction, and (c) represents the direction with an arbitrary angle (θ). Here, θ can be an integer or a real number.
[0349] In addition, for the target pixel to be filtered, Fig.11 The filtering is applied repeatedly or recursively by combining at least one of the (a), (b) and (c) directions.
[0350] The pixel area used for filtering according to an embodiment of the present invention may be any one of pixels located in the horizontal direction of the target pixel, pixels located in the vertical direction of the target pixel, pixels located in multiple horizontal direction lines including the target pixel, pixels located in multiple vertical direction lines including the target pixel, pixels within a cross-shaped area including the target pixel, and pixels within a geometric area including the target pixel.
[0351] Fig.12 is a diagram illustrating a pixel area used for filtering according to an embodiment of the present invention.
[0352] In the example, Fig.12 As shown in (a) of FIG. 8 , filtering may be performed by using a target pixel and pixels located in a horizontal direction.
[0353] Alternatively, if Fig.12 As shown in (b) of , filtering may be performed by using the target pixel and pixels located in the vertical direction.
[0354] Alternatively, if Fig.12 As shown in (c) of , filtering can be performed by using pixels located on N horizontal direction lines including the target pixel. Here, the horizontal direction line can be an upper line or a lower line or both of the upper line and the lower line of the target pixel. Here, N can be a positive integer greater than 1. In addition, when N is an odd number, the horizontal direction lines can be located above and below the target pixel in the same number.
[0355] Alternatively, if Fig.12As shown in (d) of , filtering can be performed by using pixels located on N vertical direction lines including the target pixel. Here, the vertical direction line can be a left line or a right line or both of the left line and the right line of the target pixel. Here, N can be a positive integer greater than 1. In addition, when N is an odd number, the vertical direction lines can be located on the left and right sides of the target pixel in the same number.
[0356] Alternatively, if Fig.12 As shown in (e) of , filtering may be performed by using pixels within a cross-shaped region including the target pixel. Here, when the vertical length of the cross-shaped region is M and the horizontal length is N, M and N may be positive integers greater than 2.
[0357] Alternatively, if Fig.12 As shown in (f) of FIG. 5 , filtering may be performed by using pixels within a geometric region including the target pixel. Here, the geometric region may be at least one of a square, a non-square, a triangle, a trapezoid, and a circle.
[0358] In addition, Fig.12 (a) to Fig.12 All pixels within a pixel region indicated in shaded form in (f) may be used for filtering, or filtering may be performed by using part of the pixels within the region.
[0359] For example, filtering may be performed by using the target pixel (X), and Fig.12 (a) to Fig.12 In (f), the pixels consecutive to the target pixel (X) among the pixels within the pixel region are indicated by hatching. Alternatively, filtering may be performed by using pixels spaced a predetermined distance K (K is a positive integer) from the target pixel (X).
[0360] The pixel unit to which filtering is applied according to an embodiment of the present invention may be an integer pixel unit (integer pel) or a fractional pixel unit (fractional pel) or both an integer pixel unit (integer pel) and a fractional pixel unit (fractional pel). Here, the fractional unit may be 1 / 2 (half pel), 1 / 4 (quarter pel), 1 / 8 pel, 1 / 16 pel, 1 / 32 pel, 1 / 64 pel, ..., and 1 / N pel. Here, N is a positive integer.
[0361] Fig.13 is a diagram showing an example of an embodiment in which filtering is applied in 1 / 4 (or quarter pel) units.
[0362] exist Fig.13 , pixels shaded with capital letters may represent pixels at integer positions, and other pixels including pixels with lowercase letters may represent pixels at fractional units. In addition, Fig.13 The "X i,j " where i may represent an index in the horizontal direction, and j may represent an index in the vertical direction.
[0363] exist Fig.13 In the example, the pixel unit for applying the filtering may be at least one of the following.
[0364] - Apply filtering to integer units of pixels A i,j
[0365] - Apply filtering to The unit pixel b i,j and h i,j
[0366] - Apply filtering to The unit pixel a i,j 、c i,j d i,j and n i,j
[0367] - Apply filtering to fractional pixels e i,j 、f i,j , g i,j 、i i,j 、j i,j , k i,j 、p i,j ,q i,j and r i,j , wherein the pixel is within four adjacent integer pixels forming a square.
[0368] In addition, the pixel for filtering the target pixel in each pixel unit where filtering may be performed may be Fig.11 Apply filtering in at least one direction and Fig.12 Any combination of at least one region for filtering.
[0369] Hereinafter, n-tap filtering, smoothing filtering, edge-preserving filtering, 1D filtering, 2D filtering and sequential statistical filtering according to an embodiment of the present invention will be described in detail. Here, n may be a positive integer.
[0370] The filtering using the n-tap filter according to the embodiment of the present invention may be performed by using the following Formula 8. Here, the target pixel to be filtered is X, and the pixels for filtering are {b1, b2, ..., b n}, the filter coefficients are {c1,c2,…,c n}, the value of the target pixel after filtering is X', and n is a positive integer.
[0371] [Formula 8]
[0372]
[0373] In the example of performing filtering, when the target pixel to be filtered is "b 0,0 ”, when the length of the target pixel is 8 and an 8-tap filter with filter coefficients {-1, 4, -11, 40, 40, -11, 4, -1} is applied, the filter value can be calculated according to Formula 9.
[0374] [Formula 9]
[0375] b (0,0) ={-1×A (-3,0) +4×A (-20) -11×A (-1,0) +40×A (0,0) +40×A (1,0) -11×A (2,0) +4×A (3,0) -1×A (4,0) +32} / 64
[0376] In addition, for the target pixel X to be filtered, Fig.14 As shown in the example of , when a part of the area for filtering is located outside the picture boundary, the block boundary, or the sub-block boundary, filtering for the target pixel X may be performed by using any of the following.
[0377] - No filtering is performed on the target pixel X
[0378] - Filtering for the target pixel X is performed by using an area for performing filtering existing within a picture, block or sub-block boundary.
[0379] The length of the smoothing filter according to the embodiment of the present invention may be any positive integer. In addition, the coefficients (or filter coefficients) of the smoothing filter may be determined by using any of the following.
[0380] In an example, the coefficients of the smoothing filter may be derived by using a Gaussian function. 1D and 2D Gaussian functions may be expressed as in Formula 10 below.
[0381] [Formula 10]
[0382]
[0383] σ: standard deviation
[0384] The filter coefficients can be the pixel range (0–2 BitDepth ) within the quantized value.
[0385] In an example, when filtering is performed using a 1D Gaussian function by using a 4-tap length in 1 / 32 pel units, the filter coefficients applied to the target pixel at the position of each integer / fractional unit may be as shown in the following Table 2. Here, in Table 2, 0 may represent a pixel of an integer unit, and filter coefficients from 17 / 32 to 31 / 32 may be derived by performing symmetry with respect to filter coefficients of 16 / 32–1 / 32.
[0386] [Table 2]
[0387]
[0388] In another example, when filtering is performed using a 1D Gaussian function by using a length of 4 in 1 / 32 pel units, a filter coefficient applied to a target pixel at a position of each integer / fractional unit may be as shown in Table 3 below.
[0389] [Table 3]
[0390]
[0391] In Table 3, the sum of the filter coefficients may be represented by using M bits. Here, the sum of the filter coefficients may not exceed 2<<M. For example, M may be a positive integer including 6. When M is 6, the sum of the filter coefficients may exceed 64, that is, 2<<6.
[0392] At least one of the filter coefficients of Table 3 may represent at least one filter coefficient within the first filter coefficient set.
[0393] However, the filter coefficients that may be derived from the Gaussian function are not specified as the coefficient values described in Tables 2 and 3, and the filter coefficients that may be derived from the Gaussian function may be determined based on the block size, block shape, intra / inter prediction mode, local characteristics of the image, global characteristics of the image, whether reference sample filtering is performed, whether the conditions for performing reference sample filtering according to the intra prediction mode are met, pixel components, and encoding parameters.
[0394] The filter coefficients in Table 2 and Table 3 may be examples of M-tap filter coefficients, and M may be a positive integer including 4.
[0395] The filter coefficients derived from the Gaussian function can be used for at least one of the following filtering: reference sample filtering / interpolation filtering / boundary area filtering in the intra-frame prediction unit, boundary area filtering for the prediction block filtered / generated for generating the prediction block in the motion prediction unit and the motion compensation unit, in-loop filtering in the filter unit, and OBMC, FRUC and BIO for correcting motion information in the encoder and decoder.
[0396] In another example, the coefficients of the smoothing filter may be derived by using a DCT-based function. The forward and inverse (including fractional units) DCT transforms may be represented as in Formula 11 below.
[0397] [Formula 11]
[0398]
[0399]
[0400]
[0401] The filter coefficients can be the pixel range (0–2 BitDepth ) within the quantized value.
[0402] In the example, Fig.13 In , the filter coefficients applied to fractional units 1 / 4, 1 / 2, 3 / 4, etc. can be as follows.
[0403]
[0404]
[0405]
[0406] In another example, when filtering is performed using a DCT-based function by using a 4-tap length in 1 / 32 pel units, the filter coefficient applied to the target pixel at the position of each integer / fractional unit may be as shown in Table 4 below.
[0407] [Table 4]
[0408]
[0409] In Table 4, the sum of the filter coefficients may be represented by using M bits. Here, the sum of the filter coefficients may not exceed 2<<M. For example, M may be a positive integer including 6. When M is 6, the sum of the filter coefficients may exceed 64, that is, 2<<6.
[0410] At least one of the filter coefficients of Table 4 may represent at least one filter coefficient within the first filter coefficient set.
[0411] However, the filter coefficients that may be derived from the DCT-based function are not specified as the coefficient values of Table 4, and the filter coefficients that may be derived from the DCT-based function may be determined based on the block size, block shape, intra / inter prediction mode, local characteristics of the image, global characteristics of the image, whether reference sample filtering is performed, whether the conditions for performing reference sample filtering according to the intra prediction mode are met, pixel components, and encoding parameters.
[0412] The coefficient values and filter coefficients of Table 4 may be examples of M-tap filter coefficients, and M may be a positive integer including 4.
[0413] The filter coefficients derived from the DCT-based function can be used for at least one of the following filtering: reference sample filtering / interpolation filtering / boundary area filtering in the intra-frame prediction unit, boundary area filtering for the prediction block filtered / generated for generating the prediction block in the motion prediction unit and the motion compensation unit, in-loop filtering in the filter unit, and OBMC, FRUC and BIO for correcting motion information in the encoder and decoder.
[0414] In another example, the coefficients of the smoothing filter may be derived from a median filter. Here, the median filter may be a filter that uses a median value between pixel values within a region for filtering a target pixel as a filter value.
[0415] The length of the edge-preserving filter according to the embodiment of the present invention may be any positive integer. In addition, the coefficients (or filter coefficients) of the edge-preserving filter may be determined by using at least one of the following.
[0416] For example, the coefficients of the edge-preserving filter can be derived by using a bilateral function. The bilateral function can be expressed as the following formula 12.
[0417] [Formula 12]
[0418] in,
[0419] In Formula 12, σ d can be a parameter (or spatial parameter) that adjusts the weight by considering the distance between two pixels x and y, and σ r It may be a parameter (or range parameter) that adjusts the weight considering the difference between the pixel values I(x) and I(y) of the two pixels x and y, respectively. N may represent the number of pixels (y) within the region for filtering the target pixel (x) and may be a positive integer.
[0420] For the space parameter σ d Or the range parameter σ r Or the spatial parameter σ d and the range parameter σ r Both, fixed values may be used for all pixels. However, not limited thereto, variable values determined based on at least one of block size, block shape, intra / inter prediction mode, local features of an image, global features of an image, and encoding parameters may be used.
[0421] σ d orr Or d and σ r Both are determined to depend on the value of BitDepth. In the example, "σ d or r =1<<(BitDepth-K)", where K can be a positive integer equal to or less than the bit depth, or can be 0.
[0422] In addition, σ can be determined according to the block size d or r Or d and σ r In the example, when the block size is N, N may be defined as at least one of the horizontal size, the vertical size, the sum of the horizontal size and the vertical size, and the product of the horizontal size and the vertical size of the block. Here, when N becomes larger, σ d or r When N is small, σ d or r The larger value in .
[0423] In addition, σ can be determined according to the intra prediction mode or the inter prediction mode. d or r Or d and σ r Both.
[0424] In addition, when the horizontal length and vertical length of the current block are different, different values of σ can be used to d or r Applied to horizontal filtering and vertical filtering.
[0425] In addition, when the local features of the pixels of the region where filtering is performed or the global features of the region where filtering is performed or both the local features of the pixels of the region where filtering is performed and the global features of the region where filtering is performed are defined as uniformity, when the uniformity becomes larger, σ may be used. d or r Alternatively, when the uniformity becomes smaller, σ d or r Here, the image feature may be determined in one of a picture unit, a block unit, a line unit, and a pixel unit.
[0426] The 1D filter according to the embodiment of the present invention can be any one of a nearest neighbor filter, a linear filter and a cubic filter. The length of the 1D filter can be any positive integer and can be as follows: Fig.15 The coefficients of the 1D filter (or filter coefficients) are derived as shown in .
[0427] exist Fig.15 In the figure, the pixels represented by dotted lines may represent the target pixels on which filtering is performed, the pixels represented by solid lines may be the pixels within the area used to perform filtering on the target pixels, and the length of each of the solid line and the dotted line may represent the size of the filter coefficient.
[0428] The 2D filter according to an embodiment of the present invention may be any one of a 2D nearest neighbor filter, a bilinear filter, and a bicubic filter. The length of the 2D filter may be any positive integer, and may be as follows: Fig.16 The coefficients of the 2D filter (or filter coefficients) are derived as shown in .
[0429] exist Fig.16 In the figure, the pixels represented by dotted lines may represent the target pixels on which filtering is performed, the pixels represented by solid lines may be the pixels within the area used to perform filtering on the target pixels, and the length of each of the solid line and the dotted line may represent the size of the filter coefficient.
[0430] The target pixel on which the sequential statistical filtering according to an embodiment of the present invention is performed and the N pixels in the region for performing filtering on the target pixel may be sorted in ascending or descending order, and the Kth value may be used as the filtered pixel value. Here, N and K may be positive integers satisfying K<=N.
[0431] In addition, for the target pixel being filtered, at least one filter can be applied repeatedly or recursively. In addition, filter coefficient or filter length or filter coefficient and filter length can be set to predefined values in encoder / decoder. In addition, filter coefficient or filter length or filter coefficient and filter length can be determined in encoder and sent to decoder with signal.
[0432] Fig.17 is a flowchart illustrating an image decoding method according to an embodiment of the present invention.
[0433] Reference Fig.17 , at S1701, the decoder may determine a reference sample of the current block.
[0434] Here, the reference sample of the current block may be at least one of at least one reconstructed sample line located on the left side of the current block and at least one reconstructed sample line located on the upper side of the current block.
[0435] Furthermore, at S1702 , the decoder may perform filtering on the reference samples based on the characteristics of the region including the reference samples.
[0436] Here, the feature of the region including the reference sample point may be any one of a uniform region, an edge region, and a pseudo edge region.
[0437] In addition, the step of performing filtering on the reference sample point of S1702 includes: when the feature of the area including the reference sample point is a uniform area, filtering is performed by using a smoothing filter; when the feature of the area including the reference sample point is an edge area, filtering is performed by using an edge-preserving filter; and when the feature of the area including the reference sample point is a pseudo-edge area, filtering is performed by excluding pixels determined to be noise.
[0438] Here, the characteristics of the region including the reference spots may be determined based on the uniformity of the region.
[0439] In addition, the step of performing filtering on the reference sample in S1702 may include: determining the filter length based on at least one of the size of the current block, the shape of the current block, the intra prediction mode of the current block, the partition depth of the current block, and the pixel components of the current block; and filtering the reference sample based on the determined filter length.
[0440] Furthermore, at S1703 , the decoder may perform intra prediction by using the reference samples on which filtering is performed.
[0441] In addition, the decoder may generate a prediction block by using an interpolation filter when performing intra prediction.
[0442] Here, the interpolation filter type used in the intra prediction may be determined based on whether reference sample filtering is performed or whether a condition for performing reference sample filtering according to the intra prediction mode is satisfied.
[0443] Fig.18 is a flowchart illustrating an image decoding method according to another embodiment of the present invention.
[0444] Reference Fig.18 , at S1801, the decoder may determine a reference sample of the current block.
[0445] Subsequently, at S1802, the decoder may determine whether to perform reference sample filtering based on at least one of a size of the current block, a shape of the current block, an intra prediction mode of the current block, a split depth of the current block, and a pixel component of the current block.
[0446] Subsequently, in S1802-Yes, when it is determined in S1802 to perform reference sample filtering, in S1803, the decoder may perform reference sample filtering based on the characteristics of the region including the reference sample.
[0447] Subsequently, at S1804, the decoder may perform intra prediction by using the reference samples on which filtering is performed.
[0448] At S1802-No, when it is determined at S1802 not to perform reference sample filtering, at S1805, the decoder may perform intra prediction by using the reference samples determined at S1801.
[0449] The same can be performed in the encoder using Fig.17 and Fig.18 Describes the image decoding method.
[0450] In addition, a recording medium according to the present invention may include a bit stream generated by an image encoding method, wherein the image encoding method includes: determining a reference sample of a current block; performing filtering on the reference sample based on characteristics of an area including the reference sample; and performing intra-frame prediction by using the reference sample on which filtering is performed.
[0451] The above embodiments may be performed in the same way in an encoder and a decoder.
[0452] At least one or a combination of the above embodiments may be used to encode / decode an image.
[0453] The order in which the above embodiments are applied may be different between an encoder and a decoder, or the order in which the above embodiments are applied may be the same in an encoder and a decoder.
[0454] The above embodiments may be performed on each of the luminance signal and the chrominance signal, or may be performed identically on the luminance signal and the chrominance signal.
[0455] The block shape to which the above embodiments of the present invention are applied may have a square shape or a non-square shape.
[0456] The above embodiments of the present invention may be applied according to the size of at least one of a coding block, a prediction block, a transform block, a block, a current block, a coding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as a minimum size or a maximum size or both a minimum size and a maximum size to which the above embodiments are applied, or may be defined as a fixed size to which the above embodiments are applied. In addition, in the above embodiments, the first embodiment may be applied to a first size, and the second embodiment may be applied to a second size. In other words, the above embodiments may be applied in combination according to the size. In addition, the above embodiments may be applied when the size is equal to or greater than the minimum size and equal to or less than the maximum size. In other words, the above embodiments may be applied when the block size is included in a specific range.
[0457] For example, when the size of the current block is 8×8 or larger, the above embodiment may be applied. For example, when the size of the current block is 4×4 or larger, the above embodiment may be applied. For example, when the size of the current block is 16×16 or larger, the above embodiment may be applied. For example, when the size of the current block is equal to or larger than 16×16 and equal to or smaller than 64×64, the above embodiment may be applied.
[0458] The above embodiments of the present invention may be applied according to the time layer. In order to identify the time layer to which the above embodiments may be applied, an additional identifier may be signaled, and the above embodiments may be applied to the specified time layer identified by the corresponding identifier. Here, the identifier may be defined as the lowest layer or the highest layer or both the lowest layer and the highest layer to which the above embodiments may be applied, or may be defined as a specific layer indicating that the embodiment is applied. In addition, a fixed time layer to which the embodiment is applied may be defined.
[0459] For example, when the temporal layer of the current image is the lowest layer, the above embodiment may be applied. For example, when the temporal layer identifier of the current image is 1, the above embodiment may be applied. For example, when the temporal layer of the current image is the highest layer, the above embodiment may be applied.
[0460] A stripe type to which the above embodiments of the present invention are applied may be defined, and the above embodiments may be applied according to the corresponding stripe type.
[0461] In the above embodiments, the method is described based on a flow chart with a series of steps or units, but the present invention is not limited to the order of these steps, but some steps can be performed simultaneously with other steps or in a different order. In addition, it should be understood by those skilled in the art that the steps in the flow chart are not mutually exclusive, and other steps can be added to the flow chart or some of the steps can be deleted from the flow chart without affecting the scope of the present invention.
[0462] The embodiments include various aspects of the examples. All possible combinations of the various aspects may not be described, but those skilled in the art will be able to recognize different combinations. Therefore, the present invention may include all substitutions, modifications and changes within the scope of the claims.
[0463] Embodiments of the present invention can be implemented in the form of program instructions, wherein the program instructions can be executed by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium can include program instructions, data files, data structures, etc. alone, or can include a combination of program instructions, data files, data structures, etc. The program instructions recorded in the computer-readable recording medium can be specially designed and constructed for the present invention, or are well known to those of ordinary skill in the field of computer software technology. Examples of computer-readable recording media include magnetic recording media (such as hard disks, floppy disks, and magnetic tapes), optical data storage media (such as CD-ROMs or DVD-ROMs), magneto-optical media (such as floppy disks), and hardware devices (such as read-only memories (ROMs), random access memories (RAMs), flash memories, etc.) that are specially constructed to store and implement program instructions. Examples of program instructions include not only machine language codes formatted by compilers, but also high-level language codes that can be implemented by computers using interpreters. The hardware device can be configured to be operated by one or more software modules or vice versa to implement processing according to the present invention.
[0464] Although the present invention has been described in terms of specific items (such as, detailed elements) and limited embodiments and drawings, they are only provided to help a more comprehensive understanding of the present invention, and the present invention is not limited to the above embodiments. It will be appreciated by those skilled in the art that various modifications and changes may be made to the above description.
[0465] Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents will fall within the scope and spirit of the present invention.
[0466] Industrial Applicability
[0467] The present invention can be used to encode / decode images.
Claims
1. A method for decoding an image, the method comprising: Determining reference samples of the current block included in the selected reference sample line; filtering the reference samples; and Use the filtered reference samples to perform intra prediction, The step of performing intra-frame prediction includes: determining an interpolation filter from a plurality of interpolation filters; and applying the determined interpolation filter to the filtered reference samples, The interpolation filter is determined based on the size of the current block, the intra prediction mode of the current block, whether the current block is split, and whether a condition for performing reference sample filtering is satisfied according to the intra prediction mode.
2. The method of claim 1, wherein: The intra prediction is performed by applying the determined interpolation filter to the filtered reference samples only when the pixel components of the current block are luminance samples.
3. The method of claim 1, wherein: The plurality of interpolation filters are a first filter and a second filter having a length of 4 and a unit of 1 / 32.
4. The method of claim 1, wherein: The sum of the filter coefficients of the plurality of interpolation filters is 64.
5. The method of claim 3, wherein: The first filter is the same as an interpolation filter used in inter-frame prediction for chroma components.
6. A method for encoding an image, the method comprising: Determine the reference sample point of the current block; filtering the reference samples; and Use the filtered reference samples to perform intra prediction, The step of performing intra-frame prediction includes: determining an interpolation filter from a plurality of interpolation filters; and applying the determined interpolation filter to the filtered reference samples, The interpolation filter is determined based on the size of the current block, the intra prediction mode of the current block, whether the current block is split, and whether a condition for performing reference sample filtering is satisfied according to the intra prediction mode.
7. A method for sending a bit stream, the method comprising: Sending the bit stream generated by the video encoding method; The video encoding method includes: Determine the reference sample point of the current block; filtering the reference samples; and Use the filtered reference samples to perform intra prediction, The step of performing intra-frame prediction includes: determining an interpolation filter from a plurality of interpolation filters; and applying the determined interpolation filter to the filtered reference samples, The interpolation filter is determined based on the size of the current block, the intra prediction mode of the current block, whether the current block is split, and whether a condition for performing reference sample filtering is satisfied according to the intra prediction mode.
Citation Information
Patent Citations
Method and apparatus for image encoding and decoding using intra prediction
CN105100809A
Method and apparatus for pre-prediction filtering for use in block-prediction techniques
CN106134201A
Intraframe prediction performance improvement encoding method
CN106170093A
Apparatus for encoding and decoding image by skip encoding and method for same
US20130058585A1