Video encoding or decoding method and apparatus, and recording medium storing bit stream
By constructing a candidate list containing space, time and non-neighbor blocks, and sorting based on template matching costs and motion information, the candidate list management problem in inter prediction in the prior art is solved, and image prediction performance and encoding/decoding efficiency are improved .
Patent Information
- Application Number
- CN202380042056.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-31
- Filing Date
- 2023-03-31
- Publication Date
- 2024-12-31
AI Technical Summary
The existing image encoding/decoding technology is difficult to effectively manage and select candidate lists in inter-frame prediction, resulting in low image prediction performance and encoding efficiency.
By constructing a candidate list containing spatial neighbor blocks, temporal neighbor blocks, and non-neighbor blocks, sorting and selecting according to template matching costs and motion information, predicted blocks or residual blocks are generated.
Improve image prediction performance and encoding/decoding efficiency, enable more efficient configuration and management of various types of candidate lists, and improve inter prediction performance.
Smart Images

Figure CN119234422A_ABST
Abstract
Description
Technical Field
[0001] The present specification relates to an image encoding / decoding method and apparatus, and more particularly, to a method and apparatus for generating a prediction candidate list and determining a prediction candidate in inter-frame prediction. Background Art
[0002] As the information and communication industry continues to develop, broadcast services supporting high definition (HD) resolution have become popular throughout 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, a large number of organizations have accelerated the development of next-generation imaging devices. In addition to high-definition TV (HDTV) and full high-definition (FHD) TV, user interest in UHD TV, which has a resolution more than four times that of full high-definition (FHD) TV, has also increased. As interest in it increases, image encoding / decoding technology for images with higher resolution and higher definition is now 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 encoding 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 the current picture and / or a picture 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 these image compression technologies, data regarding images can be efficiently compressed, transmitted, and stored. Summary of the invention
[0008] Technical issues An object of the present specification is to provide a method for determining a candidate to be added to a candidate list in inter prediction using a candidate list.
[0009] Another object of the present specification is to provide a method for constructing and managing several candidate lists in an inter-frame prediction process.
[0010] Technical Solution According to an embodiment of the present specification, an image decoding method may include: constructing a candidate list related to the prediction of a current block; generating a prediction block of the current block based on a candidate selected from the candidate list; and generating a reconstructed block of the current block based on the prediction block, wherein constructing the candidate list includes adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block.
[0011] According to another embodiment of the present specification, an image encoding method may include: constructing a candidate list related to the prediction of a current block; generating a prediction block of the current block based on a candidate selected from the candidate list; and generating a residual block of the current block based on the prediction block, wherein constructing the candidate list includes adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block.
[0012] According to another embodiment of the present disclosure, a computer-readable storage medium may store a bit stream for picture information generated by executing an image encoding method, wherein the image encoding method includes: constructing a candidate list related to a prediction of a current block; generating a prediction block of the current block based on a candidate selected from the candidate list; and generating a residual block of the current block based on the prediction block, wherein constructing the candidate list includes adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block.
[0013] Advantages and effects According to an embodiment of the present specification, various candidates may be added to a candidate list for inter prediction, and various types of candidate lists may be configured and managed by classifying prediction candidates.
[0014] Furthermore, according to the present specification, image prediction performance can be improved through inter-frame prediction.
[0015] Furthermore, according to the embodiments of the present specification, image encoding and decoding efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a block diagram showing a configuration of an embodiment of an encoding device to which the present disclosure is applied; Figure 2 is a block diagram showing a configuration of an embodiment of a decoding device to which the present disclosure is applied; Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded; Figure 4 is a diagram showing a form of a prediction unit (PU) that a coding unit (CU) can include; Figure 5 is a diagram showing a form of a transform unit (TU) that can be included in a CU; Figure 6 shows the partitioning of blocks according to an example; Figure 7 is a diagram for explaining an embodiment of an intra prediction process; Figure 8 is a diagram showing reference samples used in an intra prediction process; Fig. 9 is a diagram for explaining an embodiment of an inter-frame prediction process; Fig.10 shows spatial candidates according to an embodiment; Fig.11 shows the order in which motion information of spatial candidates is added to a merge list according to an embodiment; Fig.12 shows a transform and quantization process according to an example; Fig.13 shows a diagonal scan according to an example; Fig.14 shows a horizontal scan according to an example; Fig.15 shows vertical scanning according to an example; Fig.16 is a configuration diagram of an encoding device according to an embodiment; Fig.17 is a configuration diagram of a decoding device according to an embodiment; Fig.18 is a flowchart of an image encoding / decoding method, apparatus, and recording medium having a bitstream stored therein according to an example; Fig.19 shows the ratio between the distance tb between the current image and the reference picture of the current image and the distance (td) between the reference block and the reference picture of the reference block; Fig. 20 shows scaling factors according to examples; FIG. 21 shows a condition determined by comparison with a threshold value according to an example; FIG22 illustrates a template matching template configuration according to an example; Fig.23 shows a configuration of a bilateral matching template according to an example; FIG24 illustrates a template matching template and a bilateral matching template according to an example; 25 illustrates a template configuration when intra prediction is performed on an inter picture and a template configuration when inter prediction is performed on an inter picture according to an example; FIG26 shows a current picture and a reference picture according to an example; Fig. 27showing a current block and neighboring blocks of the current block according to an example; Fig.28 showing a current block and neighboring blocks of the current block according to an example; Fig.29 showing a current block and neighboring blocks of the current block according to an example; Fig.30 showing a current block and neighboring blocks of the current block according to an example; Fig.31 showing a current block and neighboring blocks of the current block according to an example; Fig.32 showing a current block and neighboring blocks of the current block according to an example; Fig.33 showing a current block and neighboring blocks of the current block according to an example; Fig.34 showing a current block and neighboring blocks of the current block according to an example; Fig.35 showing a current block and neighboring blocks of the current block according to an example; Fig.36 showing a current block and neighboring blocks of the current block according to an example; Fig.37 showing a current block and neighboring blocks of the current block according to an example; Fig.38 showing a current block and neighboring blocks of the current block according to an example; Fig.39 showing a current block and neighboring blocks of the current block according to an example; Fig.40 showing a current block and neighboring blocks of the current block according to an example; FIG41 shows a current picture and a reference picture according to an example; FIG. 42 shows a basic pattern and pattern configuration based on a block partitioning format according to an example; FIG. 43 illustrates a pattern configuration based on the position of a current block in a CTU according to an example; 44 illustrates a radial pattern, a case where the number of referenceable neighboring blocks is equal to or greater than a threshold, and a case where the number of referenceable neighboring blocks is less than or equal to the threshold according to an example; FIG. 45 illustrates a case where the number of referenceable neighboring blocks is equal to or greater than a threshold value and a case where the number of referenceable neighboring blocks is less than or equal to the threshold value according to an example; FIG. 46 shows the calculation of the referenceable blocks in each direction with reference to the number of blocks located on the extension line of the contact surface according to an example; FIG47 illustrates partitioned areas according to an example; Fig.48 showing candidate motion vectors and neighboring motion vectors according to an example; Fig.49 An equation showing a combination of usage weights according to an example; FIG50 illustrates BCW index-based weights and error cost-based weights according to an example; FIG51 illustrates a configuration of a plurality of candidate lists based on block classification according to an example; FIG. 52 illustrates a configuration of a plurality of candidate lists based on block classification according to an example; FIG. 53 illustrates an example of integrating multiple candidate lists based on block classification according to an example; FIG. 54 illustrates an example of sorting after integrating a plurality of candidate lists according to an example; FIG. 55 shows an example of integration after sorting in units of candidate lists according to an example; FIG. 56 illustrates an example of selecting and integrating candidates from a plurality of candidate lists according to an example; Fig.57 Determination of block information of a candidate in a candidate list used in a process of encoding / decoding a current block according to an example is shown; Fig.58 is an operation flow chart of an image encoding method according to an embodiment; and Fig.59 is an operation flow chart of an image decoding method according to an embodiment.
[0017] Best Mode The embodiments of the present specification can be summarized as follows.
[0018] According to an embodiment of the present specification, an image decoding method may include: constructing a candidate list related to the prediction of a current block; generating a prediction block of the current block based on a candidate selected from the candidate list; and generating a reconstructed block of the current block based on the prediction block, wherein constructing the candidate list includes adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block.
[0019] In an embodiment, the non-adjacent blocks may include blocks on a plurality of straight lines radiating at an angular interval of 22.5 degrees between an angle of 45 degrees and an angle of 225 degrees with a reference to the current block in the current picture to which the current block belongs, and blocks on a plurality of straight lines radiating at an angular interval of 45 degrees between an angle of 270 degrees and an angle of 360 degrees with a reference to the col block corresponding to the current block in the reference picture.
[0020] In an embodiment, constructing the candidate list may further include adding a fourth candidate, which is a block in intra block copy mode, to the candidate list.
[0021] In an embodiment, constructing the candidate list may include calculating, for the fourth candidate, a matching cost of a template including samples in an upper row and a left column of the block.
[0022] In an embodiment, the fourth candidate may include an upper right neighboring block, an upper left neighboring block, and a lower left neighboring block of the current block.
[0023] In an embodiment, constructing the candidate list may further include selecting at least one candidate from the candidates included in the candidate list; obtaining multiple refined motion information corresponding to multiple refined positions, wherein the multiple refined positions are spaced apart from the initial positions related to the first motion information of the selected at least one candidate; calculating a template matching cost for each of the multiple refined motion information; and selecting one or more of the multiple refined motion information according to an ascending order of the calculated template matching costs, and adding the selected refined motion information to the candidate list.
[0024] In an embodiment, the plurality of refined positions may include one or more positions on each of a plurality of straight lines radiating from the initial position at predetermined angular intervals.
[0025] In an embodiment, the one or more positions on each of the straight lines may include a plurality of positions at gradually increasing distances from the initial position.
[0026] In an embodiment, the plurality of straight lines may be two straight lines in a direction obtained by adding an angle of 45 degrees to an angle that is a multiple of 90 degrees, and the refinement position may be a position spaced apart from the initial position by the same first distance in the x and y directions.
[0027] In an embodiment, the first distance may be determined based on the accuracy of the first motion information.
[0028] In an embodiment, the template used for the template matching cost may include samples in an upper row and a left column of the block.
[0029] In an embodiment, when the current block is a rectangle having one side that is two times longer than the other side or more, the template used for the template matching cost may include only samples adjacent to the longer side.
[0030] In an embodiment, constructing the candidate list may include not adding a candidate having a template matching cost greater than a reference value as a candidate to the candidate list.
[0031] In an embodiment, the reference value may be set based on a template matching cost of a first candidate in the candidate list.
[0032] In an embodiment, constructing the candidate list may further include sorting the positions of the added candidates based on the template matching cost.
[0033] In an embodiment, the sorting may include moving the candidate with zero motion information to a last rank in the candidate list and / or excluding the candidate with zero motion information in the operation of sorting the positions of the candidates.
[0034] In an embodiment, the sorting may include: obtaining the difference in template matching costs of a pair of two adjacent candidates included in the candidate list and determining a minimum value among the differences; and when the minimum value is less than a reference value, moving at least one candidate in the pairing corresponding to the minimum value to the next position.
[0035] In an embodiment, the sorting may further include stopping the sorting operation when the minimum value is greater than the reference value.
[0036] According to another embodiment of the present specification, an image encoding method may include: constructing a candidate list related to the prediction of a current block; generating a prediction block of the current block based on a candidate selected from the candidate list; and generating a residual block of the current block based on the prediction block, wherein constructing the candidate list includes adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block.
[0037] According to another embodiment of the present disclosure, a computer-readable storage medium may store a bit stream for picture information generated by executing an image encoding method, wherein the image encoding method may include: constructing a candidate list related to a prediction of a current block; generating a prediction block of the current block based on a candidate selected from the candidate list; and generating a residual block of the current block based on the prediction block, wherein constructing the candidate list may include: adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block. DETAILED DESCRIPTION
[0038] The present invention can be variously changed and can have various embodiments, and specific embodiments will be described in detail below with reference to the accompanying drawings. However, it should be understood that these embodiments are not intended to limit the present invention to a specific disclosed form, and they include all changes, equivalent forms or modified forms included in the spirit and scope of the present invention.
[0039] The following exemplary embodiments will be described in detail with reference to the accompanying drawings showing specific embodiments. These embodiments are described so that those of ordinary skill in the art to which the present disclosure belongs can easily implement these 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 can be implemented as the other embodiments without departing from the spirit and scope of other embodiments associated with one embodiment. In addition, it should be understood that the position or arrangement of the various components in each disclosed embodiment can be changed without departing from the spirit and scope of the embodiments. Therefore, the attached detailed description is not intended to limit the scope of the present disclosure, and the scope of the exemplary embodiments is limited only by the attached claims and their equivalents (as long as they are properly described).
[0040] 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.
[0041] Terms such as "first" and "second" may be used to describe various components, but the components are not limited by the terms. The 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 referred to as a second component. Similarly, a second component may be referred to as a first component. The term "and / or" may include a combination of multiple related description items or any one of multiple related description items.
[0042] 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 intervening components 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 intervening components between the two components.
[0043] In addition, the components described in the embodiments are shown independently to indicate different characteristic functions, but this does not mean that each component is formed by a separate hardware or software. That is, for the convenience of description, multiple components are arranged and included separately. For example, at least two components in the multiple components can be integrated into a single component. On the contrary, a component can be divided into multiple components. As long as it does not depart from the essence of this specification, embodiments in which multiple components are integrated or embodiments in which some components are separated are included in the scope of this specification.
[0044] The terms used in the embodiments are only used to describe specific embodiments and are not intended to limit the present invention. Singular expressions include plural expressions unless the contrary description is specifically pointed out in the context. In an embodiment, 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 combinations thereof, and are not intended to exclude the possibility of having or adding one or more other features, numbers, steps, operations, components, parts or combinations thereof. That is, in an embodiment, the expression that describes a component "including" a specific component means that other components may be included in the practice of the present invention or the scope of the technical spirit of the present invention, but does not exclude the presence of components other than the specific components.
[0045] In an embodiment, the term "at least one" may mean one of one or more quantities (such as 1, 2, 3, and 4). In an embodiment, the term "plurality" may mean one of two or more quantities (such as 2, 3, and 4).
[0046] Some components of the embodiment are not essential components for performing essential functions, but may be optional components only for 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 (excluding optional components only for improving performance) is also included in the scope of the embodiment.
[0047] The embodiments will be described in detail below with reference to the accompanying drawings so that a person skilled in the art can easily implement the embodiments. In the following description of the embodiments, a detailed description of well-known functions or configurations that are considered to obscure the main points of this specification will be omitted. In addition, the same reference numerals are used throughout the drawings to designate the same components, and repeated descriptions of the same components will be omitted.
[0048] Hereinafter, "image" may refer to a single picture constituting a video, or may refer to the video itself. For example, "encoding and / or decoding an image" may refer to "encoding and / or decoding a video", and may also refer to "encoding and / or decoding any one of a plurality of images constituting a video".
[0049] Hereinafter, the terms "video" and "moving picture" may be used to have the same meaning and may be used interchangeably with each other.
[0050] Hereinafter, the 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.
[0051] Hereinafter, the terms “image”, “picture”, “frame”, and “screen” may be used to have the same meaning and may be used interchangeably with each other.
[0052] Hereinafter, the target block may be an encoding target block (i.e., a target to be encoded) and / or a decoding target block (i.e., a target to be decoded). In addition, the target block may be a current block, i.e., a target to be currently encoded and / or decoded. 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 refer to 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.
[0053] 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.
[0054] Hereinafter, the terms "region" and "segment" may be used interchangeably with each other.
[0055] 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.
[0056] When a variable such as i or j is used to indicate a row, column, or index, the value i may be an integer 0 or an integer greater than 0, or may be an integer 1 or an integer greater than 1. In other words, in an embodiment, each of the row, column, and index may be counted starting from 0, or may be counted starting from 1.
[0057] 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.”
[0058] Hereinafter, terms to be used in the embodiments will be described.
[0059] Encoder: An encoder refers to a device for performing encoding. In other words, an encoder may refer to an encoding device.
[0060] Decoder: A decoder refers to a device for performing decoding. That is, a decoder may refer to a decoding apparatus.
[0061] 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.
[0062] – A cell may be an M×N array of samples. Each of M and N may be a positive integer. A cell may generally represent an array of samples in two-dimensional form.
[0063] – In the encoding and decoding process 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 a unit may represent each partitioned sub-part when encoding or decoding is performed on the partitioned sub-parts.
[0064] – During the encoding and decoding of an image, a predefined process may be performed on each unit according to the type of the unit.
[0065] – 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.
[0066] - 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 such that the unit is designated to be distinguished from the block.
[0067] – The size and shape of the unit may be implemented differently. In addition, the unit may have any of various sizes and shapes. Specifically, the shape of the unit may include not only a square but also a geometric shape that can be represented in two dimensions (2D), such as a rectangle, a trapezoid, a triangle, and a pentagon.
[0068] 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.
[0069] – A cell may be partitioned into sub-cells, each sub-cell having a size smaller than that of the associated cell.
[0070] Depth: Depth may indicate the degree to which a cell is partitioned. In addition, the depth of a cell may indicate the level at which the corresponding cell exists when the cell is represented by a tree structure.
[0071] - The cell partition information may include a depth indicating a depth of the cell. The depth may indicate a number of times the cell is partitioned and / or an extent to which the cell is partitioned.
[0072] – 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.
[0073] – A single unit may be hierarchically partitioned into a plurality of subunits, and the single unit has 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 partitioned subunit 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 a subunit may include information about the size of the subunit.
[0074] 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 depth of the top node may be level "0".
[0075] - A node with a depth level of "1" may represent a cell generated when the initial cell is partitioned once. A node with a depth level of "2" may represent a cell generated when the initial cell is partitioned twice.
[0076] - A leaf node at depth level "n" may represent a cell generated when the initial cell is partitioned n times.
[0077] - A leaf node may be a bottom node that cannot be partitioned further. The depth of a leaf node may be a maximum level. For example, a predefined value for the maximum level may be 3.
[0078] –QT depth may represent the depth for a four-partition. BT depth may represent the depth for a two-partition. TT depth may represent the depth for a three-partition.
[0079] – Sample: Sample can be the basic unit of a block. Available from 0 to 2 according to the bit depth (Bd). Bd A value of -1 is used to represent a sample point.
[0080] – Samples can be pixels or pixel values.
[0081] - Hereinafter, the terms "pixel" and "sample" may be used to have the same meaning and may be used interchangeably with each other.
[0082] Coding Tree Unit (CTU): A CTU may be composed of a single luma component (Y) coding tree block and two chroma components (ie, Cb, Cr) coding tree blocks related to the luma component coding tree block. In addition, a CTU may represent information including the above blocks and syntax elements for each block.
[0083] – 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 configure sub-units such as coding units, prediction units, and transform units. The quadtree may represent a quadtree. In addition, each coding tree unit may be partitioned using a multi-type tree (MTT) using one or more partitioning methods.
[0084] – “CTU” may be used as a term to designate a pixel block as a processing unit in image decoding and encoding processes (such as in the case of partitioning an input image).
[0085] 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.
[0086] Neighboring block: A neighboring block (or neighboring block) may refer to a block adjacent to a target block. A neighboring block may refer to a reconstructed neighboring block.
[0087] Hereinafter, the terms “neighboring block” and “adjacent block” may be used to have the same meaning and may be used interchangeably with each other.
[0088] The neighboring block may represent a reconstructed neighboring block.
[0089] Spatial neighboring blocks: Spatial neighboring blocks may be blocks that are spatially adjacent to the target block. Neighboring blocks may include spatial neighboring blocks.
[0090] – A target block and spatially neighboring blocks may be included in a target picture.
[0091] - The 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.
[0092] - A spatially adjacent block may refer to a block adjacent to a vertex of the target block. Here, a block adjacent to a vertex of the target block may refer to 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.
[0093] Temporally neighboring blocks: Temporally neighboring blocks may be blocks that are temporally adjacent to the target block. Neighboring blocks may include temporally neighboring blocks.
[0094] – Temporally neighboring blocks may include co-located blocks (col blocks).
[0095] – 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 the reference picture list.
[0096] - The temporal neighboring block may be a block temporally adjacent to the spatial neighboring block of the target block.
[0097] Prediction mode: The prediction mode may be information indicating a mode for intra prediction or a mode for inter prediction.
[0098] 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.
[0099] - A single prediction unit can be divided into multiple partitions or sub-prediction units with smaller sizes. The multiple partitions can also be basic units when performing prediction or compensation. Partitions generated by dividing a prediction unit can also be prediction units.
[0100] Prediction unit partition: A prediction unit partition may be a shape into which a prediction unit is divided.
[0101] Reconstructed neighboring unit: The reconstructed neighboring unit may be a unit that is neighboring to the target unit and has been decoded and reconstructed.
[0102] - The reconstructed neighboring cell may be a cell that is spatially adjacent to the target cell or temporally adjacent to the target cell.
[0103] - The reconstructed spatially neighboring unit may be a unit included in the target picture that has been reconstructed through encoding and / or decoding.
[0104] –The reconstructed temporally adjacent unit may be a unit included in a reference image and which 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 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.
[0105] 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.
[0106] - A sub-picture may be an area having a square shape or a rectangular (ie, non-square rectangular) shape in a picture. In addition, a sub-picture may include one or more CTUs.
[0107] - A sub-picture can be a rectangular area of one or more slices in a picture.
[0108] - A sub-picture may include one or more tiles, one or more bricks and / or one or more slices.
[0109] Tile: A tile may be an area in a picture having a square shape or a rectangular (ie, a non-square rectangle) shape.
[0110] – A tile may include one or more CTUs.
[0111] – A parallel block can be partitioned into one or more partitions.
[0112] Block: A block may represent one or more CTU rows in a tile.
[0113] – A tile can be partitioned into one or more partitions. Each partition can include one or more CTU rows.
[0114] – Parallel blocks that are not partitioned into two parts can also represent partitions.
[0115] Slice: A slice may include one or more tiles in a picture. Alternatively, a slice may include one or more partitions in a tile.
[0116] - A sub-picture may consist of 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.
[0117] Parameter set: A parameter set may correspond to header information in the internal structure of a bitstream.
[0118] 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), and the like.
[0119] – 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.
[0120] – Each parameter set can refer to a higher parameter set. For example, PPS can refer to SPS. SPS can refer to VPS.
[0121] – 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”.
[0122] Rate-distortion optimization: The encoding device may use rate-distortion optimization in order to provide high encoding efficiency by utilizing a combination of the following items: 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).
[0123] – The rate-distortion optimization scheme can calculate the rate-distortion cost of each combination to select the best combination from these combinations. The equation “ " is used to calculate the rate-distortion cost. Generally, the combination that minimizes the rate-distortion cost can be selected as the optimal combination under the rate-distortion optimization scheme.
[0124] – D may represent distortion. D may be the average 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).
[0125] – R may represent the rate, which may use relevant context information to represent the bit rate.
[0126] – R may include not only encoding parameter information such as prediction mode, motion information, and coding block flag, but also bits generated by encoding transform coefficients.
[0127] – The encoding device may perform processes such as inter-frame prediction and / or intra-frame prediction, transformation, quantization, entropy coding, inverse quantization (dequantization) and / or inverse transformation in order to calculate accurate D and R. These processes may greatly increase the complexity of the encoding device.
[0128] – Bitstream: A bitstream may refer to a stream of bits including encoded image information.
[0129] 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 refer to such entropy decoding itself.
[0130] 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.
[0131] 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.
[0132] Hereinafter, the terms 'reference picture' and 'reference image' may be used to have the same meaning and may be used interchangeably with each other.
[0133] Reference picture list: A reference picture list may be a list including one or more reference images used for inter prediction or motion compensation.
[0134] – The types of reference picture lists may include combined list (LC), list 0 (L0), list 1 (L1), list 2 (L2), list 3 (L3), etc.
[0135] – For inter prediction, one or more reference picture lists may be used.
[0136] 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.
[0137] 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.
[0138] – 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 inter prediction indicator. For example, the case where the prediction list utilization flag indicates “0” (as a first value) may indicate that for a target unit, a reference picture in a reference picture list is not used to generate a prediction block. The case where the prediction list utilization flag indicates “1” (as a second value) may indicate that for a target unit, a reference picture list is used to generate a prediction unit.
[0139] Reference picture index: A reference picture index may be an index indicating a specific reference picture in a reference picture list.
[0140] Picture Order Count (POC): The POC value of a picture may indicate the order in which the corresponding picture is displayed.
[0141] Motion Vector (MV): A motion vector can be a 2D vector used for inter-frame prediction or motion compensation. A motion vector can represent the offset between a target image and a reference image.
[0142] – For example, you can use (mv x , mv y ) to represent MV. x Can indicate horizontal component, mv y May indicate the vertical component.
[0143] - Search range: The search range may be a 2D area where a search for an MV is performed during inter prediction. For example, the size of the search range may be M×N. M and N may be positive integers, respectively.
[0144] Motion vector candidate: A motion vector candidate may be a block that is a prediction candidate when a motion vector is predicted or a motion vector of a block that is a prediction candidate.
[0145] – A motion vector candidate may be included in a motion vector candidate list.
[0146] Motion vector candidate list: A motion vector candidate list may be a list configured using one or more motion vector candidates.
[0147] 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.
[0148] 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.
[0149] Merge candidate list: A merge candidate list may be a list configured using one or more merge candidates.
[0150] Merge candidate: The merge candidate may be a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-predictive merge candidate, a history-based candidate, an average merge candidate based on an average of two candidates, a zero merge candidate, etc. The merge candidate 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 an inter prediction indicator.
[0151] Merge index: The merge index may be an indicator for indicating a merge candidate in the merge candidate list.
[0152] – The merge index may indicate a reconstructed unit for deriving a merge candidate among reconstructed units spatially adjacent to the target unit and reconstructed units temporally adjacent to the target unit.
[0153] – The merge index may indicate at least one of a plurality of pieces of motion information of a merge candidate.
[0154] 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 smaller sizes. 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.
[0155] Scaling: Scaling can be referred to as the process of multiplying the factors by the levels of the transform coefficients.
[0156] – As a result of scaling the transform coefficient levels, transform coefficients may be generated. Scaling may also be referred to as "inverse quantization".
[0157] Quantization parameter (QP): A quantization parameter may be a value used to generate transform coefficient levels for transform coefficients in quantization. Alternatively, a quantization parameter may also be a value used to generate transform coefficients by scaling the transform coefficient levels in inverse quantization. Alternatively, a quantization parameter may be a value mapped to a quantization step size.
[0158] Delta quantization parameter: Delta quantization parameter represents the difference between the target unit's quantization parameter and the predicted quantization parameter.
[0159] Scanning: Scanning may refer to a method of arranging the order of coefficients in a cell, block, or matrix. For example, a method for arranging a 2D array in the form of a one-dimensional (1D) array may be referred to as "scanning". Alternatively, a method for arranging a 1D array in the form of a 2D array may also be referred to as "scanning" or "inverse scanning".
[0160] 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.
[0161] - A quantized level or a quantized transform coefficient level generated by applying quantization to a transform coefficient or a residual signal may also be included in the meaning of the term "transform coefficient".
[0162] Quantization level: The quantization level may be a value generated when the encoding device performs quantization on the transform coefficient or the residual signal. Alternatively, the quantization level may be a value that is a target of inverse quantization when the decoding device performs inverse quantization.
[0163] - A quantized transform coefficient level as a result of transform and quantization may also be included in the meaning of the quantization level.
[0164] Non-zero transform coefficient: A non-zero transform coefficient may be a transform coefficient having a value other than 0, or may be a transform coefficient level having a value other than 0. Alternatively, a non-zero transform coefficient may be a transform coefficient having a value with a magnitude other than 0, or may be a transform coefficient level having a value with a magnitude other than 0.
[0165] Quantization matrix: A quantization matrix may be a matrix used in a quantization process or an inverse quantization process in order to improve the subjective image quality or the objective image quality of an image. A quantization matrix may also be referred to as a "scaling list".
[0166] Quantization matrix coefficient: A quantization matrix coefficient can be each element in the quantization matrix. A quantization matrix coefficient can also be referred to as a "matrix coefficient".
[0167] Default matrix: The default matrix may be a quantization matrix predefined by an encoding device and a decoding device.
[0168] Non-default matrix: A non-default matrix may be a quantization matrix that is not pre-defined by the encoding device and the decoding device. The non-default matrix may represent a quantization matrix that is signaled by a user from the encoding device to the decoding device.
[0169] Most Probable Mode (MPM): The MPM may represent an intra prediction mode that is highly likely to be used for intra prediction for a target block.
[0170] The encoding apparatus and the decoding apparatus may determine one or more MPMs based on encoding parameters related to the target block and properties of an entity related to the target block.
[0171] 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 spatial neighboring block adjacent to the left side of the target block and a spatial neighboring 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.
[0172] - One or more MPMs may be determined in the same manner in both 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.
[0173] 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.
[0174] MPM indicator: The MPM indicator may indicate an MPM to be used for intra prediction for a target block among one or more MPMs in the MPM list. For example, the MPM indicator may be an index for the MPM list.
[0175] - Since the MPM list is determined in the same manner in both the encoding device and the decoding device, there may be no need to transmit the MPM list itself from the encoding device to the decoding device.
[0176] – The MPM indicator may be signaled from the encoding apparatus to the decoding apparatus. Since the MPM indicator is signaled, the decoding apparatus may determine an MPM to be used for intra prediction for a target block among the MPMs in the MPM list.
[0177] MPM usage indicator: The MPM usage indicator may indicate whether an MPM usage mode is to be used for prediction for a target block. The MPM usage mode may be a mode of determining an MPM to be used for intra prediction for a target block using an MPM list.
[0178] – The MPM usage indicator may be signaled from the encoding device to the decoding device.
[0179] Signaling: "Signaling" may mean that information is sent from an encoding device to a decoding device. Alternatively, "signaling" may mean that information is included in a bitstream or a recording medium by an encoding device. Information signaled by an encoding device may be used by a decoding device.
[0180] – The encoding device may generate encoding information by performing encoding on information to be transmitted by a signal. The encoding information may be transmitted 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.
[0181] Selective signaling: Information can be selectively signaled. Selective signaling for information may mean that an encoding device selectively includes information in a bitstream or a recording medium (according to certain conditions). Selective signaling for information may mean that a decoding device selectively extracts information from a bitstream (according to certain conditions).
[0182] Omission of signaling: Signaling for information may be omitted. Regarding information, the omission of signaling for information may mean that the encoding device does not include the information in the bitstream or recording medium (according to certain conditions). The omission of signaling for information may mean that the decoding device does not extract the information from the bitstream (according to certain conditions).
[0183] Statistic: A variable, encoding parameter, constant, etc. may have a computable value. A statistic may be a value generated by performing a calculation (operation) on the value of a specified target. For example, a statistic may indicate one or more of the average, weighted average, weighted sum, minimum, maximum, mode, median, and interpolated values of the values of a particular variable, a particular encoding parameter, a particular constant, etc.
[0184] Figure 1 is a block diagram showing a configuration of an embodiment of an encoding device to which the present disclosure is applied.
[0185] 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.
[0186] The encoding device may generate encoding information by encoding information to be sent 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 received encoding information. Here, the encoding may be entropy encoding, and the decoding may be entropy decoding.
[0187] 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.
[0188] The encoding apparatus 100 may perform encoding on the target image using the intra mode and / or the inter mode. In other words, the prediction mode of the target block may be one of the intra mode and the inter mode.
[0189] Hereinafter, the terms “intra mode”, “intra prediction mode”, “intra-screen mode” and “intra prediction mode” may be used to have the same meaning and may be used interchangeably with each other.
[0190] 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.
[0191] 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.
[0192] In addition, the encoding device 100 can generate a bit stream including the encoded information by encoding the target image, and can output and store the generated bit stream. The generated bit stream can be stored in a computer-readable storage medium and can be streamed through a wired and / or wireless transmission medium.
[0193] 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.
[0194] The encoding apparatus 100 may generate a prediction block of the target block. Also, after having generated the prediction block, the encoding apparatus 100 may encode a residual block for the target block using a residual between the target block and the prediction block.
[0195] 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 represent samples in the prediction block.
[0196] The inter prediction unit 110 may include a motion prediction unit and a motion compensation unit.
[0197] When the prediction mode is the inter mode, the motion prediction unit may search for an area that best matches the target block in the reference image 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.
[0198] The reference image may be stored in the reference picture buffer 190. More specifically, when encoding and / or decoding of a reference image has been processed, the encoded and / or decoded reference image may be stored in the reference picture buffer 190.
[0199] Since the decoded pictures are stored, the reference picture buffer 190 may be a decoded picture buffer (DPB).
[0200] 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.
[0201] 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 mode of the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode corresponds to a method for predicting and compensating the motion of a PU included in the CU based on the CU, and inter prediction or motion compensation may be performed according to the mode.
[0202] The subtractor 125 may generate a residual block, which is a difference between the target block and the prediction block. The residual block may also be referred to as a "residual signal".
[0203] The residual signal may be the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the predicted signal or a signal generated by transforming and quantizing the difference. The residual block may be a residual signal for a block unit.
[0204] 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.
[0205] The transform unit 130 may use one of a plurality of predefined transform methods when performing the transform.
[0206] The plurality of predefined transform methods may include discrete cosine transform (DCT), discrete sine transform (DST), Karhunen-Loeve transform (KLT), and the like.
[0207] 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. Optionally, transform information indicating the transform method may be sent from the encoding device 100 to the decoding device 200 using a signal.
[0208] When the transform skip mode is used, the transform unit 130 may omit the operation of transforming the residual block.
[0209] By performing quantization on the transform coefficient, a quantized transform coefficient level or a quantized level may be generated. Hereinafter, in an embodiment, each of the quantized transform coefficient level and the quantized level may also be referred to as a 'transform coefficient'.
[0210] The quantization unit 140 may generate a quantized transform coefficient level (ie, a quantized level or a quantized 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.
[0211] 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.
[0212] The entropy encoding unit 150 may perform entropy encoding on information about pixels of an image and information required for decoding the image. For example, the information required for decoding the image may include syntax elements and the like.
[0213] 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 for the target symbol to be encoded can be reduced. Therefore, the compression performance of video coding can be improved by entropy coding.
[0214] In addition, in order to perform 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 / bin. The entropy coding unit 150 may perform arithmetic coding using the derived binarization method, probability model, and context model.
[0215] 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.
[0216] 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 sent 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 sent to the decoding device may include syntax elements.
[0217] The coding parameters may include not only information (or flags or indexes) such as syntax elements that are encoded by the coding device and sent by the coding device to the decoding device using a signal, but also information derived in the coding or decoding process. In addition, the coding parameters may include information required for encoding or decoding an image. For example, the coding parameters may include at least one value of the following items, a combination of the following items, or statistics: 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), symmetric 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 partitioning or asymmetric partitioning, 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 point filtering method, a reference sample point filter tap, a reference sample point filter coefficient, a prediction block filtering method , prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, inter-frame prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter-frame prediction direction, inter-frame 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 merge mode is used, merge index, merge candidate, merge candidate list, information indicating whether skip mode is used, type of interpolation filter, taps of interpolation filter, interpolation filter filter coefficient of a loop filter, size of a motion vector, accuracy of motion vector representation, transform type, transform size, information indicating whether a first transform is used, information indicating whether an additional (second) transform is used, first transform selection information (or first transform index), second transform selection information (or second transform index), information indicating the presence or absence of a residual signal, a coding block pattern, a coding block flag, a quantization parameter, a residual quantization parameter, a quantization matrix, information about a loop filter, information indicating whether a loop filter is applied, coefficients of a loop filter, taps of a loop filter, a shape / form of a loop filter, information indicating whether a deblocking filter is applied,Coefficients of a 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 loop filter is applied, coefficients of an adaptive loop filter, taps of an adaptive loop filter, shape / form of an adaptive loop filter, binarization / debinarization method, context model, context model determination method, context model update method, information indicating whether a normal mode is executed, information indicating whether a bypass mode is executed, a valid coefficient flag, a last valid coefficient flag, a coding flag of a coefficient group, 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, positive and negative sign information, reconstructed luminance samples, reconstructed chrominance samples, context binary bits , bypass binary bits, residual 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 reconstruction 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 encoding parameter related information may also be included in the encoding parameters. Information used to calculate and / or derive the above-mentioned encoding parameters may also be included in the encoding parameters. Information calculated or derived using the above encoding parameters may also be included in the encoding parameters.
[0218] The first transform selection information may indicate a first transform applied to the target block.
[0219] The second transform selection information may indicate a second transform applied to the target block.
[0220] 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 a residual signal for a block.
[0221] Here, signaling information may mean that the encoding device 100 includes entropy-coded information generated by performing entropy coding on a flag or an index in a bitstream, and may mean that the decoding device 200 obtains information by performing entropy decoding on the entropy-coded information extracted from the bitstream. Here, the information may include a flag, an index, etc.
[0222] 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.
[0223] The bitstream may include information based on a specific syntax. The encoding apparatus 100 may generate a bitstream including information according to the specific syntax. The decoding apparatus 200 may acquire information from the bitstream according to the specific syntax.
[0224] Since the encoding apparatus 100 performs encoding via inter-frame prediction, the encoded target image can be used as a reference image for another image to be subsequently processed. 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 performed.
[0225] The quantized levels may be dequantized by the dequantization unit 160, and may be inversely transformed by the inverse transform unit 170. The dequantization unit 160 may generate dequantized coefficients by performing inverse transformation on the quantized levels. The inverse transform unit 170 may generate dequantized and inversely transformed coefficients by performing inverse transformation on the dequantized coefficients.
[0226] 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 represent a restored block or a decoded block.
[0227] The reconstructed block may be filtered by the filter unit 180. The filter unit 180 may apply one or more filters 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 a "loop filter".
[0228] The deblocking filter may eliminate block distortion occurring at boundaries between blocks in a reconstructed picture. To determine whether to apply the deblocking filter, the number of columns or rows of pixels included in the block and including the basis for determining whether to apply the deblocking filter to the target block may be determined.
[0229] 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.
[0230] Also, when vertical filtering and horizontal filtering are performed on the target block, the horizontal filtering and the vertical filtering may be performed in parallel.
[0231] SAO may add an appropriate offset to a pixel value in order to compensate for a coding error. SAO may perform correction on a pixel-based basis on an image to which deblocking is applied, wherein the correction uses an offset of the difference between the original image and the image to which deblocking is applied. In order to perform offset correction for an image, a method for dividing pixels included in an image into a specific number of regions, determining a region to which an offset is 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.
[0232] 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 signaled for each CU. Such information may be signaled 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.
[0233] 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 filtering of the target block may be performed using the statistical properties of the selected similar area. Information on whether to apply the non-local filter may be signaled for a coding unit (CU). In addition, the shape and filter coefficients of the non-local filter to be applied to the block may differ according to the block.
[0234] 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 then be used for inter-frame prediction or motion compensation.
[0235] Figure 2 is a block diagram showing a configuration of an embodiment of a decoding device to which the present disclosure is applied.
[0236] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0237] 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.
[0238] 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.
[0239] 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.
[0240] For example, an operation of switching to an intra mode or an inter mode based on a 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.
[0241] 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 to the prediction block.
[0242] 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., quantized levels or quantized coefficients). Here, the entropy decoding method may be similar to the entropy encoding method described above. That is, the entropy decoding method may be an inverse process of the entropy encoding method described above.
[0243] 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.
[0244] For example, the coefficients of the block can be changed into a 2D block shape by scanning the block coefficients using an upper right diagonal scan. 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.
[0245] The quantized coefficients may be dequantized by the dequantization unit 220. The dequantization unit 220 may generate dequantized coefficients by performing dequantization on the quantized coefficients. In addition, the dequantized 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 dequantized coefficients. As a result of performing dequantization and inverse transformation on the quantized coefficients, a reconstructed residual block may be generated. Here, when generating the reconstructed residual block, the dequantization unit 220 may apply a quantization matrix to the quantized coefficients.
[0246] When the intra mode is used, the intra prediction unit 240 may generate a prediction block by performing spatial prediction on a target block using pixel values of a previously decoded neighboring block adjacent to the target block.
[0247] 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."
[0248] 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 on the target block.
[0249] 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 mode 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.
[0250] 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 and the prediction block.
[0251] 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.
[0252] The filter unit may output a reconstructed image.
[0253] 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 then be used for inter-frame prediction or motion compensation.
[0254] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded.
[0255] Figure 3 An example where a single unit is partitioned into a plurality of sub-units may be schematically shown.
[0256] 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".
[0257] CU may be used as a basic unit for image encoding / decoding. CU may be used as a unit to which a mode selected from intra mode and inter mode is applied in image encoding / decoding. In other words, in image encoding / decoding, it may be determined which mode of intra mode and inter mode will be applied to each CU.
[0258] Also, a CU may be a basic unit for predicting, transforming, quantizing, inversely transforming, dequantizing, and encoding / decoding a transform coefficient.
[0259] 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, the LCU may be used to have the same meaning as a coding tree unit (CTU).
[0260] Partitioning a unit may mean partitioning a block corresponding to the unit. 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, while the single unit has depth information based on a tree structure.
[0261] Each partitioned sub-unit 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.
[0262] Each CU may have depth information. When a CU is partitioned, the depth of a CU generated from the partition may be increased by 1 from the depth of the partitioned CU.
[0263] The partition structure may represent 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 2 or more, including 2, 3, 4, 8, 16, etc.
[0264] According to the number of CUs generated by partitioning, the horizontal size and vertical size of each CU 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 CU generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning.
[0265] Each partitioned CU may be recursively partitioned into four CUs in the same manner. Compared to at least one of the horizontal size and the vertical size of the CU before partitioning, at least one of the horizontal size and the vertical size of each partitioned CU may be reduced through recursive partitioning.
[0266] Partitioning of the CU may be performed recursively up to a predefined depth or a predefined size.
[0267] For example, the depth of the CU may have a value ranging from 0 to 3. The size of the CU may range from a size of 64×64 to a size of 8×8 according to the depth of the CU.
[0268] 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.
[0269] Partitioning may begin at the LCU 310, and each time the horizontal and / or vertical dimensions of the CU are reduced by partitioning, the depth of the CU may increase by one.
[0270] For example, for each depth, a non-partitioned CU may have a size of 2N×2N. Also, in the case where the CU is partitioned, a CU of size 2N×2N may be partitioned into four CUs each of size N×N. Whenever the depth increases by 1, the value of N may be halved.
[0271] Reference Figure 3 , an LCU with a depth of 0 may have 64×64 pixels or a 64×64 block. 0 may be the minimum depth. An SCU with a depth of 3 may have 8×8 pixels or a 8×8 block. 3 may be the maximum depth. Here, a CU with a 64×64 block as an LCU may be represented by a depth of 0. A CU with a 32×32 block may be represented by a depth of 1. A CU with a 16×16 block may be represented by a depth of 2. A CU with an 8×8 block as an SCU may be represented by a depth of 3.
[0272] Information about whether the corresponding CU is partitioned can be represented by the partition information of the CU. The partition information can 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".
[0273] 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 of the horizontal size and vertical size of the CU before partitioning. When a CU of size 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 can be considered that the CU has been partitioned in a quadtree structure. In other words, it can be considered that quadtree partitioning has been applied to the CU.
[0274] 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 of size 32×32 is partitioned vertically into two CUs, the size of each of the two partitioned CUs may be 16×32. When a CU of size 32×32 is partitioned horizontally into two CUs, the size of each of the two partitioned CUs 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.
[0275] 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 of size 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 of size 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.
[0276] Both quadtree partitioning and binary tree partitioning are applied to Figure 3 LCU 310.
[0277] 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 through 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.
[0278] Through recursive partitioning of CUs, the optimal partitioning method that incurs the minimum rate-distortion penalty can be selected.
[0279] Figure 3 A coding tree unit (CTU) 320 in FIG. 1 is an example of a CTU to which quadtree partitioning, binarytree partitioning, and ternarytree partitioning are all applied.
[0280] 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.
[0281] For example, quadtree partitioning may be preferentially applied to CTUs. CUs that cannot be further partitioned in the form of a quadtree may correspond to leaf nodes of the quadtree. CUs corresponding to leaf nodes of the quadtree may be root nodes of a binary tree and / or a ternary tree. That is, CUs corresponding to leaf nodes of the 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 binary tree partitioning or ternary tree partitioning to a CU corresponding to a leaf node of the quadtree is prevented from being partitioned by the quadtree again, thereby effectively performing operations of partitioning blocks and / or signaling block partition information.
[0282] 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).
[0283] 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.
[0284] 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 according to the 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 according to the multi-type tree is performed, partition direction information, and partition tree information may be sequentially signaled.
[0285] 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 form. 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 form.
[0286] 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.
[0287] The partition direction information may indicate the partition direction of the multi-type tree partition. The partition direction information having a first value (eg, "1") may indicate that the corresponding CU is partitioned in the vertical direction. The partition direction information having a second value (eg, "0") may indicate that the corresponding CU is partitioned in the horizontal direction.
[0288] When a CU corresponding to each node of the multi-type tree is partitioned in the form of a multi-type tree, the corresponding CU may further include partition tree information. The partition tree information may indicate a tree used for multi-type tree partitioning.
[0289] 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.
[0290] Here, each of the above-mentioned information indicating whether partitioning by 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).
[0291] At least one of the above-mentioned four partition information, the information indicating whether partitioning by a multi-type tree is performed, the partition direction information, and the partition tree information may be entropy encoded and / or entropy decoded. In order to perform entropy encoding / entropy decoding of such information, information of a neighboring CU adjacent to the target CU may be used.
[0292] 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 is likely to be similar to the partition form of the target CU. 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: 1) four partition information of the neighboring CU, 2) information indicating whether the neighboring CU is partitioned according to a multi-type tree, 3) partition direction information of the neighboring CU, and 4) partition tree information of the neighboring CU.
[0293] In another embodiment of binary tree partitioning and ternary tree partitioning, binary tree partitioning may be performed preferentially. That is, 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, quadtree partitioning or binary tree partitioning may not be performed on the CU corresponding to the node of the ternary tree.
[0294] A CU that is not further partitioned by quadtree partitioning, binary tree partitioning, and / or ternary tree partitioning may be a unit of 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) / or a transformation unit (TU), its partition information, and the like may not be present in the bitstream.
[0295] 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.
[0296] 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 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 vertically bisected. In addition, when the vertical size of the CU is larger than the vertical size of the largest transform block, the CU may be horizontally bisected.
[0297] 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 level higher than the level of the CU. 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.
[0298] 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 level higher than the level of the CU. 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 of the intra-slice level and the inter-slice level.
[0299] 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 level higher 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 of the CTU and the information of the difference. 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.
[0300] 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.
[0301] Based on the various block sizes and depths described above, quad partition information, information indicating whether partitioning by a multi-type tree is performed, partition tree information, and / or partition direction information may or may not exist in a bitstream.
[0302] 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 the second value.
[0303] For example, when the size (horizontal size and vertical size) of the CU corresponding to each node of the multi-type tree is larger 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. Through this determination, information indicating whether partitioning by the multi-type tree is performed may not be signaled, but may be inferred as a second value.
[0304] 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 the binary tree form and / or the ternary tree form. Through this determination method, information indicating whether partitioning by the multi-type tree is performed may not be sent by a signal, but may be inferred as a second value. The reason is that when the CU is partitioned in the binary tree form and / or the 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.
[0305] 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 do not fit into the size of a pipeline buffer by binary tree partitioning or ternary tree partitioning, the 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).
[0306] For example, when the size of the pipeline buffer is 64×64, the following partitions may be limited.
[0307] - Ternary partitioning for N×M CUs (where N and / or M is 128) - Horizontal binary tree partitioning for 128×N CUs (where N<=64) - Vertical binary tree partitioning for N×128 CUs (where N<=64) 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. Through this determination, information indicating whether partitioning by a multi-type tree is performed may not be sent by a signal, but may be inferred as a second value.
[0308] Optionally, 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 the CU corresponding to each node of the multi-type tree, information indicating whether partitioning by the multi-type tree is performed may be sent by a signal. Otherwise, the CU may not be partitioned in a binary tree form and / or a ternary tree form. Through this determination, information indicating whether partitioning by the multi-type tree is performed may not be sent by a signal, but may be inferred as a second value.
[0309] Optionally, for the CU corresponding to each node of the multi-type tree, partition direction information may be signaled only when both vertical binary tree partitioning and horizontal binary tree partitioning are both feasible or only when both vertical ternary tree partitioning and horizontal ternary tree partitioning are both feasible. Otherwise, the partition direction information may not be signaled, but may be inferred as a value indicating the direction in which the CU may be partitioned.
[0310] 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 both feasible or only when both horizontal binary tree partitioning and horizontal ternary tree partitioning are both feasible. 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.
[0311] Figure 4 is a diagram illustrating a form of a prediction unit that a coding unit can include.
[0312] In a CU partitioned from an LCU, the CU that is no longer partitioned may be divided into one or more prediction units (PUs). This division is also referred to as "partitioning".
[0313] 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 above refers to Figure 2 The target blocks described may all be PUs.
[0314] 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.
[0315] In skip mode, partitions may not exist in a CU.In skip mode, a 2N×2N mode 410 may be supported without partitioning, wherein in the 2N×2N mode 410, the size of the PU and the size of the CU are identical to each other.
[0316] 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.
[0317] In intra mode, 2N×2N mode 410 and N×N mode 425 may be supported.
[0318] In 2N×2N mode 410, a PU of size 2N×2N may be encoded. A PU of size 2N×2N may represent a PU of the same size as a CU. For example, a PU of size 2N×2N may have a size of 64×64, 32×32, 16×16, or 8×8.
[0319] In N×N mode 425 , a PU of size N×N may be encoded.
[0320] For example, in intra prediction, when the size of a PU is 8×8, four partitioned PUs may be encoded. The size of each partitioned PU may be 4×4.
[0321] 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.
[0322] Which mode 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.
[0323] 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 in 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 2N×2N may be derived. The optimal intra prediction mode may be an intra prediction mode in which a minimum rate distortion cost occurs when encoding a PU of size 2N×2N among a plurality of intra prediction modes that can be used by the encoding device 100.
[0324] In addition, the encoding device 100 may sequentially perform encoding operations on each PU obtained by performing N×N partitioning. Here, the encoding operation may be an operation of encoding the PU in 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 has 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.
[0325] The encoding apparatus 100 may determine which one of the PU having a size of 2N×2N and the PU having a size of N×N is to be encoded, based on a comparison between a rate-distortion cost of a PU having a size of 2N×2N and a rate-distortion cost of a PU having a size of N×N.
[0326] A single CU may be partitioned into one or more PUs, and a PU may be partitioned into multiple PUs.
[0327] 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.
[0328] 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.
[0329] Figure 5 is a diagram illustrating a form of a transformation unit that can be included in a coding unit.
[0330] A transform unit (TU) may be a basic unit used for processes such as transformation, quantization, inverse transformation, inverse quantization, entropy encoding, and entropy decoding in a CU.
[0331] 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.
[0332] In the CU partitioned from the LCU, the CU that is no longer 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 in , a single CU 510 may be partitioned one or more times according to a quadtree structure. Through such partitioning, a single CU 510 may be composed of TUs of various sizes.
[0333] It can be considered that a single CU is recursively split when it is split two or more times. Through splitting, a single CU can be composed of transform units (TUs) having various sizes.
[0334] 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.
[0335] 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 signaled from the encoding apparatus 100 to the decoding apparatus 200. Alternatively, the size and / or shape of each TU may be derived from the information about the size and / or shape of the CU.
[0336] A CU may not be divided into TUs. When a CU is not divided into TUs, the size of the CU and the size of the TU may be equal to each other.
[0337] A single CU may be partitioned into one or more TUs, and a TU may be partitioned into multiple TUs.
[0338] 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.
[0339] 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.
[0340] Can be used with Figure 5 The CU is divided in different ways as shown in FIG.
[0341] For example, a single CU may be divided into three CUs. The horizontal sizes or vertical sizes of the three CUs generated by the division may be 1 / 4, 1 / 2, and 1 / 4 of the horizontal size or vertical size of the original CU before the division, respectively.
[0342] For example, when a CU of size 32×32 is vertically split into three CUs, the sizes of the three CUs generated by 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.
[0343] 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 a plurality of partitioning schemes may be combined and used together for the partitioning of the CU. Here, the case where a plurality of partitioning schemes are combined and used together may be referred to as "compound tree form partitioning".
[0344] Figure 6 The division of blocks according to an example is shown.
[0345] In the video encoding and / or decoding process, such as Figure 6 As shown in , the target block can be divided. For example, the target block can be a CU.
[0346] For the splitting of the target block, an indicator indicating 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.
[0347] The split information may be one or more of a split flag (hereinafter referred to as "split_flag"), a quad-binary 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").
[0348] "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.
[0349] "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.
[0350] "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.
[0351] "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.
[0352] "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.
[0353] For example, the bitmap_t may be derived by signaling at least one of quadtree_flag, binarytree_flag, and Btype_flag. Figure 6 The partitioning information of the blocks in is as shown in Table 1 below.
[0354] Table 1
[0355] For example, the QB_flag may be derived by signaling at least one of the split_flag, QB_flag, and Btype_flag. Figure 6 The partitioning information of the blocks in is as shown in Table 2 below.
[0356] Table 2
[0357] The partitioning method may be limited to a quadtree or a binary tree depending on the size and / or shape of the block. 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 based on the depth information of the block, and the depth information may be signaled from the encoding device 100 to the decoding device 200.
[0358] When the size of the block falls within a specific range, partitioning only in the form of a quadtree is possible. For example, the specific range may be defined by at least one of a maximum block size and a minimum block size that can be partitioned only in the form of a quadtree.
[0359] Information indicating a maximum block size and a minimum block size that can be divided only in a quadtree form may be signaled from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. Also, this 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 segment).
[0360] 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 greater than 64×64 and less than 256×256, only partitioning in the form of a quadtree is possible. In this case, split_flag may be a flag indicating whether partitioning in the form of a quadtree is performed.
[0361] When the size of the block is larger than the maximum size of the transform block, only partitioning in a quadtree form is possible. Here, the subblock generated by the partitioning may be at least one of a CU and a TU.
[0362] In this case, split_flag may be a flag indicating whether the CU is partitioned in a quadtree form.
[0363] When the size of the block falls within a specific range, it is possible to divide it only in a binary tree form or a ternary tree form. For example, the specific range can be defined by at least one of the maximum block size and the minimum block size that can be divided only in a binary tree form or a ternary tree form.
[0364] Information indicating a maximum block size and / or a minimum block size that can be partitioned only in a binary tree form or in a ternary tree form may be signaled from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. Also, this information may be signaled for at least one of units such as a sequence, a picture, and a slice (or segment).
[0365] 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 greater than 8×8 and less than 16×16, only partitioning in the form of a binary tree is possible. In this case, split_flag may be a flag indicating whether partitioning in the form of a binary tree or a ternary tree is performed.
[0366] The above description of partitioning in a quadtree form may be equally applied to a binary tree form and / or a ternary tree form.
[0367] The partitioning of a block may be limited by previous partitioning. For example, when a block is partitioned in a specific binary tree form and 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.
[0368] When the horizontal size or the vertical size of the partition block is a size that cannot be further divided, the above indicator may not be signaled.
[0369] Figure 7 is a diagram for explaining an embodiment of an intra prediction process.
[0370] from Figure 7 The arrow extending radially from the center of the diagram in indicates the prediction direction of the intra prediction mode. In addition, the number appearing near the arrow indicates an example of the mode value assigned to the intra prediction mode or the prediction direction of the intra prediction mode.
[0371] exist Figure 7 In FIG. 1 , 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.
[0372] 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 represent neighboring samples.
[0373] For example, intra encoding and / or decoding may be performed using values of reference samples included in the reconstructed neighboring block or encoding parameters of the reconstructed neighboring block.
[0374] 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 intra prediction is performed, 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 intra prediction is performed, 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.
[0375] 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.
[0376] 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 N×N may include a size of 4×4, 8×8, 16×16, 32×32, 64×64, etc.
[0377] 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.
[0378] 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.
[0379] For example, regardless of the size of the prediction block, the number of intra prediction modes may be fixed to N. Alternatively, the number of intra prediction modes may be 3, 5, 9, 17, 34, 35, 36, 65, 67, or 95, for example.
[0380] The intra prediction mode can be a non-directional mode or a directional mode.
[0381] For example, intra prediction modes may include Figure 7 The numbers 0 to 66 shown in the figure correspond to two non-directional modes and 65 directional modes.
[0382] 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 correspond to two non-directional modes and 93 directional modes.
[0383] The two non-directional modes may include a DC mode and a planar mode.
[0384] 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".
[0385] 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 the intra prediction mode", "(mode) value of the intra prediction mode", "(mode) angle of the intra prediction mode", and "(mode) direction of the intra prediction mode" may be used to have the same meaning and may be used interchangeably with each other.
[0386] The number of intra prediction modes may be M. The value of M may be 1 or greater. In other words, the number of intra prediction modes may be M, where M includes the number of non-directional modes and the number of directional modes.
[0387] 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.
[0388] Alternatively, the number of intra prediction modes may differ according to the shape, size and / or type of color component of the block.
[0389] For example, in Figure 7 In FIG. 5 , the directional prediction mode shown by the dotted line can be applied only to the prediction for the non-square block.
[0390] For example, the larger the size of the block, the greater the number of intra-frame prediction modes. Alternatively, the larger the size of the block, the fewer 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.
[0391] 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.
[0392] 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.
[0393] 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.
[0394] 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 whose mode value is one of 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 whose mode value is one of 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, and 17 may be the horizontal-down mode.
[0395] 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.
[0396] 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.
[0397] 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.
[0398] The number of intra prediction modes and the mode values of each intra prediction mode described above are only exemplary and may be defined differently according to embodiments, implementations and / or requirements.
[0399] 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 interpolation and / or duplication using at least one sample value among the samples included in the reconstructed neighboring block may replace the sample value of the sample that cannot be used as a reference sample. When the value generated by duplication and / or interpolation replaces the sample value of an existing sample, the sample may be used as a reference sample of the target block.
[0400] 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 a size of a target block and an intra prediction mode.
[0401] 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 indicate the number of the filter taps. In addition, the number of the filter taps may indicate the length of the filter.
[0402] When the intra prediction mode is the planar mode, the sample value of the predicted target block can be generated by using the 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 when generating the prediction block of the target block.
[0403] When the intra prediction mode is the DC mode, an average value of reference samples above the target block and reference samples on the left side of the target block may be used when generating a prediction block of the target block. 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 upper rows adjacent to the reference sample. The specific column may be one or more left columns adjacent to the reference sample.
[0404] 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.
[0405] In order to generate the above-mentioned prediction samples, real number-based interpolation may be performed.
[0406] 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.
[0407] 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.
[0408] 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.
[0409] 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 entropy decoding.
[0410] Figure 8 is a diagram showing reference samples used in an intra prediction process.
[0411] 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 corner reference sample, an upper reference sample, and an upper right reference sample.
[0412] For example, a left reference sample may represent a reconstructed reference pixel adjacent to the left side of the target block. An upper reference sample may represent a reconstructed reference pixel adjacent to the top of the target block. An upper left corner reference sample may represent a reconstructed reference pixel located at the upper left corner of the target block. A lower left reference sample may represent a reference sample located below a left sample line among samples located on the same line as a left sample line composed of left reference samples. An upper right reference sample may represent a reference sample located on the right side of an upper sample line among samples located on the same line as an upper sample line composed of upper reference samples.
[0413] When the size of the target block is N×N, the numbers of lower-left reference samples, left reference samples, upper reference samples, and upper-right reference samples may all be N.
[0414] By performing intra prediction on the target block, a prediction block may be generated. The process of generating the prediction block may include determining the values of pixels in the prediction block. The size of the target block and the prediction block may be the same.
[0415] The reference samples used for intra-frame prediction of the target block may change according to the intra-frame prediction mode of the target block. The direction of the intra-frame prediction mode may represent the dependency between the reference samples and the pixels of the prediction block. For example, the value of the 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 the one or more specified pixels in the prediction block may be samples and pixels located on a straight line along the direction of the intra-frame 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-frame 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-frame prediction mode relative to the position of the pixel.
[0416] In an example, when the intra prediction mode of the target block is a vertical mode, the upper reference sample may be used for intra prediction. When the intra prediction mode is a vertical mode, the value of a pixel in the prediction block may 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 may be used for intra prediction. In addition, the value of a pixel in a row of the prediction block may be the same as the value of a pixel of the upper reference sample.
[0417] In an example, when the intra prediction mode of the target block is a horizontal mode, the left reference sample may be used for intra prediction. When the intra prediction mode is a horizontal mode, the value of a pixel in the prediction block may be the value of a reference sample horizontally located 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 a pixel of the left reference sample.
[0418] 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 corner 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.
[0419] Also, in the case of an intra prediction mode whose mode value is a value ranging from 52 to 66, at least a portion of the upper right reference samples may be used for intra prediction.
[0420] Also, in the case of an intra prediction mode whose mode value is a value ranging from 2 to 17, at least a portion of the lower left reference samples may be used for intra prediction.
[0421] Also, in the case of an intra prediction mode whose mode value is a value ranging from 19 to 49, the top left reference sample may be used for intra prediction.
[0422] 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.
[0423] 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.
[0424] 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 a 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.
[0425] The prediction block generated via prediction may be different from the original target block. In other words, there may be a prediction error, which is 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.
[0426] Hereinafter, the terms “difference”, “error” and “residual” may be used to have the same meaning and may be used interchangeably with each other.
[0427] 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 discontinuity between the generated prediction block and the neighboring blocks.
[0428] In order to reduce the prediction error, a filtering operation for the prediction block may be used. The filtering operation may be configured to adaptively apply a filter to an 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 may be a boundary of the prediction block. In addition, the area that is considered to have a large prediction error in the prediction block may be different depending on the intra-frame prediction mode, and the characteristics of the filter may also be different depending on the intra-frame prediction mode.
[0429] like Figure 8 As shown, for intra prediction of the target block, at least one of reference lines 0 to 3 may be used.
[0430] exist 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, a reference sample point line closer to the target block may be indicated.
[0431] The samples in fragments A and F may be obtained by padding, rather than from the reconstructed neighboring blocks, wherein the padding uses the samples in fragments B and E that are closest to the target block.
[0432] 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.
[0433] When the upper 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.
[0434] In case of inter-color intra prediction, a prediction block of a target block of a second color component may be generated based on a corresponding reconstructed block of a first color component.
[0435] For example, the first color component may be a luminance component and the second color component may be a chrominance component.
[0436] To perform inter-color intra prediction, parameters of a linear model between the first color component and the second color component may be derived based on the template.
[0437] The template may include a reference sample above the target block (upper reference sample) and / or a reference sample on the left side of the target block (left reference sample), and may include an upper reference sample and / or a left reference sample of a reconstructed block of a first color component corresponding to the reference samples.
[0438] For example, the parameters of the linear model may be derived using the following values: 1) the value of the sample of the first color component having the maximum value among the samples in the template, 2) the value of the sample of the second color component corresponding to the sample of the first color component, 3) the value of the sample of the first color component having the minimum value among the samples in the template, and 4) the value of the sample of the second color component corresponding to the sample of the first color component.
[0439] When the parameters of the linear model are derived, a prediction block of the target block may be generated by applying the corresponding reconstructed block to the linear model.
[0440] According to 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 the four samples of the first color component. When subsampling is performed, derivation of parameters of a linear model and inter-color intra prediction may be performed based on the subsampled corresponding samples.
[0441] Information on whether to perform inter-color intra prediction and / or the range of a template may be signaled in an intra prediction mode.
[0442] The target block may be partitioned into two or four sub-blocks in a horizontal direction and / or a vertical direction.
[0443] The sub-blocks generated by the partitioning may be sequentially reconstructed. That is, when intra prediction is performed on each sub-block, a sub-prediction block of 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.
[0444] A subblock may be a block including a certain number (e.g., 16) or more samples. 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.
[0445] Information on whether to perform intra prediction based on these subblocks and / or information on a partition direction (horizontal direction or vertical direction) may be transmitted by a signal.
[0446] Such subblock-based intra prediction may be restricted such that it is performed only when reference sample line 0 is used. When subblock-based intra prediction is performed, filtering of a prediction block to be described below may not be performed.
[0447] A final prediction block may be generated by performing filtering on a prediction block generated through intra prediction.
[0448] 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 as a target to be filtered.
[0449] The weight and / or reference samples (eg, range of reference samples, positions 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.
[0450] 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).
[0451] 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.
[0452] The intra prediction mode of the target block may be derived using intra prediction modes of neighboring blocks that appear near the target block, and such derived intra prediction mode may be entropy encoded and / or entropy decoded.
[0453] For example, when the intra prediction mode of the target block is the same as that of the neighboring block, specific flag information may be used to signal information indicating that the intra prediction mode of the target block is the same as that of the neighboring block.
[0454] Also, for example, indicator information of a neighboring block whose intra prediction mode is the same as the intra prediction mode of the target block among intra prediction modes of a plurality of neighboring blocks may be signaled.
[0455] 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.
[0456] Fig. 9 is a diagram for explaining an embodiment of an inter-frame prediction process.
[0457] 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 indicates that the second picture refers to the first picture. That is, each image may be encoded and / or decoded according to the prediction direction.
[0458] Images may be classified into intra-pictures (I-pictures), single-predictive pictures or predictive-coded pictures (P-pictures), and bi-predictive pictures or bi-predictive-coded pictures (B-pictures) according to encoding types. Each picture may be encoded and / or decoded according to its encoding type.
[0459] When a target image to be encoded is an I picture, the target image may be encoded using data included in the image itself without performing inter-frame prediction with reference to other images. For example, the I picture may be encoded only via intra-frame prediction.
[0460] 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.
[0461] When the target image is a B picture, the image may be encoded via inter-frame prediction using reference pictures existing in both 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 the forward direction and the backward direction.
[0462] P pictures and B pictures encoded and / or decoded using reference pictures may be regarded as images using inter-frame prediction.
[0463] Hereinafter, inter prediction in the inter mode according to an embodiment will be described in detail.
[0464] Inter-frame prediction or motion compensation may be performed using a reference image and motion information.
[0465] 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.
[0466] The motion information of the target block may be derived separately during inter prediction 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.
[0467] 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 represent a PU and / or a PU partition.
[0468] The spatial candidate may be a reconstructed block that is spatially adjacent to the target block.
[0469] The temporal candidate may be a reconstructed block corresponding to the target block in a previously reconstructed co-located picture (col picture).
[0470] 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".
[0471] 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.
[0472] Inter prediction may be performed using reference pictures.
[0473] 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.
[0474] In inter prediction, a region in a reference picture may be specified 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.
[0475] Inter prediction can select a reference picture, and can also select a reference block corresponding to a target block from the reference picture. In addition, inter prediction can generate a prediction block for a target block using the selected reference block.
[0476] Motion information may be derived by each of the encoding apparatus 100 and the decoding apparatus 200 during inter prediction.
[0477] A spatial candidate may be a block that 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 a corner of the target block. Here, a "block located at a corner of a target block" may be a block that is vertically adjacent to a neighboring block that is horizontally adjacent to the target block, or a block that is horizontally adjacent to a neighboring block that is vertically adjacent to the target block. In addition, a "block located at a corner of a target block" may have the same meaning as a "block adjacent to a corner of a target block." The meaning of a "block located at a corner of a target block" may be included in the meaning of a "block adjacent to a target block."
[0478] For example, the spatial candidate may be a reconstructed block located to the left 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.
[0479] Each of the encoding apparatus 100 and the decoding apparatus 200 may identify a block existing in 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.
[0480] Each of the encoding apparatus 100 and the decoding apparatus 200 may determine the col block existing at a predefined relevant position with respect to the identified block as a temporal candidate. The predefined relevant position may be a position existing inside and / or outside the identified block.
[0481] 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.
[0482] 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 of the temporal candidate stored in the list may be a scaled motion vector.
[0483] 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.
[0484] The scheme for deriving motion information may change according to the inter prediction mode of the target block. For example, as the inter prediction mode applied to inter prediction, there may be an advanced motion vector predictor (AMVP) mode, a merge mode, a skip mode, a merge mode with a motion vector difference, a sub-block merge mode, a triangular 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". Each mode will be described in detail below.
[0485] 1) AMVP model 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.
[0486] 1-1) Create a list of predicted motion vector candidates When the AMVP mode is used as the prediction mode, each of the encoding device 100 and the decoding device 200 may create a list of prediction motion vector candidates 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 the prediction motion vector candidate.
[0487] 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.
[0488] 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.
[0489] 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.
[0490] 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".
[0491] 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".
[0492] The zero vector may be the (0,0) motion vector.
[0493] The predicted motion vector candidate may be a motion vector predictor for predicting a motion vector. In addition, in the encoding apparatus 100, each predicted motion vector candidate may be an initial search position for a motion vector.
[0494] 1-2) Searching for motion vector using a list of predicted motion vector candidates 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.
[0495] The motion vector to be used for encoding the target block may be a motion vector that can be encoded at a minimum cost.
[0496] Also, the encoding apparatus 100 may determine whether to encode the target block using the AMVP mode.
[0497] 1-3) Transmission of inter-frame prediction information 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.
[0498] 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.
[0499] 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.
[0500] Furthermore, the inter prediction information may include a residual signal.
[0501] 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.
[0502] The predicted motion vector index may indicate a predicted motion vector candidate to be used for predicting the target block among predicted motion vector candidates included in the predicted motion vector candidate list.
[0503] 1-4) Inter-frame prediction in AMVP mode using inter-frame prediction information The decoding apparatus 200 may derive 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.
[0504] The decoding device 200 may determine a motion vector candidate for the target block among the predicted motion vector candidates included in the predicted motion vector candidate list using the predicted motion vector index. The decoding device 200 may select the predicted motion vector candidate indicated by the predicted motion vector index from among the predicted motion vector candidates included in the predicted motion vector candidate list as the predicted motion vector of the target block.
[0505] The encoding device 100 may generate an entropy-coded predicted motion vector index by applying entropy encoding 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.
[0506] The motion vector actually used for inter-frame prediction of the target block may not match the predicted motion vector. In order to indicate the difference between the motion vector actually used for inter-frame 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 actually used for inter-frame prediction of the target block so as to use as small an MVD as possible.
[0507] 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.
[0508] 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.
[0509] The decoding apparatus 200 may derive a 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.
[0510] 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.
[0511] 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.
[0512] 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.
[0513] The reference direction only indicates a reference picture list to be used for predicting a target block, and may not mean that the direction of the reference picture is limited to a forward direction or a backward direction. In other words, each of the reference picture lists L0 and L1 may include pictures in a forward direction and / or a backward direction.
[0514] The reference direction being unidirectional may mean that a single reference picture list is used. The reference direction being bidirectional may mean that two reference picture lists are used. In other words, the reference direction may indicate one of the following cases: 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.
[0515] 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 encoding 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 the 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.
[0516] When two reference picture lists are used to predict the 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 the target block, the target block may specify two prediction blocks. For example, the (final) prediction block of the target block may be generated using an average or weighted sum of the two prediction blocks for the target block.
[0517] The motion vector of the target block may be derived by the predicted motion vector index, MVD, reference direction, and reference picture index.
[0518] 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.
[0519] Since the predicted motion vector index and the MVD are encoded but the motion vector itself of the target block is not encoded, the number of bits transmitted from the encoding apparatus 100 to the decoding apparatus 200 may be reduced and encoding efficiency may be improved.
[0520] 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 encode the actual motion information of the target block separately. The motion information of the target block is not encoded, but additional information may be encoded, wherein the additional information enables the motion information of the target block to be derived using the motion information of the reconstructed neighboring blocks. Since the additional information is encoded, the number of bits sent to the decoding device 200 can be reduced, and the encoding efficiency can be improved.
[0521] 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 among the reconstructed neighboring units whose motion information is to be used as the motion information of the target unit.
[0522] 2) Merge mode As a scheme for deriving motion information of a target block, there is merging. The term "merge" may mean merging the 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 in which the motion information of the target block is derived from the motion information of the neighboring blocks.
[0523] 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.
[0524] 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.
[0525] 2-1) Create a merge candidate list When the merge mode is used, each of the encoding device 100 and the decoding device 200 may use the motion information of the spatial candidate and / or the motion information of the temporal candidate to create a merge candidate list. 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 represent an inter-frame prediction indicator.
[0526] 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 storing multiple pieces of motion information.
[0527] The merge candidate may be motion information of multiple temporal candidates and / or spatial candidates. In other words, the merge candidate list may include motion information of temporal candidates and / or spatial candidates, etc.
[0528] In addition, 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.
[0529] 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 that is encoded and / or decoded before the target block.
[0530] Furthermore, the merge candidate list may include a merge candidate based on an average of two merge candidates.
[0531] 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. Such a specific mode may be an inter-frame prediction information deriving mode or a motion information deriving mode.
[0532] Inter prediction information of the target block may be derived according to a mode indicated by a merge candidate selected from among merge candidates in a merge candidate list by a merge index.
[0533] For example, the motion information derivation mode in the merge candidate list may be at least one of the following modes: 1) a motion information derivation mode for a sub-block unit and 2) an affine motion information derivation mode.
[0534] 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."
[0535] In other words, the multiple motion information in the merge candidate list can be at least one of the following information: 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) a zero vector.
[0536] 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.
[0537] A merge candidate list may be created before performing prediction in merge mode.
[0538] 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.
[0539] Merging may be applied on a CU or PU basis. When merging is performed on a CU or PU basis, the encoding device 100 may transmit a bitstream including predefined information to the decoding device 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 on which merging is to be performed among blocks that are spatial candidates and / or temporal candidates for a target block.
[0540] 2-2) Searching for motion vectors using the merge candidate list 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 generates the minimum cost in encoding the prediction and residual block.
[0541] Also, the encoding apparatus 100 may determine whether to encode the target block using the merge mode.
[0542] 2-3) Transmission of inter-frame prediction information 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. The entropy-coded inter-frame prediction information may be transmitted by the encoding device 100 to the decoding device 200 through a bitstream signal. 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.
[0543] The decoding apparatus 200 may perform inter prediction on the target block using inter prediction information of the bitstream.
[0544] The inter prediction information may include 1) mode information indicating whether a merge mode is used, 2) a merge index, and 3) correction information.
[0545] Furthermore, the inter prediction information may include a residual signal.
[0546] The decoding apparatus 200 may acquire a merge index from a bitstream only when the mode information indicates that the merge mode is used.
[0547] 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.
[0548] The merge index may indicate a merge candidate to be used for predicting the target block among merge candidates included in the merge candidate list. Alternatively, the merge index may indicate a block to be merged with the target block among neighboring blocks spatially or temporally adjacent to the target block.
[0549] 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 may set a value of the merge index to indicate the selected merge candidate.
[0550] 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.
[0551] 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'.
[0552] 2-4) Inter-frame prediction using merge mode of inter-frame prediction information 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.
[0553] 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.
[0554] 3) Skip mode 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.
[0555] The difference between the merge mode and the skip mode is whether to transmit or use a residual signal. That is, the skip mode may be similar to the merge mode except that the residual signal is not transmitted or used.
[0556] 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 information by applying entropy decoding to the entropy-coded information.
[0557] 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 syntax elements related to at least one of the MVD, the coded block flag, and the transform coefficient level to the decoding device 200.
[0558] 3-1) Create a merge candidate list The merge candidate list may also be used in the skip mode. 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".
[0559] Optionally, the skip mode may use an additional candidate list different from the 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.
[0560] The merge candidate list may be created before performing prediction in skip mode.
[0561] 3-2) Searching for motion vectors using the merge candidate list 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 generates the minimum cost in prediction.
[0562] Also, the encoding apparatus 100 may determine whether to encode the target block using the skip mode.
[0563] 3-3) Transmission of inter-frame prediction information 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.
[0564] The inter prediction information may include 1) mode information indicating whether the skip mode is used and 2) a skip index.
[0565] The skip index may be the same as the merge index described above.
[0566] 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.
[0567] The decoding device 200 may obtain the skip index from the bitstream only when the mode information indicates that the skip mode is used. As described above, the merge index and the skip index may be the same as each other. The decoding device 200 may obtain the skip index from the bitstream only when the mode information indicates that the merge mode or the skip mode is used.
[0568] 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.
[0569] 3-4) Inter-frame prediction in skip mode using inter-frame prediction information 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.
[0570] 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.
[0571] 4) Current picture reference mode The current picture reference mode may denote a prediction mode that uses a previously reconstructed area in a target picture to which the target block belongs.
[0572] A motion vector for specifying a previously reconstructed area 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.
[0573] 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 through a reference picture index of the target block.
[0574] When the target block is encoded in the current picture reference mode, the current picture may exist at a fixed position or an arbitrary position in the reference picture list for the target block.
[0575] For example, the fixed position may be a position where the value of the reference picture index is 0 or a last position.
[0576] When the target picture exists at an arbitrary position in the reference picture list, an additional reference picture index indicating such arbitrary position may be signaled by the encoding apparatus 100 to the decoding apparatus 200 .
[0577] 5) Sub-block merging mode The sub-block merge mode may be a mode in which motion information is derived from sub-blocks of a CU.
[0578] When the subblock merge mode is applied, a subblock merge candidate list may be generated using motion information of a col-sub-block of a target subblock (ie, a subblock-based temporal merge candidate) in a reference image and / or an affine control point motion vector merge candidate.
[0579] 6) Triangle partition mode In the triangular partition mode, the target block may be partitioned in a 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 of 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.
[0580] 7) Combined inter-intra prediction mode 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.
[0581] 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 the minimum sum of absolute differences (SAD) in a specific area based on the reference block indicated by the derived motion information, and may derive the found motion information as corrected motion information.
[0582] In the above-described mode, the decoding apparatus 200 may use the optical flow to compensate for the prediction samples derived through the inter-frame prediction.
[0583] In the above-described AMVP mode, merge mode, skip mode, etc., index information of a list may be used to specify motion information to be used for prediction of a target block among a plurality of pieces of motion information in the list.
[0584] In order to improve encoding efficiency, the encoding apparatus 100 may signal only the index of the element that generates 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.
[0585] Therefore, it is necessary to be able to derive the above-described lists (i.e., the predicted motion vector candidate list and the merge candidate list) based on the same data using the same scheme by the encoding device 100 and the decoding device 200. 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 must be fixed.
[0586] Fig.10 Spatial candidates according to an embodiment are shown.
[0587] exist Fig.10 , the positions of the spatial candidates are shown.
[0588] The large block in the center of the figure may represent the target block. The five small blocks may represent spatial candidates.
[0589] The coordinates of the target block may be (xP, yP), and the size of the target block may be represented by (nPSW, nPSH).
[0590] The spatial candidate A0 may be a block adjacent to the lower left corner of the target block. A0 may be a block occupying a pixel located at coordinates (xP-1, yP+nPSH).
[0591] 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 a pixel located at coordinates (xP-1, yP+nPSH-1).
[0592] The spatial candidate B0 may be a block adjacent to the upper right corner of the target block. B0 may be a block occupying a pixel located at coordinates (xP+nPSW, yP-1).
[0593] The 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 side of B0. B1 may be a block occupying a pixel located at coordinates (xP+nPSW-1, yP-1).
[0594] The spatial candidate B2 may be a block adjacent to the upper left corner of the target block. B2 may be a block occupying a pixel located at coordinates (xP-1, yP-1).
[0595] Determination of availability of spatial and temporal candidates In order to include the motion information of the spatial candidate or the motion information of the temporal candidate in the list, it must be determined whether the motion information of the spatial candidate or the motion information of the temporal candidate is available.
[0596] Hereinafter, the candidate blocks may include spatial candidates and temporal candidates.
[0597] For example, the determination may be performed by sequentially applying the following steps 1) to 4) below.
[0598] Step 1) When the PU including the candidate block is located 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.”
[0599] Step 2) When the PU including the candidate block is located 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”.
[0600] Step 3) When the PU including the candidate block is located 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”.
[0601] 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”.
[0602] Fig.11 An order in which motion information of spatial candidates is added to a merge list according to an embodiment is shown.
[0603] like 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.
[0604] Methods for exporting merge lists in merge mode and skip mode As described above, the maximum number of merge candidates in the merge list may be set. The set maximum number may be 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.
[0605] 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).
[0606] Step 1) Among the space candidates, available space candidates can be added to the merge list. Fig.11 The multiple motion information of the available spatial candidates are added to the merge list in the order shown in . Here, when the motion information of the available spatial candidate overlaps with other motion information already in the merge list, the motion information of the available spatial candidate may not be added to the merge list. The operation of checking whether the corresponding motion information overlaps with other motion information existing in the list may be referred to as "overlap check" for short.
[0607] The maximum number of pieces of motion information added may be N.
[0608] 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 of the available temporal candidate may not be added to the merge list.
[0609] 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 combining bi-directional predictions (bi-prediction) may be added to the merge list.
[0610] The target slice may be a slice including the target block.
[0611] The combined motion information may be a combination of L0 motion information and L1 motion information. The L0 motion information may be motion information referring only to the L0 reference picture list. The L1 motion information may be motion information referring only to the L1 reference picture list.
[0612] 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.
[0613] The combined motion information may include one or more pieces of combined motion information. When generating the combined motion information, L0 motion information and L1 motion information to be used in the step of generating the combined motion information among the one or more pieces of L0 motion information and the one or more pieces of L1 motion information may be predefined. The one or more pieces of combined motion information may be generated in a predefined order via combined bidirectional prediction using a pair of different motion information in a merge list. One piece of motion information in the pair of different motion information may be L0 motion information, and the other piece of motion information in the pair of different motion information may be L1 motion information.
[0614] For example, the combined motion information to which the highest priority is added 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 to which the next priority is added 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.
[0615] 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.
[0616] 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.
[0617] The zero-vector motion information may be motion information in which a motion vector is a zero vector.
[0618] 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.
[0619] The number of pieces of zero-vector motion information may be the same as the number of reference pictures in the reference picture list.
[0620] The reference direction of the zero-vector motion information may be bidirectional. Both 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.
[0621] The encoding apparatus 100 and / or the decoding apparatus 200 may then add zero-vector motion information to the merge list while changing the reference picture index.
[0622] 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.
[0623] The order of the above steps 1) to 4) is only exemplary and may be changed. In addition, some of the above steps may be omitted according to predefined conditions.
[0624] Method for deriving a candidate list of predicted motion vectors in AMVP mode The maximum number of motion vector prediction candidates in the motion vector prediction candidate list may be predefined. The predefined maximum number may be indicated by N. For example, the predefined maximum number may be 2.
[0625] 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).
[0626] 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.
[0627] 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.
[0628] The plurality of pieces of motion information of the 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 present in the prediction motion vector candidate list, the motion information of the available spatial candidate 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.
[0629] The maximum number of pieces of motion information added may be N.
[0630] 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 of the available temporal candidate may not be added to the prediction motion vector candidate list.
[0631] Step 3) When the number of pieces of motion information in the motion vector predictor candidate list is less than N, zero vector motion information may be added to the motion vector predictor candidate list.
[0632] The zero-vector motion information may include one or more pieces of zero-vector motion information. Reference picture indexes of the one or more pieces of zero-vector motion information may be different from each other.
[0633] 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.
[0634] When the zero-vector motion information overlaps with other motion information already present in the motion vector predictor candidate list, the zero-vector motion information may not be added to the motion vector predictor candidate list.
[0635] The above description of the zero-vector motion information made in conjunction with the merge list can also be applied to the zero-vector motion information, and its repeated description will be omitted.
[0636] The order of steps 1) to 3) described above is merely exemplary and may be changed. In addition, some of the steps may be omitted according to predefined conditions.
[0637] Fig.12 Transformation and quantization processes according to examples are shown.
[0638] like Fig.12 As shown in , the quantized levels may be generated by performing a transform and / or quantization process on the residual signal.
[0639] 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.
[0640] The residual signal may be transformed into a signal in the frequency domain through a transform process as part of the quantization process.
[0641] The transform kernel used for the transform may include various DCT kernels such as discrete cosine transform (DCT) type 2 (DCT-II) and discrete sine transform (DST) kernels.
[0642] These transform kernels may perform a separable transform or a 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 a horizontal direction and a vertical direction.
[0643] 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 Table 3 and Table 4 below.
[0644] Table 3
[0645] Table 4
[0646] 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 multiple transform candidates. Each transform candidate may be a DCT type or a DST type.
[0647] 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.
[0648] Table 5
[0649] In Table 5, the numbers of a vertical transform set and a horizontal transform set to be applied to a horizontal direction of a residual signal according to an intra prediction mode of a target block are shown.
[0650] As illustrated in Table 5, a 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.
[0651] In the transform and inverse transform, a transform set to be applied to the residual signal may be determined and may not be signaled as illustrated in Tables 3, 4, and 5. 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 a transform set to be applied to the residual signal is used.
[0652] For example, when the size of the target block is 64×64 or smaller, a transform set each having three transforms may be configured 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.
[0653] Here, information indicating which of the multiple 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 entropy decoded. Here, truncated unary binarization may be used to encode and / or decode such information.
[0654] As described above, methods using various transforms may be applied to a residual signal generated via intra prediction or inter prediction.
[0655] The transform may include at least one of a first transform and a secondary transform. A transform coefficient may be generated by performing a first transform on the residual signal, and a secondary transform coefficient may be generated by performing a secondary transform on the transform coefficient.
[0656] The first transform may be referred to as a “primary transform.” In addition, the first transform may also be referred to as an “adaptive multi-transform (AMT) scheme.” As described above, AMT may mean that different transforms are applied to each 1D direction (ie, vertical and horizontal directions).
[0657] The secondary transform may be a transform for improving the energy concentration of the transform coefficients generated by the first transform. Similar to the first 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).
[0658] The first transform may be performed using at least one of a plurality of predefined transform methods, for example, the plurality of predefined transform methods may include discrete cosine transform (DCT), discrete sine transform (DST), Karhunen-Loeve transform (KLT), etc.
[0659] Furthermore, the first transform may be a transform having various types according to a kernel function defining discrete cosine transform (DCT) or discrete sine transform (DST).
[0660] 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).
[0661] For example, according to the transform kernels presented in the following Table 6, the first transform may include transforms such as DCT-2, DCT-5, DCT-7, DST-7, DST-1, DST-8, and DCT-8. In the following Table 6, various transform types and transform kernel functions for multi-transform selection (MTS) are illustrated.
[0662] 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.
[0663] Table 6
[0664] In Table 6, i and j may be integer values equal to or greater than 0 and less than or equal to N-1.
[0665] A secondary transform may be performed on transform coefficients generated by performing the first transform.
[0666] As in the first transform, a transform set may also be defined in a secondary transform.The method for deriving and / or determining the above-mentioned transform set may be applied not only to the first transform but also to the secondary transform.
[0667] The primary transform and the secondary transform may be determined for a particular goal.
[0668] For example, the first 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 first 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 first transform and / or the secondary transform may be determined based on the size and / or shape of the target block.
[0669] 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.
[0670] 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.
[0671] For example, when the target of the primary transform and the secondary transform is a target block, the transform method 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 for the target block and / or a block adjacent to the target block.
[0672] Alternatively, transformation information indicating a transformation method for a specific target may be signaled from the encoding apparatus 100 to the decoding apparatus 200 .
[0673] 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.
[0674] A quantized transform coefficient (ie, a quantization level) may be generated by performing quantization on a result generated by performing the first transform and / or the sub-transform or performing quantization on a residual signal.
[0675] Fig.13 A diagonal scan according to an example is shown.
[0676] Fig.14 A horizontal scan according to an example is shown.
[0677] Fig.15 A vertical scan according to an example is shown.
[0678] 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).
[0679] Each scan may be initiated at a specific start point and may be terminated at a specific end point.
[0680] For example, by using Fig.13 The coefficients of the block are scanned by diagonal scanning to change the quantized transform coefficients into a 1D vector form. Optionally, the quantized transform coefficients may be used according to the size of the block and / or the intra prediction mode. Fig.14 Horizontal scan or Fig.15 vertical scanning instead of diagonal scanning.
[0681] Vertical scanning may be an operation of scanning 2D block type coefficients in a column direction. Horizontal scanning may be an operation of scanning 2D block type coefficients in a row direction.
[0682] In other words, which of diagonal scanning, vertical scanning, and horizontal scanning is to be used may be determined according to the size of a block and / or an inter prediction mode.
[0683] like Fig.13 , Fig.14 and Fig.15 As shown in , the quantized transform coefficients may be scanned along a diagonal direction, a horizontal direction, or a vertical direction.
[0684] 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.
[0685] In the scanning, a scanning order according to a type or direction of scanning may be first applied to a subblock. In addition, a scanning order according to a direction of scanning may be applied to quantized transform coefficients in each subblock.
[0686] For example, Fig.13 , Fig.14 and Fig.15 As shown in , when the size of the target block is 8×8, the quantized transform coefficients can be generated by the first transform, the secondary transform and the quantization of the residual signal of the target block. Therefore, one of the three types of scanning orders 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 order.
[0687] The encoding apparatus 100 may generate entropy-encoded quantized transform coefficients by performing entropy encoding on the scanned quantized transform coefficients, and may generate a bitstream including the entropy-encoded quantized transform coefficients.
[0688] 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 arranged in the form of 2D blocks via inverse scanning. Here, as an inverse scanning method, at least one of upper right diagonal scanning, vertical scanning, and horizontal scanning may be performed.
[0689] 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, depending on whether the secondary inverse transform is performed. In addition, a first inverse transform may be performed on a result generated by performing the secondary inverse transform, depending on whether the first inverse transform is to be performed. A reconstructed residual signal may be generated by performing the first inverse transform on a result generated by performing the secondary inverse transform.
[0690] For luma components reconstructed via intra prediction or inter prediction, inverse mapping with a dynamic range may be performed before loop filtering.
[0691] The dynamic range can be divided into 16 equal segments and the mapping function of the corresponding segments can be signaled.Such mapping function can be signaled at slice level or tile group level.
[0692] An inverse mapping function for performing inverse mapping may be derived based on the mapping function.
[0693] Loop filtering, storage of reference pictures, and motion compensation may be performed in the inverse mapping area.
[0694] The prediction block generated via inter prediction can be transformed to the mapping area by mapping using a mapping function, and the transformed prediction block can be used to generate a reconstructed block. However, since intra prediction is performed in the mapping area, the prediction block generated via intra prediction can be used to generate a reconstructed block without the need for mapping and / or inverse mapping.
[0695] For example, when the target block is a residual block of a chroma component, the residual block may be transformed to the inverse mapping area by scaling the chroma component of the mapping area.
[0696] Whether scaling is available can be signaled at the slice level or tile group level.
[0697] For example, scaling may be applied only if 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.
[0698] Scaling may be performed based on an average value of values of samples in a luma prediction block corresponding to the chroma prediction block. Here, when the target block uses inter prediction, the luma prediction block may refer to a mapped luma prediction block.
[0699] The value required for scaling may be derived by referring to a lookup table using an index of a segment to which the average value of the sample values of the luma prediction block belongs.
[0700] The residual block may be transformed to the inverse mapping region by scaling the residual block using the final derived value. Thereafter, for a block of a chroma component, reconstruction, intra prediction, inter prediction, loop filtering, and storage of reference pictures may be performed in the inverse mapping region.
[0701] 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.
[0702] A prediction block of 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.
[0703] 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'.
[0704] The IBC mode may be applied to a CU having a specific size. For example, the IBC mode may be applied to a CU of M×N. Here, M and N may be less than or equal to 64.
[0705] 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 configured, 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.
[0706] In the case of AMVP mode, a differential block vector may be signaled. 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 signaled.
[0707] The prediction block in the IBC mode may be included in the target CTU or the left CTU and may be limited to a block within a 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 that are encoded and / or decoded before the 64×64 block including the target block. By limiting the value of the block vector in this way, the memory consumption and device complexity caused by the implementation of the IBC mode can be reduced.
[0708] Fig.16 is a configuration diagram of an encoding device according to an embodiment.
[0709] The encoding device 1600 may correspond to the encoding device 100 described above.
[0710] 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 1640 communicating with each other through a bus 1690. The encoding apparatus 1600 may further include a communication unit 1620 connected to a network 1699.
[0711] 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 1640. The processing unit 1610 may be at least one hardware processor.
[0712] 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.
[0713] 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.
[0714] 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.
[0715] The program modules may be physically stored in various types of well-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.
[0716] 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.
[0717] The program modules may be implemented using instructions or codes executed by at least one processor of the encoding device 1600 .
[0718] 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.
[0719] The storage unit may represent the memory 1630 and / or the storage 1640. Each of the memory 1630 and the storage 1640 may be any one 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.
[0720] The storage unit may store data or information used for the operation of the encoding device 1600. In an embodiment, data or information of the encoding device 1600 may be stored in the storage unit.
[0721] For example, the storage unit may store pictures, blocks, lists, motion information, inter-frame prediction information, bitstreams, and the like.
[0722] The encoding device 1600 may be implemented in a computer system including a computer-readable storage medium.
[0723] The storage medium may store at least one module required for the operation of the encoding device 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.
[0724] Functions related to communication of data or information of the encoding device 1600 may be performed through the communication unit 1620 .
[0725] For example, the communication unit 1620 may transmit the bit stream to the decoding apparatus 1700 which will be described later.
[0726] Fig.17 is a configuration diagram of a decoding device according to an embodiment.
[0727] The decoding device 1700 may correspond to the decoding device 200 described above.
[0728] 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 1740 communicating with each other through a bus 1790. The decoding apparatus 1700 may further include a communication unit 1720 connected to a network 1799.
[0729] 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 1740. The processing unit 1710 may be at least one hardware processor.
[0730] 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.
[0731] 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 .
[0732] At least some of the entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the intra-frame prediction unit 240, the inter-frame 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 module, or other program modules.
[0733] The program modules may be physically stored in various types of well-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 device 1700.
[0734] 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.
[0735] The program modules may be implemented using instructions or codes executed by at least one processor of the decoding device 1700 .
[0736] 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 .
[0737] The storage unit may represent the memory 1730 and / or the storage 1740. Each of the memory 1730 and the storage 1740 may be any one of various types of volatile or non-volatile storage media. For example, the memory 1730 may include at least one of the ROM 1731 and the RAM 1732.
[0738] 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.
[0739] For example, the storage unit may store pictures, blocks, lists, motion information, inter-frame prediction information, bitstreams, and the like.
[0740] The decoding device 1700 may be implemented in a computer system including a computer-readable storage medium.
[0741] 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.
[0742] Functions related to communication of data or information of the decoding device 1700 may be performed through the communication unit 1720 .
[0743] For example, the communication unit 1720 may receive a bitstream from the encoding apparatus 1700 .
[0744] 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.
[0745] The present specification relates to a method for determining neighboring blocks (candidates) to be added to a candidate list in a prediction method using a candidate list (such as merge, AMVP, HMVP, or MPM), and discloses embodiments of a method for determining neighboring blocks at a correction position, a method for determining neighboring blocks based on a pattern, and a method for determining neighboring blocks based on a coding parameter.
[0746] Furthermore, the present specification discloses an embodiment of a method of determining a combination candidate and a method of determining a weight as a method of synthesizing encoding parameters of a candidate using neighboring blocks.
[0747] Another embodiment of the present specification discloses a method for constructing multiple candidate lists by classifying prediction candidates, a method for managing candidate lists based on encoding parameters, and a method for determining reference blocks based on multiple candidate lists, combined with the method for constructing and managing multiple candidate lists in a prediction process, and the candidate list management method includes construction of candidate lists, reduction of candidate lists, sorting of candidates in candidate lists, and removal and addition of candidates in candidate lists.
[0748] The embodiments relate to a method and apparatus for encoding / decoding an image, and more particularly, to a method and apparatus for encoding / decoding an image based on a block structure.
[0749] Recently, in various application fields, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, is increasing. Since image data has higher resolution and higher quality, the amount of data increases relatively compared to existing image data, and therefore, when the image data is sent using a medium such as an existing wired / wireless broadband line or stored using an existing storage medium, the transmission cost and storage cost increase. In order to solve these problems caused by high-resolution and high-quality image data, a high-efficiency image encoding / decoding technology for video with higher resolution and quality is required.
[0750] Examples of image compression techniques include various techniques such as an inter-frame prediction technique for predicting pixel values included in a current picture from pictures before or after the current picture, an intra-frame prediction technique for predicting pixel values included in the current picture using pixel information within the current picture, a transform and quantization technique for compressing the energy of a residual signal, and an entropy coding technique for assigning short codes to values with high frequency of occurrence and assigning long codes to values with low frequency of occurrence. And such image compression techniques can be used to effectively compress image data for transmission or storage.
[0751] In the related art image encoding / decoding, since the candidate list is configured and used in units of blocks, there is a limit to the improvement of encoding efficiency.
[0752] In order to improve encoding efficiency, an embodiment may provide a method for constructing and using prediction candidates and merged candidate lists by determining prediction candidates for constructing candidate lists in units of pictures, slices, tiles, CTUs, CTU rows, and CTU columns, an apparatus therefor, and a recording medium in which a bitstream is stored.
[0753] An embodiment of the present invention includes an image encoding and decoding method, an apparatus therefor, and a recording medium in which a bit stream is stored. The image encoding and decoding method includes the steps of including a neighboring block in a candidate list and determining a reference block from the candidate list.
[0754] The present invention provides a method for constructing and using a motion prediction candidate list and a merge candidate list to improve encoding efficiency by constructing candidate lists in units of pictures, slices, tiles, CTUs, CTU rows, and CTU columns, an apparatus therefor, and a recording medium in which a bitstream is stored.
[0755] The following embodiments relate to a method for determining a reference block for a current block, and an image may be encoded / decoded according to at least one or a combination of at least two of the following embodiments. The encoding efficiency of an image encoder may be improved by efficiently determining a reference block for a current block in an image encoding / decoding process using an embodiment of the present invention to be described below.
[0756] Furthermore, a block to be described below may be a unit, and a candidate list to be described below may be a candidate set, etc. and include at least one candidate.
[0757] According to an embodiment of the present invention, a reference block for a current block may be determined in at least one of inter prediction, intra prediction, transform, inverse transform, quantization, inverse quantization, entropy encoding / decoding, and loop filtering as image encoding / decoding processing.
[0758] Fig.18 is a flowchart illustrating an image encoding / decoding method, apparatus, and a recording medium having a bit stream stored therein according to an embodiment of the present invention.
[0759] Fig.18 The operation flow chart of the prediction unit ( Figure 1 The inter-frame prediction unit 110 and Figure 2 The inter-frame prediction unit 250 in the decoding device 200 is executed. In addition, Fig.18 The operation flowchart can be applied not only to the inter prediction unit that searches for a reference block in another picture, but also to the IBC mode that searches for a reference block in the same picture.
[0760] Fig.18 The operation flow chart of may include a step (E1 / D1) of including a neighboring block in a candidate list and a step (E2 / D2) of determining a reference block from the candidate list. Fig.18 A candidate list is constructed to include content (E1 / D1) of a neighboring block and content (E2 / D2) for determining a reference block to be used for prediction in the candidate list.
[0761] Reference Fig.18 , the neighboring block may be included in the candidate list when performing image encoding / decoding. In this case, the neighboring block may indicate a neighboring block adjacent to the current block in space / time, and may indicate a reconstructed neighboring block.
[0762] The neighboring block may be at least one of the spatial neighboring blocks adjacent to the current block, such as a block adjacent to the top, a block adjacent to the top left, a block adjacent to the top right, a block adjacent to the left, and a block adjacent to the bottom left relative to the current block. In addition, the neighboring block may be at least one of the spatial neighboring blocks adjacent to the boundary of the current block. In addition, the neighboring block may be at least one of the spatial neighboring blocks that exist outside the boundary of the CTU to which the current block belongs and are adjacent to the boundary of the current block. In addition, the neighboring block may be at least one of the spatial neighboring blocks that include samples outside the current block and adjacent to the position of a specific sample in the current block. In addition, the neighboring block may be at least one of the spatial neighboring blocks that exist outside the boundary of the CTU to which the current block belongs and include samples outside the current block adjacent to the position of a specific sample in the current block.
[0763] The neighboring block may indicate at least one of the multiple pieces of block information of the neighboring block. That is, the block information of the neighboring block may be included in the candidate list. Therefore, the neighboring block mentioned below may indicate at least one of the multiple pieces of block information of the neighboring block.
[0764] Reference Fig.18 , a reference block for a current block may be determined from a candidate list including neighboring blocks (candidates) or block information (candidates) of neighboring blocks. In at least one of inter prediction, intra prediction, transform, inverse transform, quantization, inverse quantization, entropy encoding / decoding, and loop filter as image encoding / decoding processing, the current block may be encoded / decoded using the determined reference block.
[0765] The reference block may indicate at least one of the multiple pieces of block information of the reference block. That is, at least one of the image encoding / decoding processes may be performed on the current block using the determined block information of the reference block. Here, the block information of the reference block may be determined as the block information of the current block. Therefore, the reference block mentioned below may indicate at least one of the multiple pieces of block information of the reference block.
[0766] Here, the neighboring blocks included in the candidate list may be referred to as candidates, and block information of the neighboring blocks included in the candidate list may also be referred to as candidates.
[0767] Also, blocks included in the candidate list may be referred to as candidates, and block information of blocks included in the candidate list may also be referred to as candidates.
[0768] That is, since a block may indicate a candidate as a block itself and may indicate a candidate as at least one of a plurality of pieces of block information, information of a block and a block are expressed as a block for the sake of convenience in the following embodiments.
[0769] The information of the block may indicate at least one of information of a neighboring block, information of a reference block, and information of a current block.
[0770] In addition, the information of the block may include at least one of the encoding parameters. The encoding information or encoding parameters may include not only information (flags, indexes, etc.) encoded in the encoder and sent to the decoder with a signal, such as syntax elements, but also information derived in the encoding process or the decoding process, and may indicate information required when the image is encoded or decoded. The encoding parameter information may include at least one of a plurality of information used in inter-frame prediction, intra-frame prediction, transformation, inverse transformation, quantization, inverse quantization, entropy encoding / decoding, and loop filters. That is, the information of the block includes block size, block depth, block partition information, block form (square or non-square), partition in quadtree form, partition in binary tree form, partition direction in binary tree form (horizontal or vertical direction), partition form in binary tree form (symmetric partitioning or asymmetric partitioning), block index, prediction mode (intra-frame prediction or inter-frame prediction), intra-frame luminance prediction mode / direction, intra-frame chrominance prediction mode / direction, intra-frame prediction mode candidate list, intra-frame prediction mode candidate index, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filter tap, reference sample filter coefficient, prediction block filter tap, prediction block filter coefficient, example side block boundary filter tap, prediction block boundary filter coefficient, motion vector (motion vector for at least one of L0, L1, L2, L3, etc.), motion vector difference (motion vector for L0, L1, L2, L3, etc.), 3, etc.), inter prediction direction (inter prediction direction for at least one of unidirectional prediction, bidirectional prediction, etc.), reference picture index (reference picture index for at least one of L0, L1, L2, L3, etc.), inter prediction indicator, prediction list utilization flag, reference picture list, motion vector prediction index, motion vector prediction candidate, motion vector candidate list, use of merge mode, merge index, merge candidate, merge candidate list, use of skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector amplitude, motion vector expression accuracy (motion vector expression unit represented by n samples or 1 / n samples such as integer samples, 1 / 2 samples, 1 / 4 samples, 1 / 8 samples, 1 / 16 samples, or 1 / 32 samples, and n can be a positive integer. In addition, n can be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate.In addition, n may be a value preset in the encoder or decoder or may be a value sent from the encoder to the decoder using a signal), transform type, transform size, primary transform usage information, secondary transform usage information, primary transform index, secondary transform index, residual signal presence / absence information, coding block pattern, coding block flag, quantization parameter, residual quantization parameter, quantization matrix, application of in-loop filter, in-loop filter coefficient, in-loop filter tap, in-loop filter shape / form, application of deblocking filter, deblocking filter coefficient, deblocking filter tap, deblocking filter strength, deblocking filter shape / form, application of adaptive sample offset. Adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, application of adaptive loop filter, adaptive loop filter coefficient, adaptive loop filter tap, adaptive loop filter shape / form, binarization / debinarization method, context model determination method, context model update method, performance of normal mode, performance of bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, coefficient group unit encoding flag, last valid coefficient position, flag indicating whether the coefficient value is greater than 1, flag indicating whether the coefficient value is greater than 2, flag indicating whether the coefficient value is greater than 3, remaining coefficient value information, positive and negative sign information, reconstructed luminance samples, reconstructed chrominance samples , residual luminance samples, residual chrominance samples, luminance transform coefficients, chrominance transform coefficients, luminance quantization level, chrominance quantization level, transform coefficient level scanning method, decoder horizontal motion vector search area size, decoder horizontal motion vector search area form, decoder horizontal motion vector search count, CTU size information, minimum block size information, maximum block size information, maximum block depth information, minimum block depth information, slice identification information, slice partitioning information, parallel block identification information, parallel block type, parallel block partitioning information, input sample bit depth, reconstructed sample bit depth, residual sample bit depth, transform coefficient bit depth and quantization level bit depth and values that can be derived from these values may also be included in the coding parameters.
[0771] In the present invention, a statistical value is a statistical value for at least one variable, coding parameter, constant, etc. having a specific value that can be calculated, and can be at least one of an average value, a weighted average value, a weighted sum value, a minimum value, a maximum value, a mode, a median value, and an interpolation value of the specific value.
[0772] The error cost in the present invention is a value derived by comparing the difference in one or more pixel values between targets, and can be calculated by using methods such as SAD / SAE, SSD / SSE, MAD / MAD, MSD / MSE, MR-SAD and SATD, for example.
[0773] SAD (Sum of Absolute Difference) / SAE (Sum of Absolute Error) MAD (mean absolute difference) / MAE (mean absolute error) SSD (sum of squared differences) / SSE (sum of squared errors) MSD (mean square deviation) / MSE (mean square error) MR-SAD (mean minus sum of absolute differences) SATD (Sum of Absolute Transfer Differences) The motion information in this specification may include at least one of a motion vector, a reference picture index, an inter-frame prediction indicator, a prediction list utilization flag, a reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, a merge index, etc., or may indicate that these derived information can be used.
[0774] The intra-frame prediction information in the present specification may include at least one of an intra-frame luminance prediction mode / direction, an intra-frame chrominance prediction mode / direction, an intra-frame prediction mode candidate list (MPM: most probable mode) and an intra-frame prediction mode candidate index (MPM index), intra-frame partition information, a gradient / prediction mode derived by a decoder-side intra-frame mode derivation method, a prediction mode derived by a template-based intra-frame mode derivation method, etc., or may be information that can be derived using these.
[0775] In this specification, candidate list management indicates a process of constructing a candidate list, reducing the candidate list, and adding or removing a candidate to or from the candidate list.
[0776] In this specification, the final candidate list means a list including final candidates (candidate blocks) used for reference block determination in the reference block determination step.
[0777] The scaling factor in the present invention is a value for scaling various encoding parameters including motion information, and indicates a ratio between a distance tb between a current image and a reference picture of the current image and a distance (td) between a reference block and a reference picture of the reference block.
[0778] In this case, Fig. 20 The scaling factor is defined as shown.
[0779] Here, the weight (w) may be a number greater than 0, and may be a preset value in the encoder or decoder, or may be a value signaled from the encoder to the decoder. In addition, at least one scaling factor may be derived by changing the weight. In addition, when the scaling factor is applied, at least one scaling factor may be used.
[0780] exist Fig.19Among them, curr_blk may indicate the current block, col_blk may indicate the reference block (at the co-located position), curr_pic may indicate the current image, curr_ref may indicate the reference picture of the current image, col_pic may indicate the reference picture having the block referred to by the current block, and col_ref may indicate the reference picture of the reference block.
[0781] In this specification, the intra-frame mode derivation method on the decoder side is a method of adding a prediction mode derived by calculating the gradient of neighboring pixels in intra-frame prediction to the MPM list to improve the MPM prediction efficiency. In this case, the decoder also adds a prediction mode derived by calculating the gradient of neighboring pixels when constructing the MPM list.
[0782] In this specification, the intra-frame template matching method is a method of using neighboring pixels to construct a template during intra-frame prediction, obtaining the region most similar to the current template from the reconstructed region in the current image, and using that region as the prediction block for the current block.
[0783] In this specification, the template-based intra-frame mode derivation method indicates creating a template for the prediction modes in the MPM list, calculating the error cost (SATD) for each prediction mode, and deriving the prediction mode based on the calculated error cost.
[0784] In this specification, when performing the "determination by comparison with a threshold", the determination may be performed based on the following conditions (see Figure 21).
[0785] In this case, the candidate / block to be compared with the threshold is BLKj, the parameter to be compared is Pk, and the threshold is THi. (j is the index of the candidate / block to be compared, k is the index of the comparison parameter, i is the threshold index, and k, i, and j are positive integers including 0) Condition 1. When the parameter to be compared is the same as the threshold (BLKj_Pk = THi), determine the corresponding block / candidate.
[0786] Condition 2. When the parameter to be compared is less than the threshold (BLKj_Pk < THi), determine the corresponding block / candidate.
[0787] Condition 3. When the parameter to be compared is greater than the threshold (BLKj_Pk > THi), determine the corresponding block / candidate.
[0788] Condition 4. When the parameter to be compared is between the thresholds, determine the corresponding block / candidate. Here, in the case of two thresholds, TH1 < BLKj_Pk < TH2 (where TH2 > TH1), and in the case of three thresholds, TH1 < BLKj-1_Pk < TH2 < BLKj_Pk < TH3 (where TH2 > TH1 & TH3 > TH2, BLKj_Pk > BLKj-1_Pk).
[0789] Condition 5. Sort the differences between the parameter to be compared and the thresholds in descending order and determine the top n differences.
[0790] Condition 6. Sort the differences between the parameter to be compared and the thresholds in descending order and determine the last v differences.
[0791] Here, n and v can be preset values in the encoder or decoder, and can be values signaled from the encoder to the decoder.
[0792] There can be at least one or more parameters and thresholds.
[0793] At least one of the above conditions can be used to perform threshold-based determination.
[0794] The threshold can be a preset value in the encoder or decoder, or can be a value signaled from the encoder to the decoder.
[0795] Referring to FIG. 21, for example, using TH2 = 5 as the threshold, the parameter to be compared is the candidate index in the P3 candidate list, and the second threshold of Condition 4 is set to TH1 = 2, and n and v of Condition 5 are set to 1 and 2 respectively. The neighboring blocks determined by Conditions 1 to 6 are as follows.
[0796] Condition 1: BLk1 Condition 2: BLk2 Condition 3: BLK3 Condition 4: BLK2 Condition 5: BLK3 Condition 6: BLK2, BLK1 In addition, regarding the "similar candidates (or similar blocks)" in the embodiments, when at least one of the encoding parameters is similar between neighboring blocks or candidates, the candidates can be called similar candidates.
[0797] The similarity can be determined based on the encoding parameters or statistical values of the encoding parameters.
[0798] The similarity may be determined based on the magnitude of the motion vector. For example, the similarity may be determined by comparing the magnitude of the motion vector of the comparison target with a threshold value. For example, at least one of the blocks having a motion vector greater than the threshold value may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a motion vector less than the threshold value may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a motion vector between the threshold values may be determined as a similar candidate. Alternatively, for example, the motion vectors may be sorted in the order in which the magnitude of the motion vector is close to the threshold value, and then n motion vectors may be selected and determined as similar candidates. Alternatively, for example, the magnitude of the motion vector may be sorted in descending order of the distance to the threshold value, and then m motion vectors may be selected and determined as similar candidates. In this case, m and n may be preset values in the encoder or decoder, and may be values signaled from the encoder to the decoder. In this case, as the threshold value, a value derived using a statistical value of motion information may be used. For example, a threshold value derived using a statistical value of at least one of a plurality of motion information such as a motion vector of a candidate list or a neighboring block, a reference picture index, and an inter-frame prediction indicator may be used. In the above example, the same process may be performed based on the motion vector difference between the comparison target candidates instead of the motion vector magnitude. When comparing the magnitude of the motion vector, at least one of the x component and the y component may be used for comparison.
[0799] Alternatively, the similarity may be determined based on the intra-frame prediction mode information or its statistical value. For example, the similarity may be determined by comparing the difference of the intra-frame prediction mode values between the comparison targets with a threshold value. For example, at least one of the blocks having a difference between the intra-frame prediction mode values greater than the threshold value may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a difference between the intra-frame prediction mode values less than the threshold value may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a difference between the intra-frame prediction mode values between the threshold values may be determined as a similar candidate. Alternatively, for example, the blocks may be sorted in the order in which the intra-frame prediction mode values are close to the threshold value, and then n may be selected and determined as similar candidates. Alternatively, for example, the blocks may be sorted in the order in which the intra-frame prediction mode values are away from the threshold value, and then m may be selected and determined as similar candidates. In this case, m and n may be preset values in the encoder or decoder, and may be values sent from the encoder to the decoder with a signal. In this case, as the threshold value, a value derived using the intra-frame prediction information and its statistical value may be used. For example, a value derived using at least one of a block in a candidate list, a neighboring block, an intra prediction mode in a most probable mode (MPM) list, gradient information derived by a decoder-side intra mode derivation method, and a statistical value of a prediction mode is used as the threshold.
[0800] Alternatively, the similarity may be determined based on the error cost. For example, the similarity may be determined by comparing the error cost derived by comparing the direct pixel value difference between the targets or the error cost derived by the matching method with a threshold. For example, at least one of the blocks having an error cost higher than the threshold may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having an error cost lower than the threshold may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having an error cost between the thresholds may be determined as a similar candidate. Alternatively, for example, n blocks may be selected in the order in which the error cost approaches the threshold and determined as similar candidates. Alternatively, for example, m blocks may be selected in the order in which the error cost is away from the threshold and determined as similar candidates. In this case, m and n may be preset values in the encoder or decoder and may be values signaled from the encoder to the decoder.
[0801] When an adjacent / non-adjacent block (or motion information of a block) indicated by a block vector (or motion vector) in the same picture or a corresponding block (or motion information of a block) in a reference picture indicated by motion information of a spatially neighboring block is determined as a similar candidate for constructing a candidate list, if an error cost (e.g., template matching cost) of the adjacent / non-adjacent block or the corresponding block is higher than a threshold (e.g., a predetermined multiple of the error cost of a predetermined order of previous additions to the candidate list such as a first candidate), the block is determined not to be a similar candidate and may not be added to the candidate list.
[0802] Alternatively, the similarity may be determined based on the distance between the comparison targets. For example, the similarity may be determined by comparing the distance difference between the current block and the target block or the distance difference between the comparison targets with a threshold. For example, at least one of the blocks having a distance difference greater than the threshold may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a distance difference less than the threshold may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a distance difference between the thresholds may be determined as a similar candidate. Alternatively, for example, the blocks may be sorted in the order in which the distance difference is close to the threshold, and then n may be selected and determined as similar candidates. Alternatively, for example, the blocks may be sorted in the order in which the distance difference is away from the threshold, and then m candidates may be selected as similar candidates. Alternatively, for example, at least one of the candidates adjacent to the comparison object candidate may be selected and determined as a similar candidate. In this case, m and n may be preset values in the encoder or decoder, and may be values sent from the encoder to the decoder by signal.
[0803] Alternatively, the similarity may be determined based on the divided regions. For example, the reference region may be divided, and candidates belonging to the same region or adjacent regions may be determined as similar candidates.
[0804] Alternatively, the similarity may be determined based on the candidate indexes in the candidate list. For example, the similarity may be determined by comparing the candidate index value of the comparison target with a threshold value. Alternatively, the similarity may be determined by comparing the index value difference between the candidate indexes with a threshold value. For example, at least one of the blocks having a candidate index greater than a threshold value or a difference between candidate index values may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a candidate index less than a threshold value or a difference between candidate index values may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a difference between candidate indexes or candidate index values between threshold values may be determined as a similar candidate. Alternatively, for example, the blocks may be sorted in the order in which the difference between the candidate indexes or candidate index values is close to the threshold value, and then n may be selected and determined as similar candidates. Alternatively, for example, the blocks may be sorted in the order in which the difference between the candidate indexes or candidate index values is away from the threshold value, and then m candidates may be selected and determined as similar candidates. In this case, m and n may be preset values in the encoder or decoder, and may be values sent from the encoder to the decoder with a signal.
[0805] Alternatively, the similarity may be determined based on the value of the scaling factor. For example, at least one of the blocks having a difference in scaling factor values between candidates less than a threshold value may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a difference in scaling factor values between candidates greater than a threshold value may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a difference in scaling factor values between candidates between a threshold value may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a difference in scaling factor values between candidates closest to the threshold value may be determined as a similar candidate. Alternatively, for example, at least one of the blocks having a difference in scaling factor values between candidates farthest from the threshold value may be determined as a similar candidate. Here, the specific value may be a preset value or may be a value signaled from the encoder to the decoder.
[0806] All thresholds used to determine similarity may be preset values in the encoder or decoder, or may be values signaled from the encoder to the decoder.
[0807] In addition, the matching scheme in the embodiment is a method of calculating the error cost while adjusting the position of the template using the template defined between the comparison targets, and includes, for example, template matching and bilateral matching. Here, the template matching cost or bilateral matching cost corresponds to a subset of the error cost.
[0808] In template matching, as shown in FIG. 22 , a template (current template) for the current block is constructed by using neighboring pixels of the current block, and a reference template matching the current template can be constructed by using pixels within a search area of a reference picture. Here, Fig.22ashows the template configuration in the case of inter-frame prediction, and Figure 22b A template configuration in the case of intra prediction is shown.
[0809] Bilateral matching can use pixels in the reference picture to construct a template, such as Fig.23 In this case, the template may be composed of at least one of the reconstructed pixels in the current image or the reference image.
[0810] When constructing a template in a matching scheme, as shown in FIG. 24 , one or more pixels or one or more lines may be left blank. Fig.24a and Figure 24b The templates matched according to the template are shown. Fig.24a The template includes neighboring pixels adjacent to the upper and left boundaries of the current block, and Figure 24b The template includes neighboring pixels adjacent to the upper boundary, left boundary, and upper left vertex of the current block. In addition, Fig.24c A template according to bilateral matching is shown, which corresponds to the size of the current block.
[0811] Furthermore, the number of pixels constituting the template, the number of lines, and the shape of the template may be differently constructed based on encoding parameters.
[0812] For example, the shape of the template may be constructed differently according to the partition shape or size of the current block or the neighboring block and its statistical value. For example, a template having a surface of the same size as the size of the surface in contact with the current block or the neighboring block may be constructed. Alternatively, for example, a template having a surface of a size smaller than the size of the surface in contact with the current block or the neighboring block may be constructed. Alternatively, for example, a template having a size larger than the size of the surface in contact with the current block or the neighboring block may be constructed. Alternatively, for example, a template may be constructed by using the maximum value, minimum value and median value of the size of the surface of each of the current block and the neighboring block as the size of the surface. Alternatively, for example, when the size of the current block or the neighboring block is less than a threshold, the template may be constructed by reducing the number of lines or pixels or the size of the template may be reduced. Alternatively, for example, when the size of the current block or the neighboring block is less than a threshold, the template may be constructed by increasing the number of lines or pixels or the size of the template may be increased. Alternatively, for example, when the size of the current block or the neighboring block is greater than a threshold, the template may be constructed by reducing the number of lines or pixels or the size of the template may be reduced. Alternatively, for example, when the size of the current block or the neighboring block is greater than a threshold, the template may be constructed by increasing the number of lines or pixels or the size of the template may be increased. Optionally, the threshold may be a value preset in the encoder or decoder, or may be a value sent by a signal from the encoder to the decoder.
[0813] When the current block is a horizontally long rectangle, for example, when the width is more than twice the height, the template may be constructed using only neighboring pixels adjacent to the upper boundary, or when the current block is a vertically long rectangle, for example, when the height is more than twice the width, the template may be constructed using only pixels adjacent to the left boundary, and only pixels in a row above the current block or a column to the left of the current block may be used as a template.
[0814] For example, the shape of the template may be configured differently according to the motion information of the neighboring blocks or their statistical values. For example, when one of the statistical values of the motion vector of the neighboring blocks is less than a threshold value, the template may be constructed by reducing the number of lines or pixels or the size of the template may be reduced. Alternatively, for example, when one of the statistical values of the motion vector of the neighboring blocks is less than a threshold value, the template may be constructed by increasing the number of lines or pixels or the size of the template may be increased. Alternatively, for example, when one of the statistical values of the motion vector of the neighboring blocks is greater than a threshold value, the template may be constructed by reducing the number of lines or pixels or the size of the template may be reduced. Alternatively, for example, when one of the statistical values of the motion vector of the neighboring blocks is greater than a threshold value, the template may be constructed by increasing the number of lines or pixels or the size of the template may be increased. The threshold value may be a value preset in the encoder or the decoder, or may be a value sent from the encoder to the decoder with a signal.
[0815] For example, the shape of the template may be constructed differently according to the prediction mode of the current block or the neighboring block. Fig.25a and Fig.25b In the example, blocks D, M, and O are blocks encoded by intra-frame prediction. Fig.25a shows a template configuration when intra prediction is performed in an inter picture, and Fig.25b The template configuration when inter prediction is performed in an inter picture is shown. For example, when inter prediction is performed on the current block, the template may be constructed by selecting at least one of the blocks determined by the inter prediction. Alternatively, for example, when inter prediction is performed on the current block, the template may be constructed by selecting at least one of the blocks determined by intra prediction. Alternatively, for example, when intra prediction is performed on the current block (in an inter picture), the template may be constructed by selecting at least one of the blocks determined by the inter prediction. Alternatively, for example, when intra prediction is performed on the current block (in an inter picture), the template may be constructed by selecting at least one of the blocks determined by the intra prediction.
[0816] Furthermore, the number of pixels constituting the template, the number of lines, and the shape of the template may be differently constructed based on pixel positions, distances between pixels, and partitioned areas.
[0817] For example, the shape of the template can be constructed differently according to the distance from the center of the search area. For example, when the distance from the center of the search area to the position to be matched is less than a threshold, the template can be constructed by reducing the number of lines or pixels or the size of the template can be reduced. Alternatively, for example, when the distance from the center of the search area to the position to be matched is less than a threshold, the template can be constructed by increasing the number of lines or pixels or the size of the template can be increased. Alternatively, for example, when the distance from the center of the search area to the position to be matched is greater than a threshold, the template can be constructed by reducing the number of lines or pixels or the size of the template can be reduced. Alternatively, for example, when the distance from the center of the search area to the position to be matched is greater than a threshold, the template can be constructed by increasing the number of lines or pixels or the size of the template can be increased. The threshold value can be a value preset in the decoder, or can be a value sent to the decoder from the encoder with a signal.
[0818] For example, the shape of the template can be constructed differently according to the distance from the pixel to be matched first. Optionally, for example, when the distance from the pixel to be matched first is less than a threshold value, the template can be constructed by reducing the number of lines or pixels or the size of the template can be reduced. Optionally, for example, when the distance from the pixel to be matched first is less than a threshold value, the template can be constructed by increasing the number of lines or pixels or the size of the template can be increased. Optionally, for example, when the distance from the pixel to be matched first is greater than a threshold value, the template can be constructed by reducing the number of lines or pixels or the size of the template can be reduced. Optionally, for example, when the distance from the pixel to be matched first is greater than a threshold value, the template can be constructed by increasing the number of lines or pixels or the size of the template can be increased. The threshold value can be a preset value in an encoder or a decoder, or can be a value sent from an encoder to a decoder with a signal.
[0819] For example, when the search area is divided into partitioned areas, the shape of the template may be constructed differently for each partitioned area.
[0820] Furthermore, the number of pixels constituting the template, the number of lines, and the shape of the template may be differently constructed based on the step of performing matching.
[0821] For example, when template matching is used to find the neighboring block with the minimum error cost, template matching can be performed at a specific position of a predetermined pattern only within the search range like a pattern matching method to reduce complexity. In this case, the pattern matching method can be performed by the following steps. In the first step, sparse matching is performed by increasing the size of the pattern within the search area or increasing the distance between the positions to be matched. In the next step, the size of the pattern is reduced by reference to the position with the minimum error cost found in the previous step or by reducing the distance between the positions to be matched to perform more accurate matching. In this case, in the first step, a template can be constructed or the size of the template can be reduced by reducing the number of lines or pixels, and in the next step, a template can be constructed or the size of the template can be increased by increasing the number of lines or pixels. Alternatively, in the first step, a template can be constructed or the size of the template can be increased by increasing the number of lines or pixels, and in the next step, a template can be constructed or the size of the template can be reduced by increasing the number of lines or pixels.
[0822] Furthermore, matching based on the above-described matching scheme may be performed at at least one pixel position within the search range.
[0823] For example, matching may be performed at at least one of the positions derived from the candidates in the candidate list.
[0824] Alternatively, for example, matching may be performed at at least one of the pixel positions that is a certain distance from the current block.
[0825] Alternatively, for example, matching may be performed at at least one of the pixel positions that is a certain distance away from the current block.
[0826] Alternatively, for example, matching may be performed at least one of the locations in specific partition areas when the search range is divided.
[0827] Alternatively, for example, matching may be performed at least one of the pixel positions belonging to a specific pattern.
[0828] Alternatively, for example, matching may be performed at at least one of pixel positions derived from a block (similar candidate) having the same or similar encoding parameters as the current block, and matching may be performed, for example, when statistical values of motion information of the blocks are the same or similar, for example, when (intra-frame or inter-frame) prediction information of the blocks are the same or similar, for example, when prediction directions of the blocks are the same or similar, or for example, when intra-frame prediction modes of the blocks are the same or similar.
[0829] The same process may be performed based on the statistical values of the candidate encoding parameters.
[0830] The threshold value may be a value preset in the encoder or the decoder, or may be a value signaled from the encoder to the decoder.
[0831] The motion information of the candidate selected within a search range determined by one or more positions derived by a predetermined method with reference to one or more candidates (e.g., motion information) selected from the candidates in the candidate list may be refined. For example, the cost (such as template matching cost) of the position determined according to a predetermined search pattern from an initial position (e.g., a position on a radial straight line of multiple angles corresponding to angles of multiples of 22.5 degrees, multiples of 45 degrees, multiples of 90 degrees, or a position obtained by adding 45 degrees to a multiple of 90 degrees) indicated by at least one or two of the multiple motion information selected, for example, based on the AMVP or template matching cost in the merged candidate list may be calculated. That is, the cost of the refined motion information may be calculated.
[0832] There may be one or more positions in the radial direction on the straight line. The plurality of positions may be positions that are spaced apart from the initial position (indicated by the motion information selected from the candidate list) by a multiple of a certain length interval (e.g., 1 / 4 pixel, 1 / 2 pixel, or 1 pixel) in the x direction and / or the y direction, or may be positions that are gradually away from the initial position indicated by the motion information selected from the candidate list (e.g., 1 / 4 pixel, 1 / 2 pixel, 1 pixel, 2 pixels, 4 pixels).
[0833] When there is a position in the radial direction on the straight line, the separation distance from the initial position may be set in proportion to the accuracy of the motion information indicating the initial position. For example, when the accuracy of the motion information pointing to the initial position is 1 / 4 pixel, the separation distance may be k 1 / 4 pixel, and k can be set to, for example, 1, 2, or 4.
[0834] Since it is necessary to calculate the template matching costs for multiple positions (or multiple pieces of refined motion information), which increases the amount of calculation, the number of template samples used in calculating the template matching cost can be reduced and the calculation burden can be reduced, for example, by using a method that only uses samples in one row above and / or one column to the left of the current block as a template.
[0835] In addition, a predetermined number of positions with the lowest cost among a plurality of refined positions (or refined motion information) may be selected as available positions. In addition, the MMVD indexing method may be used to encode information about the selected refined positions. For example, the refined positions may include a direction value indicating a direction from an initial position and a distance value indicating a distance. In this case, the direction value and the distance value may also be represented as an index to a predefined table or list. In addition, the refined motion information with the lowest cost among the plurality of refined motion information may be selected as the optimal candidate of the candidate list.
[0836] In addition, in an embodiment, “reference position correction” means including a neighboring block at a corrected reference position in a candidate list using encoding parameters (encoding information) of a current block and a neighboring block.
[0837] For example, when a neighboring block to be included in a candidate list is selected in a reference picture as shown in FIG. 26 , a position correction value may be derived using motion information or a statistical value of the motion information which is one of the encoding parameters of the neighboring block, and a block at the reference position corrected by the derived correction value may be selected.
[0838] exist Fig.26a and Figure 26b In , MV_A=(X, Y) may indicate a motion vector of a neighboring block A, C1 may indicate an existing reference block in a reference picture, and C′1 may indicate a reference block having a corrected reference position.
[0839] For example, as shown in FIG. 26 , when a neighboring block in a candidate list included in a reference picture of a current block X is C1, in the case where reference position correction is performed using a motion vector (MV_A) of a neighboring block A, C'1 at a position corrected by using the motion vector of block A as a position correction value may be included in the candidate list.
[0840] In this case, when the neighboring block at the corrected position is not referenceable, the neighboring block at the position before correction or the block adjacent to the block at the corrected position or the closest neighboring block may be included in the candidate list. In addition, position correction may be performed on at least one block in the referenceable neighboring blocks.
[0841] The correction value may be constructed in a form including at least one of the plurality of pieces of motion information for position correction. For example, the correction value may be constructed in a form of [motion vector, reference picture list index, scaling factor]. Alternatively, for example, the correction value may be constructed in a form of [motion vector candidate index, motion vector]. Alternatively, for example, the correction value may be constructed in a form of [motion vector candidate index, motion vector, reference picture index, scaling factor].
[0842] In addition, the correction value may be used after scaling. For example, the correction value may be used after scaling based on a scaling factor according to a reference picture index. In this case, the scaling factor may vary according to motion information of a neighboring block whose reference position is corrected. For example, the scaling factor may vary according to a reference picture index of a corresponding block, a size of a motion vector, or a position of a neighboring block.
[0843] When selecting a neighboring block required for deriving a correction value in the reference position correction process, at least one block may be selected from all referenceable neighboring blocks. For example, at least one block may be selected from blocks in a candidate list. Alternatively, for example, blocks in the candidate list may be excluded for selection. Alternatively, for example, at least one block may be selected from adjacent blocks. Alternatively, for example, at least one block may be selected from non-adjacent blocks.
[0844] In this case, "referenceable" means that there is a usable block nearby, and the block includes usable encoding parameters.
[0845] Alternatively, coding parameters of neighboring blocks may be used to select a block.
[0846] The block may be selected using candidate index information of a candidate list in the encoding parameters. In this case, the block may be selected by comparison between an index value and a threshold value. For example, a neighboring block having an index value that is the same as the threshold value may be selected. Alternatively, for example, a neighboring block having an index value greater than the threshold value may be selected. Alternatively, for example, a neighboring block having an index value greater than the threshold value may be selected. Alternatively, for example, n neighboring blocks having an index value close to the threshold value may be selected. Alternatively, for example, n neighboring blocks having an index value far from the threshold value may be selected. Optionally, the threshold value may be a predetermined value or a value signaled from the encoder to the decoder.
[0847] Alternatively, a block may be selected using distance or position information from the current block. For example, a block may be selected from a block adjacent to the current block. Alternatively, for example, a block may be selected from a non-adjacent block. Alternatively, for example, a block may be selected from a block within a certain threshold distance from the current block. Alternatively, for example, a block may be selected from a block outside a specific threshold distance from the current block. Alternatively, for example, a block may be selected from a block whose distance from the current block is between a specific threshold (threshold 1 < distance from the current block < threshold 2). Here, the specific distance may be a preset value or may be a value sent from the encoder to the decoder using a signal.
[0848] Alternatively, a neighboring block may be selected based on a plurality of pieces of motion information or a statistical value of a plurality of pieces of motion information that can refer to a neighboring block. For example, a neighboring block may be selected from a block whose motion vector is less than a threshold value. Alternatively, for example, at least one block may be selected from a neighboring block whose motion vector size is greater than a threshold value. Alternatively, for example, at least one block may be selected from neighboring blocks whose motion vector size is between threshold values. Here, the threshold value may be a preset value or may be a value sent from an encoder to a decoder using a signal. In this case, the threshold value may be a value derived from a statistical value of motion information of a neighboring block. For example, an average value of motion vectors, reference picture indexes, etc. of neighboring blocks may be used as a threshold value. Alternatively, for example, an average value of motion vectors, reference picture indexes, etc. of blocks included in a candidate list may be used as a threshold value.
[0849] Alternatively, the block may be determined based on an error cost derived by template matching or bilateral matching. For example, a block with the lowest error cost may be selected. Alternatively, for example, a block with the highest error cost may be selected. Alternatively, for example, at least one of the blocks with an error cost below a threshold may be selected. Alternatively, for example, at least one of the blocks with an error cost above a threshold may be selected. Alternatively, for example, at least one block may be selected from blocks with an error cost between thresholds. Here, the threshold may be a preset value or may be a value signaled from the encoder to the decoder.
[0850] Optionally, the block may be determined using a scaling factor value. For example, a block with a minimum scaling factor value may be selected. Optionally, for example, a block with a maximum scaling factor value may be selected. Optionally, for example, at least one block may be selected from blocks with scaling factor values less than a threshold. Optionally, for example, at least one of the blocks with scaling factors greater than a threshold may be selected. Optionally, for example, at least one of the blocks with scaling factor values between thresholds may be selected. Optionally, for example, a block with a scaling factor value closest to the threshold may be selected. Optionally, for example, a block with a scaling factor value farthest from the threshold may be selected. Here, the threshold may be a preset value or may be a value signaled from an encoder to a decoder.
[0851] Detailed Description Fig.18 The steps of including the neighboring blocks in the candidate list (E1 / D1) and determining the reference block from the candidate list (E2 / D2) in the flowchart of FIG.
[0852] First, the step (E1 / D1) of including neighboring blocks in a candidate list will be described.
[0853] At least one or a maximum of V neighboring blocks spatially / temporally adjacent to the current block may be included in the candidate list of the current block.
[0854] Furthermore, at least one or a maximum of V pieces of information of neighboring blocks spatially / temporally adjacent to the current block may be included in the candidate list of the current block.
[0855] Here, V may be a positive integer including 0. In addition, V may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, V may be a value preset in the encoder or the decoder, or a value signaled from the encoder to the decoder.
[0856] When the neighboring block is included in the same picture as the current block, a slice in the same picture, a tile in the same picture, a CTU in the same picture, etc., the neighboring block may be referred to as a neighboring block that is spatially adjacent to the current block. In addition, when the neighboring block is included in a different picture from the current block, a slice in a different picture, a tile in a different picture, a CTU in a different picture, etc., the neighboring block may be referred to as a neighboring block that is temporally adjacent to the current block.
[0857] A neighboring block selected using at least one or a combination of at least one of the following items may be included in the candidate list.
[0858] Adjacent to the current block A maximum of V neighboring blocks adjacent to the current block may be included in the candidate list of the current block. Here, V may be a positive integer including 0. In this case, the neighboring block being adjacent to the current block may indicate that at least one of a boundary and a vertex of the current block contacts at least one of a boundary and a vertex of the neighboring block.
[0859] Here, a block located within the vertical size of the current block based on the upper position of the current block may be referred to as a neighboring block adjacent to the current block. In addition, a block located within the horizontal size of the current block based on the left position of the current block may be referred to as a neighboring block adjacent to the current block.
[0860] The blocks may be included in the candidate list in the order from the blocks contacting the boundary of the current block to the blocks contacting the vertices of the current block. In addition, the candidates may be included in the order of the neighboring blocks contacting the vertices of the current block and the neighboring blocks contacting the boundary of the current block.
[0861] The neighboring blocks may be included in the candidate list in the order from the neighboring block adjace...
Claims
1. An image decoding method, comprising: Build a candidate list related to the prediction of the current block; generating a prediction block for the current block based on the candidate selected from the candidate list; as well as generating a reconstructed block of the current block based on the predicted block, Wherein, constructing the candidate list includes adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block.
2. The image decoding method according to claim 1, wherein: The non-adjacent blocks include blocks on a plurality of straight lines radiating at an angular interval of 22.5 degrees between an angle of 45 degrees and an angle of 225 degrees with the current block as a reference in the current picture to which the current block belongs, and blocks on a plurality of straight lines radiating at an angular interval of 45 degrees between an angle of 270 degrees and an angle of 360 degrees with a reference in the reference picture to which the col block corresponding to the current block belongs.
3. The image decoding method according to claim 1, wherein: Constructing the candidate list further includes adding a fourth candidate, which is a block in intra block copy mode, to the candidate list.
4. The image decoding method according to claim 3, wherein: Constructing the candidate list includes calculating, for the fourth candidate, a matching cost of a template including samples in an upper row and a left column of the block.
5. The image decoding method according to claim 3, wherein: The fourth candidates include an upper right neighboring block, an upper left neighboring block, and a lower left neighboring block of the current block.
6. The image decoding method according to claim 1, wherein: The build candidate list also includes: selecting at least one candidate from among the candidates included in the candidate list; obtaining a plurality of pieces of refined motion information corresponding to a plurality of refined positions, the plurality of refined positions being spaced apart from an initial position associated with the selected at least one candidate first motion information; calculating a template matching cost for each of the plurality of refined motion information; and One or more of the plurality of pieces of refined motion information are selected according to an ascending order of the calculated template matching costs, and the selected refined motion information is added to a candidate list.
7. The image decoding method according to claim 6, wherein: The plurality of refined positions include one or more positions on each of a plurality of straight lines radiating from the initial position at predetermined angular intervals.
8. The image decoding method according to claim 7, wherein: The one or more positions on each of the plurality of straight lines include a plurality of positions at gradually increasing distances from the initial position.
9. The image decoding method according to claim 7, wherein: The plurality of straight lines are two straight lines in a direction obtained by adding an angle of 45 degrees to an angle that is a multiple of 90 degrees, and the thinned positions are positions spaced apart from the initial positions by the same first distance in the x-direction and the y-direction.
10. The image decoding method according to claim 9, wherein: The first distance is determined based on the accuracy of the first motion information.
11. The image decoding method according to claim 6, wherein: The template used for the template matching cost includes the samples in the upper row and left column of the block.
12. The image decoding method according to claim 6, wherein: When the current block is a rectangle with one side being two times longer than the other side or more, the template used for the template matching cost includes only the samples adjacent to the longer side.
13. The image decoding method according to claim 1, wherein: The construction of the candidate list does not add a candidate having a template matching cost greater than a reference value as a candidate to the candidate list.
14. The image decoding method according to claim 13, wherein: The reference value is set based on a template matching cost of a first candidate in the candidate list.
15. The image decoding method according to claim 1, wherein: Constructing the candidate list also includes sorting the positions of the added candidates based on the template matching cost.
16. The image decoding method according to claim 15, wherein: The sorting includes moving the candidate with zero motion information to the last position in the candidate list and / or excluding the candidate with zero motion information in the operation of sorting the positions of the candidates.
17. The image decoding method according to claim 15, wherein: The sorting includes: obtaining a difference in template matching costs of a pair of two adjacent candidates among the candidates included in the candidate list, and determining a minimum value among the differences; and When the minimum value is smaller than a reference value, at least one candidate in the pair corresponding to the minimum value is moved to a next position.
18. The image decoding method according to claim 17, wherein: The sorting further includes stopping the sorting operation when the minimum value is greater than the reference value.
19. An image encoding method, comprising: Build a candidate list related to the prediction of the current block; generating a prediction block for the current block based on the candidate selected from the candidate list; as well as Generate a residual block of the current block based on the prediction block, Wherein, constructing the candidate list includes adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block.
20. A computer-readable storage medium storing a bit stream of picture information generated by executing an image encoding method, the image encoding method comprising: Build a list of candidates related to the prediction of the current block, generating a prediction block for the current block based on the candidate selected from the candidate list, and Generate a residual block of the current block based on the prediction block, Wherein, constructing the candidate list includes adding candidates to the candidate list in the order of a first candidate for use as a spatially neighboring block, a second candidate for use as a temporally neighboring block, and a third candidate for use as a non-neighboring block.
