Image encoding / decoding method and device, and recording medium for storing bitstream
The proposed image encoding/decoding method addresses the inefficiencies of high-resolution video by enhancing compression through inter-frame prediction and secondary prediction, reducing data volume and costs.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HYUNDAI MOTOR CO LTD
- Filing Date
- 2025-09-15
- Publication Date
- 2026-05-15
AI Technical Summary
The increasing demand for high-resolution, high-quality video has led to a surge in video data volume, resulting in higher transmission and storage costs due to the inefficiencies of existing video encoding and decoding technologies.
An image encoding/decoding method that enhances compression efficiency through inter-frame prediction by utilizing techniques such as template-based inter-screen prediction, neural network-based modes, and secondary prediction on residual blocks.
Improves encoding/decoding efficiency and prediction accuracy, reducing residual signal magnitude and overall data size, thereby lowering transmission and storage costs.
Smart Images

Figure KR2025014340_15052026_PF_FP_ABST
Abstract
Description
Video encoding / decoding method, device, and recording medium storing a bitstream
[0001] The present disclosure relates to an image encoding / decoding method, an apparatus, and a recording medium storing a bitstream. Specifically, the present disclosure relates to an image encoding / decoding method, an apparatus, and a recording medium storing a bitstream using an inter-frame prediction block.
[0002] Recently, the demand for high-resolution, high-quality video, such as UHD (Ultra High Definition) video, has been increasing across various application fields. As video data becomes higher in resolution and quality, the relative volume of data increases compared to conventional video data; consequently, transmission and storage costs increase when video data is transmitted using existing wired or wireless broadband lines or stored using existing storage media. To address these issues arising from the increase in video data resolution and quality, high-efficiency video encoding and decoding technologies for video with higher resolution and quality are required.
[0003] Inter-picture prediction is a key technology that enhances compression efficiency by utilizing the temporal correlation of consecutive frames. The encoder estimates motion between the current block and one or more reference frames and transmits the resulting motion information and prediction mode. The accuracy of inter-picture prediction can be improved by applying techniques such as single / bidirectional prediction, merge / skip, high-precision fractional pixel interpolation, reference picture list generation, and affine-based models. When the accuracy of inter-picture prediction is improved, the magnitude of residual signals is reduced, thereby enhancing the overall compression efficiency of the image.
[0004] The present disclosure aims to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.
[0005] In addition, the present disclosure aims to provide a recording medium storing a bitstream generated by an image decoding method or device according to the present disclosure.
[0006] An image decoding method according to one embodiment of the present disclosure may be characterized by comprising the steps of: performing inter-frame prediction for a current block to derive a prediction sample of the current block from a reference block of the current block; deriving a residual prediction sample of the current block; obtaining a residual sample of the current block by performing an inverse transformation on the transformation coefficients of the current block; and generating a reconstructed sample of the current block based on the prediction sample, the residual sample, and the residual prediction sample.
[0007] According to one embodiment, the residual prediction sample can be derived based on the surrounding area of the current block and the surrounding area of the reference block.
[0008] According to one embodiment, when the prediction mode of the current block is a template-based inter-screen prediction mode, the surrounding area of the current block may be set as all or part of the template area of the current block, and the surrounding area of the reference block may be set as all or part of the template area of the reference block.
[0009] According to one embodiment, when the current block refers to a reference block, the surrounding area of the current block may be configured to include one or more samples adjacent to the current block, and the surrounding area of the reference block may be configured to include one or more samples adjacent to the reference block.
[0010] According to one embodiment, when the current block refers to a first reference block and a second reference block, the surrounding area of the current block may be configured to include one or more samples adjacent to the current block, and the surrounding area of the reference block may be configured to include one or more samples adjacent to the first reference block and one or more samples adjacent to the second reference block.
[0011] According to one embodiment, the residual prediction sample of the current block is determined from the reference residual sample of the surrounding area of the current block, and the reference residual sample can be determined from the surrounding area of the current block and the surrounding area of the reference block.
[0012] According to one embodiment, the reference residual sample can be derived based on the difference in sample values between the reference block surrounding sample in the surrounding area of the reference block and the current block surrounding sample in the surrounding area of the current block when the current block refers to one reference block.
[0013] According to one embodiment, when the current block refers to the first reference block and the second reference block, the reference residual sample may be derived based on the difference in sample values between the weighted sum of the first reference block surrounding sample in the surrounding area of the first reference block and the second reference block surrounding sample in the surrounding area of the second reference block and the current block surrounding sample in the surrounding area of the current block.
[0014] According to one embodiment, the residual prediction sample of the current block can be determined by referring to reference residual samples of the surrounding area of the current block according to the in-screen prediction mode for residual prediction used to determine the residual prediction sample.
[0015] According to one embodiment, the residual prediction sample of the current block may be one of the following: the in-frame prediction mode for residual prediction, the directional in-frame prediction mode, the DC mode, and the planner mode.
[0016] According to one embodiment, the residual prediction sample of the current block is such that the in-frame prediction mode for residual prediction is a matrix-based in-frame prediction mode, and the weight matrix used in the matrix-based in-frame prediction mode can be determined based on the size and quantization coefficient of the current block.
[0017] According to one embodiment, the residual prediction sample of the current block is such that the in-frame prediction mode for residual prediction is a neural network-based in-frame prediction mode, and the neural network model used in the neural network-based in-frame prediction mode can be determined based on the size and quantization coefficient of the current block.
[0018] According to one embodiment, the inverse transformation of the transformation coefficients of the current block is performed based on a transformation kernel, and the transformation kernel can be determined based on a prediction mode within a virtual screen.
[0019] According to one embodiment, the gradient with the largest amplitude is selected from the Histogram of Gradient (HoG) derived from adjacent samples of the current block, and the virtual in-frame prediction mode can be determined based on the in-frame prediction mode corresponding to the selected gradient.
[0020] According to one embodiment, a plurality of gradient candidates are selected based on the amplitude of a gradient histogram derived from adjacent samples of the current block, and a virtual screen prediction mode can be determined based on a screen prediction mode corresponding to a selected gradient among the selected plurality of gradient candidates.
[0021] According to one embodiment, an in-frame prediction mode with the highest occurrence rate is selected from a histogram of occurrence (HoC) derived from adjacent blocks of the current block, and based on the selected in-frame prediction mode, a virtual in-frame prediction mode can be determined.
[0022] According to one embodiment, a plurality of in-screen prediction mode candidates are selected based on the magnitude of the occurrence rate from an occurrence rate histogram derived from adjacent blocks of the current block, and the virtual in-screen prediction mode can be determined based on the in-screen prediction mode selected among the plurality of selected in-screen prediction mode candidates.
[0023] According to one embodiment, the inverse transformation of the transformation coefficients of the current block can be performed based on a transformation kernel applied to a non-directional in-frame prediction mode.
[0024] According to one embodiment, for the current block or a data unit including the current block, if secondary prediction is enabled, a residual prediction sample of the current block can be derived.
[0025] A video encoding method according to one embodiment of the present disclosure may include the steps of: performing inter-frame prediction for a current block to derive a prediction sample of the current block from a reference block of the current block; deriving a residual prediction sample of the current block; obtaining a residual sample of the current block based on the prediction sample and the residual prediction sample; and obtaining a transformation coefficient of the current block by performing a transformation on the residual sample of the current block.
[0026] A non-transient computer-readable recording medium according to one embodiment of the present disclosure can store a bitstream generated by an image encoding method according to various embodiments of the present disclosure.
[0027] A bitstream transmission method according to one embodiment of the present disclosure includes the step of transmitting the bitstream, and can transmit a bitstream generated by an image encoding method according to various embodiments of the present disclosure.
[0028] The features briefly summarized above regarding the present disclosure are merely exemplary aspects of the detailed description of the present disclosure that follows and do not limit the scope of the present disclosure.
[0029] According to the present disclosure, an image encoding / decoding method and apparatus with improved encoding / decoding efficiency may be provided.
[0030] In addition, according to the present disclosure, a method for improving the prediction accuracy of inter-frame prediction by performing a secondary prediction on an inter-frame prediction block may be provided.
[0031] In addition, according to the present disclosure, the efficiency of inter-frame prediction can be improved by performing a secondary prediction on the inter-frame prediction block.
[0032] The effects obtainable from the present disclosure are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art to which the present disclosure belongs from the description below.
[0033] FIG. 1 is a block diagram showing the configuration according to one embodiment of an encoding device to which the present disclosure applies.
[0034] FIG. 2 is a block diagram showing the configuration according to one embodiment of a decoding device to which the present disclosure is applied.
[0035] FIG. 3 is a schematic diagram illustrating a video coding system to which the present disclosure can be applied.
[0036] FIG. 4 is a diagram illustrating a secondary prediction method following a primary prediction based on inter-frame prediction according to one embodiment of the present disclosure.
[0037] Figure 5 shows adjacent samples of the current block used to derive the gradient histogram of the current block.
[0038] Figure 6 shows the adjacent blocks of the current block used to derive the occurrence rate histogram of the current block.
[0039] FIG. 7 is a flowchart illustrating an image decoding method according to one embodiment of the present disclosure.
[0040] FIG. 8 is a drawing illustrating an exemplary content streaming system to which an embodiment according to the present disclosure can be applied.
[0041] An image decoding method according to one embodiment of the present disclosure may be characterized by comprising the steps of: performing inter-frame prediction for a current block to derive a prediction sample of the current block from a reference block of the current block; deriving a residual prediction sample of the current block; obtaining a residual sample of the current block by performing an inverse transformation on the transformation coefficients of the current block; and generating a reconstructed sample of the current block based on the prediction sample, the residual sample, and the residual prediction sample.
[0042] The present disclosure is subject to various modifications and may have various embodiments, and specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present disclosure to specific embodiments, and it should be understood that it includes all modifications, equivalents, and substitutions that fall within the spirit and scope of the present disclosure. Similar reference numerals in the drawings refer to the same or similar functions across various aspects. The shapes and sizes of elements in the drawings may be provided illustratively for clearer explanation. The detailed description of the exemplary embodiments described below refers to the accompanying drawings, which illustrate specific embodiments. These embodiments are described in sufficient detail to enable those skilled in the art to practice the embodiments. It should be understood that various embodiments are different but need not be mutually exclusive. For example, specific shapes, structures, and characteristics described herein may be implemented in other embodiments without departing from the spirit and scope of the present disclosure in relation to one embodiment. It should also be understood that the location or arrangement of individual components within each disclosed embodiment may be changed without departing from the spirit and scope of the embodiment. Accordingly, the following detailed description is not intended to be taken in a limiting sense, and the scope of exemplary embodiments is limited only by the appended claims, together with all equivalents to those claimed therein, provided they are properly described.
[0043] In this disclosure, terms such as first, second, etc. may be used to describe various components, but said components should not be limited by said terms. Such terms are used solely for the purpose of distinguishing one component from another. For example, without departing from the scope of this disclosure, the first component may be named the second component, and similarly, the second component may be named the first component. The term "and / or" includes a combination of a plurality of related described items or any of a plurality of related described items.
[0044] The components shown in the embodiments of the present disclosure are depicted independently to represent different characteristic functions and do not imply that each component consists of separate hardware or a single software unit. That is, each component is listed and included as a separate component for convenience of explanation; however, at least two of the components may be combined to form a single component, or a single component may be divided into multiple components to perform a function, and such integrated and separated embodiments of each component are included within the scope of the rights of the present disclosure as long as they do not deviate from the essence of the present disclosure.
[0045] The terms used in this disclosure are used merely to describe specific embodiments and are not intended to limit this disclosure. Singular expressions include plural expressions unless the context clearly indicates otherwise. Additionally, some components of this disclosure may not be essential components performing an essential function in this disclosure, but may be optional components merely for enhancing performance. This disclosure may be implemented by including only the components essential to embody the essence of this disclosure, excluding components used merely for performance enhancement, and a structure including only the essential components, excluding optional components used merely for performance enhancement, is also included within the scope of this disclosure.
[0046] In the embodiments, the term "at least one" may mean one of a number of 1 or more, such as 1, 2, 3, and 4. In the embodiments, the term "a plurality of" may mean one of a number of 2 or more, such as 2, 3, and 4.
[0047] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. In describing the embodiments of this specification, if it is determined that a detailed description of related known configurations or functions may obscure the gist of this specification, such detailed description is omitted, and the same reference numerals are used for identical components in the drawings, and redundant descriptions of identical components are omitted.
[0048] Glossary of Terms
[0049] In the following, “image” may refer to a single picture constituting a video, or it may refer to the video itself. For example, “encoding and / or decoding of an image” may mean “encoding and / or decoding of an image”, and may also mean “encoding and / or decoding of one of the images constituting the video”.
[0050] In the following, "video" and "video" may be used interchangeably with the same meaning. Additionally, the target image may be an image to be encoded and / or an image to be decoded. Furthermore, the target image may be an input image fed into an encoding device and an input image fed into a decoding device. Here, the target image may have the same meaning as the current image.
[0051] In the following, the encoder and the image encoding device may be used interchangeably with each other.
[0052] In the following, the decoder and the image decoder may be used interchangeably with each other.
[0053] In the following, "image," "picture," "frame," and "screen" may be used interchangeably with the same meaning.
[0054] In the following, “target block” may be an encoding target block that is the target of encoding and / or a decoding target block that is the target of decoding. Additionally, the target block may be a current block that is the target of current encoding and / or decoding. For example, “target block” and “current block” may be used interchangeably.
[0055] In the following description, "block" and "unit" may be used interchangeably. Additionally, to distinguish it from a block, "unit" may refer to a block containing a luminance (Luma) component block and a corresponding chroma (Chroma) component block. For example, a Coding Tree Unit (CTU) may consist of a single luminance component (Y) coding tree block (CTB) and two chroma component (Cb, Cr) coding tree blocks associated with it.
[0056] In the following, “sample,” “pixel,” and “pixel” may be used interchangeably with the same meaning. Here, a sample may represent a basic unit constituting a block.
[0057] In the following, “inter” and “inter-screen” may be used interchangeably with the same meaning.
[0058] In the following, “intra” and “in-screen” may be used interchangeably with the same meaning.
[0059]
[0060] FIG. 1 is a block diagram showing the configuration according to one embodiment of an encoding device to which the present disclosure applies.
[0061] The encoding device (100) may be an encoder, a video encoding device, or an image encoding device. The video may include one or more images. The encoding device (100) may sequentially encode one or more images.
[0062] Referring to FIG. 1, the encoding device (100) may include an image segmentation unit (110), an intra prediction unit (120), a motion prediction unit (121), a motion compensation unit (122), a switch (115), a subtractor (113), a converter (130), a quantization unit (140), an entropy encoding unit (150), an inverse quantization unit (160), an inverse converter (170), an adder (117), a filter unit (180), and a reference picture buffer (190).
[0063] Additionally, the encoding device (100) can generate a bitstream containing encoded information through encoding of an input image and can output the generated bitstream. The generated bitstream can be stored on a computer-readable recording medium or streamed via a wired / wireless transmission medium.
[0064] The video segmentation unit (110) can divide the input video into various forms to increase the efficiency of video encoding / decoding. That is, the input video consists of multiple pictures, and a single picture can be processed by hierarchically dividing it for compression efficiency, parallel processing, etc. For example, a single picture can be divided into one or more tiles or slices and then divided again into multiple CTUs (Coding Tree Units). Alternatively, a single picture can first be divided into multiple sub-pictures defined as groups of rectangular slices, and each sub-picture can be divided into the said tiles / slices. Here, the sub-pictures can be utilized to support the function of partially and independently encoding / decoding and transmitting the picture. Since multiple sub-pictures can each be restored individually, they have the advantage of being easy to edit in applications that configure multi-channel inputs into a single picture. In addition, the tiles can be divided horizontally to create bricks. Here, a brick can be utilized as the basic unit of parallel processing within a picture. Additionally, a single CTU can be recursively partitioned into a Quadtree (QT), and the terminal node of the partition can be defined as a Coding Unit (CU). The CU can be divided into a Prediction Unit (PU) and a Transform Unit (TU) to perform prediction and partitioning. Meanwhile, the CU can be utilized as the prediction unit and / or the transformation unit itself. Here, for flexible partitioning, each CTU can be recursively partitioned into a Multi-Type Tree (MTT) as well as a Quadtree (QT). The partitioning of the CTU into a Multi-Type Tree can begin at the terminal node of the QT, and the MTT can be composed of a Binary Tree (BT) and a Triple Tree (TT).For example, the MTT structure can be classified into vertical binary splitting mode (SPLIT_BT_VER), horizontal binary splitting mode (SPLIT_BT_HOR), vertical ternary splitting mode (SPLIT_TT_VER), and horizontal ternary splitting mode (SPLIT_TT_HOR). Additionally, when splitting, the minimum block size (MinQTSize) of the quad tree for the luminance block can be set to 16x16, the maximum block size (MaxBtSize) of the binary tree to 128x128, and the maximum block size (MaxTtSize) of the triple tree to 64x64. Furthermore, the minimum block size (MinBtSize) of the binary tree and the minimum block size (MinTtSize) of the triple tree can be set to 4x4, and the maximum depth (MaxMttDepth) of the multi-type tree can be set to 4. Additionally, to increase the encoding efficiency of the I slice, a dual tree can be applied that uses different CTU splitting structures for the luminance and chrominance components. On the other hand, in P and B slices, the luminance and color difference CTBs (Coding Tree Blocks) within the CTU can be divided into a single tree that shares a coding tree structure.
[0065] The encoding device (100) may perform encoding on an input image in an intra mode and / or inter mode. Alternatively, the encoding device (100) may perform encoding on an input image in a third mode other than the intra mode and inter mode (e.g., IBC mode, Palette mode, etc.). However, if the third mode has functional characteristics similar to the intra mode or inter mode, it may be classified as an intra mode or inter mode for convenience of explanation. In this disclosure, the third mode will be classified and described separately only when a specific description of the third mode is required.
[0066] When intra mode is used as the prediction mode, the switch (115) can be switched to intra, and when inter mode is used as the prediction mode, the switch (115) can be switched to inter. Here, intra mode may mean an intra-frame prediction mode, and inter mode may mean an inter-frame prediction mode. The encoding device (100) can generate a prediction block for an input block of an input image. Additionally, after the prediction block is generated, the encoding device (100) can encode a residual block using the residual of the input block and the prediction block. The input image may be referred to as the current image that is the subject of current encoding. The input block may be referred to as the current block that is the subject of current encoding or the encoding target block.
[0067] When the prediction mode is an intra mode, the intra prediction unit (120) may use a sample of a block that has already been encoded / decoded around the current block as a reference sample. The intra prediction unit (120) may perform spatial prediction for the current block using the reference sample and generate prediction samples for the input block through spatial prediction. Here, intra prediction may mean intra-frame prediction.
[0068] In the intra prediction method, non-directional prediction modes such as DC mode and Planar mode, and directional prediction modes (e.g., 65 directions) may be applied. Here, the intra prediction method can be expressed as an intra prediction mode or an intra-frame prediction mode.
[0069] When the prediction mode is an inter mode, the motion prediction unit (121) can search for the region that best matches the input block from the reference image during the motion prediction process and derive a motion vector using the searched region. At this time, the search region can be used as the region. The reference image can be stored in the reference picture buffer (190). Here, the reference image can be stored in the reference picture buffer (190) when encoding / decoding of the reference image is processed.
[0070] The motion compensation unit (122) can generate a prediction block for the current block by performing motion compensation using a motion vector. Here, inter-prediction may mean inter-frame prediction or motion compensation.
[0071] The motion prediction unit (121) and motion compensation unit (122) can generate a prediction block by applying an interpolation filter to a portion of the reference image when the value of the motion vector does not have an integer value. To perform inter-frame prediction or motion compensation, based on the encoding unit, it can determine whether the motion prediction and motion compensation method of the prediction unit included in the corresponding encoding unit is a Skip Mode, Merge Mode, Advanced Motion Vector Prediction (AMVP) Mode, or Intra Block Copy (IBC) Mode, and can perform inter-frame prediction or motion compensation according to each mode.
[0072] In addition, based on the above-mentioned inter-frame prediction method, the AFFINE mode of sub-PU-based prediction, the SbTMVP (Subblock-based Temporal Motion Vector Prediction) mode, and the MMVD (Merge with MVD) mode and GPM (Geometric Partitioning Mode) mode of PU-based prediction may be applied. Furthermore, to improve the performance of each mode, HMVP (History based MVP), PAMVP (Pairwise Average MVP), CIIP (Combined Intra / Inter Prediction), AMVR (Adaptive Motion Vector Resolution), BDOF (Bi-Directional Optical-Flow), BCW (Bi-predictive with CU Weights), LIC (Local Illumination Compensation), TM (Template Matching), OBMC (Overlapped Block Motion Compensation), etc. may be applied.
[0073] Among these, AFFINE mode is a technology used in both AMVP and MERGE modes and also offers high encoding efficiency. Conventional video coding standards have the disadvantage of failing to properly compensate for real-world movements, such as zoom in / out and rotation, because they perform Motion Compensation (MC) by considering only the translation of blocks. To address this, a 4-parameter affine motion model using two control point motion vectors (CPMV) and a 6-parameter affine motion model using three control point motion vectors can be applied to inter-prediction. Here, CPMV is a vector representing one of the affine motion models of the top-left, top-right, or bottom-left corners of the current block.
[0074] The subtractor (113) can generate a residual block using the difference between the input block and the prediction block. The residual block may also be referred to as a residual signal. The residual signal may represent the difference between the original signal and the prediction signal. Alternatively, the residual signal may be a signal generated by transforming, quantizing, or both transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be a residual signal in block units.
[0075] The transformation unit (130) can generate a transform coefficient by performing a transform on the remaining block and output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing a transform on the remaining block. When a transform skip mode is applied, the transformation unit (130) may skip the transform on the remaining block.
[0076] A quantized level can be generated by applying quantization to a conversion coefficient or a residual signal. In the following embodiments, the quantized level may also be referred to as a conversion coefficient.
[0077] For example, a 4x4 luminance residual block generated through intra prediction can be transformed using a Discrete Sine Transform (DST)-based basis vector, while the remaining residual blocks can be transformed using a Discrete Cosine Transform (DCT)-based basis vector. Additionally, the transformation blocks for a single block can be divided into a quad tree form using Residual Quad Tree (RQT) technology, and after performing transformation and quantization on each transformation block divided by RQT, a coded block flag (cbf) can be transmitted to increase coding efficiency in the case where all coefficients become zero.
[0078] As another alternative, the Multiple Transform Selection (MTS) technique can be applied to perform transformations using multiple transformation bases selectively. In other words, instead of dividing a CU into TUs via RQT, a function similar to TU division can be performed using the Sub-block Transform (SBT) technique. Specifically, SBT is applied only to inter-frame prediction blocks and, unlike RQT, divides the current block into ½ or ¼ sizes in the vertical or horizontal direction, and then performs a transformation on only one of the blocks. For example, if divided vertically, a transformation can be performed on the leftmost or rightmost block, and if divided horizontally, a transformation can be performed on the topmost or bottommost block.
[0079] In addition, Low Frequency Non-Separable Transform (LFNST), a secondary transform technique that further transforms the residual signal converted to the frequency domain through DCT or DST, can also be applied. LFNST performs additional transformation on the 4x4 or 8x8 low-frequency region in the upper left corner, thereby allowing the residual coefficients to be concentrated in the upper left corner.
[0080] The quantization unit (140) can generate a quantized level by quantizing a transformation coefficient or residual signal according to a quantization parameter (QP, Quantization parameter) and can output the generated quantized level. At this time, the quantization unit (140) can quantize the transformation coefficient using a quantization matrix.
[0081] For example, a quantizer using QP values from 0 to 51 can be used. Alternatively, if the image size is larger and higher coding efficiency is required, QP values from 0 to 63 can be used. Additionally, a Dependent Quantization (DQ) method using two quantizers instead of a single one can be applied. DQ performs quantization using two quantizers (e.g., Q0, Q1), but can be applied so that the quantizer to be used for the next transform coefficient is selected based on the current state through a state transition model, even without signaling information regarding the use of a specific quantizer.
[0082] The entropy encoding unit (150) can generate a bitstream and output a bitstream by performing entropy encoding according to a probability distribution on values calculated by the quantization unit (140) or coding parameter values calculated during the encoding process. The entropy encoding unit (150) can perform entropy encoding on information regarding a sample of an image and information for decoding an image. For example, information for decoding an image may include syntax elements, etc.
[0083] When entropy coding is applied, a small number of bits are allocated to symbols with a high probability of occurrence and a large number of bits are allocated to symbols with a low probability of occurrence, thereby representing the symbols and reducing the size of the bit sequence for the symbols to be encoded. The entropy coding unit (150) may use encoding methods such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) for entropy coding. For example, the entropy coding unit (150) may perform entropy coding using a Variable Length Coding (VLC) table. In addition, the entropy encoding unit (150) may perform arithmetic encoding using the derived binarization method, probability model, and context model after deriving a binarization method of the target symbol and a probability model of the target symbol / bin.
[0084] In this regard, when applying CABAC, in order to reduce the size of the probability table stored in the decoder, the table probability update method may be changed to a table update method using a simple formula. In addition, two different probability models may be used to obtain more accurate symbol probability values.
[0085] The entropy encoding unit (150) can convert a 2-dimensional block form coefficient into a 1-dimensional vector form through a transform coefficient scanning method to encode a transform coefficient level (quantized level).
[0086] Coding parameters may include information (flags, indexes, etc.) that is encoded in the encoding device (100) and signaled to the decoding device (200), such as syntax elements, as well as information derived during the encoding process or decoding process, and may refer to information required when encoding or decoding images.
[0087] Here, signaling a flag or index may mean that in an encoder, the corresponding flag or index is entropy encoded and included in a bitstream, and in a decoder, the corresponding flag or index is entropy decoded from the bitstream.
[0088] The encoded current image can be used as a reference image for other images processed later. Accordingly, the encoding device (100) can restore or decode the encoded current image again, and can store the restored or decoded image as a reference image in the reference picture buffer (190).
[0089] The quantized level can be dequantized in the dequantization unit (160) and inverse transformed in the inverse transform unit (170). The dequantized and / or inverse transformed coefficients can be added to the prediction block through the adder (117). A reconstructed block can be generated by adding the dequantized and / or inverse transformed coefficients and the prediction block. Here, the dequantized and / or inverse transformed coefficients refer to coefficients for which at least one of dequantization and inverse transformation has been performed, and may refer to the reconstructed residual block. The dequantization unit (160) and the inverse transform unit (170) can be performed as the reverse process of the quantization unit (140) and the transformation unit (130).
[0090] The restoration block may pass through a filter section (180). The filter section (180) may apply a deblocking filter, Sample Adaptive Offset (SAO), Adaptive Loop Filter (ALF), Bilateral filter (BIF), LMCS (Luma Mapping with Chroma Scaling), etc., to the restoration sample, restoration block, or restoration image as a whole or part of the filtering technique. The filter section (180) may also be referred to as an in-loop filter. In this case, the term in-loop filter is also used as a name that excludes LMCS.
[0091] Deblocking filters can remove block distortion occurring at the boundaries between blocks. To determine whether to perform deblocking, the decision to apply the filter to the current block can be made based on samples contained in a few columns or rows within the block. When applying a deblocking filter to a block, different filters can be applied depending on the required deblocking filtering intensity.
[0092] To compensate for encoding errors using a sample adaptive offset, an appropriate offset value can be added to the sample value. The sample adaptive offset can correct the offset from the original image on a sample-by-sample basis for the deblocked image. One method may be to divide the samples included in the image into a certain number of regions, determine the region to be offset, and apply the offset to that region, or to apply the offset by considering the edge information of each sample.
[0093] A bilateral filter (BIF) can also correct the offset from the original image on a sample-by-sample basis for the deblocked image.
[0094] An adaptive loop filter can perform filtering based on a comparison of the reconstructed image and the original image. After dividing the samples included in the image into predetermined groups, a filter to be applied to each group can be determined, thereby performing filtering differently for each group. Information regarding whether to apply an adaptive loop filter can be signaled per coding unit (CU), and the shape and filter coefficients of the adaptive loop filter to be applied may vary depending on each block.
[0095] In LMCS (Luma Mapping with Chroma Scaling), Luma mapping (LM) refers to remapping luminance values through a piece-wise linear model, and Chroma scaling (CS) refers to a technique that scales the residual values of the chrominance component according to the average luminance value of the predicted signal. In particular, LMCS can be utilized as an HDR correction technique that reflects the characteristics of HDR (High Dynamic Range) video.
[0096] The restored block or restored image that has passed through the filter unit (180) can be stored in the reference picture buffer (190). The restored block that has passed through the filter unit (180) may be part of the reference image. That is to say, the reference image may be a restored image composed of the restored blocks that have passed through the filter unit (180). The stored reference image may subsequently be used for inter-frame prediction or motion compensation.
[0097] FIG. 2 is a block diagram showing the configuration according to one embodiment of a decoding device to which the present disclosure is applied.
[0098] The decoding device (200) may be a decoder, a video decoding device, or an image decoding device.
[0099] Referring to FIG. 2, the decoding device (200) may include an entropy decoding unit (210), an inverse quantization unit (220), an inverse transformation unit (230), an intra prediction unit (240), a motion compensation unit (250), an adder (201), a switch (203), a filter unit (260), and a reference picture buffer (270).
[0100] The decoding device (200) can receive a bitstream output from the encoding device (100). The decoding device (200) can receive a bitstream stored in a computer-readable recording medium or a bitstream stream streamed through a wired / wireless transmission medium. The decoding device (200) can perform decoding on the bitstream in intra mode or inter mode. Additionally, the decoding device (200) can generate a restored image or a decoded image through decoding and can output the restored image or the decoded image.
[0101] If the prediction mode used for decoding is intra mode, the switch (203) can be switched to intra. If the prediction mode used for decoding is inter mode, the switch (203) can be switched to inter.
[0102] The decoding device (200) can decode the input bitstream to obtain a reconstructed residual block and generate a prediction block. Once the reconstructed residual block and the prediction block are obtained, the decoding device (200) can generate a reconstructed block to be decoded by adding the reconstructed residual block and the prediction block. The block to be decoded may be referred to as the current block.
[0103] The entropy decoding unit (210) can generate symbols by performing entropy decoding according to the probability distribution of the bitstream. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be the inverse process of the entropy encoding method described above.
[0104] The entropy decoding unit (210) can convert a one-dimensional vector-shaped coefficient into a two-dimensional block-shaped coefficient through a conversion coefficient scanning method to decode a conversion coefficient level (quantized level).
[0105] The quantized level can be dequantized in the dequantization unit (220) and inversely transformed in the inverse transformation unit (230). The quantized level can be generated as a restored residual block as a result of performing dequantization and / or inverse transformation. At this time, the dequantization unit (220) can apply a quantization matrix to the quantized level. The dequantization unit (220) and the inverse transformation unit (230) applied to the decoding device can apply the same technology as the dequantization unit (160) and the inverse transformation unit (170) applied to the aforementioned encoding device.
[0106] When an intra mode is used, the intra prediction unit (240) can generate a prediction block by performing a spatial prediction on the current block using sample values of already decoded blocks around the block to be decoded. The intra prediction unit (240) applied to the decoding device can apply the same technology as the intra prediction unit (120) applied to the aforementioned encoding device.
[0107] When an inter mode is used, the motion compensation unit (250) can generate a prediction block by performing motion compensation on the current block using a motion vector and a reference image stored in the reference picture buffer (270). The motion compensation unit (250) can generate a prediction block by applying an interpolation filter to a portion of the reference image when the value of the motion vector does not have an integer value. To perform motion compensation, it can be determined whether the motion compensation method of the prediction unit included in the corresponding encoding unit is a skip mode, merge mode, AMVP mode, or current picture reference mode based on the encoding unit, and motion compensation can be performed according to each mode. The motion compensation unit (250) applied to the decoder can apply the same technology as the motion compensation unit (122) applied to the aforementioned encoding unit.
[0108] The adder (201) can generate a restored block by adding the restored residual block and the prediction block. The filter unit (260) can apply at least one of the following to the restored block or the restored image: an inverse-LMCS, a deblocking filter, a sample adaptive offset, and an adaptive loop filter. The filter unit (260) applied to the decoder can apply the same filtering technology as the filter unit (180) applied to the aforementioned encoding device.
[0109] The filter unit (260) can output a restored image. The restored block or the restored image can be stored in a reference picture buffer (270) and used for inter-frame prediction. The restored block that has passed through the filter unit (260) may be part of the reference image. That is to say, the reference image may be a restored image composed of the restored blocks that have passed through the filter unit (260). The stored reference image may subsequently be used for inter-frame prediction or motion compensation.
[0110] FIG. 3 is a schematic diagram illustrating a video coding system to which the present disclosure can be applied.
[0111] A video coding system according to one embodiment may include an encoding device (10) and a decoding device (20). The encoding device (10) may transmit encoded video and / or image information or data to the decoding device (20) via a digital storage medium or network in the form of a file or streaming.
[0112] An encoding device (10) according to one embodiment may include a video source generation unit (11), an encoding unit (12), and a transmission unit (13). A decoding device (20) according to one embodiment may include a receiving unit (21), a decoding unit (22), and a rendering unit (23). The encoding unit (12) may be called a video / image encoding unit, and the decoding unit (22) may be called a video / image decoding unit. The transmission unit (13) may be included in the encoding unit (12). The receiving unit (21) may be included in the decoding unit (22). The rendering unit (23) may include a display unit, and the display unit may be composed of a separate device or an external component.
[0113] The video source generation unit (11) can acquire video / image through a process of capturing, synthesizing, or generating video / image. The video source generation unit (11) may include a video / image capture device and / or a video / image generation device. The video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / image, etc. The video / image generation device may include, for example, a computer, a tablet, and a smartphone, etc., and can generate video / image (electronically). For example, a virtual video / image may be generated through a computer, etc., in which case the video / image capture process may be replaced by a process of generating related data.
[0114] The encoding unit (12) can encode the input video / image. The encoding unit (12) can perform a series of procedures such as prediction, conversion, and quantization for compression and encoding efficiency. The encoding unit (12) can output the encoded data (encoded video / image information) in the form of a bitstream. The detailed configuration of the encoding unit (12) can also be configured in the same way as the encoding device (100) of FIG. 1 described above.
[0115] The transmission unit (13) can transmit encoded video / image information or data output in the form of a bitstream to the receiving unit (21) of the decoding device (20) via a digital storage medium or network in the form of a file or streaming. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmission unit (13) may include elements for creating a media file through a predetermined file format and elements for transmission via a broadcasting / communication network. The receiving unit (21) can extract / receive the bitstream from the storage medium or network and transmit it to the decoding unit (22).
[0116] The decoding unit (22) can decode a video / image by performing a series of procedures such as inverse quantization, inverse transformation, and prediction corresponding to the operation of the encoding unit (12). The detailed configuration of the decoding unit (22) can also be configured in the same way as the decoding device (200) of FIG. 2 described above.
[0117] The rendering unit (23) can render the decoded video / image. The rendered video / image can be displayed through the display unit.
[0118]
[0119] Hereinafter, with reference to FIGS. 4 to 7, a secondary prediction method for a block to which the inter-frame prediction of the present disclosure is applied is specifically described.
[0120] Inter-prediction is a technique for compressing data size by eliminating temporal redundancy between frames. If redundancy still remains in the residual data to which inter-prediction has been applied, the amount of residual data can be reduced and compression efficiency improved by performing secondary prediction on the residual data. That is, secondary prediction can be additionally performed on residual blocks after primary prediction using various inter-prediction techniques such as AMVP, Merge, TMP, and AMVP-Merge. When secondary prediction is applied, the value of the decoded sample is as shown in Equation 1.
[0121]
[0122] [Mathematical Formula 1]
[0123] Value of decoded sample = Predicted value via first-order prediction + Predicted residual value via second-order prediction + Decoded second-order prediction residual value
[0124]
[0125] FIG. 4 is a diagram illustrating a secondary prediction method following a primary prediction based on inter-frame prediction according to one embodiment of the present disclosure.
[0126] Referring to FIG. 4, the reference block (410) most similar to the current block (400) can be searched from the reference picture. And, the predicted block of the current block (400) can be derived based on the reference block (410).
[0127] Residual samples (404) of the current block can be obtained based on the difference between the current block (400) and the reference block (410). Since temporal redundancy may still exist in the residual samples (404), in order to eliminate this, reference residual samples (406) of the surrounding area of the current block can be additionally obtained based on the difference between the surrounding area (402) of the current block and the surrounding area (412) of the reference block. Subsequently, under the assumption that the reference residual samples (406) of the surrounding area of the current block and the residual samples (404) of the current block are similar, a second prediction can be performed based on the reference residual samples (406) of the surrounding area of the current block.
[0128] For secondary prediction, the surrounding area of the current block and the surrounding area of the prediction block, which are referenced in determining the residual prediction value, can be determined. For various primary predictions, the surrounding area of the current block and the surrounding area of the reference block can be determined by one of the following methods.
[0129] Meanwhile, in FIG. 4, the size of the surrounding area (402) of the current block can be determined as (w x L2) + (L1 x h) + (L1 x L2). And, the size of the reference residual samples (406) of the surrounding area of the current block can be determined as (w x L4) + (L3 x h) + (L3 x L4). Here, w and h represent the width and height of the current block, and the values of L1, L2, L3, and L4 can be determined as any positive integer.
[0130] According to one embodiment, if the primary prediction is an inter-frame prediction method using a template, the surrounding area of the current block may be set to be equal to or smaller than the template area of the current block referenced in the inter-frame prediction. Similarly, the surrounding area of the reference block may be set to be equal to or smaller than the template area of the reference block referenced in the inter-frame prediction.
[0131] According to one embodiment, if the primary prediction is a cross-screen prediction method using a template, the surrounding area of the current block may be set to be equal to or smaller than the predefined adjacent area of the current block. Similarly, the surrounding area of the reference block may be set to be equal to or smaller than the predefined adjacent area of the reference block.
[0132] According to one embodiment, if the primary prediction is a cross-screen prediction method using a template, the surrounding area of the current block may be set to be equal to or smaller than the predefined non-adjacent area of the current block. Similarly, the surrounding area of the reference block may be set to be equal to or smaller than the predefined non-adjacent area of the reference block.
[0133] According to one embodiment, when a primary prediction refers to a single reference block, the surrounding area of the current block may be set to be equal to or smaller than the predefined adjacent area of the current block. Similarly, the surrounding area of the reference block may be set to be equal to or smaller than the predefined adjacent area of the reference block referenced in the cross-frame prediction.
[0134] According to one embodiment, when a primary prediction refers to two or more reference blocks, each surrounding area of the two or more reference blocks may be set to be equal to or smaller than the predefined adjacent area of each reference block. The surrounding area of the current block may be set to be equal to or smaller than the predefined adjacent area of the current block, as in the above embodiment.
[0135] According to one embodiment, when a prediction mode, such as AMVP mode or Merge mode, is applied to generate a prediction block, the surrounding area of the current block may be set to be equal to or smaller than the predefined adjacent area of the current block. Similarly, the surrounding area of the reference block may be set to be equal to or smaller than the predefined adjacent area of the reference block referenced in the cross-screen prediction.
[0136] According to one embodiment, when a final prediction block is generated from two or more prediction blocks according to two or more prediction modes, such as BCW (Bi-prediction with CU-level Weight) mode, CIIP (Combined Intra Inter Prediction) mode, and AMVP-Merge mode, each surrounding area of two or more reference blocks used to derive the two or more prediction blocks may be set to be equal to or smaller than the predefined adjacent area of each reference block. The surrounding area of the current block may be set to be equal to or smaller than the predefined adjacent area of the current block, just as in the above embodiment.
[0137] Residual samples of the current block can be obtained through various primary prediction methods. To perform secondary prediction, reference residual samples of the surrounding area of the current block must be derived using the surrounding area of the prediction block of the current block determined above.
[0138] According to one embodiment, if the primary prediction is a cross-frame prediction method using a template, the reference residual samples of the surrounding area of the current block can be derived through the difference between the surrounding area of the current block and the surrounding area of the reference block.
[0139] According to one embodiment, when a primary prediction refers to a single reference block, the reference residual samples of the surrounding area of the current block can be derived from the difference between the samples of the surrounding area of the current block determined by the above method and the samples of the surrounding area of the reference block used in the primary prediction.
[0140] According to one embodiment, when a primary prediction refers to two or more reference blocks, the reference residual samples of the surrounding area of the current block can be derived from the surrounding area of the current block and the surrounding areas of the two reference blocks used in the primary prediction. For example, a weighted sum sample can be derived by weighting two corresponding samples of the surrounding areas of the two reference blocks, and the reference residual samples of the surrounding area of the current block can be derived from the difference between the weighted sum sample and the corresponding sample of the surrounding area of the current block.
[0141] According to one embodiment, when the cross-screen prediction mode of the primary prediction is a prediction mode that derives a prediction block using a single prediction method such as AMVP or Merge, the reference residual samples of the surrounding area of the current block can be derived from the difference between the samples of the surrounding area of the current block determined by the above method and the samples of the surrounding area of the reference block used for the primary prediction.
[0142] According to one embodiment, when the cross-frame prediction mode of the primary prediction is a prediction mode that determines the final prediction block by performing a weighted sum of two prediction blocks generated by two or more prediction methods, such as BCW mode, CIIP mode, and AMVP-Merge mode, the reference residual sample of the surrounding area of the current block can be derived from the surrounding area of the current block and the surrounding areas of the two reference blocks used in the primary prediction. For example, a weighted sum sample can be derived by performing a weighted sum of two corresponding samples of the surrounding areas of the two reference blocks, and the reference residual sample of the surrounding area of the current block can be derived from the difference between the weighted sum sample and the corresponding sample of the surrounding area of the current block.
[0143] In this case, the weights for the weighted sum of samples from the surrounding regions of the two reference blocks in the second prediction may be the same as the weights used to fuse the two prediction blocks in the first prediction. Alternatively, the weights used in the second prediction may be arbitrary values defined in advance. The weights may be explicitly signaled at the high level (e.g., sequence parameter set, picture parameter set, picture header, slice header, etc.) or the low level (e.g., coding tree unit, coding unit, prediction unit, etc.). Each weight is a real number greater than 0, and the sum of the weights is 1.
[0144] Secondary prediction can be performed based on reference residual samples from the surrounding region of the current block described above. Through secondary prediction, residual prediction samples, which are prediction samples of residual samples, are derived. For various primary predictions, secondary prediction can be performed using one of the following methods, or after performing one or more of the methods below in the encoder, a flag / index representing the method information with the lowest cost value based on a defined cost function can be signaled to the decoder.
[0145] In one embodiment, directional / non-directional intra-frame prediction can be performed using some / all of the reference residual samples of the surrounding region of the current block. In this case, intra-frame prediction having one or more directional / non-directional prediction modes may be used.
[0146] In the encoder, prediction is performed by applying a fixed number of directional / non-directional intra-frame prediction modes to some or all of the reference residual samples in the surrounding region of the current block. Subsequently, the intra-frame prediction mode with the lowest cost value is selected based on a fixed cost function. The information regarding the selected intra-frame prediction mode and the residual sample values after the second prediction can then be signaled from the encoder to the decoder. In this case, the number of intra-frame prediction modes used for the second prediction may always be the same. Alternatively, the number of intra-frame prediction modes used for the second prediction may vary depending on the intra-frame block size.
[0147] According to one embodiment, residual prediction samples of the current block can be derived by performing matrix-based intra-prediction (MIP) on some or all of the reference residual samples of the surrounding region of the current block. In this case, a selected weight matrix among one or more weight matrices used to derive the residual prediction samples may be used.
[0148] In the encoder, a prediction is performed by applying a fixed number of weight matrices to some or all of the reference residual samples in the surrounding region of the current block. Subsequently, the weight matrix with the lowest cost value is selected based on a defined cost function. Then, the information of the selected weight matrix and the residual samples after the second prediction can be signaled from the encoder to the decoder. At this time, the weight matrix candidates used may always be the same, or the number and types of candidates may be set differently depending on the in-frame block size or quantization parameters (QPs).
[0149] According to one embodiment, residual prediction samples of the current block can be derived by performing neural network-based intra-prediction (NNIP) on some / all of the reference residual samples of the surrounding region of the current block. At this time, a selected neural network model among one or more neural network models used to derive residual prediction samples may be used.
[0150] In the encoder, a fixed number of neural network models are applied to some or all of the reference residual samples in the surrounding region of the current block to perform predictions. Subsequently, the neural network model with the lowest cost value is selected based on a defined cost function. The information of the selected neural network model and the residual sample values after the second prediction can then be signaled from the encoder to the decoder. At this time, the neural network model candidates used may always be the same, or the number and types of candidates may be set differently depending on the in-frame block size or quantization parameters (QPs).
[0151] The characteristics of residual samples in a block where quadratic prediction has been performed may differ from the characteristics of residual samples in a block where first-order prediction has been performed. Therefore, the method for determining the separable / inseparable transformation kernel applied to a block where quadratic prediction has been performed may differ from the method applied to a block where only first-order prediction has been performed. Below, a method for deriving / specifying a virtual intra-prediction mode (VIM) used to determine the separable / inseparable transformation kernel applied to a block where quadratic prediction has been performed is described.
[0152] According to one embodiment, VIPM can be derived based on the histogram of gradient (HoG) of the current block. The histogram of gradient of the current block can be determined based on the second-order predicted samples of the current block, adjacent samples of the current block, and / or non-adjacent samples of the current block.
[0153] Here, adjacent samples of the current block may include spatially adjacent samples and / or temporally adjacent samples. Additionally, non-adjacent samples of the current block may include spatially non-adjacent samples and / or temporally non-adjacent samples. The spatially non-adjacent samples and temporally non-adjacent samples may each include partial or complete samples of a region defined by the decoder among the samples within the current frame or reference frame. Alternatively, the spatially non-adjacent samples and temporally non-adjacent samples may each include partial or complete samples of any region pointed to by the additional information of the current block among the samples within the current frame or reference frame.
[0154] The gradients of the second-order predicted samples of the current block referenced in HoG, the adjacent samples of the current block, and / or the non-adjacent samples of the current block can be calculated by applying a boundary detection filter to each sample. Boundary detection filters for detecting gradients include Sobel filters, Roberts cross filters, Prewitt filters, Scharr filters, Laplacian filters, etc.
[0155] FIG. 5 shows adjacent samples of the current block used to derive the gradient histogram of the current block. According to FIG. 5, a boundary detection filter is applied to adjacent samples (510) surrounding the current block (500). Then, the magnitude and direction of the gradient corresponding to each of the adjacent samples (510) are determined. In the gradient histogram, the direction is quantized into a plurality of predefined direction bins. The gradient of each adjacent sample (510) is reflected in the gradient histogram of the current block. For example, a value proportional to the gradient magnitude is cumulatively reflected in the bin corresponding to the direction of the gradient. Thus, the gradient histogram of the current block is constructed by reflecting all the gradients of the adjacent samples (510) of the current block in the gradient histogram.
[0156] Based on the determined HoG, VIPM can be induced according to the following methods, etc.
[0157] In one embodiment, the VIPM of the current block can be determined based on an in-frame prediction mode mapped to the gradient with the largest amplitude in the HoG.
[0158] According to one embodiment, a number of gradient candidates are selected in HoG in order of random or largest amplitude, and the VIPM of the current block may be determined based on one of the in-frame prediction mode candidates mapped to each gradient candidate. Alternatively, the VIPM of the current block may be determined based on the in-frame prediction mode mapped to the selected gradient among the gradient candidates.
[0159] In the encoder, after performing encoding on the aforementioned candidates, the VIPM of the current block can be determined based on the candidate mode having the smallest cost value for rate-distortion or a defined cost function. The determined VIPM information (e.g., whether to use VIPM, transform set index / transform kernel index / VIPM, etc.) can then be signaled to the decoder. In the decoder, the VIPM can be derived from the gradient candidates selected from the HoG according to the VIPM information.
[0160] According to one embodiment, without the above VIPM information, the mode with the smallest or largest mode number of the mapped in-frame prediction mode among the determined gradient candidates may be implicitly determined as the VIPM of the current block.
[0161] According to one embodiment, if the amplitude of all gradients of HoG is less than or equal to a specific value, any predetermined in-frame prediction mode may be determined as the VIPM of the current block.
[0162] According to one embodiment, a VIPM can be derived based on a histogram of occurrence (HoC) of the current block. The histogram of occurrence of the current block can be determined based on the adjacent blocks of the current block and / or the non-adjacent blocks of the current block.
[0163] Here, the adjacent blocks of the current block may include spatially adjacent blocks and / or temporally adjacent blocks. Additionally, the non-adjacent blocks of the current block may include spatially non-adjacent blocks and / or temporally non-adjacent blocks. The spatially non-adjacent blocks and temporally non-adjacent blocks may each include partial or complete blocks of a region defined by the decoder / decoder in the current frame or reference frame. Alternatively, the spatially non-adjacent blocks and temporally non-adjacent blocks may each include partial or complete blocks of any region pointed to by the additional information of the current block in the current frame or reference frame.
[0164] An HoC is generated from the in-frame prediction modes of some / all blocks of the current block's adjacent blocks and / or non-adjacent blocks of the current block. For example, the in-frame prediction modes used in the current block's adjacent / non-adjacent blocks are collected, and the number of pixels of the block (or the corresponding real weight) is accumulated in the direction bin corresponding to each mode to generate the HoC. For example, for a 4×4 block, 16 is accumulated in the corresponding bin.
[0165] If the prediction mode of an adjacent / non-adjacent block referenced in the HoC is a prediction mode that uses two or more intra-frame prediction modes, such as SGPM, TIMD, DIMD, etc., each intra-frame prediction mode is reflected in the direction bin corresponding to each mode according to a predetermined rule. The value accumulated in the direction bin is calculated as the width (pixels) of the current block, the width (pixels) of the referenced adjacent / non-adjacent block, or any predetermined value.
[0166] FIG. 6 shows the adjacent blocks of the current block used to derive the occurrence rate histogram of the current block. According to FIG. 6, the in-frame prediction modes of the adjacent blocks surrounding the current block (600) are scanned. The in-frame prediction modes of the adjacent blocks are then reflected in the occurrence rate histogram in proportion to the area of the adjacent blocks.
[0167] In the occurrence rate histogram, the direction is quantized into a plurality of predefined direction bins. The in-frame prediction mode of each adjacent block is reflected in the occurrence rate histogram of the current block (600) according to its prediction direction. For example, a value proportional to the width of the adjacent block is cumulatively reflected in the bin corresponding to the prediction direction of the in-frame prediction mode. For example, if the adjacent block (610) is 16x16 in size, a value corresponding to 256 is reflected in that bin. Similarly, if the adjacent block (620) is 8x8 in size, a value corresponding to 64 may be reflected in that bin. And if the adjacent block (630) is 4x4 in size, a value corresponding to 16 may be reflected in that bin.
[0168] Accordingly, the occurrence rate histogram of the current block (600) is constructed by reflecting all the in-screen prediction modes of the adjacent blocks of the current block (600) in the occurrence rate histogram.
[0169] One of the following methods can be used for inducing VIPM using HoC.
[0170] In one embodiment, the VIPM of the current block can be determined based on the in-frame prediction mode with the highest frequency in the HoC.
[0171] According to one embodiment, a number of in-screen prediction mode candidates are selected in HoC in a random or high-frequency order, and the VIPM of the current block can be determined based on one of the in-screen prediction mode candidates.
[0172] In the encoder, after performing encoding on the aforementioned intra-frame prediction mode candidates, the VIPM of the current block can be determined based on the intra-frame prediction mode candidate having the smallest cost value for bit rate-distortion or a defined cost function. The determined VIPM information (e.g., whether to use VIPM, transform set index / transform kernel index / VIPM, etc.) can then be signaled to the decoder. Furthermore, in the decoder, the VIPM can be derived from the intra-frame prediction mode candidates selected from the HoC according to the above VIPM information.
[0173] According to one embodiment, without the above VIPM information, the mode with the smallest or largest mode number among the in-screen prediction mode candidates may be implicitly determined as the VIPM of the current block.
[0174] According to one embodiment, if the frequency of all intra-frame prediction mode candidates of the HoC is below a specific value, any predetermined intra-frame prediction mode may be determined as the VIPM of the current block.
[0175] According to one embodiment, the VIPM for determining the transformation kernel and transformation set can be determined by any intra-frame prediction mode. As the prediction accuracy of the second prediction increases, the residual samples may have randomness as features such as directionality are removed. Therefore, the VIPM can be determined by any intra-frame prediction mode, such as a non-directional planar mode or DC mode. Specifically, whether a non-directional mode is used may be predefined in the decoder or selected by the syntax elements of the bitstream.
[0176] Whether to activate the secondary prediction that determines the residual prediction samples can be determined in the following way.
[0177] According to one embodiment, a syntax element (flag) indicating whether secondary prediction is enabled may be explicitly signaled at a high level (e.g., sequence parameter set, picture parameter set, picture header, slice header, etc.). This syntax element may be signaled independently or dependently on other syntax elements.
[0178] According to one embodiment, a syntax element (flag) indicating whether secondary prediction is enabled may be explicitly signaled at a low level (e.g., coding tree unit, coding unit, prediction unit, transform unit, etc.). This syntax element may be signaled independently or dependently on other syntax elements.
[0179] According to one embodiment, whether secondary prediction is enabled can be determined implicitly.
[0180] According to one embodiment, whether to enable secondary prediction can be determined based on specific inter-screen prediction mode information. For example, if the current block is in a specific inter-screen prediction mode (e.g., TMP, AMVP, Merge, BCW, etc.), secondary prediction can always be performed without separate signaling.
[0181] According to one embodiment, whether to enable secondary prediction may be implicitly determined based on specific conditions (e.g., when the block is of a specific size, when the quantization parameter (QP) is specific, etc.). For example, secondary prediction can always be performed without separate signaling for small blocks that are difficult to predict compared to large blocks. The block size that serves as the criterion for performing secondary prediction may be pre-agreed between the encoder and the decoder.
[0182] As another example, secondary prediction can always be performed without separate signaling for blocks with low QPs that are difficult to predict compared to high QPs. The QP value that serves as the criterion for performing secondary prediction may be pre-agreed between the encoder and the decoder.
[0183] FIG. 7 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure. The image decoding method of FIG. 7 can be performed by an image decoding device.
[0184] In step 702, cross-frame prediction is performed for the current block so that prediction samples of the current block can be derived from the reference block of the current block.
[0185] In step 704, a sample of the residual prediction for the current block can be derived.
[0186] According to one embodiment, the residual prediction sample can be derived based on the surrounding area of the current block and the surrounding area of the reference block.
[0187] According to one embodiment, when the prediction mode of the current block is a template-based inter-screen prediction mode, the surrounding area of the current block may be set as all or part of the template area of the current block, and the surrounding area of the reference block may be set as all or part of the template area of the reference block.
[0188] According to one embodiment, when the current block refers to a reference block, the surrounding area of the current block may be configured to include one or more samples adjacent to the current block, and the surrounding area of the reference block may be configured to include one or more samples adjacent to the reference block.
[0189] According to one embodiment, the residual prediction sample of the current block is determined from the reference residual sample of the surrounding area of the current block, and the reference residual sample can be determined from the surrounding area of the current block and the surrounding area of the reference block.
[0190] According to one embodiment, the reference residual sample can be derived based on the difference in sample values between the reference block surrounding sample in the surrounding area of the reference block and the current block surrounding sample in the surrounding area of the current block when the current block refers to one reference block.
[0191] According to one embodiment, when the current block refers to the first reference block and the second reference block, the reference residual sample may be derived based on the difference in sample values between the weighted sum of the first reference block surrounding sample in the surrounding area of the first reference block and the second reference block surrounding sample in the surrounding area of the second reference block and the current block surrounding sample in the surrounding area of the current block.
[0192] According to one embodiment, the residual prediction sample of the current block can be determined by referring to reference residual samples of the surrounding area of the current block according to the in-screen prediction mode for residual prediction used to determine the residual prediction sample.
[0193] According to one embodiment, the residual prediction sample of the current block may be one of the following: the in-frame prediction mode for residual prediction, the directional in-frame prediction mode, the DC mode, and the planner mode.
[0194] According to one embodiment, the residual prediction sample of the current block is such that the in-frame prediction mode for residual prediction is a matrix-based in-frame prediction mode, and the weight matrix used in the matrix-based in-frame prediction mode can be determined based on the size and quantization coefficient of the current block.
[0195] According to one embodiment, the residual prediction sample of the current block is such that the in-frame prediction mode for residual prediction is a neural network-based in-frame prediction mode, and the neural network model used in the neural network-based in-frame prediction mode can be determined based on the size and quantization coefficient of the current block.
[0196] In step 706, residual samples of the current block can be obtained by performing an inverse transformation on the transformation coefficients of the current block.
[0197] According to one embodiment, the inverse transformation of the transformation coefficients of the current block is performed based on a transformation kernel, and the transformation kernel can be determined based on a prediction mode within a virtual screen.
[0198] According to one embodiment, the gradient with the largest amplitude is selected from the Histogram of Gradient (HoG) derived from adjacent samples of the current block, and the virtual in-frame prediction mode can be determined based on the in-frame prediction mode corresponding to the selected gradient.
[0199] According to one embodiment, a plurality of gradient candidates are selected based on the amplitude of a gradient histogram derived from adjacent samples of the current block, and a virtual screen prediction mode can be determined based on a screen prediction mode corresponding to a selected gradient among the selected plurality of gradient candidates.
[0200] According to one embodiment, an in-frame prediction mode with the highest occurrence rate is selected from a histogram of occurrence (HoC) derived from adjacent blocks of the current block, and based on the selected in-frame prediction mode, a virtual in-frame prediction mode can be determined.
[0201] According to one embodiment, a plurality of in-screen prediction mode candidates are selected based on the magnitude of the occurrence rate from an occurrence rate histogram derived from adjacent blocks of the current block, and the virtual in-screen prediction mode can be determined based on the in-screen prediction mode selected among the plurality of selected in-screen prediction mode candidates.
[0202] According to one embodiment, the inverse transformation of the transformation coefficients of the current block can be performed based on a transformation kernel applied to a non-directional in-frame prediction mode.
[0203] In step 708, a restoration sample of the current block can be generated based on the prediction sample, the residual sample, and the residual prediction sample.
[0204] According to one embodiment, for the current block or a data unit including the current block, if secondary prediction is enabled, the step of deriving residual prediction samples of the current block of step 704 may be performed.
[0205] Meanwhile, the residual prediction sample derivation method of step 704 in FIG. 7 can be performed in the same way in the image encoding method. Also, the method for determining the transform kernel used for the inverse transform in step 706 can also be used to determine the transform kernel used for the transformation of the image encoding method. Furthermore, a bitstream can be generated by the image encoding method corresponding to the image decoding method according to FIG. 7. The bitstream can be stored in a non-transient computer-readable recording medium and can also be transmitted (or streamed). The image encoding method corresponding to the image decoding method according to FIG. 7 can be performed by an image encoding device.
[0206] FIG. 8 is a drawing illustrating an exemplary content streaming system to which an embodiment according to the present disclosure can be applied.
[0207] As illustrated in FIG. 8, a content streaming system to which an embodiment of the present disclosure is applied may largely include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.
[0208] The encoding server described above compresses content input from multimedia input devices, such as smartphones, cameras, and CCTVs, into digital data to generate a bitstream and transmits it to the streaming server. As another example, if multimedia input devices, such as smartphones, cameras, and CCTVs, generate the bitstream directly, the encoding server may be omitted.
[0209] The bitstream above may be generated by a video encoding method and / or video encoding device to which an embodiment of the present disclosure is applied, and the streaming server may temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0210] The streaming server transmits multimedia data to a user device based on a user request through a web server, and the web server can act as a medium to inform the user of available services. When a user requests a desired service from the web server, the web server transmits it to the streaming server, and the streaming server can transmit multimedia data to the user. At this time, the content streaming system may include a separate control server, and in this case, the control server can perform the role of controlling commands and responses between each device within the content streaming system.
[0211] The streaming server can receive content from a media storage and / or an encoding server. For example, when receiving content from the encoding server, the content can be received in real time. In this case, to provide a seamless streaming service, the streaming server can store the bitstream for a certain period of time.
[0212] Examples of the above user devices may include mobile phones, smartphones, laptop computers, digital broadcasting terminals, PDAs (personal digital assistants), PMPs (portable multimedia players), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, HMDs (head-mounted displays)), digital TVs, desktop computers, digital signage, etc.
[0213] Each server within the above-mentioned content streaming system can be operated as a distributed server, and in this case, data received from each server can be processed in a distributed manner.
[0214] The above embodiments may be performed in the same or a corresponding way in the encoding device and the decoding device. Additionally, an image may be encoded / decoded using at least one of the above embodiments or a combination of at least one.
[0215] The order in which the above embodiments are applied may differ between the encoding device and the decoder. Alternatively, the order in which the above embodiments are applied may be the same between the encoding device and the decoder.
[0216] The above embodiments may be performed for each of the luminance and chrominance signals. Alternatively, the above embodiments for the luminance and chrominance signals may be performed in the same way.
[0217] In the above embodiments, methods are described based on flowcharts as a series of steps or units; however, the present disclosure is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps as described above. Furthermore, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive, other steps may be included, or one or more steps of the flowcharts may be omitted without affecting the scope of the present disclosure.
[0218] The above embodiments may be implemented in the form of program instructions that can be executed through various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, etc., either alone or in combination. The program instructions recorded on the computer-readable recording medium may be those specifically designed and configured for the present disclosure, or they may be those known and available to those skilled in the art of computer software.
[0219] The bitstream generated by the encoding method according to the above embodiment may be stored in a non-transient computer-readable recording medium. Additionally, the bitstream stored in the non-transient computer-readable recording medium may be decoded by the decoding method according to the above embodiment.
[0220] Herein, examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as CD-ROMs and DVDs; magneto-optical media such as floptical disks; and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, and flash memory. Examples of program instructions include machine code, such as that generated by a compiler, as well as high-level language code that can be executed by a computer using an interpreter, etc. The hardware devices may be configured to operate as one or more software modules to perform processing according to the present disclosure, and vice versa.
[0221] Although the present disclosure has been described above with specific details such as specific components, limited embodiments, and drawings, this is provided only to aid in a more comprehensive understanding of the present disclosure and is not limited to the above embodiments, and a person skilled in the art to which the present disclosure belongs can make various modifications and variations from this description.
[0222] Accordingly, the scope of the present disclosure is not limited to the embodiments described above, and all things equivalent or equivalently modified to the claims set forth below, as well as the claims set forth below, shall be considered to be within the scope of the scope of the present disclosure.
[0223] The present disclosure may be used in an apparatus for encoding / decoding images and a recording medium storing a bitstream.
Claims
1. A step of performing an inter-frame prediction for a current block to derive a prediction sample of the current block from a reference block of the current block; A step of deriving a residual prediction sample of the current block above; A step of obtaining residual samples of the current block by performing an inverse transformation on the transformation coefficients of the current block; and The method includes the step of generating a restoration sample of the current block based on the prediction sample, the residual sample, and the residual prediction sample. An image decoding method characterized in that the above residual prediction sample is derived based on the surrounding area of the current block and the surrounding area of the reference block.
2. In Paragraph 1, A video decoding method characterized in that, when the prediction mode of the current block is a template-based inter-frame prediction mode, the surrounding area of the current block is set as all or part of the template area of the current block, and the surrounding area of the reference block is set as all or part of the template area of the reference block.
3. In Paragraph 1, An image decoding method characterized in that when the current block refers to a reference block, the surrounding area of the current block includes one or more samples adjacent to the current block, and the surrounding area of the reference block includes one or more samples adjacent to the reference block.
4. In Paragraph 1, An image decoding method characterized in that, when the current block refers to a first reference block and a second reference block, the surrounding area of the current block includes one or more samples adjacent to the current block, and the surrounding area of the reference block includes one or more samples adjacent to the first reference block and one or more samples adjacent to the second reference block.
5. In Paragraph 1, The residual prediction sample of the current block is determined from the reference residual sample of the surrounding region of the current block, and An image decoding method characterized in that the above reference residual sample is determined from the surrounding area of the current block and the surrounding area of the reference block.
6. In Paragraph 5, The above reference residual sample is, An image decoding method characterized by being derived based on the difference in sample values between a sample surrounding the reference block in the surrounding area of the reference block and a sample surrounding the current block in the surrounding area of the current block when the current block refers to a single reference block.
7. In Paragraph 5, The above reference residual sample is, An image decoding method characterized by being derived based on the difference in sample values between a sample surrounding the first reference block in the surrounding area of the first reference block and a sample surrounding the second reference block in the surrounding area of the second reference block, when the current block refers to a first reference block and a second reference block.
8. In Paragraph 5, The residual prediction sample of the current block above is, An image decoding method characterized by determining the residual prediction samples by referring to reference residual samples in the surrounding area of the current block according to an in-frame prediction mode for residual prediction used to determine the residual prediction samples.
9. In Paragraph 8, The residual prediction sample of the current block above is, An image decoding method characterized in that the intra-frame prediction mode for residual prediction is one of a directional intra-frame prediction mode, a DC mode, or a planar mode.
10. In Paragraph 8, The residual prediction sample of the current block above is, An image decoding method characterized in that the above-mentioned intra-frame prediction mode for residual prediction is a matrix-based intra-frame prediction mode, and the weight matrix used in the above-mentioned matrix-based intra-frame prediction mode is determined based on the size of the current block and the quantization coefficient.
11. In Paragraph 8, The residual prediction sample of the current block above is, An image decoding method characterized in that the above-mentioned intra-frame prediction mode for residual prediction is a neural network-based intra-frame prediction mode, and the neural network model used in the above-mentioned neural network-based intra-frame prediction mode is determined based on the size of the current block and quantization coefficients.
12. In Paragraph 1, An image decoding method characterized in that the inverse transformation of the transformation coefficients of the current block is performed based on a transformation kernel, and the transformation kernel is determined based on a prediction mode within a virtual frame.
13. In Paragraph 12, The gradient with the largest amplitude is selected from the Histogram of Gradient (HoG) derived from adjacent samples of the current block, and An image decoding method characterized by determining the virtual in-frame prediction mode based on the in-frame prediction mode corresponding to the selected gradient.
14. In Paragraph 12, Multiple gradient candidates are selected based on the amplitude from the gradient histogram derived from adjacent samples of the current block, and A video decoding method characterized by determining the virtual in-frame prediction mode based on the in-frame prediction mode corresponding to the selected gradient among the selected plurality of gradient candidates.
15. In Paragraph 12, The in-frame prediction mode with the highest occurrence rate is selected from the Histogram of Occurrence (HoC) derived from adjacent blocks of the current block, and A video decoding method characterized by determining the prediction mode within the virtual screen based on the prediction mode within the selected screen.
16. In Paragraph 12, Multiple in-screen prediction mode candidates are selected based on the magnitude of the occurrence rate from the occurrence rate histogram derived from adjacent blocks of the current block, and A video decoding method characterized by determining the virtual in-frame prediction mode based on the in-frame prediction mode selected among the above-mentioned multiple in-frame prediction mode candidates.
17. In Paragraph 1, An image decoding method characterized in that the inverse transformation of the transformation coefficients of the current block is performed based on a transformation kernel applied to a non-directional intra-frame prediction mode.
18. In Paragraph 1, An image decoding method characterized by deriving a residual prediction sample of the current block when secondary prediction is enabled for the current block or a data unit including the current block.
19. A step of performing an inter-frame prediction for the current block to derive a prediction sample of the current block from a reference block of the current block; A step of deriving a residual prediction sample of the current block above; Based on the above prediction sample and the above residual prediction sample, the method includes the step of obtaining a residual sample of the current block. The method includes the step of obtaining the transformation coefficient of the current block by performing a transformation on the residual sample of the current block. An image encoding method characterized in that the above residual prediction sample is derived based on the surrounding area of the current block and the surrounding area of the reference block.
20. A bitstream transmission method generated by a video encoding method, The above transmission method includes the step of generating a bitstream by encoding an image according to an image encoding method and the step of transmitting the generated bitstream. The above image encoding method is, A step of performing an inter-frame prediction for a current block to derive a prediction sample of the current block from a reference block of the current block; A step of deriving a residual prediction sample of the current block above; Based on the above prediction sample and the above residual prediction sample, the method includes the step of obtaining a residual sample of the current block. The method includes the step of obtaining the transformation coefficient of the current block by performing a transformation on the residual sample of the current block. A transmission method characterized in that the above residual prediction sample is derived based on the surrounding area of the current block and the surrounding area of the reference block.