Image encoding / decoding method and device, and recording medium for storing bitstream
The method improves video encoding and decoding by determining prediction modes and block vectors for UHD images, enabling efficient prediction and compression through subblock-based processing, thereby addressing the challenges of high-resolution video data handling in current technologies.
Patent Information
- Application Number
- PCT/KR2024/005005
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-09
- Filing Date
- 2024-04-15
- Publication Date
- 2024-10-17
AI Technical Summary
Current video encoding and decoding technologies face challenges in efficiently handling high-resolution video data, particularly in predicting pixel values for images with Ultra High Definition (UHD) resolution, where existing intra prediction methods like intra block copy (IBC) and intra template matching struggle to maintain high image quality and compression efficiency.
The method involves determining a prediction mode for a target block based on block vectors, which can include integer and fractional resolutions, deriving block vectors, and generating prediction blocks using these vectors, specifically by dividing the target block into subblocks and referencing motion information to determine reference blocks for accurate prediction.
This approach enhances the prediction accuracy and compression efficiency for high-resolution images by allowing for flexible block vector resolutions and subblock-based prediction, effectively addressing the limitations of existing methods in handling UHD video data.
Smart Images

Figure KR2024005005_17102024_PF_FP_ABST
Abstract
Description
Video encoding / decoding method, device, and recording medium for storing bitstream
[0001] The present invention relates to a video encoding / decoding method, device, and recording medium for storing a bitstream, and more particularly, to video encoding and decoding based on intra prediction such as intra block copy (IBC) and intra template matching.
[0002] The continuous development of the information and communications industry has led to the global spread of broadcasting services featuring HD (High Definition) resolution. This proliferation has led many users to become accustomed to high-resolution, high-quality images and / or video.
[0003] To meet consumer demand for higher image quality, many organizations are accelerating the development of next-generation video devices. Consumer interest is growing not only in High Definition TV (HDTV) and Full HD (FHD) TV, but also in Ultra High Definition (UHD) TV, which offers resolution four times higher than FHD TV. This growing interest is driving the demand for video encoding and decoding technologies capable of delivering higher resolution and image quality.
[0004] As a video compression technology, there are various technologies such as inter-prediction (also called inter-screen prediction), intra-prediction (also called intra-screen prediction), transform and quantization, and entropy encoding.
[0005] Inter prediction is a technique for predicting the values of pixels contained in the current picture using the previous and / or subsequent pictures of the current picture. Intra prediction is a technique for predicting the values of pixels contained in the current picture using information about pixels within the current picture. Transformation and quantization techniques are techniques for compressing the energy of residual images. Entropy coding is a technique for assigning short codes to values with high frequency of occurrence and long codes to values with low frequency of occurrence.
[0006] Using these image compression technologies, data about images can be effectively compressed, transmitted, and stored.
[0007] The present invention aims to provide various methods for encoding or decoding an image using at least one intra prediction mode based on a block vector.
[0008] One aspect of the present invention provides an image decoding method for predicting a target block included in a target picture. The method comprises the steps of: determining a prediction mode for the target block from among a plurality of block vector-based prediction modes; determining a block vector resolution for the target block, wherein the block vector resolution is determined from among a plurality of block vector resolution candidates including one or more integer unit resolutions and one or more fractional unit resolutions; deriving at least one block vector for the target block based on the determined prediction mode and the block vector resolution; and generating a prediction block of the target block from pre-restored samples in the target picture using the at least one block vector.
[0009] Here, when the determined mode is a subblock-based Intra Block Copy (IBC) mode, the step of deriving the at least one block vector includes: a step of dividing the target block into a plurality of subblocks; a step of deriving motion information for specifying a reference block to be referred to for deriving the at least one block vector of the target block; a step of determining the reference block within the target picture based on the motion information; and a step of generating block vectors corresponding to the subblocks within the target block using block vectors of the subblocks within the reference block. A prediction block for the target block may be generated in units of subblocks using block vectors for each subblock within the target block.
[0010] Another aspect of the present invention provides an image encoding method for predicting a target block included in a target picture. The method comprises the steps of: determining a prediction mode for the target block from among a plurality of block vector-based prediction modes; determining a block vector resolution for the target block, wherein the block vector resolution is determined from among a plurality of block vector resolution candidates including one or more integer unit resolutions and one or more fractional unit resolutions; deriving at least one block vector for the target block based on the determined prediction mode and the block vector resolution; and generating a prediction block of the target block from reconstructed samples in the target picture using the at least one block vector.
[0011] Here, when the determined mode is a subblock-based Intra Block Copy (IBC) mode, the step of deriving the at least one block vector includes: a step of dividing the target block into a plurality of subblocks; a step of deriving motion information for specifying a reference block to be referred to for deriving the at least one block vector of the target block; a step of determining the reference block within the target picture based on the motion information; and a step of generating block vectors corresponding to the subblocks within the target block using block vectors of the subblocks within the reference block. A prediction block for the target block may be generated in units of subblocks using block vectors for each subblock within the target block.
[0012] Another aspect of the present invention provides a method for generating a bitstream by predictively encoding a target block included in a target picture, and transmitting the bitstream to an image decoding device. The generation of the bitstream includes the steps of: determining a prediction mode for the target block from among a plurality of block vector-based prediction modes; determining a block vector resolution for the target block, wherein the block vector resolution is determined from among a plurality of block vector resolution candidates including one or more integer unit resolutions and one or more fractional unit resolutions; deriving at least one block vector for the target block based on the determined prediction mode and the block vector resolution; and generating a prediction block of the target block from pre-restored samples in the target picture using the at least one block vector.
[0013] Figure 1 is a block diagram showing the configuration according to one embodiment of an encoding device to which the present invention is applied.
[0014] Figure 2 is a block diagram showing the configuration according to one embodiment of a decryption device to which the present invention is applied.
[0015] Figure 3 is a diagram schematically showing the division structure of an image when encoding and decoding an image.
[0016] Figure 4 is a diagram illustrating the form of a prediction unit that a coding unit can include.
[0017] Figure 5 is a diagram illustrating the form of a transformation unit that can be included in a coding unit.
[0018] Figure 6 illustrates the division of blocks according to an example.
[0019] Figure 7 is a diagram for explaining an embodiment of intra prediction.
[0020] Figure 8 is a diagram for explaining reference samples used in intra prediction.
[0021] Figure 9 is a diagram for explaining an embodiment of inter prediction.
[0022] Figure 10 shows spatial candidates according to an example.
[0023] Figure 11 shows the order of adding motion information of spatial candidates to the merge list according to an example.
[0024] Figure 12 illustrates the process of transformation and quantization according to an example.
[0025] Figure 13 illustrates diagonal scanning according to an example.
[0026] Figure 14 illustrates horizontal scanning according to an example.
[0027] Figure 15 illustrates vertical scanning according to an example.
[0028] Fig. 16 is a structural diagram of an encoding device according to one embodiment.
[0029] Fig. 17 is a structural diagram of a decryption device according to one embodiment.
[0030] Figure 18 is an exemplary diagram for explaining template matching according to one embodiment of the present invention.
[0031] Figures 19 and 20 illustrate various examples of subsampling methods in template matching.
[0032] Figures 21 to 26 each illustrate a search method in template matching according to an example.
[0033] FIG. 27 is an exemplary diagram illustrating a method for configuring a target template in an affine mode according to one embodiment of the present invention.
[0034] FIG. 28a and FIG. 28b are exemplary diagrams for explaining a method of configuring a reference template in an affine mode according to one embodiment of the present invention.
[0035] Figure 29 is a drawing for explaining two-sided matching according to one embodiment of the present invention.
[0036] FIG. 30 is an exemplary diagram illustrating a method for determining the location of a reference block in IBC mode according to one embodiment of the present invention.
[0037] FIG. 31 is an exemplary diagram of grouping sub-blocks divided from a target block according to one embodiment of the present invention.
[0038] Figure 32 is a flowchart illustrating an image encoding method according to one embodiment of the present invention.
[0039] Figure 33 is a flowchart illustrating an image decoding method according to one embodiment of the present invention.
[0040] FIG. 34 is an exemplary diagram showing the locations of adjacent blocks of a target block considered for deriving a spatial block vector candidate according to one embodiment of the present invention.
[0041] FIG. 35 is an exemplary diagram showing the locations of non-adjacent blocks of a target block considered for deriving a spatial block vector candidate according to one embodiment of the present invention.
[0042] FIG. 36 is a drawing for explaining a position indicated by a temporal block vector candidate according to one embodiment of the present invention.
[0043] FIG. 37a and FIG. 37b are exemplary diagrams illustrating a process for deriving an auto-relocated block vector candidate according to one embodiment of the present invention.
[0044] FIGS. 38a and 38b are exemplary diagrams illustrating a method for specifying a subpixel unit position of a block vector of a target block in an intra template matching mode according to one embodiment.
[0045] Figure 39 is an example diagram for explaining the positional relationship between a target block and a reference block indicated by a block vector.
[0046] Figure 40 is an example diagram showing a reference area that can include a reference block indicated by a block vector when the size of the CTB is 128x128.
[0047] FIGS. 41 to 44 are exemplary diagrams for explaining a method for managing a reference area buffer in block vector-based image encoding or decoding according to one embodiment of the present invention.
[0048] FIG. 45a and FIG. 45b are exemplary diagrams showing a syntax structure for coding parameters subjected to entropy encoding / decoding according to one embodiment of the present invention.
[0049] FIGS. 46 to 48 are exemplary drawings showing a syntax structure for a conversion unit, which is a unit for converting a target block according to one embodiment of the present invention.
[0050] The present invention is susceptible to various modifications and embodiments. Specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, but rather to encompass all modifications, equivalents, and alternatives falling within the spirit and technical scope of the present invention.
[0051] The detailed description of the exemplary embodiments described below refers to the accompanying drawings, which illustrate specific embodiments by way of example. These embodiments are described in sufficient detail to enable those skilled in the art to practice the embodiments. It should be understood that the various embodiments, while different from each other, are not necessarily mutually exclusive. For example, specific shapes, structures, and characteristics described herein may be implemented in other embodiments without departing from the spirit and scope of the present invention. Furthermore, it should be understood that the positions or arrangements of individual components within each disclosed embodiment may be modified without departing from the spirit and scope of the embodiment. Accordingly, the following detailed description is not intended to be limiting, and the scope of the exemplary embodiments, if properly described, is defined only by the appended claims, along with the full scope of equivalents to which such claims are entitled.
[0052] Similar reference numerals in the drawings indicate identical or similar functions throughout. The shapes and sizes of elements in the drawings may be exaggerated for clarity.
[0053] While terms such as "first" and "second" may be used to describe various components in the present invention, these components should not be limited by these terms. These terms are used solely to distinguish one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as the "second component," and similarly, the second component may also be referred to as the "first component." The term "and / or" may encompass a combination of multiple related items described herein or any of multiple related items described herein.
[0054] When a component is referred to as being "connected" or "connected" to another component, it should be understood that the two components may be directly connected or connected to each other, but that there may be another component between the two components. Conversely, when a component is referred to as being "directly connected" or "directly connected" to another component, it should be understood that no other component exists between the two components.
[0055] The components shown in the embodiments are independently depicted to represent different characteristic functions, and do not imply that each component is composed of separate hardware or a single software configuration unit. That is, each component is listed and included as a separate component for convenience of explanation, and at least two components among each component may be combined to form a single component, or a single component may be divided into multiple components to perform a function, and integrated and separate embodiments of each of these components are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.
[0056] The terms used in the embodiments are only used to describe specific embodiments and are not intended to limit the present invention. The singular expression includes the plural expression unless the context clearly indicates otherwise. In the embodiments, it should be understood that the terms "comprises" or "has" indicate the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof. In other words, the description in the embodiments as "comprising" a specific configuration does not exclude configurations other than the specified configuration, and means that additional configurations may also be included in the scope of the implementation of the present invention or the technical idea of the present invention.
[0057] In the embodiments, the term "at least one" may mean one of a number greater than or equal to 1, such as 1, 2, 3, and 4. In the embodiments, the term "a plurality of" may mean one of a number greater than or equal to 2, such as 2, 3, and 4.
[0058] Some components of the embodiments may not be essential components that perform essential functions of the present invention, but may be optional components merely for performance enhancement. The embodiments may be implemented by including only essential components necessary to realize the essence of the embodiments, excluding components used solely for performance enhancement. A structure that includes only essential components, excluding optional components used solely for performance enhancement, is also within the scope of the embodiments.
[0059] Hereinafter, embodiments are described in detail with reference to the attached drawings to enable those skilled in the art to easily implement the embodiments. In describing the embodiments, detailed descriptions of related known structures or functions will be omitted if they are judged to obscure the gist of the present specification. In addition, identical components in the drawings are designated by the same reference numerals, and redundant descriptions of identical components are omitted.
[0060]
[0061] Hereinafter, an image may mean a single picture constituting a video, or may represent the video itself. For example, "encoding and / or decoding of an image" may mean "encoding and / or decoding of a video," or may mean "encoding and / or decoding of one of the images constituting the video."
[0062] Hereinafter, the terms “video” and “motion picture(s)” may be used interchangeably and have the same meaning.
[0063] Hereinafter, the target image may be an encoding target image, which is a target of encoding, and / or a decoding target image, which is a target of decoding. In addition, the target image may be an input image input to an encoding device, or an input image input to a decoding device. In addition, the target image may be a current image, which is a target of current encoding and / or decoding. For example, the terms "target image" and "current image" may be used interchangeably and have the same meaning.
[0064] Hereinafter, the terms “image”, “picture”, “frame” and “screen” may be used interchangeably and have the same meaning.
[0065] Hereinafter, the target block may be an encoding target block that is a target of encoding and / or a decoding target block that is a target of decoding. In addition, the target block may be a current block that is a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used with the same meaning and may be used interchangeably. The current block may mean an encoding target block that is a target of encoding during encoding and / or a decoding target block that is a target of decoding 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.
[0066] Hereinafter, the terms "block" and "unit" may be used interchangeably and have the same meaning. Alternatively, "block" may refer to a specific unit.
[0067] Hereinafter, the terms “region” and “segment” may be used interchangeably.
[0068] In the embodiments, each of the specified information, data, flags, indices, elements, attributes, etc., can have a value. The value "0" of the information, data, flags, indices, elements, attributes, etc., can represent false, logical false, or a first predefined value. That is, the values "0", false, logical false, and the first predefined value can be used interchangeably with each other. The value "1" of the information, data, flags, indices, elements, attributes, etc., can represent true, logical true, or a second predefined value. That is, the values "1", true, logical true, and the second predefined value can be used interchangeably with each other.
[0069] When a variable such as i or j is used to represent a row, column, or index, the value of i can be an integer greater than or equal to 0, or an integer greater than or equal to 1. That is, in the embodiments, rows, columns, and indices can be counted from 0, or can be counted from 1.
[0070] In the embodiments, the term "one or more" or the term "at least one" may mean the term "plurality." "One or more" or "at least one" may be used interchangeably with "plurality."
[0071] Below, the terms used in the examples are explained.
[0072] Encoder: An encoder can refer to a device that performs encoding. In other words, an encoder can refer to an encoding device.
[0073] Decoder: A decoder can refer to a device that performs decoding. In other words, a decoder can refer to a decoding device.
[0074] Unit: A unit may represent a unit of image encoding and / or decoding. The terms "unit" and "block" may be used interchangeably and have the same meaning.
[0075] - A unit can be an MxN array of samples. M and N can each be positive integers. A unit can often mean an array of samples in a two-dimensional form.
[0076] - In video encoding and decoding, a unit may be a region created by segmenting an image. In other words, a unit may be a specific region within an image. An image may be segmented into multiple units. Alternatively, a unit may refer to a segmented portion of an image when segmenting the segmented portion into segments and encoding or decoding the segmented portion.
[0077] - In encoding and decoding of images, predefined processing can be performed on units depending on the type of unit.
[0078] - Depending on the function, the type of the unit can be classified into a macro unit, a coding unit (CU), a prediction unit (PU), a residual unit, and a transform unit (TU). Alternatively, depending on the function, the unit can mean a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, and a transform block. For example, the target unit can be at least one of a CU, a PU, a residual unit, and a TU that are targets of encoding and / or decoding.
[0079] - A unit may mean information including a luma component block and a corresponding chroma component block, and a syntax element for each block, in order to distinguish it from a block.
[0080] - Units may vary in size and shape. Furthermore, units may have various sizes and shapes. Specifically, the unit's shape may include geometric shapes that can be expressed in two dimensions, such as squares, rectangles, trapezoids, triangles, and pentagons.
[0081] - In addition, the unit information may include at least one of the unit type, the unit size, the unit depth, the unit encoding order, and the unit decoding order. For example, the unit type may indicate one of CU, PU, residual unit, and TU.
[0082] - A unit can be further divided into sub-units of smaller size compared to the unit.
[0083] Depth: Depth can refer to the degree to which a unit is divided. Additionally, the depth of a unit can indicate the level at which a unit exists when represented as a tree structure.
[0084] - Unit split information may include depth information regarding the depth of the unit. The depth may indicate the number of times and / or degree to which the unit is split.
[0085] - In a tree structure, the root node can be considered as the shallowest node, and the leaf node can be considered as the deepest node. The root node can be the highest node. The leaf node can be the lowest node.
[0086] - A unit can be hierarchically divided into multiple sub-units with depth information based on a tree structure. In other words, a unit and a sub-unit generated by division of the unit can correspond to a node and a child node of the node, respectively. Each divided sub-unit can have a depth. Since the depth indicates the number of times and / or degree to which a unit has been divided, the division information of a sub-unit may also include information regarding the size of the sub-unit.
[0087] In a tree structure, the top node may correspond to the first undivided unit. This top node may be called the root node. Furthermore, the top node may have a minimum depth value. In this case, the top node may have a depth of level 0.
[0088] - A node with a depth of level 1 can represent a unit created when the initial unit is split once. A node with a depth of level 2 can represent a unit created when the initial unit is split twice.
[0089] - A node with a depth of level n can represent a unit generated as the initial unit is split n times.
[0090] A leaf node can be the lowest node and cannot be further divided. The depth of a leaf node can be the maximum level. For example, the predefined maximum level value can be 3.
[0091] - QT depth can represent the depth for quad partitioning. BT depth can represent the depth for binary partitioning. TT depth can represent the depth for ternary partitioning.
[0092] Sample: A sample can be the base unit that constitutes a block. A sample is numbered from 0 to 2 depending on the bit depth (Bd). Bd It can be expressed as values up to -1.
[0093] - Samples can be pixels or pixel values.
[0094] - Hereinafter, the terms “pixel”, “pixels” and “samples” may be used interchangeably and have the same meaning.
[0095] Coding Tree Unit (CTU): A CTU may consist of one luma component (Y) coding tree block and two chroma component (Cb, Cr) coding tree blocks related to the luma component coding tree block. A CTU may also mean a block including the above blocks and syntax elements for each block of the above blocks.
[0096] - Each coding tree unit can be partitioned using one or more partitioning methods, such as a quad tree (QT), a binary tree (BT), and a ternary tree (TT), to form subunits such as a coding unit, a prediction unit, and a transformation unit. A quad tree may mean a quarternary tree. In addition, each coding tree unit can be partitioned using a multi-type tree (MTT) that uses one or more partitioning methods.
[0097] - CTU can be used as a term to refer to a pixel block, which is a processing unit in the process of decoding and encoding an image, as in the segmentation of an input image.
[0098] Coding Tree Block (CTB): Coding Tree Block may be used as a term to refer to any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.
[0099] Neighbor block: A neighbor block can refer to a block adjacent to the target block. A neighbor block can also refer to a rebuilt neighbor block.
[0100] - Hereinafter, the terms “neighboring block” and “adjacent block” may be used interchangeably and have the same meaning.
[0101] - A neighbor block may also mean a reconstructed neighbor block.
[0102] Spatial neighbor block: A spatial neighbor block may be a block spatially adjacent to the target block. A neighboring block may include a spatial neighbor block.
[0103] - The target block and spatial neighboring blocks can be included within the target picture.
[0104] - A spatial neighboring block may mean a block whose boundary is adjacent to the target block or a block located within a certain distance from the target block.
[0105] - A spatial neighboring block may refer to a block adjacent to a vertex of a target block. Here, a block adjacent to a vertex of a target block may be 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.
[0106] Temporal neighbor block: A temporal neighbor block may be a block temporally adjacent to the target block. A neighboring block may include a temporal neighbor block.
[0107] - Temporal neighboring blocks may contain co-located blocks (col blocks).
[0108] - A call block may be a block within a co-located picture (col picture) that has already been reconstructed. The location of the call block within the co-located picture may correspond to the location of the target block within the target picture. Alternatively, the location of the call block within the co-located picture may be identical to the location of the target block within the target picture. The call picture may be a picture included in a reference picture list.
[0109] - A temporal neighboring block may be a block that is temporally adjacent to a spatial neighboring block of the target block.
[0110] Prediction mode: The prediction mode can be information indicating the mode used for intra prediction or the mode used for inter prediction.
[0111] Prediction unit: A prediction unit can refer to a basic unit for prediction, such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation.
[0112] - A prediction unit may be divided into multiple partitions or sub-prediction units of smaller sizes. Multiple partitions may also serve as the basis for performing prediction or compensation. Partitions generated by dividing a prediction unit may also be prediction units.
[0113] Prediction unit partition: Prediction unit partition can mean the form in which a prediction unit is divided.
[0114] Reconstructed neighboring unit: A reconstructed neighboring unit may be a unit that has already been decrypted and reconstructed as a neighbor of the target unit.
[0115] - The reconstructed neighboring unit can be a spatial neighboring unit or a temporal neighboring unit to the target unit.
[0116] - The reconstructed spatial neighboring unit may be a unit within the target picture that has already been reconstructed through encoding and / or decoding.
[0117] - The reconstructed temporal neighboring unit may be a unit within a reference image that has already been reconstructed through encoding and / or decoding. The position of the reconstructed temporal neighboring unit within the reference image may be the same as the position of the target unit within the target picture, or may correspond to the position of the target unit within the target picture. Alternatively, the reconstructed temporal neighboring unit may be a neighboring block of a corresponding block within the reference image. Here, the position of the corresponding block within the reference image may correspond to the position of the target block within the target image. Here, the correspondence of the positions of the blocks may mean that the positions of the blocks are the same, may mean that one block is included in another block, or may mean that one block occupies a specific position of another block.
[0118] Sub-picture: A picture can be divided into one or more sub-pictures. A sub-picture can consist of one or more rows of tiles and one or more columns of tiles.
[0119] - A sub-picture may be a region within a picture that has a square shape or a rectangular (i.e., non-square) shape. In addition, a sub-picture may include one or more CTUs.
[0120] - A sub-picture can be a rectangular area of one or more slices within a picture.
[0121] - A sub-picture may contain one or more tiles, one or more bricks, and / or one or more slices.
[0122] Tile: A tile can be a square or rectangular (i.e. non-square) area within a picture.
[0123] - A tile may contain one or more CTUs.
[0124] - A tile can be split into one or more bricks.
[0125] Brick: A brick can represent one or more rows of CTUs within a tile.
[0126] - A tile can be divided into one or more bricks. Each brick can contain one or more CTU rows.
[0127] - A tile that cannot be divided into two or more pieces can also mean a brick.
[0128] Slice: A slice may contain one or more tiles within a picture. Alternatively, a slice may contain one or more bricks within a tile.
[0129] - A sub-picture may include one or more slices that collectively cover a rectangular area within the picture. Accordingly, each sub-picture boundary may always be a slice boundary. Additionally, each vertical sub-picture boundary may always be a vertical tile boundary.
[0130] Parameter set: A parameter set may correspond to header information among the structures within a bitstream.
[0131] - 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), and a decoding parameter set (DPS).
[0132] Information signaled through a parameter set can be applied to pictures referencing the parameter set. For example, information within a VPS can be applied to pictures referencing the VPS. Information within an SPS can be applied to pictures referencing the SPS. Information within a PPS can be applied to pictures referencing the PPS.
[0133] A parameter set can reference a higher-level parameter set. For example, a PPS can reference an SPS, which can reference a VPS.
[0134] - In addition, the parameter set may include a tile group, slice header information, and tile header information. A tile group may mean a group including multiple tiles. In addition, the meaning of a tile group may be identical to the meaning of a slice.
[0135] Rate-distortion optimization: An encoder can use rate-distortion optimization to provide high encoding efficiency by using a combination of coding unit size, prediction mode, prediction unit size, motion information, and transform unit size.
[0136] - The rate-distortion optimization method can calculate the rate-distortion cost of each combination to select the optimal combination among the above combinations. The rate-distortion cost can be calculated using the formula "D+λ*R". In general, the combination that minimizes the rate-distortion cost according to the formula "D+λ*R" can be selected as the optimal combination in the rate-distortion optimization method.
[0137] - D can represent distortion. D can be the mean square error of the squares of the differences between the original transform coefficients and the reconstructed transform coefficients within the transform unit.
[0138] - R can represent the rate. R can represent the bit rate using related context information.
[0139] - λ can represent a Lagrangian multiplier. R can include bits generated by encoding transform coefficients as well as coding parameter information such as prediction mode, motion information, and coded block flag.
[0140] - The encoding device may perform processes such as inter prediction, intra prediction, transformation, quantization, entropy encoding, inverse quantization, and / or inverse transformation to calculate accurate D and R. These processes may significantly increase the complexity in the encoding device.
[0141] Bitstream: A bitstream can mean a string of bits containing encoded image information.
[0142] Parsing: Parsing can mean entropy decoding a bitstream to determine the values of syntax elements. Alternatively, parsing can mean entropy decoding itself.
[0143] Symbol: may mean at least one of a syntax element, a coding parameter, and a transform coefficient of a unit to be encoded and / or a unit to be decoded. In addition, a symbol may mean a target of entropy encoding or a result of entropy decoding.
[0144] Reference picture: A reference picture may refer to an image referenced by a unit for inter prediction or motion compensation. Alternatively, the reference picture may be an image including a reference unit referenced by a target unit for inter prediction or motion compensation.
[0145] Hereinafter, the terms “reference picture” and “reference image” may be used interchangeably and have the same meaning.
[0146] Reference picture list: A reference picture list may be a list containing one or more reference pictures used for inter prediction or motion compensation.
[0147] - The types of reference picture lists can include List Combined (LC), List 0 (L0), List 1 (L1), List 2 (L2), and List 3 (L3).
[0148] - One or more reference picture lists can be used for inter prediction.
[0149] Inter-prediction indicator: The inter-prediction indicator can indicate the direction of inter-prediction for the target unit. Inter-prediction can be either unidirectional prediction or bidirectional prediction. Alternatively, the inter-prediction indicator can indicate the number of reference pictures used when generating the prediction unit of the target unit. Alternatively, the inter-prediction indicator can indicate the number of prediction blocks used for inter-prediction or motion compensation for the target unit.
[0150] Prediction list utilization flag: The prediction list utilization flag can indicate whether to generate a prediction unit using at least one reference picture within a specific reference picture list.
[0151] - An inter prediction indicator can be derived using the prediction list utilization flag. Conversely, a prediction list utilization flag can be derived using the inter prediction indicator. For example, when the prediction list utilization flag indicates a first value of 0, it can indicate that, for the target unit, a prediction block is not generated using a reference picture in the reference picture list. When the prediction list utilization flag indicates a second value of 1, it can indicate that, for the target unit, a prediction unit is generated using the reference picture list.
[0152] Reference picture index: A reference picture index may be an index indicating a specific reference picture in a reference picture list.
[0153] Picture Order Count (POC): The POC of a picture can indicate the display order of the picture.
[0154] Motion Vector (MV): A motion vector can be a two-dimensional vector used in inter prediction or motion compensation. A motion vector can indicate the offset between a target image and a reference image.
[0155] - For example, MV is (mv x , mv y ) can be expressed in the form of mv x can represent the horizontal component, and mv y can represent vertical components.
[0156] Search range: The search range can be a two-dimensional region where MVs are searched during inter prediction. For example, the size of the search range can be MxN, where M and N can each be positive integers.
[0157] Motion vector candidate: A motion vector candidate can mean a block that is a prediction candidate or a motion vector of a block that is a prediction candidate when predicting a motion vector.
[0158] - Motion vector candidates can be included in the motion vector candidate list.
[0159] Motion vector candidate list: A motion vector candidate list may mean a list constructed using one or more motion vector candidates.
[0160] Motion vector candidate index: The motion vector candidate index may refer to an indicator pointing to a motion vector candidate within a motion vector candidate list. Alternatively, the motion vector candidate index may be an index of a motion vector predictor.
[0161] Motion information: Motion information may mean information including at least one of a motion vector, a reference picture index, and an inter prediction indicator, as well as reference picture list information, a reference image, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.
[0162] Merge candidate list: A merge candidate list may refer to a list constructed using one or more merge candidates.
[0163] Merge candidate: A merge candidate may refer to a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-prediction merge candidate, a history-based candidate, a candidate based on the average of two candidates, and a zero-merge candidate. A merge candidate may include an inter-prediction indicator, and may include motion information such as a reference picture index, a motion vector, a prediction list utilization flag, and an inter-prediction indicator for each list.
[0164] Merge index: A merge index can be an indicator pointing to a merge candidate within the merge candidate list.
[0165] - The merge index can indicate a reconstructed unit that is spatially adjacent to the target unit and a reconstructed unit that is temporally adjacent to the target unit, which is a merge candidate.
[0166] - The merge index can indicate at least one of the movement information of the merge candidate.
[0167] Transform unit: A transform unit may be a basic unit in residual signal encoding and / or residual signal decoding, such as transform, inverse transform, quantization, inverse quantization, transform coefficient encoding, and transform coefficient decoding. One transform unit may be divided 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.
[0168] Scaling: Scaling can mean the process of multiplying the transform coefficient levels by a factor.
[0169] - As a result of scaling on the transform coefficient level, transform coefficients can be generated. Scaling may also be referred to as dequantization.
[0170] Quantization Parameter (QP): The quantization parameter may refer to a value used to generate transform coefficient levels for transform coefficients in quantization. Alternatively, the quantization parameter may refer to a value used to generate transform coefficients by scaling transform coefficient levels in dequantization. Alternatively, the quantization parameter may be a value mapped to a quantization step size.
[0171] Delta quantization parameter: The delta quantization parameter may mean the difference value between the predicted quantization parameter and the quantization parameter of the target unit.
[0172] Scan: Scan can refer to a method for arranging the order of coefficients within a unit, block, or matrix. For example, arranging a two-dimensional array into a one-dimensional array can be called a scan. Alternatively, arranging a one-dimensional array into a two-dimensional array can also be called a scan or inverse scan.
[0173] Transform coefficient: The transform coefficient may be a coefficient value generated by performing a transform in an encoding device. Alternatively, the transform coefficient may be a coefficient value generated by performing at least one of entropy decoding and dequantization in a decoding device.
[0174] - The quantized level or quantized transform coefficient level generated by applying quantization to the transform coefficient or residual signal can also be included in the meaning of the transform coefficient.
[0175] Quantized Level: A quantized level may refer to a value generated by performing quantization on a transform coefficient or residual signal in an encoding device. Alternatively, a quantized level may refer to a value that is the target of dequantization when performing dequantization in a decoding device.
[0176] - The quantized transform coefficient level, which is the result of transformation and quantization, can also be included in the meaning of the quantized level.
[0177] Non-zero transform coefficient: A non-zero transform coefficient can mean a transform coefficient with a non-zero value or a transform coefficient level with a non-zero value. Alternatively, a non-zero transform coefficient can mean a transform coefficient whose magnitude is not zero or a transform coefficient level whose magnitude is not zero.
[0178] Quantization matrix: A quantization matrix can refer to a matrix used in the quantization or dequantization process to improve the subjective or objective image quality. A quantization matrix can also be referred to as a scaling list.
[0179] Quantization matrix coefficient: Quantization matrix coefficient can mean each element in the quantization matrix. Quantization matrix coefficient can also be called matrix coefficient.
[0180] Default matrix: The default matrix may be a quantization matrix predefined in the encoder and decoder.
[0181] Non-default matrix: A non-default matrix may be a quantization matrix that is not predefined in the encoder or decoder. A non-default matrix may refer to a quantization matrix that is signaled by the user from the encoder to the decoder.
[0182] Most Probable Mode (MPM): MPM can indicate the intra prediction mode that is likely to be used for intra prediction of the target block.
[0183] - The encoding device and the decoding device can determine one or more MPMs based on coding parameters related to the target block and properties of objects related to the target block.
[0184] - The encoding device and the decoding device can determine one or more MPMs based on the intra prediction mode of the reference block. There may be multiple reference blocks. The multiple reference blocks may include a spatial neighboring block adjacent to the left of the target block and a spatial neighboring block adjacent to the top of the target block. In other words, one or more different MPMs may be determined depending on which intra prediction modes are used for the reference blocks.
[0185] - One or more MPMs can be determined in the same manner in the encoding device and the decoding device. In other words, the encoding device and the decoding device can share an MPM list containing the same one or more MPMs.
[0186] MPM List: An MPM list may contain one or more MPMs. The number of MPMs in an MPM list may be predefined.
[0187] MPM Indicator: The MPM indicator can indicate which MPM among one or more MPMs in the MPM list is used for intra prediction of the target block. For example, the MPM indicator can be an index into the MPM list.
[0188] - Since the MPM list is determined in the same way in the encoding device and the decoding device, the MPM list itself may not need to be transmitted from the encoding device to the decoding device.
[0189] - The MPM indicator can be signaled from the encoding device to the decoding device. As the MPM indicator is signaled, the decoding device can determine which MPM among the MPMs in the MPM list will be used for intra prediction for the target block.
[0190] MPM Usage Indicator: The MPM usage indicator can indicate whether the MPM usage mode will be used for prediction of the target block. The MPM usage mode can be a mode that uses an MPM list to determine the MPM to be used for intra prediction of the target block.
[0191] - MPM usage indicators can be signaled from the encoding device to the decoding device.
[0192] Signaling: Signaling may refer to the transmission of information from an encoding device to a decoding device. Alternatively, signaling may refer to an encoding device including information within a bitstream or recording medium. Information signaled by an encoding device may be used by a decoding device.
[0193] - The encoding device can perform encoding on the signaled information to generate encoded information. The encoded information can be transmitted from the encoding device to a decoding device. The decoding device can obtain information by decoding the transmitted encoded information. Here, the encoding can be entropy encoding, and the decoding can be entropy decoding.
[0194] Selective signaling: Information can be selectively signaled. Selective signaling of information can mean that an encoding device selectively includes information (under certain conditions) in a bitstream or recording medium. Selective signaling of information can mean that a decoding device selectively extracts information (under certain conditions) from a bitstream.
[0195] Omission of signaling: Signaling for information may be omitted. Omission of signaling for information may mean that the encoding device (under certain conditions) does not include the information in the bitstream or recording medium. Omission of signaling for information may mean that the decoding device (under certain conditions) does not extract the information from the bitstream.
[0196] Statistical value: Variables, coding parameters, and constants can have values that can be operated on. A statistical value can be a value generated by an operation on the values of these specific objects. For example, a statistical value can be one or more of the following values: an average, a weighted average, a weighted sum, a minimum, a maximum, a mode, a median, and an interpolation value for the values of a specific variable, a specific coding parameter, and a specific constant.
[0197]
[0198] Figure 1 is a block diagram showing the configuration according to one embodiment of an encoding device to which the present invention is applied.
[0199] The encoding device (100) may be an encoder, a video encoding device, or an image encoding device. The video may include one or more images. The encoding device (100) may sequentially encode one or more images of the video.
[0200] Referring to FIG. 1, the encoding device (100) may include an inter prediction unit (110), an intra 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).
[0201] The encoding device (100) can perform encoding on a target image using an intra mode and / or an inter mode. In other words, the prediction mode for the target block can be one of the intra mode and the inter mode.
[0202] Hereinafter, the terms “intra mode”, “intra prediction mode”, “intra-screen mode” and “intra-screen prediction mode” may be used interchangeably and have the same meaning.
[0203] Hereinafter, the terms “inter mode”, “inter prediction mode”, “inter-screen mode” and “inter-screen prediction mode” may be used interchangeably and have the same meaning.
[0204] Hereinafter, the term "image" may refer to only a portion of an image, or may refer to a block. Furthermore, processing an "image" may refer to sequential processing of multiple blocks.
[0205] Additionally, the encoding device (100) can generate a bitstream including encoded information through encoding of a target image, and can output and store the generated bitstream. The generated bitstream can be stored in a computer-readable recording medium and can be streamed via wired and / or wireless transmission media.
[0206] As a prediction mode, when the intra mode is used, the switch (115) can be switched to intra. As a prediction mode, when the inter mode is used, the switch (115) can be switched to inter.
[0207] The encoding device (100) can generate a prediction block for a target block. In addition, after the prediction block is generated, the encoding device (100) can encode a residual block for the target block using the residual of the target block and the prediction block.
[0208] When the prediction mode is intra mode, the intra prediction unit (120) can use pixels of blocks adjacent to the target block that have already been encoded and / or decoded as reference samples. The intra prediction unit (120) can perform spatial prediction on the target block using the reference samples, and can generate prediction samples for the target block through spatial prediction. The prediction samples can refer to samples within the prediction block.
[0209] The inter prediction unit (110) may include a motion prediction unit and a motion compensation unit.
[0210] When the prediction mode is inter mode, the motion prediction unit can search for an area from the reference image that best matches the target block during the motion prediction process, and can use the searched area to derive a motion vector for the target block and the searched area. In this case, the motion prediction unit can use a search area as the area to be searched.
[0211] The reference image may be stored in a reference picture buffer (190), and when encoding and / or decoding for the reference image is processed, the encoded and / or decoded reference image may be stored in the reference picture buffer (190).
[0212] As the decoded picture is stored, the reference picture buffer (190) may be a decoded picture buffer (DPB).
[0213] The motion compensation unit can generate a prediction block for a target block by performing motion compensation using a motion vector. Here, the motion vector may be a two-dimensional vector used for inter prediction. The motion vector may also indicate an offset between the target image and the reference image.
[0214] The motion prediction unit and the motion compensation unit can generate a prediction block by applying an interpolation filter to some areas within a reference image when a motion vector has a non-integer value. In order to perform inter prediction or motion compensation, it can be determined based on the CU whether the method of motion prediction and motion compensation of a PU included in the CU is skip mode, merge mode, Advanced Motion Vector Prediction (AMVP) mode, and current picture reference mode, and inter prediction or motion compensation can be performed according to each mode.
[0215] The subtractor (125) can generate a residual block, which is the difference between the target block and the predicted block. The residual block may also be referred to as a residual signal.
[0216] A 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, quantizing, or transforming and quantizing the difference between the original signal and the predicted signal. A residual block may be a residual signal for a block unit.
[0217] The transformation unit (130) can generate a transformation coefficient by performing a transformation on the residual block and output the generated transformation coefficient. Here, the transformation coefficient may be a coefficient value generated by performing a transformation on the residual block.
[0218] The conversion unit (130) can use one of a plurality of predefined conversion methods to perform the conversion.
[0219] The predefined multiple transform methods may include transforms based on the Discrete Cosine Transform (DCT), the Discrete Sine Transform (DST), and the Karhunen-Loeve Transform (KLT).
[0220] The transformation method used for transforming the residual block may be determined based on at least one of the coding parameters for the target block and / or neighboring blocks. For example, the transformation method may be determined based on at least one of the inter-prediction mode for the PU, the intra-prediction mode for the PU, the size of the TU, and the shape of the TU. Alternatively, transformation information indicating the transformation method may be signaled from the encoding device (100) to the decoding device (200).
[0221] When the transform skip mode is applied, the transform unit (130) may omit the transformation for the residual block.
[0222] By applying quantization to a transform coefficient, a quantized transform coefficient level or a quantized level can be generated. In the following embodiments, a quantized transform coefficient level and a quantized level may also be referred to as a transform coefficient.
[0223] The quantization unit (140) can generate a quantized transform coefficient level (i.e., a quantized level or quantized coefficient) by quantizing the transform coefficient according to a quantization parameter. The quantization unit (140) can output the generated quantized transform coefficient level. At this time, the quantization unit (140) can quantize the transform coefficient using a quantization matrix.
[0224] The entropy encoding unit (150) can generate a bitstream by performing entropy encoding according to a probability distribution based on values produced by the quantization unit (140) and / or coding parameter values produced during the encoding process. The entropy encoding unit (150) can output the generated bitstream.
[0225] The entropy encoding unit (150) can perform entropy encoding on information about pixels of an image and information for decoding the image. For example, the information for decoding the image may include syntax elements, etc.
[0226] When entropy coding is applied, a small number of bits can be allocated to symbols with a high probability of occurrence, while a large number of bits can be allocated to symbols with a low probability of occurrence. As symbols are represented through this allocation, the size of the bitstring for the symbols being encoded can be reduced. Therefore, entropy coding can improve the compression performance of image coding.
[0227] In addition, the entropy encoding unit (150) can use encoding methods such as exponential golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC) for entropy encoding. For example, the entropy encoding unit (150) can perform entropy encoding using a variable length coding (Variable Length Coding / Code; VLC) table. For example, the entropy encoding unit (150) can derive a binarization method for a target symbol. In addition, the entropy encoding unit (150) can derive a probability model of a target symbol / bin. The entropy encoding unit (150) may also perform arithmetic encoding using the derived binarization method, probability model, and context model.
[0228] The entropy encoding unit (150) can change the coefficients of a two-dimensional block form into a one-dimensional vector form through a transform coefficient scanning method to encode a quantized transform coefficient level.
[0229] Coding parameters may be information required for encoding and / or decoding. Coding parameters may include information encoded by the encoding device (100) and transmitted from the encoding device (100) to the decoding device, and may include information that may be derived during the encoding or decoding process. For example, syntax elements may be included as information transmitted to the decoding device.
[0230] Coding parameters may include information (or flags and indices, etc.) encoded in an encoding device and signaled from the encoding device to the decoding device, such as syntax elements, as well as information derived during the encoding or decoding process. In addition, coding parameters may include information required for encoding or decoding an image. For example, the size of the unit / block, the shape 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 the form of a quad tree, information indicating whether the unit / block is partitioned in the form of a binary tree, the partition direction (horizontal direction or vertical direction) of the binary tree, the partition type (symmetric partition or asymmetric partition) of the binary tree, information indicating whether the unit / block is partitioned in the form of a ternary tree, the partition direction (horizontal direction or vertical direction) of the ternary tree, the partition type (symmetric partition or asymmetric partition, etc.) of the ternary tree, information indicating whether the unit / block is partitioned in the form of a multi-type tree, the combination and direction (horizontal direction or vertical direction, etc.) of the partition of the multi-type tree, the partition type (symmetric partition or asymmetric partition), the partition tree of the multi-type tree (binary tree or ternary tree), the type of the prediction mode (intra prediction or inter prediction), the intra prediction mode / direction, the intra luma prediction mode / direction, the intra chroma prediction mode / direction, the intra Segmentation information, inter-segmentation information, coding block segmentation flag, prediction block segmentation flag, transform block segmentation flag, reference sample filtering method, reference sample filter tap, reference sample filter coefficient, prediction block filtering method, prediction block filter tap, prediction block filter coefficient, prediction block boundary filtering method, prediction block boundary filter tap, prediction block boundary filter coefficient, inter-prediction mode, motion information, motion vector, motion vector difference, reference picture index,Inter prediction direction, inter prediction indicator, prediction list utilization flag, reference picture list, reference video, POC, motion vector predictor, motion vector prediction index, motion vector prediction candidate, motion vector candidate list, information indicating whether to use merge mode, merge index, merge candidate, merge candidate list, information indicating whether to use skip mode, type of interpolation filter, filter tap of interpolation filter, filter coefficient of interpolation filter, motion vector magnitude, motion vector representation accuracy, transform type, transform magnitude, information indicating whether to use primary transform, information indicating whether to use additional (secondary) transform, primary transform selection information (or primary transform index), secondary transform selection information (or secondary transform index), information indicating whether to use residual signal, coded block pattern, coded block flag, quantization parameter, residual quantization parameter, quantization matrix, information about intra-loop filter, information indicating whether to apply intra-loop filter, intra-loop Coefficients of the filter, filter taps of the intra-loop filter, shape / form of the intra-loop filter, information indicating whether a deblocking filter is applied, coefficients of the deblocking filter, filter taps of the deblocking filter, strength of the deblocking filter, shape / form of the deblocking filter, information indicating whether an adaptive sample offset is applied, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, information indicating whether an adaptive in-loop filter is applied, coefficients of the adaptive in-loop filter, filter taps of the adaptive in-loop filter, shape / form of the adaptive in-loop filter, binarization / debinarization method, context model, context model determination method, context model update method, information indicating whether a regular mode is performed, information indicating whether a bypass mode is performed,A significant coefficient flag, a last significant coefficient flag, a coefficient group unit coding flag, a last significant coefficient position, a flag indicating whether a coefficient value is greater than 1, a flag indicating whether a coefficient value is greater than 2, a flag indicating whether a coefficient value is greater than 3, remaining coefficient value information, sign information, a reconstructed luma sample, a reconstructed chroma sample, a context bin, a bypass bin, a residual luma sample, a residual chroma sample, a transform coefficient, a luma transform coefficient, a chroma transform coefficient, a quantized level, a luma quantized level, a chroma quantized level, a transform coefficient level, a luma transform coefficient level, a chroma transform coefficient level, a transform coefficient level scanning method, a size of a motion vector search region on the side of a decoding device, a shape of a motion vector search region on the side of a decoding device, a number of motion vector searches on the side of a decoding device, a CTU size, a minimum block size, a maximum block size, a maximum block depth, a minimum block depth, an image display / output order, a slice identification information, a slice type, slice partitioning information, a tile group identification information, a tile group type, Tile group partition information, tile identification information, tile type, tile partition information, picture type, bit depth, input sample bit depth, reconstructed sample bit depth, residual sample bit depth, transform coefficient bit depth, quantized level bit depth, information about a luma signal, information about a chroma signal, a value of at least one of a color space of a target block and a color space of a residual block, a combined shape or statistics may be included in the coding parameters. In addition, information related to the above-described coding parameters may also be included in the coding parameters. Information used to calculate and / or derive the above-described coding parameters may also be included in the coding parameters. Information calculated or derived using the above-described coding parameters may also be included in the coding parameters.
[0231] The primary transformation selection information can indicate the primary transformation applied to the target block.
[0232] Secondary transformation selection information can indicate a secondary transformation to be applied to the target block.
[0233] A 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. A residual block may be a residual signal for a block.
[0234] Here, signaling information may mean including entropy-encoded information generated by performing entropy encoding on a flag or index in an encoding device (100) into a bitstream, and may mean obtaining information by performing entropy decoding on entropy-encoded information extracted from a bitstream in a decoding device (200). Here, the information may include flags, indices, etc.
[0235] A signal may refer to information being signaled. Hereinafter, information about an image and a block may be referred to as a signal. Furthermore, the terms "information" and "signal" may be used interchangeably and have the same meaning herein. 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.
[0236] A bitstream may contain information according to a specific syntax. An encoding device (100) may generate a bitstream containing information according to a specific syntax. An encoding device (200) may obtain information from a bitstream according to a specific syntax.
[0237] Since encoding is performed through inter prediction by the encoding device (100), the encoded target image can be used as a reference image for other image(s) to be processed later. Accordingly, the encoding device (100) can reconstruct or decode the encoded target image again and store the reconstructed or decoded image as a reference image in the reference picture buffer (190). Inverse quantization and inverse transformation can be processed for the encoded target image for decoding.
[0238] The quantized level can be inversely quantized in the inverse quantization unit (160) and inversely transformed in the inverse transformation unit (170). The inverse quantization unit (160) can generate inversely quantized coefficients by performing inverse quantization on the quantized level. The inverse transformation unit (170) can generate inversely quantized and inversely transformed coefficients by performing inverse transformation on the inverse quantized coefficients.
[0239] The dequantized and inversely transformed coefficients can be combined with the prediction block through an adder (175), and a reconstructed block can be generated by combining the dequantized and inversely transformed coefficients with the prediction block. Here, the dequantized and / or inversely transformed coefficients may mean coefficients on which at least one of dequantization and inverse transformation has been performed, and may mean a reconstructed residual block. Here, the reconstructed block may mean a recovered block or a decoded block.
[0240] The reconstructed block may pass through a filter unit (180). The filter unit (180) may apply at least one of a deblocking filter, a sample adaptive offset (SAO), an adaptive loop filter (ALF), and a non-local filter (NLF) to the reconstructed sample, the reconstructed block, or the reconstructed picture. The filter unit (180) may also be referred to as an in-loop filter.
[0241] A deblocking filter can remove block distortion that occurs at the boundaries between blocks within a reconstructed picture. To determine whether to apply a deblocking filter to a target block, the decision can be made based on the pixel(s) contained in a number of columns or rows within the block.
[0242] When applying a deblocking filter to a target block, the applied filter may vary depending on the strength of the required deblocking filtering. In other words, among different filters, a filter determined based on the strength of the deblocking filtering may be applied to the target block. When applying a deblocking filter to a target block, one or more of a long-tap filter, a strong filter, a weak filter, and a Gaussian filter may be applied to the target block, depending on the strength of the required deblocking filtering.
[0243] Additionally, when vertical filtering and horizontal filtering are performed on the target block, the horizontal filtering and vertical filtering can be processed in parallel.
[0244] SAO can add an appropriate offset to the pixel value of a pixel to compensate for coding errors. SAO can perform compensation using an offset for the difference between the original image and the deblocked image on a pixel-by-pixel basis for an image to which deblocking has been applied. To perform offset compensation on an image, a method can be used in which the pixels included in the image are divided into a certain number of regions, and then the regions to which the offset is to be performed are determined among the divided regions, and the offset is applied to the determined regions. Alternatively, a method can be used in which the offset is applied by considering the edge information of each pixel of the image.
[0245] ALF can perform filtering based on the values compared between the reconstructed image and the original image. After dividing the pixels contained in the image into predetermined groups, the filter to be applied to each divided group can be determined, and filtering can be performed differentially for each group. Information regarding whether to apply an adaptive loop filter can be signaled for each CU. This information can be signaled in the luma signal. The shape and filter coefficients of the ALF to be applied to each block can vary for each block. Alternatively, a fixed form of ALF can be applied to a block regardless of the characteristics of the block.
[0246] A non-local filter can perform filtering based on reconstructed blocks similar to the target block. Regions similar to the target block can be selected from the reconstructed image, and filtering of the target block can be performed using statistical properties of the selected similar regions. Information regarding whether to apply a non-local filter can be signaled to the CU. Furthermore, the shapes and filter coefficients of the non-local filter applied to the blocks can vary depending on the block.
[0247] A reconstructed block or reconstructed image that has passed through the filter unit (180) may be stored as a reference picture in a reference picture buffer (190). The reconstructed block that has passed through the filter unit (180) may be a part of a reference picture. In other words, the reference picture may be a reconstructed picture composed of reconstructed blocks that have passed through the filter unit (180). The stored reference picture may then be used for inter prediction or motion compensation.
[0248]
[0249] Figure 2 is a block diagram showing the configuration according to one embodiment of a decryption device to which the present invention is applied.
[0250] The decoding device (200) may be a decoder, a video decoding device, or an image decoding device.
[0251] Referring to FIG. 2, the decoding device (200) may include an entropy decoding unit (210), an inverse quantization unit (220), an inverse transformation unit (230), an intra prediction unit (240), an inter prediction unit (250), a switch (245), an adder (255), a filter unit (260), and a reference picture buffer (270).
[0252] The decoding device (200) can receive a bitstream output from the encoding device (100). The decoding device (200) can receive a bitstream stored in a computer-readable recording medium, and can receive a bitstream streamed through a wired / wireless transmission medium.
[0253] The decoding device (200) can perform intra-mode and / or inter-mode decoding on the bitstream. In addition, the decoding device (200) can generate a reconstructed image or a decoded image through decoding, and output the generated reconstructed image or the decoded image.
[0254] For example, switching between intra mode and inter mode depending on the prediction mode used for decoding can be performed by a switch (245). If the prediction mode used for decoding is intra mode, the switch (245) can be switched to intra. If the prediction mode used for decoding is inter mode, the switch (245) can be switched to inter.
[0255] The decoding device (200) can obtain a reconstructed residual block by decoding the input bitstream and can generate a prediction block. Once the reconstructed residual block and prediction block are obtained, the decoding device (200) can generate a reconstructed block to be decoded by combining the reconstructed residual block and prediction block.
[0256] The entropy decoding unit (210) can generate symbols by performing entropy decoding on the bitstream based on a probability distribution for the bitstream. The generated symbols can include symbols in the form of quantized transform coefficient levels (i.e., quantized levels or quantized coefficients). Here, the entropy decoding method can be similar to the entropy encoding method described above. For example, the entropy decoding method can be a reverse process of the entropy encoding method described above.
[0257] The entropy decoding unit (210) can change a coefficient in the form of a one-dimensional vector into the form of a two-dimensional block through a transform coefficient scanning method in order to decode a quantized transform coefficient level.
[0258] For example, coefficients can be converted into a two-dimensional block shape by scanning the coefficients of a block using the upper right diagonal scan. Alternatively, depending on the block size and / or intra prediction mode, which scan among the upper right diagonal scan, vertical scan, and horizontal scan is used can be determined.
[0259] The quantized coefficients can be dequantized in the dequantization unit (220). The dequantization unit (220) can generate dequantized coefficients by performing dequantization on the quantized coefficients. In addition, the dequantized coefficients can be inversely transformed in the inverse transformation unit (230). The inverse transformation unit (230) can generate a reconstructed residual block by performing inverse transformation on the dequantized coefficients. As a result of performing inverse quantization and inverse transformation on the quantized coefficients, a reconstructed residual block can be generated. At this time, the inverse quantization unit (220) can apply a quantization matrix to the quantized coefficients when generating the reconstructed residual block.
[0260] When the intra mode is used, the intra prediction unit (240) can generate a prediction block by performing spatial prediction on the target block using pixel values of already decoded blocks neighboring the target block.
[0261] The inter prediction unit (250) may include a motion compensation unit. Alternatively, the inter prediction unit (250) may be referred to as a motion compensation unit.
[0262] When the inter mode is used, the motion compensation unit can generate a prediction block by performing motion compensation on the target block using a motion vector and a reference image stored in the reference picture buffer (270).
[0263] The motion compensation unit may apply an interpolation filter to a portion of a reference image when a motion vector has a non-integer value, and may generate a prediction block using the reference image to which the interpolation filter has been applied. In order to perform motion compensation, the motion compensation unit may determine which mode among skip mode, merge mode, AMVP mode, and current picture reference mode is the motion compensation method used for the PU included in the CU based on the CU, and may perform motion compensation according to the determined mode.
[0264] The reconstructed residual block and prediction block can be added through an adder (255). The adder (255) can generate a reconstructed block by adding the reconstructed residual block and prediction block.
[0265] The reconstructed block may pass through a filter unit (260). The filter unit (260) may apply at least one of a deblocking filter, SAO, ALF, and a non-local filter to the reconstructed block or the reconstructed image. The reconstructed image may be a picture including the reconstructed block.
[0266] The filter unit (260) can output a reconstructed image.
[0267] The reconstructed block and / or reconstructed image that has passed through the filter unit (260) may be stored as a reference picture in the reference picture buffer (270). The reconstructed block that has passed through the filter unit (260) may be a part of a reference picture. In other words, the reference picture may be a reconstructed image composed of the reconstructed blocks that have passed through the filter unit (260). The stored reference picture may be used for subsequent inter prediction and / or motion compensation.
[0268]
[0269] Figure 3 is a diagram schematically showing the division structure of an image when encoding and decoding an image.
[0270] Figure 3 can schematically represent an example in which one unit is divided into multiple sub-units.
[0271] To efficiently segment images, coding units (CUs) may be used during encoding and decoding. A unit may be a term referring to 1) a block containing image samples and 2) a syntax element. For example, "segmentation of a unit" may mean "segmentation of a block corresponding to a unit."
[0272] A CU can be used as a basic unit for image encoding and / or decoding. Furthermore, a CU can be used as a unit to which a selected mode, either intra-mode or inter-mode, is applied during image encoding and / or decoding. In other words, during image encoding and / or decoding, it can be determined which mode, either intra-mode or inter-mode, will be applied to each CU.
[0273] Additionally, a CU can be a basis unit for prediction, transformation, quantization, inverse transformation, inverse quantization, and encoding and / or decoding of transform coefficients.
[0274] Referring to FIG. 3, an image (300) can be sequentially divided into units of Largest Coding Units (LCUs). For each LCU, a division structure can be determined. Here, LCU can be used in the same sense as Coding Tree Units (CTUs).
[0275] Partitioning a unit may refer to the division of a block corresponding to the unit. Block partitioning information may include depth information regarding the depth of the unit. Depth information may indicate the number of times and / or degree to which the unit is partitioned. A single unit may be hierarchically divided into multiple subunits based on depth information based on a tree structure.
[0276] Each partitioned sub-unit can have depth information. The depth information can be information indicating the size of the CU. Depth information can be stored for each CU.
[0277] Each CU can have depth information. When a CU is split, the CUs generated by the split can have a depth that is 1 more than the depth of the split CU.
[0278] The partition structure may refer to the distribution of CUs within an LCU (310) for efficiently encoding an image. This distribution may be determined based on whether a single CU is partitioned into multiple CUs. The number of partitioned CUs may be a positive integer greater than or equal to 2, including 2, 4, 8, and 16.
[0279] The horizontal and vertical dimensions of a CU generated by a partition may be smaller than the horizontal and vertical dimensions of the CU before the partition, depending on the number of CUs generated by the partition. For example, the horizontal and vertical dimensions of a CU generated by a partition may be half the horizontal and half the vertical dimensions of the CU before the partition.
[0280] The partitioned CU can be recursively partitioned into multiple CUs in the same manner. By recursively partitioning, at least one of the horizontal size and the vertical size of the partitioned CU can be reduced compared to at least one of the horizontal size and the vertical size of the CU before partitioning.
[0281] The partitioning of a CU can be done recursively up to a predefined depth or a predefined size.
[0282] For example, the depth of a CU can have a value from 0 to 3. The size of a CU can range from 64x64 to 8x8 depending on the depth of the CU.
[0283] For example, the depth of the LCU (310) may be 0, and the depth of the smallest coding unit (SCU) may be a predefined maximum depth. Here, the LCU may be a CU having the largest coding unit size as described above, and the SCU may be a CU having the smallest coding unit size.
[0284] Splitting can start from LCU (310), and each time the horizontal size and / or vertical size of the CU is reduced by the splitting, the depth of the CU can increase by 1.
[0285] For example, for each depth, a CU that is not split may have a size of 2Nx2N. Furthermore, for a CU that is split, a CU of size 2Nx2N may be split into four CUs of size NxN. The size of N may be halved each time the depth increases by 1.
[0286] Referring to FIG. 3, an LCU with depth 0 can be 64x64 pixels or a 64x64 block. 0 can be the minimum depth. An SCU with depth 3 can be 8x8 pixels or an 8x8 block. 3 can be the maximum depth. In this case, a CU of a 64x64 block, which is an LCU, can be represented by depth 0. A CU of a 32x32 block can be represented by depth 1. A CU of a 16x16 block can be represented by depth 2. A CU of an 8x8 block, which is an SCU, can be represented by depth 3.
[0287] Information about whether a CU is split can be expressed through the CU's split information. The split information can be 1-bit information. All CUs except SCUs can include split information. For example, the value of the split information of a CU that is not split can be a first value, and the value of the split information of a CU that is split can be a second value. If the split information indicates whether the CU is split, the first value can be 0, and the second value can be 1.
[0288] For example, when one CU is partitioned into four CUs, the width and height of each CU of the four CUs generated by the partitioning may be half the width and half the height of the CU before the partitioning, respectively. When a CU of size 32x32 is partitioned into four CUs, the sizes of the four partitioned CUs may be 16x16. When one CU is partitioned into four CUs, it can be said that the CU is partitioned in a quad-tree form. In other words, it can be seen that a quad-tree partition is applied to the CU.
[0289] For example, when one CU is split into two CUs, the width or height of each CU of the two CUs created by the split may be half the width or half the height of the CU before the split, respectively. When a CU of size 32x32 is split vertically into two CUs, the sizes of the two split CUs may be 16x32. When a CU of size 32x32 is split horizontally into two CUs, the sizes of the two split CUs may be 32x16. When one CU is split into two CUs, it can be said that the CU is split in the form of a binary tree. In other words, it can be seen that a binary tree partition is applied to the CU.
[0290] For example, when one CU is split into three CUs, three split CUs can be created by splitting the width or height of the CU before splitting in a ratio of 1:2:1. For example, when a CU of size 16x32 is split into three CUs horizontally, the three split CUs can have sizes of 16x8, 16x16, and 16x8 from the top, respectively. For example, when a CU of size 32x32 is split into three CUs vertically, the three split CUs can have sizes of 8x32, 16x32, and 8x32 from the left, respectively. When one CU is split into three CUs, it can be said that the CU is split in a ternary-tree form. In other words, it can be seen that a ternary-tree partition is applied to the CU.
[0291] In the LCU (310) of Fig. 3, both quad-tree type division and binary-tree type division were applied.
[0292] In the encoding device (100), a coding tree unit (CTU) of 64x64 size can be divided into a plurality of smaller CUs by a recursive quad-tree structure. One CU can be divided into four CUs of the same size. The CU can be divided recursively, and each CU can have a quad-tree structure.
[0293] Through recursive partitioning of CU, the optimal partitioning method that produces the minimum rate-distortion ratio can be selected.
[0294] CTU (320) of Fig. 3 is an example of a CTU to which quad tree partitioning, binary tree partitioning, and ternary tree partitioning are all applied.
[0295] As described above, to partition a CTU, at least one of a quad tree partition, a binary tree partition, and a ternary tree partition may be applied to the CTU. The partitions may be applied based on a specified priority.
[0296] For example, a quad-tree partitioning may be preferentially applied to a CTU. A CU that cannot be further partitioned into a quad-tree may correspond to a leaf node of the quad-tree. A CU corresponding to a leaf node of the quad-tree may become a root node of a binary tree and / or a ternary tree. That is, a CU corresponding to a leaf node of the quad-tree may be partitioned into a binary tree or a ternary tree, or may not be partitioned any further. In this case, by preventing quad-tree partitioning from being applied again to a CU generated by applying binary tree partitioning or ternary tree partitioning to a CU corresponding to a leaf node of the quad-tree, partitioning of the block and / or signaling of block partitioning information may be effectively performed.
[0297] The partitioning of a CU corresponding to each node of a quad tree can be signaled using quad partitioning information. Quad partitioning information having a first value (e.g., "1") can indicate that the CU is partitioned into a quad tree shape. Quad partitioning information having a second value (e.g., "0") can indicate that the CU is not partitioned into a quad tree shape. The quad partitioning information can be a flag having a specified length (e.g., 1 bit).
[0298] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, a CU corresponding to a leaf node of a quadtree may be partitioned into either a binary tree or a ternary tree. Furthermore, a CU generated by binary tree partitioning or ternary tree partitioning may be partitioned again into a binary tree or a ternary tree, or may not be partitioned any further.
[0299] A partition in which there is no priority between a binary tree partition and a ternary tree partition may be referred to as a multi-type tree partition. That is, a CU corresponding to a leaf node of a quad tree may become a root node of a multi-type tree. For the partition of a CU corresponding to each node of a multi-type tree, at least one of information indicating whether the multi-type tree is partitioned, information on the direction of the partition, and information on the partition tree may be signaled. For the partition of a CU corresponding to each node of a multi-type tree, information indicating whether the multi-type tree is partitioned, information on the direction of the partition, and information on the partition tree may be sequentially signaled.
[0300] For example, information indicating whether a multi-type tree having a first value (e.g., "1") is split may indicate that the corresponding CU is split into a multi-type tree form. Information indicating whether a multi-type tree having a second value (e.g., "0") is split may indicate that the corresponding CU is not split into a multi-type tree form.
[0301] When a CU corresponding to each node of a multi-type tree is split into a multi-type tree, the CU may further include split direction information.
[0302] Split direction information can indicate the split direction of a multi-type tree split. Split direction information having a first value (e.g., "1") can indicate that the corresponding CU is split in the vertical direction. Split direction information having a second value (e.g., "0") can indicate that the corresponding CU is split in the horizontal direction.
[0303] When a CU corresponding to each node of a multi-type tree is split into a multi-type tree, the CU may further include split tree information. The split tree information may indicate a tree used for splitting the multi-type tree.
[0304] For example, partition tree information having a first value (e.g., "1") may indicate that the corresponding CU is partitioned into a binary tree. Partition tree information having a second value (e.g., "0") may indicate that the corresponding CU is partitioned into a ternary tree.
[0305] Here, each of the information indicating whether to split, split tree information, and split direction information described above may be a flag having a specific length (e.g., 1 bit).
[0306] At least one of the quad partition information described above, information indicating whether a multi-type tree is partitioned, partition direction information, and partition tree information may be entropy encoded and / or entropy decoded. For entropy encoding / decoding of such information, information of neighboring CUs adjacent to the target CU may be utilized.
[0307] For example, it can be considered that the partitioning shapes (i.e., whether to partition, partitioning tree, and / or partitioning direction) of the left CU and / or the upper CU and the partitioning shape of the target CU are likely to be similar to each other. 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. At this time, the information of the neighboring CU can include at least one of 1) quad partitioning information of the neighboring CU, 2) information indicating whether to partition a multi-type tree, 3) partitioning direction information, and 4) partitioning tree information.
[0308] In another embodiment, among binary tree partitioning and ternary tree partitioning, binary tree partitioning may be performed preferentially. That is, binary tree partitioning may be applied first, and a CU corresponding to a leaf node of the binary tree may be set as the root node of the ternary tree. In this case, quad tree partitioning and binary tree partitioning may not be performed on a CU corresponding to a node of the ternary tree.
[0309] A CU that cannot be further split by quad-tree splitting, binary tree splitting, and / or ternary tree splitting can become a unit of encoding, prediction, and / or transformation. That is, a CU may not be further split for prediction and / or transformation. Accordingly, a split structure and split information for splitting a CU into prediction units and / or transformation units may not exist in the bitstream.
[0310] However, if the size of the CU that is the unit of division is larger than the size of the largest transform block, the CU can be recursively divided until the size of the CU becomes smaller than or equal to the size of the largest transform block. For example, if the size of the CU is 64x64 and the size of the largest transform block is 32x32, the CU can be divided into four 32x32 blocks for transformation. For example, if the size of the CU is 32x64 and the size of the largest transform block is 32x32, the CU can be divided into two 32x32 blocks for transformation.
[0311] In such cases, information about whether a CU is split for transformation may not be separately signaled. Without signaling, whether a CU is split may be determined by comparing the horizontal size (and / or vertical size) of the CU with the horizontal size (and / or vertical size) of the largest transform block. For example, if the horizontal size of the CU is greater than the horizontal size of the largest transform block, the CU may be split into two vertically. Additionally, if the vertical size of the CU is greater than the vertical size of the largest transform block, the CU may be split into two horizontally.
[0312] Information about the maximum size and / or minimum size of a CU, and information about the maximum size and / or minimum size of a transform block can be signaled or determined at a higher level for the CU. For example, the higher level can be a sequence level, a picture level, a tile level, a tile group level, a slice level, etc. For example, the minimum size of a CU can be determined as 4x4. For example, the maximum size of a transform block can be determined as 64x64. For example, the minimum size of a transform block can be determined as 4x4.
[0313] Information about the minimum size of a CU corresponding to a leaf node of a quad tree (i.e., quad tree minimum size) and / or information about the maximum depth of a path from a root node to a leaf node of a multi-type tree (i.e., multi-type tree maximum depth) can be signaled or determined at a higher level for the CU. For example, the higher level can be a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. Information about the quad tree minimum size and / or information about the multi-type tree maximum depth can be signaled or determined separately for each of an intra slice and an inter slice.
[0314] The differential information about the size of a CTU and the maximum size of a transform block can be signaled or determined at a higher level for the CU. For example, the higher level can be a sequence level, a picture level, a slice level, a tile group level, and a tile level. Information about the maximum size of a CU corresponding to each node of a binary tree (i.e., the maximum size of a binary tree) can be determined based on the size and differential information of the CTU. The maximum size of a CU corresponding to each node of a ternary tree (i.e., the maximum size of a ternary tree) can have different values depending on the type of the slice. For example, within an intra slice, the maximum size of a ternary tree can be 32x32. Also, for example, within an inter slice, the maximum size of a ternary tree can be 128x128. For example, the minimum size of a CU corresponding to each node of a binary tree (i.e., the minimum size of a binary tree) and / or the minimum size of a CU corresponding to each node of a ternary tree (i.e., the minimum size of a ternary tree) can be set to the minimum size of the CU.
[0315] As another example, the binary tree maximum size and / or the ternary tree maximum size may be signaled or determined at the slice level. Additionally, the binary tree minimum size and / or the ternary tree minimum size may be signaled or determined at the slice level.
[0316] Based on the various block sizes and depths described above, quad partitioning information, information indicating whether a multi-type tree is partitioned, partitioning tree information, and / or partitioning direction information may or may not be present in the bitstream.
[0317] For example, if the size of the CU is not larger than the quad tree minimum size, the CU may not contain quad partition information, and the quad partition information for the CU may be inferred as the second value.
[0318] For example, if the size (width and height) of a CU corresponding to a node of a multi-type tree is greater than the maximum size (width and height) of a binary tree and / or the maximum size (width and height) of a ternary tree, the CU may not be split into a binary tree and / or a ternary tree. Depending on this decision method, information indicating whether a multi-type tree is split may not be signaled and may be inferred as a second value.
[0319] Alternatively, if the size (width and height) of the CU corresponding to the node of the multi-type tree is equal to the minimum size (width and height) of the binary tree, or the size (width and height) of the CU is equal to twice the minimum size (width and height) of the ternary tree, the CU may not be split into a binary tree form and / or a ternary tree form. Depending on this decision method, the information indicating whether the multi-type tree is split may not be signaled and may be inferred as a second value. This is because splitting the CU into a binary tree form and / or a ternary tree form generates a CU smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree.
[0320] Alternatively, the binary tree split or ternary tree split may be limited based on the size of the virtual pipeline data unit (i.e., the pipeline buffer size). For example, if the binary tree split or ternary tree split would split the CU into sub-CUs that do not fit within the pipeline buffer size, the binary tree split or ternary tree split may be limited. The pipeline buffer size may be equal to the size of the largest transform block (e.g., 64X64).
[0321] For example, when the pipeline buffer size is 64X64, the following partitions may be limited.
[0322] - Ternary tree partitioning for NxM (N and / or M are 128) CUs
[0323] - Horizontal binary tree partitioning for 128xN (N <= 64) CUs
[0324] - Vertical binary tree partitioning for Nx128 (N <= 64) CUs
[0325] Alternatively, if the depth of the multi-type tree of the CU corresponding to the node of the multi-type tree is equal to the maximum depth of the multi-type tree, the CU may not be split into a binary tree and / or a ternary tree. Depending on this decision method, information indicating whether the multi-type tree is split may not be signaled and may be inferred as a second value.
[0326] Alternatively, for a CU corresponding to a node of a multi-type tree, information indicating whether the multi-type tree is split may be signaled only if at least one of a vertical binary tree split, a horizontal binary tree split, a vertical ternary tree split, and a horizontal ternary tree split is possible. Otherwise, the CU may not be split into a binary tree form and / or a ternary tree form. Depending on this decision method, information indicating whether the multi-type tree is split may not be signaled and may be inferred as a second value.
[0327] Alternatively, the split direction information may be signaled only if both vertical binary tree splitting and horizontal binary tree splitting are possible for the CU corresponding to the node of the multi-type tree, or if both vertical ternary tree splitting and horizontal ternary tree splitting are possible. Otherwise, the split direction information may not be signaled and may be inferred as a value indicating the direction in which the CU can be split.
[0328] Alternatively, the split tree information may be signaled only if both vertical binary tree splitting and vertical ternary tree splitting are possible for the CU corresponding to a node of the multi-type tree, or if both horizontal binary tree splitting and horizontal ternary tree splitting are possible. Otherwise, the split tree information may not be signaled and may be inferred as a value indicating a tree applicable to the split of the CU.
[0329]
[0330] Figure 4 is a diagram illustrating the form of a prediction unit that a coding unit can include.
[0331] Among the CUs split from the LCU, a CU that is no longer split can be split into one or more prediction units (PUs).
[0332] A PU can be the basic unit for prediction. A PU can be encoded and decoded in any of skip mode, inter mode, and intra mode. A PU can be segmented into various forms depending on each mode. For example, the target block described above with reference to FIG. 1 and the target block described above with reference to FIG. 2 can be PUs.
[0333] A CU may not be partitioned into PUs. If a CU is not partitioned into PUs, the size of the CU and the size of the PUs may be the same.
[0334] In skip mode, there may be no partitioning within a CU. In skip mode, a 2Nx2N mode (410) in which the sizes of PUs and CUs are the same without partitioning may be supported.
[0335] In inter mode, eight types of partitioned shapes can be supported within the CU. For example, in inter mode, 2Nx2N mode (410), 2NxN mode (415), Nx2N mode (420), NxN mode (425), 2NxnU mode (430), 2NxnD mode (435), nLx2N mode (440), and nRx2N mode (445) can be supported.
[0336] In intra mode, 2Nx2N mode (410) and NxN mode (425) can be supported.
[0337] In the 2Nx2N mode (410), a PU of size 2Nx2N can be encoded. A PU of size 2Nx2N can mean a PU of the same size as the size of a CU. For example, a PU of size 2Nx2N can have a size of 64x64, 32x32, 16x16, or 8x8.
[0338] In NxN mode (425), a PU of size NxN can be encoded.
[0339] For example, in intra prediction, when the size of the PU is 8x8, four split PUs can be encoded. The size of the split PUs can be 4x4.
[0340] When a PU is encoded by an intra mode, the PU may be encoded using one intra prediction mode among a plurality of intra prediction modes. For example, High Efficiency Video Coding (HEVC) technology may provide 35 intra prediction modes, and the PU may be encoded using one intra prediction mode among the 35 intra prediction modes.
[0341] Whether a PU will be encoded in 2Nx2N mode (410) or NxN mode (425) can be determined by the rate-distortion cost.
[0342] The encoding device (100) can perform an encoding operation on a PU having a size of 2Nx2N. Here, the encoding operation may be encoding the PU in each of a plurality of intra prediction modes that the encoding device (100) can use. Through the encoding operation, an optimal intra prediction mode for the PU having a size of 2Nx2N can be derived. The optimal intra prediction mode may be an intra prediction mode that generates the minimum rate-distortion cost for encoding a PU having a size of 2Nx2N among a plurality of intra prediction modes that the encoding device (100) can use.
[0343] In addition, the encoding device (100) can sequentially perform an encoding operation on each PU of the PUs divided into NxN. Here, the encoding operation may be encoding the PU in each of a plurality of intra prediction modes that the encoding device (100) can use. Through the encoding operation, an optimal intra prediction mode for a PU of size NxN can be derived. The optimal intra prediction mode may be an intra prediction mode that generates the minimum rate-distortion cost for encoding a PU of size NxN among a plurality of intra prediction modes that the encoding device (100) can use.
[0344] The encoding device (100) can determine which of the PUs of size 2Nx2N and the PUs of size NxN to encode based on a comparison of the rate-distortion cost of the PUs of size 2Nx2N and the rate-distortion costs of the PUs of size NxN.
[0345] A CU can be divided into one or more PUs, and a PU can also be divided into multiple PUs.
[0346] For example, when one PU is split into four PUs, the width and height of each PU of the four PUs generated by the split may be half the width and half the height of the PU before the split, respectively. When a PU of size 32x32 is split into four PUs, the sizes of the four split PUs may be 16x16. When one PU is split into four PUs, it can be said that the PU is split into a quad-tree shape.
[0347] For example, when one PU is split into two PUs, the horizontal size or vertical size of each PU of the two PUs created by the split may be half the horizontal size or half the vertical size of the PU before the split, respectively. When a PU of size 32x32 is split vertically into two PUs, the sizes of the two split PUs may be 16x32. When a PU of size 32x32 is split horizontally into two PUs, the sizes of the two split PUs may be 32x16. When one PU is split into two PUs, it can be said that the PU is split in a binary-tree form.
[0348]
[0349] Figure 5 is a diagram illustrating the form of a transformation unit that can be included in a coding unit.
[0350] A transform unit (TU) may be a basic unit used for the processes of transformation, quantization, inverse transformation, inverse quantization, entropy encoding, and entropy decoding within a CU.
[0351] A TU may have a square or rectangular shape. The shape of a TU may be determined based on the size and / or shape of a CU.
[0352] Among the CUs split from an LCU, a CU that is no longer split into CUs may be split into one or more TUs. In this case, the TU split structure may be a quad-tree structure. For example, as illustrated in FIG. 5, a single CU (510) may be split one or more times according to a quad-tree structure. Through splitting, a single CU (510) may be composed of TUs of various sizes.
[0353] When a CU is split more than once, the CU can be considered to be split recursively. Through splitting, a CU can be composed of TUs of various sizes.
[0354] Alternatively, a CU may be divided into one or more TUs based on the number of vertical and / or horizontal lines that divide the CU.
[0355] A CU can be divided into symmetric TUs or asymmetric TUs. For division into asymmetric TUs, information about the size and / or shape of the TU can be signaled from the encoding device (100) to the decoding device (200). Alternatively, the size and / or shape of the TU can be derived from information about the size and / or shape of the CU.
[0356] A CU may not be split into TUs. If a CU is not split into TUs, the size of the CU and the size of the TU may be the same.
[0357] A CU can be divided into one or more TUs, and a TU can also be divided into multiple TUs.
[0358] For example, when a TU is split into four TUs, the width and height of each TU of the four TUs generated by the split may be half the width and half the height of the TU before the split, respectively. When a TU of size 32x32 is split into four TUs, the sizes of the four split TUs may be 16x16. When a TU is split into four TUs, it can be said that the TU is split into a quad-tree shape.
[0359] For example, when a TU is split into two TUs, the width or height of each TU of the two TUs generated by the split may be half the width or half the height of the TU before the split, respectively. When a TU of size 32x32 is split vertically into two TUs, the sizes of the two split TUs may be 16x32. When a TU of size 32x32 is split horizontally into two TUs, the sizes of the two split TUs may be 32x16. When a TU is split into two TUs, it can be said that the TU is split in a binary-tree form.
[0360] The CU may be partitioned in other ways than those shown in Figure 5.
[0361] For example, one CU can be split into three CUs. The horizontal or vertical sizes of the three split CUs can be 1 / 4, 1 / 2, and 1 / 4 of the horizontal or vertical size of the CU before splitting, respectively.
[0362] For example, if a CU of size 32x32 is vertically divided into three CUs, the sizes of the three divided CUs may be 8x32, 16x32, and 8x32, respectively. In this way, if one CU is divided into three CUs, the CU can be viewed as being divided in the form of a ternary tree.
[0363] Any of the partitioning methods in the form of a quad tree, a binary tree, or a ternary tree can be applied to partition a CU, and multiple partitioning methods can also be combined and used to partition a CU. In this case, when multiple partitioning methods are combined and used, it can be referred to as partitioning in the form of a composite tree.
[0364]
[0365] Figure 6 illustrates the division of blocks according to an example.
[0366] During the process of encoding and / or decoding an image, a target block may be divided as shown in Fig. 6. For example, the target block may be a CU.
[0367] For segmentation of a target block, an indicator indicating segmentation information may be signaled from an encoding device (100) to a decoding device (200). The segmentation information may be information indicating how the target block is segmented.
[0368] 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 quad tree 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”).
[0369] split_flag can be a flag indicating whether a block is split. For example, a split_flag value of 1 can indicate that the block is split. A split_flag value of 0 can indicate that the block is not split.
[0370] QB_flag may be a flag indicating whether the block is partitioned into a quad tree or a binary tree. For example, a value of 0 for QB_flag may indicate that the block is partitioned into a quad tree. A value of 1 for QB_flag may indicate that the block is partitioned into a binary tree. Alternatively, a value of 0 for QB_flag may indicate that the block is partitioned into a binary tree. A value of 1 for QB_flag may indicate that the block is partitioned into a quad tree.
[0371] quadtree_flag can be a flag indicating whether the block is partitioned into a quadtree shape. For example, a value of 1 for quadtree_flag can indicate that the block is partitioned into a quadtree shape. A value of 0 for quadtree_flag can indicate that the block is not partitioned into a quadtree shape.
[0372] binarytree_flag can be a flag indicating whether the block is partitioned into a binary tree. For example, a value of 1 for binarytree_flag can indicate that the block is partitioned into a binary tree. A value of 0 for binarytree_flag can indicate that the block is not partitioned into a binary tree.
[0373] Btype_flag can be a flag indicating whether the block is partitioned vertically or horizontally when partitioned in the form of a binary tree. For example, a value of 0 for Btype_flag can indicate that the block is partitioned horizontally. A value of 1 for Btype_flag can indicate that the block is partitioned vertically. Alternatively, a value of 0 for Btype_flag can indicate that the block is partitioned vertically. A value of 1 for Btype_flag can indicate that the block is partitioned horizontally.
[0374] For example, the partitioning information for the block in FIG. 6 can be derived by signaling at least one of quadtree_flag, binarytree_flag, and Btype_flag as shown in Table 1 below.
[0375] [Table 1]
[0376]
[0377] For example, the split information for the block in FIG. 6 can be derived by signaling at least one of split_flag, QB_flag, and Btype_flag as shown in Table 2 below.
[0378] [Table 2]
[0379]
[0380] The splitting method may be limited to a quad tree or a binary tree, depending on the size and / or shape of the block. If such a limitation applies, split_flag may be a flag indicating whether to split in a quad tree shape or a flag indicating whether to split in a binary tree shape. 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).
[0381] If the block size falls within a specified range, only quad-tree-type partitioning may be possible. For example, the specified range may be defined by at least one of the maximum block size and the minimum block size, for which only quad-tree-type partitioning is possible.
[0382] Information indicating the maximum block size and / or minimum block size that can only be split in the form of a quat tree can be signaled from the encoding device (100) to the decoding device (200) via a bitstream. In addition, such information can be signaled for at least one unit among a video, a sequence, a picture, a parameter, a tile group, and a slice (or segment).
[0383] Alternatively, the maximum block size and / or minimum block size may be fixed sizes predefined in the encoding device (100) and the decoding device (200). For example, if the block size is greater than or equal to 64x64 and less than or equal to 256x256, only quad-tree-type splitting may be possible. In this case, split_flag may be a flag indicating whether to split in quad-tree form.
[0384] If the block size is larger than the maximum transform block size, only a quad-tree-type split may be possible. In this case, the split block may be at least one of a CU and a TU.
[0385] In this case, split_flag can be a flag indicating whether to split into a quad tree form.
[0386] If the block size falls within a specified range, only binary tree-type or ternary tree-type partitioning may be possible. Here, for example, the specified range may be defined by at least one of a maximum block size and a minimum block size within which only binary tree-type or ternary tree-type partitioning is possible.
[0387] Information indicating the maximum block size and / or minimum block size that can only be divided into binary tree-type or ternary tree-type divisions can be signaled from the encoding device (100) to the decoding device (200) via a bitstream. In addition, such information can be signaled for at least one unit among a sequence, a picture, and a slice (or a segment).
[0388] Alternatively, the maximum block size and / or minimum block size may be fixed sizes predefined in the encoding device (100) and the decoding device (200). For example, if the block size is greater than or equal to 8x8 and less than or equal to 16x16, only binary tree-type splitting may be possible. In this case, split_flag may be a flag indicating whether to split in binary tree form or ternary tree form.
[0389] The description of partitioning in the quad tree form described above can be equally applied to partitioning in the binary tree form and / or ternary tree form.
[0390] The division of a block may be restricted by previous divisions. For example, if a block is divided into a specific binary tree shape, generating multiple divided blocks, each divided block can only be further divided into a specific tree shape. Here, the specific tree shape may be at least one of a binary tree shape, a ternary tree shape, and a quad tree shape.
[0391] The above-mentioned indicator may not be signaled if the width or height of the split block is such that it cannot be split any further.
[0392]
[0393] Figure 7 is a diagram for explaining an embodiment of an intra prediction process.
[0394] The arrows extending from the center to the periphery of the graph in Fig. 7 may represent the prediction directions of directional intra prediction modes. Additionally, the numbers displayed close to the arrows may represent examples of mode values assigned to intra prediction modes or prediction directions of intra prediction modes.
[0395] In Fig. 7, the number 0 may represent the Planar mode, which is a non-directional intra prediction mode. The number 1 may represent the DC mode, which is a non-directional intra prediction mode.
[0396] Intra encoding and / or decoding may be performed using reference samples of neighboring blocks of the target block. The neighboring blocks may be reconstructed neighboring blocks. The reference samples may refer to neighboring samples.
[0397] For example, intra encoding and / or decoding can be performed using values or coding parameters of reference samples contained in reconstructed neighboring blocks.
[0398] The encoding device (100) and / or the decoding device (200) can generate a prediction block by performing intra prediction on a target block based on information of a sample in a target image. When performing intra prediction, the encoding device (100) and / or the decoding device (200) can generate a prediction block for the target block by performing intra prediction based on information of a sample in the target image. When performing intra prediction, the encoding device (100) and / or the decoding device (200) can perform directional prediction and / or non-directional prediction based on at least one reconstructed reference sample.
[0399] A prediction block may refer to a block generated as a result of performing intra prediction. A prediction block may correspond to at least one of a CU, PU, and TU.
[0400] A unit of a prediction block can be at least one of the sizes of CU, PU, and TU. A prediction block can have a square shape with a size of 2Nx2N or a size of NxN. The size of NxN can include 4x4, 8x8, 16x16, 32x32, and 64x64, etc.
[0401] Alternatively, the prediction block may be a square block having a size such as 2x2, 4x4, 8x8, 16x16, 32x32 or 64x64, or a rectangular block having a size such as 2x8, 4x8, 2x16, 4x16 and 8x16.
[0402] Intra prediction can be performed based on the intra prediction mode for the target block. The number of intra prediction modes that the target block can have can be a predefined fixed value, or can be determined differently depending on the properties of the prediction block. For example, the properties of the prediction block can include the size of the prediction block and the type of the prediction block. Additionally, the properties of the prediction block can indicate coding parameters for the prediction block.
[0403] For example, the number of intra prediction modes can be fixed to N regardless of the size of the prediction block. Alternatively, for example, the number of intra prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65, 67, or 95.
[0404] The intra prediction mode can be non-directional or directional.
[0405] For example, the intra prediction mode may include two non-directional modes and 65 directional modes, corresponding to numbers 0 to 66 shown in FIG. 7.
[0406] For example, when a specific intra prediction method is used, the intra prediction mode may include two non-directional modes and 93 directional modes, corresponding to numbers -14 to 80 shown in FIG. 7.
[0407] The two non-directional modes may include DC mode and Planar mode.
[0408] A directional mode can be a prediction mode with a specific direction or a specific angle. A directional mode may also be referred to as an argular mode.
[0409] An intra prediction mode can be expressed by at least one of a mode number, a mode value, a mode angle, and a mode direction. That is, the terms "(mode) number of an intra prediction mode," "(mode) value of an intra prediction mode," "(mode) angle of an intra prediction mode," and "(mode) direction of an intra prediction mode" can be used with the same meaning and can be used interchangeably.
[0410] The number of intra prediction modes can be M. M can be greater than or equal to 1. That is, the intra prediction modes can be M, including the number of non-directional modes and the number of directional modes.
[0411] The number of intra prediction modes can be fixed to M regardless of the block size and / or color components. For example, the number of intra prediction modes can be fixed to either 35 or 67, regardless of the block size.
[0412] Alternatively, the number of intra prediction modes may vary depending on the shape, size and / or type of color components of the block.
[0413] For example, in Fig. 7, the directional prediction modes shown by the dotted lines can only be applied to predictions for non-square blocks.
[0414] For example, as the block size increases, the number of intra prediction modes may increase. Alternatively, as the block size increases, the number of intra prediction modes may decrease. When the block size is 4x4 or 8x8, the number of intra prediction modes may be 67. When the block size is 16x16, the number of intra prediction modes may be 35. When the block size is 32x32, the number of intra prediction modes may be 19. When the block size is 64x64, the number of intra prediction modes may be 7.
[0415] 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 of a luma component block may be greater than the number of intra prediction modes of a chroma component block.
[0416] For example, in the vertical mode with a mode value of 50, prediction can be performed in the vertical direction based on the pixel values of the reference sample. For example, in the horizontal mode with a mode value of 18, prediction can be performed in the horizontal direction based on the pixel values of the reference sample.
[0417] Even in a directional mode other than the aforementioned mode, the encoding device (100) and the decoding device (200) can perform intra prediction for the target unit using a reference sample according to an angle corresponding to the directional mode.
[0418] An intra prediction mode located to the right of a vertical mode may be named a vertical-right mode. An intra prediction mode located below a horizontal mode may be named a horizontal-below mode. For example, in FIG. 7, intra prediction modes whose mode values are one of 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, and 66 may be vertical-right modes. Intra prediction modes whose mode values are one of 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, and 17 may be horizontal-below modes.
[0419] Non-directional modes may include direct current (DC) mode and planar mode. For example, the mode value of direct current (DC) mode may be 1. The mode value of planar mode may be 0.
[0420] The directional mode may include an angular mode. Among the multiple intra prediction modes, any mode other than the DC mode and the planar mode may be a directional mode.
[0421] When the intra prediction mode is DC mode, a prediction block may be generated based on an average of pixel values of multiple reference samples. For example, a pixel value of a prediction block may be determined based on an average of pixel values of multiple reference samples.
[0422] The number of intra prediction modes and the mode values of each intra prediction mode described above may be merely exemplary. The number of intra prediction modes and the mode values of each intra prediction mode described above may be defined differently depending on the embodiment, implementation, and / or needs.
[0423] A step of checking whether samples included in a reconstructed neighboring block can be used as reference samples of the target block to perform intra prediction on the target block may be performed. If there is a sample among the samples of the neighboring block that cannot be used as a reference sample of the target block, a value generated by copying and / or interpolating using a sample value of at least one of the samples included in the reconstructed neighboring block may be replaced with the sample value of the sample that cannot be used as a reference sample. If the value generated by copying and / or interpolating is replaced with the sample value of the sample, the sample can be used as a reference sample of the target block.
[0424] When intra prediction is used, a filter may be applied to at least one of the reference sample or the prediction sample based on at least one of the intra prediction mode and the size of the target block.
[0425] The type of filter applied to at least one of the reference sample or the predicted sample may vary depending on 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 refer to the number of filter taps. In addition, the number of filter taps may refer to the length of the filter.
[0426] When the intra prediction mode is the planar mode, when generating a prediction block of a target block, a sample value of a prediction target sample can be generated using a weighted sum of an upper reference sample of the target sample, a left reference sample of the target sample, an upper-right reference sample of the target block, and a lower-left reference sample of the target block, depending on the position of the prediction target sample within the prediction block.
[0427] When the intra prediction mode is DC mode, the average value of the upper reference samples and the left reference samples of the target block may be used to generate a prediction block of the target block. In addition, filtering using the values of the reference samples may be performed for specific rows or specific columns within the target block. The specific rows may be one or more upper rows adjacent to the reference sample. The specific columns may be one or more left columns adjacent to the reference sample.
[0428] When the intra prediction mode is a directional mode, a prediction block can be generated using the top reference sample, the left reference sample, the top-right reference sample, and / or the bottom-left reference sample of the target block.
[0429] Real-valued interpolation may also be performed to generate the aforementioned prediction samples.
[0430] The intra prediction mode of the target block can be predicted from the intra prediction mode of the neighboring block of the target block, and the information used for prediction can be entropy encoded / decoded.
[0431] For example, if the intra prediction modes of the target block and the neighboring blocks are the same, a predefined flag can be used to signal that the intra prediction modes of the target block and the neighboring blocks are the same.
[0432] For example, an indicator may be signaled that indicates an intra prediction mode that is the same as the intra prediction mode of the target block among the intra prediction modes of multiple neighboring blocks.
[0433] If the intra prediction modes of the target block and the neighboring blocks are different, information of the intra prediction mode of the target block can be encoded and / or decoded using entropy encoding and / or decoding.
[0434]
[0435] Figure 8 is a diagram for explaining reference samples used in the intra prediction process.
[0436] The reconstructed reference samples used for intra prediction of the target block may include below-left reference samples, left reference samples, above-left corner reference samples, above reference samples, and above-right reference samples.
[0437] For example, left reference samples may refer to reconstructed reference pixels adjacent to the left side of the target block. Top reference samples may refer to reconstructed reference pixels adjacent to the top side of the target block. Top left corner reference samples may refer to reconstructed reference pixels located at the top left corner of the target block. In addition, bottom left reference samples may refer to reference samples located at the bottom of the left sample line among samples located on the same line as the left sample line composed of the left reference samples. Top right reference samples may refer to reference samples located at the right side of the top pixel line among samples located on the same line as the top sample line composed of the top reference samples.
[0438] When the size of the target block is NxN, the number of lower left reference samples, left reference samples, upper reference samples, and upper right reference samples can each be N.
[0439] A prediction block can be generated through intra prediction for a target block. Generating the prediction block may include determining the values of pixels in the prediction block. The target block and the prediction block may be of the same size.
[0440] Reference samples used for intra prediction of a target block may vary depending on the intra prediction mode of the target block. The direction of the intra prediction mode may indicate a dependency relationship between reference samples and pixels of the prediction block. For example, the value of a specified reference sample may be used as the value of one or more specified pixels of the prediction block. In this case, the specified reference sample and the one or more specified pixels of the prediction block may be samples and pixels specified in a straight line in the direction of the intra prediction mode. In other words, the value of the specified reference sample may be copied as the value of a pixel located in the reverse direction of the direction of the intra prediction mode. Alternatively, the value of a pixel of the prediction block may be the value of a reference sample located in the direction of the intra prediction mode based on the position of the pixel.
[0441] For example, if the intra prediction mode of the target block is vertical mode, the upper reference samples can be used for intra prediction. If the intra prediction mode is vertical mode, the value of a pixel of the prediction block may be the value of a reference sample located vertically above the position of the pixel. Therefore, the upper reference samples adjacent to the upper part of the target block can be used for intra prediction. In addition, the values of pixels in one row of the prediction block may be identical to the values of the upper reference samples.
[0442] For example, if the intra prediction mode of the target block is horizontal mode, the left reference samples can be used for intra prediction. If the intra prediction mode is horizontal mode, the value of a pixel of the prediction block may be the value of a reference sample located horizontally to the left of the pixel. Therefore, the left reference samples adjacent to the left of the target block can be used for intra prediction. In addition, the values of pixels in one column of the prediction block may be identical to the values of the left reference samples.
[0443] For example, if the mode value of the intra prediction mode of the target block is 34, at least a portion of the left reference samples, the upper left corner reference samples, and at least a portion of the upper reference samples may be used for intra prediction. If the mode value of the intra prediction mode is 34, the value of a pixel of the prediction block may be the value of a reference sample located diagonally to the upper left with respect to the pixel.
[0444] Additionally, when an intra prediction mode is used where the mode value is one of 52 to 66, at least some of the upper right reference samples may be used for intra prediction.
[0445] Additionally, when an intra prediction mode is used where the mode value is one of 2 to 17, at least some of the lower left reference samples may be used for intra prediction.
[0446] Additionally, when an intra prediction mode is used where the mode value is one of 19 to 49, the upper left corner reference sample can be used for intra prediction.
[0447] The number of reference samples used to determine the pixel value of one pixel of a prediction block may be one or more.
[0448] As described above, the pixel value of a pixel of a prediction block can be determined based on the position of the reference sample indicated by the position of the pixel and the direction of the intra prediction mode. If the position of the reference sample indicated by the position of the pixel and the direction of the intra prediction mode is an integer position, the value of one reference sample indicated by the integer position can be used to determine the pixel value of the pixel of the prediction block.
[0449] When the position of the reference sample pointed to by the position of the pixel and the direction of the intra prediction mode is not an integer position, an interpolated reference sample can be generated based on two reference samples closest to the position of the reference sample. The value of the interpolated reference sample can be used to determine the pixel value of the pixel of the prediction block. That is to say, when the position of the reference sample pointed to by the position of the pixel of the prediction block and the direction of the intra prediction mode represents a space between two reference samples, an interpolated value can be generated based on the values of the two samples.
[0450] The predicted block generated by prediction may not be identical to the original target block. In other words, there may be a prediction error, which is the difference between the target block and the predicted block, and there may also be a prediction error between the pixels of the target block and the pixels of the predicted block.
[0451] Hereinafter, the terms "difference", "error" and "residual" may be used interchangeably and with the same meaning.
[0452] For example, in directional intra prediction, a greater distance between pixels in a predicted block and reference samples can result in a larger prediction error. This prediction error can lead to discontinuities between the predicted block and neighboring blocks.
[0453] Filtering can be used on predicted blocks to reduce prediction errors. Filtering can adaptively apply filters to regions within a predicted block that are considered to have high prediction errors. For example, the regions considered to have high prediction errors may be the boundaries of the predicted blocks. Furthermore, depending on the intra-prediction mode, the regions considered to have high prediction errors within a predicted block may vary, and the characteristics of the filters may vary.
[0454] As illustrated in FIG. 8, for intra prediction of a target block, at least one of reference lines 0 to 3 may be used.
[0455] Each reference line in FIG. 8 may represent a reference sample line including one or more reference samples. A smaller reference line number may indicate a line of reference samples closer to the target block.
[0456] Instead of being obtained from reconstructed neighboring blocks, samples of segment A and segment F can be obtained through padding using the nearest samples of segment B and segment E, respectively.
[0457] Index information indicating a reference sample line to be used for intra prediction of a target block may be signaled. The index information may indicate a reference sample line among a plurality of reference sample lines used for intra prediction of the target block. For example, the index information may have a value of one of 0 to 3.
[0458] If the upper boundary of the target block is the boundary of the CTU, only reference sample line 0 may be available. Therefore, in this case, index information may not be signaled. If a reference sample line other than reference sample line 0 is used, filtering for the prediction block described below may not be performed.
[0459] In the case of inter-color intra prediction, a prediction block for a target block of a second color component can be generated based on a corresponding reconstructed block of a first color component.
[0460] For example, the first color component may be a luma component, and the second color component may be a chroma component.
[0461] For intra prediction between color components, parameters of a linear model between the first color component and the second color component can be derived based on a template.
[0462] The template may include a top reference sample and / or a left reference sample of the target block, and may include a top reference sample and / or a left reference sample of the reconstructed block of the first color component corresponding to these reference samples.
[0463] For example, the parameters of the linear model can be derived using 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.
[0464] Once the parameters of the linear model are derived, a prediction block for the target block can be generated by applying the corresponding reconstructed block to the linear model.
[0465] Depending on the image format, subsampling may be performed on the surrounding samples of the reconstructed block of the first color component and the corresponding reconstructed block. For example, if one sample of the second color component corresponds to four samples of the first color component, one corresponding sample may be calculated by subsampling the four samples of the first color component. When subsampling is performed, derivation of the parameters of the linear model and intra prediction between the color components may be performed based on the subsampled corresponding samples.
[0466] Whether intra prediction is performed between color components and / or the range of templates can be signaled as an intra prediction mode.
[0467] The target block can be divided into two or four sub-blocks in the horizontal and / or vertical directions.
[0468] The split sub-blocks can be sequentially reconstructed. That is, as intra prediction is performed on a sub-block, a sub-prediction block for the sub-block can be generated. Furthermore, as inverse quantization and / or inverse transformation are performed on the sub-block, a sub-residual block for the sub-block can be generated. A reconstructed sub-block can be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block can be used as a reference sample for intra prediction of a subsequent sub-block.
[0469] A sub-block may be a block containing more than a specified number of samples (e.g., 16). Therefore, for example, if the target block is an 8x4 block or a 4x8 block, the target block may be divided into two sub-blocks. Furthermore, if the target block is a 4x4 block, the target block cannot be divided into sub-blocks. If the target block has any other size, the target block may be divided into four sub-blocks.
[0470] Information regarding whether intra prediction is performed based on these sub-blocks and / or the segmentation direction (horizontal or vertical) may be signaled.
[0471] Such sub-block-based intra prediction may be restricted to be performed only when using reference sample line 0. When sub-block-based intra prediction is performed, filtering on the prediction block described below may not be performed.
[0472] A final prediction block can be generated by performing filtering on the prediction block generated by intra prediction.
[0473] Filtering can be performed by applying specific weights to the filtering target sample, the left reference sample, the top reference sample, and / or the top left reference sample.
[0474] The weights and / or reference samples (or the range of the reference samples or the location of the reference samples, etc.) used for filtering may be determined based on at least one of the block size, the intra prediction mode, and the location of the filtering target sample within the prediction block.
[0475] For example, filtering may be performed only for specific intra prediction modes (e.g., DC mode, planar mode, vertical mode, horizontal mode, diagonal mode, and / or adjacent diagonal mode).
[0476] An adjacent diagonal mode can be a mode whose number is the number of the diagonal mode plus k, or a mode whose number is the number of the diagonal mode minus k. In other words, the number of the adjacent diagonal mode can be the sum of the number of the diagonal mode plus k, or the difference between the number of the diagonal mode plus k. For example, k can be a positive integer less than or equal to 8.
[0477] The intra prediction mode of the target block can be derived using the intra prediction modes of neighboring blocks existing around the target block, and the derived intra prediction mode can be entropy encoded and / or entropy decoded.
[0478] For example, if the intra prediction mode of the target block and the intra prediction mode of the neighboring block are the same, information that the intra prediction mode of the target block and the intra prediction mode of the neighboring block are the same can be signaled using specified flag information.
[0479] Additionally, for example, indicator information for a neighboring block having an intra prediction mode identical to the intra prediction mode of the target block among intra prediction modes of a plurality of neighboring blocks can be signaled.
[0480] For example, if the intra prediction mode of the target block and the intra prediction mode of the neighboring block are different from each other, entropy encoding and / or entropy decoding of information about the intra prediction mode of the target block can be performed by performing entropy encoding and / or entropy decoding based on the intra prediction mode of the neighboring block.
[0481]
[0482] Figure 9 is a diagram for explaining an embodiment of an inter prediction process.
[0483] The rectangles illustrated in FIG. 9 may represent images (or pictures). Furthermore, arrows in FIG. 9 may represent prediction directions. An arrow from a first picture to a second picture may indicate that the second picture references the first picture. That is, images may be encoded and / or decoded according to the prediction direction.
[0484] Each picture can be classified into an I picture (Intra Picture), a P picture (Uni-prediction Picture), and a B picture (Bi-prediction Picture) according to its encoding type. Each picture can be encoded and / or decoded according to its encoding type.
[0485] When the target image to be encoded is an I-picture, the target image can be encoded using data within the image itself without inter-prediction that refers to other images. For example, an I-picture can be encoded only with intra-prediction.
[0486] If the target image is a P picture, the target image can be encoded through inter prediction using only reference pictures existing in one direction. Here, the one direction can be forward or backward.
[0487] When the target image is a B picture, the target image can be encoded through inter prediction using reference pictures existing in both directions or inter prediction using reference pictures existing in one of the forward and backward directions. Here, the bidirectional directions can be forward and backward.
[0488] P pictures and B pictures that are encoded and / or decoded using reference pictures can be considered as images in which inter prediction is used.
[0489] Below, inter prediction in inter mode according to an embodiment is specifically described.
[0490] Inter prediction or motion compensation can be performed using reference images and motion information.
[0491] In inter mode, the encoding device (100) can perform inter prediction and / or motion compensation on the target block. The decoding device (200) can perform inter prediction and / or motion compensation corresponding to the inter prediction and / or motion compensation in the encoding device (100) on the target block.
[0492] Motion information for a target block can be derived during inter prediction by each of the encoding device (100) and the decoding device (200). The motion information can be derived using motion information of a reconstructed neighboring block, motion information of a call block, and / or motion information of a block adjacent to a call block.
[0493] For example, the encoding device (100) or the decoding device (200) can perform prediction and / or motion compensation by using motion information of a spatial candidate and / or a temporal candidate as motion information of a target block. The target block may mean a PU and / or a PU partition.
[0494] A spatial candidate may be a reconstructed block that is spatially adjacent to the target block.
[0495] A temporal candidate may be a reconstructed block corresponding to a target block within an already reconstructed collocated picture (col picture).
[0496] In inter prediction, the encoding device (100) and the decoding device (200) can improve encoding efficiency and decoding efficiency by utilizing motion information of spatial candidates and / or temporal candidates. Motion information of spatial candidates may be referred to as spatial motion information. Motion information of temporal candidates may be referred to as temporal motion information.
[0497] Hereinafter, the motion information of a spatial candidate may be motion information of a PU including the spatial candidate. The motion information of a temporal candidate may be motion information of a PU including the temporal candidate. The motion information of a candidate block may be motion information of a PU including the candidate block.
[0498] Inter prediction can be performed using reference pictures.
[0499] A reference picture may be at least one of a previous picture of the target picture or a subsequent picture of the target picture. A reference picture may refer to an image used for predicting the target block.
[0500] In inter prediction, an area within a reference picture can be specified by using a reference picture index (or refIdx) indicating the reference picture and a motion vector (to be described later). Here, the specified area within the reference picture can indicate a reference block.
[0501] Inter prediction can select a reference picture and select a reference block corresponding to the target block within the reference picture. Additionally, inter prediction can generate a prediction block for the target block using the selected reference block.
[0502] Motion information can be derived during inter prediction by each of the encoding device (100) and the decoding device (200).
[0503] A spatial candidate may be a block that 1) exists within the target picture, 2) has already been reconstructed through 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 the 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. "A block located at a corner of the target block" may have the same meaning as "a block adjacent to a corner of the target block." "A block located at a corner of the target block" may be included in "a block adjacent to the target block."
[0504] For example, a 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.
[0505] Each of the encoding device (100) and the decoding device (200) can identify a block existing at a location spatially corresponding to a target block within a call picture. The location of the target block within the target picture and the location of the identified block within the call picture may correspond to each other.
[0506] Each of the encoding device (100) and the decoding device (200) can determine a call block existing at a predetermined relative position with respect to the identified block as a temporal candidate. The predetermined relative position may be a position inside and / or outside the identified block.
[0507] For example, a call block may include a first call block and a second call block. When the coordinates of the identified block are (xP, yP) and the size of the identified block is (nPSW, nPSH), the first call block may be a block located at coordinates (xP + nPSW, yP + nPSH). The second call block may be a block located at coordinates (xP + (nPSW >> 1), yP + (nPSH >> 1)). The second call block may be optionally used when the first call block is unavailable.
[0508] The motion vector of the target block can be determined based on the motion vector of the call block. Each of the encoding device (100) and the decoding device (200) can scale the motion vector of the call block. The scaled motion vector of the call block can be used as the motion vector of the target block. In addition, the motion vector of the motion information of the temporal candidates stored in the list can be a scaled motion vector.
[0509] The ratio of the motion vector of the target block to the motion vector of the called block may be equal to the ratio of the first temporal distance and the second temporal distance. The first temporal distance may be the distance between the reference picture of the target block and the target picture. The second temporal distance may be the distance between the reference picture of the called block and the called picture.
[0510] The method of deriving motion information may vary depending on the inter prediction mode of the target block. For example, inter prediction modes applied for inter prediction may include Advanced Motion Vector Predictor (AMVP) mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, triangulation mode, inter-intra joint prediction mode, affine inter mode, and current picture reference mode. The merge mode may also be referred to as motion merge mode. Below, each of the modes is described in detail.
[0511] 1) AMVP mode
[0512] When AMVP mode is used, the encoding device (100) can search for similar blocks in the neighborhood of the target block. The encoding device (100) can obtain a predicted block by performing prediction on the target block using motion information of the searched similar blocks. The encoding device (100) can encode a residual block, which is the difference between the target block and the predicted block.
[0513] 1-1) Creating a list of predicted motion vector candidates
[0514] When the AMVP mode is used as the prediction mode, each of the encoding device (100) and the decoding device (200) can generate a prediction motion vector candidate list using the motion vector of the spatial candidate, the motion vector of the temporal candidate, and the zero vector. The prediction motion vector candidate list can 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 can be determined and used as the prediction motion vector candidate.
[0515] Hereinafter, the terms "predicted motion vector (candidate)" and "motion vector (candidate)" may be used interchangeably and have the same meaning.
[0516] Hereinafter, the terms “predicted motion vector candidate” and “AMVP candidate” may be used interchangeably and have the same meaning.
[0517] Hereinafter, the terms “predicted motion vector candidate list” and “AMVP candidate list” may be used interchangeably and have the same meaning.
[0518] A 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.
[0519] A temporal candidate may include a call block and blocks adjacent to the call block. In other words, the motion vector of a call block or the motion vector of a block adjacent to the call block may be referred to as a temporal prediction motion vector candidate.
[0520] The zero vector can be a (0, 0) motion vector.
[0521] The predicted motion vector candidate may be a motion vector predictor for predicting a motion vector. Additionally, in the encoding device (100), the predicted motion vector candidate may be an initial search position for a motion vector.
[0522] 1-2) Motion vector search using the predicted motion vector candidate list
[0523] The encoding device (100) can use the predicted motion vector candidate list to determine a motion vector to be used for encoding a target block within a search range. In addition, the encoding device (100) can determine a predicted motion vector candidate to be used as a predicted motion vector of the target block among the predicted motion vector candidates in the predicted motion vector candidate list.
[0524] The motion vector to be used for encoding the target block may be a motion vector that can be encoded at the minimum cost.
[0525] Additionally, the encoding device (100) can determine whether to use the AMVP mode in encoding the target block.
[0526] 1-3) Transmission of inter prediction information
[0527] The encoding device (100) can generate a bitstream including inter prediction information required for inter prediction. The decoding device (200) can perform inter prediction on a target block using the inter prediction information of the bitstream.
[0528] Inter prediction information may include 1) mode information indicating whether AMVP mode is used, 2) predicted motion vector index, 3) motion vector difference (MVD), 4) reference direction, and 5) reference picture index.
[0529] Hereinafter, the terms “predicted motion vector index” and “AMVP index” may be used interchangeably and have the same meaning.
[0530] Additionally, the inter prediction information may include residual signals.
[0531] The decoding device (200) can obtain a predicted motion vector index, a motion vector difference, a reference direction, and a reference picture index from the bitstream through entropy decoding when the mode information indicates that the AMVP mode is used.
[0532] The predicted motion vector index may point to a predicted motion vector candidate used for prediction of a target block among predicted motion vector candidates included in the predicted motion vector candidate list.
[0533] 1-4) Inter prediction in AMVP mode using inter prediction information
[0534] The decoding device (200) can derive a predicted motion vector candidate using a predicted motion vector candidate list, and can determine motion information of a target block based on the derived predicted motion vector candidate.
[0535] The decoding device (200) can determine a motion vector candidate for the target block from among the predicted motion vector candidates included in the predicted motion vector candidate list using the predicted motion vector index. The decoding device (200) can select a 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.
[0536] The encoding device (100) can generate an entropy-encoded predicted motion vector index by applying entropy encoding to the predicted motion vector index, and can generate a bitstream including the entropy-encoded predicted motion vector index. The entropy-encoded predicted motion vector index can be signaled from the encoding device (100) to the decoding device (200) through the bitstream. The decoding device (200) can extract the entropy-encoded predicted motion vector index from the bitstream, and can obtain the predicted motion vector index by applying entropy decoding to the entropy-encoded predicted motion vector index.
[0537] The motion vector actually used for inter prediction of the target block may not match the predicted motion vector. An MVD may be used to represent the difference between the motion vector actually used for inter prediction of the target block and the predicted motion vector. The encoding device (100) may derive a predicted motion vector similar to the motion vector actually used for inter prediction of the target block in order to use an MVD with a size as small as possible.
[0538] The MVD may be the difference between the motion vector of the target block and the predicted motion vector. The encoding device (100) may calculate the MVD and generate an entropy-encoded MVD by applying entropy encoding to the MVD. The encoding device (100) may generate a bitstream including the entropy-encoded MDV.
[0539] The MVD can be transmitted from the encoding device (100) to the decoding device (200) via a bitstream. The decoding device (200) can extract an entropy-encoded MVD from the bitstream and obtain the MVD by applying entropy decoding to the entropy-encoded MVD.
[0540] The decoding device (200) can derive the motion vector of the target block by combining the MVD and the predicted motion vector. In other words, the motion vector of the target block derived from the decoding device (200) can be the sum of the MVD and the motion vector candidate.
[0541] In addition, the encoding device (100) can generate entropy-encoded MVD resolution information by applying entropy encoding to the calculated MVD resolution information, and can generate a bitstream including the entropy-encoded MVD resolution information. The decoding device (200) can extract entropy-encoded MVD resolution information from the bitstream, and can obtain MVD resolution information by applying entropy decoding to the entropy-encoded MVD resolution information. The decoding device (200) can adjust the resolution of the MVD using the MVD resolution information.
[0542] Meanwhile, the encoding device (100) can calculate the MVD based on the affine model. The decoding device (200) can derive the affine control motion vector of the target block through the sum of the MVD and the affine control motion vector candidates, and can derive the motion vector for the sub-block using the affine control motion vector.
[0543] The reference direction may point to a reference picture list used for prediction of the target block. For example, the reference direction may point to one of the reference picture list L0 and the reference picture list L1.
[0544] The reference direction may not indicate that the directions of the reference pictures are limited to the forward direction or the backward direction, but only indicates the reference picture list used for prediction of the target block. In other words, each of the reference picture list L0 and the reference picture list L1 may include pictures in the forward direction and / or the backward direction.
[0545] A unidirectional reference direction may mean that a single reference picture list is used. A bidirectional reference direction may mean that two reference picture lists are used. In other words, the reference direction may indicate that only the reference picture list L0 is used, that only the reference picture list L1 is used, or that one of the two reference picture lists is used.
[0546] A reference picture index may indicate a reference picture used for prediction of a target block among reference pictures in a reference picture list. The encoding device (100) may generate an entropy-encoded reference picture index by applying entropy encoding to the reference picture index, and may generate a bitstream including the entropy-encoded reference picture index. The entropy-encoded reference picture index may be signaled from the encoding device (100) to the decoding device (200) through a bitstream. The decoding device (200) may extract an entropy-encoded reference picture index from the bitstream, and may obtain a reference picture index by applying entropy decoding to the entropy-encoded reference picture index.
[0547] When two reference picture lists are used to predict a target block, one reference picture index and one motion vector can be used for each reference picture list. Furthermore, when two reference picture lists are used to predict a target block, two prediction blocks can be specified for the target block. For example, the (final) prediction block of the target block can be generated through the average or weighted sum of the two prediction blocks for the target block.
[0548] The motion vector of the target block can be derived by the predicted motion vector index, MVD, reference direction, and reference picture index.
[0549] The decoding device (200) can 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 pointed to by the derived motion vector within the reference picture pointed to by the reference picture index.
[0550] By encoding the predicted motion vector index and MVD without encoding the motion vector itself of the target block, the amount of bits transmitted from the encoding device (100) to the decoding device (200) can be reduced, and encoding efficiency can be improved.
[0551] Motion information of reconstructed neighboring blocks may be used for the target block. In a specific inter prediction mode, the encoding device (100) may not separately encode the motion information for the target block itself. Instead of encoding the motion information of the target block, other information that can derive the motion information of the target block through the motion information of the reconstructed neighboring blocks may be encoded instead. As other information is encoded instead, the amount of bits transmitted to the decoding device (200) may be reduced, and encoding efficiency may be improved.
[0552] 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, etc. In this case, the encoding device (100) and the decoding device (200) may use an identifier and / or an index that indicates which unit's motion information among the reconstructed neighboring units is used as the motion information of the target unit.
[0553] 2) Merge mode
[0554] One method for deriving motion information for a target block is merge. Merge can refer to the merging of motions across multiple blocks. Merge can also refer to applying motion information from one block to another. In other words, merge mode can refer to a mode in which the motion information for a target block is derived from the motion information of neighboring blocks.
[0555] When the merge mode is used, the encoding device (100) can perform prediction of motion information of the target block using motion information of the spatial candidate and / or motion information of the temporal candidate. The spatial candidate may include a reconstructed spatial neighboring block that is spatially adjacent to the target block. The spatial neighboring block may include a left neighboring block and an upper neighboring block. The temporal candidate may include a call block. The terms "spatial candidate" and "spatial merge candidate" may be used interchangeably and have the same meaning. The terms "temporal candidate" and "temporal merge candidate" may be used interchangeably and have the same meaning.
[0556] The encoding device (100) can obtain a prediction block through prediction. The encoding device (100) can encode a residual block, which is the difference between the target block and the prediction block.
[0557] 2-1) Creating a merge candidate list
[0558] When merge mode is used, each of the encoding device (100) and the decoding device (200) can generate a merge candidate list using motion information of spatial candidates and / or motion information of temporal candidates. The motion information can include 1) a motion vector, 2) a reference picture index, and 3) a reference direction. The reference direction can be unidirectional or bidirectional. The reference direction can mean an inter prediction indicator.
[0559] The merge candidate list may contain merge candidates. The merge candidates may be motion information. In other words, the merge candidate list may be a list containing motion information.
[0560] Merge candidates may be motion information such as temporal candidates and / or spatial candidates. In other words, the merge candidate list may include motion information such as temporal candidates and / or spatial candidates.
[0561] Additionally, the merge candidate list may include new merge candidates 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 motion information already present in the merge candidate list.
[0562] Additionally, the merge candidate list may include a history-based merge candidate. The history-based merge candidate may be motion information of a block encoded and / or decoded before the target block.
[0563] Additionally, the merge candidate list may include a merge candidate based on the average of two merge candidates.
[0564] Merge candidates may be specific modes that derive inter-prediction information. The merge candidate may be information indicating a specific mode that derives inter-prediction information. Inter-prediction information of the target block may be derived according to the specific mode indicated by the merge candidate. In this case, the specific mode may include a process for deriving a series of inter-prediction information. This specific mode may be an inter-prediction information derivation mode or a motion information derivation mode.
[0565] Inter prediction information of a target block can be derived according to the mode indicated by a merge candidate selected by a merge index among the merge candidates in the merge candidate list.
[0566] For example, the motion information derivation modes in the merge candidate list may be at least one of 1) a sub-block unit motion information derivation mode and 2) an affine motion information derivation mode.
[0567] Additionally, the merge candidate list may include motion information of the zero vector. The zero vector may also be referred to as a zero merge candidate.
[0568] In other words, the motion information in the merge candidate list can be at least one of: 1) motion information of a spatial candidate, 2) motion information of a temporal candidate, 3) motion information generated by a combination of motion information already existing in the merge candidate list, and 4) a zero vector.
[0569] 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.
[0570] The merge candidate list can be generated before prediction by merge mode is performed.
[0571] The number of merge candidates in the merge candidate list can be predefined. The encoding device (100) and the decoding device (200) can add merge candidates to the merge candidate list according to a predefined method and a predefined order so that the merge candidate list has a predefined number of merge candidates. Through the predefined method and the predefined order, the merge candidate list of the encoding device (100) and the merge candidate list of the decoding device (200) can be identical.
[0572] Merge can be applied on a CU or PU basis. When merging is performed on a CU or PU basis, the encoding device (100) can transmit a bitstream including predefined information to the decoding device (200). For example, the predefined information can include 1) information indicating whether merging is to be performed for each block partition, and 2) information regarding which block among the blocks that are spatial candidates and / or temporal candidates for the target block will be merged.
[0573] 2-2) Searching for motion vectors using the merge candidate list
[0574] The encoding device (100) can determine a merge candidate to be used for encoding a target block. For example, the encoding device (100) can perform predictions for the target block using merge candidates in a merge candidate list and generate residual blocks for the merge candidates. The encoding device (100) can use a merge candidate that requires the least cost for prediction and encoding of the residual block for encoding the target block.
[0575] Additionally, the encoding device (100) can determine whether to use merge mode in encoding the target block.
[0576] 2-3) Transmission of inter prediction information
[0577] The encoding device (100) can generate a bitstream including inter prediction information required for inter prediction. The encoding device (100) can perform entropy encoding on the inter prediction information to generate entropy-encoded inter prediction information, and can transmit the bitstream including the entropy-encoded inter prediction information to the decoding device (200). Through the bitstream, the entropy-encoded inter prediction information can be signaled from the encoding device (100) to the decoding device (200). The decoding device (200) can extract the entropy-encoded inter prediction information from the bitstream, and can obtain the inter prediction information by performing entropy decoding on the entropy-encoded inter prediction information.
[0578] The decoding device (200) can perform inter prediction on a target block using inter prediction information of a bitstream.
[0579] Inter prediction information may include 1) mode information indicating whether merge mode is used, 2) merge index, and 3) correction information.
[0580] Additionally, the inter prediction information may include residual signals.
[0581] The decryption device (200) can obtain the merge index from the bitstream only when the mode information indicates that the merge mode is used.
[0582] Mode information can be a merge flag. The unit of mode information can be a block. Information about a block can include mode information, and the mode information can indicate whether merge mode is applied to the block.
[0583] A merge index may indicate a merge candidate among the merge candidates included in the merge candidate list, which is used to predict the target block. Alternatively, the merge index may indicate which block among the neighboring blocks spatially or temporally adjacent to the target block is being merged.
[0584] The encoding device (100) can select a merge candidate with the highest encoding performance among the merge candidates included in the merge candidate list, and can set the value of the merge index to point to the selected merge candidate.
[0585] The correction information may be information used to correct a motion vector. The encoding device (100) may generate the correction information. The decoding device (200) may correct the motion vector of a merge candidate selected by a merge index based on the correction information.
[0586] The correction information may include at least one of information indicating whether correction has been performed, correction direction information, and correction size information. A prediction mode that corrects a motion vector based on the signaled correction information may be referred to as a merge mode with motion vector difference.
[0587] 2-4) Inter prediction in merge mode using inter prediction information
[0588] The decryption device (200) can perform prediction on a target block using a merge candidate indicated by a merge index among the merge candidates included in the merge candidate list.
[0589] The motion vector of the target block can be specified by the motion vector of the merge candidate pointed to by the merge index, the reference picture index, and the reference direction.
[0590] 3) Skip mode
[0591] Skip mode can be a mode that directly applies the motion information of spatial or temporal candidates to the target block. Furthermore, skip mode can be a mode that does not use residual signals. In other words, when skip mode is used, the reconstructed block can be identical to the predicted block.
[0592] The difference between merge mode and skip mode may lie in the transmission or use of residual signals. In other words, skip mode may be similar to merge mode, except that residual signals are not transmitted or used.
[0593] When skip mode is used, the encoding device (100) can transmit information indicating which block's motion information among the blocks that are spatial candidates or temporal candidates is used as the motion information of the target block to the decoding device (200) through a bitstream. The encoding device (100) can perform entropy encoding on this information to generate entropy-encoded information, and signal the entropy-encoded information to the decoding device (200) through a bitstream. The decoding device (200) can extract the entropy-encoded information from the bitstream, and obtain the information by performing entropy decoding on the entropy-encoded information.
[0594] Additionally, when skip mode is used, the encoding device (100) may not transmit other syntax element information, such as MVD, to the decoding device (200). For example, when skip mode is used, the encoding device (100) may not signal syntax elements regarding at least one of MVD, coded block flag, and transform coefficient level to the decoding device (200).
[0595] 3-1) Creating a list of merge candidates
[0596] Skip mode can also use a merge candidate list. In other words, a merge candidate list can be used in both merge and skip modes. In this regard, the merge candidate list may also be referred to as a "skip candidate list" or a "merge / skip candidate list."
[0597] Alternatively, skip mode may use a separate candidate list from merge mode. In such cases, the merge candidate list and merge candidates in the description below may be replaced with skip candidate list and skip candidates, respectively.
[0598] The merge candidate list can be generated before prediction is performed in skip mode.
[0599] 3-2) Searching for motion vectors using the merge candidate list
[0600] The encoding device (100) can determine a merge candidate to be used for encoding a target block. For example, the encoding device (100) can perform predictions for the target block using merge candidates in a merge candidate list. The encoding device (100) can use a merge candidate that requires the least cost for prediction to encode the target block.
[0601] Additionally, the encoding device (100) can determine whether to use skip mode in encoding the target block.
[0602] 3-3) Transmission of inter prediction information
[0603] The encoding device (100) can generate a bitstream including inter prediction information required for inter prediction. The decoding device (200) can perform inter prediction on a target block using the inter prediction information of the bitstream.
[0604] Inter prediction information may include 1) mode information indicating whether skip mode is used and 2) a skip index.
[0605] The skip index may be identical to the merge index described above.
[0606] When skip mode is used, the target block can be encoded without residual signals. The inter-prediction information may not include residual signals. Alternatively, the bitstream may not include residual signals.
[0607] The decoding device (200) can obtain a skip index from the bitstream only if the mode information indicates that the skip mode is used. As described above, the merge index and the skip index may be the same. The decoding device (200) can obtain a skip index from the bitstream only if the mode information indicates that the merge mode or the skip mode is used.
[0608] A skip index may point to a merge candidate among the merge candidates included in the merge candidate list that is used to predict the target block.
[0609] 3-4) Inter prediction in skip mode using inter prediction information
[0610] The decryption device (200) can perform prediction on a target block using a merge candidate indicated by a skip index among the merge candidates included in the merge candidate list.
[0611] The motion vector of the target block can be specified by the motion vector of the merge candidate pointed to by the skip index, the reference picture index, and the reference direction.
[0612] 4) Current picture reference mode
[0613] The current picture reference mode may mean a prediction mode that uses a pre-reconstructed region within the target picture to which the target block belongs.
[0614] A motion vector may be used to specify the reconstructed region. Whether the target block is encoded in the current picture reference mode may be determined using the reference picture index of the target block.
[0615] A flag or index indicating whether the target block is a block encoded in the current picture reference mode may be signaled from the encoding device (100) to the decoding device (200). Alternatively, whether the target block is a block encoded in the current picture reference mode may be inferred through the reference picture index of the target block.
[0616] If the target block is encoded in the current picture reference mode, the target picture may be present at a fixed or arbitrary position within the reference picture list for the target block.
[0617] For example, the fixed position can be the position where the reference picture index value is 0 or the last position.
[0618] If the target picture exists at any location within the reference picture list, a separate reference picture index indicating this arbitrary location may be signaled from the encoding device (100) to the decoding device (200).
[0619] 5) Subblock merge mode
[0620] Sub-block merge mode may refer to a mode that derives motion information for a sub-block of a CU.
[0621] When the sub-block merge mode is applied, a sub-block merge candidate list can be generated using motion information of a call sub-block of a target sub-block in a reference image (i.e., a sub-block based temporal merge candidate) and / or an affine control point motion vector merge candidate.
[0622] 6) Triangle partition mode
[0623] In triangulation mode, target blocks can be generated by diagonally dividing a target block. For each divided target block, motion information of each divided target block can be derived, and prediction samples for each divided target block can be derived using the derived motion information. The prediction sample of the target block can be derived through a weighted sum of the prediction samples of the divided target blocks.
[0624] 7) Inter-intra joint prediction mode
[0625] The inter-intra combined prediction mode may be a mode that derives a prediction sample of a target block using a weighted sum of prediction samples generated by inter prediction and prediction samples generated by intra prediction.
[0626] In the aforementioned modes, the decoding device (200) can perform its own correction on the derived motion information. For example, the decoding device (200) can search for motion information having the minimum sum of absolute differences (SAD) by searching a specified area based on a reference block indicated by the derived motion information, and can derive the searched motion information as corrected motion information.
[0627] In the aforementioned modes, the decoding device (200) can perform compensation for prediction samples derived through inter prediction using optical flow.
[0628] In the aforementioned AMVP mode, merge mode, and skip mode, motion information to be used for prediction of a target block among motion information within the list can be specified through an index to the list.
[0629] To improve encoding efficiency, the encoding device (100) may signal only the index of the element that causes the least cost in inter prediction of the target block among the elements of the list. The encoding device (100) may encode the index and signal the encoded index.
[0630] Therefore, the aforementioned lists (i.e., the predicted motion vector candidate list and the merge candidate list) may need to be derived in the same manner based on the same data in the encoding device (100) and the decoding device (200). Here, the same data may include a reconstructed picture and a reconstructed block. Furthermore, in order to specify an element by index, the order of the elements within the list may need to be constant.
[0631]
[0632] Figure 10 shows spatial candidates according to an example.
[0633] In Fig. 10, the locations of spatial candidates are shown.
[0634] The large block in the middle can represent the target block. The five smaller blocks can represent spatial candidates.
[0635] The coordinates of the target block can be (xP, yP), and the size of the target block can be (nPSW, nPSH).
[0636] A spatial candidate A0 may be a block adjacent to the lower left corner of the target block. A0 may be a block occupying pixels at coordinates (xP - 1, yP + nPSH).
[0637] A spatial candidate A1 may be a block adjacent to the left of the target block. A1 may be the bottommost block among the blocks adjacent to the left of the target block. Alternatively, A1 may be a block adjacent to the top of A0. A1 may be a block occupying a pixel at coordinates (xP - 1, yP + nPSH - 1).
[0638] A spatial candidate B0 may be a block adjacent to the upper right corner of the target block. B0 may be a block occupying pixels at coordinates (xP + nPSW, yP - 1).
[0639] A spatial candidate B1 may be a block adjacent to the top of the target block. B1 may be the rightmost block among the blocks adjacent to the top of the target block. Alternatively, B1 may be a block adjacent to the left of B0. B1 may be a block occupying a pixel at coordinates (xP + nPSW - 1, yP - 1).
[0640] A 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 at coordinates (xP - 1, yP - 1).
[0641]
[0642] Determination of availability of spatial and temporal candidates
[0643] In order to include motion information of a spatial candidate or motion information of a temporal candidate in the list, it must be determined whether motion information of a spatial candidate or motion information of a temporal candidate is available.
[0644] Hereinafter, the candidate block may include spatial candidates and temporal candidates.
[0645] For example, the above judgment can be made by sequentially applying steps 1) to 4) below.
[0646] Step 1) If the PU containing the candidate block is outside the bounds of the picture, the availability of the candidate block may be set to false. "Availability is set to false" may mean the same thing as "is set to unavailable."
[0647] Step 2) If the PU containing the candidate block is outside the boundary of the slice, the availability of the candidate block may be set to false. If the target block and the candidate block are located in different slices, the availability of the candidate block may be set to false.
[0648] Step 3) If the PU containing the candidate block is outside the tile boundary, the availability of the candidate block may be set to false. If the target block and the candidate block are located within different tiles, the availability of the candidate block may be set to false.
[0649] Step 4) If the prediction mode of the PU containing the candidate block is intra prediction mode, the availability of the candidate block may be set to false. If the PU containing the candidate block does not use inter prediction, the availability of the candidate block may be set to false.
[0650]
[0651] Figure 11 shows the order of adding motion information of spatial candidates to the merge list according to an example.
[0652] As illustrated in Fig. 11, when adding motion information of spatial candidates to a merge list, the order of A1, B1, B0, A0, and B2 can be used. That is, motion information of available spatial candidates can be added to the merge list in the order of A1, B1, B0, A0, and B2.
[0653]
[0654] How to derive a merge list in merge mode and skip mode
[0655] As described above, the maximum number of merge candidates in the merge list can be set. The set maximum number is represented as N. The set number can be transmitted from the encoding device (100) to the decoding device (200). The slice header of the slice can include N. In other words, the maximum number of merge candidates in the merge list for the target block of the slice can be set by the slice header. For example, the value of N can be 5 by default.
[0656] Motion information (i.e., merge candidates) can be added to the merge list in the order of steps 1) to 4) below.
[0657] Step 1) Available spatial candidates among the spatial candidates can be added to the merge list. The motion information of the available spatial candidates can be added to the merge list in the order shown in Fig. 11. At this time, if the motion information of an available spatial candidate overlaps with other motion information already existing in the merge list, the motion information may not be added to the merge list. Checking whether it overlaps with other motion information existing in the list can be abbreviated as a "duplication check."
[0658] The number of additional movement information can be up to N.
[0659] Step 2) If the number of motion information items in the merge list is less than N and a temporal candidate is available, the motion information of the temporal candidate may be added to the merge list. At this time, if the motion information of the available temporal candidate overlaps with other motion information already existing in the merge list, the motion information may not be added to the merge list.
[0660] Step 3) If the number of motion information in the merge list is less than N and the type of the target slice is "B", combined motion information generated by combined bi-prediction can be added to the merge list.
[0661] The target slice may be a slice that contains the target block.
[0662] The combined motion information may be a combination of L0 motion information and L1 motion information. The L0 motion information may be motion information that only refers to the reference picture list L0. The L1 motion information may be motion information that only refers to the reference picture list L1.
[0663] Within a merge list, there may be one or more pieces of L0 motion information. Additionally, within a merge list, there may be one or more pieces of L1 motion information.
[0664] There may be one or more pieces of combined motion information. When generating the combined motion information, it may be predetermined which L0 motion information and which L1 motion information will be used among one or more pieces of L0 motion information and one or more pieces of L1 motion information. The one or more pieces of combined motion information may be generated in a predetermined order by combined bidirectional prediction using pairs of different motion information in the merge list. One of the pairs of different motion information may be L0 motion information and the other may be L1 motion information.
[0665] For example, the combined motion information that is added with the highest priority may be a combination of L0 motion information with a merge index of 0 and L1 motion information with a merge index of 1. If the motion information with a merge index of 0 is not L0 motion information or if the motion information with a merge index of 1 is not L1 motion information, the combined motion information may not be generated and added. The motion information that is added next may be a combination of L0 motion information with a merge index of 1 and L1 motion information with a merge index of 0. The specific combinations below may follow other combinations in the field of video encoding / decoding.
[0666] At this time, if the combined motion information overlaps with other motion information already existing in the merge list, the combined motion information may not be added to the merge list.
[0667] Step 4) If the number of motion information in the merge list is less than N, zero vector motion information can be added to the merge list.
[0668] Zero vector motion information may be motion information whose motion vector is a zero vector.
[0669] There may be more than one zero vector motion information. The reference picture indices of one or more zero vector motion information may be different from each other. For example, the reference picture index value of the first zero vector motion information may be 0. The reference picture index value of the second zero vector motion information may be 1.
[0670] The number of zero vector motion information may be equal to the number of reference pictures in the reference picture list.
[0671] The reference direction of the zero vector motion information can be bidirectional. Both motion vectors can be zero vectors. The number of zero vector motion information can 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. Alternatively, 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, a unidirectional reference direction can be used for a reference picture index that can be applied to only one reference picture list.
[0672] The encoding device (100) and / or the decoding device (200) can sequentially add zero vector motion information to the merge list while changing the reference picture index.
[0673] If the zero vector motion information overlaps with other motion information already existing in the merge list, the above zero vector motion information may not be added to the merge list.
[0674] The order of steps 1) through 4) described above is merely exemplary, and the order of the steps may be changed. Furthermore, some of the steps may be omitted depending on predefined conditions.
[0675]
[0676] A method for deriving a list of predicted motion vector candidates in AMVP mode
[0677] The maximum number of predicted motion vector candidates in the predicted motion vector candidate list can be predefined. The predefined maximum number is denoted as N. For example, the predefined maximum number can be 2.
[0678] Motion information (i.e., predicted motion vector candidates) can be added to the predicted motion vector candidate list in the order of steps 1) to 3) below.
[0679] Step 1) Available spatial candidates can be added to the list of predicted motion vector candidates. The spatial candidates may include a first spatial candidate and a second spatial candidate.
[0680] 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.
[0681] The motion information of the available spatial candidates can be added to the predicted motion vector candidate list in the order of the first spatial candidate and the second spatial candidate. At this time, if the motion information of the available spatial candidate overlaps with other motion information already existing in the predicted motion vector candidate list, the motion information may not be added to the predicted motion vector candidate list. In other words, if the value of N is 2, and the motion information of the second spatial candidate is identical to the motion information of the first spatial candidate, the motion information of the second spatial candidate may not be added to the predicted motion vector candidate list.
[0682] The number of additional movement information can be up to N.
[0683] Step 2) If the number of motion information items in the predicted motion vector candidate list is less than N and a temporal candidate is available, the motion information of the temporal candidate may be added to the predicted motion vector candidate list. In this case, if the motion information of the available temporal candidate overlaps with other motion information already existing in the predicted motion vector candidate list, the motion information may not be added to the predicted motion vector candidate list.
[0684] Step 3) If the number of motion information in the predicted motion vector candidate list is less than N, zero vector motion information can be added to the predicted motion vector candidate list.
[0685] There may be more than one zero vector motion information. The reference picture indices of one or more zero vector motion information may be different from each other.
[0686] The encoding device (100) and / or the decoding device (200) can sequentially add zero vector motion information to the predicted motion vector candidate list while changing the reference picture index.
[0687] If the zero vector motion information overlaps with other motion information already existing in the predicted motion vector candidate list, the zero vector motion information may not be added to the predicted motion vector candidate list.
[0688] The description of zero vector motion information described above for merge lists can also be applied to zero vector motion information. Duplicate descriptions are omitted.
[0689] The order of steps 1) through 3) described above is merely exemplary, and the order of the steps may be interchanged. Furthermore, some of the steps may be omitted depending on predefined conditions.
[0690]
[0691] Figure 12 illustrates the process of transformation and quantization according to an example.
[0692] As illustrated in Fig. 12, a quantized level can be generated by performing a transformation and / or quantization process on the residual signal.
[0693] The residual signal can be generated as the difference between the original block and the predicted block. Here, the predicted block can be a block generated by intra-prediction or inter-prediction.
[0694] The residual signal can be converted to the frequency domain through a transform process that is part of the quantization process.
[0695] The transform kernel used for the transformation may include various DCT kernels such as Discrete Cosine Transform (DCT) type 2 (DCT-II) and Discrete Sine Transform (DST) kernels.
[0696] These transform kernels can perform a separable transform or a 2-dimensional (2D) non-separable transform on the residual signal. A separable transform can be a transform that performs a 1-dimensional (1D) transform on the residual signal in each of the horizontal and vertical directions.
[0697] The DCT types and DST types adaptively used for 1D transformation may include DCT-V, DCT-VIII, DST-I, and DST-VII in addition to DCT-II, as shown in Tables 3 and 4 below, respectively.
[0698] [Table 3]
[0699]
[0700] [Table 4]
[0701]
[0702] As shown in Tables 3 and 4, a transform set can be used to derive the DCT type or DST type to be used for the transformation. Each transform set can include multiple transform candidates. Each transform candidate can be of the DCT type or the DST type, etc.
[0703] Table 5 below shows an example of a set of transformations applied in the horizontal direction and a set of transformations applied in the vertical direction depending on the intra prediction mode.
[0704] [Table 5]
[0705]
[0706] In Table 5, the number of vertical direction transformation sets and the number of horizontal direction transformation sets applied to the horizontal direction of the residual signal according to the intra prediction mode of the target block are indicated.
[0707] As illustrated in Table 5, transform sets applied in the horizontal and vertical directions 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.
[0708] In these transformations and inverse transformations, the transformation set applied to the residual signal may be determined as exemplified in Tables 3, 4, and 5, and may not be signaled. Transformation indication information may be signaled from the encoding device (100) to the decoding device (200). The transformation indication information may be information indicating which transformation candidate among a plurality of transformation candidates included in the transformation set applied to the residual signal is used.
[0709] For example, when the size of the target block is 64x64 or less, transform sets each having three transforms can be configured according to the intra prediction mode. An optimal transform method can be selected from a total of nine multi-transform methods resulting from a combination of three transforms in the horizontal direction and three transforms in the vertical direction. Encoding efficiency can be improved by encoding and / or decoding the residual signal using this optimal transform method.
[0710] At this time, for at least one of the vertical and horizontal transformations, information regarding which transformation among the transformations belonging to the transformation set was used can be entropy encoded and / or decoded. Truncated unary binarization can be used to encode and / or decode this information.
[0711] The method using various transformations as described above can be applied to the residual signal generated by intra prediction or inter prediction.
[0712] The transform may include at least one of a first transform and a second transform. Transform coefficients may be generated by performing a first transform on the residual signal, and second transform coefficients may be generated by performing a second transform on the transform coefficients.
[0713] The primary transformation may be referred to as the primary transformation. Furthermore, the primary transformation may be referred to as the Adaptive Multiple Transform (AMT). As previously mentioned, AMT may imply that different transformations are applied to each of the 1D directions (i.e., the vertical and horizontal directions).
[0714] A secondary transform may be a transform intended to improve the energy concentration of the transform coefficients generated by the primary transform. Like the primary transform, the secondary transform may be a separable or non-separable transform. A non-separable transform may be a non-separable secondary transform (NSST).
[0715] The primary transformation may be performed using at least one of a plurality of predefined transformation methods. For example, the plurality of predefined transformation methods may include a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), and a Karhunen-Loeve Transform (KLT)-based transformation.
[0716] Additionally, the primary transform can be a transform with various transform types depending on the kernel function defining the DCT or DST.
[0717] For example, the transformation type may be determined based on at least one of 1) a prediction mode of the target block (e.g., one of intra prediction and inter prediction), 2) a size of the target block, 3) a shape of the target block, 4) an intra prediction mode of the target block, 5) a component of the target block (e.g., one of a luma component and a chroma component), and 6) a partitioning type applied to the target block (e.g., one of a quad tree (QT), a binary tree (BT), and a ternary tree (TT)).
[0718] For example, the first transform may include transforms such as DCT-2, DCT-5, DCT-7, DST-7, DST-1, DST-8, and DCT-8 according to the transform kernels presented in Table 6 below. Table 6 illustrates various transform types and transform kernel functions for Multiple Transform Selection (MTS).
[0719] MTS may mean that a combination of one or more DCT and / or DST transform kernels is selected for transforming the residual signal in the horizontal and / or vertical directions.
[0720] [Table 6]
[0721]
[0722] In Table 6, i and j can be integer values greater than or equal to 0 and less than or equal to N-1.
[0723] A secondary transform can be performed on the transform coefficients generated by performing the primary transform.
[0724] As with the first-order transformation, a set of transformations can also be defined for the second-order transformation. The methods for deriving and / or determining a set of transformations as described above can be applied to both the first-order transformation and the second-order transformation.
[0725] Primary and secondary transformations can be determined for a given target.
[0726] For example, the first transform and the second transform may be applied to one or more signal components of the luma component and the chroma component. Whether the first transform and / or the second transform are applied may be determined based on at least one of the coding parameters for the target block and / or the neighboring blocks. For example, whether the first transform and / or the second transform are applied may be determined based on the size and / or shape of the target block.
[0727] In the encoding device (100) and the decoding device (200), the transformation information indicating the transformation method used for the target can be derived by using specific information.
[0728] For example, the transformation information may include an index of a transformation to be used for the primary transformation and / or the secondary transformation. Alternatively, the transformation information may indicate that the primary transformation and / or the secondary transformation are not used.
[0729] For example, when the target of the first transformation and the second transformation is a target block, the transformation method(s) applied to the first transformation and / or the second transformation indicated by the transformation information may be determined according to at least one of the coding parameters for the target block and / or the neighboring block.
[0730] Alternatively, conversion information indicating a conversion method for a specific target may be signaled from the encoding device (100) to the decoding device (200).
[0731] For example, for one CU, whether a primary transformation is used, an index indicating the primary transformation, whether a secondary transformation is used, and an index indicating the secondary transformation, etc. may be derived as transformation information in the decoding device (200). Alternatively, for one CU, transformation information indicating whether a primary transformation is used, an index indicating the primary transformation, whether a secondary transformation is used, and an index indicating the secondary transformation, etc. may be signaled.
[0732] Quantized transform coefficients (i.e., quantized levels) can be generated by performing quantization on the result or residual signal generated by performing the first transform and / or the second transform.
[0733]
[0734] Figure 13 illustrates diagonal scanning according to an example.
[0735] Figure 14 illustrates horizontal scanning according to an example.
[0736] Figure 15 illustrates vertical scanning according to an example.
[0737] The quantized transform coefficients may be scanned according to at least one of an intra prediction mode, a block size, and a block shape, and according to at least one of diagonal scanning (upper-right), vertical scanning, and horizontal scanning. A block may be a transform unit.
[0738] Each scan can start at a specific starting point and end at a specific ending point.
[0739] For example, the quantized transform coefficients can be converted into a one-dimensional vector form by scanning the coefficients of a block using the diagonal scanning of FIG. 13. Alternatively, depending on the block size and / or intra prediction mode, the horizontal scanning of FIG. 14 or the vertical scanning of FIG. 15 can be used instead of the diagonal scanning.
[0740] Vertical scanning may be scanning a two-dimensional block-shaped coefficient in the column direction. Horizontal scanning may be scanning a two-dimensional block-shaped coefficient in the row direction.
[0741] In other words, depending on the block size and / or inter prediction mode, it can be determined which scanning among diagonal scanning, vertical scanning and horizontal scanning will be used.
[0742] As illustrated in FIGS. 13, 14 and 15, the quantized transform coefficients can be scanned along the diagonal, horizontal or vertical directions.
[0743] Quantized transform coefficients can be expressed in block form. A block can include multiple sub-blocks. Each sub-block can be defined according to a minimum block size or minimum block shape.
[0744] In scanning, a scanning order based on the type or direction of scanning may be applied to sub-blocks first. Additionally, a scanning order based on the direction of scanning may be applied to quantized transform coefficients within a sub-block.
[0745] For example, as illustrated in FIGS. 13, 14, and 15, when the size of the target block is 8x8, quantized transform coefficients can be generated by a first transform, a second transform, and quantization for the residual signal of the target block. Thereafter, one of three scanning orders can be applied to four 4x4 sub-blocks, and quantized transform coefficients can be scanned according to the scanning order for each 4x4 sub-block.
[0746] The encoding device (100) can generate entropy-encoded quantized transform coefficients by performing entropy encoding on scanned quantized transform coefficients, and can generate a bitstream including the entropy-encoded quantized transform coefficients.
[0747] The decoding device (200) can extract entropy-encoded quantized transform coefficients from a bitstream, and can generate quantized transform coefficients by performing entropy decoding on the entropy-encoded quantized transform coefficients. The quantized transform coefficients can be aligned into a two-dimensional block shape through inverse scanning. At this time, as a method of inverse scanning, at least one of a diagonal scan (upper right), a vertical scan, and a horizontal scan can be performed.
[0748] In the decoding device (200), inverse quantization can be performed on quantized transform coefficients. Depending on whether a second inverse transform is performed, a second inverse transform can be performed on the result generated by performing inverse quantization. In addition, depending on whether a first inverse transform is performed, a first inverse transform can be performed on the result generated by performing the second inverse transform. By performing a first inverse transform on the result generated by performing the second inverse transform, a reconstructed residual signal can be generated.
[0749] For the luma component reconstructed via intra prediction or inter prediction, inverse mapping of the dynamic range can be performed before in-loop filtering.
[0750] The dynamic range can be divided into 16 equal pieces, and a mapping function can be signaled for each piece. The mapping function can be signaled at the slice level or the tile group level.
[0751] A reverse mapping function for performing reverse mapping can be derived based on the mapping function.
[0752] In-loop filtering, storage of reference pictures and motion compensation can be performed in the reverse mapped area.
[0753] A prediction block generated through inter prediction can be converted into a mapped region by mapping using a mapping function, and the converted prediction block can be used to generate a reconstructed block. However, since intra prediction is performed in a mapped region, a prediction block generated through intra prediction can be used to generate a reconstructed block without mapping and / or demapping.
[0754] For example, if the target block is a residual block of a chroma component, the residual block can be converted into a reverse mapped region by performing scaling on the chroma component of the mapped region.
[0755] Whether scaling is available can be signaled at the slice level or the tile group level.
[0756] For example, scaling can only be applied if a mapping to the luma component is available and if the partitioning of the luma component and the partitioning of the chroma components follow the same tree structure.
[0757] Scaling may be performed based on the average of the values of the samples of the luma prediction block corresponding to the chroma prediction block. In this case, if the target block uses inter prediction, the luma prediction block may refer to the mapped luma prediction block.
[0758] The values required for scaling can be derived by referencing a look-up table using the index of the piece to which the average of the values of the samples of the luma prediction block belongs.
[0759] Finally, by performing scaling on the residual block using the derived values, the residual block can be converted into a demapped region. Subsequently, reconstruction, intra-prediction, inter-prediction, in-loop filtering, and storage of reference pictures for the chroma component blocks can be performed in the demapped region.
[0760] For example, information indicating whether mapping and / or demapping of these luma and chroma components is available can be signaled via a set of sequence parameters.
[0761] A prediction block of a target block can be generated based on a block vector. The block vector can indicate displacement between the target block and a reference block. The reference block can be a block within the target image.
[0762] In this way, a prediction mode that generates a prediction block by referring to a target image can be called an intra block copy (IBC) mode.
[0763] IBC mode can be applied to CUs of a specific size. For example, IBC mode can be applied to an MxN CU, where M and N can be 64 or less.
[0764] IBC mode may include skip mode, merge mode, and AMVP mode. In skip mode or merge mode, a merge candidate list may be constructed, and a merge index may be signaled to specify one merge candidate among the merge candidates in the merge candidate list. The block vector of the specified merge candidate may be used as the block vector of the target block.
[0765] In AMVP mode, a differential block vector can be signaled. Furthermore, the predicted block vector can be derived from the left and top neighboring blocks of the target block. Additionally, an index indicating which neighboring block will be used can be signaled.
[0766] The prediction block of the IBC mode can be included in the target CTU or the left CTU, and can be limited to blocks within the reconstructed region. For example, the value of the block vector can be limited so that the prediction block of the target block is located within a specified region. The specified region can be an region of three 64x64 blocks that are encoded and / or decoded before the 64x64 block that includes the target block. By limiting the value of the block vector in this way, the memory consumption and device complexity associated with the implementation of the IBC mode can be reduced.
[0767]
[0768] Fig. 16 is a structural diagram of an encoding device according to one embodiment.
[0769] The encoding device (1600) may correspond to the encoding device (100) described above.
[0770] The encoding device (1600) may include a processing unit (1610), a memory (1630), a user interface (UI) input device (1650), a UI output device (1660), and storage (1640) that communicate with each other via a bus (1690). In addition, the encoding device (1600) may further include a communication unit (1620) connected to a network (1699).
[0771] The processing unit (1610) may be a semiconductor device that executes processing instructions stored in a central processing unit (CPU), memory (1630), or storage (1640). The processing unit (1610) may be at least one hardware processor.
[0772] The processing unit (1610) can perform generation and processing of signals, data, or information input to the encoding device (1600), output from the encoding device (1600), or used within the encoding device (1600), and can perform inspection, comparison, and judgment related to the signals, data, or information. That is, in the embodiment, generation and processing of data or information, and inspection, comparison, and judgment related to data or information can be performed by the processing unit (1610).
[0773] The processing unit (1610) may include an inter prediction unit (110), an intra prediction unit (120), a switch (115), a subtractor (125), a transformation unit (130), a quantization unit (140), an entropy encoding unit (150), an inverse quantization unit (160), an inverse transformation unit (170), an adder (175), a filter unit (180), and a reference picture buffer (190).
[0774] At least some of the inter prediction unit (110), intra prediction unit (120), switch (115), subtractor (125), transform unit (130), quantization unit (140), entropy encoding unit (150), inverse quantization unit (160), inverse transformation unit (170), adder (175), filter unit (180), and reference picture buffer (190) may be program modules and may communicate with an external device or system. The program modules may be included in the encoding device (1600) in the form of an operating system, application program modules, and other program modules.
[0775] The program modules may be physically stored on various known memory devices. Additionally, at least some of these program modules may be stored on a remote memory device that is capable of communicating with the encoding device (1600).
[0776] Program modules may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures that perform functions or operations according to one embodiment, or implement abstract data types according to one embodiment.
[0777] The program modules may be composed of instructions or codes that are executed by at least one processor of the encoding device (1600).
[0778] The processing unit (1610) can execute commands or codes of the inter prediction unit (110), intra prediction unit (120), switch (115), subtractor (125), transform unit (130), quantization unit (140), entropy encoding unit (150), inverse quantization unit (160), inverse transformation unit (170), adder (175), filter unit (180), and reference picture buffer (190).
[0779] The storage unit may represent memory (1630) and / or storage (1640). The memory (1630) and storage (1640) may be various types of volatile or non-volatile storage media. For example, the memory (1630) may include at least one of read-only memory (ROM) (1631) and random access memory (RAM) (1632).
[0780] The storage unit may store data or information used for the operation of the encoding device (1600). In an embodiment, data or information possessed by the encoding device (1600) may be stored in the storage unit.
[0781] For example, the storage unit can store pictures, blocks, lists, motion information, inter prediction information, and bitstreams.
[0782] The encoding device (1600) can be implemented in a computer system including a recording medium that can be read by a computer.
[0783] The recording medium can store at least one module required for the encoding device (1600) to operate. The memory (1630) can store at least one module, and at least one module can be configured to be executed by the processing unit (1610).
[0784] Functions related to communication of data or information of the encoding device (1600) can be performed through the communication unit (1620).
[0785] For example, the communication unit (1620) can transmit the bitstream to a decryption device (1700) to be described later.
[0786] Fig. 17 is a structural diagram of a decryption device according to one embodiment.
[0787] The decryption device (1700) can correspond to the decryption device (200) described above.
[0788] The decryption device (1700) may include a processing unit (1710), a memory (1730), a user interface (UI) input device (1750), a UI output device (1760), and storage (1740) that communicate with each other via a bus (1790). In addition, the decryption device (1700) may further include a communication unit (1720) connected to a network (1799).
[0789] The processing unit (1710) may be a semiconductor device that executes processing instructions stored in a central processing unit (CPU), memory (1730), or storage (1740). The processing unit (1710) may be at least one hardware processor.
[0790] The processing unit (1710) can perform generation and processing of signals, data, or information input to the decryption device (1700), output from the decryption device (1700), or used within the decryption device (1700), and can perform inspection, comparison, and judgment related to the signals, data, or information. That is, in the embodiment, generation and processing of data or information, and inspection, comparison, and judgment related to data or information can be performed by the processing unit (1710).
[0791] The processing unit (1710) may include an entropy decoding unit (210), an inverse quantization unit (220), an inverse transformation 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).
[0792] At least some of the entropy decoding unit (210), inverse quantization unit (220), inverse transformation unit (230), intra prediction unit (240), inter prediction unit (250), switch (245), adder (255), filter unit (260), and reference picture buffer (270) may be program modules and may communicate with external devices or systems. The program modules may be included in the decoding device (1700) in the form of an operating system, application program modules, and other program modules.
[0793] The program modules may be physically stored on various known memory devices. Additionally, at least some of these program modules may be stored on a remote memory device that can communicate with the decryption device (1700).
[0794] Program modules may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures that perform functions or operations according to one embodiment, or implement abstract data types according to one embodiment.
[0795] The program modules may be composed of instructions or codes that are executed by at least one processor of the decryption device (1700).
[0796] The processing unit (1710) can execute commands or codes of the entropy decoding unit (210), the inverse quantization unit (220), the inverse transformation 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).
[0797] The storage unit may represent memory (1730) and / or storage (1740). The memory (1730) and storage (1740) may be various types of volatile or non-volatile storage media. For example, the memory (1730) may include at least one of read-only memory (ROM) (1731) and random access memory (RAM) (1732).
[0798] The storage unit may store data or information used for the operation of the decryption device (1700). In an embodiment, data or information possessed by the decryption device (1700) may be stored in the storage unit.
[0799] For example, the storage unit can store pictures, blocks, lists, motion information, inter prediction information, and bitstreams.
[0800] The decryption device (1700) can be implemented in a computer system including a recording medium that can be read by a computer.
[0801] The recording medium can store at least one module required for the decryption device (1700) to operate. The memory (1730) can store at least one module, and at least one module can be configured to be executed by the processing unit (1710).
[0802] Functions related to communication of data or information of the decryption device (1700) can be performed through the communication unit (1720).
[0803] For example, the communication unit (1720) can receive a bitstream from the encoding device (1600).
[0804] Hereinafter, the processing unit may represent the processing unit (1610) of the encoding device (1600) and / or the processing unit (1710) of the decoding device (1700). For example, in the function related to prediction, the processing unit may represent the switch (115) and / or the switch (245). In the function related to inter prediction, the processing unit may represent the inter prediction unit (110), the subtractor (125), and the adder (175), and may represent the inter prediction unit (250) and the adder (255). In the function related to intra prediction, the processing unit may represent the intra prediction unit (120), the subtractor (125), and the adder (175), and may represent the intra prediction unit (240) and the adder (255). In the function related to transformation, the processing unit may represent a transformation unit (130) and an inverse transformation unit (170), and may represent an inverse transformation unit (230). In the function related to quantization, the processing unit may represent a quantization unit (140) and an inverse quantization unit (160), and may represent an inverse quantization unit (220). In the function related to entropy encoding and / or decoding, the processing unit may represent an entropy encoding unit (150) and / or an entropy decoding unit (210). In the function related to filtering, the processing unit may represent a filter unit (180) and / or a filter unit (260). In the function related to a reference picture, the processing unit may represent a reference picture buffer (190) and / or a reference picture buffer (270).
[0805]
[0806] Hereinafter, improved image encoding and decoding related technologies implemented in the aforementioned image encoding device and image decoding device are disclosed.
[0807]
[0808] 1. Template Matching
[0809] Figure 18 is a diagram of one embodiment of template matching.
[0810] In template matching, motion information of a target block can be determined and / or changed based on the result of calculating a cost function between a target template for a target block and a reference template for a reference block.
[0811] In some embodiments, template matching may be used to determine motion information of a target block. Based on a cost calculation between the target template and each of the reference templates, motion information corresponding to the displacement from the location of the target block to the location of the reference block with the lowest cost reference template may be used as motion information of the target block.
[0812] In another embodiment, template matching can be used to modify or improve the motion information of a target block. For example, reference templates are determined for reference blocks at locations indicated by the initial motion information for the target block and at locations spaced apart in a predetermined direction and spaced apart from that location. Then, based on a cost calculation between the target template and each of the reference templates, the motion information corresponding to the displacement from the target block to the reference block with the reference template having the lowest cost is determined as the final motion vector of the target block.
[0813] In another embodiment, template matching can be used to reorder motion information candidates included in the motion information candidate list of the target block. For example, reference templates for reference blocks at the locations indicated by each motion information candidate are constructed. Then, based on the cost calculation between the target template and its reference templates, the motion information candidates are reordered in ascending order of cost. This allows candidates with a high probability of being selected as motion information for the target block to be assigned a lower index.
[0814] In template matching, the reference block may include at least one of a reference block pointed to by initial motion information, a reference block pointed to by motion information derived during the search process of template matching, and a reference block pointed to by motion information ultimately improved through template matching.
[0815] Here, the initial motion information may be motion information of the target block signaled from the encoding device to the decoding device. Furthermore, the motion information improved through template matching may be motion information with the lowest matching cost derived from the template matching search process. However, the method for deriving motion information is not limited to the aforementioned criteria.
[0816] The template matching method may include at least one of an inter-template matching mode and an intra-template matching mode.
[0817] Inter-template matching mode may mean a template matching method in which a reference block is constructed based on at least one of a prediction sample, a reconstructed sample, and a residual sample of a reference picture reconstructed before the target picture.
[0818] Intra template matching mode may mean a template matching method in which a reference block is constructed based on at least one of a prediction sample, a reconstructed sample, and a residual sample of a target picture.
[0819] The template matching cost may mean the result of a calculation using a cost function for the template of the target block used in template matching and the template of the reference block.
[0820] 1.1 Template Configuration
[0821] Templates used in template matching may include target templates and reference templates.
[0822] The target template may be configured through a reference area including samples around the target block. The reference area of the target block may include at least one of the samples located in the lower left, left, upper left, upper and upper right areas of the target block.
[0823] In some embodiments, the target template may be identical to the reference area of the target block.
[0824] In some other embodiments, when constructing a target template in template matching, some of the samples within the reference region of the target block may be selected, and the target template may be constructed using the selected samples.
[0825] A reference template can be constructed using a reference region that includes surrounding samples of a reference block. The reference region of the reference block may be an area corresponding to the reference region of the target block. For example, the reference region of the reference block may include at least one of the samples located in the lower left, left, upper left, upper, and upper right regions of the reference block.
[0826] In some embodiments, in template matching, the reference template may be identical to the reference region of the reference block. For example, samples of the reference template relative to the reference block may be samples corresponding to samples of the target template relative to the target block.
[0827] In some other embodiments, when constructing a reference template in template matching, some samples within the reference region of the reference block may be selected. The reference template may then be constructed using the selected samples. For example, the samples selected for constructing the reference template based on the reference block may correspond to the samples selected for constructing the template of the target block based on the target block.
[0828] In inter-template matching mode, each of the reference block, reference template, and reference region is constructed from at least one of a prediction sample, a reconstructed sample, and a residual sample of a reference picture reconstructed before the target picture.
[0829] In the intra template matching mode, each of the reference block, the reference template, and the reference region is constructed from at least one of a prediction sample, a reconstructed sample, and a residual sample of the target picture. The target / reference template of template matching may include at least one of: 1) at least one of the samples within TMSIZE_LEFT lines adjacent to the left of the target / reference block; and 2) at least one of the samples within TMSIZE_ABOVE lines adjacent to the top of the target / reference block.
[0830] However, the positional relationship between each sample and the target / reference block within the template and / or the method of configuring the template are not limited to the aforementioned relationship or method.
[0831] TMSIZE_LEFT and TMSIZE_ABOVE can each be 0, 1, 2, 3, 4, or a positive integer greater than or equal to 4.
[0832] TMSIZE_LEFT and TMSIZE_ABOVE can be equal, or TMSIZE_LEFT and TMSIZE_ABOVE can be different.
[0833] TMSIZE_LEFT and TMSIZE_ABOVE can each be a predefined value or a value determined based on signaling / encoding / decoding information.
[0834] Each of TMSIZE_LEFT and TMSIZE_ABOVE can be determined based on at least one of motion information, coding parameters, size, and prediction mode of the target block.
[0835] 1.2 Subsampling in template matching
[0836] In template matching, subsampling may be performed for configuring templates, calculating costs, etc. Subsampling may also be performed for the search area for template matching.
[0837] ■ Subsampling for template configuration
[0838] Subsampling may be used to construct a template for template matching. That is, when constructing a template, either all samples within a reference region may be used, or only a portion of the samples within the reference region may be used. Here, the reference region may refer to at least one of the region referenced by the target block and the region referenced by the reference block for constructing the template.
[0839] In constructing a template for template matching using only some samples located in the reference region, subsampling may be performed for the entire reference region or a portion of the reference region.
[0840] In constructing a template for template matching using only some samples located in the reference region, the reference region may be divided into two or more regions.
[0841] In some embodiments, the divided regions may be one of: 1) a region where subsampling is performed, 2) a region where subsampling is not performed and is used for template construction, and 3) a region not used for template construction. A template for template matching may be constructed using samples selected through subsampling in 1) and samples within the region 2).
[0842] As an example, the area corresponding to 1) may be an area within the reference area, belonging to the left and / or upper left of the block.
[0843] As another example, the area corresponding to 1) may be an area within the reference area, which belongs to the top and / or top left of the block.
[0844] In some other embodiments, the divided area may be one of 1) an area where subsampling is performed and 2) an area not used for template construction. A template for template matching may be constructed using samples selected through subsampling in 1).
[0845] ■ Subsampling for cost calculation
[0846] In template matching, when calculating the cost between a target template and a reference template, all samples within each template may be used, or only a portion of the samples within each template may be used. In other words, the cost between templates may be calculated using only a portion of the samples within each template.
[0847] Subsampling of all or part of the template region may be performed to compute the cost between templates using only some samples within the template.
[0848] In performing cost calculations between templates using only some samples within the template, the template area for template matching can be divided into two or more areas.
[0849] In some embodiments, the divided regions may be one of: 1) a region where subsampling is performed, 2) a region where subsampling is not performed and is used for calculating the cost function, and 3) a region where subsampling is not performed. The cost function between templates in template matching may be calculated using samples selected through subsampling in 1) and samples within the region 2).
[0850] In another embodiment, the divided regions may be either 1) a region where subsampling is performed and 2) a region not used in calculating the cost function. In template matching, the cost function between templates may be calculated using samples selected through subsampling in 1).
[0851] ■ Subsampling of the search area
[0852] The search process for template matching can be performed using reference templates within a search area within a certain range from the sample location indicated by the initial motion vector of the target block. In this case, the search process may utilize all samples / locations within the search area, or only a portion of the samples / locations within the search area may be selected. The search and / or matching cost calculations may be performed only on the selected samples / locations or on the motion information indicating the selected samples / locations.
[0853] In performing the search process of template matching using only some of the samples / locations within the search area, subsampling may be performed on the entire search area or part of the search area.
[0854] In performing the search process of template matching using only some of the samples / locations within the search area, the search area may be divided into two or more areas.
[0855] In some embodiments, the divided regions may be one of 1) a region where subsampling is performed, 2) a region where a search process is performed without subsampling, and 3) a region where a search process is not performed. The search process of template matching may be performed on pixels and / or selected positions selected through subsampling in 1) and samples / positions within the region 2). Alternatively, the search process of template matching may be performed on motion information indicating samples / positions selected through subsampling in 1) and samples / positions within the region 2).
[0856] In some other embodiments, the divided regions may be either 1) a region where subsampling is performed and 2) a region where the search process is not performed. The search process of template matching may be performed using the samples / locations selected through subsampling in 1). Alternatively, the search process of template matching may be performed on motion information indicating the samples / locations selected through subsampling in 1).
[0857] Figures 19 and 20 illustrate various examples of subsampling methods in template matching.
[0858] The shaded samples (or locations) in FIGS. 19 and 20 represent samples (or locations) selected through subsampling.
[0859] The template can be constructed by performing subsampling for the entire or part of the reference area, as illustrated in FIG. 20, and using only the samples (or locations) selected through the subsampling.
[0860] Cost calculation can be performed on the entire or part of the template area of the template matching, as illustrated in Fig. 20, by performing subsampling, and only on selected samples (or locations).
[0861] Additionally, subsampling may be performed for the entire or part of the search area of template matching, as illustrated in FIG. 19, and calculation of search and / or matching costs may be performed only for selected pixels and / or positions or motion information indicating the selected pixels and / or positions.
[0862] 1.3 Search method for template matching
[0863] A first search step can be performed using first motion information encoded in a bitstream or decoded from a bitstream as initial motion information, thereby deriving second motion information which is a result of correcting the first motion information. In a second search step performed after the first search step, the second motion information can be used as initial motion information.
[0864] If the initial motion information (e.g., the initial motion vector or the initial block vector) is not motion information in integer pixel units (i.e., in fractional pixel units), the search may be performed using the result of rounding (or truncating or rounding down) the initial motion information.
[0865] In order to generate a reference template at a location indicated by motion information that adds a specific offset to the initial motion information in fractional pixel units during the search process, an interpolation filter must be applied to samples at integer pixel positions to generate samples at fractional pixel positions. However, if the initial motion information is limited to integer pixel units, interpolation for fractional pixel positions is not required during the search process, thereby reducing complexity.
[0866] ■ Definition of navigation
[0867] The search can be performed using the computation of a cost function to determine the similarity between NUM_TEMPLATE_COMPARE templates.
[0868] The search may include a process of determining at least one piece of motion information that satisfies a specific condition within a specific search range. The motion information of the target block may be determined and / or modified based on the at least one piece of motion information determined through the search.
[0869] Motion information that satisfies a specific condition may mean, but is not limited to, motion information having the lowest matching cost among motion information within the search range.
[0870] ■ Cost function
[0871] The cost function used for cost calculation may mean a function that determines the similarity between at least one sample in the target template and at least one sample in the reference template.
[0872] The similarity between the first value and the second value can be determined using at least one of the following operations: 1) a difference between two values, 2) a ratio between two values, and 3) comparing the difference between two values with a specific value.
[0873] As one embodiment of an operation that compares the difference between two values with a specific value, a method may be used in which multiple similarity values are assigned depending on which interval the difference between the two values belongs to among each interval divided by multiple thresholds. For example, when a single threshold is used, a method may be used in which a first similarity value (e.g., 1) is assigned if the difference between the two values is less than or equal to the threshold, and a second similarity value (e.g., 0) is assigned otherwise.
[0874] The cost function may be one or more of the Sum of Absolute Differences (SAD), the Sum of Absolute Transformed Differences (SATD), the Mean-Removed Sum of Absolute Differences (MR-SAD), the Mean Squared Error (MSE), and the Sum of Squared Error (SSE). However, the cost functions are not limited to the items listed above.
[0875] The cost function used in template matching can be predefined or determined based on signaling / encoding / decoding information.
[0876] The cost function used in template matching can be determined based on at least one of whether bilateral matching is performed, conditions related to bilateral matching, whether inter-weighted bi-prediction is performed, and the size of the target block.
[0877] In some embodiments, MR-SAD may be used as a cost function for template matching when the target block satisfies one or more or part of the activation conditions of bilateral matching described below, or when bilateral matching is performed on the target block.
[0878] In another embodiment, SAD may be used as a cost function of template matching when the target block does not satisfy one or more of the activation conditions of the two-sided matching or when two-sided matching is not performed on the target block.
[0879] In another embodiment, the type of cost function in template matching may be determined based on specific conditions for determining the type of cost function in bilateral matching. The type of cost function in bilateral matching may be determined based on whether specific conditions are satisfied in bilateral matching. In this case, the type of cost function in template matching may be determined based on whether the activation condition for bilateral matching and the above-mentioned specific conditions for determining the type of cost function in bilateral matching are satisfied.
[0880] For example, if the target block satisfies the activation condition of bilateral matching and the specific condition for determining the cost function of bilateral matching, MR-SAD can be used as the cost function of template matching, and if it does not satisfy the specific condition, SAD can be used as the cost function of template matching.
[0881] In another embodiment, if the target block satisfies the activation condition of bilateral matching and inter-weighted bi-prediction is performed or the number of samples in the target block is greater than a certain value, MR-SAD may be used as a cost function in template matching, and otherwise, SAD may be used as a cost function in template matching.
[0882] ■ Search scope (search area)
[0883] The search range can be a specific range centered around the location indicated by the initial motion information. In other words, the center of the search range can be the location indicated by the initial motion information.
[0884] Alternatively, the search range may be a specific range with the upper left corner being the location indicated by the initial motion information. In other words, the upper left corner of the search range may be the location indicated by the initial motion information.
[0885] Alternatively, the search range may be an area including surrounding sample locations in at least one of the lower left, left, upper left, top, and upper right directions of the target block.
[0886] The search range may have the shape of a rectangle with a width of SR_X and a height of SR_Y. Alternatively, the search range may have the shape of a diamond with a width of SR_X and a height of SR_Y. Alternatively, the search range may have the shape of a hexagon excluding the square area at the lower right of the rectangle. However, the shape and size of the search range are not limited to the embodiments described above.
[0887] Each of SR_X and SR_Y can be a positive integer. Each of SR_X and SR_Y can be a predefined value or a value determined based on signaling / encoding / decoding information.
[0888] The initial motion information may be determined based on at least one of motion information of the target block, a coding parameter of the target block, a motion vector of the target block, a reference image of the target block, a block vector of the target block, a motion vector predictor of the target block, a block vector predictor of the target block, motion information of at least one surrounding block of the target block, a merge candidate of the target block, a motion vector differential of the target block, and a block vector differential of the target block.
[0889] ■ How to navigate
[0890] The search method can be defined based on at least one of a search pattern, a search resolution, a search range, initial motion information, and a unit from which motion information is derived.
[0891] The search pattern can be one of the diamond, cross, or full-search patterns. However, the search pattern is not limited to the patterns listed above.
[0892] A search using a diamond pattern may mean searching one or more of the positions (0, 2ХRR), (RR, RR), (2ХRR, 0), (RR, -RR), (0, -RR), (-RR, -RR), (-RR, 0), (-RR, RR) and (0, 0), when (0, 0) represents the position pointed to by the initial motion information.
[0893] A search using a cross pattern may mean searching one or more of the positions (0, RR), (RR, 0), (0, -RR), (-RR, 0) and (0, 0), when (0, 0) represents the position pointed to by the initial motion information.
[0894] RR can be a value determined based on the search resolution or a search resolution, and can be a predefined positive integer.
[0895] A search using the full-search pattern may mean searching all locations within a pre-defined search range.
[0896] For example, when FS_i has values from -FS_X to FS_X and FS_j has values from -FS_Y to FS_Y, a search using a full-search pattern may mean searching for positions (FS_i Х RR, FX_jХRR). Here, (0, 0) may be a position indicated by the initial motion information. However, the search range is not limited to the aforementioned positions. Each of FS_X and FS_Y may be a predefined positive integer.
[0897] The search resolution can be one of 4-pel, full-pel, half-pel, or quarter-pel. However, the search resolution is not limited to the aforementioned pels.
[0898] The search resolution may be determined based on at least one of the information about the predefined or adaptive motion vector resolution, or based on signaled / encoded / decoded values.
[0899] The unit from which motion information is derived may include a full block unit and a sub-block unit.
[0900] To determine a search method defined by a search pattern, a search resolution, etc., at least one of motion information of a target block, a coding parameter of the target block, a size of the target block, a prediction mode of the target block, a reference image of the target block, at least one sample value within the target block, a target template, at least one sample value within the target template, and an area of the target template may be considered.
[0901] Figures 21 to 26 each illustrate a search method in template matching according to an example.
[0902] Based on the motion information, coding parameters, prediction mode, and adaptive motion vector resolution of the target block, specific columns in the tables illustrated in FIGS. 21 to 26 can be determined. A search can be performed using a search pattern and search resolution corresponding to rows marked with "v" in order from the top to the bottom of the determined columns.
[0903] For example, in FIG. 21, if the target block is in AMVP mode and the resolution determined through the adaptive motion vector resolution is 4-pel, a search for a diamond pattern using the 4-pel search resolution may be performed, and then a search for a cross pattern using the 4-pel search resolution may be performed.
[0904] ALT_IF may represent the index of an adaptive interpolation filter. An interpolation filter may be applied to calculate a pixel value at a sample location of a specific resolution. The adaptive interpolation filter may be an interpolation filter selected by an index from among multiple interpolation filters. In other words, when an adaptive interpolation filter is applied, different interpolation filters may be used depending on the index to calculate a pixel value at a sample location of a specific resolution.
[0905] For example, a particular resolution may be half-pel. However, a particular resolution is not limited to half-pel.
[0906] For example, the interpolation filter determined by the index may be one of a 6-tap interpolation filter and an 8-tap interpolation filter. However, the method for determining the interpolation filter is not limited to the above-described method.
[0907] Figure 27 is an exemplary diagram illustrating a method for configuring a first template (target template) in affine mode. Figures 28a and 28b are exemplary diagrams illustrating a method for configuring a second template (reference template) in affine mode.
[0908] CPMV can refer to the affine control point motion vector (CPMV) used in affine mode. Using CPMV, MVs can be derived for each subblock within a target block.
[0909] Referring to FIG. 27, the target template (A0 to A3 and L0 to L3) may be composed of sub-blocks adjacent to the top and left of the target block (target CU).
[0910] Referring to FIG. 28a, in one embodiment, reference templates (A0 to A3 and L0 to L3) corresponding to the target template can be determined using a motion vector (or block vector) determined for each reference template position based on the CPMV of the target block. For example, a subblock at a position indicated from the target template position by the motion vector of the reference template can be configured as the reference template.
[0911] Referring to FIG. 28b, in another embodiment, the reference templates (A0 to A3 to L0 to L4) corresponding to the target template can be determined using the motion vector (or block vector) of the subblock closest to each target template within the target block. For example, the motion vector (or block vector) of the subblock closest to the target template can be determined using the CPMV of the target block. Subblocks at positions indicated from the target template position by the determined motion vector can be configured as reference templates.
[0912] When the target block is in affine mode, the target block can be divided into sub-blocks of width N and height M. Motion information for each sub-block can be determined based on at least one of motion information, coding parameters, and size of the target block. The template matching cost for the target block can be determined based on at least one of the template matching costs for the divided sub-blocks. For example, the template matching cost for the target block can be the sum of the template matching costs for the divided sub-blocks or the average of the template matching costs for each sub-block.
[0913] N and M can be 2, 4, 8 or any positive integer, respectively.
[0914] N and M can be predefined values, or values determined based on signaling / encoding / decoding information.
[0915] 1.4 Template Matching in Bidirectional Prediction Blocks
[0916] The motion information of a target block can be determined based on the motion information of surrounding blocks. This can be expressed as "the target block inherits motion information from surrounding blocks."
[0917] For example, if the target block is in merge mode, one merge candidate can be specified based on the merge index from the merge candidate list, and the motion information of the specified merge candidate can be used as the motion information of the target block.
[0918] When the target block is in AMVP mode, one MV candidate can be specified based on the MV candidate index from the MV candidate list, and the motion information of the specified MV candidate can be used as the motion information of the target block.
[0919] When the target block is bidirectionally predicted, for example, when motion information inherited from a surrounding block indicates bidirectional prediction, an embodiment in which template matching is performed on the target block may include the following.
[0920] ■ Step 1:
[0921] Template matching is performed for each of the L0 and L1 directions, and template matching costs C0 and C1 for the motion information determined for the L0 and L1 directions are calculated.
[0922] At this time, when performing template matching for each direction, template matching can be performed in the same way as template matching in one-way prediction for the corresponding direction without considering motion information in other directions.
[0923] If the predefined conditions for the target block are satisfied, MR-SAD can be used as the cost function, and if they are not satisfied, SAD can be used as the cost function.
[0924] Here, the above-defined condition may be a condition based on at least one of: whether to perform local illumination compensation mode in the target block; whether to perform inter-weighted bi-prediction in the target block; an indicator indicating whether to perform a model-based prediction method in the target block; whether to perform bilateral matching in the target block; an indicator indicating whether to perform bilateral matching in the target block; motion information of the target block; a size of the target block; a coding parameter of the target block; motion information of a neighboring block of the target block; a coding parameter of a neighboring block of the target block; and a type of cost function in template matching in a neighboring block of the target block.
[0925] In some embodiments, if the indication of whether a model-based prediction method is performed on the target block is true, or if an indicator indicating whether a model-based prediction method is performed on the target block is true, MR-SAD may be used as the cost function, and otherwise, SAD may be used as the cost function.
[0926] In another embodiment, if the indication of whether to perform bilateral matching in the target block is true or the indication of whether to perform bilateral matching in the target block is true, and the number of samples in the target block is greater than or equal to a specific value, MR-SAD may be used as the cost function, and otherwise, SAD may be used as the cost function.
[0927] The above cost function may refer to a cost function used in searching for template matching; and / or a cost function used to calculate at least one of C0, C1, and C'. C' is described below in Step 3.
[0928] The cost function used in the search for template matching and the cost function used to calculate at least one of C0, C1, and C' may be the same or different. For example, MR-SAD may be used as the cost function in the search for template matching, and SAD may be used as the cost function for C0, C1, and C'.
[0929] In another embodiment, SAD may be used as a cost function in template matching when the target block size is smaller than a certain value, and MR-SAD may be used otherwise. The block size may include at least one of the block width, block height, (the sum of the block width and the block height), and (the product of the block width and the block height).
[0930] In another embodiment, if BCW is not performed on the target block or if the same weights are used for L0 direction and L1 direction reference blocks in BCW, SAD can be used as the cost function in template matching, otherwise MR-SAD can be used.
[0931] In another embodiment, if the Local Illumination Compensation (LIC) mode is not performed on the target block, SAD can be used as a cost function in template matching, and if not, MR-SAD can be used. The Local Illumination Compensation mode can be a mode that derives at least one of a weight and an offset by calculating a correlation between the template of the target block and the template of the reference block, and applies the derived weight or offset to part or all of the target block (or the reference block of the target block). Here, the weight refers to a parameter used for a multiplication operation with the reference block of the target block, and the offset refers to a parameter used for an addition operation with the reference block of the target block. In the Local Illumination Compensation mode, the sample value (P) can be modified as follows.
[0932] P' = w*P + o (w is the weight, o is the offset).
[0933] ■ Step 2:
[0934] If C0 < C1, a new target template T' is generated using the target template and the template in the L0 direction.
[0935] For example, when a target template T, a reference template in the L0 direction T0, and a reference template in the L1 direction T1, a new target template T' can be determined as follows.
[0936]
[0937] and Each can be a predefined value.
[0938] is positive, can be negative. and may be a value determined based on whether inter-weighted quantile prediction is performed in the target block; and / or a weight in inter-weighted quantile prediction.
[0939] for example, is 2, can be -1. If no inter-weighted biprediction is performed in the target block, or if the weights in the inter-weighted biprediction for the L0 direction and the L1 direction are the same, is 2, can be -1.
[0940] For example, if inter-weighted prediction is performed on the target block, may be a value determined based on the weight for the L1 direction. may be a value determined based on the weight for the L0 direction divided by the weight for the L1 direction.
[0941] If C0 > C1, a new target template T' can be generated using the target template and the template in the L1 direction.
[0942] If the values of C0 and C1 are the same, it can be considered as one of the cases of C0 < C1 or C1 > C0 and the procedure of Step 2 can be performed.
[0943] ■ Step 3:
[0944] If C0 < C1, template matching is performed with the target template as T' for the L1 direction, and the template matching cost C' for the motion information determined for the L1 direction is calculated.
[0945] If C0 > C1, template matching is performed with the target template as T' in the L0 direction, and the template matching cost C' for the motion information determined in the L0 direction is calculated.
[0946] If the values of C0 and C1 are the same, it can be considered as one of the cases of C0 < C1 or C1 > C0 and the procedure of Step 3 can be performed.
[0947] ■ Step 4:
[0948] The motion information of the target block can be changed to unidirectional motion information based on at least one of the values of C', C0, or C1.
[0949] For example, a given value for C' The value multiplied by is the smaller value of C0 or C1 (or a given value thereto) If the value multiplied by ( ) is greater than the motion information of the target block, the motion information is changed to motion information indicating unidirectional prediction in the L0 direction or L1 direction. Here, the result of multiplying the two values may mean one of the rounded or rounded up or down values for AxB or AxB.
[0950] For example, if C0 < C1, the motion information of the target block can be changed to motion information that indicates unidirectional prediction in the L0 direction. Alternatively, the motion information for the L1 direction in the target block can be considered unavailable.
[0951] If C0 > C1, the motion information of the target block can be changed to motion information that indicates unidirectional prediction in the L1 direction. Alternatively, the motion information for the L0 direction in the target block can be considered unavailable.
[0952] If the values of C0 and C1 are the same, it can be considered as one of the cases of C0 < C1 or C1 > C0 and the procedure of Step 4 can be performed.
[0953] and Each can be a predefined value.
[0954] and may be a value determined based on whether inter-weighted quantile prediction is performed in the target block; and / or a weight in inter-weighted quantile prediction.
[0955] for example, is 1 / 2, It could be 9 / 8.
[0956] for example, can be a value determined based on the L0 direction or L1 direction weight in the inter-weighted quantity prediction. If C0 < C1, can be the L1 direction weight in the inter-weighted prediction or a value determined based on it. If C1 < C0, may be the L0 direction weight in the inter-weighted quantity prediction or a value determined based thereon.
[0957] Steps 2 to 4 above can be performed only if the target block satisfies the predefined conditions.
[0958] For example, Steps 2 to 4 above may be performed only when the target block is a bidirectional prediction, bilateral matching is not performed in the target block, or the target block does not satisfy the activation condition of bilateral matching.
[0959]
[0960] 2. Bilateral Matching
[0961] In bilateral matching, a reference block in the L0 direction and a reference block in the L1 direction are used as templates, and the motion information of the target block can be determined and / or changed based on the calculation result of the cost function between the two templates.
[0962] The reference block may include at least one of 1) a reference block pointed to by initial motion information, 2) a reference block pointed to by motion information derived during the search process of bilateral matching, and 3) a reference block pointed to by motion information finally improved through bilateral matching.
[0963] For example, when constructing a template for two-sided matching, a reference block in the L0 direction and a reference block in the L1 direction can be used as templates.
[0964] The two-sided matching cost may mean the result value of a calculation using a cost function for the template of the L0-direction reference block and the L1-direction reference block used in the two-sided matching.
[0965] If the target block is in IBC mode and is predicted using two or more reference blocks, two different reference blocks among the reference blocks of the target block may be used as templates to perform bilateral matching.
[0966] Below, we describe bilateral prediction in inter prediction mode, not IBC mode. However, the technical features of bilateral prediction in inter prediction can be applied equally to IBC mode. In this case, the reference blocks in the L0 and L1 directions can be replaced with two reference blocks generated in IBC mode.
[0967] 2-1. Subsampling in two-sided matching
[0968] ■ Subsampling for template configuration
[0969] In constructing a template for bilateral matching, only some of the pixels and / or positions within the reference block in the L0 direction and the reference block in the L1 direction may be selected. The template may be constructed using only the selected pixels and / or the selected positions.
[0970] The template for the above two-sided matching may mean at least one of a template in the L0 direction and a template in the L1 direction.
[0971] In some embodiments, subsampling of a reference block in the L0 direction and a reference block in the L1 direction may be used to construct a template for bilateral matching.
[0972] As another embodiment, when constructing a template for bilateral matching, subsampling of a portion of the reference block in the L0 direction and a portion of the reference block in the L1 direction may be used.
[0973] For example, in constructing a template for bilateral matching, a reference block in the L0 direction and a reference block in the L1 direction can each be divided into two or more regions. The divided regions can be one of 1) a region where subsampling is performed, 2) a region where subsampling is not performed and is used for constructing a template, and 3) a region not used for constructing a template. A template for bilateral matching can be constructed using pixels and / or selected positions through subsampling in 1) and pixels and / or positions within the region 2).
[0974] Alternatively, the divided regions may be either 1) a region where subsampling is performed and 2) a region not used for template construction. A template for bilateral matching may be constructed using pixels and / or locations selected through subsampling in 1).
[0975] As another embodiment, when constructing a template for two-sided matching, the area used for constructing the template may be a portion of a reference block in the L0 direction and a portion of a reference block in the L1 direction.
[0976] In another embodiment, when constructing a template for bilateral matching, pixels (or locations) used in constructing the template may be selected only from a portion of a reference block in the L0 direction and a portion of a reference block in the L1 direction.
[0977] The size of some areas of the reference block in the L0 direction may be smaller than the size of areas of the reference block in the L1 direction.
[0978] For example, the height (vertical size) of some area of the reference block in the L0 direction may be smaller than the height (vertical size) of the reference block in the L1 direction.
[0979] For example, the width (horizontal size) of some areas of the reference block in the L0 direction may be smaller than the width (horizontal size) of the reference block in the L1 direction.
[0980] The size of some areas of the reference block in the L1 direction may be smaller than the size of areas of the reference block in the L0 direction.
[0981] For example, the height (vertical size) of some areas of the reference block in the L1 direction may be smaller than the height (vertical size) of the reference block in the L0 direction.
[0982] For example, the width (horizontal size) of some areas of the reference block in the L1 direction may be smaller than the width (horizontal size) of the reference block in the L0 direction.
[0983] ■ Subsampling for cost calculation
[0984] When performing cost calculations between templates in a two-sided matching, only some of the pixels and / or locations within the template area may be selected. Cost calculations may be performed only for the selected pixels and / or locations.
[0985] In some embodiments, when performing cost calculation between templates in a bilateral matching, subsampling may be performed for the template region in the L0 direction and the template region in the L1 direction.
[0986] As another embodiment, when performing cost calculation between templates in bilateral matching, subsampling may be performed on a portion of the template area in the L0 direction and a portion of the template area in the L1 direction.
[0987] Alternatively, in performing cost calculation between templates in bilateral matching, the region of the L0-direction template and the region of the L1-direction template may each be divided into two or more regions. The divided regions may be one of: 1) a region where subsampling is performed, 2) a region where subsampling is not performed and is used for cost calculation, and 3) a region not used for cost calculation. Cost calculation between templates in bilateral matching may be performed using pixels and / or selected locations through subsampling in 1) and pixels and / or locations within the region 2).
[0988] Alternatively, the divided regions may be either 1) a region where subsampling is performed and 2) a region not used in the calculation of the cost function. In 1), the calculation of the cost function between templates in the two-sided matching may be performed using the pixels and / or locations selected through subsampling.
[0989] As another embodiment, when performing cost calculation between templates in a two-sided matching, the area used for cost calculation may be a part of the L0 direction template and a part of the L1 direction template.
[0990] The sizes of some areas of the L0 direction template and some areas of the L1 direction template may be different from each other.
[0991] As an example, the size of some areas of the template in the L0 direction may be smaller than the size of areas of the template in the L1 direction.
[0992] For example, the height (vertical size) of some areas of the template in the L0 direction may be smaller than the height (vertical size) of the template in the L1 direction.
[0993] For example, the width (horizontal size) of some region of the template in the L0 direction may be smaller than the width (horizontal size) of a block of the template in the L1 direction.
[0994] As another example, the size of some areas of the template in the L1 direction may be smaller than the size of areas of the template in the L0 direction.
[0995] For example, the height (vertical size) of some areas of the template in the L1 direction may be smaller than the height (vertical size) of the template in the L0 direction.
[0996] For example, the width (horizontal size) of some areas of the template in the L1 direction may be smaller than the width (horizontal size) of the template in the L0 direction.
[0997] ■ Subsampling of the search area
[0998] For example, when performing a search process for two-sided matching, only some pixels and / or locations within the search area may be selected. The search and / or matching cost may be calculated only for the selected pixels and / or locations. Alternatively, the search and / or matching cost may be calculated only for the motion information indicating the selected pixels and / or locations.
[0999] For example, in performing the search process of two-sided matching, subsampling may be performed on the entire or part of the search area.
[1000] Alternatively, for example, in performing the search process of bilateral matching, the search area may be divided into two or more areas. The divided areas may be one of 1) an area where subsampling is performed, 2) an area where the search process is performed without subsampling, and 3) an area where the search process is not performed. The search process of bilateral matching may be performed on pixels and / or selected positions selected through subsampling in 1) and pixels and / or positions within the area 2). Alternatively, the search process of bilateral matching may be performed on motion information indicating pixels and / or selected positions selected through subsampling in 1) and pixels and / or positions within the area 2).
[1001] Alternatively, for example, when performing a search process for bilateral matching, the search area may be divided into two or more areas. The divided areas may be either 1) an area where subsampling is performed and 2) an area where the search process is not performed. The search process for bilateral matching may be performed using pixels and / or positions selected through subsampling in 1). Alternatively, the search process for bilateral matching may be performed on motion information indicating pixels and / or positions selected through subsampling in 1).
[1002] Various examples of subsampling methods in two-sided matching are shown in Fig. 19.
[1003] The shaded samples (or locations) in Fig. 19 may represent samples (or locations) selected through subsampling.
[1004] For the reference block area in the L0 direction and the reference block area in the L1 direction, subsampling is performed as illustrated in Fig. 19, and a template can be constructed using only selected samples (or locations).
[1005] For some areas of the reference block area in the L0 direction and some areas of the reference block area in the L1 direction, subsampling is performed as illustrated in Fig. 19, and a template can be constructed using only selected samples (or locations).
[1006] For all or part of the template area of the two-sided matching, subsampling may be performed as illustrated in FIG. 19, and cost calculation may be performed only for selected samples (or locations).
[1007] For all or part of the search area of the two-sided matching, subsampling may be performed as illustrated in FIG. 19, and calculation of search and / or matching costs may be performed only for selected pixels and / or locations.
[1008] For all or part of the search area of the two-sided matching, subsampling may be performed as illustrated in FIG. 19, and calculation of search and / or matching costs may be performed only for motion information indicating selected pixels and / or positions.
[1009] 2-2. Subsampling in two-sided matching
[1010] Bilateral matching may always be performed, or bilateral matching may be performed only when predefined enabling conditions are satisfied.
[1011] For example, bilateral matching can be performed when inter prediction mode is used for the target block and two or more reference blocks are used.
[1012] For example, bilateral matching can be performed when the first direction and the second direction are different, and the first POC interval and the second POC interval are the same. The first direction can be a direction from the target image to the L0 direction reference image. The second direction can be a direction from the target image to the L1 direction reference image. The first POC interval can be the difference between the POC of the target image and the POC of the L0 direction reference image. The second POC interval can be the difference between the POC of the target image and the POC of the L1 direction reference image.
[1013] For example, bilateral matching can be performed only when the first and second directions are different. The first direction can be the direction from the target image to the L0-direction reference image. The second direction can be the direction from the target image to the L1-direction reference image.
[1014] Here, the fact that the first and second directions are different may mean that Equation 1 below is satisfied.
[1015] [Formula 1] (POCt - POC0) Х (POCt - POC1) < 0
[1016] Here, the fact that the first direction and the second direction are equal may mean that Equation 2 below is satisfied.
[1017] [Formula 2] (POCt - POC0) Х (POCt - POC1) > 0
[1018] In Equations 1 and 2, POCt represents the POC of the target image, POC0 represents the POC of the L0 direction reference image, and POC1 represents the POC of the L1 direction reference image.
[1019] 2-3. Search method for two-sided matching
[1020] ■ Definition of navigation
[1021] The search can be performed using the computation of a cost function to determine the similarity between two templates.
[1022] The search may include a process of determining at least one piece of motion information that satisfies a specific condition within a specific search range. The motion information of the target block may be determined and / or modified based on the at least one piece of motion information determined through the search.
[1023] For example, motion information that satisfies a specific condition may mean motion information with the lowest matching cost among motion information within the search range, but is not limited thereto.
[1024] The search may involve determining at least one block that satisfies a specific condition within a specific search range. Motion information indicating the block determined through the search may be used as motion information for the target block.
[1025] For example, a block satisfying a specific condition may mean, but is not limited to, motion information having the lowest matching cost among reference blocks within the search range.
[1026] ■ Cost function
[1027] A cost function may refer to a function that determines the similarity between at least one sample in the first template and at least one sample in the second template for two templates of a two-sided match. For example, it may be a function that determines the similarity between at least one sample in the first template and a corresponding sample in the second template.
[1028] The similarity between the first value and the second value can be determined using at least one of the following operations: 1) a difference between two values, 2) a ratio between two values, and 3) comparing the difference between two values with a specific value.
[1029] The cost function may be one or more of the Sum of Absolute Differences (SAD), the Sum of Absolute Transformed Differences (SATD), the Mean-Removed Sum of Absolute Differences (MR-SAD), the Mean Squared Error (MSE), and the Sum of Squared Error (SSE). However, the cost functions are not limited to the items listed above.
[1030] The cost function used in two-way matching can be predefined or determined based on signaling / encoding / decoding information.
[1031] As an example, SAD can be used as a cost function in bilateral matching when the target block size is smaller than a certain value, and MR-SAD can be used otherwise. The block size can include at least one of the following: block width, block height, (the sum of the block width and the block height), or (the product of the block width and the block height).
[1032] As another example, if BCW is not performed on the target block or if the same weights are used for L0-direction and L1-direction reference blocks in BCW, SAD or SATD can be used as the cost function in bilateral matching, otherwise MR-SAD or MR SATD can be used.
[1033] As another example, SAD can be used as a cost function in bilateral matching when local illumination compensation mode is not performed in the target block, and MR-SAD can be used as a cost function otherwise.
[1034] 2-4. Exploration phase of two-sided matching
[1035] If the initial motion information (e.g., the initial motion vector or the initial block vector) is not motion information in integer pixel units (i.e., in fractional pixel units), the initial motion information can be modified by performing rounding (or truncating or rounding up) on the initial motion information, and a search can be performed using the modified initial motion vector.
[1036] For example, in order to generate a template at a location indicated by motion information that adds a specific offset to the initial motion information in units of fractional pixels during the search process, an interpolation filter must be applied to samples at integer pixel locations to generate samples at fractional pixel locations. However, if the initial motion information is limited to units of integer pixels, the complexity can be reduced because interpolation for fractional pixel locations does not need to be performed during the search process.
[1037] Bilateral matching may involve one or more search steps.
[1038] For example, bilateral matching may be configured to sequentially include 1) a step of deriving motion information for the entire block and 2) a step of deriving motion information for sub-blocks of the block. However, the method of deriving motion information performed at each step and the order of the steps are not limited to the aforementioned configuration.
[1039] At each search step of the two-sided matching, the motion information for BM_NUM directions among the motion information for the L0 direction and the motion information for the L1 direction can be improved. BM_NUM can be 0, 1, 2, or a positive integer. The BM_NUMs used in the two-sided matching steps can be the same or different.
[1040] For example, if BM_NUM is 1 at a specific search step, then LX at the specific search step above BM Motion information improvement can be performed only for the motion information of the direction. Here, X BM can have the value 0 or 1. That is, X BM If this is 0, the L0 direction is LX BM Set in direction, X BM If this is 1, the L1 direction is LX BM It is set in the direction.
[1041] For example, at a particular search step, BM_NUM is 1, and X BM If this is 0, in the specific search step above, only search in the L0 direction can be performed while the template in the L1 direction and the motion information in the L1 direction are fixed.
[1042] X BM Information about can be signaled / encoded / decoded.
[1043] Or, X BM can be pre-defined.
[1044] For example, X BMcan be set to a value in the direction having a larger POC difference from the target picture among the L0 direction and the L1 direction. The POC difference can be the difference between the POC of the reference image (in a specific direction) and the POC of the target image.
[1045] Alternatively or additionally, X BM can be set to a direction having a higher template matching cost among the L0 direction and the L1 direction. Here, the template matching cost of a specific direction can be a template matching cost of motion information of the specific direction.
[1046] Below is X BM Various embodiments for determining this are described.
[1047]
[1048] ■ X BM How to decide
[1049] In one embodiment, X BM can be 0 if the first POC difference is greater than the second POC difference, otherwise it can be 1. Or, X BM The first POC difference may be 1 if the first POC difference is greater than the second POC difference, and 0 otherwise. The first POC difference may be the difference between the POC of the target image and the POC of the reference image in the L0 direction. The second POC difference may be the difference between the POC of the target image and the POC of the reference image in the L1 direction.
[1050] In another embodiment, X BM can be determined based on a context model and / or a probability model used to entropy encode and entropy decode motion information and coding parameters of the target block.
[1051] For example, X BM may be determined based on at least one of a context model and / or a probability model used in entropy encoding and entropy decoding of an inter prediction indicator indicating the direction of inter prediction for the target block.
[1052] From the context model and / or probability model used in entropy encoding and entropy decoding of the inter prediction indicator, the more likely direction in the target block among L0-direction unidirectional prediction and L1-direction unidirectional prediction is LX. BM The direction, i.e. the direction in which the motion information improvement is performed, can be selected.
[1053] Alternatively, from the context model and / or probability model used in entropy encoding and entropy decoding of the inter prediction indicator, the more likely direction in the target block among L0-direction unidirectional prediction and L1-direction unidirectional prediction is L(1-X). BM ) can be selected as a direction in which no motion information improvement is performed.
[1054] A more probable direction may refer to a direction in which fewer bits are used when performing entropy encoding using a contextual model and / or a probability model. Alternatively, a more probable direction may refer to a direction in which the contextual model and / or the probability model indicate a higher probability for that direction.
[1055] As another example, LX BM can be determined based on the weights in the inter-weighted prediction of the target block. For example, LX BM can be the direction with higher weight between L0 direction and L1 direction. Or, LX BM It can be a direction with a lower weight between the L0 direction and the L1 direction.
[1056] As another example, X BM can be determined based on at least one of motion information and coding parameters of surrounding blocks. For example, X in the target block can be determined based on at least one of motion information and coding parameters of surrounding blocks corresponding to at least one of A0, A1, B0, B1, and B2 of FIG. 11.
[1057] For example, X of the target block BM can be determined based on at least one of the inter prediction indicator and inter prediction weight in the surrounding blocks.
[1058] For example, X BM One or more context models and / or probability models can be used for entropy encoding and entropy decoding. Among the multiple context models and / or probability models, based on at least one of the motion information and coding information of the surrounding blocks, X in the target block BM The context model and / or probability model used for entropy encoding and entropy decoding can be determined.
[1059] X in blocks BM The context model and / or probability model used for entropy encoding and entropy decoding may be the same. Alternatively, X in blocks BM The context model and / or probability model used for entropy encoding and entropy decoding may differ depending on at least one of the inter prediction direction and inter biprediction weight of the surrounding blocks.
[1060] Same X in the search stages of both sides matching BM can be used. Alternatively, different X BM Each of them can be used.
[1061]
[1062] Below, we describe BM_NUM, which indicates the number of directions in which motion information is improved among the L0 direction and the L1 direction.
[1063] ■ BM_NUM
[1064] BM_NUM can be 0, 1, 2, or any positive integer.
[1065] BM_NUM can be pre-defined.
[1066] The BM_NUM in each search step of the two-sided matching may be determined based on coding parameters. Alternatively, the BM_NUM may be determined based on at least one of motion information, a search step of the two-sided matching, a matching cost in a previous search step, a matching cost for initial motion information in the current search step, and the BM_NUM in the previous search step.
[1067] In one embodiment, in the first search step of a two-sided match, BM_NUM may be 1 or 2.
[1068] In one embodiment, the BM_NUM of the current search step may be determined based on the matching cost in the previous search step.
[1069] For example, if the difference between the matching cost for the initial motion information of the previous search step and the matching cost for the improved motion information of the previous search step is less than COSTDIFF_FORBMNUM, the BM_NUM of the current search step may be 0.
[1070] COSTDIFF_FORBMNUM can be 0, 1, 2, 4, 8, 16, or any positive integer.
[1071] COSTDIFF_FORBMNUM can be determined based on the size of the target block. COSTDIFF_FORBMNUM can be the product of the number of pixels in the target block and a specific value. The specific value can be 0, 1, 2, 4, 8, or a positive integer.
[1072] In one embodiment, if BM_NUM in the previous search step is 0, BM_NUM in the current search step may be 0.
[1073] In one embodiment, if the matching cost for the initial motion information of the current search step is less than COSTDIFF_FORBMNUM_INIT, the BM_NUM of the target block may be 0.
[1074] COSTDIFF_FORBMNUM_INIT can be 0, 1, 2, 4, 8, 16, or any positive integer.
[1075] For example, COSTDIFF_FORBMNUM_INIT can be determined based on the size of the target block. COSTDIFF_FORBMNUM_INIT can be the product of the number of pixels in the target block and a specific value. The specific value can be 0, 1, 2, 4, 8, or a positive integer.
[1076] In one embodiment, when motion improvement is performed in the search phase of bilateral matching, motion information improvement for L0 direction motion information may be performed only when the matching cost for L0 direction motion information of the initial motion information of the current search phase is greater than COSTDIFF_FORBMNUM_INIT.
[1077] In some embodiments, when motion improvement is performed in the search phase of bilateral matching, motion information improvement for L1 direction motion information may be performed only when the matching cost for L1 direction motion information of the initial motion information of the current search phase is greater than COSTDIFF_FORBMNUM_INIT.
[1078] A BM_NUM of 0 in a specific search step of two-sided matching may indicate that motion information enhancement is not performed in said specific search step. Alternatively, a BM_NUM of 0 in a specific search step of two-sided matching may indicate that said specific search step is not performed.
[1079] For example, when two-sided matching is performed, BM_NUM in the motion information derivation step for the entire block may be 1, and BM_NUM in the motion information derivation step for the sub-block may be 2. In this case, LX in the motion information derivation step for the entire block BMOnly the motion information for the direction can be improved, and in the motion information derivation step for the sub-block, both the motion information in the L0 direction and the motion information in the L1 direction can be improved.
[1080] Figure 29 is a drawing for explaining two-sided matching according to one embodiment of the present invention.
[1081] Figure 29 shows the case where BM_NUM is 2 in the motion information derivation step for the entire block of two-sided matching.
[1082] MV0 represents initial motion information in the L0 direction, and MV1 represents initial motion information in the L1 direction.
[1083] MV diff may refer to the motion information improvement value derived through two-sided matching.
[1084] MV0' and MV1' may be motion information derived through bilateral matching.
[1085] In bilateral matching, the magnitude of the motion information improvement value in the L0 direction and the magnitude of the motion information improvement value in the L1 direction may be the same. The directions of the motion information improvement value in the L0 direction and the motion information improvement value in the L1 direction may be opposite to each other. That is, Equations 3 and 4 below may be established.
[1086] [Formula 3] MV0' = MV0 + MV diff
[1087] [Formula 4] MV1' = MV1 - MV diff
[1088] For example, if the target block is in IBC mode and two or more reference blocks are used, when performing bilateral matching in the target block, the values and directions of the motion information improvement for the first reference block and the motion information improvement for the L1 direction may be the same.
[1089] Subsampling in template matching or bilateral prediction described above may be performed based on at least one of: whether template matching or bilateral prediction is performed; an indicator indicating whether template matching or bilateral prediction is performed; motion information of the target block; coding parameters of the target block; and a search step in template matching.
[1090] As an example, the subsampling method may be determined based on at least one of: whether template matching is performed; an indicator indicating whether template matching is performed; motion information of the target block; coding parameters of the target block; and a search step in template matching.
[1091] The subsampling method used in template matching or two-sided matching may be the same for each search step. Alternatively, the subsampling method used in performing template matching and / or two-sided matching may vary across search steps.
[1092] As another example, whether to perform subsampling may be determined based on at least one of: whether to perform template matching; an indicator indicating whether to perform template matching; motion information of the target block; coding parameters of the target block; and a search step in template matching.
[1093] When performing template matching, the subsampling may be performed uniformly across search steps. Alternatively, the subsampling may be performed differently across search steps.
[1094] Subsampling in the horizontal direction may be the same as subsampling in the vertical direction. Alternatively, subsampling in the horizontal direction may be different from subsampling in the vertical direction.
[1095]
[1096] 3. Decoder-side Motion Information Derivation
[1097] In some embodiments, the decoder-side motion information derivation method may include methods such as template matching and bilateral matching. For example, motion information may be generated through template matching, or previously determined first motion information (or initial motion information) may be refined through template matching or bilateral matching. In other words, the decoder-side motion information derivation method may refer to a method of deriving second motion information by performing refinement on the first motion information.
[1098] A prediction block of the target block can be generated by performing a prediction using the derived second motion information. Alternatively, at least one of the reference blocks of the target block can be identified using the second motion information.
[1099] In embodiments, improving specific information may mean amending, correcting, or updating specific information. In embodiments, the terms "refinement," "amendment," and "correction" may be used interchangeably. By improving specific information, improved information may be generated.
[1100] Performing an improvement on specific motion information may mean that at least one of the following methods is performed on the motion information.
[1101] - Change specific information included in the corresponding movement information using a predetermined offset.
[1102] - Modifying specific information included in the corresponding movement information by performing a specific operation on the specific information and a predetermined offset. Here, the specific operation includes at least one of squaring, weighted average, weighted sum, arithmetic operation, and filtering.
[1103] A given offset may include at least one of a motion vector, a reference picture index, an inter prediction indicator, reference picture list information, a reference image, a motion vector candidate, a motion vector candidate index, a merge candidate and a merge index, a block vector, a block vector candidate, and a block vector candidate index.
[1104] A given offset can be specified from a list of offset candidates, and information for specifying the given offset can be signaled / encoded / decoded. For example, an index for specifying at least one offset from the list of given offset candidates can be signaled / encoded / decoded.
[1105] In another embodiment, the decoder-only motion information derivation method may be a method of re-ordering or reconstructing the motion information list using a matching cost.
[1106] Based on the matching cost for each piece of motion information in a list consisting of N pieces of motion information, reordering of at least one piece of motion information in the list may be performed. For example, the list consisting of N pieces of motion information may be a merge candidate list. For example, the order of all or part of the motion information in the list consisting of N pieces of motion information may be reordered in ascending order of matching cost.
[1107] After at least one piece of motion information in the list consisting of the N pieces of motion information is reordered, the list can be reconstructed.
[1108] Reconstructing a specific motion information list may mean at least one of: 1) constructing a list using only a portion of the motion information constituting the motion information list; 2) removing at least one piece of motion information constituting the motion information list from the list; 3) inserting at least one piece of new motion information into the motion information list.
[1109] As an example, the new motion information in 3) above may be motion information determined based on at least one motion information within the motion information list. For example, the new motion information may be an average or weighted average of two motion information having the smallest indices within the list.
[1110] As another example, the new motion information in 3) above may be predefined default motion information.
[1111] The above N can be 2, 3, 4, 6, 8, 12 or a positive integer.
[1112] At least one piece of motion information may be identified from the above-mentioned rearranged or reconstructed list. A prediction block of the target block may be generated by performing prediction using the identified motion information. Alternatively, at least one of the reference blocks of the target block may be identified using the identified motion information.
[1113] In another embodiment, the decoder-only motion information derivation method may be a method of specifying at least one location within a search area based on a matching cost, or a method of specifying at least one location among some locations within a search area based on a matching cost.
[1114] In embodiments, location and motion information may be used interchangeably. In embodiments, a specific location may be used interchangeably with motion information indicating a distance from a target block to that location. In embodiments, a specific location may refer to motion information indicating a distance from a target block to that location. In embodiments, a specific motion information may refer to a location indicated by the motion information from the target block.
[1115] In embodiments, specifying a location may mean specifying a sample at that location.
[1116] In embodiments, specifying a location may mean specifying motion information indicating a distance from a target block to that location.
[1117] For example, a decoder-only motion information derivation method may be to identify N locations with the lowest matching cost among locations within the search area.
[1118] The matching cost for a specific location may mean the matching cost for movement information indicating from the target block to that location.
[1119] For example, one may identify N locations within the search region with the lowest matching costs. Alternatively, one may identify N locations with the lowest matching costs among some locations within the search region. N may be 1, 2, 3, 4, 5, 6, 8, 12, or any positive integer.
[1120] A list can be constructed using N specified locations. At least one location can be selected from the constructed list, and prediction can be performed on the target block based on the selected location. Information indicating the location selected from the list can be encoded and signaled from an image encoding device to an image decoding device, and can be decoded by the image decoding device.
[1121]
[1122] 4. Intra Block Copy (IBC)
[1123] A picture can be encoded / decoded in one of the intra prediction mode, inter prediction mode, and IBC mode. Alternatively, a block can be encoded / decoded in one of the intra prediction mode, inter prediction mode, and IBC mode.
[1124] A prediction bloc...
Claims
1. In an image decoding method for predicting a target block included in a target picture, A step of determining a prediction mode for a target block among multiple prediction modes based on block vectors; A step of determining a block vector resolution for the target block, wherein the block vector resolution is determined from among a plurality of block vector resolution candidates including one or more integer unit resolutions and one or more fractional unit resolutions; A step of deriving at least one block vector for the target block based on the determined prediction mode and the block vector resolution; and A step of generating a prediction block of the target block from restored samples in the target picture using at least one block vector. An image decoding method characterized by including:
2. In paragraph 1, When the above-determined mode is a sub-block-based intra block copy (IBC) mode, the step of deriving at least one block vector is: A step of dividing the target block into a plurality of sub-blocks; A step of deriving motion information for specifying a reference block to be referenced for deriving at least one block vector of the target block; A step of determining the reference block within the target picture based on the motion information; and A step of generating block vectors corresponding to the subblocks in the target block by using block vectors of the subblocks in the reference block, An image decoding method characterized in that the prediction block for the target block is generated in units of subblocks using block vectors for each subblock within the target block.
3. In paragraph 2, An image decoding method, characterized in that the above motion information is derived based on a block vector of at least one surrounding block of the target block.
4. In paragraph 2, An image decoding method characterized in that the above motion information is derived based on at least one candidate among a plurality of candidates included in a block vector candidate list of the target block.
5. In paragraph 4, An image decoding method, characterized in that the motion information is generated based on a candidate having the lowest template matching cost based on template matching costs for the plurality of candidates.
6. In an image encoding method for predicting a target block included in a target picture, A step of determining a prediction mode for a target block among multiple prediction modes based on block vectors; A step of determining a block vector resolution for the target block, wherein the block vector resolution is determined from among a plurality of block vector resolution candidates including one or more integer unit resolutions and one or more fractional unit resolutions; A step of deriving at least one block vector for the target block based on the determined prediction mode and the block vector resolution; and A step of generating a prediction block of the target block from restored samples in the target picture using at least one block vector. An image encoding method characterized by including:
7. In paragraph 6, When the above-determined mode is a sub-block-based intra block copy (IBC) mode, the step of deriving at least one block vector is: A step of dividing the target block into a plurality of sub-blocks; A step of deriving motion information for specifying a reference block to be referenced for deriving at least one block vector of the target block; A step of determining the reference block within the target picture based on the motion information; and A step of generating block vectors corresponding to the subblocks in the target block by using block vectors of the subblocks in the reference block, An image encoding method characterized in that the prediction block for the target block is generated in units of subblocks using block vectors for each subblock within the target block.
8. In paragraph 7, An image encoding method, characterized in that the motion information is derived based on a block vector of at least one surrounding block of the target block.
9. In paragraph 7, An image encoding method characterized in that the above motion information is derived based on at least one candidate among a plurality of candidates included in a block vector candidate list of the target block.
10. In paragraph 9, A video encoding method, characterized in that the motion information is generated based on a candidate having the lowest template matching cost based on template matching costs for the plurality of candidates.
11. A method for transmitting a bitstream including encoded video data, A step of generating the bitstream by predictively encoding a target block included in a target picture; and Including a step of transmitting the above bitstream to a video decoding device, The step of generating the above bitstream is: A step of determining a prediction mode for a target block among multiple prediction modes based on block vectors; A step of determining a block vector resolution for the target block, wherein the block vector resolution is determined from among a plurality of block vector resolution candidates including one or more integer unit resolutions and one or more fractional unit resolutions; A step of deriving at least one block vector for the target block based on the determined prediction mode and the block vector resolution; and A step of generating a prediction block of the target block from restored samples in the target picture using at least one block vector. A method characterized by comprising:
Citation Information
Patent Citations
Non-face-to-face IOT solution that maximizes business efficiency
KR1020230171593A
Signal processing apparatus for weather radar with collaboration function and signal processing system including same
KR1020240057158A
KR20190107180A
KR20200118896A
Cited By
Decoding method, encoding method, electronic apparatus, storage medium and program product
WO2026218806A1
