Video encoding / decoding method and apparatus and recording medium storing bitstream
By optimizing the intra-frame prediction process and using adjacent reconstructed sample lines to configure reference samples, the problem of resource waste in high-resolution and high-quality image encoding/decoding is solved, achieving more efficient resource utilization and encoding/decoding efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ELECTRONICS & TELECOMM RES INST
- Filing Date
- 2017-09-11
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies for encoding/decoding high-resolution and high-quality images do not utilize the resources required for intra-frame prediction efficiently enough, resulting in a waste of hardware resources and memory bandwidth.
By determining whether the boundary of the current block is the boundary of the predetermined image region, reference samples are configured using adjacent reconstructed sample lines, optimizing the intra-frame prediction process and reducing the size of the line buffer.
By making efficient use of resources, the hardware resources and bandwidth required for intra-frame prediction are reduced, thus improving the efficiency of image encoding/decoding.
Smart Images

Figure CN117201776B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application filed on September 11, 2017, with application number "201780055185.8" and titled "Video Encoding / Decoding Method and Apparatus and Recording Medium Therein for Storing Bit Streams". Technical Field
[0002] This invention relates to a method and apparatus for encoding / decoding images, and a recording medium for storing bitstreams. Specifically, this invention relates to a method and apparatus for encoding / decoding images using intra-frame prediction, and a recording medium for storing bitstreams generated by the image encoding method / apparatus of this invention. Background Technology
[0003] Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) and ultra-high-definition (UHD) images, has increased across various application areas. However, higher resolution and quality image data involve a significant increase in data volume compared to traditional image data. Consequently, the costs of transmission and storage increase when transmitting image data using media such as traditional wired and wireless broadband networks, or when storing image data using traditional storage media. To address these issues arising from the increasing resolution and quality of image data, efficient image encoding / decoding technologies are needed for higher resolution and higher quality images.
[0004] Image compression techniques encompass various methods, including: inter-frame prediction, which predicts pixel values included in the current frame from previous or subsequent frames; intra-frame prediction, which predicts pixel values included in the current frame using pixel information from the current frame; energy transformation and quantization techniques for compressing residual signals; entropy coding, which assigns short codes to values with high frequency of occurrence and long codes to values with low frequency of occurrence; and so on. Image data can be effectively compressed using such image compression techniques, and the image data can be sent or stored.
[0005] In traditional intra-frame prediction, reconstructed samples located in multiple line buffers are used to construct reference samples. Therefore, when implementing the encoder / decoder, additional hardware resources and memory bandwidth are required compared to using a single line buffer or not using a line buffer at all. Summary of the Invention
[0006] Technical issues
[0007] One object of the present invention is to provide an image encoding / decoding method and apparatus that can effectively utilize resources.
[0008] Another object of the present invention is to provide an image encoding / decoding method and apparatus that effectively utilizes the resources required for intra-frame prediction.
[0009] Another object of the present invention is to provide a method and apparatus for determining the number and location of reconstructed sample lines for constructing reference samples based on the position of the current block within a predetermined image region, so as to reduce the size of the line buffer used for intra-frame prediction.
[0010] Another object of the present invention is to provide a recording medium for storing a bitstream generated by the image encoding method / device of the present invention.
[0011] Technical solution
[0012] The image decoding method according to the present invention may include: deriving an intra-prediction mode for a current block, determining whether the left or upper boundary of the current block is the boundary of a predetermined image region, configuring reference samples based on the determination result by using at least one reconstructed sample included in at least one reconstructed sample line adjacent to the current block, and performing intra-prediction on the current block based on the intra-prediction mode and the reference samples.
[0013] In the image decoding method of the present invention, the predetermined image region can be one of a frame, strip, strip segment, parallel block, and coding tree block.
[0014] In the image decoding method of the present invention, when neither the left nor the top boundary of the current block is the boundary of the predetermined image region, reference samples can be configured by using the same reconstructed sample line for the left and top sides of the current block.
[0015] In the image decoding method of the present invention, when the first boundary of the left and upper boundaries of the current block is the boundary of the predetermined image region and the remaining second boundary is not the boundary of the predetermined image region, the number of reconstructed sample lines used to configure the reference sample points or the position of the reconstructed sample lines used to configure the reference sample points may be different for the first boundary and the second boundary.
[0016] In the image decoding method of the present invention, the first boundary can be the upper boundary and the second boundary can be the left boundary.
[0017] In the image decoding method of the present invention, when a single reconstruction sample line among the at least one reconstruction sample line is used to configure reference samples, reference samples for a first boundary can be configured by using a reconstruction sample line that is substantially adjacent to the current block, and reference samples for a second boundary can be configured by using a single reconstruction sample line selected from the at least one reconstruction sample line.
[0018] In the image decoding method of the present invention, when at least two of the at least one reconstructed sample lines are used when configuring reference sample points, reference sample points for a first boundary can be configured by using reconstructed sample lines that are substantially adjacent to the current block multiple times, and reference sample points for a second boundary can be configured by using at least two reconstructed sample lines selected from the at least one reconstructed sample line.
[0019] In the image decoding method of the present invention, when at least two of the at least one reconstructed sample lines are used to configure reference samples, the reference samples can be configured by using at least one of the weighted sum, average, maximum, minimum and median values of at least two reconstructed samples on the at least two reconstructed sample lines.
[0020] In the image decoding method of the present invention, the positions of the at least two reconstructed sample points can be variably determined based on the positions of the predicted target sample points within the current block.
[0021] In the image decoding method of the present invention, the weights used in the weighted sum can be determined based on the distance from the current block.
[0022] In the image decoding method of the present invention, when both the left and upper boundaries of the current block are the boundaries of the predetermined image region, reference samples can be configured by using the same or different reconstruction sample lines for the left and upper sides of the current block.
[0023] In the image decoding method of the present invention, when reference samples are configured by using different reconstructed sample lines for the left and top sides of the current block, the number of reconstructed sample lines for the left side of the current block can be greater than the number of reconstructed sample lines for the top side of the current block.
[0024] The image encoding method according to the present invention may include: determining an intra-prediction mode for a current block, determining whether the left or upper boundary of the current block is the boundary of a predetermined image region, configuring reference samples based on the determination result by using at least one reconstruction sample included in at least one reconstruction sample line adjacent to the current block, and performing intra-prediction on the current block based on the intra-prediction mode and the reference sample.
[0025] The image decoding apparatus according to the present invention may include an intra-predictor, wherein the intra-predictor is configured to derive an intra-prediction mode for a current block, determine whether the left or upper boundary of the current block is a boundary of a predetermined image region, configure reference samples based on the determination result by using at least one reconstructed sample in at least one reconstructed sample line adjacent to the current block, and perform intra-prediction on the current block based on the intra-prediction mode and the reference samples.
[0026] Image coding apparatus may include an intra predictor, wherein the intra predictor is configured to determine an intra prediction mode for a current block, determine whether the left or top boundary of the current block is a boundary of a predetermined image region, configure reference samples based on the determination result by using at least one reconstructed sample in at least one reconstructed sample line adjacent to the current block, and perform intra prediction on the current block based on the intra prediction mode and the reference samples.
[0027] The recording medium according to the invention can store a bitstream generated by the image encoding method according to the invention.
[0028] Beneficial effects
[0029] According to the present invention, an image encoding / decoding method and apparatus capable of effectively utilizing resources can be provided.
[0030] Furthermore, according to the present invention, an image encoding / decoding method and apparatus that effectively utilize the resources required for intra-frame prediction can be provided.
[0031] Furthermore, according to the present invention, an image encoding / decoding method and apparatus can be provided for reducing the hardware resources and bandwidth required to implement the encoder / decoder by reducing the size of the line buffer used for intra-frame prediction.
[0032] Furthermore, according to the present invention, a recording medium for storing the bitstream generated by the image encoding method / device of the present invention can be provided. Attached Figure Description
[0033] Figure 1 This is a block diagram illustrating the configuration of an encoding device according to an embodiment of the present invention.
[0034] Figure 2 This is a block diagram illustrating the configuration of a decoding device according to an embodiment of the present invention.
[0035] Figure 3 It is a schematic diagram illustrating the partitioning structure of an image when it is encoded and decoded.
[0036] Figure 4 This is a diagram illustrating an embodiment of the processing used to explain intra-frame prediction.
[0037] Figure 5 This is a diagram illustrating intra-frame prediction according to the present invention.
[0038] Figure 6 This is a diagram illustrating an example of configuring reference sample lines when the current block is not adjacent to the CTU boundary.
[0039] Figure 7 This is a diagram illustrating an example of configuring reference sample lines when the current block is adjacent to the CTU boundary. Detailed Implementation
[0040] Various modifications can be made to this invention, and various embodiments of the invention exist, wherein examples of these various embodiments will now be provided with reference to the accompanying drawings, and examples of these various embodiments will be described in detail. However, the invention is not limited thereto, although exemplary embodiments may be interpreted as including all modifications, equivalents, or substitutions within the technical concept and scope of the invention. Similar reference numerals indicate the same or similar functions in various respects. In the drawings, the shapes and sizes of elements may be exaggerated for clarity. In the following detailed description of the invention, reference is made to the accompanying drawings, which illustrate specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice this disclosure. It should be understood that the various embodiments of this disclosure, though different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics associated with one embodiment described herein may be implemented in other embodiments without departing from the spirit and scope of this disclosure. Furthermore, it should be understood that the position or arrangement of various elements within each disclosed embodiment may be modified without departing from the spirit and scope of this disclosure. Therefore, the following detailed description is not intended to be limiting, and the scope of this disclosure is defined only by the appended claims (and, where appropriate, the full scope of the equivalents claimed in the claims).
[0041] The terms "first," "second," etc., used in this specification may be used to describe various components, but these components are not to be construed as limiting the terms. The terms are used only to distinguish one component from another. For example, without departing from the scope of the invention, a "first" component may be referred to as a "second" component, and a "second" component may similarly be referred to as a "first" component. The term "and / or" includes a combination of multiple items or any one of multiple items.
[0042] It will be understood that in this specification, when an element is simply referred to as "connected to" or "joined to" another element rather than "directly connected to" or "directly joined to" another element, it can be "directly connected to" or "directly joined to" another element, or connected to or joined to another element in the presence of other elements between the element and the other element. Conversely, it should be understood that when an element is referred to as "directly joined" or "directly connected" to another element, there is no intermediate element.
[0043] Furthermore, the components shown in the embodiments of the present invention are illustrated independently to present distinct functionalities. Therefore, this does not imply that each component is composed as a separate hardware or software unit. In other words, for convenience, each component includes every one of the enumerated components. Thus, at least two components in each component can be combined to form a single component, or a single component can be divided into multiple components to perform each function. Embodiments where each component is combined and embodiments where a component is divided are also included within the scope of the invention without departing from its spirit.
[0044] The terminology used in this specification is for describing particular embodiments only and is not intended to limit the invention. Expressions used in the singular include plural expressions unless they have a distinct meaning in the context. In this specification, it will be understood that terms such as “comprising,” “having,” etc., are intended to indicate the presence of features, quantities, steps, actions, elements, components, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, quantities, steps, actions, elements, components, or combinations thereof may be present or added. In other words, when a particular element is referred to as “comprising,” elements other than the corresponding element are not excluded; rather, additional elements may be included in embodiments of the invention or within the scope of the invention.
[0045] Furthermore, some components may not be essential for performing the necessary functions of the invention, but rather optional components that merely enhance its performance. The invention can be implemented by including only the essential components necessary for carrying out the invention, excluding components used to enhance performance. Structures that include only the essential components and exclude optional components used solely for enhancing performance are also included within the scope of the invention.
[0046] In the following, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing exemplary embodiments of the invention, well-known functions or structures will not be described in detail, as they would unnecessarily obscure the understanding of the invention. The same constituent elements in the drawings are denoted by the same reference numerals, and repeated descriptions of the same elements will be omitted.
[0047] Furthermore, in the following text, "image" can mean either a frame that constitutes a video or the video itself. For example, "encoding or decoding an image, or both" can mean "encoding or decoding a video, or both," and can also mean "encoding or decoding one of a plurality of images in a video, or both." Here, "frame" and "image" can have the same meaning.
[0048] Terminology Description
[0049] Encoder: A device that performs encoding.
[0050] Decoder: A device that performs decoding.
[0051] A block is a sample of an M×N matrix. Here, M and N represent positive integers, and a block can be a two-dimensional sample matrix. A block can indicate a unit. The current block can be a coding target block that becomes the target during encoding, or a decoding target block that becomes the target during decoding. Furthermore, the current block can be at least one of a coding block, a prediction block, a residual block, and a transform block.
[0052] Sample: The basic unit that makes up a block. It can be represented as a number from 0 to 2 based on the bit depth (Bd). Bd The value of -1. In this invention, a sample point can be used as the meaning of a pixel.
[0053] Unit: Indicates an encoding and decoding unit. When encoding and decoding an image, a unit can be a region generated by partitioning a single image. Furthermore, a unit can mean a sub-partition unit when a single image is partitioned into multiple sub-partition units during encoding or decoding. During image encoding and decoding, predetermined processing can be performed for each unit. A single unit can be partitioned into sub-units smaller than the unit's size. Depending on the function, a unit can mean a block, macroblock, coding tree unit, coding tree block, coding unit, coding block, prediction unit, prediction block, residual unit, residual block, transform unit, transform block, etc. Furthermore, to distinguish a unit from a block, a unit can include a luma component block, a chroma component block associated with the luma component block, and syntax elements for each chroma component block. Units can have various sizes and shapes; specifically, the shape of a unit can be a two-dimensional geometric shape, such as a rectangle, square, trapezoid, triangle, pentagon, etc. In addition, unit information can include at least one of the following: unit type (indicates coding unit, prediction unit, transform unit, etc.), unit size, unit depth, and the order in which the unit is encoded and decoded.
[0054] Encoding Tree Unit: A single encoding tree block configured with the luminance component Y and two encoding tree blocks associated with the chrominance components Cb and Cr. Furthermore, an encoding tree unit can be understood as including the block and the syntax elements of each block. Each encoding tree unit can be partitioned using at least one partitioning method, such as a quadtree partitioning method or a binary tree partitioning method, to form lower-level units such as encoding units, prediction units, transform units, etc. Encoding tree unit can be used as a term to refer to pixel blocks (wherein, when encoding / decoding an image into an input image, the pixel block becomes a processing unit).
[0055] Encoding Tree Block: Can be used as a term to refer to any one of the Y encoding tree block, Cb encoding tree block, and Cr encoding tree block.
[0056] Neighboring block: This refers to the block adjacent to the current block. A block adjacent to the current block can be a block that touches the boundary of the current block, or a block located within a predetermined distance from the current block. A neighboring block can also be a block adjacent to the vertex of the current block. Here, a block adjacent to the vertex of the current block can be 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.
[0057] Reconstructing neighboring units: This refers to neighboring blocks that are adjacent to the current block and have been spatially or temporally encoded or decoded. Here, reconstructing neighboring blocks can mean reconstructing neighboring units. Reconstructing spatially neighboring blocks can be blocks within the current frame that have been reconstructed through encoding or decoding, or both. Reconstructing temporally neighboring blocks are blocks within a reference frame that are located at the same position as the current block in the current frame, or their neighboring blocks.
[0058] Cell depth: refers to the degree to which a cell is partitioned. In a tree structure, the root node can be the highest node, and the leaf node can be the lowest node. Furthermore, when cells are represented as a tree structure, the level at which the cell exists can be considered the cell depth.
[0059] Bitstream: refers to a stream of bits that includes encoded image information.
[0060] Parameter set: Corresponds to the header information constructed within the bitstream. The parameter set may include at least one parameter set from the video parameter set, sequence parameter set, frame parameter set, and adaptive parameter set. Additionally, the parameter set may include strip header information and tile header information, etc.
[0061] Explanation: This could mean determining the value of a syntax element by performing entropy decoding, or it could mean entropy decoding itself.
[0062] Symbol: can mean at least one of the syntax elements, encoding parameters, or transform coefficient values of the encoding / decoding target unit. In addition, a symbol can mean the entropy encoding target or the entropy decoding result.
[0063] Prediction unit: This refers to the basic unit used when performing predictions (such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation). A single prediction unit can be partitioned into multiple partitions with small sizes or into lower-level prediction units.
[0064] Prediction cell partitioning: refers to the shape obtained by partitioning prediction cells.
[0065] Transform unit: This refers to the basic unit used when encoding / decoding (such as transform, inverse transform, quantization, dequantization, and transform coefficient encoding / decoding) a residual signal. A single transform unit can be partitioned into multiple transform units with small dimensions.
[0066] Figure 1 This is a block diagram illustrating the configuration of an encoding device according to an embodiment of the present invention.
[0067] Encoding device 100 may be an encoder, a video encoding device, or an image encoding device. The video may include at least one image. Encoding device 100 may encode at least one image sequentially.
[0068] Reference Figure 1 The encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switcher 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy coding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference frame buffer 190.
[0069] Encoding device 100 can perform encoding of the input image using intra-frame mode, inter-frame mode, or both. Furthermore, encoding device 100 can generate a bitstream by encoding the input image and output the generated bitstream. The generated bitstream can be stored in a computer-readable recording medium or streamed via a wired / wireless transmission medium. When intra-frame mode is used as the prediction mode, switcher 115 can switch to intra-frame mode. Optionally, when inter-frame mode is used as the prediction mode, switcher 115 can switch to inter-frame mode. Here, intra-frame mode can mean intra-frame prediction mode, and inter-frame mode can mean inter-frame prediction mode. Encoding device 100 can generate prediction blocks for input blocks of the input image. Furthermore, after generating the prediction blocks, encoding device 100 can encode the residual between the input blocks and the prediction blocks. The input image can be referred to as the current image as the current encoding target. The input block can be referred to as the current block as the current encoding target or as the encoding target block.
[0070] When the prediction mode is intra-frame mode, the intra-frame prediction unit 120 can use the pixel values of the encoded / decoded blocks adjacent to the current block as reference pixels. The intra-frame prediction unit 120 can perform spatial prediction by using the reference pixels, or generate prediction samples of the input block by performing spatial prediction. Here, intra-frame prediction can mean prediction within a frame.
[0071] When the prediction mode is inter-frame mode, the motion prediction unit 111 can retrieve the region that best matches the input block from the reference image during motion prediction and derive the motion vector by using the retrieved region. The reference image can be stored in the reference frame buffer 190.
[0072] The motion compensation unit 112 can generate prediction blocks by performing motion compensation using motion vectors. Here, inter-frame prediction can mean prediction or motion compensation between frames.
[0073] Subtractor 125 can generate a residual block by using the residual between the input block and the prediction block. The residual block can be referred to as a residual signal. The residual signal can be understood as the difference between the original signal and the prediction signal. Furthermore, the residual signal can be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal, or by performing both transformation and quantization. The residual block can be the residual signal of a block cell.
[0074] Transform unit 130 can generate transform coefficients by performing a transform on the residual block and can output the generated transform coefficients. Here, the transform coefficients can be coefficient values generated by performing a transform on the residual block. When applying the transform skip mode, transform unit 130 can skip the transform on the residual block.
[0075] Quantization levels can be generated by applying quantization to the transform coefficients or residual signal. In the following examples, the quantization levels may also be referred to as transform coefficients.
[0076] The quantization unit 140 can generate a quantization level by quantizing the transform coefficients or residual signal according to parameters, and can output the generated quantization level. Here, the quantization unit 140 can quantize the transform coefficients using a quantization matrix.
[0077] Entropy coding unit 150 can generate a bitstream by performing entropy coding on the values calculated by quantization unit 140 according to a probability distribution or on the coding parameter values calculated during encoding, and output the generated bitstream. Entropy coding unit 150 can perform entropy coding on pixel information of the image and information used for decoding the image. For example, the information used for decoding the image may include syntax elements.
[0078] When entropy coding is applied, symbols are represented such that fewer bits are allocated to symbols with a high probability of being generated and more bits are allocated to symbols with a low probability of being generated, thus reducing the size of the bitstream used to encode the symbols. The entropy coding unit 150 can use coding methods for entropy coding such as Exponential Golomb, Context Adaptive Variable-Length Coding (CAVLC), and Context Adaptive Binary Arithmetic Coding (CABAC). For example, the entropy coding unit 150 can perform entropy coding by using a Variable-Length Code (VLC) table. Furthermore, the entropy coding unit 150 can derive a binarization method for the target symbol and a probabilistic model of the target symbol / bits, and perform arithmetic coding by using the derived binarization method and context model.
[0079] In order to encode the transform coefficient levels, the entropy coding unit 150 can change the coefficients in two-dimensional block form into one-dimensional vector form by using a transform coefficient scanning method.
[0080] Encoding parameters may include information such as syntax elements (flags, indexes, etc.) encoded in the encoder and signaled to the decoder, as well as information derived during encoding or decoding. Encoding parameters can mean information required when encoding or decoding an image. For example, encoding parameters may include at least one value or combination of the following: block size, block depth, block partitioning information, cell size, cell depth, cell partitioning information, quadtree partitioning flag, binary tree partitioning flag, binary tree partitioning angle, intra-frame prediction mode, intra-frame prediction angle, reference sample filtering method, prediction block boundary filtering method, filter taps, filter coefficients, inter-frame prediction mode, motion information, motion vectors, reference image index, inter-frame prediction angle, inter-frame prediction indicator, reference image list, motion vector prediction factor, motion vector candidate list, whether motion merging mode is used, motion merging candidates, motion merging candidate list, whether skip mode is used, and interpolation filters. Information includes: type, motion vector size, motion vector representation accuracy, transform type, transform size, whether an additional (secondary) transform is used, presence of residual signal, code block style, code block flag, quantization parameters, quantization matrix, loop filter information, whether a loop filter is applied, loop filter coefficients, binarization / debinarization method, context model, context bits, bypass bits, transform coefficients, transform coefficient level, transform coefficient level scanning method, image display / output order, stripe identification information, stripe type, stripe partition information, parallel block identification information, parallel block type, parallel block partition information, frame type, bit depth, and information on luminance or chrominance signals.
[0081] Here, sending a flag or index with a signal can mean entropy encoding the corresponding flag or index by an encoder and including the corresponding flag or index in the bit stream, and can also mean entropy decoding the corresponding flag or index from the bit stream by a decoder.
[0082] When the encoding device 100 performs encoding via inter-frame prediction, the encoded current image can be used as a reference image for another image that will be processed subsequently. Therefore, the encoding device 100 can reconstruct or decode the encoded current image, or store the reconstructed or decoded image as a reference image.
[0083] The quantization level can be dequantized in dequantization unit 160, or inverse transformed in inverse transform unit 170. The coefficients that have undergone dequantization or inverse transform, or both, can be added to the prediction block by adder 175. A reconstructed block can be generated by adding the coefficients that have undergone dequantization or inverse transform, or both, to the prediction block. Here, the coefficients that have undergone dequantization or inverse transform, or both, can be understood as coefficients that have undergone at least one of dequantization and inverse transform, and can be understood as reconstructing the residual block.
[0084] The reconstructed block can be passed through filter unit 180. Filter unit 180 can apply at least one of deblocking filter, sample adaptive offset (SAO), and adaptive loop filter (ALF) to the reconstructed block or reconstructed image. Filter unit 180 may be referred to as a loop filter.
[0085] Deblocking filters remove block distortion generated at the boundaries between blocks. To determine whether to apply a deblocking filter, the number of pixels included in a block (in rows or columns) can be used. When a deblocking filter is applied to a block, another filter can be applied based on the desired deblocking intensity.
[0086] To compensate for coding errors, a suitable offset value can be added to the pixel value using sample adaptive offset. Sample adaptive offset corrects the offset of the deblocked image from the original image on a pixel-by-pixel basis. This can be achieved by applying the offset considering edge information for each pixel, or by dividing the image's pixels into a predetermined number of regions, determining the regions to be offset, and applying the offset to the determined regions.
[0087] An adaptive loop filter (ALF) performs filtering based on a comparison between the filtered reconstructed image and the original image. Pixels included in the image can be partitioned into predetermined groups, the filter to be applied to each group can be determined, and different filtering can be performed for each group. Information on whether to apply the ALF can be transmitted via a signal through the encoding unit (CU), and the shape and coefficients of the ALF to be applied to each block can vary.
[0088] The reconstructed block or reconstructed image that has passed through filter unit 180 can be stored in reference screen buffer 190. Figure 2 This is a block diagram illustrating the configuration of a decoding device according to an embodiment of the present invention.
[0089] Decoding device 200 can be a decoder, video decoding device, or image decoding device.
[0090] Reference Figure 2 The decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference frame buffer 270.
[0091] Decoding device 200 can receive bitstreams output from encoding device 100. Decoding device 200 can receive bitstreams stored on a computer-readable recording medium, or bitstreams streamed via wired / wireless transmission media. Decoding device 200 can decode the bitstreams using intra-frame mode or inter-frame mode. Furthermore, decoding device 200 can generate a decoded image or a reconstructed image generated by decoding, and output the reconstructed image or the decoded image.
[0092] When the prediction mode used during decoding is intra-frame mode, the switcher can switch to intra-frame mode. Optionally, when the prediction mode used during decoding is inter-frame mode, the switcher can switch to inter-frame mode.
[0093] Decoding device 200 obtains a reconstructed residual block and generates a prediction block by decoding the input bitstream. Once the reconstructed residual block and prediction block are obtained, decoding device 200 generates a reconstructed block that becomes the decoding target by adding the reconstructed residual block and the prediction block. The decoding target block can be referred to as the current block.
[0094] The entropy decoding unit 210 can generate symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols may include symbols in a quantized hierarchical form. Here, the entropy decoding method can be the inverse process of the entropy encoding method described above.
[0095] In order to decode the transform coefficient levels, the entropy decoding unit 210 can change the coefficients in one-dimensional vector form into two-dimensional block form by using the transform coefficient scanning method.
[0096] The quantization level can be dequantized in dequantization unit 220, or inverse transformed in inverse transform unit 230. The quantization level can be the result of dequantization, inverse transform, or both, and can be generated as a reconstruction residual block. Here, dequantization unit 220 can apply a quantization matrix to the quantization level.
[0097] When the intra-frame mode is used, the intra-frame prediction unit 240 can generate a prediction block by performing spatial prediction, wherein the spatial prediction uses the pixel values of a block that is adjacent to the target block and has already been decoded.
[0098] When the inter-frame mode is used, the motion compensation unit 250 can generate prediction blocks by performing motion compensation, wherein the motion compensation uses a reference image stored in the reference frame buffer 270 and motion vectors.
[0099] Adder 255 generates a reconstructed block by adding the reconstructed residual block and the predicted block. Filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or reconstructed image. Filter unit 260 can output a reconstructed image. The reconstructed block or reconstructed image can be stored in reference frame buffer 270 and can be used when performing inter-frame prediction.
[0100] Figure 3 It is a schematic diagram illustrating the partitioning structure of an image when it is encoded and decoded. Figure 3 An example of dividing a single cell into multiple sub-cells is illustrated schematically.
[0101] To effectively partition an image, coding units (CUs) can be used during encoding and decoding. Coding units can serve as basic units when encoding / decoding an image. Furthermore, coding units can be used to distinguish between intra-frame and inter-frame modes during image encoding / decoding. Coding units can be basic units used for predicting, transforming, quantizing, inverse transforming, dequantizing, or encoding / decoding processing of transform coefficients.
[0102] Reference Figure 3Image 300 is partitioned sequentially according to the Largest Coding Unit (LCU), and the LCU unit is determined as the partition structure. Here, LCU can be used in the same sense as Coding Tree Unit (CTU). Unit partitioning can refer to partitioning the block associated with the unit. The block partitioning information may include information about the unit depth. The depth information may indicate the number of times the unit is partitioned or the degree to which the unit is partitioned, or both. A single unit may be partitioned based on a tree structure according to the layers associated with the depth information. Each of the partitioned lower-level units may have depth information. The depth information may be information representing the size of the CU and may be stored in each CU.
[0103] The partitioning structure can be understood as the distribution of coding units (CUs) within LCU 310. This distribution can be determined by whether a single CU is partitioned into multiple CUs (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.). The horizontal and vertical sizes of the CUs generated by partitioning can be half the horizontal and vertical sizes of the CUs before partitioning, respectively, or, depending on the number of partitions, smaller than the horizontal and vertical sizes before partitioning. CUs can be recursively partitioned into multiple CUs. The partitioning of CUs can be performed recursively until a predefined depth or a predefined size is reached. For example, the depth of the LCU can be 0, and the depth of the minimum coding unit (SCU) can be a predefined maximum depth. Here, the LCU can be a coding unit with the maximum coding unit size, and the SCU can be a coding unit with the minimum coding unit size as described above. Partitioning begins at LCU 310, and the CU depth increases by 1 as the horizontal or vertical size of the CU, or both, decreases through partitioning.
[0104] Furthermore, partition information of a CU can be used to indicate whether a CU is partitioned. Partition information can be 1 bit. All CUs except SCUs can include partition information. For example, when the partition information value is 1, the CU may not be partitioned, and when the partition information value is 2, the CU may be partitioned.
[0105] Reference Figure 3 An LCU with depth 0 can be a 64×64 block. 0 can be the minimum depth. An SCU with depth 3 can be an 8×8 block. 3 can be the maximum depth. CUs with 32×32 blocks and 16×16 blocks can be represented as depth 1 and depth 2, respectively.
[0106] For example, when a single coding unit is partitioned into four coding units, the horizontal and vertical sizes of the four partitioned coding units can be half the horizontal and vertical sizes of the CU before partitioning. In one embodiment, when a 32×32 coding unit is partitioned into four coding units, the size of each of the four partitioned coding units can be 16×16. When a single coding unit is partitioned into four coding units, this can be referred to as the coding unit being partitioned into a quadtree form.
[0107] For example, when a single coding unit is partitioned into two coding units, the horizontal or vertical size of the two coding units can be half the horizontal or vertical size of the coding unit before partitioning. For example, when a coding unit of size 32×32 is partitioned vertically, the size of each of the two resulting coding units can be 16×32. When a single coding unit is partitioned into two coding units, this can be referred to as partitioning the coding unit in a binary tree manner. Figure 3 The LCU 320 is an example of an LCU that applies both quadtree-based partitioning and binary tree-based partitioning.
[0108] Figure 4 This is a diagram illustrating intra-frame prediction processing.
[0109] Intra-frame prediction modes can be non-angular or angular. Non-angular modes can be DC or planar modes, and angular modes can be prediction modes with a specific direction or angle. Intra-frame prediction modes can be represented by at least one of mode number, mode value, mode number, and mode angle. The number of intra-frame prediction modes can be M, including 1, and includes both non-angular and angular modes.
[0110] Regardless of the block size, the number of intra-prediction modes can be fixed at N. Optionally, the number of intra-prediction modes can vary depending on the block size, color component type, or both. For example, as the block size increases, the number of intra-prediction modes can be increased. Optionally, the number of intra-prediction modes for the luma component block can be greater than the number of intra-prediction modes for the chroma component block.
[0111] To perform intra-frame prediction for the current block, the following steps can be performed: determining whether a sample included in a reconstructed neighboring block can be used as a reference sample for the current block. When a sample cannot be used as a reference sample for the current block, the unusable sample value can be replaced by a value obtained by copying or interpolating, or both, at least one sample value included in a reconstructed neighboring block. The replaced sample value is then used as a reference sample for the current block.
[0112] When performing intra-frame prediction, filters can be applied to at least one of the reference samples and the prediction samples based on the intra-frame prediction mode and the current block size.
[0113] In planar mode, when generating the prediction block for the current block, the sample value of the prediction target sample is generated by using a weighted sum of the left and top reference samples of the current sample, as well as the top-right and bottom-left reference samples of the current block, based on the position of the prediction target sample within the prediction block. Furthermore, in DC mode, when generating the prediction block for the current block, the average value of the top and left reference samples of the current block can be used. Additionally, in angled mode, the prediction block can be generated using the top, left, top-right, and / or bottom-left reference samples of the current block. Real-valued interpolation can be performed to generate the prediction sample values.
[0114] The intra-prediction mode of the current block can be entropy-encoded / decoded by predicting the intra-prediction modes of blocks adjacent to the current block. When the intra-prediction mode of the current block is the same as that of neighboring blocks, this information can be transmitted using a predetermined flag. Furthermore, an indicator of the intra-prediction mode among multiple neighboring blocks that is the same as the intra-prediction mode of the current block can be transmitted using a signal. When the intra-prediction mode of the current block differs from that of neighboring blocks, entropy encoding / decoding can be performed on the intra-prediction mode information of the current block based on the intra-prediction modes of neighboring blocks.
[0115] Figure 5 This is a diagram illustrating intra-frame prediction according to the present invention.
[0116] Intra-frame prediction for the current block may include the following steps: step S510, deriving the intra-frame prediction mode; step S520, configuring reference samples; and / or step S530, performing intra-frame prediction.
[0117] In step S510, the intra-prediction mode of the current block can be derived. The intra-prediction mode of the current block can be derived using methods such as: using intra-prediction modes of neighboring blocks, entropy encoding / decoding the intra-prediction mode of the current block from the bitstream, or using encoding parameters of neighboring blocks. According to the method of using intra-prediction modes of neighboring blocks, the intra-prediction mode of the current block can be derived using at least one intra-prediction mode derived via using intra-prediction modes of neighboring blocks, a combination of at least one intra-prediction mode of neighboring blocks, and at least one MPM.
[0118] In step S520, the reference sample can be configured by performing at least one of reference sample selection and reference sample filtering.
[0119] In step S530, intra-frame prediction can be performed by executing at least one of non-angle prediction, angle prediction, position-information-based prediction, and luminance / chrominance signal-based prediction. When performing angle prediction, predictions with angles varying according to predetermined units can be performed, wherein the predetermined unit includes at least one sample point of the current block. The predetermined unit can be, for example, at least one of a single sample point, a group of sample points, a line, and a block. In step S530, filtering of the predicted sample points can be additionally performed.
[0120] To derive the intra-prediction mode of the current block, at least one reconstructed neighboring block can be used. The location of the reconstructed neighboring block can be a predefined fixed location, or it can be a location derived through encoding / decoding. In the following text, encoding / decoding can mean entropy encoding and entropy decoding. For example, when the coordinates of the top-left side sample point of the current block of size WxH are (0, 0), the neighboring block can be at least one of the blocks adjacent to coordinates (-1, H-1), (W-1, -1), (W, -1), (-1, H), and (-1, -1) as well as the neighboring blocks of the aforementioned blocks.
[0121] The intra-prediction mode of an unavailable neighboring block can be replaced by a predetermined intra-prediction mode. The predetermined intra-prediction mode can be, for example, a DC mode, a planar mode, a vertical mode, a horizontal mode, and / or a diagonal mode. For example, a neighboring block is inter-predicted when it is located outside the boundary of at least one predetermined unit among a frame, stripe, parallel block, and coding tree unit; or, when a neighboring block is encoded according to the PCM mode, the corresponding block can be determined to be unavailable.
[0122] The intra-prediction mode of the current block can be derived as the intra-prediction mode of neighboring blocks at a predetermined position, or as a statistical value of the intra-prediction modes of at least two neighboring blocks. In this specification, the statistical value may mean at least one of the following: average, maximum, minimum, mode, median, weighted average, and interpolation.
[0123] Optionally, the intra-prediction mode of the current block can be derived based on the size of neighboring blocks. For example, the intra-prediction mode of a neighboring block with a relatively large size can be derived as the intra-prediction mode of the current block. Optionally, statistics can be calculated by assigning large weights to the intra-prediction modes of blocks with relatively large sizes.
[0124] Optionally, it may be considered whether the intra-prediction mode of neighboring blocks is an angular mode. For example, when the intra-prediction mode of a neighboring block is a non-angular mode, the non-angular mode can be derived as the intra-prediction mode of the current block. Optionally, the intra-prediction modes of other neighboring blocks other than angular modes can be derived as the intra-prediction mode of the current block.
[0125] To derive the intra-prediction mode for the current block, a most probable mode (MPM) list can be configured using the intra-prediction modes of neighboring blocks. The number N of candidate modes included in the MPM list can be fixed, or determined based on the size or shape of the current block, or both. The MPM list can be configured to exclude overlapping modes. When the number of available candidate modes is less than N, predetermined candidate modes (e.g., modes obtained by adding a predetermined offset to an angle mode or by subtracting a predetermined offset from an angle mode) can be added to the MPM list. Optionally, at least one of a horizontal mode, a vertical mode, a 45° angle mode, a 135° angle mode, a 225° angle mode, and a non-angle mode can be added to the MPM list. The predetermined offset can be 1, 2, 3, 4, or a positive integer.
[0126] The MPM list can be configured in a predetermined order based on the position of neighboring blocks. For example, the predetermined order could be the order of blocks adjacent to the left, top, bottom left, top right, and top left sides of the current block. Non-angular modes can be included in the MPM list at any location. For example, non-angular modes can be added near the intra-prediction modes of blocks adjacent to the left and top sides.
[0127] As another embodiment, the intra-prediction mode of the current block can be derived using the intra-prediction mode derived from the MPM list and the intra-prediction modes of neighboring blocks. For example, when the intra-prediction mode derived from the MPM list is Pred_mpm, Pred_mpm can be changed by using the intra-prediction modes of neighboring blocks. For example, when Pred_mpm is greater than the intra-prediction modes of neighboring blocks (or greater than the statistical values of at least two intra-prediction modes), Pred_mpm can be increased by n; otherwise, Pred_mpm can be decreased by n. Here, n can be a predetermined integer such as +1, +2, +3, 0, -1, -2, -3, etc. The intra-prediction mode of the current block can be derived as the changed Pred_mpm. Optionally, when at least one of Pred_mpm and the intra-prediction modes of neighboring blocks is a non-angular mode, the intra-prediction mode of the current block can be derived as a non-angular mode. Optionally, the intra-prediction mode of the current block can be derived as an angular mode.
[0128] When the MPM flag is 0, a second MPM list including at least one intra-prediction mode can be configured, and the intra-prediction mode of the current block can be inferred using the second MPM index (2nd_mpm_idx). Here, a second indicator (e.g., the second MPM flag) indicating whether the intra-prediction mode of the current block is included in the second MPM list can be encoded / decoded. Similar to the first MPM list, the second MPM list can be configured using the intra-prediction modes of neighboring blocks. Here, intra-prediction modes included in the first MPM list may not be included in the second MPM list. The number of MPM lists is not limited to 1 or 2; N MPM lists can be used.
[0129] When the intra-prediction mode of the current block is not included in one of the multiple MPM lists, the luma component intra-prediction mode of the current block can be encoded / decoded. Furthermore, the chroma component intra-prediction mode can be derived based on the associated luma component intra-prediction mode and encoded / decoded accordingly.
[0130] When the current block is partitioned into multiple sub-blocks, at least one of the described methods can be applied to derive the intra-prediction mode for each sub-block.
[0131] The size or shape of a sub-block, or both, can be a predetermined size or block size (e.g., 4×4), or it can be determined based on the size or shape of the current block, or both. Optionally, the size of the sub-block can be determined based on whether neighboring blocks of the current block are partitioned, or it can be determined based on the intra-prediction modes of neighboring blocks of the current block. For example, the current block can be partitioned based on the boundaries where the intra-prediction modes of neighboring blocks differ. Optionally, the current block can be partitioned based on whether neighboring blocks are intra-coded blocks or inter-coded blocks.
[0132] Indicators (e.g., NDIP_flag) that represent the inference of the intra prediction mode of the current block using the intra prediction modes of neighboring blocks can be encoded / decoded. These indicators can be encoded / decoded at least one unit from the current block and sub-blocks. Here, the indicators can be encoded / decoded when the size of the current block or sub-block corresponds to a predetermined size or a predetermined size range.
[0133] The operation of determining whether the size of the current block corresponds to a predetermined size can be performed based on the horizontal or vertical length of the current block. For example, when the horizontal or vertical length is a length that can be partitioned, the size of the current block is determined to correspond to a predetermined size.
[0134] When the current block is partitioned into multiple sub-blocks, the intra-prediction modes of the multiple sub-blocks can be derived in a zigzag order or in parallel. The intra-prediction modes of the sub-blocks can be derived using at least one of the methods for deriving the intra-prediction mode of the current block. Here, neighboring blocks of the current block can be used as neighboring blocks of each sub-block. Optionally, sub-blocks within the current block can be used as neighboring blocks of each sub-block.
[0135] The intra-prediction mode of the sub-blocks included in the current block can be derived by using the intra-prediction mode of the current block and the average of the intra-prediction modes of the blocks to the left and above the sample point located at (0,0) in each sub-block. For example, if the intra-prediction mode of the current block is greater than the average value mentioned above, half of the average value can be subtracted from the derived intra-prediction mode. If the intra-prediction mode of the current block is equal to or less than the average value mentioned above, half of the average value can be added to the derived intra-prediction mode.
[0136] Intra-frame prediction information can be transmitted via at least one of the following signals: Video Parameter Set (VPS), Sequence Parameter Set (SPS), Picture Parameter Set (PPS), Adaptive Parameter Set (APS), Slice Header, and Parallel Block Header. In the case of a predetermined block size or smaller, at least one piece of intra-frame prediction information may be transmitted without a signal. Here, intra-frame prediction information from previously encoded / decoded blocks (e.g., parent blocks) can be used.
[0137] Reference samples for intra-frame prediction can be configured based on the derived intra-frame prediction mode. In the following description, the current block can mean a prediction block or a sub-block smaller in size / shape than the prediction block. Reference samples can be configured by using at least one sample reconstructed adjacent to the current block or by using a combination of samples. Furthermore, filtering can be applied to the configured reference samples.
[0138] The number or position of the reconstructed sample lines used to configure reference samples, or both, can vary depending on the current block's position within the coding tree block. Each reconstructed sample on multiple reconstructed sample lines can be used as a reference sample. Optionally, predetermined filters can be applied to the reconstructed samples, and reference samples can be generated using filtered reconstructed samples. Filtered reconstructed samples can be included in the same reconstructed sample line or in different reconstructed sample lines.
[0139] The configured reference sample can be represented as ref[m, n], and the sample obtained by applying a filter to the configured reference sample can be represented as rec[m, n]. Here, m or n can be a predetermined integer value representing the sample position. When the position of the top-left sample in the current block is (0, 0), the position of the top-left reference sample in the current block can be set to (-1, -1).
[0140] Figure 6 This is a diagram illustrating an example of configuring reference sample lines when the current block is not adjacent to the CTU boundary.
[0141] Figure 7 This is a diagram illustrating an example of configuring reference sample lines when the current block is adjacent to the CTU boundary.
[0142] By using, for example Figure 6 and 7 At least one reference sample line is configured from at least one of the multiple reconstructed sample lines shown. Here, the position or length, or both, of the at least one reconstructed sample line to be used can be determined based on the position of the current block within a predetermined image region. The predetermined image region can mean at least one of a frame, strip, strip segment, parallel block, and coded block (e.g., a coded block partitioned based on at least one of a coded tree block and a quadtree / binary tree). For example, the reconstructed sample line to be used can be selected by considering whether at least one block boundary of the current block is adjacent to the boundary of the predetermined image region.
[0143] like Figure 6 As shown, all available reconstructed sample lines (reconstructed sample line 1 to reconstructed sample line 4) can be located within the same CTU as the current block. Optionally, as Figure 7 As shown, all or some of the available reconstructed sample lines can be located within a CTU different from the current block.
[0144] According to an embodiment of the present invention, a single reference sample line can be configured by using a single reconstructed sample line adjacent to the current block.
[0145] exist Figure 6 In the example shown, the same reconstructed sample line can be used for both the top and left sides of the current block. For example, the reference sample line for the current block can be configured by using reconstructed sample line 2 for both the top and left sides.
[0146] exist Figure 7 In the example shown, different reconstructed sample lines can be used for the top and left sides of the current block. For example, as in Formula 1 below, reference sample lines can be configured by using reconstructed sample line 1 for the top side of the current block and reconstructed sample line 2 for the left side of the current block.
[0147] [Formula 1]
[0148] ref[x,-1]=rec[x,-1],(x=-1~2*W-1)
[0149] ref[-1,y]=rec[-2,y],(y=0~2*H-1)
[0150] According to another embodiment of the invention, a single reference sample line can be configured by using at least two reconstructed sample lines adjacent to the current block.
[0151] Here, a weighted sum of reconstructed samples from at least two reconstructed sample lines can be used based on the distance to the current block, the intra-prediction mode angle, or both. Weights can be determined based on at least one of the current block's intra-prediction mode (e.g., prediction mode value, whether it is an angular mode, the angle of the angular mode, etc.), block size / shape, partitioning information, proximity coding information (nearby intra-prediction modes, block size / shape, partitioning information, etc.), or any filter (e.g., at least one of a 3-tap filter, a 5-tap filter, and a 7-tap filter). Larger weights can be assigned as the distance to the current block increases.
[0152] exist Figure 6 In the example shown, the same reconstructed sample line can be used for both the upper and left sides. For example, as in Formula 2 below, reference samples can be configured by using a weighted sum of reconstructed sample line 1 and reconstructed sample line 2.
[0153] [Formula 2]
[0154] ref[-1,-1]=(rec[-2,-1]+2*rec[-1,-1]+rec[-1,-2]+2)>>2
[0155] ref[x,-1]=(rec[x,-2]+3*rec[x,-1]+2)>>2,(x=0~2*W-1)
[0156] ref[-1,y]=(rec[-2,y]+3*rec[-1,y]+2)>>2,(y=0~2*H-1)
[0157] exist Figure 7 In the example shown, different reconstructed sample lines can be used for the upper and left sides. For example, as in Formula 3 below, reference samples can be configured by using reconstructed sample line 1 and reconstructed sample line 2 for the left side of the current block and reconstructed sample line 1 for the upper side of the current block.
[0158] [Formula 3]
[0159] ref[-1,-1]=(rec[-2,-1]+3*rec[-1,-1]+2)>>2
[0160] ref[x,-1]=rec[x,-1],(x=0~2*W-1)
[0161] ref[-1,y]=(rec[-2,y]+3*rec[-1,y]+2)>>2,(y=0~2*H-1)
[0162] In the above embodiments where a single reference sample line is configured using at least two reconstructed sample lines, the weighted sum can be replaced by at least one of the average, maximum, minimum, and median values. The reconstructed samples used in the reconstructed sample line can be variably determined based on the current sample's position, or can be determined as samples at fixed positions. The samples at fixed positions can vary according to the direction or angle of the intra-frame prediction mode.
[0163] For example, in Figure 6 In the example shown, as in Formula 4 below, reference samples can be configured by using the maximum values of reconstructed sample lines 1 to 3 for both the top and left sides of the current block. max(a, b, c) is a function that outputs the maximum value among a, b, and c.
[0164] [Formula 4]
[0165] ref[-1,-1]=max(max(rec[-3,-3],rec[-2,-3],rec[-1,-3]),max(rec[-3,-2],rec[-2,-2],rec[-1,-2]),max(rec[-3,-1],rec[-2,-1],rec[-1,-1]))
[0166] ref[x,-1]=max(rec[x,-1],rec[x,-2],rec[x,-3]),(x=0~2*W-1)
[0167] ref[-1,y]=max(rec[-1,y],rec[-2,y],rec[-3,y]),(y=0~2*H-1)
[0168] For example, in Figure 7 In the example shown, as in Formula 5 below, reference samples can be configured by using the maximum value of reconstruction sample lines 1 to 3 for the left side of the current block and the maximum value of reconstruction sample lines 1 and 2 for the top side of the current block.
[0169] [Formula 5]
[0170] ref[-1,-1]=max(0,max(rec[-3,-2],rec[-2,-2],rec[-1,-2]),max(rec[-3,-1],rec[-2,-1],rec[-1,-1]))
[0171] ref[x,-1]=max(rec[x,-1],rec[x,-2],0),(x=0~2*W-1)
[0172] ref[-1,y]=max(rec[-1,y],rec[-2,y],rec[-3,y]),(y=0~2*H-1)
[0173] According to another embodiment of the invention, at least two reference sample lines can be configured by using at least two reconstructed sample lines adjacent to the current block.
[0174] exist Figure 6 In the example shown, at least two reference sample lines can be configured by using at least two reconstructed sample lines for both the top and left sides of the current block. For example, reconstructed sample lines 1 and 2 can be selected for reference sample lines 1 and 2 of the current block, respectively.
[0175] exist Figure 7 In the example shown, at least two reference sample lines can be configured by using different reconstructed sample lines for the top and left sides of the current block. For example, as in Formula 6 below, reference sample lines 1 and 2 can be configured by using reconstructed sample line 1 and reconstructed sample line 2 for the left side of the current block and reconstructed sample line 1 for the top side of the current block.
[0176] [Formula 6]
[0177] ref[x,-1]=rec[x,-1],(x=-1~2*W-1)
[0178] ref[-1,y]=rec[-1,y],(y=0~2*H-1)
[0179] ref[-2,-2]=ref[-2,-1]=rec[-1,-1]
[0180] ref[x,-2]=rec[x,-1],(x=-1~2*W-1)
[0181] ref[2*W,-2]=rec[2*W-1,-1]
[0182] ref[-2,y]=rec[-2,y],(y=0~2*H)
[0183] As another example of configuring at least two reference sample lines by using at least two reconstructed sample lines adjacent to the current block, multiple reference sample lines can be configured based on the distance from the current block or the angle of the intra-prediction mode, or both, by using at least one of the weighted sum, average, maximum, minimum, and median values of at least one reconstructed sample. The reconstructed samples used in the reconstructed sample lines can be variably determined according to the position of the current sample, or can be determined as samples at fixed positions. The samples at fixed positions can vary according to the direction or angle of the intra-prediction mode.
[0184] In one example, each reference sample line can be configured based on a weighted sum with different weights assigned differently according to the distance from the current block, and the maximum value of the reconstructed sample points. The reconstructed sample line used for the weighted sum and the reconstructed sample line used for the maximum value can be different.
[0185] exist Figure 6 In the example shown, reference samples can be configured by using the same number of reconstructed sample lines for both the top and left sides of the current block. For example, as in Formula 7 below, reference sample line 1 can be configured by a weighted sum of reconstructed sample line 1 and reconstructed sample line 2, and reference sample line 2 can be configured by the maximum value of reconstructed sample line 2 through reconstructed sample line 4.
[0186] [Formula 7]
[0187] ref[-1,-1]=(rec[-2,-1]+2*rec[-1,-1]+rec[-1,-2]+2)>>2
[0188] ref[x,-1]=(rec[x,-2]+3*rec[x,-1]+2)>>2,(x=0~2*W-1)
[0189] ref[-1,y]=(rec[-2,y]+3*rec[-1,y]+2)>>2,(y=0~2*H-1)
[0190] ref[-2,-2]=max(max(rec[-4,-4],rec[-3,-4],rec[-2,-4]),max(rec[-4,-3],rec[-3,-3],rec[-2,-3]),max(rec[-4,-2],rec[-3,-2],rec[-2,-2]))
[0191] ref[x,-2]=max(rec[x,-2],rec[x,-3],rec[x,-4]),(x=0~2*W)
[0192] ref[-2,y]=max(rec[-2,y],rec[-3,y],rec[-4,y]),(y=0~2*H)
[0193] exist Figure 7 In the example shown, reference samples can be configured by using different reconstructed sample lines for the top and left sides of the current block. For example, as in Equation 8 below, reference sample line 1 can be configured by using a weighted sum of reconstructed sample line 1 and reconstructed sample line 2 for the left side of the current block, and reference sample line 2 can be configured by using the maximum value of reconstructed sample line 2 to reconstructed sample line 4. Furthermore, reference samples 1 and 2 can be configured by using reconstructed sample line 1 for the top side of the current block.
[0194] [Formula 8]
[0195] ref[x,-1]=rec[x,-1],(x=-1~2*W-1)
[0196] ref[-1,y]=(rec[-2,y]+3*rec[-1,y]+2)>>2,(y=0~2*H-1)
[0197] ref[-2,-2]=ref[-2,-1]=rec[-1,-1]
[0198] ref[x,-2]=rec[x,-1],(x=-1~2*W-1)
[0199] ref[2*W,-2]=rec[2*W-1,-1]
[0200] ref[-2,y]=max(rec[-2,y],rec[-3,y],rec[-4,y]),(y=0~2*H)
[0201] This indicates that the information configured by using at least one of the methods described above can be encoded / decoded, or can be implicitly derived in the decoder. Optionally, when encoding / decoding the information of the reference sample shift, at least one of the following entropy encoding methods can be used, and the information is finally encoded / decoded using CABAC(ae(v)) after being binarized.
[0202] - Truncated Ricean binarization method
[0203] -K-order exponential Columbus binarization method
[0204] - Finite K-order Exponential Columbus Binarization Method
[0205] - Fixed-length binarization method
[0206] - Univariate binarization method
[0207] - Truncating Univariate Binarization Method
[0208] Referenced Figure 7 An embodiment is described where the upper boundary of the current block is the boundary of the CTU. However, embodiments of the invention are not limited thereto; embodiments of the invention can also be applied when the left boundary of the current block is the boundary of the CTU. Here, in the above embodiment, the left and upper sides can be switched and applied.
[0209] When both the top and left boundaries of the current block are boundaries of the CTU, the same reconstructed sample lines can be used for the top and left sides of the current block. Optionally, a greater number of reconstructed sample lines can be used for the left side of the current block than the number of reconstructed sample lines that can be used for the top side. This is because the resources required to store the reconstructed sample lines included in the CTU that are adjacent to the top side of the current block are relatively greater than the resources required to store the reconstructed sample lines included in the CTU that are adjacent to the left side of the current block.
[0210] Optionally, when the upper boundary of the current block is the boundary of the CTU, all upper reference samples can be determined to be unavailable. Here, upper reference samples can be configured using left reference samples. Optionally, when the left boundary is the boundary of the CTU, left reference samples can be configured using upper reference samples.
[0211] In the above embodiments, the boundary of the CTU can be replaced by the boundary of a predetermined image region. As mentioned above, the predetermined image region includes frames, stripes, strip segments, parallel blocks, etc.
[0212] Intra-frame prediction can be performed by retrieving the block most similar to the current block (hereinafter referred to as the "similar block") from the neighboring reconstructed samples rec[m, n]. Here, at least one of the location information m and n of the similar block can be entropy encoded / decoded. Optionally, the decoder can deduce the location information of the similar block by performing the same processing as the encoder.
[0213] The derived similar blocks can be used as predicted blocks for the current block. Optionally, at least one reference sample line from the derived similar blocks can be used as a reference sample for the current block. Optionally, the reference sample for the current block can be derived using at least one of the following: at least one reference sample line from the current block and at least one reference sample line from the similar blocks. Here, for example, a weighted sum can be used. Optionally, the upper reference sample and the left reference sample for the current block can be configured from different reference sample lines.
[0214] Optionally, a first residual signal is obtained by performing intra-frame prediction on the current block. Here, the intra-frame prediction mode used is applied to similar blocks to obtain a second residual signal, and the residual signal of the current block can be generated by using the residual values of the first and second residual signals.
[0215] When selecting reference samples for the current block for inter-frame prediction, the optimized reference samples for the current block can be configured by retrieving all available reconstructed samples present in the reconstructed left and upper samples. Here, the reference samples can be configured by shifting the retrieved reconstructed samples to positions where the shifted samples can be used during intra-frame prediction. The information for shifting the reference samples can be entropy encoded / decoded, or implicitly derived in the encoder / decoder.
[0216] After configuring the reference samples of the current block, the reference samples of the current block can be reconfigured by exchanging and replacing them with at least one reference sample unit. For example, samples existing on the upper reconstructed sample line or the upper reference sample line, samples on the left reference sample line using a sample group, or sample groups can be exchanged, replaced, or both.
[0217] The current block can be partitioned into at least one prediction block based on its size, shape, or both. The same reference samples can be used for the partitioned prediction blocks. Here, parallel processing is possible for at least one prediction block included in the current block.
[0218] Optionally, different reference samples can be used for the partitioned prediction blocks. For example, when the current block is partitioned into an upper prediction block and a lower prediction block, the correlation between the upper reference sample and the lower prediction block may be low. Here, the upper reference sample can be compensated to be used as a reference sample for the prediction block. For compensation, reference samples from the left reference sample line can be used. For example, the residual values of the sample at position (-1, -1) and the sample at position (-1, H / 2-1) can be used. Here, H is the height of the current block. The residual value or the value obtained by scanning the residual value can be applied to the upper reference sample. A similar method of configuring reference samples can be applied when the current block is partitioned into a left prediction block and a right prediction block, or partitioned into at least two prediction blocks.
[0219] To configure reference samples, it can be determined whether neighboring reconstructed samples are available. A neighboring reconstructed sample can be determined to be unavailable when it is located outside at least one region of a frame, strip, parallel block, and CTU. Optionally, when performing constrained intra-frame prediction on the current block, a neighboring reconstructed sample can be determined to be unavailable when it is located at a block that is inter-coded / decoded.
[0220] When a neighboring reconstructed sample is determined to be unavailable, it can be replaced by a neighboring available reconstructed sample. For example, the unavailable sample can be replaced by a neighboring available sample starting from the lower left sample location. Alternatively, the unavailable sample can be replaced by sorting through available samples. For example, the unavailable sample can be replaced by the average of available samples located at both ends of the unavailable sample.
[0221] Optionally, unavailable samples can be replaced using information from available reference samples. Here, unavailable samples can be replaced with any value of a non-neighboring available sample value. The arbitrary value can be the average of the available sample values or a value that considers the gradient of the available sample values. Optionally, both the average and the gradient can be used. The gradient can be determined based on the residual values of neighboring available samples. Optionally, the gradient can be determined based on the average and residual values of the available sample values. In addition to the average, the maximum, minimum, median, or a weighted sum with arbitrary weights can be used. The arbitrary weights can be determined based on the distance between available and unavailable samples.
[0222] The above method can be applied to all upper and left reference points, or to any angle. Furthermore, the above method can be applied when configuring the reference point lines of the current block using multiple reconstructed point lines.
[0223] Whether to apply filtering to at least one reference sample configured as above can be determined based on at least one of the intra-prediction mode and block size / shape of the current block. When applying a filter, the filter type can vary according to at least one of the intra-prediction mode, size, and shape of the current block.
[0224] Intra-prediction of the current block can be performed based on the derived intra-prediction mode and reference samples.
[0225] In DC mode, the average value of at least one of the configured reference samples can be used. Here, filtering can be applied to at least one predicted sample located at the boundary of the current block.
[0226] In the case of planar mode, a weighted sum can be used, wherein the weighted sum takes into account the distance from the location of the sample point of the target of the intra-prediction as the current block to at least one configured reference sample point.
[0227] In the angle mode, at least one reference sample point located at a predetermined angle and adjacent to the position of the intra-frame predicted target sample point can be used.
[0228] In the case of location-based intra-prediction mode, a reconstructed sample block generated based on encoded / decoded or derived location information can be used as the intra-prediction block for the current block. Optionally, the decoder can derive this by retrieving the reconstructed sample block that will be used as the intra-prediction block for the current block.
[0229] Intra-frame prediction of chrominance signals can be performed using the reconstructed luma signal of the current block. Furthermore, intra-frame prediction of other chrominance signals Cr can be performed using a single reconstructed chrominance signal Cb from the current block.
[0230] Inter-frame prediction can be performed by combining at least one of the methods described above. For example, the intra-frame prediction block of the current block can be configured using a weighted sum of prediction blocks utilizing a predetermined non-angular intra-frame prediction mode and prediction blocks utilizing a predetermined angular intra-frame prediction mode. Here, the weights can be applied differently based on at least one of the intra-frame prediction mode, block size, and sample location.
[0231] When using at least one reference sample line, intra-prediction blocks can be generated by assigning different weights to each other based on the distance to the current block or the angle, or both. The weighted sum can be of arbitrary filter precision based on at least one of the intra-prediction mode of the current block, block size / shape, partition information, and proximity coding information (nearby intra-prediction mode, block size / shape, partition information, etc.).
[0232] In the case of angle prediction mode, the configured reference samples can be reconfigured based on the angle prediction mode. For example, when the angle prediction mode uses all left and top reference samples, a one-dimensional array can be configured for either the left or top reference samples. Alternatively, the top reference samples can be configured by shifting the left reference samples, or by using a weighted sum of at least one left reference sample.
[0233] Inter-frame prediction with different angles can be performed on predetermined sample point groups of the current block. The predetermined sample point groups can be blocks, sub-blocks, lines, or individual samples.
[0234] In planar mode, a weighted sum of the upper reference sample T, left reference sample L, upper right reference sample TR, and lower left reference sample BL, based on the position of the predicted target sample, can be used. Here, the lower right sample K can be derived by using the weighted sum of TR and BL. Samples in the lower row within the current block can be replaced with BL, and samples in the right column can be replaced with TR.
[0235] A sample point at any position (x, y) within the current block can be predicted by considering a weighted sum of distances based on the position of each sample point. For example, the samples in the lower row within the current block can be derived as a weighted sum of distances based on BL and K, and the samples in the right column can be derived as a weighted sum of distances based on TR and K.
[0236] The above embodiments can be performed in the same way in both the encoder and decoder.
[0237] The order in which the above embodiments are applied between the encoder and decoder can be different, or the order in which the above embodiments are applied between the encoder and decoder can be the same.
[0238] The above embodiments can be performed on each luminance signal and chrominance signal, or the above embodiments can be performed on both luminance and chrominance signals in the same way.
[0239] The block shape applied in the above embodiments of the present invention can be square or non-square.
[0240] The above embodiments of the present invention can be applied based on the size of at least one of the following: coding block, prediction block, transform block, block, current block, coding unit, prediction unit, transform unit, unit, and current unit. Here, the size can be defined as a minimum size, a maximum size, or both, to apply the above embodiments, or it can be defined as a fixed size for applying the above embodiments. Furthermore, in the above embodiments, the first embodiment can be applied to a first size, and the second embodiment can be applied to a second size. In other words, the above embodiments can be applied in combination based on the size. Additionally, the above embodiments can 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 can be applied when the block size is included within a specific range.
[0241] For example, the above embodiments can be applied when the current block size is 8×8 or larger. For example, the above embodiments can be applied when the current block size is 4×4 or larger. For example, the above embodiments can be applied when the current block size is 16×16 or larger. For example, the above embodiments can be applied when the current block size is equal to or greater than 16×16 and equal to or less than 64×64.
[0242] The above embodiments of the present invention can be applied based on time layers. To identify the time layer to which the above embodiments can be applied, the time layer can be transmitted using signals, and the above embodiments can be applied to a specified time layer identified by a corresponding identifier. Here, the identifier can be defined as the lowest or highest layer, or both, to which the above embodiments can be applied, or it can be defined as indicating a specific layer to which an embodiment is applied. Furthermore, a fixed time layer for applying the embodiment can be defined.
[0243] For example, the above embodiments can be applied when the time layer of the current image is the lowest layer. For example, the above embodiments can be applied when the time layer identifier of the current image is 1. For example, the above embodiments can be applied when the time layer of the current image is the highest layer.
[0244] The strip type for which the above embodiments of the present invention are applied can be defined, and the above embodiments can be applied according to the corresponding strip type.
[0245] In the above embodiments, the method is described based on a flowchart having a series of steps or units. However, the present invention is not limited to the order of the steps; rather, some steps may be performed simultaneously with other steps, or may be performed with other steps in a different order. Furthermore, those skilled in the art should understand that the steps in the flowchart are not mutually exclusive, and other steps may be added to the flowchart, or some steps may be deleted from the flowchart, without affecting the scope of the present invention.
[0246] The embodiments include various aspects of the examples. All possible combinations of these aspects may not be described, but those skilled in the art will recognize the different combinations. Therefore, the invention may include all substitutions, modifications, and alterations within the scope of the claims.
[0247] Embodiments of the present invention can be implemented in the form of program instructions, which can be executed by various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include individual program instructions, data files, data structures, etc., or combinations thereof. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention, or may be known to those skilled in the art of computer software. 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 memory (ROM), random access memory (RAM), flash memory, etc.) specially constructed for storing and implementing program instructions. Examples of program instructions include not only machine language code generated by a compiler, but also high-level language code that can be implemented by a computer using an interpreter. The hardware device may be configured to operate by one or more software modules to perform the processing according to the present invention, or vice versa.
[0248] Although the invention has been described with reference to specific terminology (such as detailed elements) and limited embodiments and drawings, these are provided only to aid in a more general understanding of the invention, and the invention is not limited to the embodiments described above. Those skilled in the art will understand that various modifications and changes can be made from the above description.
[0249] Therefore, the spirit of the present invention should not be limited to the above embodiments, and the full scope of the appended claims and their equivalents shall fall within the scope and spirit of the present invention.
[0250] Industrial applicability
[0251] This invention can be used to encode / decode images.
Claims
1. An image decoding method, comprising: Derive the intra-frame prediction mode for the current block's brightness; The reference samples used for intra-frame prediction of the current block are derived from multiple reference sample lines; A prediction block is generated by performing intra-frame prediction on the current block based on the brightness intra-frame prediction mode and the reference sample points; and The reconstructed block of the current block is derived based on the predicted block of the current block. The steps for deriving the reference samples used for intra-frame prediction of the current block include: Determine whether the upper boundary of the current block is the upper boundary of the current coding tree block; and Based on the determination, a reference sample line for deriving the reference sample is selected from the plurality of reference sample line lines. The plurality of reference sample lines include a first reference sample line adjacent to the upper boundary of the current block, a second reference sample line adjacent to the first reference sample line, and a third reference sample line adjacent to the second reference sample line. Wherein, in response to the upper boundary of the current block being the upper boundary of the current coding tree block, the reference sample is derived using only the first reference sample line among the plurality of reference sample lines. Wherein, in response to the fact that the upper boundary of the current block is not the upper boundary of the current coding tree block, the reference sample is derived using one of the plurality of reference sample lines including the third reference sample line.
2. The method as described in claim 1, wherein, The intra-prediction mode of the current block is derived based on the intra-prediction modes of the left neighboring block and the upper neighboring block, wherein the left neighboring block is the block adjacent to the lower left side of the current block and the upper neighboring block is the block adjacent to the upper right side of the current block.
3. The method as described in claim 2, wherein, The intra-prediction mode of the current block is derived based on the statistical values of the intra-prediction modes of the left neighboring block and the upper neighboring block.
4. The method of claim 3, wherein, Both the maximum and minimum values are used as the statistical values.
5. The method of claim 1, wherein, The steps for deriving the intra-prediction mode of the current block include: Decode the first flag indicating whether the intra-frame prediction mode is the same as a mode included in a first MPM list containing at least one mode; and When the first flag is a first value, the mode included in the first MPM list is determined as the intra-frame prediction mode.
6. The method of claim 5, wherein, The steps for deriving the intra-prediction mode of the current block include: When the first flag is the second value, the configuration contains a second MPM list with at least one pattern; Decode the index information indicating the same intra-prediction mode as the current block; and The intra-prediction mode of the current block is derived using the second MPM list and the index information.
7. An image encoding method, comprising: Determine the intra-frame prediction mode for the current block's luminance; The reference samples used for intra-frame prediction of the current block are derived from multiple reference sample lines; A prediction block is generated by performing intra-frame prediction on the current block based on the brightness intra-frame prediction mode and the reference sample points; and The reconstructed block of the current block is derived based on the predicted block of the current block. The steps for deriving the reference samples used for intra-frame prediction of the current block include: Determine whether the upper boundary of the current block is the upper boundary of the current coding tree block; and Based on the determination, a reference sample line for deriving the reference sample is selected from the plurality of reference sample line lines. The plurality of reference sample lines include a first reference sample line adjacent to the upper boundary of the current block, a second reference sample line adjacent to the first reference sample line, and a third reference sample line adjacent to the second reference sample line. Wherein, in response to the upper boundary of the current block being the upper boundary of the current coding tree block, the reference sample is derived using only the first reference sample line among the plurality of reference sample lines. Wherein, in response to the fact that the upper boundary of the current block is not the upper boundary of the current coding tree block, the reference sample is derived using one of the plurality of reference sample lines including the third reference sample line.
8. The method of claim 7, wherein, The intra-prediction mode of the current block is encoded based on the intra-prediction mode of the left neighbor block and the intra-prediction mode of the upper neighbor block, wherein the left neighbor block is the block adjacent to the lower left side of the current block and the upper neighbor block is the block adjacent to the upper right side of the current block.
9. The method of claim 8, wherein, The intra-prediction mode of the current block is encoded based on the maximum and minimum values of the intra-prediction modes of the left neighboring block and the upper neighboring block.
10. The method of claim 7, further comprising: The intra-prediction mode of the current block is encoded. The step of encoding the intra-frame prediction mode includes: Determine whether the intra-frame prediction mode is the same as a mode included in a first MPM list containing at least one mode; and If the intra-frame prediction mode is the same as the mode included in the first MPM list, the first flag with the first value is encoded.
11. The method of claim 10, wherein, The steps for encoding the intra-frame prediction mode include: If the intra-frame prediction mode is different from the modes included in the first MPM list, a second MPM list containing at least one mode is configured. Determine the index of the mode in the second MPM list that is the same as the intra-prediction mode of the current block; and The first flag and the index, which have a second value, are encoded.
12. A method for transmitting a bit stream, wherein, The method includes: Perform an image encoding method to generate the bitstream; and Send the bit stream, The image encoding method includes: Determine the intra-frame prediction mode for the current block's luminance; The reference samples used for intra-frame prediction of the current block are derived from multiple reference sample lines; A prediction block is generated by performing intra-frame prediction on the current block based on the said intra-frame prediction mode and the said reference sample; and The reconstructed block of the current block is derived based on the predicted block of the current block. The steps for deriving the reference samples used for intra-frame prediction of the current block include: Determine whether the upper boundary of the current block is the upper boundary of the current coding tree block; and Based on the determination, a reference sample line for deriving the reference sample is selected from the plurality of reference sample line lines. The plurality of reference sample lines include a first reference sample line adjacent to the upper boundary of the current block, a second reference sample line adjacent to the first reference sample line, and a third reference sample line adjacent to the second reference sample line. Wherein, in response to the upper boundary of the current block being the upper boundary of the current coding tree block, the reference sample is derived using only the first reference sample line among the plurality of reference sample lines. Wherein, in response to the fact that the upper boundary of the current block is not the upper boundary of the current coding tree block, the reference sample is derived using one of the plurality of reference sample lines including the third reference sample line.