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

By dividing the unit block and adopting different coding modes, the mode determines the method and adaptive dimensional adjustment method to solve the problem of low image coding efficiency in existing technologies, and achieve efficient image coding.

CN119343916APending Publication Date: 2025-01-21ELECTRONICS & TELECOMM RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202380045940.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-06-09
Filing Date
2023-06-09
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The prior art is difficult to improve encoding efficiency in image encoding, especially in image encoding using block-based artificial neural networks.

Method used

By dividing the image into unit blocks, and according to different coding modes (scanning mode, low resolution mode, and sampling mode), the unit block is divided and encoded, and the method and adaptive dimension adjustment method is used to improve the coding efficiency.

Benefits of technology

Even in the system environment of limited hardware resources, high -encoding efficiency can be achieved, redundant between sub -blocks, and improving coding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119343916A_ABST
    Figure CN119343916A_ABST
Patent Text Reader

Abstract

Disclosed are an image encoding / decoding method and apparatus, and a recording medium storing a bitstream. An image decoding method according to an embodiment may comprise the steps of: reconstructing an encoding mode of a unit block; reconstructing one or more sub-blocks of the unit block; reconstructing the unit block from the one or more sub-blocks on the basis of the encoding mode; and reconstructing an image based on the unit block, in which the encoding mode includes at least one of a first mode in which the unit block is divided into two or more sub-blocks using a prescribed scanning method, a second mode in which the unit block is divided into two or more sub-blocks using a prescribed scanning method, and a third mode in which the unit block is divided into two or more sub-blocks using a prescribed scanning method. A sub-block having a lower resolution is generated from the unit block, and a third mode in which the unit block is sampled and two or more sub-blocks are generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to image encoding / decoding methods and devices, and more particularly, to image encoding techniques using artificial neural networks. Background Art

[0002] With the continuous development of the information and communication industry, broadcast services supporting high definition (HD) resolution have become popular all over the world. Through this popularity, a large number of users have become accustomed to high-resolution and high-definition images and / or videos.

[0003] In order to meet the user's demand for high definition, many organizations have accelerated the development of next-generation imaging devices. User interest in UHD TV, which has a resolution more than four times that of full HD (FHD) TV, as well as high-definition TV (HDTV) and FHD TV has increased. As people's interest in it increases, image encoding / decoding technology for images with higher resolution and higher definition is currently required.

[0004] As the image compression technology, there are various technologies such as an inter-frame prediction technology, an intra-frame prediction technology, transform, a quantization technology, a filtering technology, and an entropy coding technology.

[0005] The inter-frame prediction technique is a technique for predicting the value of a pixel included in the current picture using a picture before and / or after the current picture. The intra-frame prediction technique is a technique for predicting the value of a pixel included in the current picture using information about the pixel in the current picture. The transform and quantization technique may be a technique for compressing the energy of the residual signal.

[0006] The entropy coding technique is a technique for assigning short codewords to frequently occurring values ​​and assigning long codewords to less frequently occurring values.

[0007] By utilizing this image compression technology, data regarding images can be efficiently compressed, transmitted, and stored. Summary of the invention

[0008] Technical issues

[0009] One aspect of the present disclosure is to improve coding efficiency in image coding through artificial neural networks.

[0010] Another aspect of the present disclosure is to improve the coding efficiency of image coding using block-based artificial neural networks.

[0011] Technical Solution

[0012] According to an embodiment of the present specification, an image decoding method may include: reconstructing a coding mode of a unit block; reconstructing one or more sub-blocks of the unit block; reconstructing the unit block from the one or more sub-blocks based on the coding mode; and reconstructing an image based on the unit block, wherein the coding mode includes at least one of a first mode, a second mode and a third mode, wherein in the first mode, the unit block is divided into two or more sub-blocks by a predetermined scanning method, in the second mode, a sub-block with a low resolution is generated from the unit block, and in the third mode, two or more sub-blocks are generated by sampling the unit block.

[0013] According to another embodiment of the present specification, an image encoding method may include: dividing a target image into two or more unit blocks including a first unit block; determining an encoding mode of the first unit block; generating one or more sub-blocks from the first unit block based on the encoding mode; and encoding the one or more sub-blocks, wherein the encoding mode includes at least one of a first mode, a second mode and a third mode, wherein in the first mode, the first unit block is divided into two or more first sub-blocks by a predetermined scanning method, in the second mode, a second sub-block with a low resolution of the first unit block is generated, and in the third mode, two or more third sub-blocks are generated by sampling the first unit block.

[0014] According to another embodiment of the present disclosure, a computer-readable storage medium can store a bit stream for picture information generated by executing an image encoding method, wherein the image encoding method includes: dividing a target image into two or more unit blocks including a first unit block; determining an encoding mode of the first unit block; generating one or more sub-blocks from the first unit block based on the encoding mode; and encoding the one or more sub-blocks, wherein the encoding mode includes at least one of a first mode, a second mode and a third mode, wherein in the first mode, the first unit block is divided into two or more first sub-blocks by a predetermined scanning method, in the second mode, a second sub-block with a low resolution of the first unit block is generated, and in the third mode, two or more third sub-blocks are generated by sampling the first unit block.

[0015] Effects of the Invention

[0016] According to an embodiment of the present disclosure, by applying a mode decision method and an adaptive resizing method to a block-based artificial neural network coding technique, high coding efficiency can be achieved even in a system environment with limited hardware resources.

[0017] In addition, the redundancy between sub-blocks can be removed while the sub-blocks are individually encoded through a block-based artificial neural network, which further improves the coding performance. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0021] Figure 4 is a diagram illustrating a form of a prediction unit (PU) that a coding unit (CU) may include.

[0022] Figure 5 is a diagram illustrating a form of a transform unit (TU) that may be included in a CU.

[0023] Figure 6 The division of blocks according to an example is shown.

[0024] Figure 7 is a diagram for explaining an embodiment of an intra prediction process.

[0025] Figure 8 is a diagram showing reference samples used in an intra prediction process.

[0026] Fig. 9 is a diagram for explaining an embodiment of an inter-frame prediction process.

[0027] Fig.10 Spatial candidates according to an embodiment are shown.

[0028] Fig.11 An order in which motion information of spatial candidates is added to a merge list according to an embodiment is shown.

[0029] Fig.12 Transformation and quantization processes according to examples are shown.

[0030] Fig.13 A diagonal scan according to an example is shown.

[0031] Fig.14 A horizontal scan according to an example is shown.

[0032] Fig.15 A vertical scan according to an example is shown.

[0033] Fig.16is a diagram showing a configuration of an encoding device according to an embodiment.

[0034] Fig.17 is a diagram showing a configuration of a decoding device according to an embodiment.

[0035] Fig.18 An image encoding / decoding structure based on an artificial neural network is shown.

[0036] Fig.19 An example of a hidden vector transformation neural network is shown.

[0037] Fig. 20 An example of a hidden vector reconstruction neural network is shown.

[0038] Fig.21 An artificial neural network based image encoding / decoding structure is shown when the probability model of the hidden vector depends on the input image.

[0039] Fig. 22 An example of a hyper-prior information transformation neural network is shown.

[0040] Fig.23 An example of hyper-prior information reconstruction of a neural network is shown.

[0041] Fig.24 An artificial neural network based video coding method using a method to reduce temporal redundancy in the image domain is shown.

[0042] Fig.25 The structure of Mask R-CNN is shown, where Mask R-CNN is an artificial neural network model for object domain segmentation.

[0043] Fig.26 Shown by Fig.25 Example of feature maps extracted from FPN by Mask R-CNN.

[0044] Fig. 27 A model is shown in which feature map extraction and task execution are performed separately in different devices.

[0045] FIG. 28 shows a sampling format of YCbCr including 4:4:4 sampling, 4:2:2 sampling, and 4:2:0 sampling.

[0046] Fig.29 An example of dividing an input image into two or more unit blocks is shown.

[0047] Fig.30 is a block diagram of an image encoding and decoding method using block-based adaptive scaling and sampling according to an embodiment.

[0048] Fig.31An example of division of unit blocks and sub-blocks in the case where M=N and p=q=2 when an input image is divided into unit blocks of a size of pM×qN is shown.

[0049] Fig.32 An example of division of unit blocks and sub-blocks in the case of p=3 and q=2 when an input image is divided into unit blocks of a size of pM×qN is shown.

[0050] Fig.33 An example of recursively / hierarchically constructing sub-blocks in a unit block of 2N×2N size is shown.

[0051] Fig.34 An example of dividing a unit block of a size of 2N×2N into sub-blocks of a size of N×N by a zigzag scanning technique is shown.

[0052] Fig.35 An example of reconstructing a decoded N×N sized sub-block into a decoded 2N×2N sized unit block by a zigzag scanning technique is shown.

[0053] Fig.36 An example of adjusting the size of a unit block of 2N×2N size to a sub-block of N×N size by bicubic interpolation is shown.

[0054] Fig.37 is an example of performing resizing by reducing the resolution of the luminance channel to 1 / 2 resolution and reducing the resolution of the chrominance channels to 1 / 4 resolution when resizing is applied to an image having a YCbCr color space at a low resolution.

[0055] Fig.38 An example of reconstructing a reconstructed N×N sized sub-block into a 2N×2N sized unit block is shown.

[0056] Fig.39 A method of dividing a unit block into four different sub-blocks by dividing the unit block into 2×2 sampling units and reconstructing samples at the same position in all sampling units is shown.

[0057] Fig.40 A method of reconstructing a unit block by inverse sampling the reconstructed four sub-blocks is shown.

[0058] Fig.41 An example of removing redundancy among four sub-blocks generated by dividing a unit block through sampling is shown.

[0059] Fig.42 An example is shown in which a final sub-block is reconstructed from the reconstructed sub-blocks and the residual block, and then inverse sampling is performed to reconstruct the unit block.

[0060] Fig.43is an operation flow chart of an image encoding method according to an embodiment.

[0061] Fig.44 is an operational flow chart of a video decoding method according to an embodiment.

[0062] Best Mode

[0063] The embodiments of the present disclosure can be summarized as follows.

[0064] According to an embodiment of the present disclosure, an image decoding method includes: reconstructing a coding mode of a unit block; reconstructing one or more sub-blocks of the unit block; reconstructing the unit block from the one or more sub-blocks based on the coding mode; and reconstructing an image based on the unit block, wherein the coding mode may include at least one of a first mode, a second mode and a third mode, wherein in the first mode, the unit block is divided into two or more sub-blocks by a predetermined scanning method, in the second mode, a sub-block with a low resolution is generated from the unit block, and in the third mode, two or more sub-blocks are generated by sampling the unit block.

[0065] In an embodiment, the step of reconstructing one or more sub-blocks includes: applying a first decoding method through entropy decoding, inverse quantization, inverse transformation, and motion prediction and compensation, or a second decoding method to the one or more sub-blocks, wherein the second decoding method reconstructs a hidden vector through entropy decoding based on a hidden vector probability model, and uses the hidden vector as an input of a reconstruction neural network to generate a reconstructed image.

[0066] In an embodiment, the step of reconstructing the unit block may include tiling the two or more first sub-blocks reconstructed after being divided and encoded based on the first mode according to a predetermined scanning technique.

[0067] In an embodiment, the step of reconstructing the unit block may include upscaling a resolution of the second sub-block reconstructed after encoding at a low resolution based on the second mode by a predetermined ratio.

[0068] In an embodiment, the step of upscaling the resolution may be performed by a fixed filter or a trainable artificial neural network.

[0069] In an embodiment, in the process of reconstructing the unit block, different ratios of upscaling resolutions may be applied to the unit block of the luminance channel and the unit block of the chrominance channel.

[0070] In an embodiment, the reconstructing the unit block may include: inverse sampling the two or more third sub-blocks reconstructed after being divided and encoded based on the third mode.

[0071] In an embodiment, at least one third subblock of the two or more third subblocks may be reconstructed as a corresponding subblock among the two or more subblocks based on another third subblock of the two or more third subblocks after being encoded as a residual block.

[0072] According to another embodiment of the present disclosure, an image encoding method includes: dividing a target image into two or more unit blocks including a first unit block; determining an encoding mode of the first unit block; generating one or more sub-blocks from the first unit block based on the encoding mode; and encoding the one or more sub-blocks, wherein the encoding mode includes at least one of a first mode, a second mode and a third mode, wherein in the first mode, the first unit block is divided into two or more first sub-blocks by a predetermined scanning method, in the second mode, a second sub-block with a low resolution of the first unit block is generated, and in the third mode, two or more third sub-blocks are generated by sampling the first unit block.

[0073] In an embodiment, the target image may be an input image to be encoded, or a residual image corresponding to a difference between a predicted image of the input image and the input image.

[0074] In an embodiment, the step of encoding the one or more sub-blocks may include: applying a first encoding method through motion prediction and compensation, transformation, quantization and entropy encoding, or a second encoding method to the one or more sub-blocks, wherein the second encoding method transforms the image into a hidden vector through a transformation neural network, quantizes the hidden vector, and entropy encodes the quantized hidden vector based on a hidden vector probability model.

[0075] In an embodiment, the step of applying the second encoding method to the one or more sub-blocks may further include: using a sub-block encoded by the second encoding method before the one or more sub-blocks as an additional input to the hidden vector probability model for the one or more sub-blocks.

[0076] In an embodiment, the step of generating the sub-blocks may include: dividing the first unit block into two or more first sub-blocks having the same size by a predetermined scanning technique based on the first pattern.

[0077] In an embodiment, the step of generating the sub-block may include: reducing the resolution of the first unit block at a predetermined ratio based on the second mode.

[0078] In an embodiment, the downscaling step may be performed by a fixed filter or a trainable artificial neural network.

[0079] In an embodiment, in the process of generating the sub-blocks, different ratios of reduced resolutions may be applied to the unit blocks of the luma channel and the unit blocks of the chroma channels.

[0080] In an embodiment, the step of generating the sub-blocks may include: dividing the first unit block into sampling units having a predetermined size based on the third mode, and reconstructing samples at the same position in each sampling unit to construct two or more third sub-blocks.

[0081] In an embodiment, the step of encoding the one or more sub-blocks may include: transforming at least one third sub-block of the two or more third sub-blocks into a residual block based on another third sub-block of the two or more third sub-blocks.

[0082] In an embodiment, the transforming step may include: generating a prediction block of the at least one third sub-block based on the other third sub-block by a neural network-based transformation or an arithmetic operation; and generating the residual block based on the prediction block and the at least one third sub-block.

[0083] According to another embodiment of the present disclosure, a computer-readable storage medium stores a bit stream for picture information, wherein the picture information is generated by an image encoding method, and the image encoding method includes: dividing a target image into two or more unit blocks including a first unit block; determining an encoding mode of the first unit block; generating one or more sub-blocks from the first unit block based on the encoding mode; and encoding the one or more sub-blocks, wherein the encoding mode may include at least one of a first mode, a second mode, and a third mode, wherein in the first mode, the first unit block is divided into two or more first sub-blocks by a predetermined scanning method, in the second mode, a second sub-block with a low resolution of the first unit block is generated, and in the third mode, two or more third sub-blocks are generated by sampling the first unit block.

[0084] Embodiments of the present invention

[0085] The present disclosure may be variously modified and may have various embodiments, and specific embodiments will be described in detail below with reference to the accompanying drawings. However, it should be understood that those embodiments are not intended to limit the present disclosure to a specific disclosed form, and they include all changes, equivalents or modifications included in the spirit and scope of the present disclosure.

[0086] The following detailed description of the embodiments will be made with reference to the accompanying drawings showing specific embodiments. These embodiments are described so that a technician with ordinary knowledge in the technical field to which the present disclosure belongs can easily practice the embodiments. It should be noted that the various embodiments are different from each other, but do not need to be mutually exclusive. For example, the specific shapes, structures and characteristics described herein may be implemented as other embodiments without departing from the spirit and scope of the embodiments related to the embodiments. In addition, it should be understood that the position or arrangement of each component in each disclosed embodiment may be changed without departing from the spirit and scope of the embodiments. Therefore, the attached detailed description is not intended to limit the scope of the present disclosure, and the scope of the embodiments is limited only by the attached claims and their equivalents, as long as they are appropriately described.

[0087] In the drawings, like reference numerals are used to designate the same or similar functions in various aspects. The shapes, sizes, etc. of components in the drawings may be exaggerated to make the description clear.

[0088] Terms such as "first" and "second" may be used to describe various components, but the components are not limited by the terms. These terms are only used to distinguish one component from another component. For example, without departing from the scope of this specification, a first component may be named a second component. Similarly, a second component may be named a first component. The term "and / or" may include a combination of multiple related description items or any one of multiple related description items.

[0089] It will be understood that when a component is referred to as being "connected" or "coupled" to another component, the two components may be directly connected or coupled to each other, or there may be an intermediate component between the two components. On the other hand, it will be understood that when a component is referred to as being "directly connected or coupled", there are no intermediate components between the two components.

[0090] In addition, in order to indicate different characteristic functions, the components described in the embodiments are shown independently, but this does not mean that each of the components is formed by separate hardware or software. That is, for ease of description, the components are arranged and included separately. For example, at least two of the components can be integrated into a single component. On the contrary, a component can be divided into multiple components. An embodiment of an integrated component or an embodiment of separating some components is included in the scope of this specification as long as it does not depart from the essence of this specification.

[0091] The terms used in the embodiments are only used to describe specific embodiments and are not intended to limit the present disclosure. Unless otherwise specifically indicated in the context, singular expressions include plural expressions. In the embodiments, it should be understood that terms such as "including" or "having" are only intended to indicate the presence of features, numbers, steps, operations, components, parts, or a combination thereof, and are not intended to exclude the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or a combination thereof. That is, in the embodiments, the expression that describes a component "including" a specific component means that additional components may be included within the scope of the practice of the present disclosure or the technical spirit of the present disclosure, but does not exclude the presence of components other than the specific components.

[0092] In an embodiment, the term "at least one" may mean one of 1 or more numbers, such as 1, 2, 3, and 4. In an embodiment, the term "plurality" may mean one of 2 or more numbers, such as 2, 3, and 4.

[0093] Some components of the embodiment are not essential components for performing essential functions, but may be optional components for only improving performance. The embodiment may be implemented using only the essential components for realizing the essence of the embodiment. For example, a structure including only essential components and not including optional components used only to improve performance is also included in the scope of the embodiment.

[0094] The embodiments will be described in detail below with reference to the accompanying drawings so that a person with ordinary knowledge in the technical field to which the embodiments belong can easily practice the embodiments. In the following description of the embodiments, detailed descriptions of known functions or configurations that are considered to obscure the subject matter of this specification will be omitted. In addition, throughout the drawings, the same reference numerals are used to designate the same components, and repeated descriptions of the same components will be omitted.

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

[0096] Hereinafter, the terms 'video' and 'moving picture' may be used to have the same meaning and may be used interchangeably with each other.

[0097] Hereinafter, a target image may be an encoding target image as a target to be encoded and / or a decoding target image as a target to be decoded. In addition, the target image may be an input image input to an encoding device or an input image input to a decoding device. And, the target image may be a current image, that is, a target to be currently encoded and / or decoded. For example, the terms "target image" and "current image" may be used to have the same meaning and may be used interchangeably with each other.

[0098] Hereinafter, the terms “image”, “picture”, “frame”, and “screen” may be used to have the same meaning and may be used interchangeably with each other.

[0099] Hereinafter, the target block may be an encoding target block (a target to be encoded) and / or a decoding target block (a target to be decoded). In addition, the target block may be a current block, that is, a target to be encoded and / or decoded at present. Here, the terms "target block" and "current block" may be used to have the same meaning and may be used interchangeably with each other. The current block may represent an encoding target block that is an encoding target during encoding and / or a decoding target block that is a decoding target during decoding. In addition, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.

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

[0101] Hereinafter, the terms "region" and "segment" may be used interchangeably with each other.

[0102] In the following embodiments, specific information, data, flags, indexes, elements, and attributes may have their respective values. The value "0" corresponding to each of the information, data, flags, indexes, elements, and attributes may indicate false, logically false, or a first predefined value. In other words, the value "0", false, logically false, and the first predefined value may be used interchangeably. The value "1" corresponding to each of the information, data, flags, indexes, elements, and attributes may indicate true, logically true, or a second predefined value. In other words, the value "1", true, logically true, and the second predefined value may be used interchangeably.

[0103] When a variable such as i or j is used to indicate a row, column, or index, the value of i may be an integer of 0 or greater or may be an integer of 1 or greater. In other words, in an embodiment, each of the row, column, and index may be counted from 0 or may be counted from 1.

[0104] In an embodiment, the term “one or more” or the term “at least one” may mean the term “plurality.” The term “one or more” or the term “at least one” may be used interchangeably with “plurality.”

[0105] Hereinafter, terms to be used in the embodiments will be described.

[0106] Encoder: An encoder refers to a device for performing encoding. That is, an encoder may mean an encoding device.

[0107] Decoder: A decoder refers to a device for performing decoding. That is, a decoder may mean a decoding apparatus.

[0108] Unit: A unit may mean a unit of image encoding and decoding. The terms "unit" and "block" may be used to have the same meaning and may be used interchangeably with each other.

[0109] - A cell may be an M×N array of samples. Each of M and N may be a positive integer. A cell may generally mean an array of samples in a two-dimensional form.

[0110] - In encoding and decoding of an image, a "unit" may be a region generated by partitioning one image. In other words, a "unit" may be a region specified in one image. A single image may be partitioned into a plurality of units. Alternatively, one image may be partitioned into sub-parts, and when encoding or decoding is performed on the partitioned sub-parts, a unit may represent each of the partitioned sub-parts.

[0111] - In encoding and decoding of images, a predefined process may be performed on each unit according to the type of the unit.

[0112] - According to functions, the unit type may be classified into a macro unit, a coding unit (CU), a prediction unit (PU), a residual unit, a transform unit (TU), etc. Alternatively, according to functions, the unit may represent a block, a macro block, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, etc. For example, a target unit as a target of encoding and / or decoding may be at least one of a CU, a PU, a residual unit, and a TU.

[0113] - The term "unit" may mean information including a luma component block, a chroma component block corresponding to the luma component block, and syntax elements for each block, so that the unit is designated to be distinguished from the block.

[0114] - The size and shape of the unit can be achieved in various ways. In addition, the unit can have any of a variety of sizes and shapes. In particular, the shape of the unit can include not only a square, but also a geometric figure that can be represented in two dimensions (2D), such as a rectangle, a trapezoid, a triangle, and a pentagon.

[0115] - In addition, the unit information may include one or more of a type of unit, a size of the unit, a depth of the unit, an encoding order of the unit, and a decoding order of the unit, etc. For example, the type of the unit may indicate one of CU, PU, ​​residual unit, and TU.

[0116] - A cell can be partitioned into sub-cells, each sub-cell having a size smaller than that of the associated cell.

[0117] Depth: Depth may mean the degree to which a unit is partitioned. In addition, the depth of a unit may indicate the level at which the corresponding unit exists when (one or more) units are represented by a tree structure.

[0118] - The cell partition information may include a depth indicating the depth of the cell. The depth may indicate the number of times the cell is partitioned and / or the extent to which the cell is partitioned.

[0119] -In a tree structure, the root node can be considered to have the smallest depth and the leaf node can be considered to have the largest depth. The root node can be the highest (top) node. The leaf node can be the lowest node.

[0120] - A single unit may be hierarchically partitioned into a plurality of subunits while having depth information based on a tree structure. In other words, a unit and a subunit generated by partitioning the unit may correspond to a node and a subnode of the node, respectively. Each of the partitioned subunits may have a unit depth. Since the depth indicates the number of times a unit is partitioned and / or the degree to which a unit is partitioned, the partition information of the subunit may include information about the size of the subunit.

[0121] - In the tree structure, the top node may correspond to the initial node before partitioning. The top node may be referred to as a "root node". In addition, the root node may have a minimum depth value. Here, the top node may have a depth of level "0".

[0122] - A node with a depth of level "1" may represent a cell generated when the initial cell is partitioned once. A node with a depth of level "2" may represent a cell generated when the initial cell is partitioned twice.

[0123] - A leaf node with a depth of level "n" may represent a cell generated when the initial cell has been partitioned n times.

[0124] - A leaf node may be a bottom node, which cannot be partitioned further. The depth of a leaf node may be a maximum level. For example, the predefined value of the maximum level may be 3.

[0125] -QT depth may represent the depth used for quad-partitioning. BT depth may represent the depth used for binary-partitioning. TT depth may represent the depth used for ternary-partitioning.

[0126] Sample: Samples can be the basic unit of a block. Depending on the bit depth (Bd), it can be from 0 to 2. Bd A value of -1 indicates a sample point.

[0127] - A sample can be a pixel or a pixel value.

[0128] - Hereinafter, the terms "pixel" and "sample" may be used to have the same meaning and may be used interchangeably with each other.

[0129] Coding Tree Unit (CTU): A CTU may consist of a single luma component (Y) coding tree block and two chroma component (Cb, Cr) coding tree blocks related to the luma component coding tree block. In addition, CTU may mean information including the above blocks and syntax elements for each of the blocks.

[0130] - Each coding tree unit (CTU) may be partitioned using one or more partitioning methods such as quadtree (QT), binary tree (BT), and ternary tree (TT) to construct sub-units such as coding units, prediction units, and transform units. Quadtree may mean a quadtree. In addition, one or more partitioning methods may be used to partition each coding tree unit using a multi-type tree (MTT).

[0131] - "CTU" may be used as a term to designate a pixel block, which is a processing unit in image decoding and encoding processes, such as in the case of a partition of an input image.

[0132] Coding Tree Block (CTB): “CTB” may be used as a term to designate any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

[0133] Neighboring block: A neighboring block (or neighboring block) may mean a block adjacent to a target block. A neighboring block may mean a reconstructed neighboring block.

[0134] Hereinafter, the terms “neighboring block” and “adjacent block” may be used to have the same meaning and may be used interchangeably with each other.

[0135] The neighboring block may mean a reconstructed neighboring block.

[0136] Spatial neighboring blocks: Spatial neighboring blocks may be blocks that are spatially adjacent to the target block. Neighboring blocks may include spatial neighboring blocks.

[0137] - A target block and spatially neighboring blocks may be included in a target picture.

[0138] - A spatially neighboring block may mean a block whose boundary contacts the target block, or a block located within a predetermined distance from the target block.

[0139] - A spatially adjacent block may mean a block adjacent to a vertex of the target block. Here, a block adjacent to a vertex of the target block may mean a block vertically adjacent to a neighboring block horizontally adjacent to the target block or a block horizontally adjacent to a neighboring block vertically adjacent to the target block.

[0140] Temporally neighboring blocks: Temporally neighboring blocks may be blocks that are temporally adjacent to the target block. Neighboring blocks may include temporally neighboring blocks.

[0141] - Temporally neighboring blocks may include co-located blocks (col blocks).

[0142] The col block may be a block in a previously reconstructed co-located picture (col picture). The position of the col block in the col picture may correspond to the position of the target block in the target picture. Alternatively, the position of the col block in the col picture may be equal to the position of the target block in the target picture. The col picture may be a picture included in a reference picture list.

[0143] - The temporal neighboring block may be a block that is temporally adjacent to the spatial neighboring block of the target block.

[0144] Prediction mode: The prediction mode may be information indicating a mode for intra prediction or a mode for inter prediction.

[0145] Prediction unit: A prediction unit may be a basic unit for prediction such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation.

[0146] - A single prediction unit can be divided into multiple partitions or sub-prediction units with smaller sizes. Multiple partitions can also be basic units in the execution of prediction or compensation. Partitions generated by dividing a prediction unit can also be prediction units.

[0147] Prediction unit partition: A prediction unit partition may be a shape into which a prediction unit is divided.

[0148] Reconstructed neighboring unit: The reconstructed neighboring unit may be an already decoded and reconstructed unit that is neighboring to the target unit.

[0149] - The reconstructed neighboring cell may be a cell that is spatially adjacent to the target cell or temporally adjacent to the target cell.

[0150] The reconstructed spatially neighboring unit may be a unit that is included in the target picture and has been reconstructed through encoding and / or decoding.

[0151] -The reconstructed temporally adjacent unit may be a unit that is included in a reference image and has been reconstructed by encoding and / or decoding. The position of the reconstructed temporally adjacent unit in the reference image may be the same as the position of the target unit in the target picture, or may correspond to the position of the target unit in the target picture. In addition, the reconstructed temporally adjacent unit may be a block that is adjacent to a corresponding block in the reference image. Here, the position of the corresponding block in the reference image may correspond to the position of the target block in the target image. Here, the fact that the positions of the blocks correspond to each other may mean that the positions of the blocks are the same as each other, may mean that one block is included in another block, or may mean that one block occupies a specific position in another block.

[0152] Sub-picture: A picture can be divided into one or more sub-pictures. A sub-picture can be composed of one or more tile rows and one or more tile columns.

[0153] - A sub-picture may be a region in a picture having a square shape or a rectangular (ie, non-square rectangular) shape. In addition, a sub-picture may include one or more CTUs.

[0154] - A sub-picture can be a rectangular area of ​​one or more slices in a picture.

[0155] - A sub-picture may include one or more tiles, one or more partitions and / or one or more slices.

[0156] Tile: A tile may be an area in a picture having a square shape or a rectangular (ie, non-square rectangular) shape.

[0157] - A tile may include one or more CTUs.

[0158] - A tile can be partitioned into one or more partitions.

[0159] Block: A block may represent one or more CTU rows in a tile.

[0160] - A tile can be partitioned into one or more partitions. Each partition can include one or more CTU rows.

[0161] -A parallel block that is not partitioned into two parts can also represent a partition.

[0162] Slice: A slice may include one or more tiles in a picture. Alternatively, a slice may include one or more partitions in a tile.

[0163] - A sub-picture may contain one or more slices that together cover a rectangular area of ​​the picture. Thus, every sub-picture boundary is always also a slice boundary, and every vertical sub-picture boundary is always also a vertical tile boundary.

[0164] Parameter set: A parameter set may correspond to header information in the internal structure of a bitstream.

[0165] The parameter set may include at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), an adaptation parameter set (APS), a decoding parameter set (DPS), etc.

[0166] - Information signaled by each parameter set may be applied to pictures that reference the corresponding parameter set. For example, information in a VPS may be applied to pictures that reference the VPS. Information in an SPS may be applied to pictures that reference the SPS. Information in a PPS may be applied to pictures that reference the PPS.

[0167] -Each parameter set can refer to a higher parameter set. For example, PPS can refer to SPS. SPS can refer to VPS.

[0168] - In addition, the parameter set may include a parallel block group, a slice header information, and a parallel block header information. A parallel block group may be a group including a plurality of parallel blocks. In addition, the meaning of "parallel block group" may be the same as the meaning of "slice".

[0169] Rate-distortion optimization: The encoding device may use rate-distortion optimization in order to provide high encoding efficiency by utilizing a combination of the size of a coding unit (CU), a prediction mode, the size of a prediction unit (PU), motion information, and the size of a transform unit (TU).

[0170] -The rate-distortion optimization scheme can calculate the rate-distortion cost of each combination in order to select the best combination from the combination. The rate-distortion cost can be calculated using the equation "D+(λ*R)". Generally, the combination that can minimize the rate-distortion cost can be selected as the optimal combination in the rate-distortion optimization scheme.

[0171] -D may represent distortion. D may be the mean of the squares of the differences between the original transform coefficients and the reconstructed transform coefficients in the transform unit (ie, the mean square error).

[0172] -R may represent rate, which may represent the bit rate using relevant context information.

[0173] -λ represents a Lagrange multiplier. R may include not only encoding parameter information such as prediction mode, motion information, and coding block flag, but also bits generated due to encoding of transform coefficients.

[0174] - The encoding device may perform processes such as inter-frame prediction and / or intra-frame prediction, transformation, quantization, entropy coding, inverse quantization (inverse quantization) and / or inverse transformation in order to calculate accurate D and R. These processes may greatly increase the complexity of the encoding device.

[0175] - Bitstream: A bitstream may refer to a stream of bits including encoded image information.

[0176] Parsing: Parsing may be the decision on the value of a syntax element made by performing entropy decoding on the bitstream. Alternatively, the term "parsing" may mean such entropy decoding itself.

[0177] Symbol: A symbol may be at least one of a syntax element, a coding parameter, and a transform coefficient of a coding target unit and / or a decoding target unit. In addition, a symbol may be a target of entropy coding or a result of entropy decoding.

[0178] Reference picture: A reference picture may be an image referenced by a unit in order to perform inter-frame prediction or motion compensation. Alternatively, a reference picture may be an image including a reference unit referenced by a target unit in order to perform inter-frame prediction or motion compensation.

[0179] Hereinafter, the terms 'reference picture' and 'reference image' may be used to have the same meaning and may be used interchangeably with each other.

[0180] Reference picture list: A reference picture list may be a list including one or more reference pictures used for inter prediction or motion compensation.

[0181] - The types of reference picture lists may include List Combination (LC), List 0 (L0), List 1 (L1), List 2 (L2), List 3 (L3), etc.

[0182] - For inter prediction, one or more reference picture lists may be used.

[0183] Inter prediction indicator: The inter prediction indicator may indicate the inter prediction direction for the target unit. The inter prediction may be one of unidirectional prediction and bidirectional prediction. Optionally, the inter prediction indicator may indicate the number of reference pictures used to generate the prediction unit for the target unit. Optionally, the inter prediction indicator may indicate the number of prediction blocks used for inter prediction or motion compensation for the target unit.

[0184] Prediction list utilization flag: The prediction list utilization flag may indicate whether at least one reference picture in a specific reference picture list is used to generate a prediction unit.

[0185] - The prediction list utilization flag may be used to derive the inter prediction indicator. Conversely, the prediction list utilization flag may be used to derive the prediction list utilization flag. For example, the case where the prediction list utilization flag indicates "0" as a first value may indicate that, for the target unit, the reference picture in the reference picture list is not used to generate the prediction block. The case where the prediction list utilization flag indicates "1" as a second value may indicate that, for the target unit, the reference picture list is used to generate the prediction unit.

[0186] Reference picture index: A reference picture index may be an index indicating a specific reference picture in a reference picture list.

[0187] Picture Order Count (POC): The POC value of a picture may indicate the order in which the corresponding picture is displayed.

[0188] Motion Vector (MV): A motion vector may be a 2D vector used for inter prediction or motion compensation. A motion vector may mean the offset between a target image and a reference image.

[0189] - For example, MV can be represented as (mvx ,mv y ) format. x Can indicate the horizontal component, and mv y May indicate the vertical component.

[0190] - Search range: The search range may be a 2D area where the search of the MV is performed during inter prediction. For example, the size of the search range may be M×N. M and N may be respective positive integers.

[0191] Motion vector candidate: A motion vector candidate may be a block that is a prediction candidate when predicting a motion vector or a motion vector of a block that is a prediction candidate.

[0192] -The motion vector candidate may be included in the motion vector candidate list.

[0193] Motion vector candidate list: A motion vector candidate list may be a list constructed using one or more motion vector candidates.

[0194] Motion vector candidate index: The motion vector candidate index may be an indicator for indicating a motion vector candidate in a motion vector candidate list. Alternatively, the motion vector candidate index may be an index of a motion vector predictor.

[0195] Motion information: The motion information may be information including at least one of a reference picture list, a reference image, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index, as well as a motion vector, a reference picture index, and an inter prediction indicator.

[0196] Merge candidate list: A merge candidate list may be a list constructed using one or more merge candidates.

[0197] Merge candidates: The merge candidates may be spatial merge candidates, temporal merge candidates, combined merge candidates, combined bi-predictive merge candidates, history-based candidates, candidates based on the average of two candidates, zero merge candidates, etc. The merge candidates may include an inter prediction indicator and may include motion information such as prediction type information, reference picture index for each list, motion vector, prediction list utilization flag, and inter prediction indicator.

[0198] Merge index: The merge index may be an indicator for indicating a merge candidate in the merge candidate list.

[0199] - The merge index may indicate a reconstruction unit used to derive a merge candidate between a reconstruction unit spatially adjacent to the target unit and a reconstruction unit temporally adjacent to the target unit.

[0200] - The merge index may indicate at least one of a plurality of pieces of motion information of a merge candidate.

[0201] Transform unit: A transform unit may be a basic unit of residual signal encoding and / or residual signal decoding (such as transform, inverse transform, quantization, inverse quantization, transform coefficient encoding, and transform coefficient decoding). A single transform unit may be partitioned into a plurality of sub-transform units having a smaller size. Here, the transform may include one or more of a primary transform and a secondary transform, and the inverse transform may include one or more of a primary inverse transform and a secondary inverse transform.

[0202] Scaling: Scaling may refer to the process of multiplying the levels of transform coefficients by a factor.

[0203] - As a result of scaling of the transform coefficient levels, the transform coefficients may be generated. Scaling may also be referred to as "inverse quantization".

[0204] Quantization parameter (QP): A quantization parameter may be a value used to generate a transform coefficient level for a transform coefficient in quantization. Alternatively, a quantization parameter may also be a value used to generate a transform coefficient by scaling the transform coefficient level in inverse quantization. Alternatively, a quantization parameter may be a value mapped to a quantization step size.

[0205] Delta quantization parameter: The delta quantization parameter may mean the difference between the predicted quantization parameter and the quantization parameter of the target unit.

[0206] Scanning: Scanning may refer to a method for aligning the order of coefficients in a cell, block, or matrix. For example, a method for aligning a 2D array in the form of a one-dimensional (1D) array may be referred to as "scanning". Alternatively, a method for aligning a 1D array in the form of a 2D array may also be referred to as "scanning" or "inverse scanning".

[0207] Transform coefficient: The transform coefficient may be a coefficient value generated when the encoding device performs transformation. Alternatively, the transform coefficient may be a coefficient value generated when the decoding device performs at least one of entropy decoding and inverse quantization.

[0208] - Quantization levels or quantized transform coefficient levels generated by applying quantization to transform coefficients or residual signals may also be included in the meaning of the term "transform coefficient".

[0209] Quantization level: The quantization level may be a value generated when the encoding device performs quantization on a transform coefficient or a residual signal. Alternatively, the quantization level may be a value that is a target of inverse quantization when the decoding device performs inverse quantization.

[0210] -The quantized transform coefficient level as a result of transformation and quantization may also be included in the meaning of the quantization level.

[0211] Non-zero transform coefficient: A non-zero transform coefficient may be a transform coefficient having a value other than 0 or a transform coefficient level having a value other than 0. Alternatively, a non-zero transform coefficient may be a transform coefficient whose value is not zero or a transform coefficient level whose value is not zero.

[0212] Quantization matrix: A quantization matrix may be a matrix used in a quantization process or an inverse quantization process to improve the subjective image quality or objective image quality of an image. A quantization matrix may also be referred to as a "scaling list".

[0213] Quantization matrix coefficient: A quantization matrix coefficient can be each element in the quantization matrix. A quantization matrix coefficient can also be called a "matrix coefficient".

[0214] Default matrix: The default matrix may be a quantization matrix predefined by an encoding device and a decoding device.

[0215] Non-default matrix: A non-default matrix may be a quantization matrix that is not predefined by the encoding device and the decoding device. A non-default matrix may mean a quantization matrix that is signaled by a user from the encoding device to the decoding device.

[0216] Most Probable Mode (MPM): The MPM may represent an intra prediction mode having a high probability of being used for intra prediction of a target block.

[0217] The encoding apparatus and the decoding apparatus may determine one or more MPMs based on an encoding parameter associated with the target block and a property of an entity associated with the target block.

[0218] The encoding device and the decoding device may determine one or more MPMs based on the intra prediction mode of the reference block. The reference block may include multiple reference blocks. The multiple reference blocks may include a spatially adjacent block adjacent to the left side of the target block and a spatially adjacent block adjacent to the top of the target block. In other words, depending on which intra prediction modes have been used for the reference block, one or more different MPMs may be determined.

[0219] - One or more MPMs may be determined in the same manner in the encoding device and the decoding device. That is, the encoding device and the decoding device may share the same MPM list including the one or more MPMs.

[0220] MPM list: The MPM list may be a list including one or more MPMs. The number of the one or more MPMs in the MPM list may be predefined.

[0221] MPM indicator: The MPM indicator may indicate an MPM to be used for intra prediction of a target block among one or more MPMs in an MPM list. For example, the MPM indicator may be an index to the MPM list.

[0222] - Since the MPM list is determined in the same manner in the encoding device and the decoding device, there is no need to transmit the MPM list itself from the encoding device to the decoding device.

[0223] - The MPM indicator may be signaled from the encoding apparatus to the decoding apparatus. When the MPM indicator is signaled, the decoding apparatus may determine an MPM to be used for intra prediction of a target block among the MPMs in the MPM list.

[0224] MPM usage indicator: The MPM usage indicator may indicate whether an MPM usage mode is to be used for prediction of a target block. The MPM usage mode may be a mode of determining an MPM to be used for intra prediction of a target block using an MPM list.

[0225] - An MPM usage indicator may be signaled from an encoding device to a decoding device.

[0226] Signaling: "Signaling" may mean that information is transmitted from an encoding device to a decoding device. Alternatively, "signaling" may mean that the information is included in a bitstream or a recording medium by the encoding device. The information signaled by the encoding device may be used by the decoding device.

[0227] -The encoding device may generate encoding information by performing encoding on information to be transmitted with a signal. The encoding information may be sent from the encoding device to the decoding device. The decoding device may obtain the information by decoding the transmitted encoding information. Here, the encoding may be entropy encoding, and the decoding may be entropy decoding.

[0228] Selective signaling: Information may be selectively signaled. Selective signaling of information may mean that an encoding device selectively includes the information in a bitstream or a recording medium (according to certain conditions). Selective signaling of information may mean that a decoding device selectively extracts the information from a bitstream (according to certain conditions).

[0229] Omission of signaling: Signaling for information may be omitted. Omission of signaling for information may mean that the encoding device (according to certain conditions) does not include the information in the bitstream or recording medium. Omission of signaling for information may mean that the decoding device (according to certain conditions) does not extract the information from the bitstream.

[0230] Statistical value: A variable, encoding parameter, constant, etc. may have a computable value. A statistical value may be a value generated by performing a calculation (operation) on the value of a specified target. For example, a statistical value may indicate one or more of an average value, a weighted average value, a weighted sum, a minimum value, a maximum value, a modulus value, a median value, and an interpolated value of the values ​​of a particular variable, a particular encoding parameter, a particular constant, etc.

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

[0232] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include one or more images (pictures). The encoding device 100 may sequentially encode one or more images of a video.

[0233] The encoding device may generate the encoding information by encoding the information to be transmitted by the signal. The encoding information may be sent from the encoding device to the decoding device. The decoding device may obtain the information by decoding the received encoding information. Here, the encoding may be entropy encoding, and the decoding may be entropy decoding.

[0234] Reference Figure 1 , the encoding device 100 includes an inter-frame prediction unit 110, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization (inverse quantization) unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.

[0235] The encoding apparatus 100 may perform encoding on a target image using an intra mode and / or an inter mode. In other words, a prediction mode for a target block may be one of an intra mode and an inter mode.

[0236] Hereinafter, the terms “intra mode”, “intra prediction mode”, “intra-screen mode”, and “intra-screen prediction mode” may be used to have the same meaning and may be used interchangeably with each other.

[0237] Hereinafter, the terms “inter mode”, “inter prediction mode”, “inter-picture mode” and “inter-picture prediction mode” may be used to have the same meaning and may be used interchangeably with each other.

[0238] Hereinafter, the term "image" may indicate only a portion of an image, or may indicate a block. In addition, processing of an "image" may indicate sequential processing of a plurality of blocks.

[0239] In addition, the encoding device 100 may generate a bitstream including encoding information by encoding the target image, and may output and store the generated bitstream. The generated bitstream may be stored in a computer-readable storage medium and may be streamed through a wired and / or wireless transmission medium.

[0240] When the intra mode is used as the prediction mode, the switch 115 may switch to the intra mode. When the inter mode is used as the prediction mode, the switch 115 may switch to the inter mode.

[0241] The encoding apparatus 100 may generate a prediction block of the target block. In addition, after generating the prediction block, the encoding apparatus 100 may encode a residual block of the target block using a residual between the target block and the prediction block.

[0242] When the prediction mode is the intra mode, the intra prediction unit 120 may use pixels of a previously encoded / decoded neighboring block adjacent to the target block as reference samples. The intra prediction unit 120 may perform spatial prediction on the target block using the reference samples, and may generate prediction samples for the target block via spatial prediction. The prediction samples may refer to samples in the prediction block.

[0243] The inter prediction unit 110 may include a motion prediction unit and a motion compensation unit.

[0244] When the prediction mode is the inter mode, the motion prediction unit may search the reference image for an area that most closely matches the target block during the motion prediction process, and may derive a motion vector for the target block and the found area based on the found area. Here, the motion prediction unit may use the search range as the target area for the search.

[0245] The reference image may be stored in the reference picture buffer 190. More specifically, when encoding and / or decoding of the reference image has been processed, the encoded and / or decoded reference image may be stored in the reference picture buffer 190.

[0246] Since the decoded pictures are stored, the reference picture buffer 190 may be a decoded picture buffer (DPB).

[0247] The motion compensation unit may generate a prediction block for the target block by performing motion compensation using a motion vector. Here, the motion vector may be a two-dimensional (2D) vector for inter-frame prediction. In addition, the motion vector may indicate an offset between a target image and a reference image.

[0248] When the motion vector has a value other than an integer, the motion prediction unit and the motion compensation unit may generate a prediction block by applying an interpolation filter to a partial area of ​​the reference image. In order to perform inter prediction or motion compensation, it may be determined which of the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode corresponds to a method for predicting the motion of a PU included in a CU based on the CU and compensating for the motion, and inter prediction or motion compensation may be performed according to the mode.

[0249] The subtractor 125 may generate a residual block, which is the difference between the target block and the prediction block. The residual block may also be referred to as a "residual signal".

[0250] The residual signal may be the difference between the original signal and the prediction signal. Alternatively, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal or by transforming and quantizing the difference. The residual block may be a residual signal for a block unit.

[0251] The transform unit 130 may generate a transform coefficient by transforming the residual block, and may output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by transforming the residual block.

[0252] The transform unit 130 may use one of a plurality of predefined transform methods when performing the transform.

[0253] The plurality of predefined transform methods may include discrete cosine transform (DCT), discrete sine transform (DST), Karhunen-Loeve transform (KLT), and the like.

[0254] The transform method for transforming the residual block may be determined according to at least one of the encoding parameters for the target block and / or the neighboring block. For example, the transform method may be determined based on at least one of the inter prediction mode for the PU, the intra prediction mode for the PU, the size of the TU, and the shape of the TU. Alternatively, transform information indicating the transform method may be transmitted from the encoding device 100 to the decoding device 200 by signaling.

[0255] When the transform skip mode is used, the transform unit 130 may omit transforming the residual block.

[0256] By applying quantization to the transform coefficients, quantized transform coefficient levels or quantization levels may be generated. Hereinafter, in an embodiment, each of the quantized transform coefficient levels and the quantization levels may also be referred to as a 'transform coefficient'.

[0257] The quantization unit 140 may generate a quantized transform coefficient level (ie, a quantization level or a quantization coefficient) by quantizing the transform coefficient according to the quantization parameter. The quantization unit 140 may output the generated quantized transform coefficient level. In this case, the quantization unit 140 may quantize the transform coefficient using a quantization matrix.

[0258] The entropy encoding unit 150 may generate a bitstream by performing entropy encoding based on probability distribution based on the value calculated by the quantization unit 140 and / or the encoding parameter value calculated during the encoding process. The entropy encoding unit 150 may output the generated bitstream.

[0259] The entropy encoding unit 150 may perform entropy encoding on information about pixels of an image and information required to decode the image. For example, the information required to decode the image may include syntax elements and the like.

[0260] When entropy coding is applied, fewer bits can be allocated to symbols that appear more frequently, and more bits can be allocated to symbols that appear less frequently. Since the symbols are represented by this allocation, the size of the bit string of the target symbol to be encoded can be reduced. Therefore, the compression performance of video coding can be improved by entropy coding.

[0261] In addition, for entropy coding, the entropy coding unit 150 may use a coding method such as exponential Golomb, context adaptive variable length coding (CAVLC) or context adaptive binary arithmetic coding (CABAC). For example, the entropy coding unit 150 may use a variable length coding / code (VLC) table to perform entropy coding. For example, the entropy coding unit 150 may derive a binarization method for a target symbol. In addition, the entropy coding unit 150 may derive a probability model for a target symbol / binary bit. The entropy coding unit 150 may use the derived binarization method, probability model and context model to perform arithmetic coding.

[0262] The entropy encoding unit 150 may transform coefficients in a 2D block form into a 1D vector form through a transform coefficient scanning method in order to encode quantized transform coefficient levels.

[0263] The coding parameters may be information required for coding and / or decoding. The coding parameters may include information encoded by the coding device 100 and transmitted from the coding device 100 to the decoding device, and may also include information that can be derived during the coding or decoding process. For example, the information transmitted to the decoding device may include syntax elements.

[0264] The coding parameters may include not only information (or flags or indexes) encoded by the coding device and transmitted by the coding device to the decoding device using a signal, such as syntax elements, but also information derived in the coding or decoding process. In addition, the coding parameters may include information required to encode or decode the image. For example, the coding parameters may include at least one value, combination or statistics of the following items: the size of the unit / block, the shape / form of the unit / block, the depth of the unit / block, the partition information of the unit / block, the partition structure of the unit / block, information indicating whether the unit / block is partitioned in a quadtree structure, information indicating whether the unit / block is partitioned in a binary tree structure, the partition direction of the binary tree structure (horizontal or vertical), the partition form of the binary tree structure (symmetric partitioning or asymmetric partitioning), information indicating whether the unit / block is partitioned in a ternary tree structure, the partition direction of the ternary tree structure (horizontal or vertical), the partition form of the ternary tree structure (symmetric partitioning or asymmetric partitioning), etc.), information indicating whether the unit / block is partitioned in a multi-type tree structure, a combination and direction of partitions of the multi-type tree structure (horizontal direction or vertical direction, etc.), a partition form of the multi-type tree structure (symmetric partition or asymmetric partition, etc.), a partition tree in the form of a multi-type tree (binary tree or ternary tree), a prediction type (intra-frame prediction or inter-frame prediction), an intra-frame prediction mode / direction, an intra-frame luminance prediction mode / direction, an intra-frame chrominance prediction mode / direction, an intra-frame partition information, an inter-frame partition information, a coding block partition flag, a prediction block partition flag, a transform block partition flag, a reference sample filtering method, a reference sample filter tap, a reference sample filter coefficient, a prediction block filtering method, a prediction prediction block filter tap, prediction block filter coefficient, prediction block boundary filtering method, prediction block boundary filter tap, prediction block boundary filter coefficient, inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction direction, inter prediction indicator, prediction list utilization flag, reference picture list, reference image, POC, motion vector predictor, motion vector prediction index, motion vector prediction candidate, motion vector candidate list, information indicating whether to use merge mode, merge index, merge candidate, merge candidate list, information indicating whether to use skip mode, type of interpolation filter, tap of interpolation filter, filter of interpolation filter information indicating whether a deblocking filter is applied, coefficients of the in-loop filter, taps of the in-loop filter, shape / form of the in-loop filter, information indicating whether a deblocking filter is applied, coefficients of the deblocking filter,taps of a deblocking filter, strength of a deblocking filter, shape / form of a deblocking filter, information indicating whether an adaptive sample offset is applied, value of an adaptive sample offset, category of an adaptive sample offset, type of an adaptive sample offset, information indicating whether an adaptive in-loop filter is applied, coefficients of an adaptive in-loop filter, taps of an adaptive in-loop filter, shape / form of an adaptive in-loop filter, binarization / debinarization method, context model, context model determination method, context model update method, information indicating whether a normal mode is performed, information whether a bypass mode is performed, a valid coefficient flag, a last valid coefficient flag, a coding flag for a coefficient group, a position of a last valid coefficient, information indicating whether a coefficient value is greater than 1, information indicating whether a coefficient value is greater than 2, information indicating whether a coefficient value is greater than 3, residual coefficient value information, sign information, reconstructed luminance samples, reconstructed chrominance samples, context bits, bypass bits, residual Differential luminance samples, residual chrominance samples, transform coefficients, luminance transform coefficients, chrominance transform coefficients, quantization levels, luminance quantization levels, chrominance quantization levels, transform coefficient levels, transform coefficient level scanning methods, the size of the motion vector search area on the decoding device side, the shape / form of the motion vector search area on the decoding device side, the number of motion vector searches on the decoding device side, the size of the CTU, the minimum block size, the maximum block size, the maximum block depth, the minimum block depth, the image display / output order, the stripe identification information, the stripe type, the stripe partition information, the parallel block group identification information, the parallel block group type, the parallel block group partition information, the parallel block identification information, the parallel block type, the parallel block partition information, the picture type, the bit depth, the input sample bit depth, the reconstructed sample bit depth, the residual sample bit depth, the transform coefficient bit depth, the quantization level bit depth, the information about the luminance signal, the information about the chrominance signal, the color space of the target block and the color space of the residual block. In addition, the above-mentioned coding parameter related information may also be included in the coding parameters. Information used to calculate and / or derive the above-mentioned coding parameters may also be included in the coding parameters. Information calculated or derived using the above encoding parameters may also be included in the encoding parameters.

[0265] The first transform selection information may indicate a first transform applied to the target block.

[0266] The secondary transform selection information may indicate a secondary transform applied to the target block.

[0267] The residual signal may represent the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming and quantizing the difference between the original signal and the predicted signal. The residual block may be the residual signal of the block.

[0268] Here, signaling information may mean that the encoding apparatus 100 includes entropy encoding information generated by performing entropy encoding on a flag or an index in a bitstream, and the decoding apparatus 200 obtains information by performing entropy decoding on the entropy encoding information extracted from the bitstream. Here, the information may include a flag, an index, etc.

[0269] A signal may mean information to be transmitted using a signal. Hereinafter, information for an image and a block may be referred to as a signal. In addition, hereinafter, the terms "information" and "signal" may be used to have the same meaning and may be used interchangeably with each other. For example, a specific signal may be a signal representing a specific block. An original signal may be a signal representing a target block. A prediction signal may be a signal representing a prediction block. A residual signal may be a signal representing a residual block.

[0270] The bitstream may include information based on a specific syntax. The encoding apparatus 100 may generate a bitstream including the information according to the specific syntax. The decoding apparatus 200 may acquire information from the bitstream according to the specific syntax.

[0271] Since the encoding apparatus 100 performs encoding via inter-frame prediction, the encoded target image can be used as a reference image for another (one or more) images to be processed subsequently. Therefore, the encoding apparatus 100 may reconstruct or decode the encoded target image and store the reconstructed or decoded image as a reference image in the reference picture buffer 190. For decoding, inverse quantization and inverse transformation of the encoded target image may be processed.

[0272] The quantization level may be inversely quantized by the inverse quantization unit 160, and may be inversely transformed by the inverse transform unit 170. The inverse quantization unit 160 may generate an inversely quantized coefficient by performing inverse quantization on the quantization level. The inverse transform unit 170 may generate an inversely quantized and inversely transformed coefficient by performing inverse transformation on the inversely quantized coefficient.

[0273] The inverse quantized and inverse transformed coefficients may be added to the prediction block by the adder 175. The inverse quantized and inverse transformed coefficients are added to the prediction block, and then a reconstructed block may be generated. Here, the inverse quantized and / or inverse transformed coefficients may represent coefficients on which one or more of inverse quantization and inverse transformation are performed, and may also represent a reconstructed residual block. Here, the reconstructed block may mean a restored block or a decoded block.

[0274] The reconstructed block may be filtered by the filter unit 180. The filter unit 180 may apply one or more of a deblocking filter, a sample adaptive offset (SAO) filter, an adaptive loop filter (ALF), and a non-local filter (NLF) to the reconstructed samples, the reconstructed block, or the reconstructed picture. The filter unit 180 may also be referred to as an "in-loop filter".

[0275] The deblocking filter can eliminate block distortion that occurs at the boundary between blocks in the reconstructed picture. In order to determine whether to apply the deblocking filter, the number of rows or columns included in the block and including (one or more) pixels for the following operation can be determined: whether to apply the deblocking filter to the target block based on the (one or more) pixels.

[0276] When a deblocking filter is applied to a target block, the filter applied may be different according to the required strength of the deblocking filter. In other words, among different filters, a filter determined by considering the strength of the deblocking filter may be applied to the target block. When a deblocking filter is applied to a target block, one or more filters among a long tap filter, a strong filter, a weak filter, and a Gaussian filter may be applied to the target block according to the required strength of the deblocking filter.

[0277] In addition, when vertical filtering and horizontal filtering are performed on the target block, the horizontal filtering and the vertical filtering may be processed in parallel.

[0278] SAO may add a suitable offset to the value of a pixel to compensate for a coding error. SAO may perform correction of an offset using a difference between an original image and an image to which deblocking is applied on a pixel basis for an image to which deblocking is applied. In order to perform offset correction on an image, a method for dividing pixels included in an image into a certain number of regions, determining a region to which an offset is to be applied among the divided regions, and applying the offset to the determined region may be used, and a method for applying an offset in consideration of edge information of each pixel may also be used.

[0279] The ALF may perform filtering based on a value obtained by comparing the reconstructed image with the original image. After the pixels included in the image have been divided into a predetermined number of groups, the filter to be applied to each group may be determined, and filtering may be performed differently for each group. Information related to whether an adaptive loop filter is applied may be transmitted with a signal for each CU. Such information may be transmitted with a signal for a luminance signal. The shape and filter coefficients of the ALF to be applied to each block may be different for each block. Alternatively, an ALF having a fixed form may be applied to the block regardless of the characteristics of the block.

[0280] The non-local filter may perform filtering based on a reconstructed block similar to the target block. An area similar to the target block may be selected from the reconstructed picture, and the statistical characteristics of the selected similar area may be used to perform filtering of the target block. Information on whether to apply the non-local filter may be transmitted with a signal for a coding unit (CU). In addition, the shape and filter coefficients of the non-local filter to be applied to the block may be different according to the block.

[0281] The reconstructed block or the reconstructed image filtered by the filter unit 180 may be stored as a reference picture in the reference picture buffer 190. The reconstructed block filtered by the filter unit 180 may be a part of the reference picture. In other words, the reference picture may be a reconstructed picture composed of the reconstructed blocks filtered by the filter unit 180. The stored reference picture may be subsequently used for inter-frame prediction or motion compensation.

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

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

[0284] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210, an inverse quantization (dequantization) unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, an inter-frame prediction unit 250, a switch 245, an adder 255, a filter unit 260 and a reference picture buffer 270.

[0285] The decoding apparatus 200 may receive a bitstream output from the encoding apparatus 100. The decoding apparatus 200 may receive a bitstream stored in a computer-readable storage medium, and may receive a bitstream streamed through a wired / wireless transmission medium.

[0286] The decoding apparatus 200 may perform decoding on a bitstream in an intra mode and / or an inter mode. In addition, the decoding apparatus 200 may generate a reconstructed image or a decoded image through decoding, and may output the reconstructed image or the decoded image.

[0287] For example, switching to the intra mode or the inter mode based on the prediction mode for decoding may be performed by the switch 245. When the prediction mode for decoding is the intra mode, the switch 245 may be operated to switch to the intra mode. When the prediction mode for decoding is the inter mode, the switch 245 may be operated to switch to the inter mode.

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

[0289] The entropy decoding unit 210 may generate symbols by performing entropy decoding on the bitstream based on the probability distribution of the bitstream. The generated symbols may include symbols in the form of quantized transform coefficient levels (i.e., quantization levels or quantization coefficients). Here, the entropy decoding method may be similar to the above-mentioned entropy encoding method. That is, the entropy decoding method may be an inverse process of the above-mentioned entropy encoding method.

[0290] The entropy decoding unit 210 may change a coefficient having a one-dimensional (1D) vector form into a 2D block shape through a transform coefficient scanning method in order to decode quantized transform coefficient levels.

[0291] For example, by scanning the block coefficients using an upper right diagonal scan, the coefficients of the block can be changed into a 2D block shape. Optionally, which of the upper right diagonal scan, vertical scan, and horizontal scan to use can be determined according to the size of the corresponding block and / or the intra prediction mode.

[0292] The quantized coefficients may be inversely quantized by the inverse quantization unit 220. The inverse quantization unit 220 may generate an inversely quantized coefficient by performing inverse quantization on the quantized coefficients. In addition, the inversely quantized coefficients may be inversely transformed by the inverse transform unit 230. The inverse transform unit 230 may generate a reconstructed residual block by performing inverse transformation on the inversely quantized coefficients. As a result of performing inverse quantization and inverse transformation on the quantized coefficients, a reconstructed residual block may be generated. Here, the inverse quantization unit 220 may apply a quantization matrix to the quantized coefficients when generating the reconstructed residual block.

[0293] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction using pixel values ​​of a previously decoded neighboring block adjacent to the target block with respect to the target block.

[0294] The inter prediction unit 250 may include a motion compensation unit. Alternatively, the inter prediction unit 250 may be designated as a "motion compensation unit."

[0295] When the inter mode is used, the motion compensation unit may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270 with respect to the target block.

[0296] The motion compensation unit may apply an interpolation filter to a partial area of ​​a reference image when a motion vector has a value other than an integer, and may generate a prediction block using the reference image to which the interpolation filter is applied. In order to perform motion compensation, the motion compensation unit may determine which of a skip mode, a merge mode, an advanced motion vector prediction (AMVP) mode, and a current picture reference mode corresponds to a motion compensation method for a PU included in the CU based on the CU, and may perform motion compensation according to the determined mode.

[0297] The reconstructed residual block and the prediction block may be added to each other by the adder 255. The adder 255 may generate a reconstructed block by adding the reconstructed residual block to the prediction block.

[0298] The reconstructed block may be filtered by the filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, an SAO filter, an ALF, and an NLF to the reconstructed block or the reconstructed image. The reconstructed image may be a picture including the reconstructed block.

[0299] The filter unit may output a reconstructed image.

[0300] The reconstructed image and / or the reconstructed block filtered by the filter unit 260 may be stored as a reference picture in the reference picture buffer 270. The reconstructed block filtered by the filter unit 260 may be a part of the reference picture. In other words, the reference picture may be an image composed of the reconstructed blocks filtered by the filter unit 260. The stored reference picture may be subsequently used for inter-frame prediction or motion compensation.

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

[0302] Figure 3 An example where a single unit is partitioned into a plurality of sub-units may be schematically shown.

[0303] In order to efficiently partition an image, a coding unit (CU) may be used in encoding and decoding. The term "unit" may be used to collectively specify 1) a block including image samples and 2) a syntax element. For example, "partition of a unit" may mean "partition of a block corresponding to a unit".

[0304] CU can be used as a basic unit for image encoding / decoding. CU can be used as a unit to which one mode selected from intra mode and inter mode is applied in image encoding / decoding. In other words, in image encoding / decoding, it can be determined which one of the intra mode and the inter mode is applied to each CU.

[0305] Also, a CU may be a basic unit in prediction, transformation, quantization, inverse transformation, inverse quantization, and encoding / decoding of a transform coefficient.

[0306] Reference Figure 3 , the image 300 may be sequentially partitioned into units corresponding to a maximum coding unit (LCU), and a partition structure may be determined for each LCU. Here, LCU may be used to have the same meaning as a coding tree unit (CTU).

[0307] The partition of a unit may mean the partition of a block corresponding to the unit. The block partition information may include depth information about the depth of the unit. The depth information may indicate the number of times the unit is partitioned and / or the degree to which the unit is partitioned. A single unit may be hierarchically partitioned into a plurality of sub-units with depth information based on a tree structure.

[0308] Each of the sub-units of the partition may have depth information. The depth information may be information indicating the size of the CU. The depth information may be stored for each CU.

[0309] Each CU may have depth information. When a CU is partitioned, a CU generated by partitioning may have a depth increased by 1 from the depth of the partitioned CU.

[0310] The partition structure may mean the distribution of coding units (CUs) for efficiently encoding an image in the LCU 310. Such distribution may be determined according to whether a single CU is to be partitioned into a plurality of CUs. The number of CUs generated by partitioning may be a positive integer of 2 or more, including 2, 3, 4, 8, 16, etc.

[0311] According to the number of CUs generated by partitioning, the horizontal size and vertical size of each of the CUs generated by partitioning may be smaller than the horizontal size and vertical size of the CU before partitioning. For example, the horizontal size and vertical size of each of the CUs generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning.

[0312] The CU of each partition may be recursively partitioned into four CUs in the same manner. Through recursive partitioning, at least one of the horizontal size and the vertical size of the CU of each partition may be reduced compared to at least one of the horizontal size and the vertical size of the CU before partitioning.

[0313] Partitioning of the CU may be performed recursively up to a predefined depth or a predefined size.

[0314] For example, the depth of the CU may have a value ranging from 0 to 3. According to the depth of the CU, the size of the CU may range from a size of 64×64 to a size of 8×8.

[0315] For example, the depth of the LCU 310 may be 0, and the depth of the minimum coding unit (SCU) may be a predefined maximum depth. Here, as described above, the LCU may be a CU having a maximum coding unit size, and the SCU may be a CU having a minimum coding unit size.

[0316] Partitioning may start from the LCU 310, and the depth of the CU may increase by one whenever the horizontal and / or vertical size of the CU is reduced by partitioning.

[0317] For example, for each depth, a non-partitioned CU may have a size of 2N×2N. In addition, in the case where the CU is partitioned, a CU of size 2N×2N may be partitioned into four CUs, each of which has a size of N×N. Whenever the depth increases by 1, the value of N may be halved.

[0318] Reference Figure 3 , an LCU with a depth of 0 may have 64×64 pixels or 64×64 blocks. 0 may be the minimum depth. An SCU with a depth of 3 may have 8×8 pixels or 8×8 blocks. 3 may be the maximum depth. Here, a CU with 64×64 blocks as an LCU may be represented by a depth of 0. A CU with 32×32 blocks may be represented by a depth of 1. A CU with 16×16 blocks may be represented by a depth of 2. A CU with 8×8 blocks as an SCU may be represented by a depth of 3.

[0319] Information about whether the corresponding CU is partitioned may be represented by partition information of the CU. The partition information may be 1-bit information. All CUs except the SCU may include partition information. For example, the value of the partition information of a non-partitioned CU may be a first value. The value of the partition information of a partitioned CU may be a second value. When the partition information indicates whether the CU is partitioned, the first value may be "0" and the second value may be "1".

[0320] For example, when a single CU is partitioned into four CUs, the horizontal size and vertical size of each of the four CUs generated by partitioning may be half the horizontal size and vertical size of the CU before partitioning. When a CU having a size of 32×32 is partitioned into four CUs, the size of each of the four partitioned CUs may be 16×16. When a single CU is partitioned into four CUs, it may be considered that the CU has been partitioned in a quadtree structure. In other words, it may be considered that quadtree partitioning has been applied to the CU.

[0321] For example, when a single CU is partitioned into two CUs, the horizontal size or vertical size of each of the two CUs generated by partitioning may be half the horizontal size or vertical size of the CU before partitioning. When a CU with a size of 32×32 is partitioned vertically into two CUs, the size of each of the two CUs after partitioning may be 16×32. When a CU with a size of 32×32 is partitioned horizontally into two CUs, the size of each of the two CUs after partitioning may be 32×16. When a single CU is partitioned into two CUs, it can be considered that the CU has been partitioned in a binary tree structure. In other words, it can be considered that binary tree partitioning has been applied to the CU.

[0322] For example, when a single CU is partitioned (or divided) into three CUs, the original CU before partitioning is partitioned so that its horizontal size or vertical size is divided at a ratio of 1:2:1, thereby enabling the generation of three sub-CUs. For example, when a CU with a size of 16×32 is partitioned horizontally into three sub-CUs, the three sub-CUs generated by the partitioning may have sizes of 16×8, 16×16, and 16×8, respectively, in the direction from top to bottom. For example, when a CU with a size of 32×32 is partitioned vertically into three sub-CUs, the three sub-CUs generated by the partitioning may have sizes of 8×32, 16×32, and 8×32, respectively, in the direction from left to right. When a single CU is partitioned into three CUs, the CU may be considered to be partitioned in a ternary tree form. In other words, it may be considered that ternary tree partitioning has been applied to the CU.

[0323] Both quadtree partitioning and binary tree partitioning are applied to Figure 3 LCU 310.

[0324] In the encoding apparatus 100, a coding tree unit (CTU) having a size of 64×64 may be partitioned into a plurality of smaller CUs by a recursive quadtree structure. A single CU may be partitioned into four CUs having the same size. Each CU may be recursively partitioned and may have a quadtree structure.

[0325] Through recursive partitioning of CUs, the best partitioning method that results in the minimum rate-distortion penalty can be selected.

[0326] Figure 3 The coding tree unit (CTU) 320 in FIG. 1 is an example of a total CTU to which quadtree partitioning, binary tree partitioning, and ternary tree partitioning are applied.

[0327] As described above, in order to partition a CTU, at least one of quadtree partitioning, binary tree partitioning, and ternary tree partitioning may be applied to the CTU. The partitioning may be applied based on a specific priority.

[0328] For example, quadtree partitioning may be preferentially applied to CTUs. A CU that cannot be further partitioned in the form of a quadtree may correspond to a leaf node of a quadtree. A CU corresponding to a leaf node of a quadtree may be a root node of a binary tree and / or a ternary tree. That is, a CU corresponding to a leaf node of a quadtree may be partitioned in the form of a binary tree or a ternary tree, or may not be further partitioned. In this case, each CU generated by applying a binary tree partitioning or a ternary tree partitioning to a CU corresponding to a leaf node of a quadtree is prevented from being subjected to quadtree partitioning again, thereby effectively performing partitioning of a block and / or signaling of block partition information.

[0329] The four partition information may be used to signal the partition of the CU corresponding to each node of the quadtree. The four partition information having a first value (e.g., "1") may indicate that the corresponding CU is partitioned in a quadtree form. The four partition information having a second value (e.g., "0") may indicate that the corresponding CU is not partitioned in a quadtree form. The four partition information may be a flag having a specific length (e.g., 1 bit).

[0330] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, the CU corresponding to the leaf node of the quadtree may be partitioned in a binary tree form or a ternary tree form. In addition, the CU generated by binary tree partitioning or ternary tree partitioning may be further partitioned in a binary tree form or a ternary tree form, or may not be further partitioned.

[0331] Partitioning performed when there is no priority between binary tree partitioning and ternary tree partitioning may be referred to as "multi-type tree partitioning". That is, the CU corresponding to the leaf node of the quadtree may be the root node of the multi-type tree. The partition of the CU corresponding to each node of the multi-type tree may be signaled using at least one of information indicating whether the CU is partitioned in a multi-type tree, partition direction information, and partition tree information. For the partition of the CU corresponding to each node of the multi-type tree, information indicating whether partitioning in a multi-type tree is performed, partition direction information, and partition tree information may be sequentially signaled.

[0332] For example, information indicating whether a CU is partitioned in a multi-type tree and having a first value (e.g., "1") may indicate that the corresponding CU is partitioned in a multi-type tree. Information indicating whether a CU is partitioned in a multi-type tree and having a second value (e.g., "0") may indicate that the corresponding CU is not partitioned in a multi-type tree.

[0333] When a CU corresponding to each node of the multi-type tree is partitioned in the multi-type tree form, the corresponding CU may further include partition direction information.

[0334] The partition direction information may indicate the partition direction of the multi-type tree partition. The partition direction information having a first value (e.g., "1") may indicate that the corresponding CU is partitioned in the vertical direction. The partition direction information having a second value (e.g., "0") may indicate that the corresponding CU is partitioned in the horizontal direction.

[0335] When a CU corresponding to each node of a multi-type tree is partitioned in a multi-type tree form, the corresponding CU may further include partition tree information. The partition tree information may indicate a tree used for multi-type tree partitioning.

[0336] For example, partition tree information having a first value (eg, "1") may indicate that the corresponding CU is partitioned in a binary tree form. Partition tree information having a second value (eg, "0") may indicate that the corresponding CU is partitioned in a ternary tree form.

[0337] Here, each of the above-mentioned information indicating whether partitioning with a multi-type tree is performed, the partition tree information, and the partition direction information may be a flag having a specific length (eg, 1 bit).

[0338] At least one of the above-mentioned four partition information, the information indicating whether to perform partitioning with a multi-type tree, the partition direction information, and the partition tree information may be entropy encoded and / or entropy decoded. In order to perform entropy encoding / decoding of such information, information of a neighboring CU adjacent to the target CU may be used.

[0339] For example, it can be considered that the partition form (i.e., partition / non-partition, partition tree and / or partition direction) of the left CU and / or the upper CU and the partition form of the target CU will be similar to each other with a high probability. Therefore, based on the information of the neighboring CU, context information for entropy encoding and / or entropy decoding of the information of the target CU can be derived. Here, the information of the neighboring CU may include at least one of the following items: 1) four partition information of the neighboring CU, 2) information indicating whether the neighboring CU is partitioned in a multi-type tree, 3) partition direction information of the neighboring CU, and 4) partition tree information of the neighboring CU.

[0340] In another embodiment, among the binary tree partitioning and the ternary tree partitioning, the binary tree partitioning may be performed preferentially. That is, the binary tree partitioning may be applied first, and then the CU corresponding to the leaf node of the binary tree may be set as the root node of the ternary tree. In this case, the quadtree partitioning or the binary tree partitioning may not be performed on the CU corresponding to the node of the ternary tree.

[0341] A CU that is no longer further partitioned by quadtree partitioning, binary tree partitioning, and / or ternary tree partitioning may be a unit for coding, prediction, and / or transformation. That is, the CU may not be further partitioned for prediction and / or transformation. Therefore, a partition structure for partitioning a CU into a prediction unit (PU) and / or a transformation unit (TU), its partition information, and the like may not be present in the bitstream.

[0342] However, when the size of the CU as a unit of partition is larger than the size of the maximum transform block, the CU may be recursively partitioned until the size of the CU becomes smaller than or equal to the size of the maximum transform block. For example, when the size of the CU is 64×64 and the size of the maximum transform block is 32×32, the CU may be partitioned into four 32×32 blocks in order to perform transform. For example, when the size of the CU is 32×64 and the size of the maximum transform block is 32×32, the CU may be partitioned into two 32×32 blocks.

[0343] In this case, information indicating whether the CU is partitioned for transformation may not be separately signaled. Without signaling, whether the CU is partitioned may be determined via a comparison between the horizontal size (and / or vertical size) of the CU and the horizontal size (and / or vertical size) of the largest transform block. For example, when the horizontal size of the CU is larger than the horizontal size of the largest transform block, the CU may be bisected vertically. In addition, when the vertical size of the CU is larger than the vertical size of the largest transform block, the CU may be bisected horizontally.

[0344] Information about the maximum size and / or minimum size of the CU and information about the maximum size and / or minimum size of the transform block may be signaled or determined at a higher level than the CU level. For example, the higher level may be a sequence level, a picture level, a tile level, a tile group level, or a slice level. For example, the minimum size of the CU may be set to 4×4. For example, the maximum size of the transform block may be set to 64×64. For example, the maximum size of the transform block may be set to 4×4.

[0345] Information about the minimum size of the CU corresponding to the leaf node of the quadtree (i.e., the minimum size of the quadtree) and / or information about the maximum depth of the path from the root node of the multi-type tree to the leaf node (i.e., the maximum depth of the multi-type tree) may be signaled or determined at a higher level than the level of the CU corresponding to the leaf node of the quadtree. For example, the higher level may be a sequence level, a picture level, a slice level, a tile group level, or a tile level. Information about the minimum size of the quadtree and / or information about the maximum depth of the multi-type tree may be signaled or determined separately at each level of the intra-slice level and the inter-slice level.

[0346] Information about the difference between the size of the CTU and the maximum size of the transform block may be signaled or determined at a higher level than the level of the CU. For example, the higher level may be a sequence level, a picture level, a slice level, a parallel block group level, or a parallel block level. Information about the maximum size of the CU corresponding to each node of the binary tree (i.e., the maximum size of the binary tree) may be determined based on the size and difference information of the CTU. The maximum size of the CU corresponding to each node of the ternary tree (i.e., the maximum size of the ternary tree) may have different values ​​depending on the type of the slice. For example, the maximum size of the ternary tree at the intra-slice level may be 32×32. For example, the maximum size of the ternary tree at the inter-slice level may be 128×128. For example, the minimum size of the CU corresponding to each node of the binary tree (i.e., the minimum size of the binary tree) and / or the minimum size of the CU corresponding to each node of the ternary tree (i.e., the minimum size of the ternary tree) may be set to the minimum size of the CU.

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

[0348] Based on the above-mentioned various block sizes and depths, quad partition information, information indicating whether partitioning with a multi-type tree is performed, partition tree information, and / or partition direction information may or may not exist in a bitstream.

[0349] For example, when the size of the CU is not greater than the minimum size of the quadtree, the CU may not include quad partition information, and the quad partition information of the CU may be inferred as a second value.

[0350] For example, when the size (horizontal size and vertical size) of the CU corresponding to each node of the multi-type tree is greater than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the CU may not be partitioned in a binary tree form and / or a ternary tree form. With this determination, information indicating whether partitioning in a multi-type tree is performed may not be signaled but may be inferred as a second value.

[0351] Optionally, when the size (horizontal size and vertical size) of the CU corresponding to each node of the multi-type tree is equal to the minimum size (horizontal size and vertical size) of the binary tree, or when the size (horizontal size and vertical size) of the CU is equal to twice the minimum size (horizontal size and vertical size) of the ternary tree, the CU may not be partitioned in a binary tree form and / or a ternary tree form. With this determination method, information indicating whether partitioning in a multi-type tree is performed may not be transmitted by a signal, but may be inferred as a second value. The reason is that when the CU is partitioned in a binary tree form and / or a ternary tree form, a CU smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.

[0352] Optionally, binary tree partitioning or ternary tree partitioning may be limited based on the size of a virtual pipeline data unit (ie, the size of a pipeline buffer). For example, when a CU is partitioned into sub-CUs that are not suitable for the size of a pipeline buffer by binary tree partitioning or ternary tree partitioning, binary tree partitioning or ternary tree partitioning may be limited. The size of the pipeline buffer may be equal to the maximum size of a transform block (eg, 64×64).

[0353] For example, when the size of the pipeline buffer is 64×64, the following partitions may be limited.

[0354] -Ternary tree partitioning of N×M CUs (where N and / or M is 128)

[0355] - 128×N CU horizontal binary tree partitioning (where N<=64)

[0356] -N×128 CU vertical binary tree partition (where N<=64)

[0357] Optionally, when the depth of the CU corresponding to each node of the multi-type tree is equal to the maximum depth of the multi-type tree, the CU may not be partitioned in a binary tree form and / or a ternary tree form. With this determination, information indicating whether partitioning in a multi-type tree is performed may not be transmitted by a signal, but may be inferred as a second value.

[0358] Alternatively, information indicating whether partitioning in a multi-type tree is performed may be transmitted by signal only when at least one of vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is possible for a CU corresponding to each node of a multi-type tree. Otherwise, the CU may not be partitioned in a binary tree form and / or a ternary tree form. With this determination, information indicating whether partitioning in a multi-type tree is performed may not be transmitted by signal, but may be inferred as a second value.

[0359] Optionally, for the CU corresponding to each node of the multi-type tree, partition direction information may be transmitted with a signal only when both vertical binary tree partitioning and horizontal binary tree partitioning are possible or only when both vertical ternary tree partitioning and horizontal ternary tree partitioning are possible. Otherwise, the partition direction information may not be transmitted with a signal, but may be inferred as a value indicating the direction in which the CU may be partitioned.

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

[0361] Figure 4 is a diagram illustrating a form of prediction units that a coding unit may include.

[0362] When a CU that is not further partitioned among CUs partitioned from an LCU can be divided into one or more prediction units (PUs), such division is also called 'partitioning'.

[0363] PU can be a basic unit for prediction. PU can be encoded and decoded in any one of skip mode, inter mode and intra mode. PU can be partitioned into various shapes according to each mode. For example, Figure 1 The target block described and the above reference Figure 2 The described target blocks may each be a PU.

[0364] A CU may not be split into PUs. When a CU is not split into PUs, the size of the CU and the size of the PU may be equal to each other.

[0365] In skip mode, partitions may not exist in a CU. In skip mode, a 2N×2N mode 410 may be supported without partitions, wherein in the 2N×2N mode 410, the sizes of the PU and the CU are the same as each other.

[0366] In inter mode, there may be eight types of partition shapes in a CU. For example, in inter mode, 2N×2N mode 410, 2N×N mode 415, N×2N mode 420, N×N mode 425, 2N×nU mode 430, 2N×nD mode 435, nL×2N mode 440, and nR×2N mode 445 may be supported.

[0367] In intra mode, 2N×2N mode 410 and N×N mode 425 may be supported.

[0368] In 2N×2N mode 410, a PU having a 2N×2N size may be encoded. A PU having a 2N×2N size may mean a PU having the same size as that of a CU. For example, a PU having a 2N×2N size may have a size of 64×64, 32×32, 16×16, or 8×8.

[0369] In N×N mode 425 , a PU having an N×N size may be encoded.

[0370] For example, in intra prediction, when the size of the PU is 8×8, the PUs of four partitions may be encoded. The size of the PU of each partition may be 4×4.

[0371] When a PU is encoded in intra mode, any one of multiple intra prediction modes may be used to encode the PU. For example, HEVC technology may provide 35 intra prediction modes, and a PU may be encoded in any one of the 35 intra prediction modes.

[0372] Which of the 2Nx2N mode 410 and the NxN mode 425 is to be used to encode the PU may be determined based on the rate-distortion cost.

[0373] The encoding device 100 may perform an encoding operation on a PU of size 2N×2N. Here, the encoding operation may be an operation of encoding the PU according to each of a plurality of intra prediction modes that may be used by the encoding device 100. Through the encoding operation, an optimal intra prediction mode for a PU of size 2N×2N may be derived. The optimal intra prediction mode may be an intra prediction mode that incurs a minimum rate distortion cost when encoding a PU of size 2N×2N among a plurality of intra prediction modes that may be used by the encoding device 100.

[0374] In addition, the encoding device 100 may sequentially perform encoding operations on each PU obtained from the N×N partition. Here, the encoding operation may be an operation of encoding the PU according to each of a plurality of intra prediction modes that can be used by the encoding device 100. Through the encoding operation, an optimal intra prediction mode for a PU of size N×N may be derived. The optimal intra prediction mode may be an intra prediction mode that incurs a minimum rate distortion cost when encoding a PU of size N×N among a plurality of intra prediction modes that can be used by the encoding device 100.

[0375] The encoding apparatus 100 may determine which one of a PU of size 2N×2N and a PU of size N×N to be encoded based on a comparison of a rate-distortion cost of a PU of size 2N×2N and a rate-distortion cost of a PU of size N×N.

[0376] A single CU may be partitioned into one or more PUs, and a PU may be partitioned into multiple PUs.

[0377] For example, when a single PU is partitioned into four PUs, the horizontal size and vertical size of each of the four PUs generated by partitioning may be half the horizontal size and vertical size of the PU before partitioning. When a PU of size 32×32 is partitioned into four PUs, the size of each of the four partitioned PUs may be 16×16. When a single PU is partitioned into four PUs, it may be considered that the PU has been partitioned in a quadtree structure.

[0378] For example, when a single PU is partitioned into two PUs, the horizontal size or vertical size of each of the two PUs generated by partitioning may be half the horizontal size or vertical size of the PU before partitioning. When a PU of size 32×32 is partitioned vertically into two PUs, the size of each of the two partitioned PUs may be 16×32. When a PU of size 32×32 is partitioned horizontally into two PUs, the size of each of the two partitioned PUs may be 32×16. When a single PU is partitioned into two PUs, it may be considered that the PU has been partitioned in a binary tree structure.

[0379] Figure 5 is a diagram illustrating a form of a transformation unit that may be included in a coding unit.

[0380] A transform unit (TU) may have a basic unit for processes such as transformation, quantization, inverse transformation, inverse quantization, entropy encoding, and entropy decoding in a CU.

[0381] A TU may have a square shape or a rectangular shape. The shape of a TU may be determined based on the size and / or shape of a CU.

[0382] In a CU partitioned from an LCU, a CU that is not further partitioned into a CU may be partitioned into one or more TUs. Here, the partition structure of the TU may be a quadtree structure. For example, Figure 5 As shown, a single CU 510 can be partitioned once or multiple times according to a quadtree structure. With this partitioning, a single CU 510 can be composed of TUs of various sizes.

[0383] It can be considered that when a single CU is split two or more times, the CU is recursively split. Through splitting, a single CU can be composed of transform units (TUs) of various sizes.

[0384] Alternatively, a single CU may be split into one or more TUs based on the number of vertical lines and / or horizontal lines that split the CU.

[0385] The CU may be divided into symmetric TUs or asymmetric TUs. In order to be divided into asymmetric TUs, information about the size and / or shape of each TU may be transmitted from the encoding device 100 to the decoding device 200 by signaling. Alternatively, the size and / or shape of each TU may be derived from the information about the size and / or shape of the CU.

[0386] A CU may not be divided into TUs. When a CU is not partitioned into TUs, the size of the CU and the size of the TU may be equal to each other.

[0387] A single CU may be partitioned into one or more TUs, and a TU may be partitioned into multiple TUs.

[0388] For example, when a single TU is partitioned into four TUs, the horizontal size and vertical size of each of the four TUs generated by partitioning may be half the horizontal size and vertical size of the TU before partitioning. When a TU of size 32×32 is partitioned into four TUs, the size of each of the four partitioned TUs may be 16×16. When a single TU is partitioned into four TUs, the TU may be considered to have been partitioned in a quadtree structure.

[0389] For example, when a single TU is partitioned into two TUs, the horizontal size or vertical size of each of the two TUs generated by partitioning may be half the horizontal size or vertical size of the TU before partitioning. When a TU of size 32×32 is partitioned vertically into two TUs, the size of each of the two partitioned TUs may be 16×32. When a TU of size 32×32 is partitioned horizontally into two TUs, the size of each of the two partitioned TUs may be 32×16. When a single TU is partitioned into two TUs, the TU may be considered to have been partitioned in a binary tree structure.

[0390] Can be different from Figure 5The CU is divided in the manner shown.

[0391] For example, a single CU may be split into three CUs. The horizontal sizes or vertical sizes of the three CUs generated by the splitting may be 1 / 4, 1 / 2, and 1 / 4 of the horizontal size or vertical size of the original CU before the splitting, respectively.

[0392] For example, when a CU of size 32×32 is vertically split into three CUs, the sizes of the three CUs generated from the splitting may be 8×32, 16×32, and 8×32, respectively. In this way, when a single CU is split into three CUs, it may be considered that the CU is split in the form of a ternary tree.

[0393] One of the exemplary partitioning forms (i.e., quadtree partitioning, binary tree partitioning, and ternary tree partitioning) may be applied to the partitioning of the CU, and multiple partitioning schemes may be combined and used together for the partitioning of the CU. Here, the case where multiple partitioning schemes are combined and used together may be referred to as "complex tree format partitioning".

[0394] Figure 6 The division of blocks according to an example is shown.

[0395] In the video encoding and / or decoding process, the target block may be divided into Figure 6 For example, the target block may be a CU.

[0396] For the splitting of the target block, an indicator indicating the splitting information may be signaled from the encoding apparatus 100 to the decoding apparatus 200. The splitting information may be information indicating how the target block is split.

[0397] The split information may be one or more of a split flag (hereinafter referred to as "split_flag"), a quad flag (hereinafter referred to as "QB_flag"), a quadtree flag (hereinafter referred to as "quadtree_flag"), a binary tree flag (hereinafter referred to as "binarytree_flag") and a binary type flag (hereinafter referred to as "Btype_flag").

[0398] "split_flag" may be a flag indicating whether a block is split. For example, a split_flag value of 1 may indicate that the corresponding block is split. A split_flag value of 0 may indicate that the corresponding block is not split.

[0399] "QB_flag" may be a flag indicating which of the quadtree form and the binary tree form corresponds to the shape in which the block is divided. For example, a QB_flag value of 0 may indicate that the block is divided in a quadtree form. A QB_flag value of 1 may indicate that the block is divided in a binary tree form. Alternatively, a QB_flag value of 0 may indicate that the block is divided in a binary tree form. A QB_flag value of 1 may indicate that the block is divided in a quadtree form.

[0400] "quadtree_flag" may be a flag indicating whether the block is divided in a quadtree form. For example, a quadtree_flag value of 1 may indicate that the block is divided in a quadtree form. A quadtree_flag value of 0 may indicate that the block is not divided in a quadtree form.

[0401] "binarytree_flag" may be a flag indicating whether the block is divided in a binary tree form. For example, a binarytree_flag value of 1 may indicate that the block is divided in a binary tree form. A binarytree_flag value of 0 may indicate that the block is not divided in a binary tree form.

[0402] "Btype_flag" may be a flag indicating which of the vertical division and the horizontal division corresponds to the division direction when the block is divided in the binary tree form. For example, a Btype_flag value of 0 may indicate that the block is divided in the horizontal direction. A Btype_flag value of 1 may indicate that the block is divided in the vertical direction. Alternatively, a Btype_flag value of 0 may indicate that the block is divided in the vertical direction. A Btype_flag value of 1 may indicate that the block is divided in the horizontal direction.

[0403] For example, as shown in Table 1 below, it can be derived by signaling at least one of quadtree_flag, binarytree_flag, and Btype_flag. Figure 6 The partitioning information of the blocks in .

[0404] [Table 1]

[0405]

[0406] For example, as shown in Table 2 below, it can be derived by signaling at least one of split_flag, QB_flag, and Btype_flag. Figure 6 The partitioning information of the blocks in .

[0407] [Table 2]

[0408]

[0409] Depending on the size and / or shape of the block, the partitioning method may be limited to a quadtree or a binary tree. When this limitation is applied, split_flag may be a flag indicating whether the block is partitioned in a quadtree form or a flag indicating whether the block is partitioned in a binary tree form. The size and shape of the block may be derived from the depth information of the block, and the depth information may be transmitted from the encoding device 100 to the decoding device 200 in a signal.

[0410] When the size of the block falls within a specific range, only partitioning in the form of a quadtree may be possible. For example, the specific range may be defined by at least one of a maximum block size and a minimum block size, wherein only partitioning in the form of a quadtree is possible under the maximum block size and the minimum block size.

[0411] Information indicating a maximum block size and a minimum block size for which only quadtree division can be performed may be signaled through a bitstream from the encoding apparatus 100 to the decoding apparatus 200. In addition, the information may be signaled for at least one of units such as a video, a sequence, a picture, a parameter, a tile group, and a slice (or section).

[0412] Optionally, the maximum block size and / or the minimum block size may be a fixed size predefined by the encoding device 100 and the decoding device 200. For example, when the size of the block is above 64×64 and below 256×256, only partitioning in the form of a quadtree may be possible. In this case, split_flag may be a flag indicating whether partitioning in the form of a quadtree is performed.

[0413] When the size of the block is larger than the maximum size of the transform block, only partitioning in a quadtree form may be possible. Here, the sub-block generated by the partitioning may be at least one of a CU and a TU.

[0414] In this case, split_flag may be a flag indicating whether the CU is partitioned in a quadtree form.

[0415] When the size of the block falls within a specific range, only partitioning in a binary tree form or a ternary tree form may be possible. For example, the specific range may be defined by at least one of a maximum block size and a minimum block size, wherein under the maximum block size and the minimum block size, only partitioning in a binary tree form or a ternary tree form is possible.

[0416] Information indicating a maximum block size and / or a minimum block size that can be divided only in a binary tree form or in a ternary tree form may be signaled through a bitstream from the encoding apparatus 100 to the decoding apparatus 200. In addition, the information may be signaled for at least one of units such as a sequence, a picture, and a slice (or segment).

[0417] Alternatively, the maximum block size and / or the minimum block size may be a fixed size predefined by the encoding device 100 and the decoding device 200. For example, when the size of the block is above 8×8 and below 16×16, only partitioning in a binary tree form may be possible. In this case, split_flag may be a flag indicating whether partitioning in a binary tree form or a ternary tree form is performed.

[0418] The above description about partitioning in a quadtree form may be equally applied to a binary tree form and / or a ternary tree form.

[0419] The partitioning of a block may be limited by a previous partitioning. For example, when a block is partitioned in a specific binary tree form and then a plurality of sub-blocks are generated from the partitioning, each sub-block may be partitioned only in a specific tree form. Here, the specific tree form may be at least one of a binary tree form, a ternary tree form, and a quadtree form.

[0420] When the horizontal size or the vertical size of the partition block is a size that cannot be further divided, the above-mentioned indicator may not be signaled.

[0421] Figure 7 is a diagram for explaining an embodiment of an intra prediction process.

[0422] Figure 7 The arrows extending radially from the center of the drawing in FIG. 8 indicate prediction directions of intra prediction modes. In addition, numbers appearing near arrows indicate examples of mode values ​​assigned to intra prediction modes or prediction directions of intra prediction modes.

[0423] exist Figure 7 In the example, the number 0 may represent the planar mode which is a non-directional intra prediction mode, and the number 1 may represent the DC mode which is a non-directional intra prediction mode.

[0424] Intra-frame encoding and / or decoding may be performed using reference samples of neighboring blocks of a target block. The neighboring blocks may be reconstructed neighboring blocks. The reference samples may refer to neighboring samples.

[0425] For example, intra encoding and / or decoding may be performed using a value of a reference sample included in a reconstructed neighboring block or an encoding parameter of the reconstructed neighboring block.

[0426] The encoding device 100 and / or the decoding device 200 may generate a prediction block by performing intra prediction on the target block based on information about samples in the target image. When performing intra prediction, the encoding device 100 and / or the decoding device 200 may generate a prediction block for the target block by performing intra prediction based on information about samples in the target image. When performing intra prediction, the encoding device 100 and / or the decoding device 200 may perform directional prediction and / or non-directional prediction based on at least one reconstructed reference sample.

[0427] The prediction block may be a block generated as a result of performing intra prediction. The prediction block may correspond to at least one of a CU, a PU, and a TU.

[0428] The unit of the prediction block may have a size corresponding to at least one of a CU, a PU, and a TU. The prediction block may have a square shape having a size of 2N×2N or N×N. The size of N×N may include a size of 4×4, 8×8, 16×16, 32×32, 64×64, etc.

[0429] Alternatively, the prediction block may be a square block of size 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, etc. or a rectangular block of size 2×8, 4×8, 2×16, 4×16, 8×16, etc.

[0430] Intra prediction may be performed considering an intra prediction mode for a target block. The number of intra prediction modes that a target block may have may be a predefined fixed value, and may be a value determined differently according to properties of a prediction block. For example, the properties of a prediction block may include a size of a prediction block, a type of a prediction block, etc. In addition, the properties of a prediction block may indicate encoding parameters for the prediction block.

[0431] For example, the number of intra prediction modes may be fixed to N regardless of the size of the prediction block. Alternatively, the number of intra prediction modes may be 3, 5, 9, 17, 34, 35, 36, 65, 67, or 95, for example.

[0432] The intra prediction mode can be a non-directional mode or a directional mode.

[0433] For example, intra prediction modes may include Figure 7 The numbers 0 to 66 shown in FIG. 8 correspond to two non-directional modes and 65 directional modes.

[0434] For example, in the case of using a specific intra prediction method, the intra prediction mode may include Figure 7 The numbers -14 to 80 shown in the figure correspond to two non-directional modes and 93 directional modes.

[0435] The two non-directional modes may include a DC mode and a planar mode.

[0436] The directional mode may be a prediction mode with a specific direction or a specific angle. The directional mode may also be referred to as an "angle mode".

[0437] The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode angle, and a mode direction. In other words, the terms "(mode) number of an intra prediction mode", "(mode) value of an intra prediction mode", "(mode) angle of an intra prediction mode", and "(mode) direction of an intra prediction mode" may be used to have the same meaning and may be used interchangeably with each other.

[0438] The number of intra prediction modes may be M. The value of M may be 1 or more. In other words, the number of intra prediction modes may be M, which includes the number of non-directional modes and the number of directional modes.

[0439] The number of intra prediction modes may be fixed to M regardless of the size of the block and / or the color component. For example, the number of intra prediction modes may be fixed to any one of 35 and 67 regardless of the size of the block.

[0440] Alternatively, the number of intra prediction modes may differ according to the shape, size and / or type of color component of the block.

[0441] For example, in Figure 7 In FIG. 4 , the directional prediction mode indicated by the dotted line can be applied only to the prediction of non-square blocks.

[0442] For example, the larger the size of the block, the larger the number of intra-frame prediction modes. Alternatively, the larger the size of the block, the smaller the number of intra-frame prediction modes. When the size of the block is 4×4 or 8×8, the number of intra-frame prediction modes may be 67. When the size of the block is 16×16, the number of intra-frame prediction modes may be 35. When the size of the block is 32×32, the number of intra-frame prediction modes may be 19. When the size of the block is 64×64, the number of intra-frame prediction modes may be 7.

[0443] For example, the number of intra prediction modes may differ depending on whether the color component is a luma signal or a chroma signal. Alternatively, the number of intra prediction modes corresponding to a luma component block may be greater than the number of intra prediction modes corresponding to a chroma component block.

[0444] For example, in a vertical mode with a mode value of 50, prediction may be performed in a vertical direction based on the pixel values ​​of the reference samples. For example, in a horizontal mode with a mode value of 18, prediction may be performed in a horizontal direction based on the pixel values ​​of the reference samples.

[0445] Even in a directional mode other than the above-described modes, the encoding apparatus 100 and the decoding apparatus 200 may perform intra prediction on a target unit using reference samples according to an angle corresponding to the directional mode.

[0446] An intra-frame prediction mode located to the right relative to the vertical mode may be referred to as a "vertical-right mode". An intra-frame prediction mode located below the horizontal mode may be referred to as a "horizontal-below mode". For example, in Figure 7 , the intra prediction mode having one of the mode values ​​51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, and 66 may be the vertical-right mode. The intra prediction mode having one of the mode values ​​2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, and 17 may be the horizontal-down mode.

[0447] The non-directional mode may include a DC mode and a planar mode. For example, the value of the DC mode may be 1. The value of the planar mode may be 0.

[0448] The directional mode may include an angular mode. Among the plurality of intra prediction modes, the remaining modes except the DC mode and the planar mode may be directional modes.

[0449] When the intra prediction mode is the DC mode, the prediction block may be generated based on an average value of pixel values ​​of a plurality of reference pixels. For example, the value of a pixel of the prediction block may be determined based on the average value of pixel values ​​of a plurality of reference pixels.

[0450] The number of intra prediction modes and the mode values ​​of the intra prediction modes are merely exemplary and may be defined differently according to embodiments, implementations and / or requirements.

[0451] In order to perform intra prediction on a target block, a step of checking whether a sample included in a reconstructed neighboring block can be used as a reference sample of the target block may be performed. When there is a sample that cannot be used as a reference sample of the target block among the samples in the neighboring block, a value generated by copying and / or interpolation using at least one sample value among the samples included in the reconstructed neighboring block may replace a sample value of the sample that cannot be used as a reference sample. When the value generated by copying and / or interpolation replaces the sample value of the existing sample, the sample may be used as a reference sample of the target block.

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

[0453] The type of filter to be applied to at least one of the reference sample and the prediction sample may be different according to at least one of the intra prediction mode of the target block, the size of the target block, and the shape of the target block. The type of filter may be classified according to one or more of the length of the filter tap, the value of the filter coefficient, and the filter strength. The length of the filter tap may mean the number of the filter tap. In addition, the number of the filter tap may mean the length of the filter.

[0454] When the intra prediction mode is the planar mode, when generating a prediction block of a target block, the sample value of the predicted target block can be generated by using a weighted sum of the upper reference sample of the target block, the left reference sample of the target block, the upper right reference sample of the target block, and the lower left reference sample of the target block according to the position of the predicted target sample in the prediction block.

[0455] When the intra prediction mode is the DC mode, when generating a prediction block of a target block, an average value of a reference sample above the target block and a reference sample on the left side of the target block may be used. In addition, filtering using the value of the reference sample may be performed on a specific row or a specific column in the target block. The specific row may be one or more above rows adjacent to the reference sample. The specific column may be one or more left columns adjacent to the reference sample.

[0456] When the intra prediction mode is a directional mode, the prediction block may be generated using an upper reference sample, a left reference sample, an upper right reference sample, and / or a lower left reference sample of the target block.

[0457] In order to generate the above-mentioned prediction samples, real number-based interpolation may be performed.

[0458] The intra prediction mode of the target block may be predicted from intra prediction modes of neighboring blocks adjacent to the target block, and information used for the prediction may be entropy encoded / decoded.

[0459] For example, when the intra prediction modes of the target block and the neighboring block are identical to each other, a predefined flag may be used to signal that the intra prediction modes of the target block and the neighboring block are identical.

[0460] For example, an indicator indicating an intra prediction mode that is the same as the intra prediction mode of the target block among the intra prediction modes of a plurality of neighboring blocks may be signaled.

[0461] When intra prediction modes of a target block and a neighboring block are different from each other, information about the intra prediction mode of the target block may be encoded and / or decoded using entropy encoding and / or decoding.

[0462] Figure 8 is a diagram showing reference samples used in an intra prediction process.

[0463] The reconstructed reference samples used for intra prediction of the target block may include a lower left reference sample, a left reference sample, an upper left reference sample, an upper reference sample, and an upper right reference sample.

[0464] For example, a left reference sample may mean a reconstructed reference pixel adjacent to the left side of the target block. An upper reference sample may mean a reconstructed reference pixel adjacent to the top of the target block. An upper left corner reference sample may mean a reconstructed reference pixel located at the upper left corner of the target block. A lower left corner reference sample may mean a reference sample located below the left sample line among samples on the same line as the left sample line composed of the left reference samples. An upper right corner reference sample may mean a reference sample located on the same line as the upper sample line composed of the upper reference samples and located to the right of the upper sample line.

[0465] When the size of the target block is N×N, the number of lower left reference samples, left reference samples, upper reference samples, and upper right reference samples may each be N.

[0466] By performing intra prediction on the target block, a prediction block may be generated. Generating the prediction block may include determining values ​​of pixels in the prediction block. The target block and the prediction block may be equal in size.

[0467] The reference samples used for intra prediction of the target block may vary according to the intra prediction mode of the target block. The direction of the intra prediction mode may represent the dependency between the reference samples and the pixels of the prediction block. For example, the value of a specified reference sample may be used as the value of one or more specified pixels in the prediction block. In this case, the specified reference sample and one or more specified pixels in the prediction block may be samples and pixels located on a straight line in the direction of the intra prediction mode. In other words, the value of the specified reference sample may be copied as the value of a pixel located in a direction opposite to the direction of the intra prediction mode. Alternatively, the value of a pixel in the prediction block may be the value of a reference sample located in the direction of the intra prediction mode relative to the position of the pixel.

[0468] In an example, when the intra prediction mode of the target block is a vertical mode, the upper reference sample can be used for intra prediction. When the intra prediction mode is a vertical mode, the value of a pixel in the prediction block can be the value of a reference sample located vertically above the position of the pixel. Therefore, the upper reference sample adjacent to the top of the target block can be used for intra prediction. In addition, the value of a pixel in a row of the prediction block can be the same as the value of the above reference sample.

[0469] In an example, when the intra prediction mode of the target block is the horizontal mode, the left reference sample may be used for intra prediction. When the intra prediction mode is the horizontal mode, the value of a pixel in the prediction block may be the value of a reference sample located horizontally to the left of the position of the pixel. Therefore, the left reference sample adjacent to the left side of the target block may be used for intra prediction. In addition, the value of a pixel in a column of the prediction block may be the same as the value of the left reference sample.

[0470] In an example, when the mode value of the intra prediction mode of the current block is 34, at least some of the left reference samples, the upper left reference samples, and at least some of the upper reference samples may be used for intra prediction. When the mode value of the intra prediction mode is 34, the value of a pixel in the prediction block may be the value of a reference sample diagonally located at the upper left corner of the pixel.

[0471] Furthermore, in the case of an intra prediction mode whose mode value is a value within a range of 52 to 66, at least a portion of the upper right reference sample may be used for intra prediction.

[0472] Furthermore, in the case of an intra prediction mode whose mode value is a value within a range of 2 to 17, at least a portion of the lower left reference samples may be used for intra prediction.

[0473] Also, in the case of an intra prediction mode whose mode value is a value within a range of 19 to 49, the top left corner reference sample may be used for intra prediction.

[0474] The number of reference samples used to determine the pixel value of one pixel in the prediction block may be 1 or 2 or more.

[0475] As described above, the pixel value of the pixel in the prediction block may be determined according to the position of the pixel and the position of the reference sample indicated by the direction of the intra prediction mode. When the position of the pixel and the position of the reference sample indicated by the direction of the intra prediction mode are integer positions, the value of one reference sample indicated by the integer position may be used to determine the pixel value of the pixel in the prediction block.

[0476] When the position of a pixel and the position of a reference sample indicated by the direction of an intra prediction mode are not integer positions, an interpolated reference sample based on two reference samples closest to the position of the reference sample may be generated. The value of the interpolated reference sample may be used to determine the pixel value of a pixel in a prediction block. In other words, when the position of a pixel in a prediction block and the position of a reference sample indicated by the direction of an intra prediction mode indicate a position between two reference samples, an interpolated value based on the values ​​of the two samples may be generated.

[0477] The prediction block generated via prediction may not be the same as the original target block. In other words, there may be a prediction error as the difference between the target block and the prediction block, and there may also be a prediction error between the pixels of the target block and the pixels of the prediction block.

[0478] Hereinafter, the terms “difference”, “error” and “residual” may be used to have the same meaning and may be used interchangeably with each other.

[0479] For example, in the case of directional intra prediction, the longer the distance between the pixels of the prediction block and the reference samples, the greater the prediction error that may occur. Such prediction error may lead to discontinuities between the generated prediction block and neighboring blocks.

[0480] In order to reduce the prediction error, filtering for the prediction block can be used. The filtering can be configured to adaptively apply the filter to the area in the prediction block that is considered to have a large prediction error. For example, the area that is considered to have a large prediction error can be the boundary of the prediction block. In addition, the area in the prediction block that is considered to have a large prediction error can be different according to the intra-frame prediction mode, and the characteristics of the filter can also be different according to the intra-frame prediction mode.

[0481] like Figure 8 As shown, for intra prediction of the target block, at least one of reference lines 0 to 3 may be used.

[0482] Figure 8 Each reference line in may indicate a reference sample point line including one or more reference sample points. When the number of the reference line is smaller, it may indicate that the line of the reference sample points is closer to the target block.

[0483] The samples in the partitions A and F may be obtained by filling with the samples in the partitions B and E that are closest to the target block, rather than being obtained from the reconstructed neighboring blocks.

[0484] Index information indicating a reference sample line to be used for intra prediction of a target block may be transmitted by a signal. The index information may indicate a reference sample line to be used for intra prediction of a target block among a plurality of reference sample lines. For example, the index information may have a value corresponding to any one of 0 to 3.

[0485] When the top boundary of the target block is the boundary of the CTU, only the reference sample line 0 may be available. Therefore, in this case, the index information may not be signaled. When an additional reference sample line other than the reference sample line 0 is used, filtering of the prediction block to be described later may not be performed.

[0486] In case of inter-color intra prediction, a prediction block for a target block of a second color component may be generated based on a corresponding reconstructed block of a first color component.

[0487] For example, the first color component may be a luminance component and the second color component may be a chrominance component.

[0488] To perform inter-color intra prediction, parameters for a linear model between a first color component and a second color component may be derived based on the template.

[0489] The template may include reference samples above the target block (upper reference samples) and / or reference samples on the left side of the target block (left reference samples), and may include upper reference samples and / or left reference samples of the reconstructed block of the first color component corresponding to the reference samples.

[0490] For example, parameters for a linear model may be derived using 1) the value of a sample having a maximum value of a first color component among the samples in a template, 2) the value of a sample of a second color component corresponding to the sample of the first color component, 3) the value of a sample having a minimum value of the first color component among the samples in the template, and 4) the value of a sample of a second color component corresponding to the sample of the first color component.

[0491] When the parameters for the linear model are derived, a prediction block for the target block may be generated by applying the corresponding reconstructed block to the linear model.

[0492] Depending on the image format, subsampling may be performed on samples adjacent to a reconstructed block of a first color component and a corresponding reconstructed block of the first color component. For example, when one sample of a second color component corresponds to four samples of a first color component, one corresponding sample may be calculated by performing subsampling on four samples of the first color component. When subsampling is performed, derivation of parameters for a linear model and inter-color intra prediction may be performed based on the corresponding samples of the subsampling.

[0493] Information on whether to perform inter-color intra prediction and / or the range of a template may be signaled in an intra prediction mode.

[0494] The target block may be partitioned into two or four sub-blocks in a horizontal direction and / or a vertical direction.

[0495] The sub-blocks generated by partitioning may be sequentially reconstructed. That is, when intra prediction is performed on each sub-block, a sub-prediction block for the sub-block may be generated. In addition, when inverse quantization (inverse quantization) and / or inverse transformation is performed on each sub-block, a sub-residual block for the corresponding sub-block may be generated. The reconstructed sub-block may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block may be used as a reference sample for intra prediction of a sub-block having the next priority.

[0496] A subblock may be a block including a certain number (e.g., 16) of samples or more. For example, when the target block is an 8×4 block or a 4×8 block, the target block may be partitioned into two subblocks. In addition, when the target block is a 4×4 block, the target block cannot be partitioned into subblocks. When the target block has another size, the target block may be partitioned into four subblocks.

[0497] Information about whether to perform intra prediction based on such a subblock and / or information about a partition direction (horizontal direction or vertical direction) may be signaled.

[0498] Such subblock-based intra prediction may be restricted such that it is performed only when using reference sample line 0. When subblock-based intra prediction is performed, filtering of a prediction block to be described below may not be performed.

[0499] A final prediction block may be generated by performing filtering on a prediction block generated through intra prediction.

[0500] The filtering may be performed by applying a specific weight to a filtering target sample, a left reference sample, an upper reference sample, and / or an upper left reference sample, wherein the filtering target sample is a target to be filtered.

[0501] The weight and / or reference samples (eg, range of reference samples, position of reference samples, etc.) used for filtering may be determined based on at least one of a block size, an intra prediction mode, and a position of a filtering target sample in a prediction block.

[0502] For example, filtering may be performed only in a specific intra prediction mode (eg, a DC mode, a planar mode, a vertical mode, a horizontal mode, a diagonal mode, and / or an adjacent diagonal mode).

[0503] The adjacent diagonal pattern may be a pattern having a number obtained by adding k to the number of the diagonal pattern, and may be a pattern having a number obtained by subtracting k from the number of the diagonal pattern. In other words, the number of the adjacent diagonal pattern may be the sum of the number of the diagonal pattern and k, or may be the difference between the number of the diagonal pattern and k. For example, k may be a positive integer of 8 or less.

[0504] The intra prediction mode of the target block may be derived using intra prediction modes of neighboring blocks existing near the target block, and the intra prediction mode thus derived may be entropy encoded and / or entropy decoded.

[0505] For example, when the intra prediction mode of the target block is the same as that of the neighboring block, information indicating that the intra prediction mode of the target block is the same as that of the neighboring block may be signaled using specific flag information.

[0506] In addition, for example, indicator information for a neighboring block of an intra prediction mode identical to the intra prediction mode of the target block among intra prediction modes having a plurality of neighboring blocks may be signaled.

[0507] For example, when the intra prediction mode of the target block is different from the intra prediction mode of the neighboring block, information about the intra prediction mode of the target block may be entropy encoded and / or decoded by performing entropy encoding and / or entropy decoding based on the intra prediction mode of the neighboring block.

[0508] Fig. 9 is a diagram for explaining an embodiment of an inter-frame prediction process.

[0509] Fig. 9 The rectangle shown in can represent an image (or picture). Fig. 9 In the example, an arrow may indicate a prediction direction. An arrow pointing from a first picture to a second picture means that the second picture refers to the first picture. That is, each picture may be encoded and / or decoded according to the prediction direction.

[0510] According to the encoding type, images can be classified into intra-frame pictures (I pictures), unidirectional prediction pictures or predictive coding pictures (P pictures), and bidirectional prediction pictures or bidirectional prediction coding pictures (B pictures). Each picture can be encoded and / or decoded according to its encoding type.

[0511] When a target image to be encoded is an I picture, the target image may be encoded using data contained in the image itself without performing inter-frame prediction with reference to other images. For example, an I picture may be encoded only via intra-frame prediction.

[0512] When the target image is a P picture, the target image may be encoded via inter prediction using a reference picture existing in one direction. Here, the one direction may be a forward direction or a backward direction.

[0513] When the target image is a B picture, the image may be encoded via inter-frame prediction using reference pictures existing in two directions, or may be encoded via inter-frame prediction using reference pictures existing in one of a forward direction and a backward direction. Here, the two directions may be a forward direction and a backward direction.

[0514] P pictures and B pictures encoded and / or decoded using reference pictures may be regarded as images using inter-frame prediction.

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

[0516] Inter-frame prediction or motion compensation may be performed using a reference image and motion information.

[0517] In the inter mode, the encoding apparatus 100 may perform inter prediction and / or motion compensation on the target block. The decoding apparatus 200 may perform inter prediction and / or motion compensation corresponding to the inter prediction and / or motion compensation performed by the encoding apparatus 100 on the target block.

[0518] During inter prediction, motion information of a target block may be separately derived by the encoding apparatus 100 and the decoding apparatus 200. The motion information may be derived using motion information of a reconstructed neighboring block, motion information of a col block, and / or motion information of a block adjacent to the col block.

[0519] For example, the encoding apparatus 100 or the decoding apparatus 200 may perform prediction and / or motion compensation by using motion information of the spatial candidate and / or the temporal candidate as motion information of the target block. The target block may mean a PU and / or a PU partition.

[0520] The spatial candidates may be reconstructed blocks that are spatially adjacent to the target block.

[0521] The temporal candidate may be a reconstructed block in a previously reconstructed co-located picture (col picture) corresponding to the target block.

[0522] In inter-frame prediction, the encoding device 100 and the decoding device 200 can improve encoding efficiency and decoding efficiency by using motion information of spatial candidates and / or temporal candidates. The motion information of the spatial candidate may be referred to as "spatial motion information". The motion information of the temporal candidate may be referred to as "temporal motion information".

[0523] Hereinafter, the motion information of the spatial candidate may be the motion information of the PU including the spatial candidate. The motion information of the temporal candidate may be the motion information of the PU including the temporal candidate. The motion information of the candidate block may be the motion information of the PU including the candidate block.

[0524] Inter prediction may be performed using reference pictures.

[0525] The reference picture may be at least one of a picture before the target picture and a picture after the target picture. The reference picture may be an image used for prediction of the target block.

[0526] In inter prediction, a region in a reference picture may be specified by using a reference picture index (or refIdx) indicating a reference picture, a motion vector (to be described later), etc. Here, the region specified in the reference picture may indicate a reference block.

[0527] Inter prediction may select a reference picture, and may also select a reference block corresponding to a target block from the reference picture. In addition, inter prediction may generate a prediction block for a target block using the selected reference block.

[0528] Motion information may be derived by each of the encoding apparatus 100 and the decoding apparatus 200 during inter prediction.

[0529] A spatial candidate may be a block that satisfies the following items: 1) exists in the target picture, 2) has been previously reconstructed via encoding and / or decoding, and 3) is adjacent to the target block or is located at the corner of the target block. Here, a "block located at the corner of the target block" may be a block that is adjacent to the target block in the horizontal direction in the vertical direction, or may be a block that is adjacent to the target block in the vertical direction in the horizontal direction. In addition, a "block located at the corner of the target block" may have the same meaning as a "block adjacent to the corner of the target block". The meaning of a "block located at the corner of the target block" may be included in the meaning of a "block adjacent to the target block".

[0530] For example, the spatial candidate may be a reconstructed block located at the left side of the target block, a reconstructed block located above the target block, a reconstructed block located at the lower left corner of the target block, a reconstructed block located at the upper right corner of the target block, or a reconstructed block located at the upper left corner of the target block.

[0531] Each of the encoding apparatus 100 and the decoding apparatus 200 may identify a block existing at a position spatially corresponding to the target block in the col picture. The position of the target block in the target picture and the position of the identified block in the col picture may correspond to each other.

[0532] Each of the encoding apparatus 100 and the decoding apparatus 200 may determine the col block existing at a predefined relative position with respect to the identified block as a temporal candidate. The predefined relative position may be a position existing inside and / or outside the identified block.

[0533] For example, the col block may include a first col block and a second col block. When the coordinates of the identified block are (xP, yP) and the size of the identified block is represented by (nPSW, nPSH), the first col block may be a block located at the coordinates (xP+nPSW, yP+nPSH). The second col block may be a block located at the coordinates (xP+(nPSW>>1), yP+(nPSH>>1)). When the first col block is not available, the second col block may be selectively used.

[0534] The motion vector of the target block may be determined based on the motion vector of the col block. Each of the encoding device 100 and the decoding device 200 may scale the motion vector of the col block. The scaled motion vector of the col block may be used as the motion vector of the target block. In addition, the motion vector of the motion information for the temporal candidate stored in the list may be a scaled motion vector.

[0535] The ratio of the motion vector of the target block to the motion vector of the col block may be the same as the ratio of the first temporal distance to the second temporal distance. The first temporal distance may be the distance between the reference picture and the target picture of the target block. The second temporal distance may be the distance between the reference picture and the col picture of the col block.

[0536] The scheme for deriving motion information may change according to the inter prediction mode of the target block. For example, as an inter prediction mode applied to inter prediction, there may be an advanced motion vector prediction (AMVP) mode, a merge mode, a skip mode, a merge mode with a motion vector difference, a sub-block merge mode, a triangle partition mode, an inter-intra combined prediction mode, an affine inter mode, a current picture reference mode, etc. The merge mode may also be referred to as a "motion merge mode". Below, each mode is described in detail.

[0537] 1) AMVP model

[0538] When the AMVP mode is used, the encoding device 100 may search for a similar block in a neighboring area of ​​the target block. The encoding device 100 may obtain a prediction block by performing prediction on the target block using motion information of the found similar block. The encoding device 100 may encode a residual block, which is a difference between the target block and the prediction block.

[0539] 1-1) Creation of a list of predicted motion vector candidates

[0540] When the AMVP mode is used as the prediction mode, each of the encoding device 100 and the decoding device 200 may create a prediction motion vector candidate list using a motion vector of a spatial candidate, a motion vector of a temporal candidate, and a zero vector. The prediction motion vector candidate list may include one or more prediction motion vector candidates. At least one of the motion vector of the spatial candidate, the motion vector of the temporal candidate, and the zero vector may be determined and used as a prediction motion vector candidate.

[0541] Hereinafter, the terms "prediction motion vector (candidate)" and "motion vector (candidate)" may be used to have the same meaning and may be used interchangeably with each other.

[0542] Hereinafter, the terms 'prediction motion vector candidate' and 'AMVP candidate' may be used to have the same meaning and may be used interchangeably with each other.

[0543] Hereinafter, the terms “prediction motion vector candidate list” and “AMVP candidate list” may be used to have the same meaning and may be used interchangeably with each other.

[0544] The spatial candidate may include a reconstructed spatial neighboring block. In other words, the motion vector of the reconstructed neighboring block may be referred to as a "spatial prediction motion vector candidate".

[0545] The temporal candidate may include the col block and blocks adjacent to the col block. In other words, the motion vector of the col block or the motion vector of the block adjacent to the col block may be referred to as a "temporal prediction motion vector candidate".

[0546] The zero vector may be the (0,0) motion vector.

[0547] The prediction motion vector candidate may be a motion vector predictor for predicting a motion vector. In addition, in the encoding apparatus 100, each prediction motion vector candidate may be an initial search position for a motion vector.

[0548] 1-2) Searching for a motion vector using a list of predicted motion vector candidates

[0549] The encoding device 100 may determine a motion vector to be used for encoding a target block within a search range using the list of predicted motion vector candidates. In addition, the encoding device 100 may determine a predicted motion vector candidate to be used as a predicted motion vector of a target block among the predicted motion vector candidates present in the predicted motion vector candidate list.

[0550] The motion vector to be used for encoding the target block may be a motion vector that can be encoded at a minimum cost.

[0551] Also, the encoding apparatus 100 may determine whether to encode the target block using the AMVP mode.

[0552] 1-3) Transmission of inter-frame prediction information

[0553] The encoding apparatus 100 may generate a bitstream including inter prediction information required for inter prediction, and the decoding apparatus 200 may perform inter prediction on a target block using the inter prediction information of the bitstream.

[0554] The inter prediction information may include: 1) mode information indicating whether the AMVP mode is used, 2) a prediction motion vector index, 3) a motion vector difference (MVD), 4) a reference direction, and 5) a reference picture index.

[0555] Hereinafter, the terms 'prediction motion vector index' and 'AMVP index' may be used to have the same meaning and may be used interchangeably with each other.

[0556] In addition, the inter prediction information may include a residual signal.

[0557] When the mode information indicates that the AMVP mode is used, the decoding apparatus 200 may acquire a prediction motion vector index, an MVD, a reference direction, and a reference picture index from a bitstream through entropy decoding.

[0558] The prediction motion vector index may indicate a prediction motion vector candidate to be used for prediction of the target block among the prediction motion vector candidates included in the prediction motion vector candidate list.

[0559] 1-4) Inter-frame prediction in AMVP mode using inter-frame prediction information

[0560] The decoding apparatus 200 may induce a prediction motion vector candidate using the prediction motion vector candidate list, and may determine motion information of a target block based on the derived prediction motion vector candidate.

[0561] The decoding device 200 may determine a motion vector candidate for the target block among the prediction motion vector candidates included in the prediction motion vector candidate list using the prediction motion vector index. The decoding device 200 may select the prediction motion vector candidate indicated by the prediction motion vector index from among the prediction motion vector candidates included in the prediction motion vector candidate list as the prediction motion vector of the target block.

[0562] The encoding device 100 may generate an entropy-coded predicted motion vector index by applying entropy coding to the predicted motion vector index, and may generate a bitstream including the entropy-coded predicted motion vector index. The entropy-coded predicted motion vector index may be signaled from the encoding device 100 to the decoding device 200 through the bitstream. The decoding device 200 may extract the entropy-coded predicted motion vector index from the bitstream, and may obtain the predicted motion vector index by applying entropy decoding to the entropy-coded predicted motion vector index.

[0563] The motion vector to be actually used for inter prediction of the target block may not match the predicted motion vector. In order to indicate the difference between the motion vector to be actually used for inter prediction of the target block and the predicted motion vector, MVD may be used. The encoding apparatus 100 may derive a predicted motion vector similar to the motion vector to be actually used for inter prediction of the target block so as to use as small an MVD as possible.

[0564] The motion vector difference (MVD) may be a difference between a motion vector of a target block and a predicted motion vector. The encoding apparatus 100 may calculate the MVD, and may generate an entropy-coded MVD by applying entropy coding to the MVD. The encoding apparatus 100 may generate a bitstream including the entropy-coded MVD.

[0565] The MVD may be transmitted from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. The decoding apparatus 200 may extract the entropy-encoded MVD from the bitstream, and may acquire the MVD by applying entropy decoding to the entropy-encoded MVD.

[0566] The decoding apparatus 200 may derive the motion vector of the target block by summing the MVD and the predicted motion vector. In other words, the motion vector of the target block derived by the decoding apparatus 200 may be the sum of the MVD and the motion vector candidate.

[0567] In addition, the encoding device 100 may generate entropy-encoded MVD resolution information by applying entropy encoding to the calculated MVD resolution information, and may generate a bitstream including the entropy-encoded MVD resolution information. The decoding device 200 may extract the entropy-encoded MVD resolution information from the bitstream, and may obtain the MVD resolution information by applying entropy decoding to the entropy-encoded MVD resolution information. The decoding device 200 may use the MVD resolution information to adjust the resolution of the MVD.

[0568] In addition, the encoding apparatus 100 may calculate the MVD based on the affine model. The decoding apparatus 200 may derive the affine controlled motion vector of the target block through the sum of the MVD and the affine controlled motion vector candidate, and may derive the motion vector of the subblock using the affine controlled motion vector.

[0569] The reference direction may indicate a list of reference pictures to be used for prediction of the target block. For example, the reference direction may indicate one of reference picture list L0 and reference picture list L1.

[0570] The reference direction only indicates a reference picture list to be used for prediction of a target block and may not mean that the direction of the reference picture is limited to the forward direction or the backward direction. In other words, each of the reference picture lists L0 and L1 may include pictures in the forward direction and / or the backward direction.

[0571] The reference direction being unidirectional may mean using a single reference picture list. The reference direction being bidirectional may mean using two reference picture lists. In other words, the reference direction may indicate one of a case where only reference picture list L0 is used, a case where only reference picture list L1 is used, and a case where two reference picture lists are used.

[0572] The reference picture index may indicate a reference picture used to predict the target block among the reference pictures present in the reference picture list. The encoding apparatus 100 may generate an entropy-coded reference picture index by applying entropy coding to the reference picture index, and may generate a bitstream including the entropy-coded reference picture index. The entropy-coded reference picture index may be signaled from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. The decoding apparatus 200 may extract the entropy-coded reference picture index from the bitstream, and may obtain the reference picture index by applying entropy decoding to the entropy-coded reference picture index.

[0573] When two reference picture lists are used to predict a target block, a single reference picture index and a single motion vector may be used for each of the reference picture lists. In addition, when two reference picture lists are used to predict a target block, two prediction blocks may be specified for the target block. For example, an average or weighted sum of the two prediction blocks of the target block may be used to generate the (final) prediction block of the target block.

[0574] The motion vector of the target block may be derived by predicting the motion vector index, MVD, reference direction, and reference picture index.

[0575] The decoding apparatus 200 may generate a prediction block for the target block based on the derived motion vector and the reference picture index. For example, the prediction block may be a reference block indicated by the derived motion vector in the reference picture indicated by the reference picture index.

[0576] Since the predicted motion vector index and the MVD are encoded without encoding the motion vector itself of the target block, the number of bits transmitted from the encoding apparatus 100 to the decoding apparatus 200 may be reduced, and encoding efficiency may be improved.

[0577] For the target block, the motion information of the reconstructed neighboring blocks may be used. In a specific inter-frame prediction mode, the encoding device 100 may not separately encode the actual motion information of the target block. Instead of encoding the motion information of the target block, additional information that can derive the motion information of the target block using the motion information of the reconstructed neighboring blocks may be encoded. Since the additional information is encoded, the number of bits sent to the decoding device 200 may be reduced, and the encoding efficiency may be improved.

[0578] For example, as an inter-prediction mode in which the motion information of the target block is not directly encoded, there may be a skip mode and / or a merge mode. Here, each of the encoding device 100 and the decoding device 200 may use an identifier and / or an index indicating a unit whose motion information among the reconstructed neighboring units is to be used as the motion information of the target unit.

[0579] 2) Merge mode

[0580] As a scheme for deriving motion information of a target block, there is merging. The term "merge" may mean the merging of motions of multiple blocks. "Merge" may mean that the motion information of one block is also applied to other blocks. In other words, the merge mode may be a mode of deriving the motion information of the target block from the motion information of the neighboring blocks.

[0581] When using merge mode, the encoding device 100 may use the motion information of the spatial candidate and / or the motion information of the temporal candidate to predict the motion information of the target block. The spatial candidate may include a reconstructed spatial neighboring block that is spatially adjacent to the target block. The spatial neighboring blocks may include a left neighboring block and an upper neighboring block. The temporal candidate may include a col block. The terms "spatial candidate" and "spatial merge candidate" may be used to have the same meaning and may be used interchangeably with each other. The terms "temporal candidate" and "temporal merge candidate" may be used to have the same meaning and may be used interchangeably with each other.

[0582] The encoding apparatus 100 may obtain a prediction block through prediction. The encoding apparatus 100 may encode a residual block, which is a difference between a target block and a prediction block.

[0583] 2-1) Creation of Merge Candidate List

[0584] When the merge mode is used, each of the encoding device 100 and the decoding device 200 may create a merge candidate list using motion information of a spatial candidate and / or motion information of a temporal candidate. The motion information may include 1) a motion vector, 2) a reference picture index, and 3) a reference direction. The reference direction may be unidirectional or bidirectional. The reference direction may mean an inter-frame prediction indicator.

[0585] The merge candidate list may include a merge candidate. The merge candidate may be motion information. In other words, the merge candidate list may be a list in which a plurality of pieces of motion information are stored.

[0586] The merge candidate may be a plurality of pieces of motion information of a temporal candidate and / or a spatial candidate. In other words, the merge candidate list may include motion information of a temporal candidate and / or a spatial candidate, etc.

[0587] Furthermore, the merge candidate list may include a new merge candidate generated by combining merge candidates already present in the merge candidate list. In other words, the merge candidate list may include new motion information generated by combining a plurality of pieces of motion information previously present in the merge candidate list.

[0588] In addition, the merge candidate list may include a history-based merge candidate. The history-based merge candidate may be motion information of a block encoded and / or decoded before the target block.

[0589] Furthermore, the merge candidate list may include a merge candidate based on an average of two merge candidates.

[0590] The merge candidate may be a specific mode for deriving inter-frame prediction information. The merge candidate may be information indicating a specific mode for deriving inter-frame prediction information. The inter-frame prediction information of the target block may be derived according to the specific mode indicated by the merge candidate. In addition, the specific mode may include a process for deriving a series of inter-frame prediction information. The specific mode may be an inter-frame prediction information derivation mode or a motion information derivation mode.

[0591] Inter prediction information of the target block may be derived according to a mode indicated by a merge candidate selected by a merge index among merge candidates in the merge candidate list.

[0592] For example, the motion information derivation mode in the merge candidate list may be at least one of 1) a motion information derivation mode for a sub-block unit and 2) an affine motion information derivation mode.

[0593] In addition, the merge candidate list may include motion information of a zero vector. A zero vector may also be referred to as a "zero merge candidate".

[0594] In other words, the multiple motion information in the merge candidate list can be at least one of the following items: 1) motion information of spatial candidates, 2) motion information of temporal candidates, 3) motion information generated by combining multiple motion information previously existing in the merge candidate list, and 4) zero vector.

[0595] The motion information may include: 1) a motion vector, 2) a reference picture index, and 3) a reference direction. The reference direction may also be referred to as an "inter prediction indicator". The reference direction may be unidirectional or bidirectional. A unidirectional reference direction may indicate L0 prediction or L1 prediction.

[0596] A merge candidate list may be created before performing prediction in merge mode.

[0597] The number of merge candidates in the merge candidate list may be predefined. Each of the encoding device 100 and the decoding device 200 may add merge candidates to the merge candidate list according to a predefined scheme and a predefined priority so that the merge candidate list has a predefined number of merge candidates. The merge candidate list of the encoding device 100 and the merge candidate list of the decoding device 200 may be made identical to each other using a predefined scheme and a predefined priority.

[0598] Merging may be applied on a CU or PU basis. When merging is performed on a CU or PU basis, the encoding apparatus 100 may transmit a bitstream including predefined information to the decoding apparatus 200. For example, the predefined information may include: 1) information indicating whether merging is performed for each block partition, and 2) information about a block to be merged with, among blocks that are spatial candidates and / or temporal candidates for a target block.

[0599] 2-2) Searching for motion vectors using the merge candidate list

[0600] The encoding device 100 may determine a merge candidate to be used for encoding the target block. For example, the encoding device 100 may perform prediction on the target block using a merge candidate in the merge candidate list, and may generate a residual block for the merge candidate. The encoding device 100 may encode the target block using a merge candidate that causes the minimum cost in encoding the prediction and residual block.

[0601] Also, the encoding apparatus 100 may determine whether to encode the target block using the merge mode.

[0602] 2-3) Transmission of inter-frame prediction information

[0603] The encoding device 100 may generate a bitstream including inter-frame prediction information required for inter-frame prediction. The encoding device 100 may generate entropy-coded inter-frame prediction information by performing entropy encoding on the inter-frame prediction information, and may transmit the bitstream including the entropy-coded inter-frame prediction information to the decoding device 200. Through the bitstream, the entropy-coded inter-frame prediction information may be signaled by the encoding device 100 to the decoding device 200. The decoding device 200 may extract the entropy-coded inter-frame prediction information from the bitstream, and may obtain the inter-frame prediction information by applying entropy decoding to the entropy-coded inter-frame prediction information.

[0604] The decoding apparatus 200 may perform inter prediction on the target block using inter prediction information of the bitstream.

[0605] The inter prediction information may include: 1) mode information indicating whether a merge mode is used, 2) a merge index, and 3) correction information.

[0606] In addition, the inter prediction information may include a residual signal.

[0607] Only when the mode information indicates that the merge mode is used, the decoding apparatus 200 may acquire the merge index from the bitstream.

[0608] The mode information may be a merge flag. The unit of the mode information may be a block. The information about the block may include the mode information, and the mode information may indicate whether the merge mode is applied to the block.

[0609] The merge index may indicate a merge candidate to be used for prediction of the target block among merge candidates included in the merge candidate list. Alternatively, the merge index may indicate a block with which the target block is to be merged among neighboring blocks adjacent to the target block in space or time.

[0610] The encoding apparatus 100 may select a merge candidate having the highest encoding performance among the merge candidates included in the merge candidate list, and set a value of the merge index to indicate the selected merge candidate.

[0611] The correction information may be information for correcting a motion vector. The encoding apparatus 100 may generate the correction information. The decoding apparatus 200 may correct a motion vector of a merge candidate selected by a merge index based on the correction information.

[0612] The correction information may include at least one of information indicating whether correction is to be performed, correction direction information, and correction size information. A prediction mode that corrects a motion vector based on signaled correction information may be referred to as a 'merge mode with motion vector difference'.

[0613] 2-4) Inter-frame prediction using merge mode of inter-frame prediction information

[0614] The decoding apparatus 200 may perform prediction on the target block using a merge candidate indicated by a merge index among merge candidates included in the merge candidate list.

[0615] The motion vector of the target block may be specified by the motion vector of the merge candidate indicated by the merge index, the reference picture index, and the reference direction.

[0616] 3) Skip mode

[0617] The skip mode may be a mode in which the motion information of the spatial candidate or the motion information of the temporal candidate is applied to the target block without change. In addition, the skip mode may be a mode in which the residual signal is not used. In other words, when the skip mode is used, the reconstructed block may be the same as the predicted block.

[0618] The difference between the merge mode and the skip mode is whether the residual signal is transmitted or used. That is, the skip mode may be similar to the merge mode except that the residual signal is not transmitted or used.

[0619] When the skip mode is used, the encoding device 100 may transmit information about a block whose motion information is to be used as the motion information of the target block among blocks that are spatial candidates or temporal candidates to the decoding device 200 through a bitstream. The encoding device 100 may generate entropy-coded information by performing entropy encoding on the information, and may signal the entropy-coded information to the decoding device 200 through a bitstream. The decoding device 200 may extract the entropy-coded information from the bitstream, and may obtain the information by applying entropy decoding to the entropy-coded information.

[0620] In addition, when the skip mode is used, the encoding device 100 may not transmit other syntax information, such as MVD, to the decoding device 200. For example, when the skip mode is used, the encoding device 100 may not signal a syntax element related to at least one of the MVD, the coded block flag, and the transform coefficient level to the decoding device 200.

[0621] 3-1) Creation of Merge Candidate List

[0622] The skip mode may also use a merge candidate list. In other words, the merge candidate list may be used in both the merge mode and the skip mode. In this regard, the merge candidate list may also be referred to as a "skip candidate list" or a "merge / skip candidate list".

[0623] Optionally, the skip mode may use an additional candidate list different from the merge candidate list of the merge mode. In this case, in the following description, the merge candidate list and the merge candidate may be replaced with the skip candidate list and the skip candidate, respectively.

[0624] The merge candidate list may be created before performing prediction in skip mode.

[0625] 3-2) Searching for motion vectors using the merge candidate list

[0626] The encoding device 100 may determine a merge candidate to be used for encoding the target block. For example, the encoding device 100 may perform prediction on the target block using a merge candidate in the merge candidate list. The encoding device 100 may encode the target block using a merge candidate that causes the minimum cost in prediction.

[0627] Also, the encoding apparatus 100 may determine whether to encode the target block using the skip mode.

[0628] 3-3) Transmission of inter-frame prediction information

[0629] The encoding apparatus 100 may generate a bitstream including inter prediction information required for inter prediction, and the decoding apparatus 200 may perform inter prediction on a target block using the inter prediction information in the bitstream.

[0630] The inter prediction information may include: 1) mode information indicating whether a skip mode is used, and 2) a skip index.

[0631] The skip index can be the same as the merge index described above.

[0632] When the skip mode is used, the target block may be encoded without using the residual signal. The inter prediction information may not include the residual signal. Alternatively, the bitstream may not include the residual signal.

[0633] Only when the mode information indicates that the skip mode is used, the decoding device 200 can obtain the skip index from the bitstream. As described above, the merge index and the skip index may be the same as each other. Only when the mode information indicates that the merge mode or the skip mode is used, the decoding device 200 can obtain the skip index from the bitstream.

[0634] The skip index may indicate a merge candidate to be used for prediction of the target block among the merge candidates included in the merge candidate list.

[0635] 3-4) Inter-frame prediction in skip mode using inter-frame prediction information

[0636] The decoding apparatus 200 may perform prediction on the target block using a merge candidate indicated by a skip index among merge candidates included in the merge candidate list.

[0637] The motion vector of the target block may be specified by the motion vector of the merge candidate indicated by the skip index, the reference picture index, and the reference direction.

[0638] 4) Current picture reference mode

[0639] The current picture reference mode may indicate a prediction mode using a previously reconstructed region in a target picture to which the target block belongs.

[0640] A motion vector for specifying a previously reconstructed region may be used.A reference picture index of a target block may be used to determine whether the target block has been encoded in a current picture reference mode.

[0641] A flag or index indicating whether the target block is a block encoded in the current picture reference mode may be signaled by the encoding apparatus 100 to the decoding apparatus 200. Alternatively, whether the target block is a block encoded in the current picture reference mode may be inferred by a reference picture index of the target block.

[0642] When the target block is encoded in the current picture reference mode, the target picture may exist at a fixed position or an arbitrary position in the reference picture list for the target block.

[0643] For example, the fixed position may be a position where the value of the reference picture index is 0 or a last position.

[0644] When a target picture exists at an arbitrary position in the reference picture list, an additional reference picture index indicating such an arbitrary position may be signaled by the encoding apparatus 100 to the decoding apparatus 200 .

[0645] 5) Sub-block merging mode

[0646] The sub-block merge mode may be a mode in which motion information is derived from sub-blocks of a CU.

[0647] When the subblock merge mode is applied, a subblock merge candidate list may be generated using motion information of a co-located subblock (col subblock) of a target subblock in a reference image (ie, subblock-based temporal merge candidates) and / or affine control point motion vector merge candidates.

[0648] 6) Triangle partition mode

[0649] In the triangular partition mode, the target block may be partitioned in the diagonal direction, and sub-target blocks generated by the partitioning may be generated. For each sub-target block, motion information of the corresponding sub-target block may be derived, and the derived motion information may be used to derive prediction samples for each sub-target block. The prediction samples of the target block may be derived by a weighted sum of the prediction samples of the sub-target blocks generated by the partitioning.

[0650] 7) Combined inter-intra prediction mode

[0651] The combined inter-intra prediction mode may be a mode in which a prediction sample of a target block is derived using a weighted sum of a prediction sample generated via inter prediction and a prediction sample generated via intra prediction.

[0652] In the above-mentioned mode, the decoding device 200 may autonomously correct the derived motion information. For example, the decoding device 200 may search for motion information having a minimum sum of absolute differences (SAD) in a specific area based on a reference block indicated by the derived motion information, and may derive the found motion information as the corrected motion information.

[0653] In the above mode, the decoding apparatus 200 may use the optical flow to compensate for the prediction samples derived through the inter-frame prediction.

[0654] In the above-mentioned AMVP mode, merge mode, skip mode, etc., motion information to be used for prediction of a target block may be specified among a plurality of pieces of motion information in the list using index information of the list.

[0655] In order to improve encoding efficiency, the encoding apparatus 100 may signal only the index of the element that causes the minimum cost in inter prediction of the target block among the elements in the list. The encoding apparatus 100 may encode the index and may signal the encoded index.

[0656] Therefore, the above lists (i.e., the prediction motion vector candidate list and the merge candidate list) should be able to be derived by the encoding device 100 and the decoding device 200 using the same scheme based on the same data. Here, the same data may include a reconstructed picture and a reconstructed block. In addition, in order to specify an element using an index, the order of the elements in the list should be fixed.

[0657] Fig.10 Spatial candidates according to an embodiment are shown.

[0658] exist Fig.10 , the positions of the spatial candidates are shown.

[0659] The large block in the center of the figure may represent the target block, and the five small blocks may represent spatial candidates.

[0660] The coordinates of the target block may be (xP, yP), and the size of the target block may be represented by (nPSW, nPSH).

[0661] The spatial candidate A0 may be a block adjacent to the lower left corner of the target block. A0 may be a block occupying pixels located at coordinates (xP-1, yP+nPSH).

[0662] Spatial candidate A1 may be a block adjacent to the left side of the target block. A1 may be the bottommost block among the blocks adjacent to the left side of the target block. Alternatively, A1 may be a block adjacent to the top of A0. A1 may be a block occupying pixels located at coordinates (xP-1, yP+nPSH-1).

[0663] The spatial candidate B0 may be a block adjacent to the upper right corner of the target block. B0 may be a block occupying pixels located at coordinates (xP+nPSW, yP-1).

[0664] Spatial candidate B1 may be a block adjacent to the top of the target block. B1 may be the rightmost block among the blocks adjacent to the top of the target block. Alternatively, B1 may be a block adjacent to the left of B0. B1 may be a block occupying pixels located at coordinates (xP+nPSW-1, yP-1).

[0665] The spatial candidate B2 may be a block adjacent to the upper left corner of the target block. B2 may be a block occupying pixels located at coordinates (xP-1, yP-1).

[0666] Determination of availability of spatial and temporal candidates

[0667] In order to include the motion information of the spatial candidate or the motion information of the temporal candidate in the list, it should be determined whether the motion information of the spatial candidate or the motion information of the temporal candidate is available.

[0668] Hereinafter, the candidate blocks may include spatial candidates and temporal candidates.

[0669] For example, the determination may be performed by sequentially applying the following steps 1) to 4) below.

[0670] Step 1) When the PU including the candidate block is outside the boundary of the picture, the availability of the candidate block may be set to “false.” The expression “availability is set to false” may have the same meaning as “set to unavailable.”

[0671] Step 2) When the PU including the candidate block is outside the boundary of the slice, the availability of the candidate block may be set to “false.” When the target block and the candidate block are located in different slices, the availability of the candidate block may be set to “false.”

[0672] Step 3) When the PU including the candidate block is outside the boundary of the tile, the availability of the candidate block may be set to “false”. When the target block and the candidate block are located in different tiles, the availability of the candidate block may be set to “false”.

[0673] Step 4) When the prediction mode of the PU including the candidate block is an intra prediction mode, the availability of the candidate block may be set to “false.” When the PU including the candidate block does not use inter prediction, the availability of the candidate block may be set to “false.”

[0674] Fig.11 2 shows the order in which the motion information of the spatial candidates is added to the merge list according to an embodiment. Fig.11 As shown in , when multiple motion information of spatial candidates are added to the merge list, the order of A1, B1, B0, A0 and B2 can be used. That is, multiple motion information of available spatial candidates can be added to the merge list in the order of A1, B1, B0, A0 and B2.

[0675] Methods for deriving merge lists in merge mode and skip mode

[0676] As described above, the maximum number of merge candidates in the merge list may be set. The set maximum number is indicated by "N". The set number may be sent from the encoding device 100 to the decoding device 200. The slice header of the slice may include N. In other words, the maximum number of merge candidates in the merge list for the target block of the slice may be set by the slice header. For example, the value of N may be substantially 5.

[0677] A plurality of pieces of motion information (ie, merge candidates) may be added to the merge list in the order of the following steps 1) to 4).

[0678] Step 1) In the space candidate, available space candidates can be added to the merge list. Fig.11 The plurality of pieces of motion information of the available space candidate are added to the merge list in the order shown. Here, when the motion information of the available space candidate overlaps with other motion information already in the merge list, the motion information may not be added to the merge list. The operation of checking whether the corresponding motion information overlaps with other motion information in the list may be referred to as "overlap check" for short.

[0679] The maximum number of added motion information pieces may be N.

[0680] Step 2) When the number of motion information in the merge list is less than N and the temporal candidate is available, the motion information of the temporal candidate may be added to the merge list. Here, when the motion information of the available temporal candidate overlaps with other motion information already in the merge list, the motion information may not be added to the merge list.

[0681] Step 3) When the number of pieces of motion information in the merge list is less than N and the type of the target slice is 'B', combined motion information generated by combined bidirectional prediction (bi-prediction) may be added to the merge list.

[0682] The target slice may be a slice including the target block.

[0683] The combined motion information may be a combination of L0 motion information and L1 motion information. The L0 motion information may be motion information that refers only to the reference picture list L0. The L1 motion information may be motion information that refers only to the reference picture list L1.

[0684] In the merge list, there may be one or more pieces of L0 motion information. In addition, in the merge list, there may be one or more pieces of L1 motion information.

[0685] The combined motion information may include one or more pieces of combined motion information. When generating the combined motion information, the L0 motion information and the L1 motion information to be used for the generation may be predefined in one or more pieces of L0 motion information and one or more pieces of L1 motion information. The one or more pieces of combined motion information may be generated in a predefined order via a combined bidirectional prediction using a pair of different motion information in a merge list. One of the pair of different motion information may be L0 motion information, and the other of the pair may be L1 motion information.

[0686] For example, the combined motion information added with the highest priority may be a combination of L0 motion information having a merge index 0 and L1 motion information having a merge index 1. When the motion information having a merge index 0 is not L0 motion information or when the motion information having a merge index 1 is not L1 motion information, the combined motion information may be neither generated nor added. Next, the combined motion information added with the next priority may be a combination of L0 motion information having a merge index 1 and L1 motion information having a merge index 0. The subsequent detailed combination may conform to other combinations in the field of video encoding / decoding.

[0687] Here, when the combined motion information overlaps with other motion information already present in the merge list, the combined motion information may not be added to the merge list.

[0688] Step 4) When the number of pieces of motion information in the merge list is less than N, the motion information of the zero vector may be added to the merge list.

[0689] The zero-vector motion information may be motion information in which the motion vector is a zero vector.

[0690] The number of pieces of zero vector motion information may be one or more. The reference picture indexes of one or more pieces of zero vector motion information may be different from each other. For example, the value of the reference picture index of the first zero vector motion information may be 0. The value of the reference picture index of the second zero vector motion information may be 1.

[0691] The number of pieces of zero-vector motion information may be the same as the number of reference pictures in the reference picture list.

[0692] The reference direction of the zero-vector motion information may be bidirectional. Both of the motion vectors may be zero vectors. The number of pieces of zero-vector motion information may be the smaller of the number of reference pictures in the reference picture list L0 and the number of reference pictures in the reference picture list L1. Optionally, when the number of reference pictures in the reference picture list L0 and the number of reference pictures in the reference picture list L1 are different from each other, the reference direction as a unidirectional direction may be used for a reference picture index that may be applied only to a single reference picture list.

[0693] The encoding apparatus 100 and / or the decoding apparatus 200 may sequentially add zero vector motion information to the merge list while changing the reference picture index.

[0694] When the zero-vector motion information overlaps with other motion information already present in the merge list, the zero-vector motion information may not be added to the merge list.

[0695] The order of the above steps 1) to 4) is merely exemplary and may be changed. In addition, some of the above steps may be omitted according to predefined conditions.

[0696] Method for deriving a candidate list of prediction motion vectors in AMVP mode

[0697] The maximum number of prediction motion vector candidates in the prediction motion vector candidate list may be predefined. The predefined maximum number is indicated by N. For example, the predefined maximum number may be 2.

[0698] A plurality of pieces of motion information (ie, prediction motion vector candidates) may be added to the prediction motion vector candidate list in the order of the following steps 1) to 3).

[0699] Step 1) An available spatial candidate among the spatial candidates may be added to the prediction motion vector candidate list. The spatial candidate may include a first spatial candidate and a second spatial candidate.

[0700] The first spatial candidate may be one of A0, A1, scaled A0, and scaled A1. The second spatial candidate may be one of B0, B1, B2, scaled B0, scaled B1, and scaled B2.

[0701] Multiple pieces of motion information of available spatial candidates may be added to the prediction motion vector candidate list in the order of the first spatial candidate and the second spatial candidate. In this case, when the motion information of the available spatial candidate overlaps with other motion information already in the prediction motion vector candidate list, the motion information may not be added to the prediction motion vector candidate list. In other words, when the value of N is 2, if the motion information of the second spatial candidate is the same as the motion information of the first spatial candidate, the motion information of the second spatial candidate may not be added to the prediction motion vector candidate list.

[0702] The maximum number of pieces of motion information added may be N.

[0703] Step 2) When the number of pieces of motion information in the prediction motion vector candidate list is less than N and the temporal candidate is available, the motion information of the temporal candidate may be added to the prediction motion vector candidate list. In this case, when the motion information of the available temporal candidate overlaps with other motion information already in the prediction motion vector candidate list, the motion information may not be added to the prediction motion vector candidate list.

[0704] Step 3) When the number of pieces of motion information in the prediction motion vector candidate list is less than N, zero vector motion information may be added to the prediction motion vector candidate list.

[0705] The zero-vector motion information may include one or more pieces of zero-vector motion information. The reference picture indexes of the one or more pieces of zero-vector motion information may be different from each other.

[0706] The encoding apparatus 100 and / or the decoding apparatus 200 may sequentially add a plurality of pieces of zero vector motion information to the prediction motion vector candidate list while changing the reference picture index.

[0707] When the zero-vector motion information overlaps with other motion information already present in the prediction motion vector candidate list, the zero-vector motion information may not be added to the prediction motion vector candidate list.

[0708] The above description of zero vector motion information made in conjunction with the merge list can also be applied to zero vector motion information. The repeated description thereof will be omitted.

[0709] The order of the above steps 1) to 3) is merely exemplary and may be changed. In addition, some of the steps may be omitted according to predefined conditions.

[0710] Fig.12 Transformation and quantization processes according to examples are shown.

[0711] like Fig.12 As shown, the quantization level may be generated by performing a transform and / or quantization process on the residual signal.

[0712] The residual signal may be generated as a difference between the original block and the predicted block. Here, the predicted block may be a block generated via intra prediction or inter prediction.

[0713] The residual signal may be transformed into a signal in the frequency domain through a transform process as part of the quantization process.

[0714] The transform kernel used for the transform may include various DCT kernels such as a discrete cosine transform (DCT) type 2 (DCT-II) and a discrete sine transform (DST) kernel.

[0715] These transform kernels may perform separable transform or two-dimensional (2D) non-separable transform on the residual signal. The separable transform may be a transform indicating that a one-dimensional (1D) transform is performed on the residual signal in each of horizontal and vertical directions.

[0716] The DCT type and DST type adaptively used for 1D transform may include DCT-V, DCT-VIII, DST-I, and DST-VII in addition to DCT-II, as shown in each of the following Tables 3 and 4.

[0717] [Table 3]

[0718] Transformation Sets Transformation Candidates 0 DST-VII, DCT-VIII 1 DST-VII, DST-I 2 DST-VII, DCT-V

[0719] [Table 4]

[0720] Transformation Sets Transformation Candidates 0 DST-VII, DCT-VIII, DST-I 1 DST-VII, DST-I, DCT-VIII 2 DST-VII, DCT-V, DST-I

[0721] As shown in Tables 3 and 4, when deriving a DCT type or a DST type to be used for transformation, a transform set may be used. Each transform set may include a plurality of transform candidates. Each transform candidate may be a DCT type or a DST type.

[0722] Table 5 below shows an example of a transform set to be applied to a horizontal direction and a transform set to be applied to a vertical direction according to an intra prediction mode.

[0723] [Table 5]

[0724] Intra prediction mode 0 1 2 3 4 5 6 7 8 9 Vertical Transformation Set 2 1 0 1 0 1 0 1 0 1 Horizontal Transform Set 2 1 0 1 0 1 0 1 0 1 Intra prediction mode 10 11 12 13 14 15 16 17 18 19 Vertical Transformation Set 0 1 0 1 0 0 0 0 0 0 Horizontal Transform Set 0 1 0 1 2 2 2 2 2 2 Intra prediction mode 20 21 22 23 24 25 26 27 28 29 Vertical Transformation Set 0 0 0 1 0 1 0 1 0 1 Horizontal Transform Set 2 2 2 1 0 1 0 1 0 1 Intra prediction mode 30 31 32 33 34 35 36 37 38 39 Vertical Transformation Set 0 1 0 1 0 1 0 1 0 1 Horizontal Transform Set 0 1 0 1 0 1 0 1 0 1 Intra prediction mode 40 41 42 43 44 45 46 47 48 49 Vertical Transformation Set 0 1 0 1 0 1 2 2 2 2 Horizontal Transform Set 0 1 0 1 0 1 0 0 0 0 Intra prediction mode 50 51 52 53 54 55 56 57 58 59 Vertical Transformation Set 2 2 2 2 2 1 0 1 0 1 Horizontal Transform Set 0 0 0 0 0 1 0 1 0 1 Intra prediction mode 60 61 62 63 64 65 66 Vertical Transformation Set 0 1 0 1 0 1 0 Horizontal Transform Set 0 1 0 1 0 1 0

[0725] In Table 5, the numbers of vertical transform sets and horizontal transform sets in the horizontal direction to be applied to the residual signal according to the intra prediction mode of the target block are indicated.

[0726] As illustrated in Table 5, the transform set to be applied to the horizontal direction and the vertical direction may be predefined according to the intra prediction mode of the target block. The encoding device 100 may perform transform and inverse transform on the residual signal using the transform included in the transform set corresponding to the intra prediction mode of the target block. In addition, the decoding device 200 may perform inverse transform on the residual signal using the transform included in the transform set corresponding to the intra prediction mode of the target block.

[0727] In the transform and inverse transform, a transform set to be applied to the residual signal may be determined as illustrated in Tables 3, 4, and 5, and the transform set to be applied to the residual signal may not be signaled. The transform indication information may be signaled from the encoding apparatus 100 to the decoding apparatus 200. The transform indication information may be information indicating which one of a plurality of transform candidates included in the transform set to be applied to the residual signal is used.

[0728] For example, when the size of the target block is 64×64 or smaller, a transform set each having three transforms may be constructed according to the intra prediction mode. An optimal transform method may be selected from a total of nine multi-transform methods generated by a combination of three transforms in the horizontal direction and three transforms in the vertical direction. Through such an optimal transform method, a residual signal may be encoded and / or decoded, and thus encoding efficiency may be improved.

[0729] Here, information indicating which of the transforms belonging to each transform set has been used for at least one of the vertical transform and the horizontal transform may be entropy encoded and / or decoded. Here, truncated unary binarization may be used to encode and / or decode such information.

[0730] As described above, methods using various transforms may be applied to a residual signal generated via intra prediction or inter prediction.

[0731] The transform may include at least one of a primary transform and a secondary transform. A transform coefficient may be generated by performing a primary transform on the residual signal, and a secondary transform coefficient may be generated by performing a secondary transform on the transform coefficient.

[0732] The first transform may be referred to as a “primary transform.” Furthermore, the first transform may also be referred to as an “adaptive multi-transform (AMT) scheme.” AMT may mean applying different transforms to each 1D direction (ie, vertical and horizontal directions) as described above.

[0733] The secondary transform may be a transform for improving the energy concentration on the transform coefficients generated by the primary transform. Similar to the primary transform, the secondary transform may be a separable transform or a non-separable transform. Such a non-separable transform may be a non-separable secondary transform (NSST).

[0734] The first transformation may be performed using at least one of a plurality of predefined transformation methods, for example, the plurality of predefined transformation methods may include discrete cosine transform (DCT), discrete sine transform (DST), Karhunen-Loeve transform (KLT), etc.

[0735] Furthermore, the first transform may be a transform having various transform types according to a kernel function defining a discrete cosine transform (DCT) or a discrete sine transform (DST).

[0736] For example, the transform type may be determined based on at least one of the following items: 1) a prediction mode of the target block (e.g., one of intra-frame prediction and inter-frame prediction), 2) a size of the target block, 3) a shape of the target block, 4) an intra-frame prediction mode of the target block, 5) a component of the target block (e.g., one of a luminance component and a chrominance component), and 6) a partition type applied to the target block (e.g., one of a quadtree, a binary tree, and a ternary tree).

[0737] For example, according to the transform kernel presented in Table 6 below, the first transform may include transforms such as DCT-2, DCT-5, DCT-7, DST-7, DST-1, DST-8, and DCT-8. In Table 6 below, various transform types and transform kernel functions for multiple transform selection (MTS) are illustrated.

[0738] MTS may refer to the selection of a combination of one or more DCT and / or DST kernels to transform the residual signal in the horizontal and / or vertical direction.

[0739] [Table 6]

[0740]

[0741] In Table 6, i and j may be integer values ​​equal to or greater than 0 and less than or equal to N-1.

[0742] A secondary transform may be performed on transform coefficients generated by performing the primary transform.

[0743] As in the first transform, the transform set may also be defined in the secondary transform. The method for deriving and / or determining the above transform set may be applied not only to the first transform but also to the secondary transform.

[0744] The primary transformation and the secondary transformation can be determined for a specific goal.

[0745] For example, the primary transform and the secondary transform may be applied to a signal component corresponding to one or more of a luminance (luma) component and a chrominance (chroma) component. Whether to apply the primary transform and / or the secondary transform may be determined based on at least one of the encoding parameters for the target block and / or the neighboring block. For example, whether to apply the primary transform and / or the secondary transform may be determined based on the size and / or shape of the target block.

[0746] In the encoding apparatus 100 and the decoding apparatus 200 , transform information indicating a transform method to be used for a target may be derived by using the designation information.

[0747] For example, the transform information may include a transform index to be used for the primary transform and / or the secondary transform. Alternatively, the transform information may indicate that the primary transform and / or the secondary transform is not to be used.

[0748] For example, when the target of the primary transform and the secondary transform is a target block, the (one or more) transform methods to be applied to the primary transform and / or the secondary transform indicated by the transform information may be determined based on at least one of the encoding parameters of the target block and / or a block adjacent to the target block.

[0749] Alternatively, transform information indicating a transform method for a specific target may be transmitted from the encoding apparatus 100 to the decoding apparatus 200 .

[0750] For example, for a single CU, whether to use a primary transform, an index indicating the primary transform, whether to use a secondary transform, and an index indicating the secondary transform may be derived as transform information by the decoding device 200. Alternatively, for a single CU, transform information indicating whether to use a primary transform, an index indicating the primary transform, whether to use a secondary transform, and an index indicating the secondary transform may be transmitted by a signal.

[0751] The quantized transform coefficient (ie, the quantization level) may be generated by performing quantization on a result generated by performing the primary transform and / or the secondary transform, or by performing quantization on a residual signal.

[0752] Fig.13 A diagonal scan according to an example is shown.

[0753] Fig.14 A horizontal scan according to an example is shown.

[0754] Fig.15 A vertical scan according to an example is shown.

[0755] The quantized transform coefficient may be scanned via at least one of (upper right) diagonal scanning, vertical scanning, and horizontal scanning according to at least one of an intra prediction mode, a block size, and a block shape. The block may be a transform unit (TU).

[0756] Each scan may be initiated at a specific starting point and may be terminated at a specific ending point.

[0757] For example, by using Fig.13 The coefficients of the block are scanned by diagonal scanning, and the quantized transform coefficients can be changed into a 1D vector form. Optionally, the quantized transform coefficients can be used according to the size of the block and / or the intra prediction mode. Fig.14 Horizontal scan or Fig.15 The image is scanned vertically instead of diagonally.

[0758] Vertical scanning may be an operation of scanning 2D block coefficients in a column direction. Horizontal scanning may be an operation of scanning 2D block coefficients in a row direction.

[0759] In other words, which of diagonal scanning, vertical scanning, and horizontal scanning to use may be determined according to the size of a block and / or an inter prediction mode.

[0760] like Fig.13 , Fig.14 and Fig.15 As shown, the quantized transform coefficients may be scanned along a diagonal direction, a horizontal direction, or a vertical direction.

[0761] The quantized transform coefficients may be represented by a block shape. Each block may include a plurality of sub-blocks. Each sub-block may be defined according to a minimum block size or a minimum block shape.

[0762] In scanning, a scanning order according to a type or direction of scanning may be mainly applied to a subblock. In addition, a scanning sequence according to a direction of scanning may be applied to a quantized transform coefficient in each subblock.

[0763] For example, Fig.13 , Fig.14 and Fig.15 As shown, when the size of the target block is 8×8, the quantized transform coefficients can be generated by first transforming, second transforming and quantizing the residual signal of the target block. Therefore, one of the three types of scanning sequences can be applied to the four 4×4 sub-blocks, and the quantized transform coefficients can also be scanned for each 4×4 sub-block according to the scanning sequence.

[0764] The encoding apparatus 100 may generate entropy-coded quantized transform coefficients by performing entropy encoding on the scanned quantized transform coefficients, and may generate a bitstream including the entropy-coded quantized transform coefficients.

[0765] The decoding apparatus 200 may extract entropy-encoded quantized transform coefficients from a bitstream, and may generate quantized transform coefficients by performing entropy decoding on the entropy-encoded quantized transform coefficients. The quantized transform coefficients may be aligned in the form of 2D blocks via inverse scanning. Here, as a method of inverse scanning, at least one of upper right diagonal scanning, vertical scanning, and horizontal scanning may be performed.

[0766] In the decoding apparatus 200, inverse quantization may be performed on the quantized transform coefficient. A secondary inverse transform may be performed on a result generated by performing the inverse quantization according to whether the secondary inverse transform is performed. In addition, a primary inverse transform may be performed on a result generated by performing the secondary inverse transform according to whether the primary inverse transform is to be performed. A reconstructed residual signal may be generated by performing the primary inverse transform on a result generated by performing the secondary inverse transform.

[0767] For luma components reconstructed via intra prediction or inter prediction, inverse mapping with dynamic range may be performed prior to in-loop filtering.

[0768] The dynamic range may be divided into 16 equal segments and the mapping function for each segment may be signaled.Such a mapping function may be signaled at slice level or tile group level.

[0769] An inverse mapping function for performing inverse mapping may be derived based on the mapping function.

[0770] In-loop filtering, storage of reference pictures, and motion compensation may be performed in the inverse mapping area.

[0771] The prediction block generated via inter prediction can be changed to a mapping region by mapping using a mapping function, and the changed prediction block can be used to generate a reconstructed block. However, since intra prediction is performed in the mapping region, the prediction block generated via intra prediction can be used to generate a reconstructed block without mapping and / or inverse mapping.

[0772] For example, when the target block is a residual block of a chroma component, the residual block may be changed into an inverse mapping area by scaling the chroma component of the mapping area.

[0773] Whether scaling is available can be signaled at the slice level or tile group level.

[0774] For example, scaling may be applied only if a mapping is available for luma components and the partitions of the luma components and the partitions of the chroma components follow the same tree structure.

[0775] Scaling may be performed based on an average value of the values ​​of samples in a luma prediction block corresponding to a chroma prediction block. Here, when a target block uses inter prediction, the luma prediction block may mean a mapped luma prediction block.

[0776] The value required for scaling may be derived by referring to the lookup table using the index of the segment to which the average value of the sample values ​​of the luma prediction block belongs.

[0777] The residual block may be changed to the inverse mapping region by scaling the residual block using the finally derived value. Thereafter, for the block of the chroma component, reconstruction, intra prediction, inter prediction, in-loop filtering, and storage of reference pictures may be performed in the inverse mapping region.

[0778] For example, information indicating whether mapping and / or inverse mapping of luma components and chroma components is available may be signaled through a sequence parameter set.

[0779] A prediction block for a target block may be generated based on a block vector. The block vector may indicate a displacement between the target block and a reference block. The reference block may be a block in a target image.

[0780] In this manner, a prediction mode that generates a prediction block by referring to a target image may be referred to as an 'intra block copy (IBC) mode'.

[0781] The IBC mode may be applied to a CU having a specific size. For example, the IBC mode may be applied to an M×NCU. Here, M and N may be less than or equal to 64.

[0782] The IBC mode may include a skip mode, a merge mode, an AMVP mode, etc. In the case of the skip mode or the merge mode, a merge candidate list may be constructed, and a merge index may be signaled, and thus a single merge candidate may be specified among the merge candidates present in the merge candidate list. The block vector of the specified merge candidate may be used as the block vector of the target block.

[0783] In the case of AMVP mode, a differential block vector may be transmitted by signal. In addition, a prediction block vector may be derived from the left neighboring block and the upper neighboring block of the target block. In addition, an index indicating which neighboring block will be used may be transmitted by signal.

[0784] The prediction block in the IBC mode may be included in the target CTU or the left CTU and may be limited to blocks within the previously reconstructed area. For example, the value of the block vector may be limited so that the prediction block of the target block is located in a specific area. The specific area may be an area defined by three 64×64 blocks encoded and / or decoded before the 64×64 block including the target block. The value of the block vector is limited in this way, and thus the memory consumption and device complexity caused by the implementation of the IBC mode may be reduced.

[0785] Fig.16 is a diagram showing a configuration of an encoding device according to an embodiment.

[0786] The encoding device 1600 may correspond to the above-described encoding device 100 .

[0787] The encoding apparatus 1600 may include a processing unit 1610, a memory 1630, a user interface (UI) input device 1650, a UI output device 1660, and a storage device 1640, which communicate with each other through a bus 1690. The encoding apparatus 1600 may further include a communication unit 1620 coupled to a network 1699.

[0788] The processing unit 1610 may be a central processing unit (CPU) or a semiconductor device for executing processing instructions stored in the memory 1630 or the storage device 1640. The processing unit 1610 may be at least one hardware processor.

[0789] The processing unit 1610 may generate and process a signal, data, or information input to, output from, or used in the encoding device 1600, and may perform checks, comparisons, determinations, etc. related to the signal, data, or information. In other words, in an embodiment, generation and processing of data or information and checks, comparisons, and determinations related to data or information may be performed by the processing unit 1610.

[0790] The processing unit 1610 may include an inter-frame prediction unit 110, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.

[0791] At least some of the inter prediction unit 110, the intra prediction unit 120, the switch 115, the subtractor 125, the transform unit 130, the quantization unit 140, the entropy encoding unit 150, the inverse quantization unit 160, the inverse transform unit 170, the adder 175, the filter unit 180, and the reference picture buffer 190 may be program modules and may communicate with an external device or system. The program module may be included in the encoding apparatus 1600 in the form of an operating system, an application program module, or other program modules.

[0792] The program modules may be physically stored in various types of known storage devices. In addition, at least some of the program modules may also be stored in a remote storage device capable of communicating with the encoding device 1600.

[0793] The program modules may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures for performing functions or operations according to the embodiments or for implementing abstract data types according to the embodiments.

[0794] The program module may be implemented using instructions or codes executed by at least one processor of the encoding device 1600 .

[0795] The processing unit 1610 can execute instructions or codes in the inter-frame prediction unit 110, the intra-frame prediction unit 120, the switch 115, the subtractor 125, the transform unit 130, the quantization unit 140, the entropy encoding unit 150, the inverse quantization unit 160, the inverse transform unit 170, the adder 175, the filter unit 180 and the reference picture buffer 190.

[0796] The storage unit may represent the memory 1630 and / or the storage device 1640. Each of the memory 1630 and the storage device 1640 may be any of various types of volatile or non-volatile storage media. For example, the memory 1630 may include at least one of a read-only memory (ROM) 1631 and a random access memory (RAM) 1632.

[0797] The storage unit may store data or information used for the operation of the encoding apparatus 1600. In an embodiment, data or information of the encoding apparatus 1600 may be stored in the storage unit.

[0798] For example, the storage unit may store pictures, blocks, lists, motion information, inter-frame prediction information, bitstreams, and the like.

[0799] The encoding device 1600 may be implemented in a computer system including a computer-readable storage medium.

[0800] The storage medium may store at least one module required for the operation of the encoding apparatus 1600. The memory 1630 may store at least one module, and may be configured such that the at least one module is executed by the processing unit 1610.

[0801] Functions related to communication of data or information of the encoding device 1600 may be performed through the communication unit 1620 .

[0802] For example, the communication unit 1620 may transmit a bit stream to the decoding apparatus 1600 which will be described later.

[0803] Fig.17 is a diagram showing a configuration of a decoding device according to an embodiment.

[0804] The decoding device 1700 may correspond to the above-mentioned decoding device 200 .

[0805] The decoding apparatus 1700 may include a processing unit 1710, a memory 1730, a user interface (UI) input device 1750, a UI output device 1760, and a storage device 1740, which communicate with each other through a bus 1790. The decoding apparatus 1700 may also include a communication unit 1720 coupled to a network 1799.

[0806] The processing unit 1710 may be a central processing unit (CPU) or a semiconductor device for executing processing instructions stored in the memory 1730 or the storage device 1740. The processing unit 1710 may be at least one hardware processor.

[0807] The processing unit 1710 may generate and process a signal, data, or information input to, output from, or used in the decoding device 1700, and may perform checks, comparisons, determinations, etc. related to the signal, data, or information. In other words, in an embodiment, generation and processing of data or information and checks, comparisons, and determinations related to data or information may be performed by the processing unit 1710.

[0808] The processing unit 1710 may include an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , an inter prediction unit 250 , a switch 245 , an adder 255 , a filter unit 260 , and a reference picture buffer 270 .

[0809] At least some of the entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the intra prediction unit 240, the inter prediction unit 250, the adder 255, the switch 245, the filter unit 260, and the reference picture buffer 270 of the decoding device 200 may be program modules and may communicate with an external device or system. The program module may be included in the decoding device 1700 in the form of an operating system, an application program module, or other program modules.

[0810] The program modules may be physically stored in various types of known storage devices. In addition, at least some of the program modules may also be stored in a remote storage device capable of communicating with the decoding apparatus 1700.

[0811] The program modules may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures for performing functions or operations according to the embodiments or for implementing abstract data types according to the embodiments.

[0812] The program module may be implemented using instructions or codes executed by at least one processor of the decoding device 1700 .

[0813] The processing unit 1710 may execute instructions or codes in the entropy decoding unit 210 , the inverse quantization unit 220 , the inverse transform unit 230 , the intra prediction unit 240 , the inter prediction unit 250 , the switch 245 , the adder 255 , the filter unit 260 , and the reference picture buffer 270 .

[0814] The storage unit may represent the memory 1730 and / or the storage device 1740. Each of the memory 1730 and the storage device 1740 may be any of various types of volatile storage media or non-volatile storage media. For example, the memory 1730 may include at least one of the ROM 1731 and the RAM 1732.

[0815] The storage unit may store data or information used for the operation of the decoding device 1700. In an embodiment, data or information of the decoding device 1700 may be stored in the storage unit.

[0816] For example, the storage unit may store pictures, blocks, lists, motion information, inter-frame prediction information, bitstreams, and the like.

[0817] The decoding device 1700 may be implemented in a computer system including a computer-readable storage medium.

[0818] The storage medium may store at least one module required for the operation of the decoding device 1700. The memory 1730 may store at least one module, and may be configured such that the at least one module is executed by the processing unit 1710.

[0819] Functions related to communication of data or information of the decoding device 1700 may be performed through the communication unit 1720 .

[0820] For example, the communication unit 1720 may receive a bitstream from the encoding apparatus 1700 .

[0821] Hereinafter, a processing unit may represent a processing unit 1610 of the encoding apparatus 1600 and / or a processing unit 1710 of the decoding apparatus 1700. For example, with respect to a function related to prediction, a processing unit may represent a switch 115 and / or a switch 245. With respect to a function related to inter-prediction, a processing unit may represent an inter-prediction unit 110, a subtractor 125, and an adder 175, and may represent an inter-prediction unit 250 and an adder 255. With respect to a function related to intra-prediction, a processing unit may represent an intra-prediction unit 120, a subtractor 125, and an adder 175, and may represent an intra-prediction unit 240 and an adder 255. With respect to a function related to transform, a processing unit may represent a transform unit 130 and an inverse transform unit 170, and may represent an inverse transform unit 230. With respect to a function related to quantization, a processing unit may represent a quantization unit 140 and an inverse quantization unit 160, and may indicate an inverse quantization unit 220. Regarding functions related to entropy encoding and / or entropy decoding, the processing unit may indicate the entropy encoding unit 150 and / or the entropy decoding unit 210. Regarding functions related to filtering, the processing unit may indicate the filter unit 180 and / or the filter unit 260. Regarding functions related to reference pictures, the processing unit may indicate the reference picture buffer 190 and / or the reference picture buffer 270.

[0822] The image coding technology based on artificial neural networks encodes and decodes the input image itself at a time, and its structure is: the input image is transformed into a hidden vector, the components of the hidden vector are quantized, and then entropy coding is performed through a probability model based on artificial neural networks, so that the encoder sends the encoded bit stream to the decoder. For this reason, in the case of high-resolution images, it may be difficult to perform encoding and decoding in a system environment with limited hardware resources.

[0823] Taking this into consideration, the input image is divided into blocks and each block is encoded and decoded using an artificial neural network, which is known as image coding technology based on block-based artificial neural networks.

[0824] However, since image encoding technology using such a block-based artificial neural network also has a limitation of not being able to use block peripheral information, it is difficult to improve encoding performance.

[0825] The embodiments of the present disclosure achieve higher efficiency than the encoding method of the related art by applying different encoding methods according to the characteristics of each unit block to the image encoding technology according to the block-based artificial neural network.

[0826] As a different encoding method, a mode in which each unit block is divided into several sub-blocks and encoded or a mode in which a unit block is reduced to one block and encoded may be used.

[0827] First, an image encoding method based on an artificial neural network will be described.

[0828] Fig.18 An image encoding / decoding structure based on artificial neural network is shown.

[0829] The encoder based on artificial neural network transforms the input image to be encoded (x) into a hidden vector (y) through the hidden vector transformation neural network, and quantizes each component of the hidden vector The quantized hidden vector is encoded by entropy based on the hidden vector probability model. The data is transformed into a bit stream which is then sent to a decoder based on an artificial neural network.

[0830] The artificial neural network based decoder again entropy decodes the bit stream sent from the artificial neural network based encoder based on the latent vector probability model to reconstruct the quantized latent vector And use the quantized hidden vector as the input of the hidden vector reconstruction neural network to output a reconstructed image with the same dimension as the input image

[0831] exist Fig.18The blocks indicated by dashed lines in represent trainable parameters or neural networks. The trainable parameters and neural networks can be learned through loss functions and back-propagation algorithms.

[0832] The loss function includes the mean square error (MSE) between the input image and the reconstructed image and the hidden vector probability model Calculated Entropy Both, and an optimization method that considers both the quality and the bit amount of the reconstructed image in this way is called rate-distortion optimization, and here, E refers to expected value.

[0833] Fig.19 shows an example of a hidden vector transformation neural network, and Fig. 20 An example of a hidden vector reconstruction neural network is shown.

[0834] The latent vector transformation neural network is a neural network that receives an image as input and outputs a latent vector, and the latent vector reconstruction neural network is a neural network that receives a quantized latent vector as input and outputs a reconstructed image.

[0835] Typically, the input image is 3D image information including three channels of RGB or YCbCr, height and width, and the hidden vector is usually a feature map with more channels (N=128 or 192, etc.) and smaller height (H) and width (W).

[0836] The input image may be 2D image information or 3D image information having N channels. For example, the input image may include three channels of RGB or YCbCr. Here, N may be 1, 2, 3 or a positive integer.

[0837] The hidden vector may refer to a feature map having M channels. M may be 64, 128, 192, or a positive integer. For example, the width and height of the hidden vector may be the same as the width and height of the input image, respectively. Alternatively, for example, at least one of the width and height of the hidden vector may be smaller than the width and height of the input image.

[0838] In the hidden vector transformation neural network (g a )of Fig.19 In the paper, a convolutional layer with a 5×5 kernel and a stride of 2 is used, and three generalized divisive normalization (GDN) layers are used. GDN is a nonlinear layer that has shown high efficiency in shallow neural networks.

[0839] In the hidden vector transformer neural network, the kernels used in the convolutional layers, the stride sizes, and the number of convolutional layers and the GDNs corresponding to the convolutional layers may be varied taking into account rate-distortion optimization and / or supporting hardware resources.

[0840] In the case of hardware or system environments that can perform sufficient computations in a given time, large kernels, small stride values, and a large number of convolutional layers and GDNs can be used, whereas in poor computing environments, conversely, the kernel size can be reduced and the stride can be increased to use a small number of convolutional layers and GDNs.

[0841] In addition, in a structure using multiple convolutional layers, kernels of different sizes and / or strides of different sizes may be used for each convolutional layer, or in at least one convolutional layer, a kernel having a different size from that of another convolutional layer and / or a stride having a different size from that of another convolutional layer may be used.

[0842] In the hidden vector reconstruction neural network (g s )of Fig. 20 In

[15] , the convolutional layers of the hidden vector transformation neural network are replaced with transposed convolutional layers, and the non-linear layers can be implemented using inverse generalized divide normalization (IGDN).

[0843] The hidden vector generated by the transformation neural network is transmitted to the reconstruction neural network in a quantized state.

[0844] Quantization maps values ​​within a specific range to a specific value and can be used when limiting the number of values ​​that can be expressed. Quantization can be mainly divided into uniform quantization and non-uniform quantization. In uniform quantization, the range mapped to a specific value is the same, and in non-uniform quantization, the range mapped to each value can be different.

[0845] In artificial neural network based video coding, the component values ​​of the latent vector are also quantized, but uniform quantization is mainly used because the latent vector transform neural network guarantees nonlinear transformation.

[0846] In particular, quantization in the image coding based on the artificial neural network can be replaced by a process of adding (Equation 1) uniform noise between -0.5 and 0.5, instead of quantization at the time of training to train the artificial neural network so that the back propagation algorithm can be used, and rounding operation (Equation 2) can be used instead at the time of inference (i.e., when performing prediction or classification of new input data using the trained artificial neural network). Here, inference can be performed in the image decoding process. When decoding an image encoded based on the artificial neural network, the quantized hidden vector can be dequantized by rounding operation.

[0847] [Equation 1]

[0848]

[0849] [Equation 2]

[0850]

[0851] In Equation 1 and Equation 2, is the hidden vector to which uniform noise is added, is the quantized hidden vector, is a uniform distribution, and Round() is a rounding operation.

[0852] Furthermore, the quantized hidden vector is sent to the reconstruction neural network in an entropy-coded state.

[0853] Entropy coding performs encoding based on entropy when the probability distribution of occurrence values ​​of a random variable is known, and may be, for example, arithmetic coding.

[0854] In the image coding method based on artificial neural network, the encoder and the decoder perform entropy encoding and entropy decoding on the quantized hidden vector, respectively.

[0855] It can be expressed by the hidden vector probability model (i.e., entropy model) p y (y) to perform entropy encoding and decoding of the hidden vector, and p y (y) can be designed as a trainable parameter or probability distribution estimated by a neural network.

[0856] For each component of the hidden vector y i Under the assumption of mutual independence, the latent vector probability model can be designed as shown in Equation 3.

[0857] [Equation 3]

[0858]

[0859] In addition, the probability model of the hidden vector to which uniform noise within (-1 / 2, 1 / 2) is added (Equation 4) and the probability model of the quantized hidden vector (Equation 5) can be expressed as the probability model of the hidden vector and the uniform distribution The convolution operation between .

[0860] [Equation 4]

[0861]

[0862] [Equation 5]

[0863]

[0864]

[0865] In Equations 4 and 5, * is a convolution operation, and unless otherwise specified, the latent vector probability model refers to the probability model of the quantized latent vector.

[0866] The probability model of the hidden vector can be mainly divided into a probability model independent of the input image and a probability model depending on the input image. In the former case, the same probability model is used for all input images, and in the latter case, another neural network structure is included, and through this neural network structure, a probability model estimated differently according to the input image is used.

[0867] Generally, the case where the probability model of the latent vector depends on the input image is better than the case where it does not depend on the input image, so the case where the probability model of the latent vector depends on the input image is mainly used.

[0868] The hidden vector probability model can be designed as a parametric model or a non-parametric model. In the case of a parametric model, a Gaussian distribution or a Laplace distribution can be used, and in the case of a non-parametric model, trainable parameters and arithmetic operation results of non-linear functions can be appropriately used to implement them.

[0869] Fig.18 This could be an example of a case where the probability model of the latent vector is independent of the input image.

[0870] Equation 6 is an example of a latent vector probability model, which is a latent vector probability model designed with a Laplace distribution using trainable parameters μ and σ.

[0871] [Equation 6]

[0872]

[0873] In Equation 6, Lap refers to Laplace distribution, and μ and σ are mean and scale information, which are parameters of the Laplace distribution and may have the same dimension as the hidden vector. μ i , σ i They refer to Here, the dimension may refer to the number of channels.

[0874] Fig.21 An image encoding / decoding structure based on an artificial neural network is shown when a probability model of a hidden vector depends on an input image, and a super prior information transformation neural network, a super prior information probability model, and a super prior information reconstruction neural network are further included in Fig.18 in the structure.

[0875] If the probability model of the hidden vector depends on the input image, additional information for estimating the probability model of the hidden vector for the current input image should be generated and sent to the decoder, and such additional information is called super-prior information.

[0876] In general, the super-prior information transformation neural network is a neural network that receives a hidden vector as input and outputs super-prior information z, and the super-prior information reconstruction neural network receives the quantized super-prior information As input and output μ y and σ y , where μ y and σ y are the parameters of the hidden vector probability model.

[0877] The super-prior information is also sent from the encoder to the decoder in the form of a bit stream through quantization and entropy coding, and at this time, the super-prior information probability model is used for entropy coding.

[0878] The super-prior information probability model can use the aforementioned hidden vector probability model that is independent of the input image.

[0879] Fig. 22 An example of a super prior information transformation neural network is shown, which uses one convolutional layer with a 3×3 kernel at stride 1, two convolutional layers with a 5×5 kernel at stride 2, and rectified linear units (ReLU) as non-linear layers. In particular, the super prior information transformation neural network uses an absolute value operation (abs) on the input of the first layer.

[0880] Refer to above Fig.19 As with the hidden vector transformation neural network described in the previous section, the number of convolutional layers that make up the super-prior information transformation neural network, the size of the kernels used in the convolutional layers and the stride values ​​can be changed as needed, and sub-linear layers can also be used by selecting one or more of several non-linear activation functions.

[0881] Fig.23 An example of a hyper-prior information reconstruction neural network is shown. The convolutional layer with a 5×5 kernel in the hyper-prior information transformation neural network is replaced with a pre-convolutional layer, excluding the absolute value operation, and then a ReLU layer is added to achieve it.

[0882] Artificial neural network based image encoding is performed by trainable parameters and neural networks. Learning of these parameters and neural network weights can be done by updating the parameters and neural network weights in a direction that minimizes a specific loss function computed from the learning data.

[0883] In particular, a neural network for image coding is end-to-end learned in a direction that simultaneously minimizes the distortion between the input image and the reconstructed image and the bit rate of the bitstream transmitted from the encoder to the decoder. This optimization method can be referred to as rate-distortion optimization.

[0884] Typically, distortion can be measured using the mean squared error (MSE) or multi-scale structural similarity index (MS-SSIM) between the input image and the reconstructed image, and the entropy (i.e., the amount of information) calculated by the hidden vector probability model can be used. as the bit rate.

[0885] In addition, a constant λ is used to determine the ratio between distortion and bit rate. When λ is used as shown in Equation 7, the desired picture quality level can be determined. Generally, the larger λ is, the higher the quality level is.

[0886] [Equation 7]

[0887]

[0888] In particular, when the probability model of the hidden vector depends on the input image, an entropy term is additionally included in the loss function (Equation 8) for bitstream transmission of super-prior information, where L is the loss function and is the reconstructed image and d is the distortion function, such as MSE or MS-SSIM.

[0889] [Equation 8]

[0890]

[0891] The artificial neural network based video coding method internally uses the artificial neural network based image coding method and may also use a method for removing temporal redundancy.

[0892] Temporal redundancy can be removed by using a reference frame, and in particular, an image encoded using such a reference frame is referred to as a P frame or a B frame. A P picture may refer to an image using only one reference picture, and a B picture may refer to an image using two or more reference pictures. In addition, an image encoded without using a reference picture is referred to as an I frame, and encoding of the I picture can be performed in the same manner as image encoding.

[0893] Video coding methods based on artificial neural networks can be mainly divided into methods that reduce temporal redundancy by using reference images in the image domain and methods that reduce temporal redundancy by using reference images in the latent space.

[0894] The use of reference images in the image domain follows a structure similar to that of conventional video coding methods, and the method of using reference images in the latent space is a new method that can be used in artificial neural network based video coding, which solves the problem of error propagation in video coding.

[0895] Error propagation refers to the occurrence of large degradation due to accumulation of degradation in image quality when a reconstructed image is repeatedly used as a reference image.

[0896] Fig.24 An artificial neural network based video coding method using a method for reducing temporal redundancy in the image domain is shown. This is a method based on neural networks to implement and apply methods such as the use of residual frames using reference images, motion estimation through optical flow networks, and motion compensation.

[0897] by Fig.24 For example, when the current video x is encoded by using an artificial neural network-based video coding method that reduces temporal redundancy in the image domain t When encoding, the general processing performed by the encoder is as follows 1) to 4).

[0898] 1) First, the optical flow neural network transforms the current image x t and the reconstructed reference image present in the decoded frame buffer Used as input to output motion vector v t .

[0899] 2) The motion vector encoder network converts the motion vector v t Used as input to output the transformed motion vector m t , and the quantized motion vector It is sent to the decoder through entropy coding.

[0900] 3) Motion vector decoder network reception Takes as input and outputs reconstructed motion vectors And the motion compensation network receives the reference image and Takes as input and generates a predicted frame

[0901] 4) The residual image r t Used as input to the residual encoder network to output the hidden vector y t , where the residual image r t is the current image x t and predicted image The difference between them, and the quantized hidden vector It is sent to the decoder through entropy coding.

[0902] by Fig.24 For example, when the video decoding method based on artificial neural network is used to reconstruct the reconstructed image using the method of reducing temporal redundancy in the image domain When , the general processing performed by the decoder is as follows 1) to 4).

[0903] 1) Obtain the quantized hidden vector from the bitstream through entropy decoding and motion vector

[0904] 2) The residual decoder network quantizes the hidden vector Used as input to output the reconstructed residual image

[0905] 3) The motion compensation network reconstructs the reference image in the reconstructed image buffer and motion vector Used as input to generate predicted images

[0906] 4) Finally, the reconstructed image is generated, as shown in the formula shown.

[0907] The video encoding method based on artificial neural network may include an image encoding method based on artificial neural network.

[0908] Various machine vision tasks (such as object classification, object recognition, object detection, object segmentation, object tracking) or machine tasks (such as various image processing such as super-resolution, frame interpolation, etc.) have increasingly utilized artificial neural networks (ANNs).

[0909] The artificial neural network model for performing machine tasks generally includes a feature map extractor for extracting features from input data or input images and a task executor for actually performing a specific machine task based on the extracted features. At this time, when the input is in the form of an image, the extracted features are generally referred to as feature maps.

[0910] In the present disclosure, the expression "feature map" is used, but it can also be applied to features that are not in the form of a map.

[0911] Fig.25 The structure of Mask R-CNN is shown, where Mask R-CNN is an artificial neural network model for object domain segmentation.

[0912] exist Fig.25 In the structure of , the feature pyramid network (FPN) is used as the feature map extractor, and the region proposal network (RPN) and the region of interest head (ROI Head) are used as task executors.

[0913] Fig.26 Shown by Fig.25 Example of feature maps extracted from FPN by Mask R-CNN.

[0914] If the input is an image, the shape of the feature map can be represented as a horizontal × vertical two-dimensional array, and since the feature map of a layer usually includes several channels, the feature map of each layer can be represented as a 3D array of size (width_size × length_size × channel_number).

[0915] That is, if Fk is a feature map of layer k, Fk can be represented as a 3D array Fk[x][y][c] including extracted eigenvalues, where x and y represent the horizontal and vertical positions of the eigenvalues, respectively, and c represents the channel index.

[0916] In FPN, the feature map of each layer consists of 256 channels, and Fig.26 Only the feature map corresponding to the first channel in the feature map of each layer is shown as an example. For reference, in FPN, as the layer becomes deeper, the horizontal and vertical sizes of the feature map become smaller than the size of the input image.

[0917] As machine learning has been widely used in various devices including mobile devices and large servers, there are more and more cases where a feature map extractor and a task executor do not exist in the same device but exist in different devices.

[0918] Fig. 27 A model is shown in which feature map extraction and task execution are performed separately in different devices.

[0919] Fig. 27 The example shows a case where the feature map extractor exists in the mobile device, but the specific task executor (such as object segmentation, disparity map estimation, or image reconstruction) exists in the cloud server. In this case, the feature map extracted from the mobile device is sent to the server, and the result of the server operation is sent to the mobile device again.

[0920] As in this example, when the feature map extractor and the task executor are separated, the extracted feature map should be delivered to the task executor, and a feature map encoding method is needed to minimize the amount of feature map data to be delivered or stored while minimizing the degradation of task performance.

[0921] As another example, even if the feature map extractor and the task executor exist in the same device, there may be a case where the extracted feature map is stored by the storage device and then used by the task executor. Even in this case, a feature map encoding method is required.

[0922] The human visual system (HVS) may be more sensitive to the luminance signal Y than to the chrominance signals Cb and Cr. Since the signal represented by RGB has a high correlation between channels, there may be considerable redundancy.

[0923] Therefore, the amount of information to be encoded for the input image can be reduced by exploiting the characteristics of the human visual system and the correlation between channels.

[0924] The YCbCr color space is a color conversion standard established in 1982, ITU-R BT.601 is a standard established for the SD class, and BT.709 is a standard established for the HD class.

[0925] The YCbCr sampling format includes 4:4:4 sampling ( Fig.28a )、4:2:2 sampling( Fig.28b )、4:2:0 sampling( Fig.28c )wait.

[0926] 4:4:4 sampling has the same resolution of Y, Cb, and Cr, and stores the chrominance components as they are. In 4:2:2 sampling, the ratio of the chrominance components to the luminance components in the horizontal direction is 1:1, and the ratio between the chrominance components and the luminance components in the vertical direction is 1:2. In 4:2:0 sampling, the ratio of the chrominance components to the luminance components in the horizontal and vertical directions is 1:2.

[0927] For example, if the YCbCr sampling format is one of 4:2:2 sampling and 4:2:0 sampling, downsampling of the Y channel or upsampling of the Cb and Cr channels may be performed before being used as an input to the artificial neural network, and the result of the downsampling or upsampling may be used as an input to the artificial neural network.

[0928] In order to effectively encode image signals of various characteristics, conventional video encoding techniques use a block-by-block encoding method.

[0929] Since a terminal has limited hardware resources, block-based encoding may be required to efficiently utilize the terminal's encoding algorithm and resources.

[0930] HEVC (ITU-T / ISO / IEC 23008-2 High Efficiency Video Coding) has a coding unit (CU) block, where the coding unit (CU) block can be divided into sub-CUs in a recursive quadtree structure.

[0931] In HEVC, a CU partition block is divided into a prediction unit (PU) block and a transform unit (TU) partition block.

[0932] In HEVC, the optimal partition block (CU / PU / TU) combination uses an optimal mode determination method based on a minimum rate-distortion value as shown in Equation 9.

[0933] [Equation 9]

[0934] J n =SSEn (QP)+λ(QP)·R n (QP)

[0935] In Equation 9, R n is the number of bits generated when encoding using the nth CU, PU and TU block combination mode, and is obtained by n (x,y) and reconstructed signal The difference between them is squared to calculate the SSE as in Equation 10 n (Sum of squared errors).

[0936] [Equation 10]

[0937]

[0938] By Equation 9, the encoding mode that minimizes the distortion of the reconstructed image quality while minimizing the number of generated bits is selected as the final encoding mode, and QP is a quantization parameter.

[0939] The image coding method based on artificial neural network has the characteristic of processing the input image once. Due to this characteristic, it may not be possible to encode high-resolution images in the same way in a system environment with limited hardware resources.

[0940] Therefore, before applying the artificial neural network based image encoding method, the input image can be divided into unit blocks, and then encoding and decoding can be performed on each of the divided unit blocks, which is called image encoding according to the block-based artificial neural network.

[0941] However, in the case of image encoding according to a block-based artificial neural network, there is a limitation in that neighboring information of a unit block cannot be used.

[0942] In order to divide the image into unit blocks, the input image can be divided into two or more unit blocks, such as Fig.29 shown.

[0943] Fig.30 is a block diagram of an image encoding and decoding method using block-based adaptive scaling and sampling according to an embodiment.

[0944] exist Fig.30 In the encoding target image, the encoding target image can be an input image to be encoded or a residual image between a predicted image of the input image to be encoded and the input image to be encoded. In addition, the encoding target image can be extended to a feature map or a multi-resolution feature map.

[0945] The encoder may perform a unit block partitioning function, an encoding mode determining function, a subblock constructing function, and a subblock encoding function, and the decoder may perform an encoding mode reconstruction function, a subblock decoding function, a unit block reconstruction function, and an image reconstruction function.

[0946] Unit block division refers to dividing an encoding target image into two or more unit blocks. B(x, y) is a unit block divided from the encoding target image.

[0947] In the case of dividing the encoding target image into unit blocks, the encoding target image may be divided into unit blocks having a size of pM×qN (where p and q are positive integers). Fig.29 An example of partitioning into square unit blocks of pM=qN is shown, and the size and shape of the unit blocks can be changed by adjusting the values ​​of p, q, M, and N.

[0948] The coding mode determination is used to determine the coding mode for each unit block divided by the unit block division. The rate-distortion optimization can be used to determine the coding mode for each unit block.

[0949] Determining the coding mode of the corresponding unit block to be currently encoded through rate-distortion optimization means: calculating the rate-distortion cost function for the case where all or some available coding modes are applied to the unit block to be currently encoded, and determining the coding mode with the lowest calculated rate-distortion cost as the coding mode in the corresponding unit block.

[0950] Coding modes that may be used to encode the unit block may include using a conventional image encoding method (eg, HEVC or VVC) and using an image encoding method based on an artificial neural network.

[0951] For example, when an artificial neural network is used to encode a unit block, the cost function of Equation 7 or Equation 8 may be used as a rate-distortion-based cost function. Alternatively, when a conventional video coding technique (e.g., HEVC or VVC) is used to encode a unit block without using an artificial neural network, the cost function described with reference to Equations 9 and 10 may be used.

[0952] Information about the determined encoding mode may be included in a bitstream and transmitted so that a decoder may know the information.

[0953] Sub-block construction refers to constructing a sub-block by a method corresponding to a determined coding mode. The method of constructing a unit block into sub-blocks may vary according to the coding mode. Here, b(x, y) is a sub-block generated from the unit block.

[0954] Fig.31An example of dividing an input image into unit blocks and sub-blocks in the case where M=N and p=q=2 when the input image is divided into unit blocks of size pM×qN is shown, and Fig.32 An example of dividing an input image into unit blocks and sub-blocks in a case where p=3 and q=2 when the input image is divided into unit blocks of a size of pM×qN is shown.

[0955] Each unit block can be divided into various sub-blocks, and the size and shape of the sub-blocks can be changed by adjusting the values ​​of p, q, M, and N.

[0956] Fig.31 An example is shown in which a unit block B(x, y) is divided into sub-blocks b1(x, y), b2(x, y), and b3(x, y) when M=N and p=q=2. Fig.32 This is an example of dividing a unit block B(x, y) with p=3 and q=2 into sub-blocks b1(x, y) and b2(x, y).

[0957] Hereinafter, the embodiment will be described in detail by taking the case where M=N and p=q=2 (ie, the case where the unit block is 2N×2N) as an example. However, it can also be applied to other combinations of p, q, M and N.

[0958] The sub-block constructed from the unit block may be regarded as the unit block, and the sub-block may be hierarchically constructed by constructing the sub-block again. The partition depth may be defined according to the hierarchical degree of the hierarchical sub-block.

[0959] Fig.33 An example of recursively / hierarchically constructing sub-blocks in a unit block of 2N×2N size is shown.

[0960] For example, in the case of a sub-block constructed from a unit block divided from an encoding target image, the division depth may be 0, and based on the sub-block being regarded as a unit block, in the case of a sub-block constructed from the unit block, the division depth may be 1.

[0961] The sub-blocks and hierarchical sub-blocks may be determined in different coding modes.

[0962] Sub-block coding can be performed by conventional image coding devices ( Figure 1 ) or neural network-based video encoding devices ( Fig.18 ) operation, and can encode the sub-block and output a bit stream containing mode information and sub-block information.

[0963] Typical video coding devices can refer to the image encoder in HEVC (ITU-T / ISO / IEC 23008-2 High Efficiency Video Coding) or VVC (ITU-T / ISO / IEC 23090-3 General Video Coding) (reference Figure 1), and can encode images through processes such as transformation, quantization, entropy coding, motion prediction, motion compensation, and intra-frame prediction.

[0964] In the case of performing sub-block encoding using a general image encoder, different quantization parameters may be used according to an encoding mode of a unit block.

[0965] As mentioned above Fig.18 As described, the neural network-based image encoding device transforms the input image to be encoded into a hidden vector through a hidden vector transformation neural network, quantizes each component of the hidden vector, and transforms the quantized hidden vector into a bit stream through entropy coding based on a hidden vector probability model.

[0966] In the case of sub-block encoding using a neural network-based image encoder, different image quality levels can be used according to the encoding mode of the unit block, and different neural network-based image encoders can also be used.

[0967] Coding mode reconstruction is to reconstruct the coding mode information from the bitstream sent from the encoder.

[0968] Sub-block decoding is to decode information about sub-blocks in the bit stream sent from the encoder, and a conventional image decoding device ( Figure 2 ) or neural network-based decoding devices ( Fig.18 ) operation. is the reconstructed sub-block.

[0969] A typical image decoding device may refer to an image decoder in HEVC (ITU-T / ISO / IEC 23008-2 High Efficiency Video Coding) or VVC (ITU-T / ISO / IEC 23090-3 Versatile Video Coding) (reference Figure 2 ), and the image can be decoded through processes such as entropy decoding, inverse quantization, inverse transformation, motion compensation, and intra-frame prediction.

[0970] As mentioned above Fig.18 As described, the neural network-based image decoding device entropy decodes a bit stream sent from a neural network-based encoder based on a hidden vector probability model to reconstruct a quantized hidden vector, and reconstructs a reconstructed image of the same size as the input image by using the quantized hidden vector as an input of a hidden vector reconstruction neural network.

[0971] Sub-block decoding may use different sub-block decoding devices according to the encoding mode of the unit block.

[0972] When a conventional image decoder is used for sub-block decoding, different quantization parameters may be used according to the coding mode of the unit block. In addition, when a neural network-based image decoder is used for sub-block decoding, different neural network-based image decoders may be used according to the coding mode of the unit block.

[0973] In the unit block reconstruction, the reconstructed sub-block is reconstructed into the unit block, and the encoding mode information transmitted from the encoder may be used to reconstruct the unit block. The method of reconstructing the sub-block into the unit block may vary according to the encoding mode. is the reconstructed unit block.

[0974] In image reconstruction, an image is reconstructed using the reconstructed unit blocks, and the reconstructed image is output.

[0975] In an embodiment of the present disclosure, when determining the encoding mode of the encoder, the encoding mode that can be determined for each unit block can be any one of 1) sub-block division encoding mode, 2) scaling encoding mode by resolution adjustment, and 3) sub-block division encoding mode by sampling.

[0976] 1) Sub-block division coding mode

[0977] Fig.34 An example of dividing a 2N×2N size unit block into N×N size sub-blocks by a zigzag scanning technique is shown, and Fig.35 An example of reconstructing a decoded N×N sized sub-block into a 2N×2N sized unit block by a zigzag scanning technique is shown.

[0978] In the sub-block construction in the sub-block division coding mode, the unit block B(x, y) to be encoded currently is divided into two or more sub-blocks, for example, Fig.34 The four sub-blocks b1(x,y), b2(x,y), b3(x,y) or b4(x,y) in the block, where (x,y) is the position of the sample point in the block. The sub-blocks can be encoded into the bitstream by sub-block coding.

[0979] The bit stream of the sub-block is reconstructed into sub-blocks again by sub-block decoding in the decoder. The unit block reconstruction in the sub-block partition coding mode may refer to the reconstruction of each sub-block or all sub-blocks constituting the corresponding unit block. For example, the unit block reconstruction in the sub-block partition coding mode may be tiling the reconstructed sub-blocks according to a predefined order. Tiling is performed to generate decoded unit blocks exist Fig.35 In the four decoded sub-blocks Reconstructed into decoded unit blocks by zigzag scanning

[0980] 2) Scaling coding mode by resolution adjustment

[0981] The sub-block construction in the scaling coding mode by resolution adjustment constructs sub-blocks by performing low resolution on the unit block to be encoded currently at a specific ratio (0 < r < 1).

[0982] In the scaling coding mode by low resolution, a sub-block b(x, y) can be generated by reducing the resolution of the unit block B(x, y). At this time, as a method of reducing resolution, there are methods using fixed filters (such as bilinear interpolation or bicubic interpolation) or methods using trainable artificial neural networks. Depending on the ratio r used when increasing or decreasing the resolution, each can be considered a different coding mode.

[0983] Fig.36 An example of scaling the 2N×2N-sized unit block B(x, y) to the N×N-sized sub-block b(x, y) by bicubic interpolation is shown.

[0984] When the unit block uses a color space with a luminance channel and a chrominance channel (such as the YCbCr color space), a filter that converts the chrominance channel to a lower resolution than the luminance channel can be used.

[0985] Fig.37 An example of scaling the unit block by reducing the resolution of the luminance channel to 1 / 2 resolution and the resolution of the chrominance channel to 1 / 4 resolution when scaling an image with the YCbCr color space by reducing the resolution is shown.

[0986] The sub-block can be encoded into the bitstream through sub-block encoding. Through sub-block decoding in the decoder, the bitstream for the sub-block is reconstructed into a sub-block. The unit block reconstruction in the scaling coding mode by resolution adjustment performs high resolution on the reconstructed sub-block at the reciprocal of the specific ratio (1 / r > 1) determined by the encoder.

[0987] At this time, as a method of increasing resolution, there are methods using fixed filters (such as bilinear interpolation or bicubic interpolation) or methods using trainable artificial neural networks.

[0988] Fig.38 An example of reconstructing the reconstructed N×N-sized sub-block into a 2N×2N-sized unit block is shown.

[0989] Depending on the ratio r used when performing low resolution and high resolution, each can be considered a different coding mode.

[0990] For example, information about the ratio r may be signaled / encoded / decoded.

[0991] 3) Coding mode by sub-block division of samples

[0992] In the sub-block division coding mode by sampling, the sub-block construction is to sample the unit block to be encoded currently and divide it into two or more sub-blocks. In order to divide the unit block B(x,y) into sub-blocks by sampling, the unit block can be divided into m×n sampling units, and then the samples at the same position in all sampling units can be reconstructed to form two or more different sub-blocks.

[0993] For example, Fig.39 A method is shown in which a unit block B(x,y) is divided into 2×2 sampling units, samples at the same position in all sampling units are reconstructed, and the reconstructed samples are divided into four different sub-blocks b1(x,y), b2(x,y), b3(x,y), and b4(x,y).

[0994] The sub-blocks may be encoded into a bit stream by sub-block encoding. The bit stream of the sub-blocks is reconstructed into sub-blocks again by sub-block decoding in a decoder. Unit block reconstruction is to reconstruct unit blocks from reconstructed sub-blocks by inverse sampling, and sub-block inverse sampling is to perform sub-block partitioning inversely to reconstruct unit blocks from reconstructed sub-blocks.

[0995] Fig.40 The reconstruction of the four sub-blocks is shown. Perform inverse sampling to reconstruct the unit block method.

[0996] Different coding modes can be considered depending on the sampling and desampling methods.

[0997] Since sub-blocks divided by sampling have high spatial redundancy with each other, redundancy of the remaining sub-blocks may be removed by using one or more sub-blocks.

[0998] As a method for removing redundancy between sub-blocks, a typical image encoder generates a prediction block through a predictor (e.g., an intra-frame prediction unit), and then determines a residual block that is a difference between the prediction block and the existing sub-block as a final sub-block. The prediction block can also be generated through a neural network-based transformation or arithmetic operation.

[0999] Fig.41 An example of removing redundancy among four sub-blocks generated by dividing a unit block through sampling is shown.

[1000] exist Fig.41In the example, four sub-blocks b1(x,y), b2(x,y), b3(x,y), and b4(x,y) are generated from the unit block B(x,y) by sampling, and in order to remove redundancy between the sub-blocks, for example, a prediction block of each sub-block is generated by using the first sub-block b1(x,y) as it is. Then, a residual block different from the existing sub-blocks b2(x,y), b3(x,y), and b4(x,y) is generated To remove the redundancy between sub-blocks. At this time, the final sub-block can be b1(x,y),

[1001] Fig.42 The reconstructed sub-block and residual block are shown Reconstruct the final sub-block And then perform inverse sampling to reconstruct the unit block .

[1002] In the sub-block division coding mode by sampling, different coding modes may be considered according to a method of removing redundancy between sub-blocks.

[1003] For example, the encoding modes may be classified based on a method of removing redundancy between subblocks in dividing the encoding mode by subblocks of samples.

[1004] In an image encoding method using an artificial neural network as a method for removing redundancy between sub-blocks, entropy encoding efficiency can be improved by using a previously encoded or decoded sub-block as an additional input of a hidden vector probability model for a sub-block currently to be encoded or decoded.

[1005] In addition, in the foregoing description, it has been described that one of three encoding modes based on artificial neural networks including sub-block partitioning encoding mode, scaling encoding mode by resolution adjustment, and sub-block partitioning encoding mode by sampling is determined for each unit block. However, the embodiments of the present disclosure are not limited thereto.

[1006] When an input image is divided into unit blocks in the form of, for example, tiles, slices, or sub-pictures, an encoding method in which a conventional image encoding method such as HEVC or VVC is applied to the unit blocks may be determined as an encoding mode of the unit blocks.

[1007] When the conventional image encoding method is selected as the encoding mode, as shown above with reference to Figure 1 and Figure 2As described in detail, the unit block can be further divided into multiple CTUs, each CTU can be recursively divided into multiple smaller CUs, each CU is predicted according to an inter-frame prediction mode with reference to other reference pictures and an intra-frame prediction mode or a block copy mode with reference to an area within the same picture, and a residual signal for each CU is generated and output as a bit stream through transformation, quantization, and entropy coding. Because they have been fully described above, the details related to them are omitted.

[1008] Syntax elements such as indexes may be added to a bitstream to distinguish between a case where a conventional image encoding method is applied as an encoding mode to a unit block and a case where three encoding modes based on an artificial neural network are applied.

[1009] The index of the coding mode for notifying the unit block may be transmitted with a signal for each unit block. For example, the index of the first value may indicate a conventional image coding method, the index of the second value may indicate a sub-block division coding mode in a coding mode based on an artificial neural network, the index of the third value may indicate a scaling coding mode in a coding mode based on an artificial neural network, and the index of the fourth value may indicate a sub-block division coding mode by sampling in a coding mode based on an artificial neural network. For example, the first value, the second value, the third value, and the fourth value may be different from each other. The first value, the second value, the third value, and the fourth value may have values ​​of 1 to 4. Alternatively, for example, the first value, the second value, the third value, and the fourth value may be different from each other and may have values ​​of 0 to 3.

[1010] In addition, a syntax element notifying whether a conventional encoding method is activated for a unit block belonging to a corresponding higher unit may be added to header information of a higher unit (e.g., a sequence or a slice) including a plurality of unit blocks. In addition, an activation syntax element of the conventional encoding method may be replaced, or in addition, a syntax element indicating whether an artificial neural network-based encoding mode is activated in a unit block belonging to a corresponding higher unit may be added to header information of the higher unit.

[1011] Fig.43 is a flowchart of an image encoding method according to an embodiment.

[1012] First, the encoding apparatus 100 or 1600 divides an encoding target image into two or more unit blocks having a predetermined size ( S4310 ).

[1013] The encoding target image may be an input image to be encoded and / or a residual image between a predicted image of the input image and the input image. Optionally, the encoding target image may be a feature map.

[1014] like Fig.29As shown, the unit block may be a square having the same horizontal length and vertical length or a non-square shape having different horizontal lengths and vertical lengths. In addition, each unit block may be further divided into sub-blocks having various shapes or hierarchically divided into two or more division depths, as described above with reference to Figure 31 to Figure 33 described.

[1015] The encoding device 100 may determine a coding mode related to a method of encoding a unit block (S4320), and may determine the coding mode according to rate-distortion optimization for each unit block. Information about the determined coding mode may be encoded and included in a bitstream and transmitted to a decoder, or information about the determined coding mode may not be transmitted when it is derived from a neighboring unit block.

[1016] The encoding apparatus 100 generates a sub-block based on the determined encoding mode (S4330), and encodes the sub-block (S4340).

[1017] The encoding modes for encoding each unit block include: a first encoding mode for dividing sub-blocks using a scanning technique; a second encoding mode for scaling the unit block by adjusting the resolution; and a third encoding mode for dividing the sub-block into sub-blocks having a smaller size by sampling.

[1018] In addition, the encoding mode for encoding each unit block may also include a general image encoding method for performing motion prediction, prediction block generation, residual block generation, transformation, quantization, and entropy encoding.

[1019] As referenced above Fig.34 As described, the first coding mode may be the most basic example of dividing a 2N×2N size unit block into four N×N size sub-blocks by a zigzag scanning technique and then encoding them. For example, if the unit block is large, the unit block may be divided into 9 or 16 sub-blocks, and the sub-blocks may be sorted by applying a zigzag scanning technique, or the sub-blocks may be sorted differently by applying a vertical scanning technique or a horizontal scanning technique.

[1020] The encoding mode information for the first encoding mode may include the number of divisions into sub-blocks (or the sizes of the sub-blocks) and a scanning technique.

[1021] In the second encoding mode, a sub-block may be constructed by reducing the resolution of a unit block into a block having a smaller size, or a sub-block having the same size may be constructed by reducing the number of bits representing each pixel.

[1022] For conversion to lower resolution, bilinear interpolation filters, bicubic interpolation filters, etc. or trainable artificial neural networks may be used.

[1023] In addition, as mentioned above Fig.37 As described, sub-blocks having different sizes may be generated by applying different resolutions to unit blocks of a luma channel and a chroma channel.

[1024] The encoding mode information for the second encoding mode may include resolution adjustment ratio information (or sub-block size), resolution adjustment method related information (filter type, neural network, etc.), and the like.

[1025] The third encoding mode is to generate two or more sub-blocks of the same size by sampling a unit block, wherein the unit block is divided into m×n sampling units (for example, 2×2 or 3×3), and samples at the same position in all sampling units are collected and constructed into one sub-block to generate an m×n sub-block.

[1026] The sub-blocks generated according to the coding mode can be based on the above reference Figure 1 The conventional image encoding method described above is encoded, or based on the above reference Figures 18 to 27 The neural network described is encoded.

[1027] In particular, when the unit block is divided into a plurality of sub-blocks in the third coding mode, since the correlation between the sub-blocks is high, the above reference Fig.41 The redundant information between the sub-blocks is removed.

[1028] For example, after generating four sub-blocks according to 2×2 sampling units, prediction blocks for the second to fourth sub-blocks may be generated based on the first sub-block, and with respect to the second to fourth sub-blocks, residual blocks corresponding to the differences between the corresponding sub-blocks and the prediction blocks of the corresponding sub-blocks may be generated.

[1029] In this case, the residual blocks of the first subblock and the second to fourth subblocks become subblocks of the unit block, and encoding may be performed on the residual blocks of the first subblock and the second to fourth subblocks.

[1030] A conventional image encoding method or a method using a neural network may also be applied to encoding the first sub-block and the residual blocks of the second to fourth sub-blocks.

[1031] The encoding mode information related to the third encoding mode may include sampling unit information, information related to a sub-block transformation method (which sub-block is to be generated as a residual block, etc.), and the like.

[1032] The encoding information about the generated subblocks and the encoding mode information about the unit block are transformed into a bit stream and transmitted to a decoding device via a storage medium or a communication medium.

[1033] Fig.44 is a flowchart of an image decoding method according to an embodiment.

[1034] The decoding apparatus 200 derives information related to the encoding mode of the unit block and information related to the division of the unit block of the image from the bitstream (S4410). The decoding apparatus 200 may parse the encoding mode information of the unit block transmitted in the form of a syntax element in the bitstream, or may derive based on the encoding mode information of the neighboring unit blocks without parsing.

[1035] The encoding mode information of the unit block is information related to a method of encoding the unit block, and in an embodiment of the present disclosure where the unit block is transformed into one or more sub-blocks and encoded, the encoding mode information of the unit block may include information related to generating a sub-block from the unit block or information related to reconstructing the unit block from the sub-blocks.

[1036] The decoding device 200 reconstructs one or more sub-blocks constituting the corresponding unit block based on the encoding mode information of the unit block (S4420). Figure 2 The conventional image encoding method described above or based on the reference Figures 18 to 27 The described artificial neural network is used to reconstruct the sub-blocks.

[1037] The decoding apparatus 200 reconstructs one or more reconstructed sub-blocks into a unit block according to the encoding mode (S4430).

[1038] When referring to the above Fig.34 When the first mode described above divides a unit block into two or more unit blocks, the two or more reconstructed sub-blocks can be scanned by a predetermined scanning technique (for example, as described above with reference to Fig.35 The zigzag scanning technique described in ) is reconstructed as a unit block.

[1039] When encoding the sub-block in a state where the resolution of the unit block is reduced according to the second mode, the reconstructed sub-block can be transformed into the unit block by increasing the resolution using a predetermined interpolation filter or a trainable artificial neural network. The sub-block corresponding to the chrominance component can have a higher resolution increase rate than the sub-block corresponding to the luminance component.

[1040] When the unit block is sampled according to the third mode and divided into two or more sub-blocks and encoded, the two or more reconstructed sub-blocks may be inversely sampled and reconstructed into the unit block.

[1041] In order to remove redundancy, at least one subblock (e.g., a second subblock) among the plurality of subblocks may be predicted based on another subblock (e.g., a first subblock) and encoded to a state transformed into a residual block corresponding to a difference with an original second subblock, and in this case, the second subblock encoded as the residual block may be reconstructed and then transformed into the original second subblock based on the reconstructed first subblock. The reconstructed first subblock and the second subblock may be reconstructed into a unit block based on a sampling unit.

[1042] The decoding apparatus 200 reconstructs an image based on the reconstructed unit block (S4440). When the reconstructed image is a residual image, an operation of reconstructing the original image using another reference image may be added.

[1043] In this way, an image can be divided into unit blocks, an optimal coding mode for encoding can be determined by scaling one or more sub-blocks according to rate-distortion optimization for each unit block, and the unit blocks can be encoded using traditional coding methods or artificial neural networks, thereby achieving high coding efficiency even with limited resources.

[1044] In addition, while encoding an image using a block-based artificial neural network, the encoding performance can be improved by removing redundancy between individually encoded sub-blocks.

[1045] The embodiments may be performed using the same method by the encoding apparatus 1600 and the decoding apparatus 1700. In addition, an image may be encoded / decoded using at least one of the embodiments or at least one combination thereof.

[1046] The application order of the embodiments may be different from each other according to the encoding device 1600 and the decoding device 1700 , and the application order of the embodiments may be (at least partially) the same as each other according to the encoding device 1600 and the decoding device 1700 .

[1047] The embodiments may be performed for each of a luminance signal and a chrominance signal, and may be performed equally for the luminance signal and the chrominance signal.

[1048] The form of the block to which the embodiment is applied may have a square or non-square shape.

[1049] Whether to apply and / or execute at least one of the above embodiments may be determined based on a condition related to the size of the block. In other words, when the condition related to the size of the block is met, at least one of the above embodiments may be applied and / or executed. The condition includes a minimum block size and a maximum block size. The block may be one of the blocks described above in conjunction with the embodiment and the units described above in conjunction with the embodiment. The block to which the minimum block size is applied and the block to which the maximum block size is applied may be different from each other.

[1050] For example, when the block size is equal to or greater than the minimum block size and / or less than or equal to the maximum block size, the above embodiments may be applied and / or performed. When the block size is greater than the minimum block size and / or less than or equal to the maximum block size, the above embodiments may be applied and / or performed.

[1051] For example, the above embodiment may only be applied to the case where the block size is a predefined block size. The predefined block size may be 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, or 256×256. The predefined block size may be (2×SIZE X )×(2×SIZE Y ). SIZE X Can be one of 1 or greater integers. Y Can be one of 1 or greater integers.

[1052] For example, the above embodiment may only be applied to the case where the block size is equal to or greater than the minimum block size. The above embodiment may only be applied to the case where the block size is greater than the minimum block size. The minimum block size may be 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, or 256×256. Alternatively, the minimum block size may be (2×SIZE MIN_X )×(2×SIZE MIN_Y ). SIZE MIN_X Can be one of 1 or greater integers. MIN_Y Can be one of 1 or greater integers.

[1053] For example, the above embodiment may only be applied to the case where the block size is less than or equal to the maximum block size. The above embodiment may only be applied to the case where the block size is less than the maximum block size. The maximum block size may be 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, or 256×256. Alternatively, the maximum block size may be (2×SIZE MAX_X )×(2×SIZE MAX_Y ). SIZE MAX_X Can be one of 1 or greater integers. MAX_Y Can be one of 1 or greater integers.

[1054] For example, the above embodiment may be applied only to the case where ...

Claims

1. An image decoding method, comprising: Reconstruction unit block encoding mode; Reconstructing one or more sub-blocks of the unit block; reconstructing the unit block from the one or more sub-blocks based on the coding mode; as well as Reconstructing an image based on the unit blocks, The encoding mode includes at least one of a first mode, a second mode and a third mode, wherein in the first mode, the unit block is divided into two or more sub-blocks by a predetermined scanning method, in the second mode, a sub-block with a low resolution is generated from the unit block, and in the third mode, two or more sub-blocks are generated by sampling the unit block.

2. The image decoding method according to claim 1, wherein: The step of reconstructing one or more sub-blocks includes: applying a first decoding method through entropy decoding, inverse quantization, inverse transformation, and motion prediction and compensation, or a second decoding method to the one or more sub-blocks, wherein the second decoding method reconstructs a hidden vector through entropy decoding based on a hidden vector probability model, and uses the hidden vector as an input of a reconstruction neural network to generate a reconstructed image.

3. The image decoding method according to claim 1, wherein: The step of reconstructing the unit block includes tiling two or more first sub-blocks reconstructed after being divided and encoded based on the first mode according to a predetermined scanning technique.

4. The image decoding method according to claim 1, wherein: The reconstructing of the unit block includes upscaling the resolution of the second sub-block reconstructed after encoding at the low resolution based on the second mode by a predetermined ratio.

5. The image decoding method according to claim 4, wherein: The step of upscaling the resolution is performed by means of a fixed filter or a trainable artificial neural network.

6. The image decoding method according to claim 4, wherein: In the process of reconstructing the unit blocks, different ratios of upscaling resolutions are applied to the unit blocks of the luminance channel and the unit blocks of the chrominance channels.

7. The image decoding method according to claim 1, wherein: The step of reconstructing the unit block includes inversely sampling the two or more third sub-blocks reconstructed after being divided and encoded based on the third mode.

8. The image decoding method according to claim 7, wherein: At least one third subblock among the two or more third subblocks is reconstructed as a corresponding subblock among the two or more subblocks based on another third subblock among the two or more third subblocks after being encoded as a residual block.

9. An image encoding method, comprising: dividing the target image into two or more unit blocks including the first unit block; Determining a coding mode of the first unit block; generating one or more sub-blocks from the first unit block based on the coding mode; as well as encoding the one or more sub-blocks, The encoding mode includes at least one of a first mode, a second mode and a third mode, wherein in the first mode, the first unit block is divided into two or more first sub-blocks by a predetermined scanning method, in the second mode, a second sub-block with a low resolution of the first unit block is generated, and in the third mode, two or more third sub-blocks are generated by sampling the first unit block.

10. The image encoding method according to claim 9, wherein: The target image is an input image to be encoded, or a residual image corresponding to a difference between a predicted image of the input image and the input image.

11. The image encoding method according to claim 9, wherein: The step of encoding the one or more sub-blocks includes: applying a first encoding method through motion prediction and compensation, transformation, quantization and entropy encoding, or a second encoding method to the one or more sub-blocks, wherein the second encoding method transforms the image into a hidden vector through a transformation neural network, quantizes the hidden vector, and entropy encodes the quantized hidden vector based on a hidden vector probability model.

12. The image encoding method according to claim 11, wherein: The step of applying the second encoding method to the one or more sub-blocks further comprises: using a sub-block encoded by the second encoding method before the one or more sub-blocks as an additional input to the hidden vector probability model for the one or more sub-blocks.

13. The image encoding method according to claim 9, wherein: The step of generating the sub-blocks includes dividing the first unit block into two or more first sub-blocks having the same size by a predetermined scanning technique based on a first pattern.

14. The image encoding method according to claim 9, wherein: The step of generating the sub-block includes reducing the resolution of the first unit block according to a predetermined ratio based on the second mode.

15. The image encoding method according to claim 14, wherein: The downscaling step is performed by means of fixed filters or trainable artificial neural networks.

16. The image encoding method according to claim 14, wherein: In the process of generating the sub-blocks, different ratios of reduced resolutions are applied to the unit blocks of the luminance channel and the unit blocks of the chrominance channels.

17. The image encoding method according to claim 9, wherein: The step of generating the sub-blocks includes: dividing the first unit block into sampling units with a predetermined size based on the third mode, and reconstructing samples at the same position in each sampling unit to construct two or more third sub-blocks.

18. The image encoding method according to claim 17, wherein: The step of encoding the one or more sub-blocks includes transforming at least one third sub-block of the two or more third sub-blocks into a residual block based on another third sub-block of the two or more third sub-blocks.

19. The image encoding method according to claim 18, wherein: The transformation steps include: Based on the another third sub-block, generating a prediction block of the at least one third sub-block through a neural network-based transformation or an arithmetic operation; and The residual block is generated based on the prediction block and the at least one third sub-block.

20. A computer-readable storage medium storing a bit stream for picture information, wherein: The picture information is generated by an image coding method, and the image coding method includes: dividing the target image into two or more unit blocks including the first unit block; Determining a coding mode of the first unit block; generating one or more sub-blocks from the first unit block based on the encoding mode; and encoding the one or more sub-blocks, The encoding mode includes at least one of a first mode, a second mode and a third mode, wherein in the first mode, the first unit block is divided into two or more first sub-blocks by a predetermined scanning method, in the second mode, a second sub-block with a low resolution of the first unit block is generated, and in the third mode, two or more third sub-blocks are generated by sampling the first unit block.

Citation Information

Patent Citations

  • Camera module

    KR1020220070388A