Image encoding / decoding method

By deducing the encoding information and motion vector difference of the current block from adjacent blocks, and using a multi-transformation scheme, the problem of low encoding efficiency of high-resolution images is solved, and more efficient encoding and decoding is achieved, reducing transmission and storage costs.

CN115914625BActive Publication Date: 2025-07-11ELECTRONICS & TELECOMM RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211602572.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2016-08-01
Filing Date
2017-07-18
Publication Date
2025-07-11
Estimated Expiration
2037-07-18

AI Technical Summary

Technical Problem

The prior art has the problem of low encoding efficiency in high-resolution and high-quality image encoding, especially in the case of increased transmission and storage costs. The traditional motion compensation method only uses one-way prediction and two-way prediction, which limits the improvement of encoding efficiency.

Method used

By deducing the encoding information of the current block from the reconstruction block adjacent to the current block, including the encoding/decoding method of the motion vector difference and the motion vector difference, the first transformation and quadratic transformation scheme are adopted to improve the encoding efficiency by utilizing the motion information of the adjacent block and the intra prediction mode.

Benefits of technology

Improve image encoding/decoding efficiency, reduce transmission and storage costs, and enhance the accuracy and efficiency of encoded information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914625B_ABST
    Figure CN115914625B_ABST
Patent Text Reader

Abstract

An image encoding / decoding method is provided. The present invention relates to a method for performing motion compensation using motion vector prediction. An image decoding method for this method may include the following steps: obtaining a quantized residual signal for a current block; dequantizing the quantized residual signal; and determining a transform scheme for performing an inverse transform on the residual signal. The inverse transform includes a first transform and a second transform, and at least one of the first transform scheme and the second transform scheme can be derived from the already decoded reconstructed blocks around the current block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with an application date of July 18, 2017, an application number of 201780048129.1, and a title of "Image Encoding / Decoding Method". Technical Field

[0002] The present invention relates to a method and apparatus for encoding / decoding an image. More specifically, the present invention relates to a method and apparatus for deriving encoding information of a current block by using encoding information of neighboring blocks. Background Art

[0003] Recently, the demand for high-resolution and high-quality images such as high-definition (HD) images and ultra-high-definition (UHD) images has increased in various application fields. However, image data with higher resolution and quality has an increased data volume compared to traditional image data. Therefore, when transmitting image data through a medium such as a traditional wired or wireless broadband network, or when storing image data by using a traditional storage medium, the cost of transmission and storage increases. To solve these problems that occur as the resolution and quality of image data increase, an efficient image encoding / decoding technique for higher resolution and higher quality images is required.

[0004] Image compression techniques include various techniques, including: an inter-frame prediction technique 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 technique for predicting pixel values included in a current picture by using pixel information in the current picture; a transform and quantization technique for compressing the energy of a residual signal; an entropy encoding technique for assigning a short code to a value with a high occurrence frequency and a long code to a value with a low occurrence frequency; and so on. Image data can be effectively compressed by using such image compression techniques and can be transmitted or stored.

[0005] In traditional motion compensation, only a spatial motion vector candidate, a temporal motion vector candidate, and a zero motion vector candidate are added to a motion vector candidate list to be used, and only uni-directional prediction and bi-directional prediction are used, so there are limitations in improving encoding efficiency. Summary of the Invention

[0006] Technical Problem

[0007] An object of the present invention is to provide a method and apparatus for deriving encoding information of a current block from a reconstructed block adjacent to the current block.

[0008] Another object of the present invention is to provide a method and apparatus for encoding / decoding a difference between a motion vector difference of a block adjacent to a current block and a motion vector difference of the current block.

[0009] Technical Solution

[0010] According to the present invention, an image encoding method includes: generating a prediction signal for a current block; generating a residual signal for the current block based on the prediction signal; determining a transform scheme for transforming the residual signal; and performing quantization on the residual signal. Here, the transform includes a first transform and a second transform, and at least one of the first transform scheme and the second transform scheme is derived from an encoded reconstruction block adjacent to the current block.

[0011] According to the present invention, an image decoding method includes: obtaining a quantized residual signal for a current block; performing inverse quantization on the quantized residual signal; and determining a transform scheme for inverse-transforming the residual signal. Here, the inverse transform includes a first transform and a second transform, and at least one of the first transform scheme and the second transform scheme is derived from a decoded reconstruction block adjacent to the current block.

[0012] In the image encoding method or the image decoding method, when the prediction signal is generated by intra prediction, at least one of the first transform scheme and the second transform scheme can be derived from a neighboring block having the same intra prediction mode as the intra prediction mode of the current block.

[0013] In the image encoding method or the image decoding method, when the first transform scheme of a neighboring block having the same intra prediction mode as the intra prediction mode of the current block indicates a transform skip, the first transform scheme and the second transform scheme of the current block can be determined as a transform skip.

[0014] In the image encoding method or the image decoding method, the second transform scheme can be derived from a neighboring block having the same first transform scheme as the first transform scheme of the current block.

[0015] In the image encoding method or the image decoding method, when the prediction signal is generated by inter prediction, at least one of the first transform scheme and the second transform scheme is derived from a neighboring block having the same motion information as the motion information of the current block.

[0016] In the image encoding method or the image decoding method, the motion information may include at least one of a motion vector, a reference picture index, and a reference picture direction.

[0017] Technical Effects

[0018] According to the present invention, the encoding / decoding efficiency can be improved by providing a method and an apparatus for deriving encoding information of a current block from a reconstruction block adjacent to the current block.

[0019] According to the present invention, the encoding / decoding efficiency can be improved by a method and an apparatus for encoding / decoding a difference between a motion vector difference between a current block and an adjacent block and the motion vector difference of the current block. Brief Description of the Drawings

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

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

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

[0023] Figure 4 is a diagram showing the form of a prediction unit (PU) that may be included in a coding unit (CU).

[0024] Figure 5 is a diagram showing the form of a transform unit (TU) that may be included in a coding unit (CU).

[0025] Figure 6 is a diagram for explaining an embodiment of the process of intra prediction.

[0026] Figure 7 is a diagram for explaining an embodiment of the process of inter prediction.

[0027] Figure 8 is a diagram for explaining a set of transforms according to an intra prediction mode.

[0028] Figure 9 is a diagram for explaining the process of transformation.

[0029] Figure 10 is a diagram for explaining the scanning of quantized transform coefficients.

[0030] Figure 11 is a diagram for explaining block partitioning.

[0031] Figure 12 is a diagram showing an example of an encoding / decoding unit according to the partition form of a block.

[0032] Figure 13 is a flowchart showing the process of determining whether to decode information on binary tree partitioning.

[0033] Figure 14 is a flowchart showing the process of determining whether to decode information on binary tree partitioning.

[0034] Figures 15 to 17 is a diagram showing an example of a case where binary tree partitioning is no longer performed for blocks having a predetermined size or smaller.

[0035] Figure 18It is a flowchart showing a process of determining encoding information for deriving a residual signal of a current block from neighboring blocks when the current block is encoded by intra prediction.

[0036] Figure 19 It is a flowchart showing a process of determining encoding information for deriving a residual signal of a current block from neighboring blocks when the current block is encoded by inter prediction.

[0037] Figure 20 It is a flowchart showing a decoding process of a motion vector of a current block.

[0038] Figure 21 It is a diagram showing an example of deriving spatial motion vector candidates.

[0039] Figure 22 It is a diagram showing an example of deriving temporal motion vector candidates.

[0040] Figure 23 It is a diagram showing the derivation of a second motion vector difference. Detailed Description

[0041] Inventive Mode

[0042] Various modifications can be made to the present invention, and there are various embodiments of the present invention. Herein, examples of the embodiments will now be provided with reference to the accompanying drawings and will be described in detail. However, the present invention is not limited thereto, although the exemplary embodiments can be construed as including all modifications, equivalents, or alternative forms within the technical concept and scope of the present invention. Similar reference numerals refer to functions that are the same or similar in all aspects. In the 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 drawings that illustrate specific embodiments in which the present invention can be implemented by way of illustration. These embodiments are described in sufficient detail to enable those skilled in the art to practice the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics associated with one embodiment described herein can be implemented in other embodiments without departing from the spirit and scope of the present disclosure. In addition, it should be understood that the positions or arrangements of the individual elements within each disclosed embodiment can be modified without departing from the spirit and scope of the present disclosure. Accordingly, the following detailed description is not to be taken in a limiting sense, and the scope of the present disclosure is defined only by the appended claims (and, where appropriate, the full scope of equivalents claimed by the claims).

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

[0044] It will be understood that in this specification, when an element is simply referred to as "connected to" or "coupled to" another element rather than "directly connected to" or "directly coupled to" another element, it may be "directly connected to" or "directly coupled to" another element, or connected to or coupled to another element with other elements inserted therebetween. Conversely, it should be understood that when an element is referred to as "directly coupled" or "directly connected" to another element, there is no intermediate element.

[0045] In addition, the constituent components shown in the embodiments of the present invention are shown independently to present different characteristic functions from each other. Therefore, this does not mean that each constituent component is constituted as a separate hardware or software constituent unit. In other words, for convenience, each constituent component includes each of the enumerated constituent components. Therefore, at least two constituent components in each constituent component may be combined to form one constituent component, or one constituent component may be divided into multiple constituent components to perform each function. Embodiments in which each constituent component is combined and embodiments in which one constituent component is divided are also included in the scope of the present invention without departing from the essence of the present invention.

[0046] The terms used in this specification are only for describing specific embodiments and are not intended to limit the present invention. Expressions used in the singular include plural expressions unless they have a clearly different meaning in the context. In this specification, it will be understood that terms such as "including...", "having...", etc. are intended to indicate the existence of features, quantities, steps, actions, elements, components, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, quantities, steps, actions, elements, components, or combinations thereof may exist or may be added. In other words, when a specific element is referred to as "being included", elements other than the corresponding element are not excluded, but rather, additional elements may be included in the embodiments of the present invention or within the scope of the present invention.

[0047] In addition, some constituent elements may not be indispensable constituent elements for performing the essential functions of the present invention, but rather optional constituent elements for merely enhancing its performance. The present invention can be implemented by including only the essential indispensable constituent components for implementing the present invention and excluding the constituent components used for enhancing performance. A structure that includes only the indispensable constituent components and excludes the optional constituent components used for merely enhancing performance is also included within the scope of the present invention.

[0048] 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 will not be described in detail because they would unnecessarily obscure the understanding of the present invention. The same constituent elements in the drawings are denoted by the same reference numerals, and repeated descriptions of the same elements will be omitted.

[0049] In addition, hereinafter, an image may mean a frame constituting a video, or may mean the video itself. For example, "encoding or decoding an image or performing encoding and decoding" may mean "encoding or decoding a video or performing encoding and decoding", and may mean "encoding or decoding or performing encoding and decoding on one image among a plurality of images of a video". Here, a frame and an image may have the same meaning.

[0050] Term Description

[0051] Encoder: May mean a device that performs encoding.

[0052] Decoder: May mean a device that performs decoding.

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

[0054] Block: May mean samples of an M×N matrix. Here, M and N are positive integers, and a block may mean a matrix of samples in a two-dimensional form.

[0055] Sample: Is the basic unit of a block, and may indicate a value ranging from 0 to 2Bd–1 according to the bit depth (Bd). A sample may mean a pixel in the present invention.

[0056] Unit: It can mean a unit for encoding and decoding an image. When encoding and decoding an image, the unit can be a region generated by partitioning an image. In addition, the unit can mean a sub-partitioning unit when an image is partitioned into multiple sub-partitioning units during encoding or decoding. When encoding and decoding an image, a predetermined process can be performed for each unit. A unit can be partitioned into sub-units with a size smaller than the size of the unit. Depending on the function, the unit can mean 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 transform unit, a transform block, etc. In addition, in order to distinguish the unit from the block, the unit can include a luminance component block, a chrominance component block of the luminance component block, and syntax elements of each color component block. The unit can have various sizes and shapes. Specifically, the shape of the unit can be a two-dimensional geometric figure, such as a rectangle, a square, a trapezoid, a triangle, a pentagon, etc. In addition, the unit information can include at least one of the unit type (indicating a coding unit, a prediction unit, a transform unit, etc.), the unit size, the unit depth, the order of encoding and decoding the unit, etc.

[0057] Reconstructed neighboring unit: It can mean a reconstructed unit that has been encoded or decoded earlier in space / time, and the reconstructed unit is adjacent to the encoding / decoding target unit. Here, the reconstructed neighboring unit can mean a reconstructed neighboring block.

[0058] Neighboring block: It can mean a block adjacent to the encoding / decoding target block. A block adjacent to the encoding / decoding target block can mean a block having a boundary in contact with the encoding / decoding target block. The neighboring block can mean a block located at the adjacent vertices of the encoding / decoding target block. The neighboring block can mean a reconstructed neighboring block.

[0059] Unit depth: It can mean the degree of partitioning of the unit. In a tree structure, the root node can be the highest node, and the leaf node can be the lowest node.

[0060] Symbol: It can mean the syntax elements of the encoding / decoding target unit, the encoding parameters, the values of the transform coefficients, etc.

[0061] Parameter set: It can mean the header information in the structure of the bitstream. The parameter set can include at least one of a video parameter set, a sequence parameter set, a picture parameter set, or an adaptive parameter set. In addition, the parameter set can mean slice header information and parallel block (tile) header information, etc.

[0062] Bitstream: It can mean a bit string including encoded image information.

[0063] Prediction Unit: It can be meant as the basic unit when performing inter-frame prediction, intra-frame prediction, and compensation for the prediction. A prediction unit can be partitioned into multiple partitions. In this case, each of the multiple partitions can be the basic unit when performing prediction and compensation, and each partition partitioned from the prediction unit can be a prediction unit. In addition, a prediction unit can be partitioned into multiple small prediction units. The prediction unit can have various sizes and shapes, and specifically, the shape of the prediction unit can be a two-dimensional geometric figure, such as a rectangle, square, trapezoid, triangle, pentagon, etc.

[0064] Prediction Unit Partition: It can be meant as the shape of the partitioned prediction unit.

[0065] Reference Picture List: It can be meant as a list including at least one reference picture, where the at least one reference picture is used for inter-frame prediction or motion compensation. The types of the reference picture list can be List Combined (LC), List 0 (L0), List 1 (L1), List 2 (L2), List 3 (L3), etc. At least one reference picture list can be used for inter-frame prediction.

[0066] Inter-frame Prediction Indicator: It can be meant as one of the following: the inter-frame prediction direction (unidirectional prediction, bidirectional prediction, etc.) of the coding / decoding target block in the case of inter-frame prediction, the number of reference pictures used to generate the prediction block through the coding / decoding target block, and the number of reference blocks used to perform inter-frame prediction or motion compensation through the coding / decoding target block.

[0067] Reference Picture Index: It can be meant as the index of a specific reference picture in the reference picture list.

[0068] Reference Picture: It can be meant as the picture that a specific unit refers to for inter-frame prediction or motion compensation. The reference image can be referred to as the reference picture.

[0069] Motion Vector: It is a two-dimensional vector used for inter-frame prediction or motion compensation, and can be meant as the offset between the coding / decoding target picture and the reference picture. For example, (mvX, mvY) can indicate the motion vector, where mvX can indicate the horizontal component and mvY can indicate the vertical component.

[0070] Motion Vector Candidate: It can be meant as the unit that becomes a prediction candidate when predicting the motion vector, or can be meant as the motion vector of the unit.

[0071] Motion Vector Candidate List: It can be meant as a list configured by using motion vector candidates.

[0072] Motion Vector Candidate Index: It can be meant as the indicator that indicates the motion vector candidate in the motion vector candidate list. The motion vector candidate index can be referred to as the index of the motion vector predictor.

[0073] Motion information: It can mean motion vectors, reference picture indices, and inter-prediction indicators, and information including at least one of reference picture list information, reference pictures, motion vector candidates, motion vector candidate indices, etc.

[0074] Merge candidate list: It can mean a list configured by using merge candidates.

[0075] Merge candidate: It can include spatial merge candidates, temporal merge candidates, combined merge candidates, combined bi-prediction merge candidates, zero merge candidates, etc. A merge candidate can include motion information such as prediction type information, reference picture indices for each list, motion vectors, etc.

[0076] Merge index: It can mean information indicating a merge candidate in a merge candidate list. In addition, the merge index can indicate a block of a derived merge candidate among reconstructed blocks that are spatially / temporally adjacent to the current block. In addition, the merge index can indicate at least one motion information among multiple motion informations of a merge candidate.

[0077] Transformation unit: It can mean a basic unit when performing encoding / decoding similar to transformation, inverse transformation, quantization, dequantization, and transformation coefficient encoding / decoding on a residual signal. A transformation unit can be partitioned into multiple small transformation units. The transformation unit can have various sizes and shapes. Specifically, the shape of the transformation unit can be a two-dimensional geometric figure such as a rectangle, square, trapezoid, triangle, pentagon, etc.

[0078] Scaling: It can mean a process of multiplying a factor by a transformation coefficient level, as a result of which transformation coefficients can be generated. Scaling can also be referred to as dequantization.

[0079] Quantization parameter: It can mean a value used when scaling a transformation coefficient level during quantization and dequantization. Here, the quantization parameter can be a value mapped to a quantization step size.

[0080] Delta quantization parameter: It can mean the difference between the quantization parameter of an encoding / decoding target unit and a predicted quantization parameter.

[0081] Scanning: It can mean a method of sorting the order of coefficients within a block or matrix. For example, the operation of sorting a two-dimensional matrix into a one-dimensional matrix can be called scanning, and the operation of sorting a one-dimensional matrix into a two-dimensional matrix can be called scanning or inverse scanning.

[0082] Transformation coefficient: It can mean a coefficient value generated after performing a transformation. In the present invention, a quantized transformation coefficient level (i.e., a transformation coefficient to which quantization has been applied) can be called a transformation coefficient.

[0083] Non-zero transform coefficient: It can mean a transform coefficient with a value not equal to 0, or it can mean a level of transform coefficient with a value not equal to 0.

[0084] Quantization matrix: It can mean a matrix used in quantization and inverse quantization to improve the subject quality or object quality of an image. The quantization matrix can be referred to as a scaling list.

[0085] Quantization matrix coefficient: It can mean each element of the quantization matrix. The quantization matrix coefficient can be referred to as a matrix coefficient.

[0086] Default matrix: It can mean a predetermined quantization matrix pre-defined in the encoder and decoder.

[0087] Non-default matrix: It can mean a quantization matrix sent / received by a user when it is not pre-defined in the encoder and decoder.

[0088] Coding tree unit: It can be composed of a luma component (Y) coding tree unit and two related chroma component (Cb, Cr) coding tree units. Each coding tree unit can be partitioned by using at least one partitioning method (such as a quadtree, binary tree, etc.) to form sub-units, such as coding units, prediction units, transform units, etc. The coding tree unit can be used as a term for indicating a pixel block (where the pixel block is a processing unit in the decoding / encoding process of an image, such as the partitioning of an input image).

[0089] Coding tree block: It can be used as a term for indicating one of the Y coding tree unit, Cb coding tree unit, and Cr coding tree unit.

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

[0091] Encoding device 100 can be a video encoding device or an image encoding device. The video can include one or more images. Encoding device 100 can encode one or more images of the video in chronological order.

[0092] Refer to Figure 1 , encoding device 100 can include a motion prediction unit 111, a motion compensation unit 112, an intra prediction unit 120, a switcher 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.

[0093] The encoding device 100 can encode an input picture in an intra mode, an inter mode, or both the intra mode and the inter mode. In addition, the encoding device 100 can generate a bitstream by encoding the input picture and can output the generated bitstream. When the intra mode is used as a prediction mode, the switcher 115 can switch to intra. When the inter mode is used as a prediction mode, the switcher 115 can switch to inter. Here, the intra mode can be referred to as an intra prediction mode, and the inter mode can be referred to as an inter prediction mode. The encoding device 100 can generate a prediction block of an input block of the input picture. In addition, after generating the prediction block, the encoding device 100 can encode the residual between the input block and the prediction block. The input picture can be referred to as the current picture that is the target of current encoding. The input block can be referred to as the current block or can be referred to as the encoding target block that is the target of current encoding.

[0094] When the prediction mode is the intra mode, the intra prediction unit 120 can use the pixel values of previously encoded blocks adjacent to the current block as reference pixels. The intra prediction unit 120 can perform spatial prediction by using the reference pixels and can generate prediction samples of the input block by using the spatial prediction. Here, the intra prediction can mean intra-frame prediction.

[0095] When the prediction mode is the inter mode, the motion prediction unit 111 can search for a region that best matches the input block in the reference picture in the motion prediction process and can derive a motion vector by using the searched region. The reference picture can be stored in the reference picture buffer 190.

[0096] The motion compensation unit 112 can generate a prediction block by performing motion compensation by using the motion vector. Here, the motion vector can be a two-dimensional vector for inter prediction. In addition, the motion vector can indicate the offset between the current picture and the reference picture. Here, the inter prediction can mean inter-frame prediction.

[0097] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 can generate a prediction block by applying an interpolation filter to a partial region in the reference picture. In order to perform inter prediction or motion compensation based on an encoding unit, it is possible to determine which method among the skip mode, the merge mode, the AMVP mode, and the current picture reference mode to use for the motion prediction and compensation method of the prediction unit in the encoding unit. Inter prediction or motion compensation can be performed according to each mode. Here, the current picture reference mode can mean a prediction mode that uses a pre-reconstructed region of the current picture having the encoding target block. In order to specify the pre-reconstructed region, a motion vector for the current picture reference mode can be defined. Whether to encode the encoding target block according to the current picture reference mode can be encoded by using the reference picture index of the encoding target block.

[0098] The subtractor 125 can generate a residual block by using the residual between the input block and the prediction block. The residual block may be referred to as a residual signal.

[0099] The transform unit 130 can generate transform coefficients by transforming the residual block and can output the transform coefficients. Here, the transform coefficients may be the coefficient values generated by transforming the residual block. In the transform skip mode, the transform unit 130 can skip the transformation of the residual block.

[0100] Quantized transform coefficient levels can be generated by applying quantization to the transform coefficients. Hereinafter, in the embodiments of the present invention, the quantized transform coefficient levels may be referred to as transform coefficients.

[0101] The quantization unit 140 can generate quantized transform coefficient levels by quantizing the transform coefficients according to quantization parameters and can output the quantized transform coefficient levels. Here, the quantization unit 140 can quantize the transform coefficients by using a quantization matrix.

[0102] The entropy coding unit 150 can generate a bitstream by performing entropy coding on the values calculated by the quantization unit 140 or on the coding parameter values calculated during the coding process according to the probability distribution, and can output the generated bitstream. The entropy coding unit 150 can perform entropy coding on the information for decoding the image and perform entropy coding on the information of the pixels of the image. For example, the information for decoding the image may include syntax elements and the like.

[0103] When entropy coding is applied, symbols are represented by assigning a small number of bits to symbols with a high occurrence probability and a large number of bits to symbols with a low occurrence probability, thereby reducing the size of the bitstream for encoding the target symbols. Therefore, through entropy coding, the compression performance of image coding can be improved. For entropy coding, the entropy coding unit 150 can use coding methods such as exponential Golomb, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC). For example, the entropy coding unit 150 can perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 can derive the binarization method of the target symbols and the probability model of the target symbols / bits, and then can perform arithmetic coding by using the derived binarization method or the derived probability model.

[0104] To encode the transform coefficient levels, the entropy encoding unit 150 may change the coefficients in a two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method. For example, by scanning the coefficients of a block with a top-right scan, the coefficients in a two-dimensional form can be changed into a one-dimensional vector. Depending on the size of the transform unit and the intra prediction mode, a vertical scan for scanning the coefficients in a two-dimensional block form along the column direction and a horizontal scan for scanning the coefficients in a two-dimensional block form along the row direction may be used instead of the top-right scan. That is, depending on the size of the transform unit and the intra prediction mode, it can be determined which scan method among the top-right scan, the vertical scan, and the horizontal scan will be used.

[0105] Encoding parameters may include information such as syntax elements encoded by an encoder and sent to a decoder, and may include information that can be derived during an encoding or decoding process. Encoding parameters may mean information necessary for encoding or decoding an image. For example, encoding parameters may include at least one value or a combined form of the following items: block size, block depth, block partitioning information, unit size, unit depth, unit partitioning information, quadtree-form partitioning flags, binary-tree-form partitioning flags, binary-tree-form partitioning directions, intra prediction modes, intra prediction directions, reference sample filtering methods, prediction block boundary filtering methods, filter taps, filter coefficients, inter prediction modes, motion information, motion vectors, reference picture indices, inter prediction directions, inter prediction indicators, reference picture lists, motion vector predictors, motion vector candidate lists, information on whether a motion merge mode is used, motion merge candidates, motion merge candidate lists, information on whether a skip mode is used, interpolation filter types, motion vector sizes, precisions of motion vector representations, transform types, transform sizes, information on whether an additional (secondary) transform is used, information on whether a residual signal exists, coding block styles, coding block flags, quantization parameters, quantization matrices, in-loop filter information, information on whether a filter is applied in-loop, in-loop filter coefficients, binarization / de-binarization methods, context models, context bits, bypass bits, transform coefficients, transform coefficient levels, transform coefficient level scanning methods, image display / output order, slice identification information, slice types, slice partitioning information, parallel block identification information, parallel block types, parallel block partitioning information, picture types, bit depths, and information on luminance signals or chrominance signals.

[0106] A residual signal may mean the difference between an original signal and a prediction signal. Alternatively, a residual signal may be a signal generated by transforming the difference between an original signal and a prediction signal. Alternatively, a residual signal may be a signal generated by transforming and quantizing the difference between an original signal and a prediction signal. A residual block may be a residual signal of a block unit.

[0107] When the encoding device 100 performs encoding by using inter-frame prediction, the currently encoded picture can be used as a reference picture for another image to be subsequently processed. Therefore, the encoding device 100 can decode the currently encoded picture and can store the decoded image as a reference picture. To perform decoding, inverse quantization and inverse transformation can be performed on the currently encoded picture.

[0108] The quantized coefficients can be inverse quantized by the inverse quantization unit 160 and can be inverse transformed by the inverse transformation unit 170. The coefficients that have been inverse quantized and inverse transformed can be added to the prediction block by the adder 175, whereby a reconstructed block can be generated.

[0109] The reconstructed block can pass through the filter unit 180. The filter unit 180 can apply at least one of a deblocking filter, sample adaptive offset (SAO), and adaptive loop filter (ALF) to the reconstructed block or the reconstructed picture. The filter unit 180 can be referred to as a loop filter.

[0110] The deblocking filter can remove block distortion that appears at the boundaries between blocks. To determine whether the deblocking filter is to be run, it can be determined whether the deblocking filter is to be applied to the current block based on pixels in several rows or columns included in the block. When the deblocking filter is applied to a block, a strong filter or a weak filter can be applied according to the required deblocking filtering strength. In addition, when applying the deblocking filter, horizontal direction filtering and vertical direction filtering can be processed in parallel.

[0111] Sample adaptive offset can add an optimal offset value to the pixel value to compensate for encoding errors. Sample adaptive offset can correct the offset between the deblocked filtered image and the original picture for each pixel. To perform offset correction on a specific picture, a method of applying an offset considering the edge information of each pixel can be used, or a method of partitioning the pixels of the image into a predetermined number of regions, determining the regions for which offset correction is to be performed, and applying offset correction to the determined regions can be used.

[0112] The adaptive loop filter can perform filtering based on a value obtained by comparing the reconstructed picture with the original picture. The pixels of the image can be partitioned into predetermined groups, one filter to be applied to each group is determined, and different filtering can be performed on each group. Information on whether the adaptive loop filter is to be applied to the luminance signal can be sent for each coding unit (CU). The shape and filter coefficients of the adaptive loop filter applied to each block can vary. In addition, an adaptive loop filter having the same form (fixed form) can be applied without considering the characteristics of the target block.

[0113] The reconstructed block that has passed through the filter unit 180 can be stored in the reference picture buffer 190.

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

[0115] The decoding device 200 may be a video decoding device or an image decoding device.

[0116] Referring to Figure 2 , the decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transformation unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference picture buffer 270.

[0117] The decoding device 200 may receive a bitstream output from the encoding device 100. The decoding device 200 may decode the bitstream in an intra mode or an inter mode. In addition, the decoding device 200 may generate a reconstructed picture by performing decoding and may output the reconstructed picture.

[0118] When the prediction mode used in decoding is the intra mode, the switcher may be switched to intra. When the prediction mode used in decoding is the inter mode, the switcher may be switched to inter.

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

[0120] The entropy decoding unit 210 may generate symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols may include symbols having quantized transform coefficient levels. Here, the method of entropy decoding may be similar to the method of entropy encoding described above. For example, the method of entropy decoding may be an inverse process of the method of entropy encoding described above.

[0121] In order to decode the transform coefficient levels, the entropy decoding unit 210 may perform transform coefficient scanning, whereby coefficients in a one-dimensional vector form may be changed to a two-dimensional block form. For example, by scanning the coefficients of a block with a right-up scan, the coefficients in a one-dimensional vector form may be changed to a two-dimensional block form. Depending on the size of the transform unit and the intra prediction mode, vertical direction scanning and horizontal direction scanning may be used instead of the right-up scan. That is, depending on the size of the transform unit and the intra prediction mode, it may be determined which of the right-up scan, vertical direction scanning, and horizontal direction scanning is used.

[0122] The quantized transform coefficient levels can be inverse quantized by an inverse quantization unit 220 and can be inverse transformed by an inverse transform unit 230. The quantized transform coefficient levels are inverse quantized and inverse transformed to generate a reconstructed residual block. Here, the inverse quantization unit 220 can apply a quantization matrix to the quantized transform coefficient levels.

[0123] When an intra mode is used, an intra prediction unit 240 can generate a prediction block by performing spatial prediction, where the spatial prediction uses pixel values of previously decoded blocks adjacent to a decoding target block.

[0124] When an inter mode is used, a motion compensation unit 250 can generate a prediction block by performing motion compensation, where the motion compensation uses both a reference picture stored in a reference picture buffer 270 and a motion vector. When the value of the motion vector is not an integer, the motion compensation unit 250 can generate a prediction block by applying an interpolation filter to a partial area in the reference picture. To perform motion compensation, based on a coding unit, it can be determined which method among a skip mode, a merge mode, an AMVP mode, and a current picture reference mode is used as the motion compensation method for a prediction unit in the coding unit. In addition, motion compensation can be performed according to the mode. Here, the current picture reference mode can mean a prediction mode that uses a previously reconstructed area within the current picture having a decoding target block. The previously reconstructed area may not be adjacent to the decoding target block. To indicate the previously reconstructed area, a fixed vector can be used for the current picture reference mode. In addition, a flag or index indicating whether the decoding target block is a block decoded according to the current picture reference mode can be signaled and can be derived by using a reference picture index of the decoding target block. The current picture for the current picture reference mode may exist at a fixed position (e.g., a position with a reference picture index of 0 or the last position) within a reference picture list for the decoding target block. In addition, the current picture can be variably located within the reference picture list, and for this, a reference picture index indicating the position of the current picture can be signaled.

[0125] The reconstructed residual block and the prediction block can be added by an adder 255. The block generated by adding the reconstructed residual block and the prediction block can pass through a filter unit 260. 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 picture. The filter unit 260 can output a reconstructed picture. The reconstructed picture can be stored in the reference picture buffer 270 and can be used for inter prediction.

[0126] Figure 3 is a diagram schematically showing a partitioning structure of an image when encoding and decoding an image. Figure 3 Schematically shows an embodiment in which a unit is partitioned into multiple sub - units.

[0127] For effective partitioning of an image, coding units (CUs) can be used in encoding and decoding. Here, a coding unit can be meant as a unit for performing encoding. The unit can be a combination of 1) syntax elements and 2) a block including picture samples. For example, "partitioning of a unit" can be meant as "partitioning of a block related to the unit". Block partitioning information can include information about the depth of the unit. The depth information can indicate the number of times the unit is partitioned or the degree to which the unit is partitioned or both.

[0128] Referring to Figure 3 , the image 300 is sequentially partitioned for each largest coding unit (LCU), and the partitioning structure is determined for each LCU. Here, the LCU and the coding tree unit (CTU) have the same meaning. A unit can have depth information based on a tree structure and can be hierarchically partitioned. Each partitioned sub-unit can have depth information. The depth information indicates the number of times the unit is partitioned or the degree to which the unit is partitioned or both. Thus, the depth information can include information about the size of the sub-unit.

[0129] The partitioning structure can be meant as the distribution of coding units (CUs) in the LCU 310. A CU can be a unit for effectively encoding an image. The distribution can be determined based on whether a CU will be partitioned multiple times (a positive integer equal to or greater than 2, including 2, 4, 8, 16, etc.). The width size and height size of the partitioned CU can be half the width size and half the height size of the original CU, respectively. Optionally, depending on the number of partitions, the width size and height size of the partitioned CU can be less than the width size and height size of the original CU, respectively. The partitioned CU can be recursively partitioned into multiple further partitioned CUs, where, according to the same partitioning method, the further partitioned CUs have width sizes and height sizes smaller than the width size and height size of the partitioned CU.

[0130] Here, the partitioning of the CU can be recursively performed until a predetermined depth. The depth information can be information indicating the size of the CU and can be stored in each CU. For example, the depth of the LCU can be 0, and the depth of the smallest coding unit (SCU) can be a predetermined maximum depth. Here, the LCU can be a coding unit having the maximum size as described above, and the SCU can be a coding unit having the minimum size.

[0131] Whenever the LCU 310 starts to be partitioned and the width size and height size of the CU are reduced by the partitioning operation, the depth of the CU increases by 1. In the case of a CU that cannot be partitioned, the CU can have a 2N×2N size for each depth. In the case of a CU that can be partitioned, a CU having a 2N×2N size can be partitioned into multiple N×N size CUs. Whenever the depth increases by 1, the size of N is halved.

[0132] For example, when a coding unit is partitioned into four sub-coding units, the width dimension and the height dimension of one of the four sub-coding units can be half of the width dimension and half of the height dimension of the original coding unit respectively. For example, when a coding unit of 32×32 size is partitioned into four sub-coding units, each of the four sub-coding units can have a size of 16×16. When a coding unit is partitioned into four sub-coding units, the coding unit can be partitioned in the form of a quadtree.

[0133] For example, when a coding unit is partitioned into two sub-coding units, the width dimension or the height dimension of one of the two sub-coding units can be half of the width dimension or half of the height dimension of the original coding unit respectively. For example, when a coding unit of 32×32 size is vertically partitioned into two sub-coding units, each of the two sub-coding units can have a size of 16×32. For example, when a coding unit of 32×32 size is horizontally partitioned into two sub-coding units, each of the two sub-coding units can have a size of 32×16. When a coding unit is partitioned into two sub-coding units, the coding unit can be partitioned in the form of a binary tree.

[0134] Referring to Figure 3 , the size of the LCU with the minimum depth 0 can be 64×64 pixels, and the size of the SCU with the maximum depth 3 can be 8×8 pixels. Here, a CU (i.e., LCU) with 64×64 pixels can be represented by depth 0, a CU with 32×32 pixels can be represented by depth 1, a CU with 16×16 pixels can be represented by depth 2, and a CU (i.e., SCU) with 8×8 pixels can be represented by depth 3.

[0135] In addition, information on whether a CU will be partitioned can be represented by the partition information of the CU. The partition information can be 1-bit information. The partition information can be included in all CUs except the SCU. For example, when the value of the partition information is 0, the CU may not be partitioned, and when the value of the partition information is 1, the CU may be partitioned.

[0136] Figure 4 is a diagram showing the forms of prediction units (PUs) that can be included in a coding unit (CU).

[0137] Among the multiple CUs partitioned from the LCU, the CUs that are no longer partitioned can be partitioned into at least one prediction unit (PU). This process can also be referred to as partitioning.

[0138] The PU can be a basic unit for prediction. The PU can be encoded and decoded in any one of the skip mode, the inter-frame mode, and the intra-frame mode. The PU can be partitioned in various forms according to the mode.

[0139] In addition, a coding unit may not be partitioned into multiple prediction units, and the coding unit and the prediction unit have the same size.

[0140] As Figure 4 shown, in the skip mode, a CU may not be partitioned. In the skip mode, a 2N×2N mode 410 having the same size as the non-partitioned CU may be supported.

[0141] In the inter-frame mode, 8 partition modes may be supported in a CU. For example, in the inter-frame mode, a 2N×2N mode 410, a 2N×N mode 415, an N×2N mode 420, an N×N mode 425, a 2N×nU mode 430, a 2N×nD mode 435, an nL×2N mode 440, and an nR×2N mode 445 may be supported. In the intra-frame mode, a 2N×2N mode 410 and an N×N mode 425 may be supported.

[0142] A coding unit may be partitioned into one or more prediction units. A prediction unit may be partitioned into one or more sub-prediction units.

[0143] For example, when a prediction unit is partitioned into four sub-prediction units, the width size and the height size of one of the four sub-prediction units may be half of the width size and half of the height size of the original prediction unit. For example, when a 32×32-sized prediction unit is partitioned into four sub-prediction units, each of the four sub-prediction units may have a size of 16×16. When a prediction unit is partitioned into four sub-prediction units, the prediction unit may be partitioned in a quadtree form.

[0144] For example, when a prediction unit is partitioned into two sub-prediction units, the width size or the height size of one of the two sub-prediction units may be half of the width size or half of the height size of the original prediction unit. For example, when a 32×32-sized prediction unit is vertically partitioned into two sub-prediction units, each of the two sub-prediction units may have a size of 16×32. For example, when a 32×32-sized prediction unit is horizontally partitioned into two sub-prediction units, each of the two sub-prediction units may have a size of 32×16. When a prediction unit is partitioned into two sub-prediction units, the prediction unit may be partitioned in a binary tree form.

[0145] Figure 5 is a diagram showing the form of a transform unit (TU) that may be included in a coding unit (CU).

[0146] The transform unit (TU) may be a basic unit for transformation, quantization, inverse transformation, and inverse quantization within a CU. The TU may have a square shape, a rectangular shape, etc. The TU may be independently determined according to the size of the CU, the form of the CU, or both.

[0147] Among the CUs partitioned from the LCU, the non-partitioned CUs can be partitioned into at least one TU. Here, the partitioning structure of the TUs can be a quadtree structure. For example, as Figure 5 shown, a CU 510 can be partitioned one or more times according to the quadtree structure. The case where a CU is partitioned at least once can be referred to as recursive partitioning. By performing partitioning, a CU 510 can be formed by TUs with various sizes. Optionally, a CU can be partitioned into at least one TU according to the number of vertical lines for partitioning the CU or the number of horizontal lines for partitioning the CU or both. A CU can be partitioned into TUs that are symmetric to each other, or can be partitioned into TUs that are not symmetric to each other. To partition a CU into TUs that are symmetric to each other, the information on the size / shape of the TUs can be signaled and can be derived from the information on the size / shape of the CU.

[0148] In addition, a coding unit may not be partitioned into a transform unit, and the coding unit and the transform unit may have the same size.

[0149] A coding unit can be partitioned into at least one transform unit, and a transform unit can be partitioned into at least one sub-transform unit.

[0150] For example, when a transform unit is partitioned into four sub-transform units, the width size and height size of one of the four sub-transform units can be half the width size and half the height size of the original transform unit respectively. For example, when a 32×32-sized transform unit is partitioned into four sub-transform units, each of the four sub-transform units can have a size of 16×16. When a transform unit is partitioned into four sub-transform units, the transform unit can be partitioned in a quadtree form.

[0151] For example, when a transform unit is partitioned into two sub-transform units, the width size or height size of one of the two sub-transform units can be half the width size or half the height size of the original transform unit respectively. For example, when a 32×32-sized transform unit is vertically partitioned into two sub-transform units, each of the two sub-transform units can have a size of 16×32. For example, when a 32×32-sized transform unit is horizontally partitioned into two sub-transform units, each of the two sub-transform units can have a size of 32×16. When a transform unit is partitioned into two sub-transform units, the transform unit can be partitioned in a binary tree form.

[0152] When performing a transform, the residual block may be transformed by using at least one of the predetermined transform methods. For example, the predetermined transform methods may include a discrete cosine transform (DCT), a discrete sine transform (DST), a KLT, etc. Which transform method is applied to transform the residual block may be determined by using at least one of the following: inter prediction mode information of a prediction unit, intra prediction mode information of a prediction unit, and the size / shape of a transform block. Information indicating the transform method may be signaled.

[0153] Figure 6 FIG. is a diagram illustrating an embodiment of a process for explaining intra prediction.

[0154] The intra prediction mode may be a non-directional mode or a directional mode. The non-directional mode may be a DC mode or a planar mode. The directional mode may be a prediction mode having a specific direction or angle, and the number of directional modes may be M which is equal to or greater than 1. The directional mode may be indicated as at least one of a mode number, a mode value, and a mode angle.

[0155] The number of intra prediction modes may be N which is equal to or greater than 1, including the non-directional mode and the directional mode.

[0156] The number of intra prediction modes may vary according to the size of the block. For example, when the size of the block is 4×4 or 8×8, the number of intra prediction modes may be 67, when the size of the block is 16×16, the number of intra prediction modes may be 35, when the size of the block is 32×32, the number of intra prediction modes may be 19, and when the size of the block is 64×64, the number of intra prediction modes may be 7.

[0157] The number of intra prediction modes may be fixed to N regardless of the size of the block. For example, the number of intra prediction modes may be fixed to at least one of 35 or 67 regardless of the size of the block.

[0158] The number of intra prediction modes may vary according to the type of color component. For example, the number of prediction modes may vary according to whether the color component is a luminance signal or a chrominance signal.

[0159] Intra coding and / or decoding may be performed by using sample values or coding parameters included in reconstructed neighboring blocks.

[0160] In order to encode / decode a current block according to intra prediction, it is possible to identify whether the samples included in the reconstructed neighboring blocks can be used as reference samples for the encoding / decoding target block. When there are samples that cannot be used as reference samples for the encoding / decoding target block, by using at least one of the samples included in the reconstructed neighboring blocks, the sample values are copied and / or interpolated to the samples that cannot be used as reference samples, whereby the samples that cannot be used as reference samples can be used as reference samples for the encoding / decoding target block.

[0161] In intra prediction, based on at least one of the intra prediction mode and the size of the encoding / decoding target block, a filter can be applied to at least one of the reference samples or the predicted samples. Here, the encoding / decoding target block can mean the current block, and can mean at least one of an encoded block, a predicted block, and a transformed block. The type of the filter applied to the reference samples or the predicted samples can vary according to at least one of the intra prediction mode or the size / shape of the current block. The type of the filter can vary according to at least one of the number of filter taps, the filter coefficient values, or the filter strength.

[0162] In the non-directional plane mode among the intra prediction modes, when generating a predicted block of the encoding / decoding target block, the sample values in the predicted block can be generated by using the weighted sum of the upper reference sample of the current sample, the left reference sample of the current sample, the upper right reference sample of the current block, and the lower left reference sample of the current block according to the sample position.

[0163] In the non-directional DC mode among the intra prediction modes, when generating a predicted block of the encoding / decoding target block, the predicted block can be generated by the average value of the upper reference sample of the current block and the left reference sample of the current block. In addition, filtering can be performed on one or more upper rows and one or more left columns adjacent to the reference samples in the encoding / decoding block by using the reference sample values.

[0164] In the case of multiple direction modes (angle modes) among the intra prediction modes, the predicted block can be generated by using the upper right reference sample and / or the lower left reference sample, and the multiple direction modes can have different directions. In order to generate the predicted sample values, interpolation of real number units can be performed.

[0165] To perform an intra prediction method, an intra prediction mode of a current prediction block may be predicted from intra prediction modes of neighboring prediction blocks adjacent to the current prediction block. In a case where the intra prediction mode of the current prediction block is predicted by using mode information predicted from neighboring intra prediction modes, when the current prediction block and the neighboring prediction block have the same intra prediction mode, information that the current prediction block and the neighboring prediction block have the same intra prediction mode may be transmitted by using predetermined flag information. When the intra prediction mode of the current prediction block is different from the intra prediction mode of the neighboring prediction block, the intra prediction mode information of the block to be coded / decoded may be coded by performing entropy coding.

[0166] Figure 7 is a diagram for explaining an embodiment of a process of inter prediction.

[0167] Figure 7 The quadrilateral shown in may indicate an image (or picture). In addition, Figure 7 The arrow of may indicate a prediction direction. That is, an image may be coded or decoded, or coded and decoded, according to the prediction direction. According to the coding type, each image may be classified as an I picture (intra picture), a P picture (unidirectional prediction picture), a B picture (bidirectional prediction picture), etc. Each picture may be coded and decoded according to the coding type of each picture.

[0168] When an image to be coded is an I picture, the image itself may be intra-coded without inter prediction. When an image to be coded is a P picture, the image may be coded by performing inter prediction or motion compensation by using only a forward reference picture. When an image to be coded is a B picture, the image may be coded by performing inter prediction or motion compensation by using reference pictures both in the forward and reverse directions. Alternatively, the image may be coded by performing inter prediction or motion compensation by using a reference picture in either the forward or reverse direction. Here, when an inter prediction mode is used, an encoder may perform inter prediction or motion compensation, and a decoder may respond to the encoder performing motion compensation. Images of P pictures and B pictures coded or decoded or coded and decoded by using reference pictures may be regarded as images for inter prediction.

[0169] Hereinafter, inter prediction according to an embodiment will be described in detail.

[0170] Inter prediction or motion compensation may be performed by using both a reference picture and motion information. In addition, the above-described skip mode may be used for inter prediction.

[0171] The reference picture may be at least one of a previous picture and a subsequent picture of the current picture. Here, inter-frame prediction may predict a block of the current picture based on the reference picture. Here, the reference picture may be meant as an image used when predicting a block. An area within the reference picture may be specified by using a reference picture index (refIdx) indicating the reference picture, a motion vector, and the like.

[0172] Inter-frame prediction may select a reference picture and a reference block within the reference picture that is related to the current block. A predicted block of the current block may be generated by using the selected reference block. The current block may be a block among the blocks of the current picture that is a current encoding target or a current decoding target.

[0173] Motion information may be derived from the process of inter-frame prediction by the encoding device 100 and the decoding device 200. In addition, the derived motion information may be used when performing inter-frame prediction. Here, the encoding device 100 and the decoding device 200 may improve encoding efficiency or decoding efficiency or both by using the motion information of a reconstructed neighboring block or a co-located block (col block) or both. A col block may be a block within a previously reconstructed co-located picture (col picture) that is related to the spatial position of the encoding / decoding target block. A reconstructed neighboring block may be a block within the current picture, and a block that has been previously reconstructed by encoding or decoding or both encoding and decoding. In addition, a reconstructed block may be a block adjacent to the encoding / decoding target block, or a block located at an outer corner of the encoding / decoding target block, or both. Here, a block located at an outer corner of the encoding / decoding target block may be a block that is vertically adjacent to a neighboring block that is horizontally adjacent to the encoding / decoding target block. Alternatively, a block located at an outer corner of the encoding / decoding target block may be a block that is horizontally adjacent to a neighboring block that is vertically adjacent to the encoding / decoding target block.

[0174] The encoding device 100 and the decoding device 200 may respectively determine a block existing at a position spatially related to the encoding / decoding target block within the col picture, and may determine a predefined relative position based on the determined block. The predefined relative position may be an inner position or an outer position or both an inner position and an outer position of the block existing at the position spatially related to the encoding / decoding target block. In addition, the encoding device 100 and the decoding device 200 may respectively derive a col block based on the determined predefined relative position. Here, the col picture may be one picture among at least one reference picture included in the reference picture list.

[0175] The method of deriving motion information may vary according to the prediction mode of the encoding / decoding target block. For example, prediction modes applied to inter-frame prediction may include advanced motion vector prediction (AMVP), merge mode, and the like. Here, the merge mode may be referred to as a motion merge mode.

[0176] For example, when the AMVP is applied as a prediction mode, the encoding device 100 and the decoding device 200 may respectively generate a motion vector candidate list by using the motion vector of the reconstructed neighboring block or the motion vector of the col block or both. The motion vector of the reconstructed neighboring block or the motion vector of the col block or both may be used as a motion vector candidate. Here, the motion vector of the col 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.

[0177] The encoding device 100 may generate a bitstream, and the bitstream may include a motion vector candidate index. That is, the encoding device 100 may generate a bitstream by entropy encoding the motion vector candidate index. The motion vector candidate index may indicate the optimal motion vector candidate selected from the motion vector candidates included in the motion vector candidate list. The motion vector candidate index may be sent from the encoding device 100 to the decoding device 200 through the bitstream.

[0178] The decoding device 200 may entropy decode the motion vector candidate index from the bitstream, and may select a motion vector candidate for the decoding target block among the motion vector candidates included in the motion vector candidate list by using the entropy decoded motion vector candidate index.

[0179] The encoding device 100 may calculate the motion vector difference (MVD) between the motion vector of the decoding target block and the motion vector candidate, and may entropy encode the MVD. The bitstream may include the entropy encoded MVD. The MVD may be sent from the encoding device 100 to the decoding device 200 through the bitstream. Here, the decoding device 200 may entropy decode the MVD received from the bitstream. The decoding device 200 may derive the motion vector of the decoding target block by the sum of the decoded MVD and the motion vector candidate.

[0180] The bitstream may include a reference picture index indicating a reference picture, etc., and the reference picture index may be entropy encoded and sent from the encoding device 100 to the decoding device 200 through the bitstream. The decoding device 200 may predict the motion vector of the decoding target block by using the motion information of neighboring blocks, and may derive the motion vector of the decoding target block by using the predicted motion vector and the motion vector difference. The decoding device 200 may generate a predicted block of the decoding target block based on the derived motion vector and the reference picture index information.

[0181] As another method for deriving motion information, a merge mode is used. The merge mode may mean the merging of the motions of multiple blocks. The merge mode may mean that the motion information of one block is applied to another block. When the merge mode is applied, the encoding device 100 and the decoding device 200 may respectively generate a merge candidate list by using the motion information of the reconstructed neighboring blocks or the motion information of the col blocks or both. The motion information may include at least one of the following items: 1) a motion vector, 2) a reference picture index, and 3) an inter prediction indicator. The prediction indicator may indicate uni-directional (L0 prediction, L1 prediction) or bi-directional.

[0182] Here, the merge mode may be applied to each CU or each PU. When the merge mode is executed for each CU or each PU, the encoding device 100 may generate a bitstream by entropy decoding predefined information and may send the bitstream to the decoding device 200. The bitstream may include the predefined information. The predefined information may include: 1) a merge flag as information indicating whether the merge mode is executed for each block partition, and 2) a merge index as information indicating which block among the neighboring blocks adjacent to the encoding target block is merged. For example, the neighboring blocks adjacent to the encoding target block may include the left neighboring block of the encoding target block, the upper neighboring block of the encoding target block, the temporal neighboring block of the encoding target block, etc.

[0183] The merge candidate list may indicate a list storing motion information. In addition, the merge candidate list may be generated before the merge mode is executed. The motion information stored in the merge candidate list may be at least one of the following motion information: the motion information of neighboring blocks adjacent to the encoding / decoding target block, the motion information of co-located blocks related to the encoding / decoding target block in the reference picture, newly generated motion information by pre-combining the motion information existing in the merge motion candidate list, and a zero merge candidate. Here, the motion information of neighboring blocks adjacent to the encoding / decoding target block may be referred to as a spatial merge candidate. The motion information of co-located blocks related to the encoding / decoding target block in the reference picture may be referred to as a temporal merge candidate.

[0184] The skip mode may be a mode that applies the mode information of the neighboring block itself to the encoding / decoding target block. The skip mode may be one of the modes for inter prediction. When the skip mode is used, the encoding device 100 may entropy encode information about which block's motion information is used as the motion information of the encoding target block and may send the information to the decoding device 200 through the bitstream. The encoding device 100 may not send other information (e.g., syntax element information) to the decoding device 200. The syntax element information may include at least one of motion vector difference information, an encoded block flag, and a transform coefficient level.

[0185] The residual signal generated after intra prediction or inter prediction can be transformed into the frequency domain by a transform process as part of the quantization process. Here, the first transform can use Discrete Cosine Transform type 2 (DCT-II) and various DCT and DST kernels. These transform kernels can perform a separable transform that performs a 1D transform along the horizontal and / or vertical directions on the residual signal, or can perform a 2D non-separable transform on the residual signal.

[0186] For example, in the case of a 1D transform, the DCT and DST types used in the transform can be DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII as shown in the following table. For example, as shown in Table 1 and Table 2, the DCT or DST type used in the transform can be derived by forming a transform set.

[0187] [Table 1]

[0188] Transformation set Transformation 0 DST_VII, DCT-VIII 1 DST-VII, DST-I 2 DST-VII, DCT-V

[0189] [Table 2]

[0190] Transformation set Transformation 0 DST_VII, DCT-VIII, DST-I 1 DST-VII, DST-I, DCT-VIII 2 DST-VII, DCT-V, DST-I

[0191] For example, as Figure 8 shown, different transform sets are defined for the horizontal and vertical directions according to the intra prediction mode. Next, the encoder / decoder can perform the transform and / or inverse transform by using the intra prediction mode of the current coding / decoding target block and the transform of the relevant transform set. In this case, entropy coding / decoding is not performed on the transform set, and the encoder / decoder can define the transform set according to the same rule. In this case, entropy coding / decoding indicating which transform among the transforms of the transform set is used can be performed. For example, when the size of the block is equal to or less than 64×64, according to the intra prediction mode, three transform sets are formed as shown in Table 2, and three transforms are used for each horizontal direction transform and vertical direction transform to combine and perform a total of nine multi-transform methods. Next, the residual signal is encoded / decoded by using the optimal transform method, whereby the coding efficiency can be improved. Here, in order to perform entropy coding / decoding on the information indicating which transform method among the three transforms of a transform set is used, truncated unary binarization can be used. Here, in order to perform at least one of the vertical transform and the horizontal transform, entropy coding / decoding indicating which transform among the transforms of the transform set is used can be performed.

[0192] After the above first transform is completed, as Figure 9As shown, the encoder may perform a secondary transform on the transformed coefficients to improve energy concentration. The secondary transform may perform a separable transform that performs a 1D transform along the horizontal and / or vertical directions, or may perform a 2D non-separable transform. The transform information used may be sent, or may be derived by the encoder / decoder based on the current coding information and neighboring coding information. For example, for a 1D transform, a transform set for the secondary transform may be defined. Entropy coding / decoding is not performed on this transform set, and the encoder / decoder may define the transform set according to the same rules. In this case, information indicating which of the transforms in the transform set is used may be sent, and this information may be applied to at least one residual signal through intra prediction or inter prediction.

[0193] At least one of the number or type of transform candidates is different for each transform set. At least one of the number or type of transform candidates may be determined differently based on at least one of the following: the position, size, partition form, and prediction mode (intra / inter mode) or the direction / non-direction of the intra prediction mode of the block (CU, PU, TU, etc.).

[0194] The decoder may perform a secondary inverse transform according to whether the secondary inverse transform is performed, and may perform a first inverse transform from the result of the secondary inverse transform according to whether the first inverse transform is performed.

[0195] The above first transform and secondary transform may be applied to at least one signal component in the luminance / chrominance component, or may be applied according to the size / shape of any coding block. Entropy coding / decoding may be performed on the indices indicating both whether the first transform / secondary transform is used and the first transform / secondary transform used in any coding block. Optionally, the index may be default-derived by the encoder / decoder based on at least one piece of current / neighboring coding information.

[0196] The residual signal generated after intra prediction or inter prediction is quantized after being subjected to the first transform and / or the secondary transform, and the quantized transform coefficients are subjected to entropy coding. Here, as Figure 10 shown, the quantized transform coefficients may be scanned in the diagonal direction, vertical direction, and horizontal direction based on at least one of the intra prediction mode or the size / shape of the smallest block.

[0197] In addition, the quantized transform coefficients that have undergone entropy decoding may be arranged in block form by inverse scanning, and at least one of inverse quantization or inverse transform may be performed on the relevant block. Here, as a method of inverse scanning, at least one of diagonal direction scanning, horizontal direction scanning, and vertical direction scanning may be performed.

[0198] For example, when the size of the current coding block is 8×8, a first transformation, a second transformation, and quantization may be performed on the residual signal for an 8×8 block. Next, according to Figure 10 at least one of the three scan order methods shown in

[0199] a scan and entropy coding may be performed on the quantized transform coefficients for each of the four 4×4 sub-blocks. In addition, an inverse scan may be performed on the quantized transform coefficients by performing entropy decoding. The quantized transform coefficients on which the inverse scan has been performed become transform coefficients after inverse quantization, and at least one of a second inverse transformation or a first inverse transformation is performed, whereby a reconstructed residual signal may be generated. Figure 11 In video coding processing, a block may be partitioned as shown in

[0200] and an indicator corresponding to the partitioning information may be signaled. Here, the partitioning information may be at least one of the following: a split flag (split_flag), a quadtree / binary tree flag (QB_flag), a quadtree partitioning flag (quadtree_flag), a binary tree partitioning flag (binarytree_flag), and a binary tree partitioning type flag (Btype_flag). Here, split_flag is a flag indicating whether the block is partitioned, QB_flag is a flag indicating whether the block is partitioned in a quadtree form or a binary tree form, quadtree_flag is a flag indicating whether the block is partitioned in a quadtree form, binarytree_flag is a flag indicating whether the block is partitioned in a binary tree form, and Btype_flag is a flag indicating whether the block is vertically partitioned or horizontally partitioned in the case of binary tree partitioning.

[0201] When the partitioning flag is 1, it may indicate that partitioning is performed, and when the partitioning flag is 0, it may indicate that partitioning is not performed. In the case of the quadtree / binary tree flag, 0 may indicate quadtree partitioning, and 1 may indicate binary tree partitioning. Alternatively, 0 may indicate binary tree partitioning, and 1 may indicate quadtree partitioning. In the case of the binary tree partitioning type flag, 0 may indicate horizontal partitioning, and 1 may indicate vertical partitioning. Alternatively, 0 may indicate vertical partitioning, and 1 may indicate horizontal partitioning. Figure 11 For example, the partitioning information of

[0202] [Table 3]

[0203]

[0204] For example, the partition information of Figure 11 can be derived by signaling at least one of split_flag, QB_flag, and Btype_flag shown in Table 4. Figure 11

[0205] [Table 4]

[0206]

[0207] The partitioning method can be performed only in a quadtree form or only in a binary tree form according to the size / shape of the block. In this case, split_flag can mean a flag indicating whether the partitioning is performed in a quadtree form or in a binary tree form. The size / shape of the block can be derived from the depth information of the block, and the depth information can be signaled.

[0208] When the size of the block is within a predetermined range, the partitioning can be performed only in a quadtree form. Here, the predetermined range can be defined as at least one of the size of the largest block or the size of the smallest block that can be partitioned only in a quadtree form. Information indicating the size of the largest block / smallest block allowing quadtree-form partitioning can be signaled through a bitstream, and this information can be signaled in units of at least one of a sequence, picture parameters, or a slice. Alternatively, the size of the largest block / smallest block can be a fixed size preset in the encoder / decoder. For example, when the range of the size of the block is from 256×256 to 64×64, the partitioning can be performed only in a quadtree form. In this case, split_flag can be a flag indicating whether the partitioning is performed in a quadtree form.

[0209] When the size of the block is within a predetermined range, the partitioning can be performed only in a binary tree form. Here, the predetermined range can be defined as at least one of the size of the largest block or the size of the smallest block that can be partitioned only in a binary tree form. Information indicating the size of the largest block / smallest block allowing binary-tree-form partitioning can be signaled through a bitstream, and this information can be signaled in units of at least one of a sequence, picture parameters, or a slice. Alternatively, the size of the largest block / smallest block can be a fixed size preset in the encoder / decoder. For example, when the range of the size of the block is from 16×16 to 8×8, the partitioning can be performed only in a binary tree form. In this case, split_flag can be a flag indicating whether the partitioning is performed in a binary tree form.

[0210] After partitioning a block in a binary tree form, when the partitioned block is further partitioned, the partitioning can be performed only in a binary tree form.

[0211] ​When the width dimension or the length dimension of the partitioned block cannot be further partitioned, at least one indicator may not be signaled.

[0212] In addition to the quadtree-based binary tree partitioning, the quadtree-based partitioning may be performed after the binary tree partitioning.

[0213] When the block is partitioned based on the quadtree form or the binary tree form or both, the block corresponding to the leaf node according to the final partition of the block may be set as a single coding / decoding unit. In other words, when the block having any size or any form is no longer partitioned, the corresponding block may be encoded / decoded. In one embodiment, for a block having any size or any form and corresponding to a binary leaf node generated by the quadtree form partitioning or the binary tree form partitioning or both the quadtree form partitioning and the binary tree form partitioning, coding / decoding processes such as prediction (e.g., inter prediction or intra prediction), transform, etc. may be performed.

[0214] Figure 12 is a diagram showing an example of a coding / decoding unit according to the partitioning form of a block. In Figure 12 In the example shown, solid lines are used to distinguish the blocks generated by the quadtree partitioning, and dashed lines are used to distinguish the blocks generated by the binary tree partitioning. When it is assumed that the structure of the coded block is determined as the example shown in Figure 12 the nodes finally partitioned by the solid lines and the dashed lines may be defined as binary leaf nodes. Coding / decoding (e.g., intra prediction or inter prediction, first transform, second transform, quantization, entropy coding / decoding, etc.) may be performed on the block corresponding to the binary leaf node in accordance with the block size or the block form corresponding to the respective leaf node without additional partitioning according to the prediction sub-block or the transform sub-block.

[0215] For convenience of explanation, in the embodiments to be described later, the partitioning form of the block based on the quadtree form or the binary tree form or both is defined as the block structure.

[0216] When encoding / decoding, the block structure of each color component may be the same, or the block structure of each color component may be different. In one embodiment, according to any encoding parameter condition, the block structure may be the same for the luminance component and the chrominance component, or may be different for the luminance component and the chrominance component. Here, the block structure being the same for the luminance component and the chrominance component may mean that the block structure information determined for the luminance component is inherited to the chrominance component, or the block structure information determined for the chrominance component is inherited to the luminance component. For example, according to the type of the current encoded / decoded picture or slice, the luminance signal and the chrominance signal may have the same block structure or different block structures within an intra picture or an intra slice. Here, the block structure of the luminance component and the chrominance component that will form an intra picture or an intra slice can be determined to be the same or different through an encoding process of deriving a rate-distortion cost function according to each block structure and selecting the block structure with the minimum cost function.

[0217] The encoding device may perform entropy encoding on the information indicating whether the same block structure is used for each color component, and send this information to the decoding device. Here, this information may be encoded according to at least one of a sequence level (e.g., a sequence parameter set (SPS)), a picture level (e.g., a picture parameter set (PPS)), a slice header, a largest coding unit (LCT or CTU), and a coding unit (or coding block).

[0218] For example, the encoding parameter information indicating whether the block structure of each color component is the same for an intra picture, an intra slice, an inter picture, or an inter slice may be sent through the SPS or PPS.

[0219] In addition, the encoding parameter information indicating whether the block structure of each color component is the same within an intra slice or an inter slice may be sent through the slice header.

[0220] In addition, the encoding parameter information indicating whether the block structure of each color component is the same for a largest coding unit or a coding unit may be sent in units of the largest coding unit or the coding unit.

[0221] When the encoding / decoding target block meets a predetermined condition, block partitioning of the encoding / decoding target block may not be allowed. Therefore, encoding / decoding of block partitioning information for blocks that meet the predetermined condition may be omitted. Here, the predetermined condition may be related to at least one of block size, block form, and block partitioning depth, and may represent the size, form, or depth of a block that allows or does not allow partitioning in the quadtree form or the binary tree form or both forms. The block size or form may be a base value representing the size, form, or depth of a block that allows or does not allow partitioning in the quadtree form or the binary tree form or both forms. The block depth may represent a threshold value of the block depth that allows or does not allow partitioning in the quadtree form or the binary tree form or both forms. The block depth may be a factor that increases by 1 when performing partitioning in the quadtree form or the binary tree form or both forms.

[0222] The block partitioning information may include at least one of information indicating whether block partitioning is performed (e.g., split_flag), information indicating whether quadtree partitioning is performed (e.g., Quadtree_flag or QB_flag), information indicating whether binary tree partitioning is performed (e.g., Binarytree_flag or QB_flag), and information indicating the type of binary tree partitioning (e.g., Btype_flag).

[0223] For example, when it is assumed that the predetermined condition indicates that the block size is equal to or less than the base value and binary tree partitioning of a block that meets the predetermined condition is not allowed, for a block with a block size equal to or less than the base value, encoding / decoding of at least one of the information related to binary tree partitioning (e.g., quadtree / binary tree form flag (QB_flag), binary tree partitioning flag (binaraytree_flag), and binary tree partitioning type flag (Btype_flag)) may be omitted. When encoding of the quadtree / binary tree form flag (QB_flag) is omitted, the partitioning flag (split_flag) may be used to indicate whether quadtree partitioning is performed on the block.

[0224] Not limited to the above example, it may be set that quadtree partitioning of a block that meets the predetermined condition is not allowed. Here, for a block that meets the predetermined condition, encoding / decoding of at least one of the information related to quadtree partitioning (e.g., quadtree / binary tree form flag (QB_flag) or quadtree partitioning flag (quadtree_flag)) may be omitted. When encoding / decoding of the quadtree / binary tree form flag (QB_flag) can be omitted, the partitioning flag (split_flag) may be used to indicate whether binary tree partitioning is performed on the block.

[0225] In another embodiment, it may be set that any form of partitioning of a block that meets the predetermined condition is allowed. Here, for a block that meets the predetermined condition, encoding / decoding of any partitioning information may not be performed.

[0226] With reference to the accompanying drawings, a process for determining whether to omit the encoding / decoding of partition information will be described in detail.

[0227] Figure 13 FIG. 6 is a flowchart showing a process for determining whether to decode information related to binary tree partitioning. For ease of explanation, in this embodiment, it is assumed that partitioning in the form of a binary tree is not allowed for blocks that satisfy a predetermined condition.

[0228] First, in step S1301, information related to a predetermined condition can be obtained. Here, the information related to the predetermined condition may include at least one of block size, block form, and partition depth. The predetermined condition can be set based on the information of the predetermined condition as to whether the block size is equal to or greater than a threshold, whether the block size is equal to or less than a threshold, whether the block form is a preset form, whether the block depth is equal to or greater than a threshold, or whether the block depth is equal to or less than a threshold.

[0229] The information related to the predetermined condition can be predefined in the encoder and decoder. Here, the information related to the predetermined condition can represent at least one of the block size, block form, and block depth that define the predetermined condition. In one embodiment, the block size / form or partition depth for which the encoding / decoding of partition information is omitted may have a fixed value predefined in the encoder and decoder. Alternatively, the information related to the predetermined condition can be determined differently by an encoding parameter representing the size / form of the encoding / decoding target block or the partition depth of the block.

[0230] In another embodiment, the information related to the predetermined condition can be encoded / decoded according to sequence level, picture level, slice header, or a predetermined coding region unit. Here, the predetermined coding region may have a size / form smaller than the current coding / decoding picture or slice, and may include a largest coding unit (LCU or CTU) or a block of any size or any form included in the largest coding unit (e.g., a block generated by performing quadtree partitioning on the largest coding unit). The information related to the predetermined condition can be expressed as the largest size or the smallest size of the block or both, or can be expressed as the largest depth or the smallest depth of the block or both.

[0231] The encoder can determine the block structure by comparing the rate distortion of the result obtained by encoding based on the quadtree form and the binary tree form and the rate distortion of the result obtained by encoding based on the quadtree form. The encoder can consider the size, form, or depth of the block for which binary tree partitioning will no longer be performed according to the determined block structure, and encode the information related to the predetermined condition. In addition, the decoder can decode the information related to the predetermined condition from the bitstream that does not allow binary tree partitioning, and determine whether the current block satisfies the predetermined condition based on the decoded information.

[0232] In step S1302, the decoder may determine whether the current block satisfies a predetermined condition. As a result, when the current block satisfies the predetermined condition, decoding of information related to the binary tree partitioning of the current block may be omitted.

[0233] Optionally, when the current block does not satisfy the predetermined condition, in step S1303, information related to the binary tree partitioning of the current block may be decoded according to whether quadtree partitioning is performed on the current block. For example, when quadtree partitioning is not performed on the current block, information related to the binary tree partitioning of the current block may be decoded.

[0234] In other words, whether to encode / decode the block partitioning information of the current block may be determined by comparing whether the size, form, or depth of the current block corresponds to the size, form, or depth of the block according to the predetermined condition.

[0235] In another embodiment, according to an embodiment of the present invention, information indicating whether block partitioning is allowed for a block with any size, any form, or any depth may be encoded / decoded. Here, the information indicating whether block partitioning is allowed may include information indicating whether there is quadtree partitioning (e.g., NoPresent_Quadtree_flag) or information indicating whether there is binary tree partitioning (e.g., NoPresent_Binarytree_flag).

[0236] When it is indicated that block partitioning is not allowed for a block with any size, any form, or any depth, block partitioning may not be allowed for lower layer blocks except for the corresponding block. Here, the lower layer blocks may include at least one of a block having a block size smaller than that of the corresponding block, a block having the same block form as the corresponding block, a block having a partitioning depth greater than that of the corresponding block, and a lower layer node block of the corresponding block.

[0237] In one embodiment, when information indicating whether there is binary tree partitioning for a block with any size / form is signaled and this information indicates that there is no binary tree partitioning, for blocks having a size / form smaller than that of the block, encoding / decoding of information related to binary tree partitioning (e.g., at least one of information indicating whether binary tree partitioning is performed (e.g., quadtree / binary tree flag (QB_flag), binary tree partitioning flag (binaraytree_flag), and binary tree partitioning type flag (Btype_flag))) may be omitted except for the block.

[0238] Not limited to the above examples, information indicating whether there is quadtree partitioning for a block with any size / form and whether there is a binary tree partitioning type flag may be signaled.

[0239] Information indicating whether binary tree partitioning is allowed may be sent according to a predetermined coding region. Here, the predetermined coding region may have a size / form smaller than that of the current coded / decoded picture or slice, and may include blocks of any size or any form included in a largest coding unit (LCU or CTU) or coding unit (e.g., blocks generated by performing quadtree partitioning on the largest coding unit). The encoder may determine a block structure by comparing the rate distortion of the result obtained by coding a block of any size / form based on the quadtree form and the binary tree form with the rate distortion of the result obtained by coding based on the quadtree form, and determine whether to code information indicating that binary tree partitioning is allowed according to the determined block structure.

[0240] Information indicating whether binary tree partitioning is allowed may be coded / decoded according to layers. In one embodiment, when information of a higher-layer block signaled indicates that block partitioning is allowed, information indicating whether block partitioning is allowed for lower-layer blocks generated by partitioning the higher-layer block may be coded / decoded.

[0241] In another embodiment, information about the size, form, or depth of a block (in which information indicating whether block partitioning is performed is signaled) may be coded / decoded according to a higher level. In one embodiment, information about the size, form, or depth of a block may be sent according to at least one of a sequence level, a picture level, and a slice header. Here, for a block corresponding to the size, form, or depth of a block signaled according to a higher level, or for a higher-layer block in the higher level, information indicating whether block partitioning is allowed may be signaled.

[0242] Figure 14 FIG. is a flowchart showing a process of determining whether to decode information related to binary tree partitioning. For ease of explanation, in this embodiment, it is assumed that information indicating whether binary tree partitioning is only allowed for the current block is signaled.

[0243] First, in step S1401, information indicating whether binary tree partitioning is performed may be decoded.

[0244] In step S1402, when the information indicates that binary tree partitioning is not allowed, decoding of the binary tree partitioning information of the current block may be omitted. In addition, decoding of the binary tree partitioning information for lower-layer blocks generated by the current block partitioned by the quadtree may not be performed.

[0245] Meanwhile, in step S1402, when the information indicates that binary tree partitioning is allowed, in step S1403, the information related to binary tree partitioning can be decoded according to whether quadtree partitioning is performed on the current block. For example, when quadtree partitioning is not performed on the current block, the information related to binary tree partitioning for the current block can be decoded. In addition, for lower-level blocks generated by performing quadtree or binary tree partitioning on the current block, the information related to binary tree partitioning can be decoded according to whether quadtree partitioning is performed on the lower-level blocks.

[0246] Figures 15 to 17 is a diagram showing an example of a case where binary tree partitioning is no longer performed on a block having a predetermined size or smaller size.

[0247] As Figure 15 an example shown in, assume that the size / form of the maximum coding unit is 128×128, binary tree partitioning is not performed, and only quadtree partitioning exists in the maximum coding unit through rate-distortion optimization performed by the coding device.

[0248] As Figure 16 shown in the example, when the information indicating that binary tree partitioning is not performed on a block of a predetermined size is not encoded / decoded, the information indicating whether binary tree partitioning is performed on a block for which quadtree partitioning is no longer performed can be encoded / decoded.

[0249] However, as Figure 17 shown in the example, when the information indicating that binary tree partitioning is performed on a block having a size of 128×128 or smaller is encoded / decoded, the information indicating whether binary tree partitioning is performed on a block having a size of 128×128 or smaller may not be encoded / decoded. Therefore, the amount of information to be encoded is reduced, thereby improving the encoding / decoding efficiency.

[0250] As described above with reference to Figure 13 the encoder can encode the information on the size (e.g., the information representing 128×128), form, or depth of a block that does not allow binary tree partitioning, and send the encoded information to the decoding device. The decoding device can decode the information on the size of the block on which binary tree partitioning is not performed from the bitstream, and no longer decode the information related to binary tree partitioning of blocks having a block size equal to or smaller than the size indicated by the decoded information.

[0251] In another embodiment, as described above with reference to Figure 14 the coding device can encode the information indicating that binary tree partitioning is not allowed for a block having an arbitrary size (the block does not perform binary tree partitioning), and send the encoded information to the decoding device. Here, the information can be a 1-bit flag (e.g., NoPresent_BinaryTree_flag), but is not limited thereto. InFigure 17 In the example shown, for example, the NoPresent_BinaryTree_flag for a block having a size of 128×128 is signaled.

[0252] In Figure 16 and Figure 17 for example, when quadtree form or binary tree partitioning is performed, the flag value is set to 1, otherwise, the flag value is set to 0. However, the opposite setting is also possible.

[0253] Embodiments related to disallowing block partitioning can be applied to the luminance component and the chrominance component. Here, information indicating disallowance of block partitioning (e.g., information on the size, form, or depth of a block indicating disallowance of block partitioning, or information indicating whether block partitioning is allowed) can be commonly applied to the luminance component and the chrominance component, or can be independently signaled for the luminance component and the chrominance component. When the information is entropy encoded / decoded, any one of the truncated Rice binarization method, the K-th order exponential Golomb binarization method, the restricted K-th order exponential Golomb binarization method, the fixed-length binarization method, the unary binarization method, and the truncated unary binarization method can be used as the entropy encoding method. In addition, after binarizing the information, the information is finally encoded / decoded by using CABAC(ae(v)).

[0254] Next, the transformation and scanning of the residual signal of the current block will be described.

[0255] When encoding / decoding the residual signal of the current block, at least one piece of encoding information of the residual signal of the current block can be implicitly derived in the encoder / decoder by the encoding information of the residual signal of an encoding / decoding block adjacent to the current block. Here, the encoding information of the residual signal can include information related to the transformation scheme of the residual signal (e.g., the transformation scheme for the first transformation and the second transformation) and information for scanning the transformed coefficients for quantization. Here, the quantized transformed coefficients can indicate that the residual signal generated after intra prediction has been subjected to transformation (e.g., the first transformation and the second transformation) and quantization.

[0256] Specifically, when the current block is encoded by intra prediction, the encoding information of the current block can be derived from neighboring blocks adjacent to the current block based on the intra prediction mode of the current block. Alternatively, when the current block is encoded by inter prediction, the encoding information of the current block can be derived from neighboring blocks adjacent to the current block based on the motion information of the current block. Hereinafter, with reference to Figure 18 and Figure 19 the process of deriving the encoding information of the residual signal of the current block from neighboring blocks when the current block is encoded by intra prediction and when the current block is encoded by inter prediction will be described in detail.

[0257] Figure 18 This is a flowchart showing a process for determining encoding information for deriving a residual signal of a current block from neighboring blocks when the current block is encoded by intra prediction.

[0258] First, in step S1801, it is possible to determine whether there is a neighboring block encoded in the same intra prediction mode as the intra prediction mode of the current block. Here, the neighboring blocks of the current block can be included in the same picture (in other words, the current picture) as the current block and represent blocks that have been encoded / decoded before the current block. In one embodiment, the neighboring blocks can include blocks adjacent to the current block among the blocks that have been encoded / decoded before the current block. Here, the blocks adjacent to the current block can include at least one of the blocks adjacent to the boundary (e.g., the left boundary or the upper boundary) of the current block and the blocks adjacent to the corners (e.g., the upper left corner, the upper right corner, or the lower left corner) of the current block.

[0259] When there is a neighboring block encoded in the same intra prediction mode as the intra prediction mode of the current block, in step S1802, the encoding information for the residual signal of the corresponding neighboring block can be derived as the encoding information of the current block. Specifically, at least one of the first transform, second transform, and scan information of the current block can be derived from a neighboring block having the same intra prediction mode as the intra prediction mode of the current block.

[0260] In one embodiment, when the intra prediction mode of the current block is the same as the intra prediction mode of a neighboring block of the current block and the corresponding neighboring block skips the first transform (transform skip), the residual signal of the current encoded block can also skip the first transform. When the first transform of the current block is skipped, the second transform of the current block can also be skipped.

[0261] Alternatively, when the intra prediction mode of the current block is the same as the intra prediction mode of a neighboring block of the current block, the first transforms of the current block for the horizontal and vertical directions can be set to be the same as the first transforms applied to a neighboring block having the same intra prediction mode as the intra prediction mode of the current block. Therefore, the encoding / decoding of the encoding information (e.g., the transform information (or transform index) used when performing the first transforms for the horizontal and vertical directions) required for performing the first transform on the residual signal of the current block can be omitted.

[0262] For example, when the intra prediction mode of the current block is determined to be number 23 (mode 23), and the intra prediction mode of at least one neighboring block adjacent to the current block is determined to be number 23 (mode 23), the first transform applied to the residual signal of the neighboring block having the intra prediction mode of number 23 can be used as the first transform for the residual signal of the current block. For example, when the first transform in the horizontal direction for the residual signal of the neighboring block having the same intra prediction mode as the current block is performed by DCT-V, and the first transform in the vertical direction for the residual signal is performed by DST-VII, the first transform in the horizontal direction for the residual signal of the current block is performed by using DCT-V, and the first transform in the vertical direction is performed by using DST-VII.

[0263] In another embodiment, when the intra prediction mode of the current block is the same as the intra prediction mode of the neighboring block of the current block, the second transform of the current block can be set to be the same as the second transform applied to the neighboring block having the same intra prediction mode as the current block. Accordingly, the encoding / decoding of the encoding information (e.g., transform information (or transform index) of the second transform) required for performing the second transform on the residual signal of the current block can be omitted.

[0264] For example, when the intra prediction mode of the current block is determined to be number 35 (mode 35), and the intra prediction mode of at least one neighboring block adjacent to the current block is also determined to be number 35 (mode 35), the second transform applied to the residual signal of the neighboring block having the intra prediction mode of number 35 can be used as the second transform for the residual signal of the current block.

[0265] In another embodiment, when the intra prediction mode of the current block is the same as the intra prediction mode of the neighboring block of the current block, the scan order of the current block can be set to be the same as the scan order of the neighboring block having the same intra prediction mode as the current block. Accordingly, the encoding / decoding of the encoding information (e.g., scan index (scan order index) of at least one of the diagonal direction, the horizontal direction, and the vertical direction (representing the scan order)) required for scanning the quantized transform coefficients for the residual signal of the current block can be omitted.

[0266] Not limited to the above examples, at least two of the first transform, the second transform, and the scan order of the neighboring block having the same intra prediction mode as the current block can be derived as the encoding information of the current block.

[0267] In one embodiment, the first transform and the second transform of neighboring blocks having the same intra prediction mode as the intra prediction mode of the current block may be applied to the current block, or the first transform and the scan order of the neighboring blocks or the second transform and the scan order of the neighboring blocks may be applied to the current block. Alternatively, all of the first transform, the second transform, and the scan order of neighboring blocks having the same intra prediction mode as the intra prediction mode of the current block may be applied to the current block.

[0268] When multiple neighboring blocks having the same intra prediction mode as the current block are adjacent to the current block, the coding information of the current block may be derived based on the priority among the neighboring blocks. In one embodiment, when the block adjacent to the left side of the current block and the block adjacent to the upper side of the current block respectively have the same intra prediction mode as the intra prediction mode of the current block, and the priority of the block adjacent to the left side of the current block is higher than the priority of the block adjacent to the upper side of the current block, the coding information of the current block may be derived based on the coding information of the block adjacent to the left side of the current block.

[0269] In another embodiment, when multiple neighboring blocks having the same intra prediction mode as the current block are adjacent to the current block, information for identifying the neighboring block (which is used to derive the coding information of the current block) may be signaled via the bitstream. Here, the coding information of the residual signal of the current block may be derived from the neighboring block indicated by the information for identifying the neighboring block (e.g., neighboring block index).

[0270] When there is no neighboring block having the same intra prediction mode as the current block, in step S1803, entropy coding / decoding may be performed on the coding information of the residual signal of the current block. In one embodiment, when there is no neighboring block having the same intra prediction mode as the current block, entropy coding / decoding may be performed on at least one of the transform information (or transform index) of the first transform of the current block, the transform information (or transform index) of the second transform, and the information (or scan index) of the scan order.

[0271] In the above embodiments, the description has been made in the case where the intra prediction mode of the current block is the same as the intra prediction mode of the neighboring block and the coding information of the residual signal of the current block is derived from the neighboring block. In another embodiment, the second coding information of the residual signal of the current block may be derived from a neighboring block having the same first coding information of the residual signal as the current block. Here, the first coding information and the second coding information may include at least one of the information of the first transform, the information of the second transform, and the scan order.

[0272] In one embodiment, when there is at least one neighboring block that uses the same first transform as the first transform determined for the current block, the second transform of the current block may be set to the second transform applied to the neighboring block that uses the same first transform as the first transform of the current block. Here, the encoding / decoding of the encoding information required to perform the second transform on the residual signal of the current block may be omitted. For example, assume that the first transform of the residual signal of the current block in the horizontal direction is determined to be DCT-V, and the first transform in the vertical direction is determined to be DST-VII. When DCT-V is determined to be the first transform in the horizontal direction of at least one neighboring block of the current block and DST-VII is determined to be the first transform in the vertical direction, the second transform of the neighboring block that uses the same first transform as the first transform of the current block may be applied as the second transform of the current block.

[0273] In addition, the scan order of the neighboring block that uses the same first transform as the first transform of the current block may be applied as the scan order of the current block. In addition, the second transform and scan order of the neighboring block that uses the same first transform as the first transform of the current block may also be applied as the second transform and scan order of the current block.

[0274] In the above embodiment, the derivation of at least one of the second transform and scan order of the current block from the neighboring block that uses the same first transform as the first transform of the current block has been described. However, at least one of the first transform and scan order of the current block may be derived from the neighboring block that uses the same second transform as the second transform of the current block, or at least one of the first transform and second transform of the current block may be derived from the neighboring block that uses the same scan order as the scan order of the current block.

[0275] The second coding information of the current block may be derived from the neighboring block that has the same intra prediction mode and first coding information as the intra prediction mode and first coding information of the current block.

[0276] In one embodiment, when there is at least one neighboring block that uses the same intra prediction mode and the same first transform as the intra prediction mode and the first transform determined for the current block, the second transform of the current block may be set to the second transform applied to the neighboring block that has the same intra prediction mode as the intra prediction mode of the current block and uses the same first transform as the first transform of the current block. Here, the encoding / decoding of the encoding information required to perform the second transform on the residual signal of the current block may be omitted.

[0277] In addition, the scan order of neighboring blocks that use the same intra prediction mode and first transform as those of the current block can be applied as the scan order of the current block. Optionally, the second transform and scan order of neighboring blocks that use the same intra prediction mode and first transform as those of the current block can be applied to the current block.

[0278] In the above embodiments, at least one of the second transform and scan order of the current block is derived from neighboring blocks that have the same intra prediction mode as the current block and use the same first transform as the first transform of the current block. In addition, at least one of the first transform and scan order of the current block can be derived from neighboring blocks that have the same intra prediction mode as the intra prediction mode of the current block and use the same second transform as the second transform of the current block, or at least one of the first transform and second transform of the current block can be derived from neighboring blocks that have the same intra prediction mode as the intra prediction mode of the current block and use the same scan order as the scan order of the current block.

[0279] Figure 19 is a flowchart showing a process of determining whether to derive encoding information of a residual signal of a current block from neighboring blocks when the current block is encoded by inter prediction.

[0280] First, in step S1901, it can be determined whether the inter prediction mode of the current block is a merge mode. When the inter prediction mode of the current block is the merge mode, in order to derive the motion information of the current block, in step S1902, the neighboring block merged with the current block can be determined. In one embodiment, the neighboring block merged with the current block can be determined by a merge index indicating the neighboring block to be merged with the current block in the merge candidate list. Here, the neighboring blocks of the current block can include neighboring blocks that are spatially adjacent to the current block and neighboring blocks that are temporally adjacent to the current block.

[0281] When the neighboring block merged with the current block is determined, in step S1903, the encoding information of the residual signal of the neighboring block merged with the current block can be derived as the encoding information of the residual signal of the current block. In one embodiment, at least one of the first transform, second transform, and scan order of the current block can be set the same as at least one of the first transform, second transform, and scan order of the neighboring block merged with the current block.

[0282] When the inter prediction mode of the current block is not the merge mode, in step S1904, it can be determined whether there is a neighboring block in the neighboring blocks of the current block that has the same motion information as the motion information of the current block. Here, the motion information can include at least one of a motion vector, a reference picture index, and a reference picture direction.

[0283] When there is a neighboring block having the same motion information as that of the current block, in step S1905, the coding information of the residual signal of the neighboring block having the same motion information as that of the current block can be derived as the coding information of the residual signal of the current block. In one embodiment, at least one of the first transformation, second transformation, and scan order of the current block can be set identically to at least one of the first transformation, second transformation, and scan order of a neighboring block having at least one of the same motion vector, reference picture index, and reference picture direction as at least one of the motion vector, reference picture index, and reference picture direction of the current block.

[0284] When there is no neighboring block having the same motion information as that of the current block, in step S1906, entropy coding / decoding can be performed on the coding information of the residual signal of the current block. In one embodiment, when there is no neighboring block having the same motion information as that of the current block, entropy coding / decoding can be performed on at least one of the transformation information (or transformation index) of the first transformation, the transformation information (or transformation index) of the second transformation, and the information (or scan index) of the scan order of the current block.

[0285] In Figure 19 the example shown, the neighboring block for deriving the coding information of the residual signal of the current block can be adaptively determined according to whether the inter-frame prediction mode of the current block is the merge mode. Different from Figure 19 the example shown, when the inter-frame prediction mode of the current block is only the merge mode, the coding information of the residual signal of the current block can be derived from the neighboring block. Alternatively, regardless of whether the inter-frame prediction mode of the current block is the merge mode, the coding information of the current block can be derived from a neighboring block having the same motion information as that of the current block.

[0286] In the above embodiment, it has been described in the case where the motion vector of the current block is the same as that of the neighboring block and the coding information of the residual signal of the current block is derived from the neighboring block. In another embodiment, the second coding information of the residual signal of the current block can be derived from a neighboring block having the same first coding information or motion vector as the first coding information or motion vector of the residual signal of the current block.

[0287] After deriving the motion information of the current block as in the above embodiment, the coding information of the current block can be derived from the neighboring block based on whether the motion information of the current block is the same as that of the neighboring block. In addition, the coding information of the current block can be derived based on the motion information of the neighboring block without considering the motion information of the current block.

[0288] Based on at least one piece of information indicating whether a predefined type (e.g., a predefined transform type or a predefined scan type) is used and whether a residual type (e.g., a residual transform type or a residual scan type) other than the predefined type is used, the above-mentioned encoded information (such as a first transform, a second transform, and a scan order) can be encoded / decoded.

[0289] In one embodiment, when a residual signal is generated by intra prediction or inter prediction or both, information indicating whether a predefined transform type is applied to the residual signal can be encoded. Here, the predefined transform type can be a transform type mainly used when performing a transform on the residual signal (e.g., DCT-II), but is not limited thereto. The information can be a 1-bit flag (e.g., a transform flag, a TM flag). In one embodiment, when the TM flag is 0 (or 1), it can indicate that the predefined transform type is applied to the residual signal. When the TM flag is 1 (or 0), it can indicate that another transform type other than the predefined transform type is applied to the residual signal. In addition, the information can be configured with a flag having 2 bits or more. The first bit can indicate whether the predefined transform type is used for the first transform, and the second bit can indicate whether the predefined transform type is used for the second transform.

[0290] When the information indicates that another transform type other than the predefined transform type is applied to the residual signal, information for specifying any one of the residual transform types in the residual transform type can be encoded. Here, the residual transform type can represent the remaining transform types other than the predefined transform type among the transform types that can be applied to the residual signal. For example, when the predefined transform type is DCT-II, the residual transform type can include at least one of DCT-V, DCT-VIII, DST-I, and DST-VII. The information can be index information (TM idx) for specifying any one of the residual transform types, and the index information can be any positive integer. For example, TM idx 1 can represent DCT-V, TM idx 2 can represent DCT-VIII, TM idx 3 can represent DST-I, and TM idx 4 can represent DST-VII.

[0291] The index information may indicate a combination of transform types for the horizontal and vertical directions of the residual signal. In other words, the 1D transform types for the horizontal / vertical directions can be determined by a single piece of index information. For example, when the TM flag is 1 and the TM idx is 1 at the same time, the transform type combination matching TM idx 1 can be determined as the transform types for the horizontal and vertical directions of the current block. In one embodiment, when TM idx indicates DCT-V for the horizontal direction and DCT-VIII for the vertical direction, DCT-V and DCT-VIII can be respectively determined as the horizontal direction transform type and the vertical direction transform type of the current block.

[0292] When determining the coding parameters of the current block, at least one piece of information specifying any one of the following items can be derived from the neighboring blocks of the current block: whether a predefined type is used, and the residual type. For example, at least one piece of information (TM idx) specifying any one of the following items can be derived from the neighboring blocks of the current block: information (TM flag) indicating whether a predefined transform type is applied to the current block, and the residual transform type.

[0293] In one embodiment, at least one of the TM flag and TM idx of the current block can be derived as the same value as that of the neighboring block of the current block.

[0294] Furthermore, when at least one TM flag of the neighboring block of the current block is 1, encoding / decoding can be performed by implicitly assuming that the TM flag of the current block is 1. Here, the TM idx of the current block can be implicitly sent through the bitstream or can be implicitly derived from the neighboring block.

[0295] Described by way of example, at least one piece of information (TM idx) specifying any one of the following items can be derived from the neighboring blocks used when performing intra prediction or inter prediction on the current block: information (TM flag) indicating whether a predefined transform type is applied to the current block, and the residual transform type.

[0296] In one embodiment, when the inter prediction mode of the current block is the merge mode, at least one of the TM flag and the TM idx may be considered to newly configure merge candidates. The newly configured merge candidate list may include merge candidates in which at least one of the TM flag and the TM idx has different values. In one embodiment, the merge candidate list may be configured to have a first merge candidate and a second merge candidate, where the first merge candidate and the second merge candidate have the same motion information and have different TM flags or TM idx or both different TM flags and TM idx. At least one of the TM flag and the TM idx of the current block may be determined to be the same as at least one of the merge candidates indicated by the merge index (Merge_idx). Therefore, the motion information (motion vector, reference picture index, inter prediction direction indicator) of the current block, as well as the TM flag or TM idx or both the TM flag and the TM idx, may be encoded / decoded based on the merge mode.

[0297] Here, information indicating that the merge candidate list is newly configured may be explicitly sent through the bitstream. The information sent may be a 1-bit flag, but is not limited thereto. In addition, when the TM flag of at least one neighboring block of the current block is 1, it may be implicitly recognized that the merge candidate list is newly configured. Here, the neighboring block may be the block in which the TM flag first becomes 1 according to a predetermined neighboring block scan order, or may be a predefined position block.

[0298] In the above embodiments, a method of deriving information (e.g., the TM flag or TM idx or both the TM flag and the TM idx) for determining the transform type from neighboring blocks of the current block has been described. The above embodiments may be applied to at least one of determining the transform type of the first transform of the current block and determining the transform type of the second transform. In one embodiment, in other words, at least one of the transform information (e.g., the TM flag (first TM flag) or TM idx (first TM idx) or both the TM flag and the TM idx) of the first transform and the transform information (e.g., the TM flag (second TM flag) or TM idx (second TM idx)) of the second transform may be derived from neighboring blocks of the current block.

[0299] In addition, in addition to the merge candidate list generated based on motion information, a merge candidate list may be generated based on the transform information of the current block. In one embodiment, when the merge candidate list generated based on the motion information of neighboring blocks is defined as the "first merge candidate list" and the merge candidate list generated based on the transform information of neighboring blocks is defined as the "second merge candidate list", the motion information of the current block is derived from the merge candidate specified by the first merge index within the first merge candidate list. However, the transform information of the current block may be derived from the merge candidate specified by the second merge index within the second merge candidate list.

[0300] In addition, information (e.g., a scan flag or a scan idx or both a scan flag and a scan idx) for determining a scan order of a current block from neighboring blocks of the current block can be derived. Here, the scan flag can indicate whether the scan order of the current block is the same as a predefined scan order, and the scan idx can be information indicating any one of residual scan orders in a residual scan order.

[0301] According to another embodiment of the present invention, the same coding information can be applied to all blocks located within a signaling block, where the signaling block is within a current coding / decoding picture or slice. Here, the signaling block can represent a region having a size smaller than at least one of a horizontal resolution or a vertical resolution of the current picture or the current slice. In other words, the signaling block can be defined as a predetermined region having a size smaller than the current picture or the current slice.

[0302] The information of the signaling block can be sent through at least one of a sequence unit, a picture unit, and a slice header. In one embodiment, at least one of a size, a form, or a position of the signaling block can be sent through at least one of a sequence parameter set, a picture parameter set, and a slice header. Alternatively, the information of the signaling block can be implicitly derived from coding information of the current block or neighboring blocks adjacent to the current block. The signaling block can have a square or rectangular form, but is not limited thereto.

[0303] The coding information of the signaling block can be applied to all blocks included in the signaling block. In one embodiment, at least one of a first transformation, a second transformation, and a scan order can be set the same for all blocks included in the signaling block. The coding information applied to all blocks included in the signaling block can be sent through a bitstream. Alternatively, the coding information of a block at a specific position within the signaling block can be applied to all blocks included in the signaling block.

[0304] In the above embodiments, it has been described that all blocks included in the signaling block have the same coding information. In another embodiment, blocks that satisfy a predetermined condition among the blocks included in the signaling block can be set to have the same coding information. Here, the predetermined condition can be defined according to at least one of a size, a form, or a depth of the block. In one embodiment, at least one of a first transformation, a second transformation, and a scan order can be set the same for blocks having a predetermined size or a smaller size (e.g., blocks having a size of 4×4 or smaller) among all blocks included in the signaling block.

[0305] The embodiments for obtaining the coding information of the current block can be applied to both the luminance component and the chrominance component. In addition, by using at least one of the embodiments, information indicating that at least one of a first transformation, a second transformation, and a scan is performed on the residual signal for the current block can be encoded / decoded. When the above information is entropy encoded / decoded, at least one of a truncated Rice binarization method, a K-order exponential Golomb binarization method, a restricted K-order exponential Golomb binarization method, a fixed-length binarization method, a unary binarization method, and a truncated unary binarization method can be used as the entropy coding method. In addition, after binarizing the above information, the above information can be finally encoded / decoded by using CABAC(ae(v)). Alternatively, it can be implicitly derived to determine the coding information of the current block by using at least one of the size and form of the current block.

[0306] Next, the encoding / decoding of motion vector information will be described in detail.

[0307] When the current block is encoded by inter prediction, the encoder may send a motion vector difference (MVD) representing the difference between the motion vector encoded adjacent to the current block and the motion vector of the current block to the decoder.

[0308] The decoder may derive the motion vector encoded adjacent to the current block as a motion vector candidate for the current block. Specifically, the decoder may derive motion vector candidates from both the decoded temporal motion vector and the decoded spatial motion vector of the current block or at least one of the decoded temporal motion vector or the decoded spatial motion vector of the current block, and configure a motion vector candidate list (MVP list).

[0309] The encoder may send information (e.g., MVP list index) indicating the motion vector prediction value for deriving the motion vector difference among the motion vector candidates included in the motion vector candidate list. Subsequently, the decoding device may determine the motion vector candidate indicated by the MVP list index as the motion vector prediction value, and derive the motion vector of the current block by using the motion vector prediction value and the motion vector difference.

[0310] Based on the above explanation, a method for encoding / decoding the motion vector information of the current block according to the present invention will be described in detail.

[0311] Figure 20 is a flowchart showing the decoding process of the motion vector of the current block.

[0312] First, in step S2001, the spatial motion vector candidates of the current block may be derived. The spatial motion vector candidates of the current block may be derived from the encoded / decoded blocks included in the same picture as the picture including the current block.

[0313] Figure 21It is a diagram showing an example of deriving a candidate for a spatial motion vector.

[0314] As Figure 21 In the example shown, the spatial motion vector of the current block can be derived from block B1 adjacent to the upper side of the current block X, block A1 adjacent to the left side of the current block, block B0 adjacent to the upper right corner of the current block, block B2 located at the upper left corner, and block A0 adjacent to the lower left corner of the current block. The spatial motion vector derived from the neighboring blocks of the current block can be determined as a candidate for the spatial motion vector of the current block.

[0315] Here, the candidates for the spatial motion vector can be derived in a predetermined order. In one embodiment, the candidates for the spatial motion vector can be determined in the order of A0, A1, B0, B1, and B2 to check if there is a motion vector in each block. When there is a motion vector of a neighboring block, the motion vector of the corresponding neighboring block can be determined as a candidate for the spatial motion vector.

[0316] When the reference picture of the neighboring block is different from the reference picture of the current block, the motion vector obtained by scaling the motion vector of the neighboring block using the distance between the reference picture referenced by the current picture and the neighboring block and the distance between the reference picture referenced by the current picture and the current block can be determined as the spatial motion vector of the current block.

[0317] Subsequently, in step S2002, candidates for the temporal motion vector of the current block can be derived. The temporal motion vector of the current block can be derived from the reconstructed blocks within the co-located picture.

[0318] Figure 22 It is a diagram showing an example of deriving a candidate for the temporal motion vector.

[0319] As Figure 22 In the example shown, the temporal motion vector of the current block can be derived from the block at position H outside the co-located block C or from the block at position C3 inside the co-located block C, where the co-located block C corresponds to the position spatially identical to the current block X within the co-located picture of the current picture. The candidates for the temporal motion vector can be derived sequentially from the block at position H and the block at position C3. In one embodiment, when the motion vector can be derived from the block at position H, the candidate for the temporal motion vector can be derived from the block at position H. Alternatively, when the motion vector cannot be derived from the block at position H, the candidate for the temporal motion vector can be derived from the block at position C3. When the block at position H or C3 is encoded by intra prediction, no candidate for the temporal motion vector of the current block is derived.

[0320] In addition to Figure 22In addition to the examples shown, at least one temporal motion vector candidate for the current block can be derived from the co-located picture indicated by the motion information of the currently obtained block and the co-located blocks included in the co-located picture indicated by the motion information or neighboring blocks of the co-located blocks. Here, the motion information may include at least one of a picture index indicating the co-located picture and a motion vector indicating the co-located block within the co-located picture. The motion information for specifying the co-located picture and the co-located block may be additionally signaled for the current block.

[0321] The temporal motion vector candidates for the current block can be obtained in sub-block units having a size smaller than that of the current block. For example, when the size of the current block is 8×8, the temporal motion vector candidates can be obtained in sub-block units having a size smaller than the current block (such as 2×2, 4×4, 8×4, 4×8, etc.). The sub-blocks can have a square or rectangular form. In addition, the size or form of the sub-blocks can be preset in the encoder / decoder or can be determined according to the size or form of the current block.

[0322] Subsequently, in step S2003, a motion vector candidate list including at least one motion vector candidate among the spatial motion vector candidates and the temporal motion vector candidates can be generated.

[0323] Here, the motion vector candidate list can be configured to include at least one temporal motion vector candidate. In one embodiment, when the number of motion vector candidates that can be included in the motion vector candidate list is N (where N is a positive integer greater than 0), the motion vector candidate list can be configured to definitely include at least one motion vector candidate. Although up to N mutually different spatial motion vector candidates can be derived when deriving the spatial motion vector candidates, at least one of the N spatial motion vector candidates can be removed from the motion vector candidate list by any similarity determination. Therefore, the temporal motion vector candidate can be included in the motion vector candidate list. Here, any similarity determination can represent a method of combining at least two spatial motion vectors into a single spatial motion vector by using a maximum value, a minimum value, an average value, a median value, or any weighted sum when even though the spatial motion vectors have different values from each other but the difference between the motion vectors is not large. The number of spatial motion vector candidates can be reduced by using any similarity determination.

[0324] Optionally, when the N spatial motion vector candidates are included in the motion vector candidate list in a predetermined priority order, at least one of the spatial motion vector candidates can be removed from the motion vector candidate list in the reverse order of the predetermined priority. In other words, at least one of the spatial motion vector candidates can be removed from the motion vector candidate list in the reverse order, starting from the last one. Therefore, the temporal motion vector candidate can be included in the motion vector candidate list.

[0325] It is possible to determine whether to remove a spatial motion vector candidate from the above-mentioned motion vector candidate list according to whether the temporal motion vector candidate is used. In addition, the number of spatial motion vector candidates removed from the motion vector candidate list can be determined according to the number of temporal motion vector candidates used for the current block or the number of temporal motion vector candidates available for the current block.

[0326] In addition, the number of motion vector candidates that can be included in the motion vector candidate list can be increased by 1 (in other words, increased to N + 1), so that the temporal motion vector candidate is included in the motion vector candidate list.

[0327] Subsequently, in step S2004, any one of the motion vector candidates included in the motion vector candidate list can be determined as the motion vector prediction value. In one embodiment, the decoder can determine the motion vector prediction value of the current block based on information (such as the MVP list index) specifying any one of the motion vector candidates included in the motion vector candidate list.

[0328] In step S2005, when the motion vector prediction value of the current block is determined, the motion vector of the current block can be obtained by using the motion vector difference. The motion vector difference can represent the difference between the motion vector of the current block and the motion vector prediction value of the current block. The motion vector difference of the current block can be entropy encoded / decoded.

[0329] According to an embodiment of the present invention, in order to reduce the amount of information of the motion vector difference, the motion vector difference of the current block can be encoded by using the motion vector difference of a reconstructed block that is adjacent to the current block and is encoded by inter-frame prediction. In one embodiment, the second motion vector difference of the current block can be encoded, where the second motion vector difference represents the difference between the following two motion vector differences: the motion vector difference representing the difference between the motion vector of the current block and the motion vector prediction, and the motion vector difference representing the difference between the reconstructed blocks that are adjacent to the current block and are encoded by inter-frame prediction.

[0330] Figure 23 is a diagram showing the derivation of the second motion vector difference.

[0331] Assume that the motion vector difference (MVD) of the current block (block 2) is (5, 5). Here, the second motion vector difference of the current block can be encoded by using the motion vector difference of the upper block (block 1) located above the current block.

[0332] In one embodiment, when it is assumed that the motion vector difference of the upper block is (5, 5), since the motion vector difference of the current block is the same as that of the upper block, the second motion vector difference of the current block can become (0, 0). When the motion vector difference (0, 0) instead of the motion vector difference (5, 5) is encoded, the amount of information used to encode the motion vector difference of the current block can be reduced.

[0333] In addition, when there is a block having the same motion vector difference as that of the current block, the motion vector difference of the current block can be derived from neighboring blocks without transmitting the motion vector difference of the current block.

[0334] As in the above example, the position of the neighboring block for deriving the second motion vector candidate of the current block or the information indicating the position of the neighboring block having the same motion vector difference as that of the current block can be explicitly transmitted through the bitstream. In one embodiment, the information (e.g., MVD index) for identifying the neighboring block for deriving the second motion vector candidate or the neighboring block having the same motion vector candidate as that of the current block among the neighboring blocks of the current block can be sent to the decoder through the bitstream.

[0335] In another embodiment, the position of the neighboring block for deriving the second motion vector candidate of the current block or the information representing the position of the neighboring block having the same motion vector difference as that of the current block can be implicitly derived in the encoder / decoder according to the same process. In one embodiment, the motion vector difference of the neighboring block used as the motion vector predictor (MVP) of the current block can be used as the motion vector difference predictor (MVD predictor) for deriving the second motion vector difference of the current block.

[0336] When the current block is encoded by bidirectional prediction, the information indicating whether the motion vector differences of reference picture list 0 (List 0) and reference picture list 1 (List 1) are the same can be encoded. Here, the same motion vector difference can mean that the sign and magnitude of the motion vector difference are the same, or can mean that the magnitudes of the motion vector differences are the same but the signs of the motion vector differences are different. When the motion vector differences of reference picture list 0 and reference picture list 1 are the same, the encoding / decoding of any one of the motion vector differences of reference picture list 0 and reference picture list 1 can be omitted.

[0337] According to another embodiment of the present invention, all blocks within a signaling block of the current coded / decoded picture or slice may have at least one identical motion vector prediction value (MVP) to derive an optimal motion vector difference (MVD). Optionally, according to another embodiment of the present invention, all blocks within a signaling block of the current coded / decoded picture or slice may have at least one identical motion vector difference prediction value (MVD predictor) to derive an optimal second motion vector difference. Here, the motion vector prediction value or the motion vector difference prediction value may be sent for each signaling block, or the motion vector prediction value or the motion vector difference prediction value may be implicitly derived by using the coding information of neighboring blocks adjacent to the signaling block. Here, the signaling block may represent a region having a size smaller than at least one of the horizontal resolution and the vertical resolution of the current picture or the current slice. In other words, the signaling block may be defined as a predetermined region having a size smaller than the current picture or the current slice.

[0338] The information of the signaling block may be sent by at least one of a sequence unit, a picture unit, and a slice header. In one embodiment, at least one of the size, form, or position of the signaling block may be sent by at least one of a sequence parameter set, a picture parameter set, and a slice header. Optionally, the information of the signaling block may be implicitly derived by using the coding information of the current block or neighboring blocks adjacent to the current block. The signaling block may have a square or rectangular form, but is not limited thereto.

[0339] The above inter-frame coding / decoding process may be performed for each luminance signal and chrominance signal. For example, at least one method of obtaining an inter-frame prediction indicator, generating a motion vector candidate list, deriving a motion vector, and performing motion compensation in the above inter-frame coding / decoding process may be differently applied to the luminance signal and the chrominance signal.

[0340] The above inter-frame coding / decoding process may be equally performed for the luminance signal and the chrominance signal. For example, at least one of an inter-frame prediction indicator, a motion vector candidate list, a motion vector candidate, a motion vector, and a reference picture applied to the luminance signal when performing the above inter-frame coding / decoding process may be equally applied to the chrominance signal.

[0341] The above method may be performed in the encoder and the decoder in the same way. For example, at least one method of deriving a motion vector candidate list, deriving a motion vector candidate, deriving a motion vector, and performing motion compensation in the above inter-frame coding / decoding process may be equally applied to the encoder and the decoder. Optionally, the order of the above method may be differently applied to the encoder and the decoder.

[0342] The above embodiments of the present invention can be applied according to the size of at least one of a coding block, a prediction block, a block, and a unit. Here, the size can be defined as the minimum size or the maximum size or both the minimum size and the maximum size to which the above embodiments are applied, or can be defined as a fixed size to which the embodiments are applied. In addition, in the above embodiments, the first embodiment can be applied to a first size, and the second embodiment can be applied to a second size. In other words, the embodiments can be combined and applied according to the size. In addition, the above embodiments of the present invention can be applied only to the minimum size or a larger size and the maximum size or a smaller size. In other words, the above embodiments can be applied to block sizes included within a predetermined range.

[0343] For example, when the size of the coding / decoding target block is 8×8 or larger, the above embodiments can be applied. For example, when the size of the coding / decoding target block is 16×16 or larger, the above embodiments can be applied. For example, when the size of the coding / decoding target block is 32×32 or larger, the above embodiments can be applied. For example, when the size of the coding / decoding target block is 64×64 or larger, the above embodiments can be applied. For example, when the size of the coding / decoding target block is 128×128 or larger, the above embodiments can be applied. For example, when the size of the coding / decoding target block is 4×4, the above embodiments can be applied. For example, when the size of the coding / decoding target block is 8×8 or smaller, the above embodiments can be applied. For example, when the size of the coding / decoding target block is 8×8 or larger and 16×16 or smaller, the above embodiments can be applied. For example, when the size of the coding / decoding target block is 16×16 or larger and 64×64 or smaller, the above embodiments can be applied.

[0344] The above embodiments of the present invention can be applied according to a time layer. An additional identifier for identifying the time layer to which the above embodiments can be applied can be signaled, and the above embodiments can be applied to the time layer indicated by the corresponding identifier. Here, the identifier can be defined as indicating the minimum layer or the maximum layer or both the minimum layer and the maximum layer to which the embodiments can be applied, or can be defined as indicating a specific layer to which the above embodiments can be applied.

[0345] For example, when the time layer of the current picture is the lowest layer, the above embodiments can be applied. For example, when the time layer identifier of the current picture is 0, the above embodiments can be applied. For example, when the time layer identifier of the current picture is 1, the above embodiments can be applied. For example, when the time layer of the current picture is the highest layer, the above embodiments can be applied.

[0346] As in the above embodiments of the present invention, the reference picture set used when generating the reference picture list and the modified reference picture list may use at least one of the reference picture lists L0, L1, L2, and L3.

[0347] According to an embodiment of the present invention, when calculating the boundary strength in the deblocking filter, at least one to at most N motion vectors of the coding / decoding target block may be used. Here, N is a positive integer equal to or greater than 1, and may be 2, 3, 4, etc.

[0348] The above embodiments of the present invention may be applied when the motion vector has at least one of the following units when predicting the motion vector: 16-pixel (16-pel) unit, 8-pixel (8-pel) unit, 4-pixel (4-pel) unit, integer-pixel (integer-pel) unit, 1 / 2-pixel (1 / 2-pel) unit, 1 / 4-pixel (1 / 4-pel) unit, 1 / 8-pixel (1 / 8-pel) unit, 1 / 16-pixel (1 / 16-pel) unit, 1 / 32-pixel (1 / 32-pel) unit, and 1 / 64-pixel (1 / 64-pel) unit. In addition, when predicting the motion vector, the motion vector may be optionally used in accordance with the above pixel units.

[0349] The slice type to which the above embodiments of the present invention are applied may be defined, and the above embodiments of the present invention may be applied according to the corresponding slice type.

[0350] For example, when the slice type is a T (three-way prediction)-slice, the prediction block may be generated by using at least three motion vectors, so that the weighted sum of at least three prediction blocks may be calculated and used as the final prediction block of the coding / decoding target block. For example, when the slice type is a Q (four-way prediction)-slice, the prediction block may be generated by using at least four motion vectors, so that the weighted sum of at least four prediction blocks may be calculated and used as the final prediction block of the coding / decoding target block.

[0351] The above embodiments of the present invention may be applied to the inter prediction and motion compensation methods using motion vector prediction, and may be applied to the inter prediction and motion compensation methods using the skip mode or the merge mode.

[0352] The block form to which the above embodiments of the present invention may be applied may have a square form or a non-square form.

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

[0354] The embodiments described above include examples of various aspects. Of course, it is not possible to describe every conceivable combination of components or methods for the purpose of describing each aspect, but those of ordinary skill in the art will be able to recognize that further combinations and permutations are possible. Accordingly, this specification is intended to cover all such alternative forms, modifications, and variations that fall within the spirit and scope of the appended claims.

[0355] A computer-readable storage medium may include individual program instructions, data files, data structures, etc., or a combination of program instructions, data files, data structures, etc. The program instructions recorded on the computer-readable storage medium may be specifically designed and constructed for the present invention or any program instructions known to those skilled in the art of computer software technology. Examples of computer-readable storage media include: magnetic recording media (such as hard disks, floppy disks, and magnetic tapes); optical data storage media (such as CD-ROMs or DVD-ROMs); magneto-optical media (such as floppy optical disks); and hardware devices specifically constructed to store and execute program instructions (such as read-only memory (ROM), random access memory (RAM), and flash memory). Examples of program instructions include not only machine language code formatted by a compiler, but also high-level language code that can be executed by a computer using an interpreter. The hardware device may be configured to be operated by one or more software modules to perform the processing according to the present invention, and vice versa.

[0356] Although the present invention has been described in terms of specific terms (such as detailed elements), limited embodiments, and drawings, they are provided only to assist in a more general understanding of the present invention, and the present invention is not limited to the above embodiments. Those skilled in the art to which the present invention pertains will understand that various modifications and changes can be made from the above description.

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

[0358] Industrial Applicability

[0359] The present invention can be used in devices for encoding / decoding images.

Claims

1. An image decoding method performed by an image decoding device, the method comprising: Obtaining a current block by partitioning an image; Partitioning the current block using a partitioning method determined based on the size of the current block; Generating a prediction block of an encoded block obtained based on the partitioning method; Generating a residual block of the encoded block by performing an inverse transform on the residual data of the encoded block; And Generating a reconstructed block of the encoded block using the prediction block and the residual block, wherein when the size of the current block is greater than 64×64, the partitioning method is implicitly determined as a quadtree partitioning without signaling partitioning information, wherein when the size of the current block is less than or equal to 64×64, the partitioning method is explicitly determined based on the signaled partitioning information, wherein the current block is recursively and repeatedly partitioned until the size of the current block becomes 64×64 or smaller.

2. The image decoding method according to claim 1, Among them, The step of generating the prediction block includes: not allowing binary tree partitioning when the encoded block satisfies a predetermined condition.

3. The image decoding method according to claim 2, Among them, The predetermined condition is derived based on the size of the encoded block.

4. The image decoding method according to claim 1, Among them, The step of generating the prediction block includes: filtering the prediction block based on at least one of the intra prediction mode of the encoded block and the size of the encoded block.

5. The image decoding method according to claim 1, Among them, The signaled partitioning information includes a first flag indicating whether to partition the current block, a second flag indicating whether to partition the current block into a quadtree, and a third flag indicating the partitioning type.

6. The image decoding method according to claim 5, Among them, The signaled partitioning information is signaled in the order of the first flag, the second flag, and the third flag.

7. An image encoding method performed by an image encoding device, the method comprising: Obtaining a current block by partitioning an image; Partitioning the current block using a partitioning method determined based on the size of the current block; Generating a prediction block of an encoded block obtained based on the partitioning method; Generating a residual block of the encoded block; Generating residual data of the encoded block by performing a transform on the residual block; And Encoding the encoded block and the residual data, wherein when the size of the current block is greater than 64×64, the partitioning method is implicitly determined as a quadtree partitioning without signaling partitioning information, wherein when the size of the current block is less than or equal to 64×64, the partitioning method is explicitly determined based on the signaled partitioning information, wherein the current block is recursively and repeatedly partitioned until the size of the current block becomes 64×64 or smaller.

8. A method for transmitting a bitstream generated by an image encoding method, the method comprising: Transmitting the bitstream generated by the image encoding method, wherein the image encoding method includes: Obtaining a current block by partitioning an image; Partitioning the current block using a partitioning method determined based on the size of the current block; Generate a prediction block for the coded block obtained based on the partitioning method; Generate a residual block for the coded block; Generate residual data for the coded block by performing a transform on the residual block; and Encode the coded block and the residual data, wherein when the size of the current block is greater than 64×64, the partitioning method is implicitly determined as a quadtree partitioning without signaling the partitioning information, wherein when the size of the current block is less than or equal to 64×64, the partitioning method is explicitly determined based on the signaled partitioning information, wherein the current block is recursively and repeatedly partitioned until the size of the current block becomes 64×64 or smaller.

Citation Information

Patent Citations

  • Image encoding / decoding method

    CN115052143A