Image encoding / decoding method and apparatus, and recording medium for storing bit stream

By optimizing the image encoding/decoding method and predicting the coefficient signs based on the transform type, the problem of increasing the amount of high-resolution image data is solved, the encoding/decoding efficiency is improved and the cost is reduced.

CN120642339APending Publication Date: 2025-09-12HYUNDAI MOTOR CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202480010115.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-04-10
Filing Date
2024-04-09
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

When existing image encoding/decoding technologies process high-resolution and high-quality images, the increase in data volume leads to high transmission and storage costs, and the coefficient sign prediction is highly complex.

Method used

By determining the transform type of the current block, predicting the coefficient symbol prediction target based on the transform type, optimizing the coefficient symbol prediction area and number, and improving the encoding/decoding efficiency.

Benefits of technology

It achieves more efficient image encoding/decoding, reduces transmission and storage costs, and optimizes the coefficient sign prediction process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120642339A_ABST
    Figure CN120642339A_ABST
Patent Text Reader

Abstract

Provided are an image encoding / decoding method, an apparatus, a recording medium for storing a bitstream, and a transmission method. The image decoding method comprises the steps of: determining a transform type of a current block; determining a coefficient symbol prediction target of the current block based on the transform type; and predicting a symbol of a coefficient corresponding to a coefficient symbol prediction target, where the coefficient symbol prediction target may be designated as a coefficient symbol prediction region or a number of coefficients corresponding to the coefficient symbol prediction target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and apparatus for encoding / decoding an image and a recording medium for storing a bitstream. Specifically, the present invention relates to a method and apparatus for encoding / decoding an image using a sign of a prediction coefficient and a recording medium for storing a bitstream. Background Art

[0002] Recently, in various application fields, the demand for high-resolution and high-quality images (such as ultra-high-definition (UHD) images) has increased. As image data becomes higher in resolution and quality, the amount of data increases relatively compared to existing image data. Therefore, when such image data is transmitted using existing media (such as wired or wireless broadband channels), or when image data is stored using existing storage media, both transmission cost and storage cost increase. In order to solve these problems that occur as image data becomes higher in resolution and quality, efficient image encoding / decoding technology is required for images with higher resolution and image quality.

[0003] The technology of predicting coefficient signs as used in image encoding / decoding technology is a technology in which, for residual coefficients to which sign prediction can be applied, a combination that minimizes a predetermined cost function is selected from all possible combinations of negative signs and positive signs, and the combination is used as a predicted value of the actual sign.

[0004] However, when determining the target coefficient to be predicted by sign prediction, the problem has very high complexity since all coefficient positions within the sign prediction area are scanned and every possible combination of negative and positive signs is checked for the target coefficient to be predicted by sign prediction. Summary of the Invention

[0005] Technical issues

[0006] An object of the present invention is to provide a method and apparatus for encoding / decoding images with improved encoding / decoding efficiency.

[0007] Another object of the present invention is to provide a recording medium for storing a bit stream generated by the method or apparatus for decoding an image according to the present invention.

[0008] Another object of the present invention is to provide a method for measuring a coefficient sign by using a coefficient sign prediction area and the number of coefficient sign prediction targets determined according to a transform type of a current block, so as to solve the above-mentioned problem of coefficient sign prediction.

[0009] Technical Solution

[0010] According to an embodiment of the present invention, a method for decoding an image includes: determining a transform type of a current block; determining a coefficient sign prediction target based on the transform type; and predicting the sign of a coefficient corresponding to the coefficient sign prediction target, and the coefficient sign prediction target can be specified as a coefficient sign prediction area or the number of coefficients corresponding to the coefficient sign prediction target.

[0011] In the method for decoding an image, the transform type of the current block may indicate any one of separate transform, non-separate transform, and a combination of separate transform and non-separate transform.

[0012] In the method for decoding an image, a coefficient corresponding to a coefficient sign prediction target may be a coefficient located within a coefficient sign prediction area.

[0013] In a method for decoding an image, a size of a coefficient symbol prediction region of a current block may be determined based on a transform type of the current block.

[0014] In the method for decoding an image, the size of the coefficient symbol prediction region of the current block may be determined based on a comparison result between the size of the current block and the size of the coefficient symbol prediction region determined based on a transform type of the current block.

[0015] In a method for decoding an image, the size of a coefficient symbol prediction area of ​​a current block may be determined based on a comparison result between the size of a valid area and the size of a coefficient symbol prediction area determined based on a transform type of the current block, wherein the valid area is an area within the current block including non-zero coefficients.

[0016] In a method for decoding an image, the number of coefficients corresponding to a coefficient sign prediction target may be determined based on a transform type of a current block.

[0017] In a method for decoding an image, the number of coefficients corresponding to a coefficient sign prediction target may be determined based on a comparison result between the number of non-zero coefficients of a current block and the number of coefficients corresponding to a coefficient sign prediction target determined based on a transform type of the current block.

[0018] In a method for decoding an image, the number of coefficients corresponding to a coefficient sign prediction target can be determined based on a comparison result between the number of non-zero coefficients included in a valid area within a current block and the number of coefficients corresponding to a coefficient sign prediction target determined based on a transform type of the current block.

[0019] In a method for decoding an image, the number of coefficients corresponding to a coefficient sign prediction target is determined based on a comparison result between the number of non-zero coefficients included in a coefficient sign prediction area and the number of coefficients corresponding to a coefficient sign prediction target determined based on a transform type of a current block, and the coefficient sign prediction area can be determined based on the transform type of the current block.

[0020] According to an embodiment of the present invention, a method for encoding an image includes: determining a transform type of a current block; determining a coefficient sign prediction target based on the transform type; and predicting the sign of a coefficient corresponding to the coefficient sign prediction target, and the coefficient sign prediction target can be specified as a coefficient sign prediction area or the number of coefficients corresponding to the coefficient sign prediction target.

[0021] A non-transitory computer-readable recording medium according to an embodiment of the present invention can store a bitstream generated by a method for encoding an image, the method comprising: determining a transform type of a current block; determining a coefficient sign prediction target based on the transform type; and predicting a sign of a coefficient corresponding to the coefficient sign prediction target, wherein the coefficient sign prediction target is specified as a coefficient sign prediction area or the number of coefficients corresponding to the coefficient sign prediction target.

[0022] A bitstream transmission method according to an embodiment of the present invention can transmit a bitstream generated by a method for encoding an image. The method for encoding an image includes: determining a transform type of a current block; determining a coefficient sign prediction target based on the transform type; and predicting a sign of a coefficient corresponding to the coefficient sign prediction target, wherein the coefficient sign prediction target is specified as a coefficient sign prediction area or the number of coefficients corresponding to the coefficient sign prediction target.

[0023] The features briefly summarized above regarding the present disclosure are provided only as examples to explain the detailed description and are not to be construed as limiting the scope of the present disclosure.

[0024] Beneficial effects

[0025] According to the present invention, a method and apparatus for encoding / decoding an image with improved encoding / decoding efficiency can be provided.

[0026] In addition, according to the present invention, a method for predicting the sign of a coefficient can be provided, which predicts the sign of the coefficient only for an area of ​​distribution applicable to the coefficient of the current block.

[0027] In addition, according to the present invention, a method for predicting the signs of coefficients can be provided, which predicts the signs only for a predetermined number of coefficients.

[0028] Effects obtainable from the present disclosure are not limited to the above-mentioned effects, and other effects not mentioned will be clearly understood from the following description by those skilled in the art. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a block diagram showing the configuration of an encoding apparatus according to an embodiment of the present invention.

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

[0031] Figure 3 FIG. 1 is a diagram schematically illustrating a video encoding system to which the present invention is applicable.

[0032] Figure 4 is a diagram for describing a cost function of a method for predicting a coefficient sign according to an embodiment of the present invention.

[0033] Figure 5 is a diagram for describing a non-separate primary transform applied to each block size according to an embodiment of the present invention.

[0034] Figure 6 is a diagram for describing a zeroing method in a non-separating transform according to an embodiment of the present invention.

[0035] Figure 7 is a diagram for describing an embodiment of a transform block to which a non-separate primary transform is applied according to an embodiment of the present invention.

[0036] Figure 8 is a flowchart illustrating a method for decoding an image according to an embodiment of the present invention.

[0037] Figure 9 FIG. 1 is a diagram illustrating a content streaming system to which an embodiment of the present invention is applicable. DETAILED DESCRIPTION

[0038] The present invention may have various modifications and embodiments, and specific embodiments are shown in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, but should be understood to include all modifications, equivalents or substitutes included in the spirit and scope of the present invention. In various aspects, similar reference numerals in the drawings indicate the same or similar functions. The shapes and sizes of the elements in the drawings can be provided by way of example for a clearer description. The detailed description of the exemplary embodiments described below refers to the drawings, which illustrate specific embodiments by way of example. These embodiments are described in sufficient detail to enable those skilled in the art to practice these embodiments. It should be understood that various embodiments are different from each other, but not necessarily mutually exclusive. For example, the specific shapes, structures and characteristics described herein can be implemented in other embodiments without departing from the spirit and scope of the present invention regarding an embodiment. It should also be understood that the position or arrangement of the various components in each disclosed embodiment can be changed without departing from the spirit and scope of the embodiment. Therefore, the detailed description set forth below is not intended to be restrictive, and the scope of the exemplary embodiments is limited only by the full range of equivalents to which the appended claims and these claims are entitled (if appropriately described).

[0039] In the present invention, the terms first, second, etc. may be used to describe various components, but the components should not be limited by these terms. These terms are only used to distinguish one component from another. For example, a first component may be referred to as a second component, and similarly, a second component may be referred to as a first component without departing from the scope of the present invention. The term is and / or includes a combination of multiple related descriptive items or any item among multiple related descriptive items.

[0040] The components shown in the embodiments of the present invention are depicted independently to indicate different characteristic functions, and do not mean that each component is formed as a separate hardware or software configuration unit. That is, for ease of explanation, each component is listed and included as a separate component, and at least two components can be combined to form a single component, or a component can be divided into multiple components to perform functions, and embodiments in which components are integrated and embodiments in which each component is divided are also included in the scope of the present invention as long as they do not depart from the essence of the present invention.

[0041] The terms used in the present invention are only used to describe specific embodiments and are not intended to limit the present invention. Unless the context clearly indicates otherwise, singular expressions include plural expressions. In addition, some components of the present invention are not essential components for performing the basic functions of the present invention and may be optional components that are only used to improve performance. The present invention can be implemented by only including essential components for realizing the essence of the present invention and not including components that are only used to improve performance, and structures that only include essential components except the optional components that are only used to improve performance are also included within the scope of the present invention.

[0042] In one embodiment, the term "at least one" may refer to one of a number greater than or equal to 1, such as 1, 2, 3, and 4. In one embodiment, the term "plurality" may refer to one of a number greater than or equal to 2, for example, 2, 3, and 4.

[0043] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing the embodiments of this specification, if it is determined that a detailed description of a related known configuration or function may obscure the subject matter of this specification, the detailed description will be omitted, and the same reference numerals will be used for the same components in the accompanying drawings, and repeated description of the same components will be omitted.

[0044] Terminology Description

[0045] Hereinafter, "image" may refer to a picture constituting a video, or may also refer to the video itself. For example, "encoding and / or decoding of an image" may refer to "encoding and / or decoding of a video," or may also refer to "encoding and / or decoding of one of the pictures constituting the video."

[0046] Hereinafter, the terms "dynamic image" and "video" may be used interchangeably and synonymously. Furthermore, a target image may be an encoding target image serving as an encoding target and / or a decoding target image serving as a decoding target. Furthermore, a target image may be an input image to an encoding device or an input image to a decoding device. Here, the target image may have the same meaning as the current image.

[0047] Hereinafter, an encoder and an image encoding device may be used with the same meaning and may be used interchangeably.

[0048] Hereinafter, a decoder and an image decoding device may be used with the same meaning and may be used interchangeably.

[0049] Hereinafter, “image,” “picture,” “frame,” and “picture” may be used with the same meaning and may be used interchangeably.

[0050] Hereinafter, a "target block" may be an encoding target block that is an encoding target and / or a decoding target block that is a decoding target. In addition, a target block may be a current block that is a target of current encoding and / or decoding. For example, "target block" and "current block" may be used with the same meaning and may be used interchangeably.

[0051] Hereinafter, "block" and "unit" may be used interchangeably with each other. Furthermore, a "unit" may refer to a block including a luma component block and its corresponding chroma component blocks to distinguish it from a block. For example, a coding tree unit (CTU) may consist of one luma component (Y) coding tree block (CTB) and two associated chroma component (Cb, Cr) coding tree blocks.

[0052] Hereinafter, "sample," "picture element," and "pixel" may be used with the same meaning and may be used interchangeably. Herein, a sample may refer to a basic unit constituting a block.

[0053] Hereinafter, “inter-frame” and “inter-screen” may be used with the same meaning and may be used interchangeably.

[0054] Hereinafter, “intra-frame” and “intra-screen” may be used with the same meaning and may be used interchangeably.

[0055] Figure 1 is a block diagram showing the configuration of an encoding apparatus according to an embodiment of the present invention.

[0056] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include one or more images. The encoding device 100 may encode one or more images sequentially.

[0057] refer to Figure 1 , the encoding device 100 may include an image segmentation unit 110, an intra-frame prediction unit 120, a motion prediction unit 121, a motion compensation unit 122, a switch 115, a subtractor 113, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, a dequantization unit 160, an inverse transform unit 170, an adder 117, a filter unit 180 and a reference picture buffer 190.

[0058] In addition, the encoding device 100 can generate a bit stream including encoding information by encoding the input image and output the generated bit stream. The generated bit stream can be stored in a computer-readable recording medium or can be streamed through a wired / wireless transmission medium.

[0059] The image segmentation unit 110 can segment the input image into various forms to improve the efficiency of video encoding / decoding. That is, the input video is composed of multiple pictures, and for compression efficiency, parallel processing, etc., a picture can be segmented and processed hierarchically. For example, a picture can be segmented into one or more tiles or slices, and then segmented again into multiple CTUs (coding tree units). Alternatively, a picture can first be segmented into multiple sub-pictures defined as rectangular slice groups, and each sub-picture can be segmented into tiles / slices. Here, sub-pictures can be used to support the functions of partially independent encoding / decoding and transmitting pictures. Since multiple sub-pictures can be reconstructed separately, there is an advantage of easy editing in applications where multi-channel input is configured into one picture. In addition, tiles can be divided horizontally to generate blocks. Here, blocks can be used as basic units for parallel processing within a picture. In addition, a CTU can be recursively segmented into a quadtree (QT), and the terminal node of the segmentation can be defined as a CU (coding unit). The CU can be split into PU (prediction unit) as a prediction unit and TU (transform unit) as a transform unit to perform prediction and segmentation. At the same time, the CU can be used as a prediction unit and / or a transform unit itself. Here, for flexible segmentation, each CTU can be recursively split into a multi-type tree (MTT) and a quadtree (QT). The CTU can be split into a multi-type tree starting from the end node of the QT, and the MTT can be composed of a binary tree (BT) and a ternary tree (TT). For example, the MTT structure can be classified into a vertical binary split mode (SPLIT_BT_VER), a horizontal binary split mode (SPLIT_BT_HOR), a vertical ternary split mode (SPLIT_TT_VER), and a horizontal ternary split mode (SPLIT_TT_HOR). In addition, the minimum block size (MinQTSize) of the quadtree of the luminance block during segmentation can be set to 16×16, the maximum block size (MaxBtSize) of the binary tree can be set to 128×128, and the maximum block size (MaxTtSize) of the ternary tree can be set to 64×64. In addition, the minimum block size (MinBtSize) of the binary tree and the minimum block size (MinTtSize) of the ternary tree can be specified as 4×4, and the maximum depth (MaxMttDepth) of the multi-type tree can be specified as 4. In addition, in order to improve the coding efficiency of the I slice, a dual tree of the CTU partition structure that uses the luminance component and the chrominance component differently can be applied. On the other hand, in P slices and B slices, the luminance and chrominance CTBs (coding tree blocks) within the CTU can be partitioned into a single tree (singletree) that shares the coding tree structure.

[0060] The encoding device 100 can perform encoding on the input image in intra mode and / or inter mode. Alternatively, the encoding device 100 can perform encoding on the input image in a third mode (e.g., IBC mode, palette mode, etc.) other than intra mode and inter mode. However, if the third mode has functional characteristics similar to those of intra mode or inter mode, the third mode may be classified as intra mode or inter mode for ease of explanation. In the present invention, the third mode is separately classified and described only when a specific description of the third mode is required.

[0061] When the intra mode is used as the prediction mode, the switch 115 can be switched to intra, and when the inter mode is used as the prediction mode, the switch 115 can be switched to inter. Here, the intra mode may refer to the intra prediction mode, and the inter mode may refer to the inter prediction mode. The encoding device 100 can generate a prediction block for the input block of the input image. In addition, the encoding device 100 can encode the residual block using the residual of the input block and the prediction block after generating the prediction block. The input image can be referred to as the current image that is the current encoding target. The input block can be referred to as the current block that is the current encoding target or the encoding target block.

[0062] When the prediction mode is intra mode, the intra prediction unit 120 may use samples of blocks that have been encoded / decoded around the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block using the reference samples, or generate prediction samples of the input block through spatial prediction. In this article, intra prediction may refer to intra-frame prediction.

[0063] As the intra prediction method, non-directional prediction modes such as DC mode and planar mode and directional prediction modes (for example, 65 directions) can be applied. Here, the intra prediction method can be expressed as an intra prediction mode or an intra-screen prediction mode.

[0064] When the prediction mode is inter mode, the motion prediction unit 121 can retrieve the area that best matches the input block from the reference image during the motion prediction process and derive a motion vector by using the retrieved area. In this case, the search area can be used as the above-mentioned area. The reference image can be stored in the reference picture buffer 190. Here, when encoding / decoding the reference image, the reference image can be stored in the reference picture buffer 190.

[0065] The motion compensation unit 122 may generate a prediction block of the current block by performing motion compensation using a motion vector. Herein, inter prediction may refer to inter-picture prediction or motion compensation.

[0066] When the value of the motion vector is not an integer, the motion prediction unit 121 and the motion compensation unit 122 may generate a prediction block by applying an interpolation filter to a partial area of ​​the reference picture. In order to perform inter-frame prediction or motion compensation, it may be determined based on the coding unit whether the motion prediction and motion compensation mode of the prediction unit included in the coding unit is one of the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and intra block copy (IBC) mode, and inter-frame prediction or motion compensation may be performed according to each mode.

[0067] In addition, based on the above-mentioned inter-frame prediction method, the affine mode based on sub-PU prediction, the temporal motion vector prediction based on sub-block (SbTMVP) mode, the PU prediction-based MVD merge (MMVD) mode and the geometric partitioning mode (GPM) can be applied. In addition, in order to improve the performance of each mode, the history-based MVP (HMVP), pairwise average MVP (PAMVP), combined intra / inter prediction (CIIP), adaptive motion vector resolution (AMVR), bidirectional optical flow (BDOF), bidirectional prediction with CU weight (BCW), local illumination compensation (LIC), template matching (TM), overlapped block motion compensation (OBMC), etc. can be applied.

[0068] Among them, the AFFINE mode is a technology used in both AMVP and MERGE modes, and also has high coding efficiency. In the existing video coding standard, because motion compensation (MC) is performed by considering only the parallel movement of the block, it has the disadvantage of not being able to properly compensate for actual motions such as zooming in / out and rotation. To supplement this, a four-parameter affine motion model (affine motion model) using two control point motion vectors (CPMV) and a six-parameter affine motion model using three control point motion vectors can be utilized and the above motion model can be applied to inter-frame prediction. Here, CPMV is a vector representing an affine motion model of any one of the upper left, upper right, and lower left of the current block.

[0069] The subtractor 113 may generate a residual block by using the difference between the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may refer to the difference between the original signal and the prediction signal. Alternatively, the residual signal may be a signal generated by transforming or quantizing, or transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be a residual signal in units of blocks.

[0070] The transform unit 130 may generate a transform coefficient by performing a transform on the residual block and output the generated transform coefficient. In this article, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip transforming the residual block.

[0071] A quantized level may be generated by applying quantization to a transform coefficient or a residual signal. Hereinafter, a quantized level may also be referred to as a transform coefficient in embodiments.

[0072] For example, a 4×4 luminance residual block generated by intra prediction is transformed using a basis vector based on discrete sine transform (DST), and the remaining residual block can be transformed using a basis vector based on discrete cosine transform (DCT). In addition, the transform block is divided into a quadtree shape for one block using the residual quad tree (RQT) technology, and after transforming and quantizing each transform block divided by RQT, in order to improve coding efficiency when all coefficients become 0, a coded block flag (CBF) can be transmitted.

[0073] As another alternative, a multiple transform selection (MTS) technique that selectively uses multiple transform bases to perform transforms can be applied. That is, instead of partitioning the CU into TUs through RQT, a function similar to TU partitioning can be performed through sub-block transform (SBT) technology. Specifically, SBT is only applied to inter-frame prediction blocks, and unlike RQT, the current block can be partitioned into 1 / 2 or 1 / 4 sizes in the vertical or horizontal direction, and then the transform can be performed only on one block in the block. For example, if the block is partitioned vertically, the transform can be performed on the leftmost or rightmost block, and if the block is partitioned horizontally, the transform can be performed on the topmost or bottommost block.

[0074] In addition, a low-frequency non-separable transform (LFNST) can be applied. LFNST is a secondary transform technique that performs an additional transform on the residual signal transformed to the frequency domain by DCT or DST. LFNST performs an additional transform on the 4×4 or 8×8 low-frequency region in the upper left corner, so that the residual coefficients can be concentrated in the upper left corner.

[0075] The quantization unit 140 may generate a quantization level by quantizing the transform coefficient or the residual signal according to a quantization parameter (QP) and output the generated quantization level. Herein, the quantization unit 140 may quantize the transform coefficient by using a quantization matrix.

[0076] For example, a quantizer with a QP value of 0 to 51 can be used. Alternatively, if the image size is large and higher coding efficiency is required, a QP of 0 to 63 can be used. In addition, a correlated quantization (DQ) method using two quantizers instead of one quantizer can be applied. DQ performs quantization using two quantizers (e.g., Q0 and Q1), and although information about the use of a specific quantizer is not signaled, a state transition model can be used to select a quantizer to be used for the next transform coefficient based on the current state.

[0077] The entropy coding unit 150 may generate a bitstream by performing entropy coding on the values ​​calculated by the quantization unit 140 or the coding parameter values ​​calculated when performing coding according to the probability distribution, and output the bitstream. The entropy coding unit 150 may perform entropy coding on information about samples of an image and information for decoding the image. For example, the information for decoding the image may include syntax elements.

[0078] When entropy coding is applied, symbols are represented so that a smaller number of bits are allocated to symbols with a high probability of occurrence, and a larger number of bits are allocated to symbols with a low probability of occurrence, and thus, the size of the bit stream for the symbols to be coded can be reduced. The entropy coding unit 150 can perform entropy coding using a coding method such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 can perform entropy coding by using a variable length coding / coding (VLC) table. In addition, the entropy coding unit 150 can derive a binarization method of the target symbol and a probability model of the target symbol / bit, and perform arithmetic coding by using the derived binarization method and context model.

[0079] In this regard, when CABAC is applied, in order to reduce the size of the probability table stored in the decoding device, the probability update method of the table can be changed to a method of updating the table using a simple formula and applying this probability update method. In addition, in order to obtain more accurate symbol probability values, two different probability models can be used.

[0080] In order to encode the transformation coefficient level (quantization level), the entropy encoding unit 150 may change the coefficients in a two-dimensional block form into a one-dimensional vector form through a transformation coefficient scanning method.

[0081] The encoding parameters may include information such as syntax elements (flags, indexes, etc.) encoded in the encoding device 100 and signaled to the decoding device 200 and information derived in the encoding or decoding process, and may refer to information required when encoding or decoding an image.

[0082] Herein, signaling a flag or an index may refer to entropy encoding the corresponding flag or index in an encoder and including in a bitstream, and may refer to entropy encoding the corresponding flag or index from a bitstream in a decoder.

[0083] The encoded current image can be used as a reference image for another image to be processed later. Therefore, the encoding device 100 can reconstruct or decode the encoded current image again and store the reconstructed or decoded image as a reference image in the reference picture buffer 190.

[0084] The quantization level may be dequantized in the dequantization unit 160 or inversely transformed in the inverse transform unit 170. The dequantized and / or inversely transformed coefficients may be added to the prediction block by the adder 117. Herein, the dequantized and / or inversely transformed coefficients may refer to coefficients on which at least one of dequantization and inverse transformation is performed, and may refer to a reconstructed residual block. The dequantization unit 160 and the inverse transform unit 170 may be performed as inverse processes of the quantization unit 140 and the transform unit 130.

[0085] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply a deblocking filter, sample adaptive offset (SAO), adaptive loop filter (ALF), bilateral filter (BIF), luma mapping with chroma scaling (LMCS), etc. to the reconstructed sample, reconstructed block, or reconstructed image using all or part of the filtering techniques. The filter unit 180 may be referred to as an in-loop filter. In this case, the in-loop filter is also used as a name other than LMCS.

[0086] A deblocking filter can remove block distortion generated at the boundaries between blocks. To determine whether to apply a deblocking filter, a determination can be made based on samples included in a number of rows or columns included in the block whether to apply the deblocking filter to the current block. When applying a deblocking filter to a block, different filters can be applied depending on the desired deblocking filter strength.

[0087] To compensate for coding errors using sample adaptive offset, an appropriate offset can be added to the sample value. Sample adaptive offset can correct the offset between the deblocked image and the original image in sample units. A method can be used in which the samples included in the image are divided into a predetermined number of regions, the regions to which the offset is applied are determined, and the offset is applied to the determined regions, or a method in which the offset is applied taking into account edge information about each sample.

[0088] The bilateral filter (BIF) can also correct the offset from the original image on a sample-by-sample basis for an image on which deblocking has been performed.

[0089] The adaptive loop filter can perform filtering based on the comparison result of the reconstructed image and the original image. The samples included in the image can be divided into predetermined groups, the filter applied to each group can be determined, and different filtering can be performed for each group. Information on whether to apply ALF can be signaled by the coding unit (CU), and the form and coefficients of the adaptive loop filter to be applied to each block may be different.

[0090] In luma mapping with chroma scaling (LMCS), luma mapping (LM) refers to remapping luma values ​​using a piecewise linear model, and chroma scaling (CS) refers to a technique for scaling the residual values ​​of chroma components according to the average luma value of the prediction signal. Specifically, LMCS can be used as an HDR correction technique that reflects the characteristics of high dynamic range (HDR) images.

[0091] The reconstructed block or the reconstructed image that has passed through the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed block that has passed through the filter unit 180 may be part of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed block that has passed through the filter unit 180. The stored reference image may be subsequently used for inter-frame prediction or motion compensation.

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

[0093] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.

[0094] refer to Figure 2 , the decoding device 200 may include an entropy decoding unit 210, a dequantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 201, a switch 203, a filter unit 260 and a reference picture buffer 270.

[0095] The decoding device 200 can receive the bit stream output from the encoding device 100. The decoding device 200 can receive the bit stream stored in a computer-readable recording medium, or can receive the bit stream streamed via a wired / wireless transmission medium. The decoding device 200 can decode the bit stream in intra-frame mode or inter-frame mode. In addition, the decoding device 200 can generate a reconstructed image generated by decoding or a decoded image, and output the reconstructed image or the decoded image.

[0096] When the prediction mode for decoding is intra mode, the switch 203 may be switched to intra. Alternatively, when the prediction mode for decoding is inter mode, the switch 203 may be switched to inter.

[0097] The decoding device 200 can obtain a reconstructed residual block by decoding the input bitstream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block that becomes the decoding target by adding the reconstructed residual block and the prediction block. The decoding target block can be referred to as the current block.

[0098] The entropy decoding unit 210 may generate symbols by entropy decoding the bit stream according to the probability distribution. The generated symbols may include symbols in the form of quantization levels. In this article, the entropy decoding method may be the inverse process of the above entropy encoding method.

[0099] The entropy decoding unit 210 may change the coefficients of the one-dimensional vector shape into coefficients of the two-dimensional block shape through a transform coefficient scanning method to decode the transform coefficient level (quantization level).

[0100] The quantization level may be dequantized in the dequantization unit 220 or inversely transformed in the inverse transform unit 230. The quantization level may be the result of dequantization and / or inverse transformation and may be generated from the reconstructed residual block. Here, the dequantization unit 220 may apply a quantization matrix to the quantization level. The dequantization unit 220 and the inverse transform unit 230 applied to the decoding device may apply the same technology as the dequantization unit 160 and the inverse transform unit 170 applied to the encoding device described above.

[0101] When intra mode is used, the intra prediction unit 240 can generate a prediction block by performing spatial prediction on the current block using sample values ​​of blocks decoded around the decoding target block. The intra prediction unit 240 applied to the decoding device can apply the same technology as the intra prediction unit 120 applied to the above-mentioned encoding device.

[0102] When the inter-frame mode is used, the motion compensation unit 250 can generate a prediction block by performing motion compensation on the current block using the motion vector and the reference image stored in the reference picture buffer 270. When the value of the motion vector is not an integer value, the motion compensation unit 250 can generate a prediction block by applying an interpolation filter to a partial area within the reference image. In order to perform motion compensation, it can be determined based on the coding unit whether the motion compensation method of the prediction unit included in the corresponding coding unit is skip mode, merge mode, AMVP mode, or current picture reference mode, and motion compensation can be performed according to each mode. The motion compensation unit 250 applied to the decoding device can apply the same technology as the motion compensation unit 122 applied to the above-mentioned encoding device.

[0103] The adder 201 can generate a reconstructed block by adding the reconstructed residual block and the prediction block. The filter unit 260 can apply at least one of inverse LMCS, deblocking filter, sample adaptive offset, and adaptive loop filter to the reconstructed block or reconstructed image. The filter unit 260 applied to the decoding device can apply the same filtering technology as the filtering technology applied to the filter unit 180 of the encoding device described above.

[0104] The filter unit 260 may output a reconstructed image. The reconstructed block or image may be stored in the reference picture buffer 270 and used for inter-frame prediction. The reconstructed block that has passed through the filter unit 260 may be part of a reference image. That is, the reference image may be a reconstructed image composed of the reconstructed blocks that have passed through the filter unit 260. The stored reference image may then be used for inter-frame prediction or motion compensation.

[0105] Figure 3 FIG. 1 is a diagram schematically illustrating a video encoding system to which the present invention is applicable.

[0106] The video encoding system according to the 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 in the form of a file or stream via a digital storage medium or a network.

[0107] The encoding device 10 according to the embodiment may include a video source generation unit 11, an encoding unit 12, and a transmission unit 13. The decoding device 20 according to the embodiment may include a reception unit 21, a decoding unit 22, and a rendering unit 23. The encoding unit 12 may be referred to as a video / image encoding unit, and the decoding unit 22 may be referred to as a video / image decoding unit. The transmission unit 13 may be included in the encoding unit 12. The reception 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 configured as a separate device or an external component.

[0108] The video source generation unit 11 can obtain a video / image by capturing, synthesizing, or generating a 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 including previously captured videos / images, etc. The video / image generation device may include, for example, a computer, a tablet computer, a smartphone, etc., and may (electronically) generate the video / image. For example, a virtual video / image may be generated by a computer, etc. In this case, the video / image capture process may be replaced by a process for generating relevant data.

[0109] The encoding unit 12 can encode the input video / image. The encoding unit 12 can perform a series of processes such as prediction, transformation and quantization to improve compression and encoding efficiency. The encoding unit 12 can output encoded data (encoded video / image information) in the form of a bit stream. The detailed configuration of the encoding unit 12 can also be configured as described above. Figure 1 The encoding device 100 is performed in the same manner.

[0110] The transmitting unit 13 can transmit the encoded video / image information or data output in the form of a bitstream to the receiving unit 21 of the decoding device 20 in the form of a file or streaming via a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit 13 may include components for generating a media file in a predetermined file format and may include components for transmitting via a broadcast / communication network. The receiving unit 21 extracts / receives the bitstream from the storage medium or the network and transmits the bitstream to the decoding unit 22.

[0111] The decoding unit 22 can decode the video / image by performing a series of processes corresponding to the operations of the encoding unit 12, such as dequantization, inverse transformation, and prediction. The detailed configuration of the decoding unit 22 can also be configured as described above. Figure 2 The decoding device 200 is performed in the same manner.

[0112] The rendering unit 23 may render the decoded video / image. The rendered video / image may be displayed by the display unit.

[0113] The method for predicting the sign of the coefficient may be a method for predicting the sign of the residual coefficient based on discontinuity between reconstructed samples located at the upper and left boundaries of the current block and reconstructed samples of blocks above and to the left of the current block. In this article, the discontinuity between the reconstructed samples at the upper and left boundaries of the current block and the reconstructed samples of blocks above and to the left of the current block may be measured by a cost function.

[0114] The technique of predicting the sign of a coefficient may use, as a prediction value, a sign that minimizes a cost function among all possible combinations of negative signs and positive signs in residual coefficients to which coefficient sign prediction is applicable.

[0115] In the following, reference Figures 4 to 8 , a method for predicting coefficient signs according to an embodiment of the present invention will be described in detail.

[0116] Figure 4is a diagram for describing a cost function of a method for predicting a coefficient sign according to an embodiment of the present invention.

[0117] refer to Figure 4 , the coefficient sign of the residual coefficient may be determined based on discontinuity between samples 420 adjacent to the current block 410 among reconstructed samples of blocks adjacent to the top and left of the current block 410 and at least some of the reconstructed samples 430 at the upper boundary and the left boundary of the current block 410. Herein, at least some of the reconstructed samples 430 located at the upper boundary and the left boundary of the current block may be referred to as sign candidate samples.

[0118] A cost function for measuring discontinuity between samples 420 adjacent to the current block and symbol candidate samples may be defined as shown in the following formula.

[0119] [Formula 1]

[0120]

[0121] Here, R x,1 may refer to the reconstructed samples in the top row of the current block 410, and R 1,y May refer to the reconstructed samples in the left column of the current block 410. R x,0 Refers to the reconstructed samples of the block adjacent to the top of the current block located at R x,1 The sample at the top. In addition, R x,-1 Refers to the reconstructed samples of the block adjacent to the top of the current block located at R x,0 Sample from the top.

[0122] In addition, R 0,y Refers to the reconstructed samples of the block adjacent to the left of the current block located at R 1,y In addition, R -1,y Refers to the reconstructed samples of the block adjacent to the left of the current block located at R 0,y Sample on the left.

[0123] x and y may indicate the horizontal and vertical coordinates of the sample, and w and h may indicate the width and height of the current block, respectively.

[0124] By replacing the reconstructed sample R of the current block 410 in Formula 1 with the sum of the predicted value P and the residual value r x,1 and R 1,y , the cost function can be defined as shown in the following formula.

[0125] [Formula 2]

[0126]

[0127] With the transformed cost function shown in Formula 2, the term (-R x,-1 +2R x,0 -R x,1 ) and (-R -1,y +2R 0,y -R 1,y ). Therefore, the complexity of coefficient sign prediction can be reduced.

[0128] A flag indicating whether the sign of the residual coefficient predicted based on the cost function is identical to the actual sign of the residual coefficient may be generated. The flag indicating whether the sign of the predicted residual coefficient is identical to the actual sign of the residual coefficient may be encoded as a bit of context encoding.

[0129] Coefficient sign prediction can be performed in the upper left SPAreaW×SPAreaH area of ​​the current block and / or the current transform block. The upper left SPAreaW×SPAreaH area where coefficient sign prediction is performed can be defined as a sign prediction area or a coefficient sign prediction area. In addition, coefficient sign prediction can be performed only on NumSPCoeff residual coefficients stored in descending order of quantization index (qIdx). Here, SPAreaW, SPAreaH and NumSPCoeff are arbitrary positive integers and can respectively indicate the width, height, and number of coefficients to which coefficient sign prediction is to be applied (i.e., the number of target coefficients, i.e., the coefficients corresponding to the coefficient sign prediction target) of the coefficient sign prediction area. As the quantization index (qIdx) is larger, the absolute value of the actual coefficient may also be larger.

[0130] In the case of dependent quantization using two quantizers, the quantization index qIdx can be calculated as follows to compensate for the influence of multiple quantizers.

[0131] [Formula 3]

[0132] qIdx = (|level|<<1) - (state & 1)

[0133] Here, level can indicate the level value of the coefficient sent from the encoder and the level value of the residual coefficient parsed from the bitstream in the decoder. In addition, state can indicate a variable determined to a specific value, which is the result of the relevant quantization / dequantization performed in the encoder and decoder.

[0134] As shown in Table 1, SPAreaW and SPAreaH indicating a coefficient sign prediction area may be set based on one or more pieces of surrounding information such as an encoding environment configuration, resolution of an image, intra prediction mode / inter prediction mode, and a quantization parameter (QP).

[0135] [Table 1]

[0136]

[0137]

[0138] Information about SPAreaW and SPAreaH set based on the definition in Table 1 can be signaled through a higher layer such as a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, and a picture header. The decoder can perform a decoding operation by using the signaled information about SPAreaW and SPAreaH.

[0139] Additionally, SPAreaW and SPAreaH indicating the coefficient sign prediction area may be updated using the width TbW and height TbH of the current block and / or the transform block according to the following formula.

[0140] [Formula 4]

[0141] SPAreaW=min(TbW,SPAreaW)

[0142] [Formula 5]

[0143] SPAreaH=min(TbH,SPAreaH)

[0144] NumSPCoeff indicates the number of coefficients corresponding to the coefficient sign prediction target (i.e., the number of target coefficients) and can be determined as an arbitrary value in the encoder and / or decoder. Alternatively, the number of target coefficients NumSPCoeff can be signaled in the encoder through an upper layer such as a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, and a picture header. The decoder can perform a decoding operation by using the signaled information about NumSPCoeff.

[0145] NumSPCoeff indicates the number of target coefficients corresponding to the coefficient sign prediction target, and NumSPCoeff may be updated based on the number of non-zero coefficients in the current block and / or the transform block according to the following formula.

[0146] [Formula 6]

[0147] NumSPCoeff=min(NumSPCoeff,TbNumNzCoeff)

[0148] Here, TbNumNzCoeff may indicate the number of non-zero coefficients in the current block and / or the transform block.

[0149] According to an embodiment of the present invention, coefficient sign prediction may be performed by determining a coefficient sign prediction region for a block to which various transforms are applied. According to an embodiment of the present invention, a coefficient sign prediction region may be determined based on a transform type.

[0150] In the transform step of the video encoding process, various transform methods can be applied to the current block, such as a separate primary transform, a combination of a separate primary transform and a non-separate secondary transform, and a non-separate primary transform. In this article, in order to reduce computational complexity and memory usage, zeroing can be applied to transform some coefficients of the current block to 0. When a separate primary transform is applied to a transform block with a side length of 32 in the horizontal and vertical directions, only the transform coefficients in the 16 columns and 16 rows starting from the (0, 0) position are retained, and all other coefficients can be transformed to 0. For example, for a 32×32 transform block in which a separate primary transform is applied in the horizontal and vertical directions, only the transform coefficients in the upper left 16×16 area starting from the (0, 0) position are retained, and all other coefficients can be transformed to 0. Therefore, the 16×16 area located at the upper left corner of the transform block can be defined as a valid area after zeroing.

[0151] As another example, for a 32×8 transform block to which separate primary transforms are applied in the horizontal and vertical directions, only transform coefficients within a 16×8 region on the left starting from the (0, 0) position are retained, and all other coefficients may be transformed to 0. Therefore, the 16×8 region on the left side of the transform block may be defined as a valid region after zeroing.

[0152] In addition, when transform is applied in the horizontal and vertical directions to a transform block having a side length of 64, only transform coefficients in 32 columns and 32 rows starting from the (0, 0) position are retained, and all other coefficients may be transformed to 0. For example, for a 64×64 transform block in which transform is applied in the horizontal and vertical directions, only transform coefficients in a 32×32 area in the upper left starting from the (0, 0) position are retained, and all other coefficients may be transformed to 0. Therefore, the 32×32 area located at the upper left corner of the transform block may be defined as a valid area after zeroing.

[0153] As another example, for a 64×16 transform block to which separate primary transforms are applied in the horizontal and vertical directions, only transform coefficients within a 32×16 region on the left starting from the (0, 0) position are retained, and all other coefficients may be transformed to 0. Therefore, the 32×16 region on the left side of the transform block may be defined as a valid region after zeroing.

[0154] Unlike existing transform methods, the non-separate primary transform (NSPT) is a technique that applies a non-separate transform to the primary transform. During the non-separate primary transform, zeroing can also be performed to reduce computational complexity and memory usage. The implementation of the non-separate primary transform can be described as follows.

[0155] Figure 5 is a diagram for describing a non-separate primary transform applied to each block size according to an embodiment of the present invention.

[0156] refer to Figure 5 , for blocks with a width or height of 4 and a size equal to or less than 4×16 and 16×4, a non-separate primary transform corresponding to the block size may be applied. On the other hand, for blocks with a width or height of 4 and a size exceeding 4×16 and 16×4, a DCT-11 transform and LFNST4 (which is a non-separate secondary transform) may be applied. That is, for blocks with a width or height of 4 and a size exceeding 4×16 and 16×4, a non-separate primary transform may not be applied.

[0157] In addition, for blocks with a width or height of 8 and a size equal to or less than 8×16 and 16×8, a non-separable primary transform corresponding to the block size may be applied. On the other hand, for blocks with a width or height of 8 and a size exceeding 8×16 and 16×8, a DCT-11 transform and LFNST8 (which is a non-separable secondary transform) may be applied. That is, for blocks with a width or height of 8 and a size exceeding 8×16 and 16×8, a non-separable primary transform may not be applied.

[0158] The size of the non-separating primary transform kernel applied according to each block size, the number of transform coefficients to be zeroed, and the number of residual coefficients after zeroing may be as described in Table 2.

[0159] [Table 2]

[0160]

[0161] The non-separate transform and the zeroing during the non-separate transform can be performed as follows.

[0162] Figure 6 is a diagram for describing a zeroing method in a non-separating transform according to an embodiment of the present invention.

[0163] refer to Figure 6, the transform coefficients of the input block that has undergone non-separable transform can be scanned in a predetermined direction and rearranged into a one-dimensional vector of a 1×M shape. In this article, the predetermined direction can be one of a row-first direction, a column-first direction, and a diagonal direction. In this article, M can be the product of the width and height of the input block for transform (i.e., TbW×TbH). Alternatively, M can be the product of the width and height of a predetermined region of interest (ROI) within the transform block.

[0164] An M×N transform kernel can be applied to the rearranged 1×M vector. Herein, N can be a positive integer equal to or less than M. If N is greater than M, the high-frequency transform coefficients can be reset to zero. As a result of the transform, a one-dimensional vector of a 1×N shape can be output.

[0165] The one-dimensional vector of the 1×N shape generated as a result of the transformation can be scanned again in a predetermined direction on a block basis or on a coefficient group (CG) basis and rearranged into a two-dimensional form. In this article, the predetermined direction can be one of a row-first direction, a column-first direction, and a diagonal direction.

[0166] Figure 6 The following illustrates the case where zeroing is performed in a non-separate transform. As a result of performing zeroing in a non-separate transform, certain regions of the block may have zero or non-zero transform coefficients, relative to the (0, 0) position of the block. On the other hand, all transform coefficients in the remaining regions may be zero. In this document, regions with non-zero transform coefficients may be referred to as valid regions.

[0167] Figure 7 is a diagram for describing an embodiment of a transform block to which a non-separate primary transform is applied according to an embodiment of the present invention.

[0168] refer to Figure 7 , the size of the transform block can be 8×8. When a non-separate primary transform is performed on a transform block of size 8×8, the transform coefficients of the 8×8 transform block can be scanned in a predetermined direction and rearranged into a 1×64 vector. In addition, a 64×32 transform kernel can be applied to the rearranged 1×64 vector. The 1×32 vector obtained as a result of performing the transform can be a residual transform coefficient. The 1×32 vector obtained as a result of performing the transform can be scanned in a predetermined direction and rearranged into a two-dimensional form. As a result, the non-zero transform coefficients can be rearranged in a region of size 4×8 within the 8×8 transform block, and residual coding can be performed. Therefore, the region of size 4×8 where the non-zero transform coefficients exist can be a valid area.

[0169] According to an embodiment of the present invention, the coefficient symbol prediction region can be determined according to the transform type. When a separate transform is applied to the current block, the coefficient symbol prediction region of the block can be determined as W S ×H S Alternatively, when both the separate transform and the non-separate transform are applied to the current block, the coefficient sign prediction region of the block may be determined as W SN ×H SN When a non-separate transform is applied to the current block, the coefficient sign prediction region of the block can be determined as W N ×H N .

[0170] According to an embodiment, W indicating the size of the coefficient sign prediction area S 、H S 、W SN 、H SN 、W N and H N Can be any positive integer.

[0171] According to another embodiment, W indicating the size of the coefficient sign prediction area S 、H S 、W SN 、H SN 、W N and H N It can be set based on one or more pieces of surrounding information such as the encoding environment configuration, the category of the image, the resolution of the image, the intra prediction mode / inter prediction mode, and the quantization parameter (QP).

[0172] According to yet another embodiment, W indicating the size of the coefficient sign prediction area S 、H S 、W SN 、H SN 、W N and H N It can be independently signaled in the encoder through upper layers such as sequence parameter set (SPS), picture parameter set (PPS), slice header, and picture header.

[0173] According to yet another embodiment, W indicating the size of the coefficient symbol prediction area defined according to the transform type applied to the block S 、H S 、W SN 、H SN 、W N and H N The signaling may depend on information indicating the size of the coefficient symbol prediction region for a particular transform type.

[0174] According to yet another embodiment, W indicating the size of the coefficient symbol prediction area may be determined based on an index indicating a combination used in the current block among combinations defined according to the transform type. S 、H S 、W SN 、H SN 、W N and H N Herein, the transform type may be determined by transform-related syntax elements including a block size and / or a transform flag, a transform index, and the like.

[0175] According to an embodiment, the size of the coefficient sign prediction area SPAreaW×SPAreaH may be updated according to the following formula.

[0176] [Formula 7]

[0177] SPAreaW=min(W X ,TbW)

[0178] [Formula 8]

[0179] SPAreaH=min(H X ,TbH)

[0180] Here, TbW may indicate the width of the transform block, and TbH may indicate the height of the transform block. That is, the size of the coefficient symbol prediction area SPAreaW may be updated to W x and the width TbW of the transform block, and SPAreaH can be updated to H x and the height TbH of the transform block. Herein, the subscript X may be S for a block to which a separate transform is applied, SN for a block to which a separate transform and a non-separate transform are applied, and N for a block to which a non-separate transform is applied.

[0181] According to another embodiment, the size of the coefficient sign prediction area SPAreaW×SPAreaH may be updated according to the following formula.

[0182] [Formula 9]

[0183] SPAreaW=min(W X ,ZoTbW)

[0184] [Formula 10]

[0185] SPAreaH=min(H X ,ZoTbH)

[0186] That is, the size of the coefficient sign prediction area SPAreaW can be updated to W xand the width of the valid area ZoTbW, and SPAreaH can be updated to H x and the height of the effective area ZoTbH, whichever is smaller. Herein, the subscript X may be S for a block to which a separate transform is applied, SN for a block to which a separate transform and a non-separate transform are applied, and N for a block to which a non-separate transform is applied.

[0187] According to an embodiment of the present invention, the coefficient symbol prediction region for the current block can be adaptively set according to the various transform types applied to the current block. Furthermore, by updating the size of the coefficient symbol prediction region using the width or height of the transform block or the width or height of the valid region after zeroing, the coefficient symbol prediction region can be determined more efficiently. Furthermore, by determining the coefficient symbol prediction region based on the valid region, unnecessary coefficient scanning can be avoided, and encoding complexity can be reduced.

[0188] According to an embodiment of the present invention, the number of coefficients corresponding to the coefficient sign prediction target can be determined according to the transform type. When a separate transform is applied to the current block, the number of target coefficients can be determined as N s Alternatively, when both the separate transform and the non-separate transform are applied to the current block, the number of target coefficients may be determined as N SN When a non-separate transform is applied to the current block, the number of target coefficients may be determined as N N .

[0189] According to an embodiment, N indicating the number of target coefficients s 、N SN and N N Can be any positive integer.

[0190] According to another embodiment, N indicating the number of target coefficients may be set based on one or more pieces of surrounding information such as encoding environment configuration, category of picture, resolution of picture, intra prediction mode / inter prediction mode, and quantization parameter (QP). s 、N SN and N N .

[0191] According to yet another embodiment, N indicating the number of target coefficients s 、N SN and N N It can be independently signaled in the encoder through upper layers such as sequence parameter set (SPS), picture parameter set (PPS), slice header, and picture header.

[0192] According to yet another embodiment, N indicates the number of target coefficients defined according to the transform type applied to the block. s 、NSN and N N The signaling may depend on information indicating the number of target coefficients for a particular transform type.

[0193] According to yet another embodiment, N indicating the number of target coefficients may be determined based on an index indicating a combination used in the current block among combinations defined according to the transform type. s 、N SN and N N Herein, the transform type may be determined by transform-related syntax elements including a block size and / or a transform flag, a transform index, and the like.

[0194] According to an embodiment, the number of target coefficients NumSPCoeff may be updated according to the following formula.

[0195] [Formula 11]

[0196] NumSPCoeff=min(N X ,TbNumNzCoeff)

[0197] Here, TbNumNzCoeff may indicate the number of non-zero coefficients in the transform block. That is, the number of target coefficients NumSPCoeff may be updated to N x and the smaller value of TbNumNzCoeff. Herein, the subscript X may be S for a block to which a separate transform is applied, SN for a block to which a separate transform and a non-separate transform are applied, and N for a block to which a non-separate transform is applied.

[0198] According to another embodiment, the number of target coefficients NumSPCoeff may be updated according to the following formula.

[0199] [Formula 12]

[0200] NumSPCoeff=min(N X ,SPNumNzCoeff)

[0201] Here, SPNumNzCoeff may indicate the number of non-zero coefficients within the determined coefficient sign prediction region. That is, the number of target coefficients NumSPCoeff may be updated to N x and the smaller value of SPNumNzCoeff. Herein, the subscript X may be S for a block to which a separate transform is applied, SN for a block to which a separate transform and a non-separate transform are applied, and N for a block to which a non-separate transform is applied.

[0202] According to yet another embodiment, the number of target coefficients NumSPCoeff may be updated according to the following formula.

[0203] [Formula 13]

[0204] NumSPCoeff=min(N X ,ZoNumNzCoeff)

[0205] Here, ZoNumNzCoeff may indicate the number of non-zero coefficients in the effective area after zeroing. That is, the number of target coefficients NumSPCoeff may be updated to N x and the smaller value of ZoNumNzCoeff. Herein, the subscript X may be S for a block to which a separate transform is applied, SN for a block to which a separate transform and a non-separate transform are applied, and N for a block to which a non-separate transform is applied.

[0206] According to an embodiment of the present invention, the number of coefficients corresponding to the coefficient sign prediction target can be adaptively set according to the various transform types applied to the current block. In addition, by using the number of non-zero coefficients in the transform block, the coefficient sign prediction area, or the valid area after zeroing, the number of target coefficients for which coefficient sign prediction can be effectively performed can be determined. Therefore, the complexity of encoding and / or decoding can be reduced.

[0207] In addition, according to the existing coefficient sign prediction method, pixels are reconfigured based on each possible combination of the negative sign and the positive sign of each coefficient, and the combination that minimizes the cost function is selected. On the other hand, according to the embodiment of the present invention, since the number of coefficient sign prediction target coefficients is adaptively determined, not only the complexity of encoding and / or decoding can be reduced, but also memory usage can be reduced.

[0208] Figure 8 is a flowchart illustrating a method for decoding an image according to an embodiment of the present invention. Figure 8 The image decoding method can be performed by an image decoding device.

[0209] A transform type of a current block may be determined ( S810 ).

[0210] Based on the transform type, a coefficient sign prediction target of the current block may be determined (S820).

[0211] In addition, the sign of the coefficient corresponding to the coefficient sign prediction target may be predicted (S830).

[0212] Herein, the coefficient sign prediction target may be specified as a coefficient sign prediction region or the number of coefficients corresponding to the coefficient sign prediction target.

[0213] Herein, the transform type of the current block may indicate any one of separate transform, non-separate transform, and a combination of separate transform and non-separate transform.

[0214] Herein, the coefficient corresponding to the coefficient sign prediction target may be a coefficient located within a coefficient sign prediction area.

[0215] Herein, the size of the coefficient symbol prediction region of the current block may be determined based on the transform type of the current block.

[0216] Herein, the size of the coefficient symbol prediction region of the current block may be determined based on a comparison result between the size of the current block and the size of the coefficient symbol prediction region determined based on the transform type of the current block.

[0217] In this article, the size of the coefficient symbol prediction area of ​​the current block can be determined based on a comparison result between the size of the valid area and the size of the coefficient symbol prediction area determined based on the transform type of the current block, where the valid area is an area within the current block including non-zero coefficients.

[0218] The method for determining the size of the coefficient sign prediction area of ​​the current block is described in Formula 7 to Formula 10 and related explanations.

[0219] Herein, the number of coefficients corresponding to the coefficient sign prediction target may be determined based on the transform type of the current block.

[0220] Herein, the number of coefficients corresponding to the coefficient sign prediction target may be determined based on a comparison result between the number of non-zero coefficients of the current block and the number of coefficients corresponding to the coefficient sign prediction target determined based on a transform type of the current block.

[0221] Herein, the number of coefficients corresponding to the coefficient sign prediction target may be determined based on a comparison result between the number of non-zero coefficients included in a valid area within the current block and the number of coefficients corresponding to the coefficient sign prediction target determined based on a transform type of the current block.

[0222] Herein, the number of coefficients corresponding to the coefficient sign prediction target may be determined based on a comparison result between the number of non-zero coefficients included in the coefficient sign prediction region and the number of coefficients corresponding to the coefficient sign prediction target determined based on a transform type of the current block. Herein, the coefficient sign prediction region may be determined based on a transform type of the current block.

[0223] The method for determining the number of coefficients corresponding to the coefficient sign prediction target is as described in Formula 11 to Formula 13 and related explanations.

[0224] at the same time, Figure 8The steps described in the above can be performed in the same manner in the image coding method. Figure 8 The image encoding method according to the steps described in the above embodiment generates a bit stream. The bit stream can be stored in a non-transitory computer-readable recording medium and can also be transmitted (or streamed).

[0225] Figure 9 The content streaming system to which the embodiments of the present invention are applicable is exemplarily shown.

[0226] like Figure 9 As shown, the content streaming media system to which the embodiment of the present invention is applied may mainly include an encoding server, a streaming media server, a web server, a media storage, a user device, and a multimedia input device.

[0227] The encoding server compresses the content received from the multimedia input device (such as a smart phone, camera, CCTV, etc.) into digital data to generate a bitstream and sends it to the streaming server. As another example, if the multimedia input device (such as a smart phone, camera, CCTV, etc.) directly generates the bitstream, the encoding server can be omitted.

[0228] A bitstream may be generated by applying the image encoding method and / or the image encoding apparatus according to the embodiment of the present invention, and the streaming server may temporarily store the bitstream during the process of transmitting or receiving the bitstream.

[0229] The streaming server sends multimedia data to the user device via the web server based on the user's request, and the web server can act as an intermediary to inform the user of any available services. When the user requests the required service from the web server, the web server sends it to the streaming server, and the streaming server can send the multimedia data to the user. In this case, the content streaming system can include a separate control server, and in this case, the control server can control the commands / responses between the devices in the content streaming system.

[0230] The streaming server can receive content from a media storage and / or encoding server. For example, when receiving content from an encoding server, the content can be received in real time. In this case, in order to provide a smooth streaming service, the streaming server can store the bitstream for a period of time.

[0231] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, touchpad PCs, tablet PCs, ultrabooks, wearable devices (e.g., smart watches, smart glasses, HMDs), digital TVs, desktop computers, digital signage, etc.

[0232] Each server in the above-described content streaming system may operate as a distributed server, in which case data received from each server may be distributed and processed.

[0233] The above embodiments may be performed in the same or corresponding manner in an encoding device and a decoding device. In addition, an image may be encoded / decoded using at least one embodiment or a combination of at least one embodiment among the above embodiments.

[0234] The order of applying the above embodiments may be different in the encoding device and the decoding device. Alternatively, the order of applying the above embodiments may be the same in the encoding device and the decoding device.

[0235] The above-described embodiments may be performed for each of the luminance signal and the chrominance signal. Alternatively, the above-described embodiments for the luminance signal and the chrominance signal may be performed identically.

[0236] In the above embodiments, the method is described based on a flowchart having a series of steps or units, but the present invention is not limited to the order of the steps, and some steps can be performed simultaneously with other steps or in a different order. In addition, it should be understood by those skilled in the art that the steps in the flowchart are not mutually exclusive, and other steps can be added to the flowchart or some steps can be deleted from the flowchart without affecting the scope of the present invention.

[0237] The embodiments may be implemented in the form of program instructions that can be executed by various computer components and may be recorded in a computer-readable recording medium. The computer-readable recording medium may include independent program instructions, data files, data structures, etc., or a combination of program instructions, data files, data structures, etc. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention, or may be well known to those skilled in the art in the field of computer software technology.

[0238] The bitstream generated by the encoding method according to the above embodiment can be stored in a non-transitory computer-readable recording medium. In addition, the bitstream stored in the non-transitory computer-readable recording medium can be decoded by the decoding method according to the above embodiment.

[0239] Examples of computer-readable recording media include: magnetic recording media such as hard disks, floppy disks, and magnetic tapes; optical data storage media such as CD-ROMs or DVD-ROMs; magneto-optical media such as floppy disks; and hardware devices such as read-only memory (ROM), random access memory (RAM), flash memory, etc., which are specially constructed to store and implement program instructions. Examples of program instructions include not only machine language codes generated by an encoder, but also high-level language codes that can be implemented by a computer using an interpreter. The hardware device can be configured to be operated by one or more software modules to perform the processing according to the present invention, or vice versa.

[0240] Although the present invention has been described with reference to specific matters such as detailed elements and limited embodiments and drawings, these are provided only to help a more comprehensive understanding of the present invention, and the present invention is not limited to the above embodiments. It will be understood by those skilled in the art that various modifications and changes can be made from the above description.

[0241] Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents should fall within the scope and spirit of the present invention.

[0242] Industrial Applicability

[0243] The present invention can be used in an apparatus for encoding / decoding an image and a recording medium for storing a bit stream.

Claims

1. A method for decoding an image, the method comprising: Determine the transform type of the current block; Determining a coefficient sign prediction target for the current block based on the transform type; as well as predicting the sign of the coefficient corresponding to the coefficient sign prediction target, Herein, the coefficient sign prediction target is specified as a coefficient sign prediction area or the number of coefficients corresponding to the coefficient sign prediction target.

2. The method according to claim 1, wherein The transform type of the current block indicates one of: a separate transform, a non-separate transform, and a combination of a separate transform and a non-separate transform.

3. The method according to claim 1, wherein The coefficient corresponding to the coefficient sign prediction target is a coefficient located within the coefficient sign prediction area.

4. The method according to claim 1, wherein A size of the coefficient sign prediction region of the current block is determined based on the transform type of the current block.

5. The method according to claim 4, wherein The size of the coefficient symbol prediction region of the current block is determined based on a comparison result between the size of the current block and the size of the coefficient symbol prediction region determined based on the transform type of the current block.

6. The method according to claim 4, wherein: The size of the coefficient symbol prediction area of ​​the current block is determined based on a comparison result between the size of the valid area and the size of the coefficient symbol prediction area determined based on the transform type of the current block, wherein the valid area is an area within the current block including non-zero coefficients.

7. The method according to claim 1, wherein The number of coefficients corresponding to the coefficient sign prediction target is determined based on the transform type of the current block.

8. The method according to claim 7, in, The number of coefficients corresponding to the coefficient sign prediction target is determined based on a comparison result between the number of non-zero coefficients in the current block and the number of coefficients corresponding to the coefficient sign prediction target determined based on the transform type of the current block.

9. The method according to claim 7, wherein: The number of coefficients corresponding to the coefficient sign prediction target is determined based on a comparison result between the number of non-zero coefficients included in the valid area within the current block and the number of coefficients corresponding to the coefficient sign prediction target determined based on the transform type of the current block.

10. The method according to claim 7, wherein: determining the number of coefficients corresponding to the coefficient sign prediction target based on a comparison result between the number of non-zero coefficients included in the coefficient sign prediction region and the number of coefficients corresponding to the coefficient sign prediction target determined based on the transform type of the current block, and The coefficient sign prediction area is determined based on the transform type of the current block.

11. A method for encoding an image, the method comprising: Determine the transform type of the current block; Determining a coefficient sign prediction target for the current block based on the transform type; as well as predicting the sign of the coefficient corresponding to the coefficient sign prediction target, Herein, the coefficient sign prediction target is specified as a coefficient sign prediction area or the number of coefficients corresponding to the coefficient sign prediction target.

12. A non-transitory computer-readable recording medium for storing a bit stream generated by a method for encoding an image, in, The method for encoding an image comprises: Determine the transform type of the current block; Determining a coefficient sign prediction target for the current block based on the transform type; and predicting the sign of the coefficient corresponding to the coefficient sign prediction target, Herein, the coefficient sign prediction target is specified as a coefficient sign prediction area or the number of coefficients corresponding to the coefficient sign prediction target.

13. A method for transmitting a bit stream, the method comprising transmitting the bit stream, the bit stream being generated by a method for encoding an image, in, The method for encoding an image comprises: Determine the transform type of the current block; Determining a coefficient sign prediction target for the current block based on the transform type; and predicting the sign of the coefficient corresponding to the coefficient sign prediction target, Herein, the coefficient sign prediction target is specified as a coefficient sign prediction area or the number of coefficients corresponding to the coefficient sign prediction target.