Method for encoding / decoding image and recording medium

By dynamically adjusting the size and shape of the transform coefficient group and adopting a binarization method suitable for large-value transform coefficients, the problem of limited transformation coefficient coding performance in the prior art is solved, and efficient transformation coefficient coding and decoding are achieved.

CN119893094APending Publication Date: 2025-04-25ELECTRONICS & TELECOMM RES INST +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510050047.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-03-11
Filing Date
2019-07-05
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art has performance limitations when encoding transform coefficients, especially when adaptively reflecting the characteristics of transform coefficient distribution within the encoding block and handling the transform coefficient value is large.

Method used

By determining the zeroing area in the current block and partitioning and decoding other areas in units of the transformation coefficient group, the size and shape of the transformation coefficient group are dynamically adjusted to adapt to the characteristics of different coded blocks, and a binarization method suitable for large-value transformation coefficients is adopted.

Benefits of technology

Flexible transformation coefficient grouping and scanning are realized, improving the efficiency of transformation coefficient encoding, especially when processing large-value transformation coefficients, which significantly reduces the computational complexity and storage cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119893094A_ABST
    Figure CN119893094A_ABST
Patent Text Reader

Abstract

The invention discloses a method for encoding / decoding an image and a recording medium. The method for decoding an image comprises the steps of: determining a zeroing region in a current block; dividing a region except the zeroing region in the current block into transformation coefficient group units; and decoding the transformation coefficients in the transformation coefficient group unit.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of an invention patent application with an application date of July 5, 2019, application number 201980047052.5, and invention name “Method and device for image encoding / decoding and a recording medium having a bit stream stored thereon”. Technical Field

[0002] The present invention relates to a method and apparatus for encoding / decoding an image and a recording medium for storing a bit stream. In particular, the present invention relates to an improved transform coefficient encoding / decoding method. Background Art

[0003] Recently, in various application fields, the demand for high-resolution and high-quality images such as high-definition (HD) images and ultra-high-definition (UHD) images has increased. However, compared with conventional image data, image data with higher resolution and quality has an increasing amount of data. Therefore, when image data is transmitted by using a medium such as a conventional wired and wireless broadband network, or when image data is stored by using a conventional storage medium, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data increase, efficient image encoding / decoding technology is required for images with high resolution and high image quality.

[0004] The image compression technology includes various technologies such as an inter-frame prediction technology for predicting pixel values ​​included in a current picture from a previous picture or a subsequent picture of the current picture, an intra-frame prediction technology for predicting pixel values ​​included in the current picture by using pixel information within the current picture, a transform and quantization technology for compressing the energy of a residual signal, an entropy encoding technology for assigning short codes to values ​​with high occurrence frequencies and assigning long codes to values ​​with low occurrence frequencies, etc. These image compression technologies are used to efficiently compress image data for transmission or storage.

[0005] In video encoding / decoding, the residual signal generated by predictive coding is transformed into the frequency domain, and its coefficients are quantized to obtain transform coefficients, and then encoding / decoding is performed on the transform coefficients. In transform coefficient coding, various techniques are used: a transform coefficient grouping technique for determining a coding unit of a transform coefficient; a transform coefficient scanning technique for arranging the coefficients of a transform coefficient group processed in a 2D form into a 1D form; and a transform coefficient binarization and entropy coding technique for binary encoding the coefficient values ​​arranged in one dimension and representing the resulting value as a bit string for final storage and transmission.

[0006] In order to effectively encode the transform coefficients, a transform coefficient grouping and a transform coefficient scanning method that can well reflect the values ​​and distribution characteristics of the generated transform coefficients are required. However, in the prior art, the same scanning method is applied to the transform coefficient groups of fixed sizes and the transform coefficient groups within the coding block, which limits the performance when encoding the transform coefficients.

[0007] In addition, the value of the transform coefficient varies in size according to the quantization parameter and the position of the transform coefficient. However, in the prior art, only a transform coefficient binarization method that is relatively effective when the value of the transform coefficient is small is applied, so that there is a performance limitation when encoding the transform coefficient.

[0008] In the prior art, in order to encode the transform coefficients of the current coding block, the coding block is divided into transform coefficient groups of a fixed size, and the transform coefficient groups generated by the division are transformed using the same scanning method. Since the same scanning method applied to the transform coefficient groups of the same size is applied within one coding block, there is a limitation that the distribution characteristics of the transform coefficients within the coding block cannot be adaptively reflected.

[0009] Depending on the applied quantization parameter and the position of the transform coefficient within the transform block, the magnitude of the value of the generated transform coefficient varies. When the value of the quantization parameter is small due to the characteristics of the image, or when the transform coefficient corresponds to the low-frequency component of the image, the value of the transform coefficient is large. However, in the prior art, the method of binary encoding the transform coefficient mainly considers the case where the value of the transform coefficient is not large. Therefore, a transform coefficient binarization method that can well reflect the case where the value of the transform coefficient is large is needed. Summary of the invention

[0010] Technical issues

[0011] The present invention intends to adaptively and flexibly configure a transform coefficient grouping and a transform coefficient scanning method, wherein the transform coefficient grouping is a unit of transform coefficient encoding.

[0012] In addition, the present invention intends to propose a binarization method that can well represent transform coefficients when the values ​​of the transform coefficients are large, compared with the traditional transform coefficient binarization method.

[0013] Technical Solution

[0014] A method for decoding an image according to the present invention may include: determining a zeroing area within a current block; partitioning an area within the current block except the zeroing area in units of transform coefficient groups; and decoding transform coefficients in units of transform coefficient groups.

[0015] In the method for decoding an image according to the present invention, when determining the zeroing area, when the width or height of the current block is greater than a first predefined size, an area within the current block with a size equal to or greater than the first predefined size is determined as the zeroing area.

[0016] In the method for decoding an image according to the present invention, when determining the zeroing area, the determining step is based on a type of frequency transformation of the current block.

[0017] In the method for decoding an image according to the present invention, when determining the zeroing area, when the type of frequency transform of the current block is DST-7 or DCT-8, an area within the current block with a size equal to or greater than a second predefined size is determined as the zeroing area.

[0018] In the method for decoding an image according to the present invention, when determining the zeroing area, when the frequency transform type of the current block is DCT-2, an area within the current block with a size equal to or greater than a third predefined size is determined as the zeroing area.

[0019] In the method for decoding an image according to the present invention, the size of the transform coefficient group is determined based on the width and height of the current block.

[0020] In the method for decoding an image according to the present invention, when the width or height of the current block is smaller than the fourth predefined size, the size of the transform coefficient group is determined to be a fifth predefined size, and when the width and height of the current block are larger than the fourth predefined size, the size of the transform coefficient group is determined to be a sixth predefined size, wherein the sixth predefined size is larger than the fifth predefined size.

[0021] In the method for decoding an image according to the present invention, when an area of ​​a current block is greater than a predefined area and a shape of the current block is a non-square shape, a shape of a transform coefficient group is determined to be a non-square shape.

[0022] A method for encoding an image according to the present invention may include: determining a zeroing area within a current block; partitioning an area within the current block other than the zeroing area in units of transform coefficient groups; and encoding transform coefficients in units of transform coefficient groups.

[0023] In the method for encoding an image according to the present invention, when determining the zeroing area, when the width or height of the current block is greater than a first predefined size, an area within the current block with a size equal to or greater than the first predefined size is determined as the zeroing area.

[0024] In the method for encoding an image according to the present invention, when determining the zeroing area, the determining step is based on a type of frequency transformation of the current block.

[0025] In the method for encoding an image according to the present invention, when determining the zeroing area, when the type of frequency transform of the current block is DST-7 or DCT-8, an area within the current block with a size equal to or greater than a second predefined size is determined as the zeroing area.

[0026] In the method for encoding an image according to the present invention, when determining the zeroing area, when the frequency transform type of the current block is DCT-2, an area within the current block whose size is equal to or greater than a third predefined size is determined as the zeroing area.

[0027] In the method for encoding an image according to the present invention, the size of the transform coefficient group is determined based on the width and height of the current block.

[0028] In the method for encoding an image according to the present invention, when the width or height of the current block is smaller than the fourth predefined size, the size of the transform coefficient group is determined to be a fifth predefined size, and when the width and height of the current block are larger than the fourth predefined size, the size of the transform coefficient group is determined to be a sixth predefined size, wherein the sixth predefined size is larger than the fifth predefined size.

[0029] In the method for encoding an image according to the present invention, when an area of ​​a current block is greater than a predefined area and a shape of the current block is a non-square shape, a shape of a transform coefficient group is determined to be a non-square shape.

[0030] Beneficial Effects

[0031] The present invention proposes transform coefficient groups of various sizes within a coding block and different scanning methods for each transform coefficient group, enabling highly flexible transform coefficient grouping and transform coefficient scanning, and the present invention proposes an effective binarization method for transform coefficients with large values, enabling very efficient transform coefficient encoding.

[0032] The present invention can reduce the number of transform coefficients that need to be encoded through an effective transform coefficient grouping and scanning method.

[0033] The present invention can perform efficient binarization, in which transform coefficients with larger values ​​are assigned relatively fewer binary bits.

[0034] According to the present invention, the image encoding and decoding efficiency can be improved.

[0035] According to the present invention, the computational complexity of an image encoder and an image decoder can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a block diagram showing a configuration according to an example of an encoding device to which the present invention is applied.

[0037] Figure 2 is a block diagram showing a configuration according to an example of a decoding device to which the present invention is applied.

[0038] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded.

[0039] Figure 4 is a diagram illustrating an example of intra prediction processing.

[0040] Figure 5 is a diagram illustrating an example of inter-frame prediction processing.

[0041] Figure 6 is a diagram illustrating transform and quantization processing.

[0042] Figure 7 is a diagram showing reference samples that can be used for intra prediction.

[0043] Figure 8 2 is a diagram illustrating filtering performed on boundaries of blocks adjacent to each other according to an embodiment of the present invention.

[0044] Figures 9 to 12 is a diagram showing an example of fixed block transform coefficient grouping according to the present invention.

[0045] Figures 13 to 15 is a diagram showing an example of variable block transform coefficient grouping according to the present invention.

[0046] Fig.16 is a diagram illustrating a method of determining a transform coefficient group based on positions of non-zero transform coefficients within a current block.

[0047] Figures 17 to 20 is a diagram showing how to determine a transform coefficient grouping method based on a width (M) or a height (N) of a current block (M×N).

[0048] Figure 21 to Figure 23 is a diagram illustrating a method of setting a transform coefficient group by using an intra prediction mode and position information of a last non-zero coefficient.

[0049] Fig.24 and Fig.25 is a diagram illustrating a return-to-zero region and a non-return-to-zero region according to an embodiment of the present invention.

[0050] Fig.26 and Fig. 27is a diagram illustrating grouping of transform coefficients in a non-return-to-zero region.

[0051] Fig.28 is a diagram illustrating an example of a fixed transform coefficient scanning method.

[0052] Fig.29 is a diagram showing a transform coefficient presence indicator based on a transform coefficient and a transform coefficient presence indicator based on a transform coefficient group.

[0053] Fig.30 is a diagram showing binarization of transform coefficients based on absolute value comparison.

[0054] Fig.31 is a diagram illustrating binarization of transform coefficients based on exponential scaling comparison.

[0055] Fig.32 is a flowchart illustrating a method of decoding an image according to an embodiment of the present invention. DETAILED DESCRIPTION

[0056] Various modifications may be made to the present invention, and there are various embodiments of the present invention, and examples of various embodiments of the present invention will now be provided and described in detail with reference to the accompanying drawings. However, although the exemplary embodiments may be interpreted as including all modifications, equivalents or alternative forms within the technical concept and technical scope of the present invention, the present invention is not limited thereto. Similar reference numerals refer to the same or similar functions in various aspects. In the accompanying drawings, the shapes and sizes of the elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that illustrate specific embodiments in which the present invention may be implemented by way of illustration. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, without departing from the spirit and scope of the present disclosure, the specific features, structures and characteristics described herein in conjunction with one embodiment may be implemented in other embodiments. In addition, it should be understood that without departing from the spirit and scope of the present disclosure, the position or arrangement of each element within each disclosed embodiment may be modified. Therefore, the following detailed description should not be understood in a limiting sense, and the scope of the present disclosure is limited only by the appended claims (in the case of appropriate interpretation, together with the full range of equivalent forms claimed by the claims).

[0057] The terms "first", "second", etc. used in the specification may be used to describe various components, but these components are not interpreted as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, the "first" component may be referred to as the "second" component, and the "second" component may also be similarly referred to as the "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.

[0058] It will be understood that, in this specification, when an element is merely referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” the other element, the element may be “directly connected to” or “directly coupled to” the other element, or connected to or coupled to the other element with other elements between the element and the other element. Conversely, it should be understood that when an element is referred to as being “directly coupled to” or “directly coupled to” another element, there are no intervening elements.

[0059] In addition, the components shown in the embodiments of the present invention are shown independently to present characteristic functions different from each other. Therefore, this does not mean that each component is composed of a component unit of separate hardware or software. In other words, for convenience, each component includes each of the enumerated components. Therefore, at least two components in each component can be combined to form a component, or a component can be divided into a plurality of components for performing each function. Without departing from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is divided are also included in the scope of the present invention.

[0060] The terms used in this specification are only used to describe specific embodiments, and are not intended to limit the present invention. Unless the expression used in the singular has a significantly different meaning in the context, it includes plural expressions. In this specification, it will be understood that terms such as "including ... ", "having ... ", etc. are intended to indicate that there are features, quantities, steps, actions, elements, parts, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, quantities, steps, actions, elements, parts, or combinations thereof may exist or may be added. In other words, when a particular element is referred to as "included", the elements other than the corresponding elements are not excluded, but additional elements may be included in embodiments of the present invention or in the scope of the present invention.

[0061] In addition, some components may not be indispensable components for performing the necessary functions of the present invention, but optional components that only improve their performance. The present invention can be implemented by only including the indispensable components for implementing the essence of the present invention and excluding the components used when improving performance. The structure that only includes the indispensable components and excludes the optional components used when only improving performance is also included in the scope of the present invention.

[0062] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing the exemplary embodiments of the present invention, well-known functions or structures may unnecessarily obscure the understanding of the present invention, and therefore they will not be described in detail. The same constituent elements in the accompanying drawings are represented by the same reference numerals, and repeated descriptions of the same elements will be omitted.

[0063] Hereinafter, an image may refer to a picture constituting a video, or may refer to the video itself. For example, “encoding or decoding an image or both encoding and decoding” may refer to “encoding or decoding a moving picture or both encoding and decoding”, and may refer to “encoding or decoding one of the images of the moving picture or both encoding and decoding.”

[0064] Hereinafter, the terms "motion picture" and "video" may be used as the same meaning and may be replaced with each other.

[0065] Hereinafter, a target image may be an encoding target image as a target of encoding and / or a decoding target image as a target of decoding. In addition, a target image may be an input image input to an encoding device, and an input image input to a decoding device. Here, the target image may have the same meaning as the current image.

[0066] Hereinafter, the terms "image", "picture", "frame" and "screen" may be used as the same meaning and replaced with each other.

[0067] Hereinafter, the target block may be an encoding target block as a target of encoding and / or a decoding target block as a target of decoding. In addition, the target block may be a current block as a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used as the same meaning and may be replaced with each other.

[0068] Hereinafter, the terms "block" and "unit" may be used as the same meaning and replaced with each other. Alternatively, a "block" may refer to a specific unit.

[0069] In the following, the terms "region" and "segment" are used interchangeably.

[0070] Hereinafter, a specific signal may be a signal representing a specific block. For example, an original signal may be a signal representing a target block. A prediction signal may be a signal representing a prediction block. A residual signal may be a signal representing a residual block.

[0071] In an embodiment, each of the specific information, data, flags, indexes, elements, attributes, etc. may have a value. The value of the information, data, flags, indexes, elements, and attributes equal to "0" may represent a logical false or a first predefined value. In other words, the value "0", false, logical false, and the first predefined value may be replaced with each other. The value of the information, data, flags, indexes, elements, and attributes equal to "1" may represent a logical true or a second predefined value. In other words, the value "1", true, logical true, and the second predefined value may be replaced with each other.

[0072] When the variable i or j is used to represent a column, row, or index, the value of i may be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, the columns, rows, indexes, etc. may be counted from 0 or 1.

[0073] Description of terms

[0074] Encoder: This refers to a device that performs encoding. In other words, it refers to an encoding device.

[0075] Decoder: Refers to a device that performs decoding. In other words, it refers to a decoding device.

[0076] Block: is an M×N sample array. Here, M and N may represent positive integers, and a block may represent a sample array in a two-dimensional form. A block may refer to a unit. A current block may represent an encoding target block that becomes a target at the time of encoding, or a decoding target block that becomes a target at the time of decoding. In addition, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.

[0077] Sample: It is the basic unit of a block. According to the bit depth (Bd), the sample can be expressed from 0 to 2 Bd In the present invention, a sample point may be used as the meaning of a pixel. That is, a sample point, a pel, and a pixel may have the same meaning as each other.

[0078] Unit: may refer to a coding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. In addition, when a single image is partitioned into sub-division units during encoding or decoding, a unit may represent a sub-division unit. That is, an image may be partitioned into a plurality of units. When encoding and decoding an image, a predetermined process may be performed for each unit. A single unit may be partitioned into sub-units having a size smaller than that of the unit. Depending on the function, a unit may represent a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, and the like. In addition, in order to distinguish a unit from a block, a unit may include a luminance component block, a chrominance component block associated with the luminance component block, and a syntax element for each color component block. A unit may have various sizes and shapes, and specifically, the shape of the unit may be a two-dimensional geometric figure, such as a square shape, a rectangular shape, a trapezoidal shape, a triangular shape, a pentagonal shape, and the like. Also, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transformation unit, etc., and a unit size, a unit depth, an order of encoding and decoding of the unit, and the like.

[0079] Coding tree unit: A single coding tree block configured with a luminance component Y, and two coding tree blocks associated with chrominance components Cb and Cr. In addition, the coding tree unit may represent a syntax element including a block and each block. Each coding tree unit may be partitioned by using at least one of a quadtree partitioning method, a binary tree partitioning method, and a ternary tree partitioning method to configure a lower-level unit such as a coding unit, a prediction unit, a transform unit, etc. The coding tree unit may be used as a term for specifying a sample block that becomes a processing unit when encoding / decoding an image as an input image. Here, the quadtree may represent a quadtree.

[0080] When the size of the coding block is within a predetermined range, it can be divided using only quadtree partitioning. Here, the predetermined range may be defined as at least one of the maximum size and the minimum size of the coding block that can be divided using only quadtree partitioning. Information indicating the maximum / minimum size of the coding block that allows quadtree partitioning may be transmitted by signaling through a bitstream, and the information may be transmitted by signaling in at least one unit of a sequence, a picture parameter, a parallel block group, or a slice (fragment). Optionally, the maximum / minimum size of the coding block may be a fixed size predetermined in the encoder / decoder. For example, when the size of the coding block corresponds to 256×256 to 64×64, it may be divided using only quadtree partitioning. Optionally, when the size of the coding block is larger than the size of the maximum conversion block, it may be divided using only quadtree partitioning. Here, the block to be divided may be at least one of a coding block and a transform block. In this case, the information indicating the division of the coding block (e.g., split_flag) may be a flag indicating whether quadtree partitioning is performed. When the size of the coding block falls within a predetermined range, it may be divided using only binary tree partitioning or ternary tree partitioning. In this case, the above description of the quadtree partition can be applied to the binary tree partition or the ternary tree partition in the same manner.

[0081] Coding tree block: may be used as a term for designating any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

[0082] Neighboring block: may refer to a block adjacent to the current block. The block adjacent to the current block may refer to a block that touches the boundary of the current block or a block that is located within a predetermined distance from the current block. The neighboring block may refer to a block adjacent to a vertex of the current block. Here, the block adjacent to a vertex of the current block may refer to a block that is vertically adjacent to a neighboring block that is horizontally adjacent to the current block or a block that is horizontally adjacent to a neighboring block that is vertically adjacent to the current block.

[0083] Reconstructed neighboring block: may refer to a neighboring block that is adjacent to the current block and has been encoded or decoded in space / time. Here, the reconstructed neighboring block may refer to a reconstructed neighboring unit. The reconstructed spatial neighboring block may be a block that is within the current picture and has been reconstructed by encoding or decoding or both encoding and decoding. The reconstructed temporal neighboring block is a block at a position corresponding to the current block of the current picture within the reference image or a neighboring block of the block.

[0084] Unit depth: can represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) can correspond to the first unit that is not partitioned. In addition, the highest node can have a minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 can represent a unit generated by partitioning the first unit once. A node with a depth of level 2 can represent a unit generated by partitioning the first unit twice. A node with a depth of level n can represent a unit generated by partitioning the first unit n times. A leaf node can be the lowest node and a node that cannot be further partitioned. The depth of a leaf node can be the maximum level. For example, the predefined value of the maximum level can be 3. The depth of the root node can be the lowest, and the depth of the leaf node can be the deepest. In addition, when a unit is represented as a tree structure, the level at which the unit exists can represent the unit depth.

[0085] Bitstream: can represent a stream of bits including coded image information.

[0086] Parameter set: corresponds to header information in the configuration within the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set may be included in the parameter set. In addition, the parameter set may include a slice header, a tile group header, and a tile header information. The term "tile group" may mean a group of tiles and has the same meaning as a slice.

[0087] Parsing: may mean determining the value of a syntax element by performing entropy decoding, or may mean the entropy decoding itself.

[0088] Symbol: At least one of a syntax element, a coding parameter, and a transform coefficient value that can represent a coding / decoding target unit. In addition, the symbol can represent an entropy coding target or an entropy decoding result.

[0089] Prediction mode: may be information indicating a mode of encoding / decoding using intra-frame prediction or a mode of encoding / decoding using inter-frame prediction.

[0090] Prediction unit: may represent a basic unit when performing prediction (such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation). A single prediction unit may be partitioned into multiple partitions of smaller size, or may be partitioned into multiple prediction units of lower levels. Multiple partitions may be basic units when performing prediction or compensation. Partitions generated by splitting a prediction unit may also be prediction units.

[0091] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.

[0092] A reference picture list may refer to a list including one or more reference pictures used for inter prediction or motion compensation. There are several types of available reference picture lists, including LC (List Combination), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3).

[0093] The inter prediction indicator may refer to the direction of inter prediction (unidirectional prediction, bidirectional prediction, etc.) of the current block. Alternatively, the inter prediction indicator may refer to the number of reference pictures used to generate the prediction block of the current block. Alternatively, the inter prediction indicator may refer to the number of prediction blocks used when performing inter prediction or motion compensation on the current block.

[0094] The prediction list utilization flag indicates whether at least one reference picture in a specific reference picture list is used to generate a prediction block. The prediction list utilization flag may be used to derive the inter prediction indicator, and conversely, the inter prediction indicator may be used to derive the prediction list utilization flag. For example, when the prediction list utilization flag has a first value of zero (0), it indicates that the reference picture in the reference picture list is not used to generate the prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it indicates that the reference picture list is used to generate the prediction block.

[0095] The reference picture index may refer to an index indicating a specific reference picture in a reference picture list.

[0096] A reference picture may refer to a reference picture that is referenced by a specific block for the purpose of performing inter-frame prediction or motion compensation on the specific block. Alternatively, a reference picture may be a picture including a reference block that is referenced by a current block for inter-frame prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference image" have the same meaning and may be replaced with each other.

[0097] A motion vector may be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector may represent an offset between a coding / decoding target block and a reference block. For example, (mvX, mvY) may represent a motion vector. Here, mvX may represent a horizontal component, and mvY may represent a vertical component.

[0098] The search range may be a two-dimensional area searched during inter prediction to retrieve a motion vector. For example, the size of the search range may be M×N. Here, M and N are both integers.

[0099] The motion vector candidate may refer to a prediction candidate block or a motion vector of the prediction candidate block when predicting a motion vector. In addition, the motion vector candidate may be included in a motion vector candidate list.

[0100] The motion vector candidate list may mean a list consisting of one or more motion vector candidates.

[0101] The motion vector candidate index may represent an indicator indicating a motion vector candidate in the motion vector candidate list. Alternatively, the motion vector candidate index may be an index of a motion vector predictor.

[0102] The motion information may represent information including at least one of the following items: a motion vector, a reference picture index, an inter prediction indicator, a prediction list utilization flag, a reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.

[0103] The merge candidate list may mean a list consisting of one or more merge candidates.

[0104] The merge candidate may represent a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-predictive merge candidate, or a zero merge candidate. The merge candidate may include motion information such as an inter prediction indicator, a reference picture index for each list, a motion vector, a prediction list utilization flag, and an inter prediction indicator.

[0105] The merge index may represent an indicator indicating a merge candidate in the merge candidate list. Alternatively, the merge index may indicate a block from which the merge candidate is derived in a reconstructed block that is spatially / temporally adjacent to the current block. Alternatively, the merge index may indicate at least one piece of motion information of the merge candidate.

[0106] Transform unit: may represent a basic unit when encoding / decoding (such as transform, inverse transform, quantization, inverse quantization, transform coefficient encoding / decoding) is performed on a residual signal. A single transform unit may be partitioned into a plurality of lower-level transform units having a smaller size. Here, the transform / inverse transform may include at least one of a first transform / first inverse transform and a second transform / second inverse transform.

[0107] Scaling: may refer to the process of multiplying the level of quantization by a factor. Transform coefficients may be generated by scaling the level of quantization. Scaling may also be referred to as inverse quantization.

[0108] Quantization parameter: may represent a value used when a transform coefficient is used to generate a quantized level during quantization. The quantization parameter may also represent a value used when a transform coefficient is generated by scaling the quantized level during inverse quantization. The quantization parameter may be a value mapped on a quantization step size.

[0109] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.

[0110] Scan: may refer to a method of ordering coefficients within a cell, block, or matrix. For example, an operation of changing a two-dimensional matrix of coefficients to a one-dimensional matrix may be called a scan, and an operation of changing a one-dimensional matrix of coefficients to a two-dimensional matrix may be called a scan or an inverse scan.

[0111] Transform coefficient: may refer to a coefficient value generated after performing a transform in an encoder. A transform coefficient may refer to a coefficient value generated after performing at least one of entropy decoding and inverse quantization in a decoder. A quantization level obtained by quantizing a transform coefficient or a residual signal or a quantized transform coefficient level may also fall within the meaning of a transform coefficient.

[0112] Quantization level: may represent a value generated by quantizing a transform coefficient or a residual signal in an encoder. Alternatively, the quantization level may represent a value that is a dequantization target for which dequantization will be performed in a decoder. Similarly, the quantized transform coefficient level as a result of transformation and quantization may also fall within the meaning of the quantization level.

[0113] Non-zero transform coefficient: may refer to a transform coefficient having a value other than zero, or a transform coefficient level or quantization level having a value other than zero.

[0114] Quantization matrix: may refer to a matrix used in a quantization process or an inverse quantization process performed to improve subjective image quality or objective image quality. The quantization matrix may also be referred to as a scaling list.

[0115] Quantization matrix coefficients: can represent each element in the quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.

[0116] Default matrix: may represent a predetermined quantization matrix preliminarily defined in an encoder or decoder.

[0117] Non-default matrix: may represent a quantization matrix that is not initially defined in the encoder or decoder but is signaled by the user.

[0118] Statistical value: The statistical value for at least one of the variables, coding parameters, constant values, etc. having calculable specific values ​​can be one or more of the average value, total value, weighted average value, weighted sum value, minimum value, maximum value, most frequently occurring value, median value, and interpolation value of the corresponding specific value.

[0119] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.

[0120] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include at least one image. The encoding device 100 may sequentially encode at least one image.

[0121] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.

[0122] The encoding device 100 may perform encoding on the input image by using an intra mode or an inter mode or both the intra mode and the inter mode. In addition, the encoding device 100 may generate a bit stream including encoding information by encoding the input image, and output the generated bit stream. The generated bit stream may be stored in a computer-readable recording medium, or may be streamed through a wired / wireless transmission medium. When the intra mode is used as a prediction mode, the switch 115 may be switched to the intra mode. Alternatively, when the inter mode is used as a prediction mode, the switch 115 may be switched to the inter mode. Here, the intra mode may represent an intra prediction mode, and the inter mode may represent an inter prediction mode. The encoding device 100 may generate a prediction block for an input block of the input image. In addition, the encoding device 100 may encode the residual block using the residual of the input block and the prediction block after generating the prediction block. The input image may be referred to as a current image as a current encoding target. The input block may be referred to as a current block as a current encoding target, or may be referred to as an encoding target block.

[0123] When the prediction mode is the intra mode, the intra prediction unit 120 may use samples of a block that has been encoded / decoded and is adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block by using the reference samples, or may generate prediction samples of the input block by performing spatial prediction. Here, intra prediction may refer to prediction within a frame.

[0124] When the prediction mode is the inter-frame mode, the motion prediction unit 111 may retrieve the area that best matches the input block from the reference image when performing motion prediction, and derive a motion vector by using the retrieved area. In this case, the search area may be used as the area. The reference image may be stored in the reference picture buffer 190. Here, when encoding / decoding of the reference image is performed, the reference image may be stored in the reference picture buffer 190.

[0125] The motion compensation unit 112 may generate a prediction block by performing motion compensation on the current block using a motion vector. Here, inter prediction may refer to prediction or motion compensation between frames.

[0126] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial area of ​​a reference picture. In order to perform inter-picture prediction or motion compensation on a coding unit, it may be determined which mode among the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode is used for motion prediction and motion compensation of a prediction unit included in the corresponding coding unit. Then, depending on the determined mode, inter-picture prediction or motion compensation may be performed differently.

[0127] The subtractor 125 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 represent the difference between the original signal and the prediction signal. In addition, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal, or by transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be a residual signal of a block unit.

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

[0129] The quantization level may be generated by applying quantization to a transform coefficient or to a residual signal. Hereinafter, the quantization level may also be referred to as a transform coefficient in an embodiment.

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

[0131] The entropy encoding unit 150 may generate a bit stream by performing entropy encoding on the value calculated by the quantization unit 140 or the encoding parameter value calculated when encoding is performed according to the probability distribution, and output the generated bit stream. The entropy encoding unit 150 may perform entropy encoding on sample information of the image and information for decoding the image. For example, the information for decoding the image may include a syntax element.

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

[0133] In order to encode a transform coefficient level (quantized level), the entropy encoding unit 150 may change a coefficient in a two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.

[0134] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and transmitted to the decoder by signaling, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partition direction (horizontal or vertical), binary tree partition form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, the direction of multi-type tree partitioning direction (horizontal or vertical), type of multi-type tree partitions (symmetric or asymmetric) and tree (binary tree or ternary tree) structure of multi-type tree partitions, prediction mode (intra-frame prediction or inter-frame prediction), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter taps, reference sample filter coefficients, prediction block filtering method, prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, intra-frame prediction mode, frame inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation accuracy of motion vector, transform type, transform size, information on whether primary (first) transform is used, information on whether secondary transform is used, primary transform index, secondary transform index, residual Information on whether a difference signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an in-loop filter, in-loop filter coefficients, in-loop filter taps, in-loop filter shape / form, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether to apply an adaptive sample point offset, adaptive sample point offset value, adaptive sample point offset category, adaptive sample point offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form, binarization / debinarization method,Context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag for unit of coefficient group, position of last valid coefficient, flag on whether the value of coefficient is greater than 1, flag on whether the value of coefficient is greater than 2, flag on whether the value of coefficient is greater than 3, information on remaining coefficient value, positive and negative sign information, reconstructed luminance sample, reconstructed chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, size of motion vector search area on decoder side , the shape of the motion vector search area at the decoder side, the number of motion vector searches at the decoder side, information about the CTU size, information about the minimum block size, information about the maximum block size, information about the maximum block depth, information about the minimum block depth, image display / output order, slice identification information, slice type, slice partition information, parallel block identification information, parallel block type, parallel block partition information, parallel block group identification information, parallel block group type, parallel block group partition information picture type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantization levels, and information about a luminance signal or information about a chrominance signal. ,

[0135] Here, signaling a flag or an index may mean entropy encoding the corresponding flag or index by an encoder and including it in a bitstream, and may mean entropy decoding the corresponding flag or index from the bitstream by a decoder.

[0136] When the encoding apparatus 100 performs encoding by inter-frame prediction, the encoded current image may be used as a reference image for another image that is subsequently processed. Therefore, the encoding apparatus 100 may reconstruct or decode the encoded current image, or store the reconstructed or decoded image as a reference image in the reference picture buffer 190.

[0137] The quantized level may be dequantized in the dequantization unit 160 or may be inversely transformed in the inverse transform unit 170. The dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may be added to the prediction block by the adder 175. A reconstructed block may be generated by adding the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient to the prediction block. Here, the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may mean a coefficient on which at least one of dequantization and inverse transformation is performed, and may mean a reconstructed residual block.

[0138] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed sample, the reconstructed block, or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.

[0139] The deblocking filter can remove block distortion generated in the boundary between blocks. In order to determine whether to apply the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on the samples included in the number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter can be applied according to the required deblocking filter strength.

[0140] In order to compensate for the coding error, a suitable offset value may be added to the sample value by using sample adaptive offset. Sample adaptive offset can correct the offset of the deblocked image and the original image in units of samples. A method of applying the offset in consideration of edge information about each sample may be used, or a method of partitioning the samples of the image into a predetermined number of regions, determining the region to which the offset is applied, and applying the offset to the determined region may be used.

[0141] The adaptive loop filter may perform filtering based on a comparison result of a filtered reconstructed image and an original image. Samples included in an image may be partitioned into predetermined groups, a filter to be applied to each group may be determined, and differential filtering may be performed on each group. Information on whether ALF is applied may be signaled through a coding unit (CU), and the form and coefficient of ALF to be applied to each block may vary.

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

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

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

[0145] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 225, a filter unit 260 and a reference picture buffer 270.

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

[0147] When the prediction mode used in decoding is the intra mode, the switch may be switched to the intra mode. Alternatively, when the prediction mode used in decoding is the inter mode, the switch may be switched to the inter mode.

[0148] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block as a decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as a current block.

[0149] The entropy decoding unit 210 may generate symbols by entropy decoding the bit stream according to the probability distribution. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be an inverse process of the above entropy encoding method.

[0150] In order to decode the transform coefficient levels (quantized levels), the entropy decoding unit 210 may change the coefficients in the form of a one-way vector into a two-dimensional block form by using a transform coefficient scanning method.

[0151] The quantized level may be dequantized in the dequantization unit 220, or the quantized level may be inversely transformed in the inverse transform unit 230. The quantized level may be a result of dequantization or inverse transformation or both, and may be generated as a reconstructed residual block. Here, the dequantization unit 220 may apply a quantization matrix to the quantized level.

[0152] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values ​​of blocks that are adjacent to the decoding target block and have been decoded.

[0153] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270 .

[0154] The adder 225 can generate a reconstructed block by adding the reconstructed residual block to the prediction block. The filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or the reconstructed image. The filter unit 260 can output the reconstructed image. The reconstructed block or the reconstructed image can be stored in the reference picture buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by the filter unit 260 can be a part of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference image can be used later in inter-frame prediction or motion compensation.

[0155] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded. Figure 3 An example of partitioning a single cell into a plurality of lower-level cells is schematically shown.

[0156] In order to efficiently partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing an intra prediction mode from an inter prediction mode when encoding / decoding an image. A coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of a transform coefficient.

[0157] Reference Figure 3 , the image 300 is partitioned sequentially according to the maximum coding unit (LCU), and the LCU unit is determined as a partition structure. Here, the LCU may be used in the same meaning as the coding tree unit (CTU). Unit partitioning may mean partitioning a block associated with the unit. In the block partition information, information about the unit depth may be included. The depth information may indicate the number or degree of the unit being partitioned or both the number and degree of the unit being partitioned. A single unit may be partitioned into a plurality of lower-level units hierarchically associated with the depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning the unit may correspond to a node and a child node of the node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information indicating the size of a CU and may be stored in each CU. The unit depth indicates the number and / or degree associated with partitioning the unit. Therefore, the partition information of the lower-level unit may include information about the size of the lower-level unit.

[0158] The partition structure may indicate the distribution of coding units (CUs) within the LCU 310. Such distribution may be determined according to whether a single CU is partitioned into a plurality of (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal size and vertical size of the CU generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning, respectively, or may have sizes smaller than the horizontal size and vertical size before partitioning according to the number of partitioning. The CU may be recursively partitioned into a plurality of CUs. By recursive partitioning, at least one of the height and width of the CU after partitioning may be reduced compared to at least one of the height and width of the CU before partitioning. The partitioning of the CU may be recursively performed until a predefined depth or a predefined size. For example, the depth of the LCU may be 0, and the depth of the smallest coding unit (SCU) may be a predefined maximum depth. Here, as described above, the LCU may be a coding unit having a maximum coding unit size, and the SCU may be a coding unit having a minimum coding unit size. Partitioning starts from the LCU 310, and as the horizontal size or vertical size or both the horizontal size and the vertical size of the CU decrease through partitioning, the CU depth increases by 1. For example, for each depth, the size of the non-partitioned CU may be 2N×2N. In addition, in the case of a partitioned CU, a CU of size 2N×2N may be partitioned into four CUs of size N×N. As the depth increases by 1, the size of N may be halved.

[0159] In addition, information on whether a CU is partitioned may be indicated by using partition information of the CU. The partition information may be 1-bit information. All CUs except the SCU may include partition information. For example, when the value of the partition information is a first value, the CU may not be partitioned, and when the value of the partition information is a second value, the CU may be partitioned.

[0160] Reference Figure 3 , an LCU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. An SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. A CU with a block of 32×32 and a block of 16×16 may be represented as depth 1 and depth 2, respectively.

[0161] For example, when a single coding unit is partitioned into four coding units, the horizontal size and vertical size of the four coding units partitioned may be half the horizontal size and vertical size of the CU before being partitioned. In one embodiment, when a coding unit of size 32×32 is partitioned into four coding units, the size of each of the four coding units partitioned may be 16×16. When a single coding unit is partitioned into four coding units, it can be said that the coding unit can be partitioned into a quadtree form.

[0162] For example, when one coding unit is partitioned into two sub-coding units, the horizontal size or vertical size (width or height) of each of the two sub-coding units may be half of the horizontal size or vertical size of the original coding unit. For example, when a coding unit of size 32×32 is partitioned vertically into two sub-coding units, each of the two sub-coding units may have a size of 16×32. For example, when a coding unit of size 8×32 is partitioned horizontally into two sub-coding units, each of the two sub-coding units may have a size of 8×16. When one coding unit is partitioned into two sub-coding units, the coding unit may be said to be partitioned into two, or partitioned according to a binary tree partition structure.

[0163] For example, when one coding unit is partitioned into three sub-coding units, the horizontal size or the vertical size of the coding unit may be partitioned in a ratio of 1:2:1, thereby generating three sub-coding units having a ratio of the horizontal size or the vertical size of 1:2:1. For example, when a coding unit having a size of 16×32 is partitioned horizontally into three sub-coding units, the three sub-coding units may have sizes of 16×8, 16×16, and 16×8, respectively, in order from the uppermost sub-coding unit to the lowermost sub-coding unit. For example, when a coding unit having a size of 32×32 is partitioned vertically into three sub-coding units, the three sub-coding units may have sizes of 8×32, 16×32, and 8×32, respectively, in order from the left sub-coding unit to the right sub-coding unit. When one coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned into three sub-coding units or partitioned according to a ternary tree partition structure.

[0164] exist Figure 3 , a coding tree unit (CTU) 320 is an example of a CTU to which a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure are all applied.

[0165] As described above, in order to partition a CTU, at least one of a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure may be applied. Various tree partition structures may be sequentially applied to a CTU according to a predetermined priority order. For example, a quadtree partition structure may be preferentially applied to a CTU. Coding units that can no longer be partitioned using a quadtree partition structure may correspond to leaf nodes of a quadtree. Coding units corresponding to leaf nodes of a quadtree may be used as root nodes of a binary and / or ternary tree partition structure. That is, coding units corresponding to leaf nodes of a quadtree may be further partitioned according to a binary tree partition structure or a ternary tree partition structure, or may not be further partitioned. Therefore, by preventing coding units obtained from binary tree partitions or ternary tree partitions of coding units corresponding to leaf nodes of a quadtree from being further quadtree partitioned, block partitioning operations and / or operations of transmitting partition information with signals may be effectively performed.

[0166] The fact that the coding unit corresponding to the node of the quadtree is partitioned may be signaled using the four partition information. The four partition information having a first value (e.g., '1') may indicate that the current coding unit is partitioned according to the quadtree partition structure. The four partition information having a second value (e.g., '0') may indicate that the current coding unit is not partitioned according to the quadtree partition structure. The four partition information may be a flag having a predetermined length (e.g., one bit).

[0167] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, the coding unit corresponding to the leaf node of the quadtree may be further partitioned by any of the binary tree partitioning and the ternary tree partitioning. In addition, the coding unit generated by the binary tree partitioning or the ternary tree partitioning may be further partitioned by the binary tree partitioning or the ternary tree partitioning, or may not be further partitioned.

[0168] A tree structure in which there is no priority between binary tree partitions and ternary tree partitions is called a multi-type tree structure. A coding unit corresponding to a leaf node of a quadtree may be used as a root node of a multi-type tree. At least one of multi-type tree partition indication information, partition direction information, and partition tree information may be used to signal whether to partition a coding unit corresponding to a node of a multi-type tree. In order to partition a coding unit corresponding to a node of a multi-type tree, multi-type tree partition indication information, partition direction information, and partition tree information may be sequentially signaled.

[0169] The multi-type tree partition indication information having a first value (eg, "1") may indicate that the current coding unit will be subjected to multi-type tree partitioning. The multi-type tree partition indication information having a second value (eg, "0") may indicate that the current coding unit will not be subjected to multi-type tree partitioning.

[0170] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a multi-type tree partition structure, the coding unit may include partition direction information. The partition direction information may indicate in which direction the current coding unit will be partitioned according to the multi-type tree partition. The partition direction information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned vertically. The partition direction information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned horizontally.

[0171] When the coding unit corresponding to the node of the multi-type tree is further partitioned according to the multi-type tree partition structure, the current coding unit may include partition tree information. The partition tree information may indicate a tree partition structure to be used to partition the nodes of the multi-type tree. The partition tree information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to a binary tree partition structure. The partition tree information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to a ternary tree partition structure.

[0172] The partition indication information, the partition tree information and the partition direction information may all be flags having a predetermined length (eg, one bit).

[0173] At least any one of the quadtree partition indication information, the multi-type tree partition indication information, the partition direction information, and the partition tree information may be entropy encoded / decoded. In order to entropy encode / decode those types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, there is a high probability that the partition type (partitioned or not partitioned, partition tree, and / or partition direction) of the left neighboring coding unit and / or the upper neighboring coding unit of the current coding unit is similar to the partition type of the current coding unit. Therefore, context information for entropy encoding / decoding the information about the current coding unit may be derived from the information about the neighboring coding units. The information about the neighboring coding units may include at least any one of the quadtree partition information, the multi-type tree partition indication information, the partition direction information, and the partition tree information.

[0174] As another example, among binary tree partitioning and ternary tree partitioning, binary tree partitioning may be preferentially performed. That is, the current coding unit may be firstly subjected to binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree may be set as the root node for the ternary tree partitioning. In this case, for the coding unit corresponding to the node of the ternary tree, neither quadtree partitioning nor binary tree partitioning may be performed.

[0175] A coding unit that cannot be partitioned according to a quadtree partition structure, a binary tree partition structure, and / or a ternary tree partition structure becomes a basic unit for encoding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Therefore, partition structure information and partition information for partitioning a coding unit into prediction units and / or transformation units may not exist in the bitstream.

[0176] However, when the size of the coding unit (i.e., the basic unit for partitioning) is larger than the size of the maximum transform block, the coding unit may be recursively partitioned until the size of the coding unit is reduced to be equal to or smaller than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and when the size of the maximum transform block is 32×32, the coding unit may be partitioned into four 32×32 blocks for transforming. For example, when the size of the coding unit is 32×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into two 32×32 blocks for transforming. In this case, the partitioning of the coding unit for transforming is not separately signaled, and the partitioning of the coding unit for transforming may be determined by comparison between the horizontal size or vertical size of the coding unit and the horizontal size or vertical size of the maximum transform block. For example, when the horizontal size (width) of the coding unit is larger than the horizontal size (width) of the maximum transform block, the coding unit may be vertically divided into two equal parts. For example, when the vertical size (length) of the coding unit is larger than the vertical size (length) of the maximum transform block, the coding unit may be horizontally divided into two equal parts.

[0177] Information of the maximum and / or minimum size of the coding unit and information of the maximum and / or minimum size of the transform block may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, a sequence level, a picture level, a slice level, a tile group level, a tile block level, etc. For example, the minimum size of the coding unit may be determined as 4×4. For example, the maximum size of the transform block may be determined as 64×64. For example, the minimum size of the transform block may be determined as 4×4.

[0178] Information of the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information of the maximum depth of the multi-type tree from the root node to the leaf node (maximum tree depth of the multi-type tree) may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. Information of the minimum size of the quadtree and / or information of the maximum depth of the multi-type tree may be signaled or determined for each of the intra-picture slice and the inter-picture slice.

[0179] The difference information between the size of the CTU and the maximum size of the transform block may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, a parallel block group level, a parallel block level, etc. Information of the maximum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the maximum size of the binary tree) may be determined based on the size of the coding tree unit and the difference information. The maximum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the maximum size of the ternary tree) may vary depending on the type of the slice. For example, for an intra-picture slice, the maximum size of the ternary tree may be 32×32. For example, for an inter-picture slice, the maximum size of the ternary tree may be 128×128. For example, the minimum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the minimum size of the binary tree) and / or the minimum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the minimum size of the ternary tree) may be set as the minimum size of the coding block.

[0180] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree may be signaled or determined at the slice level. Alternatively, the minimum size of the binary tree and / or the minimum size of the ternary tree may be signaled or determined at the slice level.

[0181] Depending on the size information and depth information of the above-mentioned various blocks, quad partition information, multi-type tree partition indication information, partition tree information and / or partition direction information may be included in the bitstream or may not be included in the bitstream.

[0182] For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not include the quad partition information. Therefore, the quad partition information may be inferred as the second value.

[0183] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is greater than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be transmitted by a signal, but the multi-type tree partition indication information may be inferred as a second value.

[0184] Optionally, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or is twice as large as the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be transmitted by a signal, but the multi-type tree partition indication information may be inferred as a second value. This is because, when the coding unit is partitioned according to the binary tree partition structure and / or the ternary tree partition structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.

[0185] Optionally, the binary tree partition or ternary tree partition may be limited based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when the coding unit is divided into sub-coding units that do not fit into the pipeline buffer size by the binary tree partition or ternary tree partition, the corresponding binary tree partition or ternary tree partition may be limited. The pipeline buffer size may be the size of the maximum transform block (e.g., 64×64). For example, when the pipeline buffer size is 64×64, the following division may be limited.

[0186] - N×M (N and / or M is 128) ternary tree partitions for coding units

[0187] - 128×N (N<=64) binary tree partitions along the horizontal direction for the coding unit

[0188] - N×128 (N<=64) binary tree partitions along the vertical direction for the coding unit

[0189] Optionally, when the depth of the coding unit corresponding to the node of the multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be transmitted by a signal, but the multi-type tree partition indication information may be inferred as a second value.

[0190] Optionally, the multi-type tree partition indication information can be transmitted by signal only when at least one of the vertical binary tree partition, the horizontal binary tree partition, the vertical ternary tree partition, and the horizontal ternary tree partition is feasible for the coding unit corresponding to the node of the multi-type tree. Otherwise, the coding unit may not be partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be transmitted by signal, but the multi-type tree partition indication information may be inferred as the second value.

[0191] Optionally, only when both vertical binary tree partitioning and horizontal binary tree partitioning or both vertical ternary tree partitioning and horizontal ternary tree partitioning are feasible for the coding unit corresponding to the node of the multi-type tree, the partition direction information can be transmitted by signal. Otherwise, the partition direction information may not be transmitted by signal, but the partition direction information may be inferred as a value indicating a possible partition direction.

[0192] Optionally, the partition tree information may be signaled only when both vertical binary tree partitioning and vertical ternary tree partitioning or both horizontal binary tree partitioning and horizontal ternary tree partitioning are feasible for the coding tree corresponding to the node of the multi-type tree. Otherwise, the partition tree information may not be signaled, but the partition tree information may be inferred as a value indicating a possible partition tree structure.

[0193] Figure 4 is a diagram illustrating an intra prediction process.

[0194] Figure 4 The arrows from the center to the outside in may represent the prediction direction of the intra prediction mode.

[0195] Intra-frame encoding and / or decoding may be performed by using reference samples of neighboring blocks of the current block. The neighboring blocks may be reconstructed neighboring blocks. For example, intra-frame encoding and / or decoding may be performed by using encoding parameters or values ​​of reference samples included in the reconstructed neighboring blocks.

[0196] The prediction block may represent a block generated by performing intra prediction. The prediction block may correspond to at least one of a CU, a PU, and a TU. The unit of the prediction block may have a size of one of a CU, a PU, and a TU. The prediction block may be a square block of a size of 2×2, 4×4, 16×16, 32×32, or 64×64, etc., or may be a rectangular block of a size of 2×8, 4×8, 2×16, 4×16, and 8×16, etc.

[0197] Intra-prediction may be performed according to an intra-prediction mode for the current block. The number of intra-prediction modes that the current block may have may be a fixed value, and may be a value determined differently according to properties of the prediction block. For example, the properties of the prediction block may include the size of the prediction block, the shape of the prediction block, and the like.

[0198] Regardless of the block size, the number of intra-frame prediction modes can be fixed to N. Optionally, the number of intra-frame prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65 or 67, etc. Optionally, the number of intra-frame prediction modes can vary according to the block size or the color component type or both the block size and the color component type. For example, the number of intra-frame prediction modes can vary depending on whether the color component is a luminance signal or a chrominance signal. For example, as the block size becomes larger, the number of intra-frame prediction modes can increase. Optionally, the number of intra-frame prediction modes of the luminance component block can be greater than the number of intra-frame prediction modes of the chrominance component block.

[0199] The intra prediction mode may be a non-angle mode or an angle mode. The non-angle mode may be a DC mode or a planar mode, and the angle mode may be a prediction mode having a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of intra prediction modes may be M, which is greater than 1, including non-angle modes and angle modes. In order to perform intra prediction on a current block, a step of determining whether a sample included in a reconstructed neighboring block can be used as a reference sample of the current block may be performed. When there are samples that cannot be used as reference samples of the current block, a value obtained by copying or interpolating at least one sample value of the samples included in the reconstructed neighboring block, or performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, and thus the replaced sample value is used as the reference sample of the current block.

[0200] Figure 7 is a diagram showing reference samples that can be used for intra prediction.

[0201] As in Figure 7 As shown in , at least one of the reference sample line 0 to the reference sample line 3 can be used for intra prediction of the current block. Figure 7 In the example, the samples of fragment A and fragment F may be filled with the samples of the closest fragment B and fragment E, respectively, instead of being retrieved from the reconstructed neighboring blocks. Index information indicating the reference sample line to be used for intra prediction of the current block may be transmitted by signal. When the upper boundary of the current block is the boundary of the CTU, only the reference sample line 0 may be available. Therefore, in this case, the index information may not be transmitted by signal. When a reference sample line other than the reference sample line 0 is used, filtering for the prediction block, which will be described later, may not be performed.

[0202] When intra prediction is performed, a filter may be applied to at least one of a reference sample and a prediction sample based on an intra prediction mode and a current block size.

[0203] In the case of the planar mode, when generating the prediction block of the current block, according to the position of the prediction target sample in the prediction block, the sample value of the prediction target sample may be generated by using the weighted sum of the upper reference sample and the left reference sample of the current block and the upper right reference sample and the lower left reference sample of the current block. In addition, in the case of the DC mode, when generating the prediction block of the current block, the average value of the upper reference sample and the left reference sample of the current block may be used. In addition, in the case of the angular mode, the prediction block may be generated by using the upper reference sample, the left reference sample, the upper right reference sample and / or the lower left reference sample of the current block. In order to generate the prediction sample value, interpolation of real number units may be performed.

[0204] In the case of intra prediction between color components, a prediction block of a second color component of a current block may be generated based on a corresponding reconstruction block of a first color component. For example, the first color component may be a luminance component, and the second color component may be a chrominance component. For intra prediction between color components, parameters of a linear model between the first color component and the second color component may be derived based on a template. The template may include upper adjacent samples and / or left adjacent samples of the current block and upper adjacent samples and / or left adjacent samples of a reconstruction block of the first color component corresponding thereto. For example, the sample value of the first color component with the maximum value among the samples in the template and the sample value of the second color component corresponding thereto, and the sample value of the first color component with the minimum value among the samples in the template and the sample value of the second color component corresponding thereto may be used to derive the parameters of the linear model. When the parameters of the linear model are derived, the corresponding reconstruction block may be applied to the linear model to generate a prediction block of the current block. Depending on the video format, subsampling may be performed on the adjacent samples of the reconstruction block of the first color component and the corresponding reconstruction block. For example, when one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component may be subsampled to calculate one corresponding sample. In this case, parameter derivation of a linear model and intra prediction between color components may be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of a template may be signaled as an intra prediction mode.

[0205] The current block may be partitioned into two or four sub-blocks in the horizontal direction or the vertical direction. The partitioned sub-blocks may be sequentially reconstructed. That is, intra prediction may be performed on the sub-block to generate a sub-prediction block. In addition, inverse quantization and / or inverse transformation may be performed on the sub-block to generate a sub-residual block. The reconstructed sub-block may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block may be used as a reference sample for intra prediction of the sub-sub-block. The sub-block may be a block including a predetermined number (e.g., 16) or more samples. Thus, for example, when the current block is an 8×4 block or a 4×8 block, the current block may be partitioned into two sub-blocks. In addition, when the current block is a 4×4 block, the current block may not be partitioned into sub-blocks. When the current block has other sizes, the current block may be partitioned into four sub-blocks. Information on whether intra prediction is performed based on sub-blocks and / or partition directions (horizontal or vertical) may be transmitted by a signal. Intra prediction based on sub-blocks may be limited to being performed only when reference sample line 0 is used. When subblock-based intra prediction is performed, filtering for a prediction block, which will be described later, may not be performed.

[0206] The final prediction block may be generated by performing filtering on the prediction block of the intra prediction. The filtering may be performed by applying a predetermined weight to the filtering target sample, the left reference sample, the upper reference sample, and / or the upper left reference sample. The weight and / or reference sample (range, position, etc.) used for filtering may be determined based on at least one of the block size, the intra prediction mode, and the position of the filtering target sample in the prediction block. The filtering may be performed only in the case of a predetermined intra prediction mode (e.g., DC, plane, vertical, horizontal, diagonal, and / or adjacent diagonal mode). The adjacent diagonal mode may be a mode in which the diagonal mode is added to k or the diagonal mode is subtracted from k. For example, k may be a positive integer of 8 or less.

[0207] The intra-frame prediction mode of the current block may be entropy encoded / decoded by predicting the intra-frame prediction mode of a block existing adjacent to the current block. When the intra-frame prediction mode of the current block is the same as that of the neighboring block, information that the intra-frame prediction mode of the current block is the same as that of the neighboring block may be transmitted by signaling using predetermined flag information. In addition, indicator information of the intra-frame prediction mode that is the same as the intra-frame prediction mode of the current block among the intra-frame prediction modes of multiple neighboring blocks may be transmitted by signaling. When the intra-frame prediction mode of the current block is different from that of the neighboring block, the intra-frame prediction mode information of the current block may be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.

[0208] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.

[0209] exist Figure 5 In , a rectangle can represent a picture. Figure 5In FIG. 1 , the arrow indicates the prediction direction. According to the encoding type of the picture, the picture can be classified into an intra picture (I picture), a predicted picture (P picture) and a bi-predicted picture (B picture).

[0210] An I picture may be encoded by intra prediction without requiring inter-picture prediction. A P picture may be encoded by inter-picture prediction using a reference picture existing in one direction (i.e., forward or backward) relative to the current block. A B picture may be encoded by inter-picture prediction using a reference picture preset in two directions (i.e., forward and backward) relative to the current block. When inter-picture prediction is used, the encoder may perform inter-picture prediction or motion compensation, and the decoder may perform corresponding motion compensation.

[0211] Hereinafter, embodiments of inter-picture prediction will be described in detail.

[0212] Reference pictures and motion information may be used to perform inter-picture prediction or motion compensation.

[0213] The motion information of the current block may be derived during inter-picture prediction by each of the encoding apparatus 100 and the decoding apparatus 200. The motion information of the current block may be derived by using the motion information of a reconstructed neighboring block, the motion information of a co-located block (also referred to as a col block or a co-located block), and / or the motion information of a block adjacent to the co-located block. The co-located block may refer to a block in a previously reconstructed co-located picture (also referred to as a col picture or a co-located picture) that is spatially co-located with the current block. The co-located picture may be one of one or more reference pictures included in a reference picture list.

[0214] The derivation method of motion information may differ depending on the prediction mode of the current block. For example, the prediction modes applied to inter prediction include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, triangle partition mode, inter-intra combined prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.

[0215] For example, when AMVP is used as a prediction mode, at least one of a motion vector of a reconstructed neighboring block, a motion vector of a co-located block, a motion vector of a block adjacent to the co-located block, and a (0, 0) motion vector may be determined as a motion vector candidate for the current block, and a motion vector candidate list may be generated by using the motion vector candidate. The motion vector candidate of the current block may be derived by using the generated motion vector candidate list. The motion information of the current block may be determined based on the derived motion vector candidate. The motion vector of the co-located block or the motion vector of the block adjacent to the co-located block may be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block may be referred to as a spatial motion vector candidate.

[0216] The encoding device 100 may calculate a motion vector difference (MVD) between a motion vector of a current block and a motion vector candidate, and may perform entropy coding on the motion vector difference (MVD). In addition, the encoding device 100 may perform entropy coding on a motion vector candidate index and generate a bitstream. The motion vector candidate index may indicate the best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding device may perform entropy decoding on the motion vector candidate index included in the bitstream, and may select a motion vector candidate of a decoding target block from the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. In addition, the decoding device 200 may add the entropy-decoded MVD to the motion vector candidate extracted by entropy decoding, thereby deriving a motion vector of the decoding target block.

[0217] In addition, the encoding apparatus 100 may perform entropy encoding on the resolution information of the calculated MVD. The decoding apparatus 200 may adjust the resolution of the entropy-decoded MVD using the MVD resolution information.

[0218] In addition, the encoding device 100 calculates a motion vector difference (MVD) between a motion vector in the current block and a candidate motion vector based on an affine model, and performs entropy encoding on the MVD. The decoding device 200 derives a motion vector based on each sub-block by deriving an affine controlled motion vector of a decoding target block through the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.

[0219] The bitstream may include a reference picture index indicating a reference picture. The reference picture index may be entropy encoded by the encoding apparatus 100 and then signaled as a bitstream to the decoding apparatus 200. The decoding apparatus 200 may generate a prediction block of a decoding target block based on the derived motion vector and the reference picture index information.

[0220] Another example of a method of deriving motion information of a current block may be a merge mode. The merge mode may indicate a method of merging motions of a plurality of blocks. The merge mode may indicate a mode of deriving motion information of a current block from motion information of a neighboring block. When the merge mode is applied, the motion information of the reconstructed neighboring block and / or the motion information of the co-located block may be used to generate a merge candidate list. The motion information may include at least one of a motion vector, a reference picture index, and an inter-picture prediction indicator. The prediction indicator may indicate unidirectional prediction (L0 prediction or L1 prediction) or bidirectional prediction (L0 prediction and L1 prediction).

[0221] The merge candidate list may be a list of stored motion information. The motion information included in the merge candidate list may be at least one of the following: motion information of a neighboring block adjacent to the current block (spatial merge candidate), motion information of a block co-located with the current block in a reference picture (temporal merge candidate), new motion information generated by a combination of motion information present in the merge candidate list, motion information of a block encoded / decoded before the current block (historical-based merge candidate), and a zero merge candidate.

[0222] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and may transmit the bitstream to the decoding device 200 using a signal. The merge flag may be information indicating whether a merge mode is performed for each block, and the merge index may be information indicating which neighboring block among neighboring blocks of the current block is a merge target block. For example, the neighboring blocks of the current block may include a left neighboring block on the left side of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.

[0223] In addition, the encoding device 100 performs entropy encoding on the correction information for correcting the motion vector in the motion information of the merge candidate, and transmits it to the decoding device 200 by signal. The decoding device 200 may correct the motion vector of the merge candidate selected by the merge index based on the correction information. Here, the correction information may include at least one of information on whether to perform correction, correction direction information, and correction size information. As described above, the prediction mode that corrects the motion vector of the merge candidate based on the correction information transmitted by the signal may be referred to as a merge mode with a motion vector difference.

[0224] The skip mode may be a mode in which the motion information of the neighboring blocks is applied to the current block as it is. When the skip mode is applied, the encoding apparatus 100 may perform entropy encoding on information of the fact of which block's motion information is to be used as the motion information of the current block to generate a bitstream, and may signal the bitstream to the decoding apparatus 200. The encoding apparatus 100 may not signal a syntax element regarding at least any one of the motion vector difference information, the coded block flag, and the transform coefficient level to the decoding apparatus 200.

[0225] The sub-block merge mode may represent a mode for deriving motion information in units of sub-blocks of a coding block (CU). When the sub-block merge mode is applied, the sub-block merge candidate list may be generated using motion information of a sub-block co-located with the current sub-block in a reference image (sub-block based temporal merge candidates) and / or affine control point motion vector merge candidates.

[0226] The triangular partition mode may denote a mode of deriving motion information by partitioning the current block into diagonal directions, deriving each prediction sample using each of the derived motion information, and deriving the prediction sample of the current block by weighting each of the derived prediction samples.

[0227] The inter-intra combined prediction mode may mean a mode of deriving a prediction sample of a current block by weighting a prediction sample generated by inter prediction and a prediction sample generated by intra prediction.

[0228] The decoding apparatus 200 may correct the derived motion information by itself. The decoding apparatus 200 may search for a predetermined area based on a reference block indicated by the derived motion information, and derive motion information having a minimum SAD as corrected motion information.

[0229] The decoding apparatus 200 may use the optical flow to compensate for the prediction samples derived through the inter-frame prediction.

[0230] Figure 6 is a diagram illustrating transform and quantization processing.

[0231] As in Figure 6 As shown in , a transform process and / or a quantization process is performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the prediction block (i.e., an intra-frame prediction block or an inter-frame prediction block). The prediction block is a block generated by intra-frame prediction or inter-frame prediction. The transform can be a primary transform, a secondary transform, or both a primary transform and a secondary transform. The residual signal is subjected to a primary transform to generate a transform coefficient, and the transform coefficient is subjected to a secondary transform to generate a secondary transform coefficient.

[0232] At least one scheme selected from various predefined transform schemes is used to perform the primary transform. For example, examples of predefined transform schemes include discrete cosine transform (DCT), discrete sine transform (DST) and Karhunen-Loève transform (KLT). The transform coefficients generated by the primary transform may undergo a secondary transform. The transform scheme for the primary transform and / or the secondary transform may be determined based on the coding parameters of the current block and / or the neighboring blocks of the current block. Optionally, transform information indicating the transform scheme may be transmitted by a signal. DCT-based transforms may include, for example, DCT-2, DCT-8, etc. DST-based transforms may include, for example, DST-7.

[0233] A quantization level signal (quantization coefficient) may be generated by performing quantization on a residual signal or a result of performing a primary transform and / or a secondary transform. Depending on the intra prediction mode or block size / shape of the block, the quantization level signal may be scanned according to at least one of a diagonal upper right scan, a vertical scan, and a horizontal scan. For example, when the coefficients are scanned along a diagonal upper right scan, the coefficients in block form are changed to a one-dimensional vector form. In addition to the diagonal upper right scan, a horizontal scan that scans the coefficients in a two-dimensional block form horizontally or a vertical scan that scans the coefficients in a two-dimensional block form vertically may be used according to the size of the transform block and / or the intra prediction mode. The scanned quantization level coefficients may be entropy encoded for insertion into a bitstream.

[0234] The decoder entropy decodes the bit stream to obtain quantization level coefficients. The quantization level coefficients may be arranged in a two-dimensional block form by inverse scanning. For the inverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning may be used.

[0235] The quantization level coefficients may then be inverse quantized, followed by a secondary inverse transform as required, and finally a primary inverse transform as required to produce a reconstructed residual signal.

[0236] Inverse mapping in the dynamic range can be performed for the luminance component reconstructed by intra-frame prediction or inter-frame prediction before in-loop filtering. The dynamic range can be divided into 16 equal segments, and the mapping function for each segment can be transmitted by a signal. The mapping function can be transmitted by a signal at the slice level or the parallel block group level. The inverse mapping function for performing inverse mapping can be derived based on the mapping function. In-loop filtering, reference picture storage and motion compensation are performed in the inverse mapping area, and the prediction block generated by inter-frame prediction is converted to a mapping area via mapping using a mapping function, and then used to generate a reconstructed block. However, since intra-frame prediction is performed in the mapping area, the prediction block generated via intra-frame prediction can be used to generate a reconstructed block without mapping / inverse mapping.

[0237] When the current block is a residual block of a chroma component, the residual block can be converted to an inverse mapping area by performing scaling on the chroma component of the mapping area. The availability of scaling can be transmitted by signaling at the slice level or the parallel block group level. Scaling can be applied only when the mapping for the luminance component is available and the division of the luminance component and the division of the chroma component follow the same tree structure. Scaling can be performed based on the average value of the sample value of the luminance prediction block corresponding to the chroma block. In this case, when the current block uses inter-frame prediction, the luminance prediction block can represent the mapped luminance prediction block. The value required for scaling can be derived by referring to the lookup table using the index of the fragment to which the average value of the sample value of the luminance prediction block belongs. Finally, the residual block can be converted to the inverse mapping area by scaling the residual block using the derived value. Then, chroma component block recovery, intra-frame prediction, inter-frame prediction, in-loop filtering, and reference picture storage can be performed in the inverse mapping area.

[0238] Information indicating whether mapping / inverse mapping of luma components and chroma components is available may be signaled through a sequence parameter set.

[0239] The prediction block of the current block may be generated based on a block vector indicating the displacement between the current block and the reference block in the current picture. In this way, the prediction mode for generating the prediction block with reference to the current picture is called an intra-block copy (IBC) mode. The IBC mode may be applied to M×N (M<=64, N<=64) coding units. The IBC mode may include a skip mode, a merge mode, an AMVP mode, and the like. In the case of a skip mode or a merge mode, a merge candidate list is constructed, and a merge index is transmitted with a signal so that a merge candidate can be specified. The block vector of the specified merge candidate may be used as the block vector of the current block. The merge candidate list may include at least one of a spatial candidate, a history-based candidate, a candidate based on an average of two candidates, and a zero merge candidate. In the case of the AMVP mode, a difference block vector may be transmitted with a signal. In addition, a prediction block vector may be derived from the left neighboring block and the upper neighboring block of the current block. An index about the neighboring block to be used may be transmitted with a signal. The prediction block in the IBC mode is included in the current CTU or the left CTU and is limited to a block in a reconstructed area. For example, the value of the block vector may be limited so that the prediction block of the current block is located in the region of three 64×64 blocks preceding the 64×64 block to which the current block belongs in the encoding / decoding order. By limiting the value of the block vector in this way, the memory consumption and device complexity of the implementation according to the IBC mode can be reduced.

[0240] Hereinafter, a transform coefficient encoding / decoding method according to an embodiment of the present invention will be described. In the following embodiments, the current block may be a transform unit or a transform block.

[0241] In the present invention, the transform coefficient for the current block may mean a coefficient derived as a result of transforming a residual signal of the current block, or a quantization level value of the transform coefficient.

[0242] Figure 8 is a diagram illustrating a transform coefficient encoding / decoding method according to an embodiment of the present invention.

[0243] Reference Figure 8 The transform coefficient encoding / decoding method may include: [D1] a step of grouping the transform coefficients; [D2] a step of scanning the transform coefficients; and [D3] a step of binarizing the transform coefficients.

[0244] [D1] Transform coefficient grouping step

[0245] When encoding / decoding the transformation coefficient with respect to the current block, the transformation coefficient grouping may be performed using at least one method of fixed block transformation coefficient grouping and variable block transformation coefficient grouping.

[0246] Encoding / decoding of a transform coefficient with respect to a current block may be performed in units of a transform coefficient group.

[0247] The K transform coefficient groups may be independently subjected to transform coefficient encoding / decoding. In addition, the K transform coefficient groups may be independently subjected to prediction encoding / decoding, and the K transform coefficient groups may be independently subjected to transform and quantization. Here, K may be a positive integer.

[0248] Additionally, transform coefficient groups may be defined as transform coefficient blocks, child transform blocks, or sub-transform blocks.

[0249] Transformation coefficient grouping for a current block according to an exemplary embodiment may be performed as fixed block transformation coefficient grouping.

[0250] Specifically, the transform coefficients for the current block may be divided into transform coefficient groups, each transform coefficient group having a fixed size of M (width)×N (height).

[0251] Figures 9 to 12 is a diagram showing an example of fixed block transform coefficient grouping according to the present invention.

[0252] Fig. 9 An example of performing transform coefficient grouping with the same size as the size of the current block is shown. Fig. 9 , when the current block is 8×8 in size, the size of the transform coefficient group is set to 8×8, and the current block may be a transform coefficient group.

[0253] Fig.10 An example of partitioning a current block into predetermined sizes and grouping transform coefficients thereof is shown. Fig.10, when the current block has a size of 16×16 and the transform coefficient group is a predetermined size which is a size of 4×4, the current block is divided into 16 transform coefficient groups for grouping.

[0254] Fig.11 An example of transform coefficient grouping when the current block is not exactly divided by transform coefficient groups in size is shown. Fig.11 , when the current block is 16×16 in size and the transform coefficient group is a predetermined size as 5×5 in size, transform coefficient groups of sub-block sizes such as 5×1, 1×5, and 1×1 are allowed for the right and lower boundaries of the current block.

[0255] Fig.12 An example of transform coefficient grouping when the horizontal size or vertical size of a predetermined transform coefficient group is larger than the horizontal size or vertical size of a current block is shown. Fig.12 , when the current block is of 16×4 size and the predetermined transform coefficient group is of 8×8 size, a transform coefficient group of 8×4 size is allowed. That is, the size of the predetermined transform coefficient group may vary according to the size of the current block.

[0256] In addition, when the current block exists at the right boundary or the lower boundary of the picture, or when the current block is not exactly divided by the transform coefficient group in size, as described above with reference to Fig.11 and Fig.12 As described, transform coefficient groups that differ in size from the fixed transform coefficient group size are allowed.

[0257] Transformation coefficient grouping for a current block according to an exemplary embodiment may be performed as variable block transformation coefficient grouping.

[0258] Specifically, the transform coefficients for the current block may be divided into k transform coefficient groups of different sizes. When performing variable block transform coefficient grouping, the current block may be divided into k transform coefficient groups, wherein the transform coefficient groups have positions and sizes of transform coefficient groups with optimal costs. In addition, the k transform coefficient groups generated by the variable block transform coefficient grouping may not overlap with each other.

[0259] Figures 13 to 15 is a diagram showing an example of variable block transform coefficient grouping according to the present invention.

[0260] As in Fig.13 As shown in , when the current block is of 16×16 size, the current block is divided in such a way that the transform coefficient group at the upper left position is of 8×8 size and the remaining transform coefficient groups are of 4×4 size.

[0261] like Fig.14As shown in , when the current block is 16×16 in size, the current block is divided in a manner that the transform coefficient group at the left position is 4×8 in size and the remaining transform coefficient groups are 4×4 in size. Optionally, when the current block is 16×16 in size, the current block is divided in a manner that the transform coefficient group at the top position is 8×4 in size and the remaining transform coefficient groups are 4×4 in size.

[0262] like Fig.15 As shown in , when the current block is of 16×16 size, the current block is divided in the following manner: the transform coefficient group at the upper left position is of 8×8 size, the transform coefficient group at the left position is of 4×8 size, the transform coefficient group at the top position is of 8×4 size, and the remaining transform coefficient groups are of 4×4 size.

[0263] In addition, the transform coefficient grouping method for the current block may be indexed as a grouping method having an optimal cost among N grouping methods, where N is an arbitrary positive integer.

[0264] For example, an index list of five grouping methods may be constructed as follows, and index information indicating a method having a minimum RD cost may be signaled.

[0265] Index 0: fixed block transform coefficient grouping method;

[0266] Index 1: first variable block transform coefficient grouping method;

[0267] Index 2: second variable block transform coefficient grouping method;

[0268] Index 3: third variable block transform coefficient grouping method;

[0269] Index 4: fourth variable block transform coefficient grouping method;

[0270] When performing transform coefficient grouping, a transform coefficient grouping method may be determined based on encoding parameters (e.g., at least one of a slice type, a parallel block group type, a coding mode, an intra prediction mode, an inter prediction mode, a value of a transform coefficient, and a size / shape of a current block). The transform coefficient grouping method may be at least one of the above-mentioned fixed block transform coefficient grouping method and the variable block transform coefficient grouping method.

[0271] A transform coefficient grouping method may be determined based on a slice type.

[0272] For example, when the current slice is slice I, a variable block transform coefficient grouping method is determined. When the current slice is slice P or slice B, a fixed block transform coefficient grouping method is determined.

[0273] The transform coefficient grouping method may be determined based on the positions of non-zero transform coefficients within the current block.

[0274] For example, a minimum size of a transform coefficient group including all non-zero transform coefficients in the current block may be determined. Here, the size of the transform coefficient group may be (X_max+1)×(Y_max+1), where X_max is the maximum value of the X-coordinate position of the non-zero transform coefficient in the current block, and Y_max is the maximum value of the Y-coordinate position of the non-zero transform coefficient in the current block.

[0275] Fig.16 is a diagram illustrating a method of determining a transform coefficient group based on positions of non-zero transform coefficients within a current block.

[0276] Reference Fig.16 , in a coding block of size 16×16, a transform coefficient group 0 of a minimum size (6×6) including all non-zero transform coefficients may be determined.

[0277] Only when the current block is of N×M size, when min(N,M) or max(N,M) is greater than a threshold K (which is an arbitrary positive integer), an example of determining a transform coefficient grouping method based on the positions of non-zero coefficients within the current block can be performed.

[0278] The transform coefficient grouping method may be determined based on the prediction mode.

[0279] For example, when the current block is in the intra prediction mode, a variable block transform coefficient grouping method is determined. When the current block is in the inter prediction mode, a fixed block transform coefficient grouping method is determined.

[0280] A transform coefficient grouping method may be determined based on an intra prediction mode.

[0281] For example, when the intra prediction mode of the current block is DC / planar mode, it is determined to use reference Fig.13 When the intra prediction mode of the current block is the horizontal angle mode, the reference Fig.14 When the intra prediction mode of the current block is a vertical angle mode, the reference Fig.15 Describes the method for grouping transform coefficients.

[0282] The transform coefficient grouping method may be determined based on the size of the current block.

[0283] For example, when the minimum value (min(N,M)) or the maximum value (max(N,M)) of the width (M) and the height (N) of the current block (M×N) is greater than a threshold value K (which is an arbitrary positive integer), a variable block transform coefficient grouping method is determined. Otherwise, a fixed block transform coefficient grouping method is determined.

[0284] For example, when the width (M) and height (N) of the current block (M×N) are the same, a fixed block transform coefficient grouping method is determined. When the width (M) and height (N) of the current block (M×N) are different, a variable block transform coefficient grouping method is determined.

[0285] For example, when the width (M) of the current block (M×N) is less than the height (N) and also less than a predefined value (P), the width of the transform coefficient group is fixed to the width (M) of the current block, and then the transform coefficient grouping is performed. In this article, P can be a positive integer, such as 4.

[0286] For example, when the height (N) of the current block (M×N) is less than the width (M) and also less than a predefined value (Q), the height of the transform coefficient group is fixed to the height (N) of the current block, and then the transform coefficient grouping is performed. In this article, Q can be a positive integer, such as 4.

[0287] Figures 17 to 20 is a diagram showing how to determine a transform coefficient grouping method based on a width (M) or a height (N) of a current block (M×N).

[0288] For example, as in Fig.17 As shown in , when the width (M) of the current block is greater than an arbitrary threshold, transform coefficient grouping is performed by dividing M by 4.

[0289] For example, as in Fig.18 As shown in , when the width (M) of the current block is greater than an arbitrary threshold, transform coefficient grouping is performed by dividing M by 2.

[0290] For example, as in Fig.19 As shown in , when the height (N) of the current block is greater than an arbitrary threshold, transform coefficient grouping is performed by dividing N by 4.

[0291] For example, as in Fig. 20 As shown in , when the height (N) of the current block is greater than an arbitrary threshold, transform coefficient grouping is performed by dividing N by 2.

[0292] For example, when the width (M) or height (N) of the current block is less than an arbitrary threshold value (T), the transform coefficients are grouped into a transform coefficient group of a size of B×B. On the contrary, when the width (M) and height (N) of the current block are equal to or greater than an arbitrary threshold value, the transform coefficients are grouped into a transform coefficient group of a size of 2B×2B. Here, T may be a positive integer, such as 4, and B may be a positive integer, such as 2.

[0293] For example, when the area (M×N) of the current block is greater than an arbitrary threshold (R) and is non-square in shape, transform coefficient grouping is performed as a transform coefficient group of a non-square shape. Here, R may be a positive integer, such as 8.

[0294] The area of ​​the transform coefficient group may be fixed to at least one unit of a sub-CU, a CU, a CTU, a tile, a tile group, a partition, a slice, a picture, and a sequence. Here, the area of ​​the transform coefficient group may be the product of the width and height of the transform coefficient group, and may be a positive integer.

[0295] For example, the area of ​​the transform coefficient group may have a value of {4, 8, 16, 32, 64, 128, 256, 512}. Here, the area of ​​the transform coefficient group may be transmitted based on at least one of a sub-CU, a CU, a CTU, a tile, a tile group, a partition, a slice, a picture, and a sequence.

[0296] For example, a value obtained by applying log2 to the area of ​​the transform coefficient group may be transmitted.

[0297] For example, a value obtained by applying log2 to the area of ​​the transform coefficient group is added to -2, and the resulting value may be transmitted.

[0298] For example, a value obtained by applying log2 to the area of ​​the transform coefficient group is added to -3, and the resulting value may be transmitted.

[0299] A transform coefficient group may be divided into sub-transform coefficient groups.

[0300] For example, transform and quantization may be performed in units of transform coefficient groups, and scanning and binarization of transform coefficients may be performed in units of sub-transform coefficient groups.

[0301] The transform coefficient grouping method may be determined using the intra prediction mode and position information of the last non-zero coefficient.

[0302] The residual signal after intra-frame prediction may have a correlation according to the intra-frame prediction direction. Therefore, there is the following characteristic: when horizontal prediction is used, most of the non-zero coefficients after frequency transformation appear in the first column; on the contrary, when vertical prediction is used, most of the non-zero coefficients after frequency transformation appear in the first row.

[0303] Using this characteristic after frequency transformation and the position information of the last non-zero coefficient, transform coefficient grouping can be performed efficiently. Here, the word efficient can mean generating very large transform coefficient groups to reduce the number of coefficient presence indicators based on transform coefficient groups (blocks) to be signaled.

[0304] Figure 21 to Figure 23 is a diagram illustrating a method of setting a transform coefficient group by using an intra prediction mode and position information of a last non-zero coefficient.

[0305] Fig.21An example of performing transform coefficient grouping using position information of the last non-zero coefficient when the intra prediction mode is the horizontal direction is shown.

[0306] Reference Fig.21 , in the case of intra horizontal prediction, the first transform coefficient group has a vertical size starting from position (0,0) which may be the same as the vertical size of the current block; and the horizontal size of the first transform coefficient group may be determined as the x position of the last non-zero transform coefficient + 1. Here, the intra prediction horizontal direction may include an intra prediction mode having a direction similar to the horizontal direction (i.e., a direction less than an angle of +-90 degrees centered on the horizontal direction).

[0307] Fig. 22 An example of performing transform coefficient grouping using position information of the last non-zero coefficient when the intra prediction mode is the vertical direction is shown.

[0308] Reference Fig. 22 , in the intra vertical direction prediction, the first transform coefficient group has the same horizontal size as the horizontal size of the current block starting from the position (0,0); and the vertical size of the first transform coefficient group may be determined as the y position of the last non-zero transform coefficient + 1. Here, the intra prediction vertical direction may include an intra prediction mode having a direction similar to the vertical direction (i.e., a direction less than an angle of +-90 degrees centered on the vertical direction).

[0309] Fig.23 An example is shown in which the intra prediction mode is a non-angular prediction mode and transform coefficient grouping is performed using position information of the last non-zero coefficient.

[0310] Reference Fig.23 In the case of non-angular intra prediction, the first transform coefficient group may be determined as a triangle shape of a minimum size including the position of the last non-zero coefficient. Here, the non-angular prediction mode may include a planar mode and a DC mode.

[0311] In addition, using the transform coefficient scanning method (rather than the intra prediction mode) and the position information of the last non-zero coefficient, the transform coefficient grouping method may be determined.

[0312] In reference Fig.21 and Fig. 22 In the described example, a transform coefficient group may be set according to a scanning method without using an intra prediction mode.

[0313] For example, when using horizontal scanning, Fig.21 In the case of vertical scanning, the transform coefficient groups can be arranged in the same way as in Fig. 22 In addition, in the case of using zigzag scanning or diagonal scanning, the following can be used: Fig.23 The method in is used to set the transform coefficient group.

[0314] For the remaining non-return-to-zero regions except the return-to-zero region, transform coefficient grouping may be performed.

[0315] Specifically, the transform coefficient grouping may be performed on the remaining regions except the return-to-zero region. That is, the transform coefficient grouping may be performed in the non-return-to-zero region.

[0316] For example, in a non-return-to-zero region, a transform coefficient group including all non-zero transform coefficients may be generated.

[0317] Additionally, the return-to-zero region / non-return-to-zero region may be predefined in the encoder and decoder, or may be determined based on signaled information in a specific header (VPS, SPS, PPS, slice, block, tile, etc.).

[0318] In addition, in the current block, an area having a predefined value (T) or greater may be set as a zeroing area. Here, T may be a positive integer, such as 32. That is, when the width or height of the current block is equal to or greater than a predefined size, an area of ​​the predefined size or greater within the current block is determined as a zeroing area.

[0319] For example, when the current block is 64×64 in size and the predefined value is 32, an area of ​​the current block other than an area of ​​32×32 in size at the upper left is set as a zeroing area.

[0320] For example, when the current block is 16×64 in size and the predefined value is 32, an area of ​​the current block other than an area of ​​16×32 in size at the upper left is set as a zeroing area.

[0321] Alternatively, the return-to-zero area / non-return-to-zero area may be determined based on at least one of the size of the current block and the type of frequency transform.

[0322] For example, when a transform type other than DCT-2 (e.g., DST-7 or DCT-8) is used as the type of frequency transform and the current block (or transform block) is 64×64 in size, an area other than the upper left transform area of ​​32×32 size is determined as a zeroing area.

[0323] For example, when a transform type other than DCT-2 (e.g., DCT-7 or DCT-8) is used as the type of frequency transform, the non-return-to-zero region is set to an M×M size region at the upper left of the current block. In this case, the region other than the M×M size region at the upper left may be set as the return-to-zero region. Here, M may be a positive integer, such as 16.

[0324] In addition, the determination of the return-to-zero area / non-return-to-zero area may be performed by a combination of one or more of the above examples.

[0325] Fig.24 and Fig.25 is a diagram illustrating a return-to-zero region and a non-return-to-zero region according to an embodiment of the present invention.

[0326] Fig.24 An example of a quadrilateral zeroing region is shown.

[0327] Fig.25 An example of a triangular zeroed region is shown.

[0328] Regarding transform coefficient grouping for a non-return-to-zero region, one or more transform coefficient groups of a fixed size may be configured according to the return-to-zero region, or transform coefficient groups of different sizes that may minimally include the return-to-zero region may be configured.

[0329] Fig.26 and Fig. 27 is a diagram illustrating grouping of transform coefficients in a non-return-to-zero region.

[0330] Reference Fig.26 , when an 8×8 sized area located at the lower right within a 16×16 sized block is defined as a zeroing area, a step of grouping into three 8×8 sized transform coefficient groups occurs.

[0331] Reference Fig. 27 , when a triangular area located at the lower right within a 16×16 size block is defined as a zeroing area and assuming that the minimum size of a transform coefficient group is 4×4, six 4×4 size transform coefficient groups and one 8×8 size transform coefficient group are configured to minimally include the zeroing area.

[0332] [D2] Transform coefficient scanning step

[0333] When encoding / decoding the transform coefficient of the current block, the transform coefficient scanning may be performed using at least one of fixed transform coefficient scanning and adaptive transform coefficient scanning. In addition, the above-mentioned scanning method may be performed on the transform coefficient group.

[0334] Fig.28 is a diagram illustrating an example of a fixed transform coefficient scanning method.

[0335] Reference Fig.28 , the fixed transform coefficient scanning method can be performed by any one of diagonal scanning, horizontal scanning, vertical scanning and zigzag scanning.

[0336] In addition, a fixed transform scanning method may be determined based on at least one of a current block, a tile, a tile group, a partition, a slice, a picture, and a sequence.

[0337] Regarding adaptive transform coefficient scanning, a transform coefficient scanning method may be adaptively determined based on encoding parameters.

[0338] For example, the transform coefficient scanning method may be determined based on at least one of a quantization parameter, a transform method, an encoding mode, an intra prediction mode, an inter prediction mode, a value of a transform coefficient, and a size / shape of a current block.

[0339] As another example, when the current block is in the intra prediction mode and is processed in the DC / planar prediction mode, the transform coefficient scanning method is determined to be the diagonal scanning.

[0340] As another example, when the current block is in the intra prediction mode and is processed in the horizontal angle prediction mode, the transform coefficient scanning method is determined to be the vertical scanning.

[0341] As another example, when the current block is in the intra prediction mode and is processed in the vertical angle prediction mode, the transform coefficient scanning method is determined to be the horizontal scanning.

[0342] In addition, a transform coefficient scanning candidate list of N candidates may be configured based on at least one of a picture, a slice, a partition, a tile group, a tile, a coding block, and a transform coefficient group, where N is a positive integer. In this case, the transform coefficient scanning candidate list may be configured based on at least one of a coding mode, a transform method, an inter-frame prediction mode, and an intra-frame prediction mode. The encoder may encode index information indicating a scanning method with the best cost (e.g., the generated bit and RD cost) in the transform coefficient scanning candidate list. The decoder may select a transform coefficient scanning method from the transform coefficient scanning candidate list by using the index information.

[0343] In addition, a transform coefficient scanning candidate list may be constructed based on a transform coefficient scanning method of a neighboring block with respect to the current block.

[0344] In addition, transform coefficient scanning may be performed on transform coefficients and transform coefficient groups included in a non-return-to-zero region except for the return-to-zero region.

[0345] The syntax elements (last_significant_coeff_x_prefix / suffix, last_significant_coeff_y_prefix / suffix) indicate the start of the scan or the position of the last non-zero transform coefficient within the current transform block, and are intended to indicate only the positions of transform coefficients included in non-return-to-zero regions, so that the maximum range of the syntax elements may be limited, prompting the syntax elements to be represented by much shorter bits.

[0346] For example, in the case where only a 32×32-sized area at the upper left corner within a 64×64-sized transform block is defined as a non-return-to-zero area, each of the positions x and y of the last transform coefficient may have a range of 0 to 31. Therefore, when represented by fixed bits, the position is represented by 5 bits.

[0347] The encoder may scan the transform coefficient group included in the non-return-to-zero area according to a predefined transform coefficient scanning method (or scanning order), and may scan the transform coefficients within the corresponding transform coefficient group according to a predefined transform coefficient scanning method (or scanning order).

[0348] Here, the transform coefficient may be encoded by starting scanning from a transform coefficient existing at a position of the last transform coefficient included in the non-return-to-zero region.

[0349] The decoder can decode the position of the last transform coefficient from the bitstream, and can scan the non-return-to-zero area starting from the position of the last transform coefficient according to a predefined transform coefficient scanning method (or scanning order), so that the position of the decoded transform coefficient within the transform coefficient block can be derived.

[0350] [D3] Transform coefficient binarization step

[0351] The binarization of the transform coefficient may be performed using at least one method of binarizing a transform coefficient presence indicator, binarizing a transform coefficient sign, and binarizing a transform coefficient absolute value. Here, binarization may refer to entropy encoding / decoding.

[0352] Hereinafter, binarization of a transform coefficient presence indicator, a transform coefficient sign, and a transform coefficient absolute value will be described.

[0353] [D3-1] Binarization of transform coefficient presence indicator

[0354] The transform coefficient existence indicator is an indicator indicating whether a non-zero transform coefficient exists.

[0355] The transform coefficient presence indicator may be encoded / decoded based on a transform coefficient or a transform coefficient group.

[0356] When the value of the transform coefficient is not 0, the transform coefficient existence indicator based on the transform coefficient is set to '1', and when the value of the transform coefficient is 0, the transform coefficient existence indicator based on the transform coefficient is set to '0'.

[0357] When a non-zero transform coefficient exists in the corresponding transform coefficient group, the transform coefficient group-based transform coefficient existence indicator is set to '1', and when the non-zero transform coefficient does not exist, the transform coefficient group-based transform coefficient existence indicator is set to '0'.

[0358] When the transform coefficient presence indicator based on the transform coefficient group is "0", the coefficient presence indicator based on the transform coefficient within the transform coefficient group is not encoded / decoded. In this case, the transform coefficient presence indicator based on the transform coefficient within the transform coefficient group can be considered as "0".

[0359] Fig.29 is a diagram showing a transform coefficient presence indicator based on a transform coefficient and a transform coefficient presence indicator based on a transform coefficient group.

[0360] exist Fig.29 In , the current block is of 8×8 size and the transform coefficient group is of 4×4 size.

[0361] Reference Fig.29 , when the transform coefficient group-based transform coefficient existence indicator is "0", the transform coefficient-based transform coefficient existence indicator is not encoded / decoded and therefore does not exist.

[0362] In addition, the transform may not be performed in the return-to-zero region, so that the transform coefficient group-based transform coefficient presence indicator and the transform coefficient-based transform coefficient presence indicator may be hidden for the transform coefficient group and the transform coefficient included in the return-to-zero region. Here, hiding may mean that encoding / decoding is not performed or that transmission from the encoder to the decoder does not occur.

[0363] Therefore, for the transform coefficient groups and transform coefficients included in the zeroing area, the decoder may not perform entropy decoding on the syntax fragments of the transform coefficient existence indicator based on the transform coefficient group and the transform coefficient existence indicator based on the transform coefficient, and the value of the transform coefficient existence indicator based on the transform coefficient group and the value of the transform coefficient existence indicator based on the transform coefficient may be considered to be "0".

[0364] As described above, the zeroing region may be predefined in the encoder and the decoder, or may be determined based on information transmitted by signaling in a specific header (VPS, SPS, PPS, slice, partition, tile group, etc.) Therefore, the transform coefficient group-based transform coefficient presence indicator and the transform coefficient-based transform coefficient presence indicator may be hidden based on the information used to determine the zeroing region.

[0365] In addition, the zeroing area can be determined based on at least one of the size of the current block and the type of frequency transform, so that the transform coefficient existence indicator based on the transform coefficient group and the transform coefficient existence indicator based on the transform coefficient can be hidden based on at least one of the size of the current block and the type of frequency transform.

[0366] For example, as in Fig.26As shown in , when the current block is 16×16 in size and the gray 8×8 in size area is determined to be a zeroing area, for the transform coefficient group included in the gray area, the encoder does not send at least one transform coefficient presence indicator based on the transform coefficient group and at least one transform coefficient presence indicator based on the transform coefficient. In addition, the decoder may not entropy decode at least one transform coefficient presence indicator based on the transform coefficient group and at least one transform coefficient presence indicator based on the transform coefficient for the corresponding area, and the value of the corresponding transform coefficient presence indicator based on the transform block coefficient and the value of the corresponding transform coefficient presence indicator based on the transform coefficient may be considered to be "0".

[0367] For example, as in Fig. 27 As shown in , when the zeroing region is a triangular shape and the minimum transform coefficient group is defined as a 4×4 size, at least one transform coefficient presence indicator based on the transform coefficient of the zeroing region included in the transform coefficient group is not transmitted by the encoder and is regarded by the decoder as having a value of 0. All other transform coefficient presence indicators based on the transform coefficient group based on the zeroing region and transform coefficient presence indicators based on the transform coefficient may be hidden.

[0368] For example, when a transform type other than DCT2 (e.g., DST7 or DCT8) is used as a transform type and the current block is 64×64 in size, an area other than the upper left transform area of ​​32×32 size is defined as a zeroing area. For a transform coefficient group included in a corresponding area, the encoder may not send at least one transform coefficient presence indicator based on the transform coefficient group and at least one transform coefficient presence indicator based on the transform coefficient, and the decoder may not entropy decode at least one transform coefficient presence indicator based on the transform coefficient group and at least one transform coefficient presence indicator based on the transform coefficient for the corresponding area. In addition, the value of the corresponding transform coefficient presence indicator based on the transform coefficient group and the value of the corresponding transform coefficient presence indicator based on the transform coefficient may be considered to be "0".

[0369] When a transform coefficient existence indicator based on a transform coefficient group or a transform coefficient existence indicator based on a transform coefficient is binarized (entropy encoding / decoding), the transform coefficient group uses different probability information (context) when entropy encoding / decoding the transform coefficient existence indicator based on the transform coefficient group or the transform coefficient existence indicator based on the transform coefficient.

[0370] For example, in Fig.26 In the case shown in , the upper left 8×8 sized block based on the transform coefficient and other blocks use different probability information when performing entropy encoding / decoding on the transform coefficient group-based transform coefficient existence indicator or the transform coefficient-based transform coefficient existence indicator.

[0371] For example, in Fig. 27 In the case shown in , a 4×4 sized transform coefficient group including a portion of a zeroed area and a 4×4 sized transform coefficient group not including a zeroed area use different probability information when performing entropy encoding / decoding on a transform coefficient group-based transform coefficient existence indicator or a transform coefficient-based transform coefficient existence indicator.

[0372] Furthermore, based on the size of each transform coefficient group, different probability information may be used when performing entropy encoding / decoding on a transform coefficient group-based transform coefficient existence indicator or a transform coefficient-based transform coefficient existence indicator.

[0373] [D3-2] Binarization of transform coefficients

[0374] When transform coefficient sign binarization is performed for the current block, the transform coefficient sign binarization may be performed using at least one method of a transform coefficient sign indicator, transform coefficient sign hiding, and transform coefficient sign prediction.

[0375] When binarizing the sign of a transform coefficient of a current block, a transform coefficient sign indicator may be used.

[0376] For example, when the transform coefficient is a negative number (-), the transform coefficient sign indicator is set to "1", and when the transform coefficient is a positive number (+), the transform coefficient sign indicator is set to "0". Conversely, when the transform coefficient is a negative number (-), the transform coefficient sign indicator is set to "0", and when the transform coefficient is a positive number (+), the transform coefficient sign indicator is set to "1".

[0377] For example, when the transform coefficient existence indicator based on the transform coefficient or the transform coefficient existence indicator based on the transform coefficient group is '0', the transform coefficient sign indicator is not encoded / decoded.

[0378] In addition, when the signs of the transform coefficients of the current block are binarized, transform coefficient sign hiding may be used.

[0379] Transform coefficient sign hiding may be to derive N pieces of transform coefficient sign information (where N may be a positive integer) according to the state of the absolute value of the transform coefficient, and may be performed in units of transform coefficient groups.

[0380] For example, when the sum of transform coefficients of the transform coefficient group is an even number, the first non-zero transform coefficient has a positive sign '+'.

[0381] For example, when the sum of transform coefficients of the transform coefficient group is an even number, the first non-zero transform coefficient has a negative sign '-'.

[0382] In addition, when the sign of the transform coefficient of the current block is binarized, the transform coefficient sign prediction may be used.

[0383] In transform coefficient sign prediction, the signs of N non-zero transform coefficients in the transform coefficient group are predicted, where N is a positive integer. The case where the actual sign matches the predicted sign is indicated by a value of "1", and the case where the actual sign does not match the predicted sign is indicated by a value of "0". Transform coefficient sign prediction can be performed in units of transform coefficient groups.

[0384] For example, the prediction of the sign of the transform coefficient may be performed using a combination with the best cost among the combinations of the signs of the N coefficients to be predicted (2N combinations). Here, the cost of the sign combination may be obtained from the similarity between the data obtained by inversely transforming the current transform coefficient group using the corresponding combination and the adjacent reconstructed image.

[0385] [D3-3] Binarization of absolute value of transform coefficients

[0386] When performing absolute value binarization of transform coefficients for the current block, at least one method of transform coefficient binarization based on absolute value comparison, transform coefficient binarization based on exponential scaling absolute value comparison, and residual transform coefficient absolute value binarization may be used to perform the transform coefficient absolute value binarization.

[0387] [D3-3-1] Binarization of transform coefficients based on absolute value comparison

[0388] The transform coefficient binarization based on absolute value comparison may be performed in units of transform coefficient groups or in units of transform coefficients, or may be performed when a transform coefficient existence indicator is 1.

[0389] The transform coefficient binarization based on absolute value comparison can be performed using Expression 1 and a positive integer N as follows.

[0390] [Expression 1]

[0391] Abs(coeff.)>K, K={1,…,N}

[0392] For example, when N is 2, the execution Fig.30 The transform coefficient binarization based on absolute value comparison shown in .

[0393] For example, K may be 2N or 2N-1. Here, when K is 2N, the absolute value binarization of the transform coefficient is performed by comparing the absolute value of the transform coefficient with the values ​​of 2, 4, 6, ..., and 2N. In addition, when K is 2N-1, the absolute value binarization of the transform coefficient is performed by comparing the absolute value of the transform coefficient with the values ​​of 1, 3, 5, ..., and 2N-1.

[0394] In addition, according to the above scanning method, the transform coefficient binarization based on absolute value comparison can be performed only on the I transform coefficient. Here, I can be a positive integer.

[0395] [D3-3-2] Binarization of transformation coefficients based on absolute value comparison of exponential scaling

[0396] The transform coefficient binarization based on exponent scale absolute value comparison may be performed in units of transform coefficient groups or in units of transform coefficients, or may be performed when a coefficient existence indicator is 1.

[0397] The transform coefficient binarization based on exponent-scaled absolute value comparison can be performed as follows using Expression 2 and positive integers a and N.

[0398] [Expression 2]

[0399] Abs(coeff.)≥a K , K={1,…,N}

[0400] For example, when a is 2 and N is 3, executing Fig.31 Binarization of transform coefficients based on exponentially scaled absolute value comparison as shown in .

[0401] In addition, according to the above scanning method, the transform coefficient binarization based on absolute value comparison can be performed only on the I transform coefficient. Here, I can be a positive integer.

[0402] exist Fig.31 In the example, the value of Abs(coeff.)(Abs(coefficient)) may be an absolute value of a transform coefficient level. Here, the transform coefficient level may be a result of transform and quantization.

[0403] As in Fig.31 As shown in , when a is 2 and N is 3, an indicator for the existence of a transform coefficient, an indicator for indicating a case where the absolute value of the transform coefficient level is equal to or greater than 2, an indicator for indicating a case where the absolute value of the transform coefficient level is equal to or greater than 4, and an indicator for indicating a case where the absolute value of the transform coefficient level is equal to or greater than 8 are encoded / decoded.

[0404] In this case, when the value of the transform coefficient presence indicator is true (or the value is "1"), the indicator indicating the case where the absolute value of the transform coefficient level is equal to or greater than 2 is encoded / decoded. In addition, when the value of the indicator indicating the case where the absolute value of the transform coefficient level is equal to or greater than 2 is true (or the value is "1"), the indicator indicating the case where the absolute value of the transform coefficient level is equal to or greater than 4 is encoded / decoded. In addition, when the value of the indicator indicating the case where the absolute value of the transform coefficient level is equal to or greater than 4 is true (or the value is "1"), the indicator indicating the case where the absolute value of the transform coefficient level is equal to or greater than 8 is encoded / decoded.

[0405] [D3-3-3] Binarization of residual transform coefficients

[0406] The residual transform coefficient binarization may be performed in units of transform coefficient groups or in units of transform coefficients, or may be performed when a coefficient presence indicator is 1.

[0407] The residual transform coefficient binarization may be performed by various binarization methods.

[0408] For example, the truncated Rice binarization method may be used to perform the binarization of the residual transform coefficients.

[0409] For example, the residual transform coefficient binarization may be performed using a K-th order Exp_Golomb binarization method.

[0410] For example, a finite binarization method may be used to perform the residual transform coefficient binarization.

[0411] For example, the residual transform coefficient binarization may be performed using a unary binarization method.

[0412] For example, the residual transform coefficient binarization may be performed using a truncated unary binarization method or a truncated binarization method.

[0413] In addition, the binarization method may be determined according to the value of the residual transform coefficient.

[0414] For example, residual transform coefficients having a value equal to or less than a positive integer c are binarized using a truncated unary binarization method, and residual coefficients exceeding the value c are binarized using a K-th order Exp_Golomb binarization method.

[0415] In addition, the binarization method can be determined according to the scanning order.

[0416] For example, when the residual transform coefficients are binarized using the K-th order Exp_Golomb binarization method, the value of K increases or decreases according to the scanning order.

[0417] Based on encoding parameters (e.g., at least one of a slice type, a parallel block group type, an encoding mode, an intra prediction mode, an inter prediction mode, a value of a transform coefficient, and a size / shape of a current block), a transform coefficient binarization method may be determined in units of transform coefficients.

[0418] For example, transform coefficients belonging to the low frequency may be binarized by exponential scaling absolute value comparison, and the remaining transform coefficients may be binarized by absolute value comparison-based transform coefficients.

[0419] For example, the exponential scaling absolute value comparison binarization may be performed on the transform coefficients having a low quantization parameter (QP), and the absolute value comparison-based transform coefficient binarization may be performed on the remaining transform coefficients.

[0420] Based on the encoding parameters (e.g., at least one of the slice type, the parallel block group type, the encoding mode, the intra prediction mode, the inter prediction mode, the value of the transform coefficient, and the size / shape of the current block), the transform coefficient binarization method may be determined on a per-block basis. Here, the block may be a transform coefficient group.

[0421] For example, when the current block is in the intra prediction mode, the transform coefficient binarization based on the exponent scale absolute value comparison is performed. When the current block is in the inter prediction mode, the transform coefficient binarization based on the absolute value comparison is performed.

[0422] For example, when the current block is of N×M size, when the minimum value of M and N (min(N,M)) or the maximum value of M and N (max(N,M)) is greater than a predefined K (where K is a positive integer), the transform coefficient binarization based on exponential scaling absolute value comparison is performed, otherwise, the transform coefficient binarization based on absolute value comparison is performed.

[0423] Fig.32 is a flowchart illustrating a method of decoding an image according to an embodiment of the present invention.

[0424] Reference Fig.32 , in step S3210, the apparatus for decoding an image may determine a zeroing area within a current block.

[0425] Specifically, when the width or height of the current block is greater than the first predefined size, a region in the current block whose size is equal to or greater than the first predefined size is determined as a zeroing region. In this article, the first predefined size may be 32.

[0426] In addition, the zeroing region may be determined based on the type of frequency transform of the current block. Specifically, when the type of frequency transform of the current block is DST-7 or DCT-8, a region within the current block having a size equal to or greater than a second predetermined size is determined as the zeroing region. In this article, the second predefined size may be 16.

[0427] On the other hand, when the type of frequency transform of the current block is DCT-2, a region within the current block whose size is equal to or greater than a third predefined size is determined as a zeroing region. Here, the third predefined size may be 32.

[0428] Furthermore, in step S3220, the apparatus for decoding an image may partition an area other than the zeroing area within the current block in units of transform coefficient groups.

[0429] Here, the size of the transform coefficient group may be determined based on the width and height of the current block. Specifically, when the width or height of the current block is less than the fourth predefined size, the size of the transform coefficient group is determined to be the fifth predefined size. When the width and height of the current block are greater than the fourth predefined size, the size of the transform coefficient group is determined to be the sixth predefined size. Here, the sixth predefined size may be 4, and the fifth predefined size may be 2.

[0430] In addition, when the area of ​​the current block is greater than the predefined area and the shape of the current block is a non-square shape, the shape of the transform coefficient group is determined to be a non-square shape. Here, the predefined area may be 8.

[0431] Furthermore, in step S3230, the apparatus for decoding an image may decode the transform coefficient in units of transform coefficient groups.

[0432] Referenced above Fig.32 A method for decoding an image is described.

[0433] Can be referenced Fig.32 The described method of decoding an image is similar to the description of the method of encoding an image of the present invention, so that redundant description will be omitted.

[0434] The bit stream generated by the method of encoding an image of the present invention may be temporarily stored in a recording medium.

[0435] The above-described embodiments may be performed in the same manner in an encoder and a decoder.

[0436] At least one or a combination of the above embodiments may be used to encode / decode a video.

[0437] The order in which the above-described embodiments are applied may be different between the encoder and the decoder, or the order in which the above-described embodiments are applied may be the same in the encoder and the decoder.

[0438] The above-described embodiments may be performed on each of a luminance signal and a chrominance signal, or may be performed identically on the luminance signal and the chrominance signal.

[0439] The block shape to which the above-described embodiment of the present invention is applied may have a square shape or a non-square shape.

[0440] The above-mentioned embodiments of the present invention may be applied according to the size of at least one of a coding block, a prediction block, a transform block, a block, a current block, a coding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as a minimum size or a maximum size or both a minimum size and a maximum size, so that the above-mentioned embodiments are applied, or may be defined as a fixed size to which the above-mentioned embodiments are applied. In addition, in the above-mentioned embodiments, the first embodiment may be applied to a first size, and the second embodiment may be applied to a second size. In other words, the above-mentioned embodiments may be applied according to size combinations. In addition, the above-mentioned embodiments may be applied when the size is equal to or greater than the minimum size and equal to or less than the maximum size. In other words, the above-mentioned embodiments may be applied when the block size is included in a specific range.

[0441] For example, when the size of the current block is 8×8 or larger, the above embodiment may be applied. For example, when the size of the current block is 4×4 or larger, the above embodiment may be applied. For example, when the size of the current block is 16×16 or larger, the above embodiment may be applied. For example, when the size of the current block is equal to or larger than 16×16 and equal to or smaller than 64×64, the above embodiment may be applied.

[0442] The above-described embodiments of the present invention may be applied according to time layers. In order to identify the time layers to which the above-described embodiments may be applied, a corresponding identifier may be transmitted by a signal, and the above-described embodiments may be applied to the specified time layers identified by the corresponding identifiers. Here, the identifier may be defined as the lowest layer or the highest layer or both the lowest layer and the highest layer to which the above-described embodiments may be applied, or may be defined as a specific layer indicating that the embodiment is applied. In addition, a fixed time layer to which the embodiment is applied may be defined.

[0443] For example, when the temporal layer of the current image is the lowest layer, the above embodiment may be applied. For example, when the temporal layer identifier of the current image is 1, the above embodiment may be applied. For example, when the temporal layer of the current image is the highest layer, the above embodiment may be applied.

[0444] A slice type or a tile group type to which the above-described embodiments of the present invention are applied may be defined, and the above-described embodiments may be applied according to the corresponding slice type or tile group type.

[0445] 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, but some steps may be performed simultaneously with other steps or in a different order. In addition, it should be understood by those of ordinary skill in the art that the steps in the flowchart are not mutually exclusive, and other steps may be added to the flowchart, or some steps may be deleted from the flowchart without affecting the scope of the present invention.

[0446] The embodiments include various aspects of the examples. All possible combinations of the various aspects may not be described, but those skilled in the art will be able to recognize different combinations. Therefore, the present invention may include all substitutions, modifications and changes within the scope of the claims.

[0447] Embodiments of the present invention may be implemented in the form of program instructions, wherein the program instructions may be executed by various computer components and 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 known to a person of ordinary skill in the field of computer software technology. Examples of computer-readable recording media include magnetic recording media, such as hard disks, floppy disks, and magnetic tapes; optical data storage media, such as CD-ROMs or DVD-ROMs; magnetic optimal media, such as floppy disks; and hardware devices, such as read-only memories (ROMs), random access memories (RAMs), flash memories, etc., which are specifically constructed to store and implement program instructions. Examples of program instructions include not only machine language codes formatted by a compiler, but also high-level language codes that can be implemented by a computer using an interpreter. The hardware device may be configured to be operated by one or more software modules to perform processing according to the present invention, and vice versa.

[0448] Although the present invention has been described according to specific items such as detailed elements and limited embodiments and drawings, they are provided only to help more generally understand the present invention, and the present invention is not limited to the above embodiments. It will be appreciated by those skilled in the art that various modifications and changes can be made from the above description.

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

[0450] Industrial Applicability

[0451] The present invention can be used in an apparatus for encoding / decoding an image.

Claims

1. A method for decoding an image, the method comprising: Determine the non-return-to-zero area of ​​the current block; Partitioning the non-return-to-zero region in units of transform coefficient groups; Decoding the transform coefficients of the non-return-to-zero area in units of transform coefficient groups; Generating a residual block of the current block based on the transform coefficients of the non-return-to-zero area; as well as generating a reconstructed block of the current block based on the residual block of the current block, Wherein, when the width and height of the non-return-to-zero region are smaller than the first predefined size, the size of the transform coefficient group is determined to be the second predefined size, When the width and height of the non-return-to-zero area are greater than the first predefined size, determining the size of the transform coefficient group to be a third predefined size, The third predefined size is larger than the second predefined size.

2. The method according to claim 1, wherein: When a width or a height of the non-return-to-zero region is smaller than a first predefined size and an area of ​​the non-return-to-zero region is larger than a predefined area, the shape of the transform coefficient group is determined to be a non-square shape.

3. A method for encoding an image, the method comprising: Generate a residual block of the current block; generating a transform coefficient of the current block based on a residual block of the current block; Determining a non-return-to-zero region of the current block; Partitioning the non-return-to-zero region in units of transform coefficient groups; and The transform coefficients of the non-return-to-zero region are encoded in units of transform coefficient groups. Wherein, when the width and height of the non-return-to-zero region are smaller than the first predefined size, the size of the transform coefficient group is determined to be the second predefined size, When the width and height of the non-return-to-zero area are greater than the first predefined size, determining the size of the transform coefficient group to be a third predefined size, The third predefined size is larger than the second predefined size.

4. The method according to claim 3, wherein: When a width or a height of the non-return-to-zero region is smaller than a first predefined size and an area of ​​the non-return-to-zero region is larger than a predefined area, the shape of the transform coefficient group is determined to be a non-square shape.

5. A non-transitory computer-readable recording medium storing a bit stream generated by a method for encoding an image, in, The method comprises: Generate a residual block of the current block; generating a transform coefficient of the current block based on a residual block of the current block; Determining a non-return-to-zero region of the current block; Partitioning the non-return-to-zero region in units of transform coefficient groups; and The transform coefficients are encoded in units of transform coefficient groups. Wherein, when the width and height of the non-return-to-zero region are smaller than the first predefined size, the size of the transform coefficient group is determined to be the second predefined size, When the width and height of the non-return-to-zero area are greater than the first predefined size, determining the size of the transform coefficient group to be a third predefined size, The third predefined size is larger than the second predefined size.