Image encoding / decoding method and apparatus using model-based prediction method, and bitstream storage medium
The method employs model-based prediction to enhance video encoding/decoding efficiency by leveraging sample redundancy, addressing the inefficiencies in conventional methods and reducing transmission and storage costs for high-resolution video data.
Patent Information
- Application Number
- PCT/KR2024/004763
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-08
- Filing Date
- 2024-04-09
- Publication Date
- 2024-10-17
AI Technical Summary
Conventional video encoding/decoding methods face limitations in improving coding efficiency due to redundancy in information between luminance and chrominance component samples, leading to increased transmission and storage costs for high-resolution, high-quality video data.
A method and device utilizing model-based prediction to reduce signaling bits by constructing a sample set and applying a mapping model to the target block, followed by entropy encoding/decoding, which leverages the redundancy between samples to enhance encoding/decoding efficiency.
This approach effectively reduces signaling bits and improves video encoding/decoding efficiency, addressing the challenges of high-resolution video data transmission and storage costs by optimizing the use of sample redundancy.
Smart Images

Figure KR2024004763_17102024_PF_FP_ABST
Abstract
Description
Image encoding / decoding method, device, and bitstream storage medium using model-based prediction method
[0001] The present invention relates to a method and device for encoding / decoding an image, and more particularly, to a method and device for encoding / decoding an image including a weighted sum of prediction blocks.
[0002] Recently, the demand for high-resolution, high-quality images, such as HD (High Definition) and UHD (Ultra High Definition) images, is increasing across various application fields. As image data becomes higher in resolution and quality, the relative amount of data increases compared to conventional image data. Therefore, transmitting image data using existing media such as wired or wireless broadband lines or storing it using existing storage media leads to increased transmission and storage costs. To address these issues arising as image data becomes higher in resolution and quality, highly efficient image encoding / decoding technologies for higher-resolution and higher-quality images are required.
[0003] There are various technologies for image compression, such as inter-picture prediction technology that predicts pixel values included in the current picture from pictures before or after the current picture, intra-picture prediction technology that predicts pixel values included in the current picture using pixel information in the current picture, transformation and quantization technology for compressing the energy of the residual signal, and entropy coding technology that assigns short codes to values with high frequency of appearance and long codes to values with low frequency of appearance. Using these image compression technologies, image data can be effectively compressed and transmitted or stored.
[0004] In conventional image encoding / decoding methods and devices, there is a limit to improving encoding efficiency because there is redundancy of information between luminance component samples and chrominance component samples; between surrounding samples of a target block and samples within the target block;
[0005] The present invention can provide a method and device for reducing signaling bits by utilizing redundancy of information between samples through model-based prediction to improve encoding / decoding efficiency of an image.
[0006] One embodiment of the present invention is a video encoding method and device characterized by performing the steps of constructing a sample set and deriving a mapping model; applying the mapping model to a target block; and entropy encoding / decoding encoding information.
[0007] The present invention can provide a method and device for reducing signaling bits by utilizing redundancy of information between samples through model-based prediction to improve encoding / decoding efficiency of an image.
[0008] Figure 1 is a block diagram showing the configuration according to one embodiment of an encoding device to which the present invention is applied.
[0009] Figure 2 is a block diagram showing the configuration according to one embodiment of a decryption device to which the present invention is applied.
[0010] Figure 3 is a diagram schematically showing the division structure of an image when encoding and decoding an image.
[0011] Figure 4 is a diagram for explaining an embodiment of an on-screen prediction process.
[0012] Figure 5 is a diagram for explaining an embodiment of a screen-to-screen prediction process.
[0013] Figure 6 is a diagram for explaining the process of transformation and quantization.
[0014] Figure 7 illustrates embodiments representing segmentation boundaries in geometric segmentation mode.
[0015] Figure 8 is a diagram showing the segmentation boundary, segmentation offset, and segmentation angle in geometric segmentation mode.
[0016] FIG. 9 illustrates an embodiment of a weight map used for each prediction block according to a geometric segmentation boundary.
[0017] Figure 10 is a diagram of one embodiment of template matching.
[0018] Figure 11 illustrates a subsampling method of a search area of template matching.
[0019] Figure 12 illustrates a subsampling method for a template of template matching.
[0020] FIGS. 13 to 18 each illustrate a search method in template matching according to one embodiment.
[0021] FIG. 19 illustrates a first template configuration method in affine mode according to one embodiment.
[0022] Figure 20 illustrates a second template configuration method in affine mode according to an example.
[0023] Figure 21 illustrates various examples of subsampling methods in two-sided matching.
[0024] Figure 22 illustrates bilateral matching according to one embodiment.
[0025] Fig. 23 is a flowchart of an encoding method for a target block according to one embodiment.
[0026] Fig. 24 is a flowchart of a decryption method for a target block according to one embodiment.
[0027] Fig. 25 is a flowchart of a decryption method for a target block according to one embodiment.
[0028] Figure 26 illustrates an embodiment for a first input structure and a second input structure.
[0029] Figure 27 is a drawing to explain a specific location.
[0030] Figure 28 illustrates the reference area used to derive the mapping model.
[0031] Figure 29 shows samples of the calculation of the mapping model output.
[0032] Figure 30 is a diagram for explaining the surrounding samples within the target block and BOUND_LINE_NUM rows / columns and the samples within BOUND_LINE_NUM rows / columns within the target block.
[0033] FIG. 31 illustrates an embodiment of determining whether to use upper peripheral samples in constructing various sample sets based on at least one of peripheral samples within the upper two rows / columns of a target block or samples within two rows / columns within the target block.
[0034] Figure 32 is a diagram showing non-adjacent blocks of the current block.
[0035] Figure 33 illustrates a filter based on the luminance component position.
[0036] Figure 34 shows an example of a 3x3 sized low-pass filter for prediction sample correction.
[0037] Figure 35 is a reference drawing for the convenience of explaining the mapping model function.
[0038] Figure 36 illustrates a first luminance component sample and surrounding samples.
[0039] Figure 37 illustrates a first embodiment for generating a reference block when a motion vector (or block vector) indicates a sub-pixel location.
[0040] Figure 38 illustrates a second embodiment for generating a reference block when a motion vector (or block vector) indicates a sub-pixel location.
[0041] The present disclosure is susceptible to various modifications and embodiments. Therefore, specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present disclosure to specific embodiments, but rather to include all modifications, equivalents, and substitutes falling within the spirit and scope of the present disclosure. In the drawings, similar reference numerals designate the same or similar functions throughout. The shapes and sizes of elements in the drawings may be exaggerated for clarity. 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 disclosure. Furthermore, it should be understood that the positions or arrangements of individual components within each disclosed embodiment may be changed without departing from the spirit and scope of the embodiment. Accordingly, the detailed description set forth below is not intended to be taken in a limiting sense, and the scope of the exemplary embodiments, if properly described, is defined only by the appended claims, along with the full scope equivalents to which such claims are entitled.
[0042] While terms such as "first" and "second" may be used herein to describe various components, 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 disclosure, a first component may be referred to as a "second component," and similarly, a second component may also be referred to as a "first component." The term "and / or" includes a combination of multiple related items described herein or any of multiple related items described herein.
[0043] When a component of the present disclosure is referred to as being "connected" or "connected" to another component, it should be understood that it may be directly connected or connected to that other component, but that there may be other components present in between. Conversely, when a component is referred to as being "directly connected" or "directly connected" to another component, it should be understood that there are no other components present in between.
[0044] The components shown in the embodiments of the present disclosure are independently depicted to represent different characteristic functions, and do not imply that each component is composed of separate hardware or a single software component. 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 such integrated and separate embodiments of each component are also included in the scope of the present disclosure as long as they do not deviate from the essence of the present disclosure.
[0045] The terminology used in this disclosure is only used to describe specific embodiments and is not intended to limit the present disclosure. The singular expression includes plural expressions unless the context clearly indicates otherwise. In this disclosure, it should be understood that terms such as "comprise" or "have" are intended to specify 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 of a specific configuration in this disclosure as "comprising" does not exclude configurations other than the specified configuration, and means that additional configurations may be included in the scope of the implementation or technical idea of the present disclosure.
[0046] Some components of the present disclosure may not be essential components that perform essential functions of the present disclosure, but may be optional components merely for performance enhancement. The present disclosure may be implemented by including only components essential to implementing the essence of the present disclosure, 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 present disclosure.
[0047] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. In describing the embodiments of this specification, if a detailed description of a related known configuration or function is judged to obscure the gist of this specification, the detailed description will be omitted. The same reference numerals will be used for identical components in the drawings, and duplicate descriptions of the same components will be omitted.
[0048]
[0049] Hereinafter, the term "video" may refer to a single picture constituting a video, or may refer to the video itself. For example, "encoding and / or decoding of a video" may refer to "encoding and / or decoding of a video," or may refer to "encoding and / or decoding of one of the videos constituting the video."
[0050] Hereinafter, the terms “movie” and “video” may be used interchangeably and have the same meaning.
[0051] Hereinafter, the target image may be an encoding target image, which is the target of encoding, and / or a decoding target image, which is the target of decoding. Furthermore, the target image may be an input image input to an encoding device, or an input image input to a decoding device. Here, the target image may have the same meaning as the current image.
[0052] Hereinafter, the terms “image”, “picture”, “frame” and “screen” may be used interchangeably and have the same meaning.
[0053] Hereinafter, the target block may be an encoding target block that is the target of encoding and / or a decoding target block that is the target of decoding. Furthermore, the target block may be a current block that is the target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used interchangeably and have the same meaning.
[0054] Hereinafter, the terms "block" and "unit" may be used interchangeably and have the same meaning. Alternatively, "block" may refer to a specific unit.
[0055] Hereinafter, the terms “region” and “segment” may be used interchangeably.
[0056] Hereinafter, a specific signal may be a signal representing a specific block. For example, the original signal may be a signal representing a target block. The prediction signal may be a signal representing a predicted block. The residual signal may be a signal representing a residual block.
[0057] In the embodiments, each of the specified information, data, flags, indices, and elements, attributes, etc., can have a value. The value "0" of the information, data, flags, indices, and elements, attributes, etc., can represent 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, and elements, attributes, etc., can represent 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.
[0058] 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.
[0059] Encoder: refers to a device that performs encoding. In other words, it can mean an encoding device.
[0060] Decoder: Refers to a device that performs decoding. In other words, it can refer to a decoding device.
[0061] Block: An MxN array of samples. Here, M and N can represent positive integer values, and a block can typically represent a two-dimensional sample array. A block can represent a unit. The current block can represent an encoding target block that is the target of encoding during encoding, and a decoding target block that is the target of decoding during decoding. In addition, the current block can be at least one of an encoding block, a prediction block, a residual block, or a transform block. In particular, the shape of the block can include a geometric shape that can be expressed in two dimensions, such as a rectangle, a trapezoid, a triangle, or a pentagon, in addition to a square. In addition, the block information can include at least one of a block type indicating an encoding block, a prediction block, a residual block, or a transform block, a block size, a block depth, and a block encoding or decoding order.
[0062] Sample: A basic unit that constitutes a block. Depending on the bit depth (Bd), it can be expressed as a value from 0 to 2Bd - 1. In the present invention, a sample can be used with the same meaning as a pixel or a pixel. In other words, a sample, a pixel, and a pixel can have the same meaning.
[0063] Unit: This may refer to a unit of image encoding and decoding. In image encoding and decoding, a unit may be a region into which one image is divided. In addition, a unit may refer to a divided unit when one image is divided into detailed units and encoded or decoded. That is, one image may be divided into multiple units. In image encoding and decoding, predefined processing may be performed for each unit. One unit may be further divided into sub-units having a smaller size than the unit. Depending on the function, a unit may refer to a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, etc. In addition, a unit may mean a luminance component block, a corresponding chroma component block, and a syntax element for each block to distinguish it from a block. The unit may have various sizes and shapes, and in particular, the shape of the unit may include a geometric shape that can be expressed in two dimensions, such as a square, a rectangle, a trapezoid, a triangle, a pentagon, etc. In addition, the unit information may include at least one or more of a type of the unit, a size of the unit, a depth of the unit, and an encoding or decoding order of the unit, which indicate an encoding unit, a prediction unit, a residual unit, a transformation unit, etc.
[0064] Coding Tree Unit: It consists of one luminance component (Y) coding tree block and two chrominance component (Cb, Cr) coding tree blocks related to it. It may also mean including the blocks and syntax elements for each block. Each coding tree unit can be partitioned using one or more partitioning methods such as a quad tree or a binary tree to form lower units such as a coding unit, a prediction unit, and a transformation unit. It can be used as a term to refer to a sample block that becomes a processing unit in the process of decoding / encoding an image, such as partitioning an input image.
[0065] Coding Tree Block: This term can be used to refer to any one of the Y coding tree block, Cb coding tree block, and Cr coding tree block.
[0066] Neighbor block: This may refer to a block adjacent to the current block. A block adjacent to the current block may refer to a block whose boundary is adjacent to the current block or a block located within a certain distance from the current block. A neighboring block may refer to a block adjacent to a vertex of the current block. Here, a block adjacent to a vertex of the current block may refer to a block vertically adjacent to a neighboring block horizontally adjacent to the current block, or a block horizontally adjacent to a neighboring block vertically adjacent to the current block. A neighboring block may also refer to a restored neighboring block.
[0067] Reconstructed Neighbor Block: This may refer to a neighboring block that has already been spatially / temporally encoded or decoded around the current block. In this case, the reconstructed neighboring block may refer to a reconstructed neighboring unit. The reconstructed spatial neighboring block may be a block within the current picture that has already been reconstructed through encoding and / or decoding. The reconstructed temporal neighboring block may be a reconstructed block or a neighboring block of a location corresponding to the current block of the current picture within the reference image.
[0068] Unit Depth: This can indicate the degree to which a unit has been divided. In a tree structure, the root node corresponds to the initial, undivided unit. This root node can be referred to as the root node. Furthermore, the root node can have the minimum depth. In this case, the root node can have a depth of level 0. A node with a depth of level 1 can represent a unit created by splitting the initial unit once. A node with a depth of level 2 can represent a unit created by splitting the initial unit twice. A node with a depth of level n can represent a unit created by splitting the initial unit n times. 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 default value for the maximum level can be 3. The root node can be said to have the shallowest depth, and the leaf node can have the deepest depth. Additionally, when units are represented in a tree structure, the level at which a unit exists can indicate unit depth.
[0069] Bitstream: This can mean a string of bits containing encoded image information.
[0070] Parameter Set: This corresponds to header information within the structure of the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, or an adaptation parameter set may be included in the parameter set. In addition, the parameter set may also include slice header and tile header information.
[0071] Parsing: This can mean entropy decoding a bitstream to determine the values of syntax elements, or it can mean entropy decoding itself.
[0072] Symbol: It may mean at least one of the syntactic elements of the target unit to be encoded / decoded, the coding parameter, or the value of the transform coefficient. In addition, the symbol may mean the target of entropy encoding or the result of entropy decoding.
[0073] Prediction Mode: This can be information indicating a mode in which encoding / decoding is performed with intra-screen prediction or a mode in which encoding / decoding is performed with inter-screen prediction.
[0074] Prediction Unit: This can refer to the basic unit used when performing predictions, such as inter-screen prediction, intra-screen prediction, inter-screen compensation, intra-screen compensation, and motion compensation. A single prediction unit can be divided into multiple partitions or multiple sub-prediction units of smaller sizes. Multiple partitions can also be the basic unit for performing prediction or compensation. Partitions created by dividing a prediction unit can also be prediction units.
[0075] Prediction Unit Partition: This can refer to the form in which the prediction unit is divided.
[0076] Reference Picture List: This may refer to a list containing one or more reference pictures used for inter-frame prediction or motion compensation. The types of reference picture lists may include LC (List Combined), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3), etc., and one or more reference picture lists may be used for inter-frame prediction.
[0077] Inter-Prediction Indicator: This can indicate the inter-prediction direction (unidirectional prediction, bidirectional prediction, etc.) of the current block. Alternatively, it can indicate the number of reference images used to generate the prediction block for the current block. Alternatively, it can indicate the number of prediction blocks used when performing inter-prediction or motion compensation for the current block.
[0078] Prediction list utilization flag: Indicates whether a prediction block is generated using at least one reference picture within a specific reference picture list. The prediction list utilization flag can be used to derive an inter-screen prediction indicator, and conversely, the prediction list utilization flag can be derived using the inter-screen prediction indicator. For example, when the prediction list utilization flag indicates a first value of 0, it can indicate that a prediction block is not generated using a reference picture within the reference picture list, and when it indicates a second value of 1, it can indicate that a prediction block can be generated using the reference picture list.
[0079] Reference Picture Index: This may refer to an index that indicates a specific reference picture in the reference picture list.
[0080] Reference Picture: This may refer to an image referenced by a specific block for inter-frame prediction or motion compensation. Alternatively, the reference picture may be an image that includes a reference block referenced by the current block for inter-frame prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference picture" may be used interchangeably and have the same meaning.
[0081] Motion Vector: This can be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector can indicate the offset between a target block to be encoded / decoded and a reference block. For example, (mvX, mvY) can represent a motion vector. mvX can represent the horizontal component, and mvY can represent the vertical component.
[0082] Search Range: The search range can be a two-dimensional area where motion vectors are searched during inter-frame prediction. For example, the size of the search range can be MxN, where M and N can each be positive integers. Furthermore, the shape of the search range can include geometric shapes that can be expressed in two dimensions, such as rectangles, trapezoids, triangles, and pentagons, in addition to squares.
[0083] Motion Vector Candidate: When predicting a motion vector, this can refer to a block that becomes a prediction candidate or the motion vector of that block. Additionally, the motion vector candidate can be included in a motion vector candidate list.
[0084] Motion Vector Candidate List: This may refer to a list constructed using one or more motion vector candidates.
[0085] Motion Vector Candidate Index: This may refer to an indicator pointing to a motion vector candidate within the motion vector candidate list. It may be the index of a motion vector predictor.
[0086] Motion Information: may mean information including at least one of a motion vector, a reference picture index, an inter-frame prediction indicator, as well as a prediction list utilization flag, reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, or a merge index.
[0087] Merge Candidate List: This may refer to a list constructed using one or more merge candidates.
[0088] Merge Candidate: This can refer to a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-prediction merge candidate, a zero-merge candidate, etc. Merge candidates can include motion information such as inter-frame prediction indicators, reference image indices for each list, motion vectors, prediction list utilization flags, and inter-frame prediction indicators.
[0089] Merge Index: This may refer to an indicator that points to a merge candidate within the merge candidate list. Furthermore, the merge index may indicate the block that derived the merge candidate among the restored blocks spatially and temporally adjacent to the current block. Furthermore, the merge index may indicate at least one piece of motion information associated with the merge candidate.
[0090] Transform Unit: This can refer to a basic unit when performing residual signal encoding / decoding, such as transform, inverse transform, quantization, inverse quantization, and transform coefficient encoding / decoding. One transform unit can be divided into multiple lower transform units having smaller sizes. Here, the transform / inverse transform can include at least one of primary transform / inverse transform or secondary transform / inverse transform.
[0091] Scaling: This can refer to the process of multiplying transform coefficient levels by a factor. The result of scaling transform coefficient levels can be used to generate transform coefficients. Scaling can also be called dequantization.
[0092] Quantization Parameter: This can refer to a value used to generate transform coefficient levels for transform coefficients in quantization. Alternatively, it can refer to a value used to scale transform coefficient levels to generate transform coefficients in dequantization. The quantization parameter can be a value mapped to the quantization step size.
[0093] Delta Quantization Parameter: This can mean the difference value between the predicted quantization parameter and the quantization parameter of the target unit to be encoded / decoded.
[0094] Scan: This can refer to a method for arranging the order of coefficients within a unit, block, or matrix. For example, sorting a two-dimensional array into a one-dimensional array is called a scan. Alternatively, sorting a one-dimensional array into a two-dimensional array can also be called a scan or inverse scan.
[0095] Transform Coefficient: This may refer to a coefficient value generated after performing a transform in an encoder. Alternatively, it may refer to a coefficient value generated after performing at least one of entropy decoding or dequantization in a decoder. The meaning of a transform coefficient may also include a quantized level or a quantized transform coefficient level that applies quantization to a transform coefficient or residual signal.
[0096] Quantized Level: This can refer to the value generated by performing quantization on a transform coefficient or residual signal in an encoder. Alternatively, it can refer to the value that is the target of dequantization before dequantization is performed in a decoder. Similarly, the quantized transform coefficient level, which is the result of transformation and quantization, can also be included in the meaning of the quantized level.
[0097] Non-zero Transform Coefficient: This can mean a transform coefficient whose magnitude is not 0, or a transform coefficient level whose magnitude is not 0.
[0098] Quantization Matrix: This can refer to a matrix used in the quantization or dequantization process to improve the subjective or objective image quality. The quantization matrix can also be called a scaling list.
[0099] Quantization Matrix Coefficient: This can refer to each element within a quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.
[0100] Default Matrix: This can refer to a predetermined quantization matrix that is predefined in the encoder and decoder.
[0101] Non-default Matrix: This can refer to a quantization matrix that is not predefined in the encoder and decoder and is signaled by the user.
[0102] Statistical value: The statistical value for at least one of the variables, encoding parameters or constants having specific operable values may be at least one of the mean, weighted mean, weighted sum, minimum, maximum, mode, median or interpolated values of the specific values.
[0103] Neighboring block: A neighboring block can refer to a block adjacent to the target block. Neighboring blocks can include spatial and temporal neighboring blocks. Neighboring blocks can also refer to reconstructed neighboring blocks within the reference image. Neighboring blocks do not necessarily have to be adjacent to the target block.
[0104] Spatial neighboring blocks: Spatial neighboring blocks may be blocks spatially adjacent to the target block. The target block and spatial neighboring blocks may be included in the target image. Spatial neighboring blocks may include blocks whose boundaries touch at least a portion of the boundaries of the target block. Alternatively, spatial neighboring blocks may include blocks whose distance from the target block is less than or equal to a reference value. Spatial neighboring blocks may include blocks diagonally adjacent to a vertex of the target block. Spatial neighboring blocks may include an upper left block adjacent to the upper left of the target block, an upper block adjacent to the upper right of the target block, an upper right block input to the upper right of the target block, a left block adjacent to the left of the target block, a right block adjacent to the right of the target block, a lower left block adjacent to the lower left of the target block, a lower block adjacent to the lower bottom of the target block, and a lower right block adjacent to the lower right of the target block.
[0105] Temporal neighboring blocks: Temporal neighboring blocks may be blocks temporally adjacent to the target block. Temporal neighboring blocks may include collocated blocks (col blocks). A collocated block may be a block within a reconstructed image within a reference image buffer. A collocated picture (col picture) may refer to a picture containing a collocated block. A collocated picture may be a picture included in a reference image list. A collocated block may be determined based on the location of the target block within the target image. Two blocks being "temporally adjacent" may mean that the locations of the two blocks satisfy a specific condition. The location of the collocated block within the collocated picture may be the same as the location of the target block within the target image. Alternatively, the location of the collocated block within the collocated picture may correspond to the location of the target block within the target image. Here, correspondence between the locations of blocks may mean that the areas of the blocks are identical, that an area of one block is included in an area of another block, or that one block occupies a specific location within another block. For example, the location of a call block within a call image may be identical to the location of a target block within the target image. Alternatively, a call block may be a block within a call image that contains a call pixel. A call pixel may be a pixel having coordinates identical to those of a specific pixel in the target block. A temporal neighboring block may be a block temporally adjacent to a spatial neighboring block of the target block.
[0106] Neighbor sample: A neighbor sample may refer to a sample within a neighboring block. Neighbor samples may include predicted samples, reconstructed samples, residual samples, and decoded samples.
[0107] Below, terms listed on a single line may be used with the same meaning in the embodiments and may be used interchangeably in the embodiments.
[0108] “Motion information”, “Motion vector”, “Block vector”
[0109] “Bidirectional prediction”, “Bidirectional prediction”, “Inter-screen bidirectional prediction”, “Inter-screen bidirectional prediction”
[0110] “IBC mode”, “In-screen block copy mode”, “IBC”, “In-screen block copy”
[0111] Predefined value: A predefined value may refer to a value commonly used in an encoding device and a decoding device. For example, a predefined value may be interpreted as being limited to a fixed value. Alternatively, the predefined value may be a value shared by an encoding device and a decoding device through signaling. Alternatively, the predefined value may be a value derived through the same procedure in an encoding device and a decoding device so that the encoding device and the decoding device have a common value. Alternatively, the predefined value may be a common value in an encoding device and a decoding device. The value derived through the same procedure in the encoding device and the decoding device may include a value derived through the same procedure for the same value and / or the same information in the encoding device and the decoding device. The value derived through the same procedure in the encoding device and the decoding device may include a value derived using the same conditional statement for the same value and / or the same information in the encoding device and the decoding device. The above description of a predefined value may also apply to predefined information. In the above descriptions, 'value' can be replaced with 'information'.
[0112] 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 picture, a motion vector candidate, a motion vector candidate index, a merge candidate and a merge index, CPMV, a block vector, a block vector candidate, or a block vector candidate index.
[0113] In the present disclosure, “when an indicator indicating whether a specific method is performed is true” may mean when the indicator indicates whether the specific method is performed is true in a prediction mode; motion information; coding parameter; and / or position; as indicated by the indicator. For example, the indicator indicating whether a specific mode is performed may have a value from 0 to 3, and the specific mode may be performed only when the indicator has a value of 1 or 3. In this case, when the indicator indicating whether a specific mode is performed is true, it means when the indicator indicating whether a specific mode is performed has a value of 1 or 3.
[0114] In this disclosure, “when an indicator indicating whether a specific method is used is false” means when the indicator indicating whether a specific method is used is not true.
[0115] In embodiments, reordering for a particular object may mean sorting for the particular object or elements within the particular object.
[0116] In the present disclosure, “if an indicator indicating whether to perform a specific method (or mode) on a target block is true” and “if a specific method is performed on a target block” may be used with the same meaning and may be replaced with each other.
[0117] In the present disclosure, “when an instruction indicating whether to perform a specific method (or mode) on a target block is false” and “when a specific method is not performed on a target block” may be used with the same meaning and may be replaced with each other.
[0118] In the present disclosure, the matching cost may include a template matching cost and a two-sided matching cost.
[0119]
[0120] In the present disclosure, “sample of (a block or reference area or template)” may mean all samples within (a block or reference area or template) or may mean at least one sample within (a block or reference area or template).
[0121]
[0122] Figure 1 is a block diagram showing the configuration according to one embodiment of an encoding device to which the present invention is applied.
[0123] The encoding device (100) may be an encoder, a video encoding device, or an image encoding device. A video may include one or more images. The encoding device (100) may sequentially encode one or more images.
[0124] Referring to FIG. 1, the encoding device (100) may include a motion prediction unit (111), a motion compensation unit (112), 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).
[0125] The encoding device (100) can perform encoding on an input image in intra mode and / or inter mode. In addition, the encoding device (100) can generate a bitstream including encoded information through encoding the input image and output the generated bitstream. The generated bitstream can be stored in a computer-readable recording medium or can be streamed through a wired / wireless transmission medium. When the intra mode is used as the prediction mode, the switch (115) can be switched to intra, and when the inter mode is used as the prediction mode, the switch (115) can be switched to inter. Here, the intra mode can mean an intra-screen prediction mode, and the inter mode can mean an inter-screen prediction mode. The encoding device (100) can generate a prediction block for an input block of the input image. In addition, after the prediction block is generated, the encoding device (100) can encode a residual block using a residual of the input block and the prediction block. The input image may be referred to as the current image, which is the current encoding target. The input block may be referred to as the current block, which is the current encoding target, or the encoding target block.
[0126] When the prediction mode is intra mode, the intra prediction unit (120) can use samples of blocks already encoded / decoded around the current block as reference samples. The intra prediction unit (120) can perform spatial prediction on the current block using the reference samples, and can generate prediction samples for the input block through spatial prediction. Here, intra prediction can mean prediction within the screen.
[0127] When the prediction mode is inter mode, the motion prediction unit (111) can search for an area that best matches the input block from the reference image during the motion prediction process and derive a motion vector using the searched area. At this time, the area can be used as a search area. The reference image can be stored in the reference picture buffer (190). Here, when encoding / decoding for the reference image is processed, it can be stored in the reference picture buffer (190).
[0128] The motion compensation unit (112) can generate a prediction block for the current block by performing motion compensation using a motion vector. Here, inter prediction may mean inter-screen prediction or motion compensation.
[0129] The above motion prediction unit (111) and motion compensation unit (112) can generate a prediction block by applying an interpolation filter to a portion of the reference image when the value of the motion vector does not have an integer value. In order to perform inter-screen prediction or motion compensation, it is possible to determine whether the motion prediction and motion compensation method of the prediction unit included in the corresponding encoding unit is a skip mode, a merge mode, an advanced motion vector prediction (AMVP) mode, or a current picture reference mode based on the encoding unit, and perform inter-screen prediction or motion compensation according to each mode.
[0130] The subtractor (125) can generate a residual block using the difference between the input block and the predicted block. The residual block may also be referred to as a residual signal. The residual signal may refer to 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. The residual block may be a residual signal in block units.
[0131] The transform unit (130) can perform a transform on the residual block to generate a transform coefficient and output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit (130) may also skip the transform on the residual block.
[0132] Quantized levels can be generated by applying quantization to transform coefficients or residual signals. In the following embodiments, quantized levels may also be referred to as transform coefficients.
[0133] The quantization unit (140) can generate a quantized level by quantizing a transform coefficient or residual signal according to a quantization parameter, and can output the generated quantized level. At this time, the quantization unit (140) can quantize the transform coefficient using a quantization matrix.
[0134] The entropy encoding unit (150) can generate a bitstream by performing entropy encoding according to a probability distribution on values produced by the quantization unit (140) or coding parameter values produced during the encoding process, and can output the bitstream. The entropy encoding unit (150) can perform entropy encoding on information about image samples and information for decoding the image. For example, the information for decoding the image can include syntax elements, etc.
[0135] When entropy encoding is applied, a small number of bits are allocated to symbols with a high occurrence probability, and a large number of bits are allocated to symbols with a low occurrence probability, thereby representing the symbols, whereby the size of the bit string for the symbols to be encoded can be reduced. The entropy encoding unit (150) can use an encoding method such as exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), or 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 / Code (VLC) table. In addition, the entropy encoding unit (150) may perform arithmetic encoding using the binarization method, probability model, and context model derived from the binarization method of the target symbol and the probability model of the target symbol / bin.
[0136] The entropy encoding unit (150) can change a two-dimensional block form coefficient into a one-dimensional vector form through a transform coefficient scanning method to encode a transform coefficient level.
[0137] Coding parameters may include not only information (flags, indices, etc.) encoded by the encoder and signaled to the decoder, such as syntax elements, but also information derived during the encoding or decoding process, and may mean information required when encoding or decoding an image. For example, unit / block size, unit / block depth, unit / block partition information, unit / block partition structure, whether to partition in quadtree form, whether to partition in binary tree form, partition direction in binary tree form (horizontal direction or vertical direction), partition type in binary tree form (symmetric partition or asymmetric partition), prediction mode (intra-screen prediction or inter-screen prediction), intra-screen prediction mode / direction, reference sample filtering method, reference sample filter tab, reference sample filter coefficients, prediction block filtering method, prediction block filter tab, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter tab, prediction block boundary filter coefficients, inter-screen prediction mode, motion information, motion vector, reference image index, inter-screen prediction direction, inter-screen prediction indicator, prediction list utilization flag, reference image list, reference image, motion vector prediction candidate, motion vector candidate list, whether to use merge mode, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tab, interpolation filter coefficients, motion vector magnitude, motion vector representation accuracy, transformation type, transformation magnitude, whether to use primary transformation Information, whether to use the secondary transform, information on whether to use the primary transform index, information on whether to use the secondary transform index, information on whether to use the residual signal, coded block pattern, coded block flag, quantization parameter, quantization matrix, whether to apply an intra-screen loop filter, intra-screen loop filter coefficients, intra-screen loop filter taps, intra-screen loop filter shape / shape, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / shape,At least one value or a combined form of whether to apply an adaptive sample offset, an adaptive sample offset value, an adaptive sample offset category, an adaptive sample offset type, whether to apply an adaptive loop filter, an adaptive loop filter coefficient, an adaptive loop filter tap, an adaptive loop filter shape / form, a binarization / inverse binarization method, a context model determination method, a context model update method, whether to perform a regular mode, whether to perform a bypass mode, a context bin, a bypass bin, a transform coefficient, a transform coefficient level, a quantized level, a transform coefficient level scanning method, an image display / output order, slice identification information, a slice type, slice division information, tile identification information, a tile type, a tile division information, a picture type, a bit depth, information about a luminance signal, or information about a chrominance signal may be included in the encoding parameters.
[0138] Here, signaling a flag or index may mean that the encoder entropy encodes the flag or index and includes it in the bitstream, and that the decoder entropy decodes the flag or index from the bitstream.
[0139] When the encoding device (100) performs encoding through inter prediction, the encoded current image can be used as a reference image for other images to be processed later. Accordingly, the encoding device (100) can reconstruct or decode the encoded current image again and store the reconstructed or decoded image as a reference image in the reference picture buffer (190).
[0140] The quantized level can be dequantized in the dequantization unit (160) and inversely transformed in the inverse transformation unit (170). The dequantized and / or inversely transformed coefficients can be combined with a prediction block through an adder (175), and a reconstructed block can be generated by combining the dequantized and / or inversely transformed coefficients and the prediction block. Here, the dequantized and / or inversely transformed coefficients refer to coefficients on which at least one of dequantization and inverse transformation has been performed, and may refer to a reconstructed residual block.
[0141] The restoration 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), or an adaptive loop filter (ALF) to the restoration sample, restoration block, or restoration image. The filter unit (180) may also be referred to as an in-loop filter.
[0142] A deblocking filter can remove block distortion that occurs at the boundaries between blocks. Whether to apply a deblocking filter to the current block can be determined based on the samples contained in several columns or rows within the block. When applying a deblocking filter to a block, different filters can be applied depending on the required deblocking filtering strength.
[0143] Sample adaptive offset can be used to compensate for encoding errors by adding an appropriate offset value to sample values. Sample adaptive offset can compensate for the offset from the original image on a sample-by-sample basis for deblocked images. This can be done by dividing the samples contained in the image into a fixed number of regions, determining the regions to be offset, and applying the offset to those regions. Alternatively, the offset can be applied by considering the edge information of each sample.
[0144] An adaptive loop filter can perform filtering based on a comparison between a reconstructed image and the original image. By dividing the samples contained in the image into predetermined groups and determining the filter to be applied to each group, filtering can be performed differentially for each group. Information regarding whether to apply an adaptive loop filter can be signaled for each coding unit (CU), and the shape and filter coefficients of the adaptive loop filter applied to each block can vary.
[0145] The restored block or restored image that has passed through the filter unit (180) may be stored in the reference picture buffer (190). The restored block that has passed through the filter unit (180) may be a part of the reference image. In other words, the reference image may be a restored image composed of restored blocks that have passed through the filter unit (180). The stored reference image may be used for inter-screen prediction or motion compensation thereafter.
[0146] Figure 2 is a block diagram showing the configuration according to one embodiment of a decryption device to which the present invention is applied.
[0147] The decoding device (200) may be a decoder, a video decoding device, or an image decoding device.
[0148] 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), a motion compensation unit (250), an adder (255), a filter unit (260), and a reference picture buffer (270).
[0149] 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, or a bitstream streamed through a wired / wireless transmission medium. The decoding device (200) can perform decoding on the bitstream in intra mode or inter mode. In addition, the decoding device (200) can generate a restored image or a decoded image through decoding, and can output the restored image or the decoded image.
[0150] If the prediction mode used for decryption is intra mode, the switch can be switched to intra. If the prediction mode used for decryption is inter mode, the switch can be switched to inter.
[0151] The decoding device (200) can decode the input bitstream to obtain a reconstructed residual block and generate a prediction block. Once the reconstructed residual block and the prediction block are obtained, the decoding device (200) can generate a reconstructed block to be decoded by adding the reconstructed residual block and the prediction block. The block to be decoded may be referred to as a current block.
[0152] The entropy decoding unit (210) can generate symbols by performing entropy decoding according to a probability distribution for the bitstream. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be the reverse process of the entropy encoding method described above.
[0153] The entropy decoding unit (210) can change a one-dimensional vector-shaped coefficient into a two-dimensional block-shaped coefficient through a transform coefficient scanning method to decode a transform coefficient level.
[0154] The quantized level can be dequantized in the dequantization unit (220) and inversely transformed in the inverse transformation unit (230). The quantized level can be generated as a restored residual block as a result of performing the dequantization and / or inverse transformation. At this time, the inverse quantization unit (220) can apply a quantization matrix to the quantized level.
[0155] When the intra mode is used, the intra prediction unit (240) can generate a prediction block by performing spatial prediction on the current block using sample values of already decoded blocks surrounding the block to be decoded.
[0156] When the inter mode is used, the motion compensation unit (250) can generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer (270) on the current block. The motion compensation unit (250) can generate a prediction block by applying an interpolation filter to a portion of the reference image when the value of the motion vector does not have an integer value. In order to perform motion compensation, it is possible to determine whether the motion compensation method of the prediction unit included in the corresponding encoding unit is skip mode, merge mode, AMVP mode, or current picture reference mode based on the encoding unit, and motion compensation can be performed according to each mode.
[0157] The adder (255) can add the restored residual block and the prediction block to generate a restored block. The filter unit (260) can apply at least one of a deblocking filter, a sample adaptive offset, or an adaptive loop filter to the restored block or restored image. The filter unit (260) can output the restored image. The restored block or restored image can be stored in the reference picture buffer (270) and used for inter prediction. The restored block that has passed through the filter unit (260) can be a part of the reference image. In other words, the reference image can be a restored image composed of restored blocks that have passed through the filter unit (260). The stored reference image can be used for inter-screen prediction or motion compensation thereafter.
[0158] Figure 3 is a diagram schematically illustrating an image segmentation structure when encoding and decoding an image. Figure 3 schematically illustrates an embodiment in which one unit is divided into multiple sub-units.
[0159] In order to efficiently segment an image, a coding unit (CU) may be used in encoding and decoding. The coding unit may be used as a basic unit for image encoding / decoding. In addition, the coding unit may be used as a unit for distinguishing an intra-screen prediction mode and an inter-screen prediction mode during image encoding / decoding. The coding unit may be a basic unit used for the process of prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding of transform coefficients.
[0160] Referring to FIG. 3, an image (300) is sequentially divided into Largest Coding Unit (LCU) units, and a division structure is determined for each LCU unit. Here, LCU may be used in the same sense as Coding Tree Unit (CTU). Division of a unit may mean division of a block corresponding to the unit. Block division information may include information regarding the depth of the unit. The depth information may indicate the number of times and / or the degree to which the unit is divided. One unit may 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 may correspond to a node and a child node of the node, respectively. Each divided sub-unit may have depth information. The depth information may be information indicating the size of a CU and may be stored for each CU. Since the unit depth indicates the number of times and / or the degree to which the unit is divided, the division information of a sub-unit may include information regarding the size of the sub-unit.
[0161] The partition structure may refer to the distribution of coding units (CUs) within the LCU (310). This distribution may be determined depending on whether to partition one CU into a plurality of CUs (a positive integer greater than or equal to 2, including 2, 4, 8, 16, etc.). The horizontal and vertical sizes of the CU generated by the partitioning may be half the horizontal size and half the vertical size of the CU before the partitioning, respectively, or may be smaller than the horizontal size and vertical size of the CU before the partitioning depending on the number of partitions. The CU may be recursively partitioned into a plurality of CUs. By recursive partitioning, at least one of the horizontal size or the vertical size of the partitioned CU may be reduced compared to at least one of the horizontal size or the vertical size of the CU before the partitioning. The partitioning of the CU may be performed recursively up to a predefined depth or a predefined size. For example, the depth of an LCU may be 0, and the depth of a Smallest Coding Unit (SCU) may be a predefined maximum depth. Here, the LCU may be a coding unit having the largest coding unit size as described above, and the SCU may be a coding unit having the smallest coding unit size. Splitting starts from an LCU (310), and each time the horizontal and / or vertical size of the CU is reduced by the splitting, the depth of the CU increases by 1. For example, for each depth, a CU that is not split may have a size of 2Nx2N. Additionally, 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.
[0162] Additionally, information on 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, if the split information value is the first value, the CU may not be split, and if the split information value is the second value, the CU may be split.
[0163] Referring to Figure 3, an LCU with depth 0 can be a 64x64 block. 0 can be the minimum depth. An SCU with depth 3 can be an 8x8 block. 3 can be the maximum depth. CUs of 32x32 blocks and 16x16 blocks can be represented as depths 1 and 2, respectively.
[0164] For example, when one coding unit is split into four coding units, the horizontal and vertical sizes of the four split coding units may be half the sizes of the horizontal and vertical sizes of the coding unit before being split. For example, when a coding unit having a size of 32x32 is split into four coding units, each of the four split coding units may have a size of 16x16. When one coding unit is split into four coding units, it can be said that the coding unit is split in a quad-tree form.
[0165] For example, when one coding unit is split into two coding units, the horizontal or vertical size of the two split coding units may be half the size compared to the horizontal or vertical size of the coding unit before being split. For example, when a coding unit having a size of 32x32 is split vertically into two coding units, each of the two split coding units may have a size of 16x32. When one coding unit is split into two coding units, it can be said that the coding unit is split in the form of a binary tree. The LCU (320) of FIG. 3 is an example of an LCU to which both a quadtree-type split and a binary tree-type split are applied.
[0166] Figure 4 is a diagram for explaining an embodiment of an on-screen prediction process.
[0167] The arrows from the center to the periphery of Figure 4 may indicate the prediction directions of the prediction modes within the screen.
[0168] In-frame encoding and / or decoding may be performed using reference samples from neighboring blocks of the current block. The neighboring blocks may be reconstructed neighboring blocks. For example, in-frame encoding and / or decoding may be performed using values or encoding parameters of reference samples contained in the reconstructed neighboring blocks.
[0169] A prediction block may refer to a block generated as a result of performing prediction within a screen. The prediction block may correspond to at least one of a CU, a PU, or a TU. The unit of the prediction block may be the size of at least one of a CU, a PU, or a TU. The prediction block may be a square block having a size such as 2x2, 4x4, 16x16, 32x32, or 64x64, or may be a rectangular block having a size such as 2x8, 4x8, 2x16, 4x16, or 8x16.
[0170] In-screen prediction can be performed based on the in-screen prediction mode for the current block. The number of in-screen prediction modes that the current block can have can be a predefined fixed value, or it can be determined differently based on the properties of the prediction block. For example, the properties of the prediction block can include the size and shape of the prediction block.
[0171] The number of prediction modes within a picture may be fixed to N regardless of the size of the block. Or, for example, the number of prediction modes within a picture may be 3, 5, 9, 17, 34, 35, 36, 65, or 67. Or, the number of prediction modes within a picture may vary depending on the size of the block and / or the type of the color component. For example, the number of prediction modes within a picture may vary depending on whether the color component is a luma signal or a chroma signal. For example, the number of prediction modes within a picture may increase as the size of the block increases. Or, the number of prediction modes within a luma component block may be greater than the number of prediction modes within a chroma component block.
[0172] The prediction mode within the screen can be a non-directional mode or a directional mode. The non-directional mode can be a DC mode or a planar mode, and the angular mode can be a prediction mode having a specific direction or angle. The prediction mode within the screen can be expressed by at least one of a mode number, a mode value, a mode number, a mode angle, or a mode direction. The number of prediction modes within the screen can be one or more M including the non-directional and directional modes.
[0173] A step may be performed to check whether samples included in the reconstructed neighboring blocks can be used as reference samples for the current block in order to predict the current block within the screen. If there are samples that cannot be used as reference samples for the current block, the sample value of at least one sample included in the reconstructed neighboring blocks is copied and / or interpolated to replace the sample value of the sample that cannot be used as a reference sample, and then the sample value can be used as a reference sample for the current block.
[0174] When making in-screen predictions, a filter can be applied to at least one of the reference sample or the prediction sample based on at least one of the in-screen prediction mode or the size of the current block.
[0175] In planar mode, when generating a prediction block of the current block, the sample value of the prediction target sample can be generated using a weighted sum of the top and left reference samples of the current sample, the top-right and bottom-left reference samples of the current block, depending on the position of the prediction target sample within the prediction block. In addition, in DC mode, when generating a prediction block of the current block, the average value of the top and left reference samples of the current block can be used. In addition, in directional mode, the prediction block can be generated using the top, left, top-right and / or bottom-left reference samples of the current block. Real-valued interpolation can also be performed to generate the prediction sample value.
[0176] The intra-screen prediction mode of the current block can be predicted from the intra-screen prediction modes of blocks existing around the current block and entropy encoded / decoded. If the intra-screen prediction modes of the current block and the surrounding blocks are the same, information indicating that the intra-screen prediction modes of the current block and the surrounding blocks are the same can be signaled using predetermined flag information. In addition, indicator information regarding an intra-screen prediction mode that is the same as the intra-screen prediction mode of the current block among the intra-screen prediction modes of a plurality of surrounding blocks can be signaled. If the intra-screen prediction modes of the current block and the surrounding blocks are different, entropy encoding / decoding can be performed based on the intra-screen prediction modes of the surrounding blocks to entropy encode / decode intra-screen prediction mode information of the current block.
[0177] Figure 5 is a diagram for explaining an embodiment of a screen-to-screen prediction process.
[0178] The rectangles illustrated in Figure 5 can represent images. Additionally, the arrows in Figure 5 can indicate prediction directions. Each image can be classified into an I-picture (Intra Picture), a P-picture (Predictive Picture), a B-picture (Bi-predictive Picture), etc., depending on its encoding type.
[0179] An I picture can be encoded / decoded through intra-picture prediction without inter-picture prediction. A P picture can be encoded / decoded through inter-picture prediction using only reference pictures existing in a unidirectional direction (e.g., forward or backward). A B picture can be encoded / decoded through inter-picture prediction using reference pictures existing in both directions (e.g., forward and backward). In addition, in the case of a B picture, it can be encoded / decoded through inter-picture prediction using reference pictures existing in both directions or inter-picture prediction using reference pictures existing in one of the forward and backward directions. Here, the bidirectional direction can be forward and backward. Here, when inter-picture prediction is used, the encoder can perform inter-picture prediction or motion compensation, and the decoder can perform corresponding motion compensation.
[0180] Below, inter-screen prediction according to an embodiment is described in detail.
[0181] Inter-screen prediction or motion compensation can be performed using reference images and motion information.
[0182] Motion information for a current block can be derived through inter-frame 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 surrounding block, motion information of a collocated block (col block), and / or a block adjacent to the collocated block. The collocated block may be a block corresponding to the spatial position of the current block within an already reconstructed collocated picture (col picture). Here, the collocated picture may be one picture from at least one reference picture included in a reference picture list.
[0183] The method for deriving motion information may vary depending on the prediction mode of the current block. For example, prediction modes applied for inter-frame prediction may include AMVP mode, merge mode, skip mode, and current picture reference mode. Here, merge mode may be referred to as motion merge mode.
[0184] For example, when AMVP is applied as a prediction mode, a motion vector candidate list can be generated by determining at least one of a motion vector of a reconstructed neighboring block, a motion vector of a called block, a motion vector of a block adjacent to the called block, or a (0, 0) motion vector as a motion vector candidate. A motion vector candidate can be derived using the generated motion vector candidate list. Motion information of the current block can be determined based on the derived motion vector candidate. Here, the motion vector of the called block or the motion vector of a block adjacent to the called block can be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block can be referred to as a spatial motion vector candidate.
[0185] The encoding device (100) can calculate the motion vector difference (MVD) between the motion vector of the current block and the motion vector candidate, and can entropy encode the MVD. In addition, the encoding device (100) can generate a bitstream by entropy encoding the motion vector candidate index. The motion vector candidate index can indicate an optimal motion vector candidate selected from among the motion vector candidates included in the motion vector candidate list. The decoding device (200) can entropy decode the motion vector candidate index from the bitstream, and select a motion vector candidate of a block to be decoded from among the motion vector candidates included in the motion vector candidate list using the entropy-decoded motion vector candidate index. In addition, the decoding device (200) can derive a motion vector of a block to be decoded by summing the entropy-decoded MVD and the motion vector candidate.
[0186] The bitstream may include a reference picture index indicating a reference picture, etc. The reference picture index may be entropy encoded and signaled from the encoding device (100) to the decoding device (200) via the bitstream. The decoding device (200) may generate a prediction block for the block to be decoded based on the derived motion vector and the reference picture index information.
[0187] Another example of a method for deriving motion information is merge mode. Merge mode may refer to merging motions of multiple blocks. Merge mode may refer to a mode in which motion information of a current block is derived from motion information of surrounding blocks. When merge mode is applied, a merge candidate list may be generated using motion information of reconstructed surrounding blocks and / or motion information of a called block. The motion information may include at least one of 1) a motion vector, 2) a reference image index, or 3) an inter-frame prediction indicator. The prediction indicator may be unidirectional (L0 prediction, L1 prediction) or bidirectional.
[0188] The merge candidate list may represent a list in which motion information is stored. The motion information stored in the merge candidate list may be at least one of motion information of neighboring blocks adjacent to the current block (spatial merge candidate), motion information of blocks collocated with the current block in a reference image (temporal merge candidate), new motion information generated by combining motion information already present in the merge candidate list, or a zero merge candidate.
[0189] The encoding device (100) can generate a bitstream by entropy encoding at least one of a merge flag and a merge index, and then signal it to the decoding device (200). The merge flag can be information indicating whether to perform a merge mode for each block, and the merge index can be information on which block among the neighboring blocks adjacent to the current block will be merged. For example, the neighboring blocks of the current block can include at least one of the left neighboring block, the upper neighboring block, or the temporal neighboring block of the current block.
[0190] Skip mode may be a mode that applies motion information of surrounding blocks as is to the current block. When skip mode is used, the encoding device (100) may entropy encode information on which block's motion information is to be used as the motion information of the current block and signal it to the decoding device (200) through a bitstream. At this time, the encoding device (100) may not signal a syntax element regarding at least one of motion vector difference information, an encoding block flag, or a transform coefficient level to the decoding device (200).
[0191] The current picture reference mode may mean a prediction mode using a pre-reconstructed region within the current picture to which the current block belongs. At this time, a vector may be defined to specify the pre-reconstructed region. Whether the current block is encoded in the current picture reference mode may be encoded using the reference picture index of the current block. A flag or index indicating whether the current block is a block encoded in the current picture reference mode may be signaled, or may be inferred from the reference picture index of the current block. If the current block is encoded in the current picture reference mode, the current picture may be added to a fixed position or an arbitrary position within the reference picture list for the current block. The fixed position may be, for example, a position where the reference picture index is 0 or the last position. If the current picture is added to an arbitrary position within the reference picture list, a separate reference picture index indicating the arbitrary position may be signaled.
[0192] Figure 6 is a diagram for explaining the process of transformation and quantization.
[0193] As illustrated in FIG. 6, a quantized level can be generated by performing a transformation and / or quantization process on the residual signal. The residual signal can be generated as a difference between an original block and a prediction block (an intra-screen prediction block or an inter-screen prediction block). Here, the prediction block can be a block generated by intra-screen prediction or inter-screen prediction. Here, the transformation can include at least one of a primary transformation or a secondary transformation. A transformation coefficient can be generated by performing a primary transformation on the residual signal, and a secondary transformation can be performed on the transformation coefficient to generate a secondary transformation coefficient.
[0194] The primary transform can be performed using at least one of a plurality of pre-defined transform methods. For example, the plurality of pre-defined transform methods can include a transform based on a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), or a Karhunen Loeve Transform (KLT). A secondary transform can be performed on transform coefficients generated after performing the primary transform. The transform method applied during the primary transform and / or the secondary transform can be determined based on at least one of the encoding parameters of the current block and / or the neighboring blocks. Alternatively, transform information indicating the transform method can be signaled.
[0195] Quantization can be performed on the result or residual signal of the first transform and / or the second transform to generate a quantized level. The quantized level can be scanned according to at least one of an up-right diagonal scan, a vertical scan, or a horizontal scan based on at least one of an in-picture prediction mode or a block size / shape. For example, the coefficients of a block can be scanned using an up-right diagonal scan to change them into a one-dimensional vector form. Depending on the size of the transform block and / or the in-picture prediction mode, a vertical scan that scans the two-dimensional block shape coefficients in the column direction, or a horizontal scan that scans the two-dimensional block shape coefficients in the row direction, may be used instead of the up-right diagonal scan. The scanned quantized level can be entropy encoded and included in the bitstream.
[0196] A decoder can entropy-decode a bitstream to generate quantized levels. These quantized levels can be aligned into a two-dimensional block shape through inverse scanning. At least one of the following methods can be used for inverse scanning: upper-right diagonal scanning, vertical scanning, or horizontal scanning.
[0197] Inverse quantization can be performed on a quantized level, a second inverse transform can be performed depending on whether a second inverse transform is performed, and a first inverse transform can be performed depending on whether a first inverse transform is performed on the result of the second inverse transform, thereby generating a restored residual signal.
[0198]
[0199] Below, Adaptive Motion Vector Resolution (AMVR) and Adaptive Block Vector Resolution (ABVR) are described.
[0200] In embodiments, the term “resolution” may mean the term “motion vector resolution.”
[0201] In adaptive motion vector resolution, the resolution of the motion vector difference can be adjusted on a block-by-block basis.
[0202] Adaptive motion vector resolution information can indicate the resolution of a motion vector difference. The resolution of a motion vector difference for a target block can be determined through signaling / encoding / decoding of the adaptive motion vector resolution information.
[0203] Information related to adaptive motion vector resolution may include at least one of an indicator indicating whether to use adaptive motion vector resolution, an index for indicating motion vector resolution, the number of resolution candidates in adaptive motion vector resolution, or the type of resolution candidates in adaptive motion vector resolution. For example, if the indicator indicating whether to use adaptive motion vector resolution in a target block is true, an index for indicating motion vector resolution in the target block may be signaled / encoded / decoded.
[0204] The motion vector resolutions applicable to the blocks may be the same or different.
[0205] For example, the resolutions of motion vectors applicable to the target block can be determined based on at least one of coding parameters, motion information, or mode information of the target block.
[0206] Adaptive motion vector resolution can improve encoding efficiency by adjusting the resolution of the motion vector difference.
[0207] For example, the adjusted resolution can be one of 16-pel, 8-pel, 4-pel, full-pel, half-pel, and quarter-pel, but is not limited to the pels listed above.
[0208] When the adjusted resolution is n-pel, if the value of a component of the motion vector difference changes by 1, the position indicated by the motion vector difference can change by n pixel(s). In other words, when the adjusted resolution of the target block is n-pel, each component of the motion vector difference can point to a reference block in units of n pixels.
[0209] For example, if the motion vector difference that should actually be applied to the target block is (a, b), and the adjusted resolution is p-pel, (a / p, b / p) instead of (a, b) can be encoded. That is, the motion vector difference signaled / encoded in the encoding device can be (a / p, b / p). The decoder can derive the original motion vector difference (a, b) again by multiplying the signaled motion vector difference (a / p, b / p) by p.
[0210] Embodiments of the inter-screen prediction mode of the present disclosure can be extended.
[0211] First, in terms of which specific reconstructed blocks are referenced for prediction of the target block, the inter-screen prediction mode, the intra-block copy (IBC) mode, and the intra-template matching prediction (IMT) mode may have common characteristics.
[0212] Accordingly, in embodiments, the inter-screen prediction mode may be replaced with the IBC mode or the intra-screen template matching mode. The description of the case where the inter-screen prediction mode is used for the target block may also be applied when the IBC mode or the intra-screen template matching mode is used for the target block. The description of the inter-screen prediction mode may be applied to the IBC mode or the intra-screen template matching mode, and the inter-screen prediction mode may be replaced with the IBC mode or the intra-screen template matching mode. Furthermore, information related to the inter-screen prediction mode may be regarded as information related to the IBC mode or the intra-screen template matching mode. The description of information related to the inter-screen prediction mode may be applied to information related to the IBC mode or the intra-screen template matching mode. For example, when the IBC mode or the intra-screen template matching mode is used for the target block, the value of the inter-screen prediction mode indicator may be 0 (or false). However, at this time, the value of the IBC mode indicator or the intra-screen template matching mode indicator may be 1 (or true).
[0213] Also, in embodiments, the motion vector (MV) of inter-screen prediction may be replaced with the block vector (BV) of IBC. The description of the case where MV is used for the target block may also be applied to the case where BV is used for the target block. The description of MV may be applied to BV, and MV may be replaced with BV. In addition, information related to MV may be regarded as information related to BV. The description of information related to MV may be applied to information related to BV. However, BV may be information indicating a specific reconstructed block in the target image including the target block, rather than a reference image.
[0214] Accordingly, the above description of adaptive motion vector resolution (AMVR) can also be applied to adaptive block vector resolution (ABVR) by replacing motion vectors with block vectors.
[0215] In embodiments related to the inter-screen prediction mode, the reference block and reference template of template matching are described as existing within the reference image. On the other hand, when the IBC mode or the intra-screen template matching mode is used for the target block, the reference block and the reference template may only exist within the target image. Therefore, in embodiments, the reference image described in relation to the inter-screen prediction mode may be regarded as the target image in the IBC mode and the intra-screen template matching mode. Alternatively, in embodiments, the reference image described in relation to the inter-screen prediction mode may be limited to the target image in the IBC mode and the intra-screen template matching mode, and images other than the target image may not be referenced in the IBC mode and the intra-screen template matching mode.
[0216] In terms of determining a reference block of a target block based on a block vector of the target block and determining a predicted block of the target block based on the determined reference block of the target block, the IBC and the intra-screen template matching method may have common characteristics.
[0217] Accordingly, in embodiments, IBC can be replaced with intra-screen template matching. The description of the case where the IBC mode is used for the target block can also be applied to the case where the intra-screen template matching mode is used for the target block. The description of the IBC mode can be applied to the intra-screen template matching mode, and the IBC mode can be replaced with the intra-screen template matching mode. Furthermore, information related to the IBC mode can be considered information related to the intra-screen template matching mode. The description of information related to the IBC mode can be applied to information related to the intra-screen template matching mode.
[0218] The IBC mode may include at least one of the IBC merge mode, the IBC-AMVP mode, the subblock-wise IBC mode, or the IBC-MBVD mode.
[0219] In embodiments, intra-screen template matching may be replaced by IBC. The description of the case where the intra-screen template matching mode is used for the target block may also be applied when the IBC mode is used for the target block. The description of the intra-screen template matching mode may be applied to the IBC mode, and the intra-screen template matching mode may be replaced by the IBC mode. Furthermore, information related to the intra-screen template matching mode may be considered information related to the IBC mode. The description of information related to the intra-screen template matching mode may be applied to information related to the IBC mode.
[0220] The on-screen template matching mode may include at least one of an on-screen template matching mode at the whole block level (i.e., an on-screen template matching mode other than a sub-block level), a sub-block level template matching mode, or an IBC template matching mode.
[0221]
[0222] Below, we describe the subsampling method. Subsampling may mean that only a subset of the samples within a specific region are selected.
[0223] The subsampling method can be applied in various ways in the prediction step, the transformation step, and the restoration step, and can be applied to the techniques of the present disclosure for selecting some samples among samples within a specific area, such as various filters (downsample filter, upsample filter, reference sample filter, filter at unit boundary, interpolation filter, low-pass filter, high-pass filter, etc.) and motion vector adjustment.
[0224] That subsampling is performed may mean that only some of the samples within a specific area are selected, 1) the SUBSAMPLE_START_HORth sample in the horizontal direction and the SUBSAMPLE_START_VERth sample in the vertical direction with respect to the specific sample; and 2) samples whose sample intervals are a multiple of SUBSAMPLE_STEP_HOR in the horizontal direction and a multiple of SUBSAMPLE_STEP_VER in the vertical direction with respect to the sample in 1); Alternatively, that subsampling is performed may mean that some of the samples in 1) and 2) are selected. The location of the specific sample may be the upper left, lower left, lower right, or upper right sample of the area in which subsampling is performed. However, the location of the specific sample is not limited to the upper left sample of the area in which subsampling is performed.
[0225] SUBSAMPLE_START_HOR and SUBSAMPLE_START_VER can be 0 or a positive integer, respectively. Information about at least one of SUBSAMPLE_START_HOR or SUBSAMPLE_START_VER can be signaled / encoded / decoded, or the values of SUBSAMPLE_START_HOR and / or SUBSAMPLE_START_VER can be determined as predefined values without signaling / encoding / decoding the information.
[0226] SUBSAMPLE_STEP_VER and SUBSAMPLE_STEP_HOR can be 0, 1, 2, or a positive integer, respectively. Information about at least one of SUBSAMPLE_STEP_VER or SUBSAMPLE_STEP_HOR can be signaled / encoded / decoded, or the values of SUBSAMPLE_STEP_VER and / or SUBSAMPLE_STEP_HOR can be determined as predefined values without signaling / encoding / decoding the information.
[0227] Subsampling methods can be distinguished by the area in which subsampling is performed, the location of the area in which subsampling is performed, the size of the area in which subsampling is performed, SUBSAMPLE_START_HOR, SUBSAMPLE_START_VER, SUBSAMPLE_STEP_HOR, and SUBSAMPLE_STEP_VER. However, the criteria for distinguishing subsampling methods are not limited to the values described above.
[0228] Information about the subsampling method can be signaled / encoded / decoded, or a predefined subsampling method can be used without signaling / encoding / decoding.
[0229] Information about the subsampling method may be information for determining the subsampling method.
[0230] For example, information about the subsampling method may be information about the area in which subsampling is performed, the location of the area in which subsampling is performed, the size of the area in which subsampling is performed, and at least one of SUBSAMPLE_START_HOR, SUBSAMPLE_START_VER, SUBSAMPLE_STEP_HOR, or SUBSAMPLE_STEP_VER.
[0231] For example, the subsampling method may be determined based on at least one of motion information, coding parameters, size, or prediction mode of the target block.
[0232] The subsampling method may be determined at least one unit among a sequence level, a picture level, a subpicture level, a tile level, a tile group level, a slice level, a CTU (Coding Tree Unit) level, a CU (Coding Unit) level, or a PU (Prediction Unit), but the unit determined is not limited thereto.
[0233] Below, the Geometric Partitioning Mode (GPM) is described.
[0234] Figure 7 illustrates embodiments representing segmentation boundaries in geometric segmentation mode.
[0235] Figure 8 is a diagram showing the segmentation boundary, segmentation offset, and segmentation angle in geometric segmentation mode.
[0236] FIG. 9 illustrates an embodiment of a weight map used for each prediction block according to a geometric segmentation boundary.
[0237] Referring to FIG. 7, the geometric partitioning mode of the present disclosure may have various types of partitioning shapes. The geometric partitioning shape may include at least one of a vertical partitioning shape, a horizontal partitioning shape, and a diagonal partitioning shape. Referring to FIG. 8, each partitioning shape may be determined based on at least one of a partitioning offset or a partitioning angle. The partitioning offset and the partitioning angle may be predefined values or may be determined by information encoded / decoded from a bitstream. In FIG. 7, among the shapes of 20 geometric partitioning modes, 4 vertical or horizontal partitioning shapes are disclosed, and 16 diagonal partitioning shapes are distinguished. The 20 geometric partitioning modes may be specified by an index and may be defined in an encoder / decoder as a separate table.
[0238] A prediction method using a geometric segmentation mode may include determining a segmentation boundary that divides a target block into two in various directions in a linear form, and performing a weighted summation of two prediction blocks (or reference blocks) using a weight map determined based on the segmentation boundary. The aforementioned subsampling method may be performed in performing the weighted summation.
[0239] At least one prediction block (or at least one reference block) in geometric segmentation mode may mean a unidirectional and / or bidirectional predicted prediction block or a reference block in at least one direction in unidirectional and / or bidirectional prediction.
[0240] Alternatively, for example, at least one prediction block in geometric segmentation mode may mean a predicted prediction block within the screen.
[0241] For example, in geometric segmentation mode, one prediction block can be inter-predicted, and another prediction block can be intra-predicted. Here, inter-prediction can be replaced with prediction using IBC mode or intra-template matching mode as described above.
[0242] Below, we explain template matching.
[0243] Figure 10 is a diagram of one embodiment of template matching.
[0244] In template matching, the motion information of the target block can be determined and / or changed based on the calculation result of the cost function between the target template and the reference template.
[0245] The reference block may include at least one of 1) a block indicated by initial motion information, 2) a block indicated by motion information derived during the search process of template matching, 3) a block indicated by motion information finally improved through template matching, 4) a block having a sample (or position) belonging to the search range of template matching as one of the upper left, lower left, upper right, lower right, and center, or 5) a block finally determined through template matching.
[0246] The size of the reference block can be the same as the size of the target block.
[0247] The motion information improved through template matching may be the motion information with the lowest matching cost derived from the template matching search process. However, the method for deriving the motion information is not limited to the aforementioned criteria.
[0248] 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.
[0249] Each of the reference block, the reference template, and the reference region may include at least one of a prediction sample, a reconstruction sample, a residual sample, or a decoded sample of the reference image. Alternatively, each of the reference block, the reference template, and the reference region may include at least one of a prediction sample, a reconstruction sample, a residual sample, or a decoded sample of the target image.
[0250] The target template may include surrounding samples of the target block. The reference region of the target block may include surrounding samples of the target block.
[0251] For example, the reference region of the target block may include at least one of the samples located in the lower left, left, upper left, upper or upper right regions around the target block.
[0252] For example, in template matching, the target template may be identical to the reference region of the target block.
[0253] For example, samples of a target template based on a target block may be samples corresponding to samples of a reference template based on a reference block.
[0254] For example, in template matching, when constructing a target template, some of the samples within the reference area of the target block may be selected. The target template may be constructed using the selected samples.
[0255] For example, the samples selected for configuring the target template based on the target block may be samples corresponding to the samples selected for configuring the template of the reference block based on the reference block.
[0256] For example, the reference area of the target block based on the target block may be an area corresponding to the reference area of the reference block based on the reference block.
[0257] A reference template may include surrounding samples of a reference block. A reference region of a reference block may include surrounding samples of the reference block.
[0258] For example, the reference region of a reference block may include at least one of the samples located in the lower left, left, upper left, upper or upper right regions around the reference block.
[0259] For example, in template matching, the reference template may be identical to the reference region of the reference block.
[0260] For example, samples of a reference template based on a reference block may be samples corresponding to samples of a target template based on a target block.
[0261] For example, when constructing a reference template in template matching, some of the samples within the reference region of the reference block may be selected. The reference template may be constructed using the selected samples.
[0262] For example, the samples selected for configuring the reference template based on the reference block may be samples corresponding to the samples selected for configuring the template of the target block based on the target block.
[0263] For example, the reference area of the reference block based on the reference block may be an area corresponding to the reference area of the target block based on the target block.
[0264] The template matching method may include at least one of an intra-screen template matching mode or an inter-screen template matching mode.
[0265] The in-screen template matching mode may mean a template matching method in which each of a reference block, a reference template, and a reference region includes at least one of a prediction sample, a restoration sample, a residual sample, or a decoded sample of a target image.
[0266] The inter-screen template matching mode may mean a template matching method in which each of a reference block, a reference template, and a reference region includes at least one of a prediction sample, a reconstructed sample, a residual sample, or a decoded sample of a reference image.
[0267] 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; or 2) at least one of the samples within TMSIZE_ABOVE lines adjacent to the top of the target / reference block. However, the positional relationship between each sample in the template and the target / reference block and / or the method of configuring the template are not limited to the aforementioned relationship or method.
[0268] Each of TMSIZE_LEFT and TMSIZE_ABOVE can be a positive integer greater than or equal to 0, 1, 2, 3, 4, or 4. TMSIZE_LEFT and TMSIZE_ABOVE can be the same. Alternatively, TMSIZE_LEFT and TMSIZE_ABOVE can be different. Each of TMSIZE_LEFT and TMSIZE_ABOVE can be a predefined value or a value determined based on signaling / encoding / decoding information. Each of TMSIZE_LEFT and TMSIZE_ABOVE can be determined based on at least one of motion information, coding parameters, size, or prediction mode of the target block.
[0269]
[0270] When constructing a template for template matching, all samples within the reference region may be used, or only a portion of the samples within the reference region may be used. The subsampling method described above may be applied to determine the portion of samples.
[0271] The template for the above template matching may mean at least one of a template of a target block or a template of a reference block.
[0272] The above reference area may mean at least one of a reference area of a target block for template matching or a reference area of a reference block.
[0273] 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.
[0274] In constructing a template for template matching using only some samples located in a reference region, the reference region may be divided into two or more regions. The divided regions may be one of: 1) a region where subsampling is performed, 2) a region used for template construction without subsampling, 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).
[0275] For 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.
[0276] For 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.
[0277] Alternatively, when 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. Each of the divided regions may be one of 1) a region where subsampling is performed and 2) a region not used for template construction. A template for template matching may be constructed using samples selected through subsampling in 1).
[0278] In template matching, when calculating the cost function between the target template and the reference template, all samples within each template may be used, or only some of the samples within each template may be used. In other words, the cost function may be calculated only for some samples.
[0279] In performing the computation of the cost function between templates using only at least one partial sample within the template, subsampling may be performed on the entire template region or a portion of the template region.
[0280] In performing calculation of a cost function between templates using only at least one partial sample within the template, the template region for template matching may 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 calculating the cost function, and 3) a region where the cost function is not calculated. Calculation of the cost function between templates in template matching may be performed using samples selected through subsampling in 1) and samples within the region 2).
[0281] Alternatively, in performing the calculation of the cost function between templates using only at least one partial sample within the template, the template region for template matching may be divided into two or more regions. The divided regions may be either 1) a region where subsampling is performed and 2) a region not used for calculating the cost function. In 1), the calculation of the cost function between templates in template matching may be performed using samples selected through subsampling.
[0282] When performing the search process for template matching, all samples / locations within the search area may be used, or only some of the samples / locations within the search area may be selected. The search and / or matching cost may be calculated only for the selected samples / locations. Alternatively, the search and / or matching cost may be calculated only for the motion information indicating the selected samples / locations.
[0283] 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 a portion of the search area.
[0284] In performing the search process of template matching using only some of the samples / positions within the search region, the search region may 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 the search process is performed without subsampling, and 3) a region where the 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).
[0285] Alternatively, when performing the search process of template matching using only some of the samples / locations within the search region, the search region may be divided into two or more regions. Each of the divided regions may be one of 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).
[0286] Figure 11 illustrates a subsampling method of a search area of template matching.
[0287] Figure 12 illustrates a subsampling method for a template of template matching.
[0288] The shaded samples (or locations) in FIGS. 11 and 12 may represent samples (or locations) selected through subsampling.
[0289] For the entire or part of the reference area, subsampling can be performed as illustrated in FIG. 12, and a template can be constructed using only selected samples (or locations).
[0290] For the entire or part of the template area of template matching, subsampling can be performed as illustrated in Fig. 12, and calculation of the cost function can be performed only for selected samples (or locations).
[0291] For the entire or part of the search area of template matching, subsampling can be performed as illustrated in FIG. 11, and search and / or matching cost calculations can be performed only for selected pixels and / or locations.
[0292] For the entire or part of the search area of template matching, subsampling can be performed as illustrated in FIG. 11, and search and / or matching cost calculation can be performed only for motion information indicating selected pixels and / or positions.
[0293]
[0294] A first search step can be performed using the first motion information as initial motion information to derive second motion information, which is the 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.
[0295] 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 result of rounding (or truncating or rounding down) the initial motion information can be used instead as the initial motion information.
[0296] For example, 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 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.
[0297] The search can be performed using the computation of a cost function to determine the similarity between NUM_TEMPLATE_COMPARE templates.
[0298] 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.
[0299] Motion information that satisfies a specific condition may mean, but is not limited to, motion information with the lowest matching cost among motion information within the search range.
[0300] Alternatively, 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.
[0301] A block satisfying a specific condition may mean, but is not limited to, a reference block having the lowest matching cost among reference blocks within the search range.
[0302]
[0303] The cost function may mean a function that determines the similarity between at least one sample in a target template and at least one sample in a reference template.
[0304] The similarity between the first value and the second value can be determined using at least one of: 1) a difference between the two values, 2) a ratio between the two values, or 3) an operation that compares the difference between the two values to a specific value.
[0305] The cost function may be a function that determines the similarity between at least one sample in the target template and a corresponding sample in the reference template.
[0306] 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.
[0307] The cost function used in template matching can be predefined or determined based on signaling / encoding / decoding information.
[0308] For example, MR-SAD can be used as a cost function in template matching when the target block satisfies the activation conditions of bilateral matching and / or part of the activation conditions of bilateral matching, or when bilateral matching is performed in the target block.
[0309] For example, SAD can be used as a cost function in template matching when the target block does not satisfy the activation conditions of two-sided matching and / or part of the activation conditions of two-sided matching, or when two-sided matching is not performed in the target block.
[0310] For example, the type of cost function in two-sided matching may be determined based on whether a specific condition is satisfied. In this case, the type of cost function in template matching may be determined based on whether the activation condition for two-sided matching and the above-mentioned specific conditions for determining the type of cost function in two-sided matching are satisfied.
[0311] For example, if the target block satisfies the activation condition of the two-sided matching and the above-mentioned specific condition, MR-SAD can be used as a cost function in the two-sided matching, and if it does not satisfy the condition, SAD can be used as a cost function in the two-sided matching.
[0312] For example, if the target block satisfies the activation condition of bilateral matching; if inter-weighted bilateral prediction is performed or the number of samples in the target block is greater than a certain value; MR-SAD can be used as the cost function in template matching; otherwise, SAD can be used as the cost function in template matching.
[0313]
[0314] 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.
[0315] 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.
[0316] Alternatively, the search range may be comprised of a previously restored region surrounding the target block. For example, the search range may include at least one of the samples (or locations of samples) located in the lower left, left, upper left, upper, or upper right regions surrounding the target block.
[0317] At least one of the size or shape of the search range for the target block may be predefined in the encoder and decoder.
[0318] Alternatively, at least one of the size or shape of the search range in the target block may be determined based on at least one of the target block size, the coding parameters of the target block, the motion information of the target block, or the prediction mode of the target block.
[0319] Alternatively, information indicating one of the size and shape of the search range for the target block may be encoded and signaled.
[0320] 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 cross with a width of SR_X and a height of SR_Y. However, the shape and size of the search range are not limited to the embodiments described above.
[0321] 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.
[0322] 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, or a block vector differential of the target block.
[0323] The search method can be distinguished based on at least one of a search pattern, a search resolution, a search range, initial motion information, or a unit from which motion information is derived.
[0324] The search method may be determined based on at least one of motion information of the target block, coding parameters 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, or an area of the target template.
[0325] The search pattern can be one of the diamond pattern, cross pattern, and full-search pattern. However, the search pattern is not limited to the patterns listed above.
[0326] 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.
[0327] 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.
[0328] RR can be a value determined based on the search resolution or a search resolution, and can be a predefined positive integer.
[0329] A search using the full-search pattern may mean searching all locations within a pre-defined search range.
[0330] 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 the positions of (FS_i×RR, FX_j×RR). Here, (0, 0) may be the 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.
[0331] 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.
[0332] 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.
[0333] The unit from which motion information is derived may include a full block unit and a sub-block unit.
[0334]
[0335] FIGS. 13 to 18 each illustrate a search method in template matching according to one embodiment.
[0336] 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. 13 to 18 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.
[0337] For example, in FIG. 13, 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.
[0338] 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.
[0339] For example, a particular resolution may be half-pel. However, a particular resolution is not limited to half-pel.
[0340] 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.
[0341]
[0342] FIG. 19 illustrates a first template configuration method in affine mode according to one embodiment.
[0343] CPMV can stand for affine control point motion vector (CPMV). Using CPMV, the MV of each subblock within the target block can be derived. CPMV can use either a 4-parameter affine motion model using 2 CPMVs or a 6-parameter affine motion model using 3 CPMVs.
[0344] When the target block is in affine mode, the target block can be divided into subblocks of width N and height M. Motion information for each subblock can be determined based on at least one of motion information, coding parameters, or 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 subblocks. For example, the template matching cost for the target block can be the sum of the template matching costs for the divided subblocks or the average of the template matching costs for each subblock.
[0345] N and M can be 2, 4, 8, 16 or positive integers, respectively. N and M can be predefined values, or values determined based on signaling / encoding / decoding information.
[0346] Figure 20 illustrates a second template configuration method in affine mode according to an example.
[0347] Referring to FIG. 20A, the reference templates (A0 to A3 to L0 to L4) of the target block may be configured to include at least one of the samples at a position indicated from the target template position corresponding to each reference template by a motion vector (or block vector) determined for each reference template position based on the CPMV of the target block. The motion vector (or block vector) determined for each reference template position may mean a motion vector (or block vector) determined for at least one of the positions within the corresponding reference template (for example, the center position of the corresponding reference template).
[0348] Referring to FIG. 20B, the reference templates (A0 to A3 to L0 to L4) of the target block can be configured to include at least one of the samples at a position indicated from the target template position corresponding to each reference template by the motion vector (or block vector) of the nearest sub-block within the target block.
[0349]
[0350] For example, 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."
[0351] 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.
[0352] For example, if 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.
[0353] An example of performing template matching on a target block when the motion information inherited from the surrounding blocks of the target block indicates bidirectional prediction may be as follows. Each of the steps below may be performed sequentially.
[0354] In the first step, template matching is performed for each of the L0 and L1 directions, and the template matching cost (C0, C1) for the motion information determined for the L0 and L1 directions can be calculated.
[0355] At this time, template matching for each direction can be performed in the same manner as template matching in unidirectional prediction for that direction, without considering motion information in other directions. For example, MR-SAD can be used as a cost function if the target block satisfies a predefined condition, and SAD can be used as a cost function if it does not.
[0356] The above-described condition may be a condition based on at least one of: whether a model-based prediction method is performed in the target block; an indicator indicating whether a model-based prediction method is performed in the target block; whether two-sided matching is performed in the target block; an indicator indicating whether two-sided matching is performed 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; or a type of a cost function in template matching in a neighboring block of the target block.
[0357] For example, if the indication of whether a model-based prediction method is performed on a target block is true, or if an indicator indicating whether a model-based prediction method is performed on a target block is true, MR-SAD can be used as a cost function, and otherwise, SAD can be used as a cost function.
[0358] For example, if the indication of whether to perform two-sided matching in the target block is true, or if the indication of whether to perform two-sided matching in the target block is true, and the number of samples in the target block is greater than a specific value, MR-SAD can be used as the cost function, and otherwise, SAD can be used as the cost function.
[0359] The above cost function may refer to a cost function used in the search for template matching; and / or a cost function used to calculate at least one of C0, C1, or C'. The cost function commonly used in the search for template matching and the cost function used to calculate at least one of C0, C1, or C' may be the same or different.
[0360] For example, when searching for template matching, MR-SAD can be used as a cost function, and C0, C1, and C' can be calculated using SAD.
[0361] In the second step, if C0 < C1, a new target template T' can be generated using the target template and the template in the L0 direction.
[0362] For example, when the target template T, the reference template in the L0 direction are T0, and the reference template in the L1 direction are T1, can be determined as follows. Here, and can each be a predefined value. Also, 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. For example, is 2, can be -1.
[0363] If C0 > C1, a new target template T' can be generated using the target template and the template in the L1 direction. 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 the second step can be performed.
[0364] In the third step, if C0 < C1, template matching is performed with the target template as T' in the L1 direction, and the template matching cost C' for the motion information determined in the L1 direction can be calculated.
[0365] If C0 > C1, template matching can be 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 can be calculated.
[0366] 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.
[0367] In step 4, if In this case, the motion information of the target block can be changed to motion information indicating unidirectional prediction in the L0 direction or L1 direction based on the C0 and C1 values.
[0368] 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 can be considered unavailable in the target block.
[0369] 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 can be considered unavailable in the target block.
[0370] 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. Here, and can each be a predefined value. Here, 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. For example, is 1, can be 1 / 8.
[0371] For example, steps 2 to 4 may be performed only when the target block satisfies a predefined condition.
[0372] For example, the second to fourth steps 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.
[0373] 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.
[0374] 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, or 3) a reference block pointed to by motion information finally improved through bilateral matching.
[0375] For example, when constructing a template for bilateral matching, a reference block in the L0 direction and a reference block in the L1 direction can be used as templates.
[0376] 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.
[0377] If the target block is in intra-block copy (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.
[0378]
[0379] When 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.
[0380] The template for the above two-sided matching may mean at least one of a template in the L0 direction or a template in the L1 direction.
[0381] For example, in constructing a template for bilateral matching, subsampling for a reference block in the L0 direction and a reference block in the L1 direction can be used.
[0382] For example, in 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.
[0383] Alternatively, for example, in constructing a template for bilateral matching, a reference block in the L0 direction and a reference block in the L1 direction may each be divided into two or more regions. The divided regions may be one of: 1) a region in which subsampling is performed, 2) a region in which subsampling is not performed and is used for constructing a template, or 3) a region not used for constructing a template. A template for bilateral matching may be constructed using pixels and / or selected positions through subsampling in 1) and pixels and / or positions within the region 2).
[0384] Alternatively, for example, in constructing a template for bilateral matching, the reference block in the L0 direction and the reference block in the L1 direction may each be divided into two or more regions. The divided regions may be either 1) a region where subsampling is performed and 2) a region not used for constructing the template. A template for bilateral matching may be constructed using pixels and / or positions selected through subsampling in 1).
[0385] For example, when constructing a template for two-sided matching, the region 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.
[0386] For example, when constructing a template for bilateral matching, pixels (or locations) used in constructing the template may be selected only from some areas of the reference block in the L0 direction and some areas of the reference block in the L1 direction.
[0387] The size of some regions of the reference block in the L0 direction may be smaller than the size of the region of the reference block in the L0 direction. For example, the height (vertical size) of some regions of the reference block in the L0 direction may be smaller than the height (vertical size) of the reference block in the L0 direction. For example, the width (horizontal size) of some regions of the reference block in the L0 direction may be smaller than the width (horizontal size) of the reference block in the L0 direction.
[0388] Alternatively, the size of a portion of the reference block in the L1 direction may be smaller than the size of the portion of the reference block in the L1 direction. For example, the height (vertical size) of a portion of the reference block in the L1 direction may be smaller than the height (vertical size) of the reference block in the L1 direction. For example, the width (horizontal size) of a portion of the reference block in the L1 direction may be smaller than the width (horizontal size) of the reference block in the L1 direction.
[0389]
[0390] In calculating the cost function between templates in a two-sided matching, only some of the pixels and / or locations within the template area may be selected. The cost function may be calculated only for the selected pixels and / or locations.
[0391] For example, in performing calculation of a cost function between templates in two-sided matching, subsampling may be performed for the template region in the L0 direction and the template region in the L1 direction.
[0392] For example, in performing calculation of a cost function between templates in bilateral matching, subsampling may be performed on a portion of the template region in the L0 direction and a portion of the template region in the L1 direction.
[0393] Alternatively, for example, in performing calculation of a cost function 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 each be one of: 1) a region in which subsampling is performed, 2) a region in which subsampling is not performed and is used for calculating the cost function, and 3) a region in which the cost function is not calculated. Calculation of the cost function between templates in bilateral matching may be performed using pixels and / or selected positions through subsampling in 1) and pixels and / or positions within the region 2).
[0394] Alternatively, for example, in performing the calculation of the cost function 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 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 bilateral matching may be performed using the pixels and / or positions selected through subsampling.
[0395] For example, when calculating a cost function between templates in a two-sided matching, the region used for calculating the cost function may be a part of the L0 direction template and a part of the L1 direction template.
[0396] 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 L0 direction. 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 L0 direction. For example, the width (horizontal size) of some areas of the template in the L0 direction may be smaller than the width (horizontal size) of a block of the template in the L0 direction.
[0397] Alternatively, the size of a portion of the template in the L1 direction may be smaller than the size of the portion of the template in the L1 direction. For example, the height (vertical size) of a portion of the template in the L1 direction may be smaller than the height (vertical size) of the template in the L1 direction. For example, the width (horizontal size) of a portion of the template in the L1 direction may be smaller than the width (horizontal size) of the template in the L1 direction.
[0398]
[0399] When performing the search process for two-sided matching, only some of the 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.
[0400] For example, in performing the search process of two-sided matching, subsampling may be performed on the entire or part of the search area.
[0401] 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).
[0402] 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).
[0403]
[0404] Figure 21 illustrates various examples of subsampling methods in two-sided matching.
[0405] The shaded samples (or locations) in Fig. 21 may represent samples (or locations) selected through subsampling.
[0406] For the reference block area in the L0 direction and the reference block area in the L1 direction, subsampling can be performed as shown in Fig. 21, and a template can be constructed using only selected samples (or locations).
[0407] 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 can be performed as shown in Fig. 21, and a template can be constructed using only selected samples (or locations).
[0408] For all or part of the template area of the two-sided matching, subsampling can be performed as illustrated in Fig. 21, and calculation of the cost function can be performed only for selected samples (or locations).
[0409] For the entire or part of the search area of the two-sided matching, subsampling can be performed as illustrated in FIG. 21, and the search and / or matching cost calculation can be performed only for selected pixels and / or locations.
[0410] For the entire or part of the search area of the two-sided matching, subsampling can be performed as illustrated in FIG. 21, and the search and / or matching cost calculation can be performed only for the motion information indicating the selected pixels and / or positions.
[0411]
[0412] Two-sided matching can always work.
[0413] Alternatively, two-sided matching may only work if predefined enabling conditions are satisfied.
[0414] 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.
[0415] For example, bilateral matching can be performed only 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.
[0416] 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.
[0417] Here, the fact that the first and second directions are different may mean that the following equation is satisfied.
[0418]
[0419] Here, the fact that the first and second directions are equal may mean that the following equation is satisfied.
[0420]
[0421] can be the POC of the target image. POC0 can be the POC of the L0 direction reference image. POC1 can be the POC of the L1 direction reference image.
[0422]
[0423] The search can be performed using the computation of a cost function to determine the similarity between two templates.
[0424] 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.
[0425] 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.
[0426] Alternatively, 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.
[0427] 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.
[0428]
[0429] The cost function may mean 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 matching.
[0430] The similarity between the first value and the second value can be determined using at least one of: 1) a difference between the two values, 2) a ratio between the two values, or 3) an operation that compares the difference between the two values to a specific value.
[0431] 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.
[0432] 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.
[0433] The cost function used in two-way matching can be predefined or determined based on signaling / encoding / decoding information.
[0434] For example, if the target block size is smaller than a certain value, SAD can be used as the cost function in bilateral matching, and otherwise, MR-SAD can be used. The block size can include at least one of the following: the block width, the block height, the sum of the block width and the block height, or the product of the block width and the block height.
[0435] For 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 can be used as the cost function in bilateral matching, otherwise MR-SAD can be used.
[0436] For example, if the local illumination compensation mode is not performed in the target block, SAD can be used as the cost function in bilateral matching, and if not, MR-SAD can be used. The local illumination compensation mode can mean a mode that derives at least one of a weight or an offset by calculating the correlation between the template of the target block and the template of the reference block, and multiplies, adds, or multiplies and adds the weight or offset to part or all of the target block (or the reference block of the target block).
[0437]
[0438] 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 result of rounding (or truncating or rounding down) the initial motion information can be used instead as the initial motion information.
[0439] 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.
[0440] Bilateral matching may involve one or more search steps.
[0441] 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.
[0442] 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.
[0443] For example, if BM_NUM is 1 in a specific search step, motion information improvement can be performed only for motion information in the LXBM direction in the specific search step.
[0444] For example, if BM_NUM is 1 and XBM is 0 in a specific search step, only search in the L0 direction can be performed in the above specific search step while the template in the L1 direction and the motion information in the L1 direction are fixed.
[0445] XBM can be 0, 1, or a positive integer.
[0446] XBM can be pre-defined.
[0447] For example, the XBM direction can be a direction with a larger POC interval between the L0 direction and the L1 direction. The POC can be the difference between the POC of the reference image (in a specific direction) and the POC of the target image.
[0448] For example, the XBM direction may be a direction with a higher template matching cost among the L0 direction and the L1 direction. Here, the template matching cost of a specific direction may be a template matching cost of motion information of the specific direction.
[0449] For example, information about XBM can be signaled / encoded / decoded.
[0450]
[0451] For example, the XBM can be 0 if the first POC difference is greater than the second POC difference, and 1 otherwise. Alternatively, the XBM can be 1 if the first POC difference is greater than the second POC difference, and 0 otherwise. The first POC difference can 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 can be the difference between the POC of the target image and the POC of the reference image in the L1 direction.
[0452] For example, the XBM 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.
[0453] For example, the XBM 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 in the target block.
[0454] For example, from a context model and / or a probability model used in entropy encoding and entropy decoding of an inter prediction indicator, a more likely direction in the target block between L0-direction unidirectional prediction and L1-direction unidirectional prediction may be selected as the LXBM direction. For example, from a context model and / or a probability model used in entropy encoding and entropy decoding of an inter prediction indicator, a more likely direction in the target block between L0-direction unidirectional prediction and L1-direction unidirectional prediction may be selected as the LXBM direction.
[0455] Alternatively, for example, from a context model and / or a probability model used in entropy encoding and entropy decoding of an inter prediction indicator, a more likely direction in the target block among L0-direction unidirectional prediction and L1-direction unidirectional prediction may be selected in the L(1-XBM) direction. For example, from a context model and / or a probability model used in entropy encoding and entropy decoding of an inter prediction indicator, a more likely direction in the target block among L0-direction unidirectional prediction and L1-direction unidirectional prediction may be selected in the L(1-XBM) direction.
[0456] 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.
[0457]
[0458] For example, LXBM can be determined based on the inter-prediction weight of the target block. For example, LXBM can be a direction in which the inter-prediction weight of the target block is higher in the L0 direction or L1 direction. Or, for example, LX can be a direction in which the inter-prediction weight of the target block is lower in the L0 direction or L1 direction.
[0459] For example, XBM can be determined based on at least one of motion information or coding parameters of surrounding blocks.
[0460] For example, X in the target block can be determined based on at least one of the motion information or coding parameters of the surrounding blocks corresponding to at least one of A0, A1, B0, B1, or B2 of FIG. 19.
[0461] For example, the XBM in a target block can be determined based on at least one of an inter prediction indicator or an inter bi-prediction weight in surrounding blocks.
[0462] For example, one or more context models and / or probability models can be used for entropy encoding and entropy decoding of XBM.
[0463] Among a plurality of context models and / or probability models, a context model and / or probability model used for entropy encoding and entropy decoding of an XBM in a target block can be determined based on at least one of motion information or coding information of surrounding blocks.
[0464] For example, the context model and / or probability model used for entropy encoding and entropy decoding of XBM in blocks may be the same. Alternatively, the context model and / or probability model used for entropy encoding and entropy decoding of XBM in blocks may differ depending on at least one of the inter-prediction direction or inter-prediction weight of the surrounding blocks.
[0465] The same XBM may be used in the search steps of both matchings. Alternatively, different XBMs may be used in the search steps of both matchings.
[0466] For example, in performing bilateral matching, a cost function used for calculating the bilateral matching cost may be determined based on the weights of the bi-prediction with weights of the target block and / or the weight index of the bi-prediction with weights.
[0467] In embodiments, weighted bi-prediction may mean bi-prediciton with CU-level Weights (BCW).
[0468] For example, if the first and second weights of the target block are the same, the two-sided matching cost can be calculated using SAD or SATD. If the first and second weights of the target block are different, the two-sided matching cost can be calculated using MRSAD or MRSATD. Here, the first weight can be a weight in the inter-weighted biprediction for the L0 direction. The second weight can be a weight in the inter-weighted biprediction for the L1 direction.
[0469] BM_NUM can be 0, 1, 2, or any positive integer.
[0470] BM_NUM can be pre-defined.
[0471] 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, or a BM_NUM in a previous search step.
[0472] For example, in the first search step of a two-sided match, BM_NUM can be 1 or 2.
[0473] For example, the BM_NUM of the current search step can be determined based on the matching cost in the previous search step.
[0474] 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.
[0475] COSTDIFF_FORBMNUM can be 0, 1, 2, 4, 8, 16, or any positive integer.
[0476] For example, the COSTDIFF_FORBMNUM may be determined based on the size of the target block. COSTDIFF_FORBMNUM may be the product of the number of pixels in the target block and a specific value. The specific value may be 0, 1, 2, 4, 8, or a positive integer.
[0477] For example, if BM_NUM in the previous search step was 0, BM_NUM in the current search step may be 0.
[0478] For example, 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 can be 0.
[0479] COSTDIFF_FORBMNUM can be 0, 1, 2, 4, 8, 16, or any positive integer.
[0480] 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.
[0481] For example, when motion improvement is performed in the search phase of bilateral matching, motion information improvement for L0-direction motion information can 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.
[0482] For example, when motion improvement is performed in the search phase of bilateral matching, motion information improvement for L1 direction motion information can 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.
[0483] COSTDIFF_FORBMNUM can be 0, 1, 2, 4, 8, 16, or any positive integer.
[0484] 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.
[0485] 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.
[0486] 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, in the motion information derivation step for the entire block, only the motion information for the LXBM direction may be improved, and in the motion information derivation step for the sub-block, both the motion information for the L0 direction and the motion information for the L1 direction may be improved.
[0487]
[0488] Figure 22 illustrates bilateral matching according to one embodiment.
[0489] Figure 22 shows the case where BM_NUM is 2 in the motion information derivation step for the entire block of two-sided matching.
[0490] MV0 may be the initial motion information for the L0 direction.
[0491] MV1 may be the initial motion information for the L1 direction.
[0492] MVdiff can mean the motion information improvement value derived through bilateral matching.
[0493] MV0' and MV1' may be motion information derived through bilateral matching.
[0494] 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, the following equations may be established.
[0495] MV0' = MV0 + MVdiff
[0496] MV1' = MV1 - Mvdiff
[0497]
[0498] In the embodiments, subsampling may be performed based on at least one of: whether template matching is performed; an indicator indicating whether template matching is performed; whether bilateral matching is performed; an indicator indicating whether bilateral matching is performed; motion information of the target block; coding parameters of the target block; or a search step in template matching and / or bilateral matching.
[0499] For 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; whether bilateral matching is performed; an indicator indicating whether bilateral matching is performed; motion information of the target block; coding parameters of the target block; or a search step in template matching and / or bilateral matching.
[0500] For example, when performing template matching and / or two-sided matching, the subsampling method used may be the same for the search steps.
[0501] Alternatively, for example, when performing template matching and / or two-sided matching, the subsampling method used may vary from step to step.
[0502]
[0503] In the embodiments, whether subsampling is performed may be determined based on at least one of: whether template matching is performed; an indicator indicating whether template matching is performed; whether bilateral matching is performed; an indicator indicating whether bilateral matching is performed; motion information of the target block; coding parameters of the target block; or a search step in template matching and / or bilateral matching.
[0504] For 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; whether to perform bilateral matching; an indicator indicating whether to perform bilateral matching; motion information of the target block; coding parameters of the target block; or a search step in template matching and / or bilateral matching.
[0505] For example, when performing template matching and / or two-sided matching, whether subsampling is performed or not may be the same for the search steps.
[0506] Alternatively, for example, when performing template matching and / or two-sided matching, whether subsampling is performed may vary from search step to search step.
[0507] For example, whether subsampling is performed in the horizontal direction or in the vertical direction may be the same.
[0508] For example, whether subsampling is performed in the horizontal direction or in the vertical direction may be different.
[0509] The subsampling method in the search step in which a search is performed for the entire target block in template matching and / or bilateral matching and the subsampling method in the search step in which a search is performed for a sub-block within the target block in template matching and / or bilateral matching may be the same or different.
[0510] The decoder-side motion information derivation method may include the aforementioned template matching method, the aforementioned bilateral matching method, the motion information improvement method, the motion information list reordering method, and the location specification method within the search area.
[0511]
[0512] In a method for improving motion information, second motion information can be derived by performing refinement on first motion information. Furthermore, a prediction block of a target block can be generated by performing prediction using the second motion information. At least one of the reference blocks of the target block can be identified using the second motion information.
[0513] 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.
[0514] Performing an improvement on specific motion information may mean that at least one of the following methods is performed on the motion information.
[0515] For example, specific information included in the movement information can be changed with a predetermined offset.
[0516] For example, specific information included in the movement information can be changed as a result of performing a specific operation on the information and a predetermined offset.
[0517] The specific operation may include at least one of squaring, weighted average, weighted sum, arithmetic operation, or filtering.
[0518] The above predetermined 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, or a block vector candidate index.
[0519] For example, the predetermined offset can be specified from a predetermined offset candidate list.
[0520] Information for specifying the above predetermined offset can be signaled / encoded / decoded.
[0521] An index for specifying at least one offset from the above-described list of offset candidates can be signaled / encoded / decoded.
[0522]
[0523] A method for reordering a list of motion information may be a method for performing reordering of at least one piece of motion information in a list consisting of N pieces of motion information based on a matching cost for each piece of motion information in the list.
[0524] For example, the order of the motion information within the list consisting of the N pieces of motion information can be reordered in ascending order of matching cost.
[0525] For example, the order of at least one piece of motion information in the list consisting of the N pieces of motion information may be reordered in ascending order of matching cost.
[0526] For example, after at least one piece of motion information in a list consisting of the N pieces of motion information is reordered, the list can be reconstructed.
[0527] Reconstructing a specific motion information list may mean at least one of: 1) constructing a list using only some of the motion information constituting the motion information list; 2) removing at least one of the motion information constituting the motion information list from the list; or 3) inserting at least one new motion information into the motion information list.
[0528] For example, in the above 3), the new motion information may be motion information determined based on at least one motion information in the motion information list. As an example, the new motion information may be an average or weighted average of two motion information having the smallest indices in the list.
[0529] Alternatively, for example, the new motion information in 3) above may be default motion information.
[0530] The above N can be 2, 3, 4, 6, 8, 12 or a positive integer.
[0531] At least one piece of motion information can be identified from the above reordered list.
[0532] A prediction block of a target block can be generated by performing a prediction using motion information specified from the above reordered list.
[0533] At least one of the reference blocks of the target block can be specified using the specified motion information from the above reordered list.
[0534] For example, the list composed of the N pieces of motion information may refer to a candidate list of motion information merging of the target block. For example, the list composed of the N pieces of motion information may refer to a list composed by a motion information derivation method of the decoder end.
[0535] A method for specifying a location within a search area may be a method for specifying at least one location within the search area based on a matching cost. Alternatively, the method may be a method for specifying at least one location among some locations within the search area based on a matching cost.
[0536] 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.
[0537] In embodiments, specifying a location may mean specifying a sample at that location.
[0538] In embodiments, specifying a location may mean specifying motion information indicating a distance from a target block to that location.
[0539] 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.
[0540] The matching cost for a specific location may mean the matching cost for movement information indicating from the target block to that location.
[0541] 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.
[0542] The above N can be 1,2,3,4,5,6,8,12 or a positive integer.
[0543] A list can be constructed using the above-mentioned N specified locations. At least one location can be specified from the constructed list, and prediction can be performed on the target block based on that location. Information for specifying the location from the list can be signaled / encoded / decoded.
[0544] A mapping model may be a model representing an association from a first set of variables to a second set of variables.
[0545] The first set of variables may be referred to as the independent variable set (or, the set of independent variables). The independent variable set may be a set of at least one variable that is expected to influence or be able to influence another variable (dependent variable).
[0546] The second set of variables may be referred to as the dependent set of variables (or the set of dependent variables). The dependent set of variables may be a set of at least one variable whose value is determined or is expected to be determined based on another variable (independent variable).
[0547] A mapping model can be a model that shows how a dependent variable changes as an independent variable changes.
[0548] An independent sample set may be a set of independent variables of a mapping model. Alternatively, the set of independent variables of a mapping model may be determined based on the independent sample set.
[0549] The dependent sample set may be a set of dependent variables of the mapping model. Alternatively, the set of dependent variables of the mapping model may be determined based on the dependent sample set.
[0550] The subject sample set may be a set of variables to which a mapping model is applied for prediction of at least one of the samples of the target block and / or for changing at least one of the sample values of the target block. Alternatively, the set of variables to which a mapping model is applied for prediction of at least one of the samples of the target block and / or for changing at least one of the sample values of the target block may be determined based on the subject sample set.
[0551] In one embodiment, the variable includes a sample value, and when the variable is a sample value, the independent variable set and the dependent variable set can be expressed as an independent sample set and a dependent sample set. Here, the sample value can be any one of a sample value for one sample, a value obtained by transforming the sample value using surrounding samples, and a representative value of a plurality of samples. Here, the representative value can be any one of an average value, a median value, a maximum value, and a minimum value.
[0552] Prediction can be performed for at least one of the samples of the target block based on a mapping model that computes the association between the independent sample set and the dependent sample set or the target sample set.
[0553] A prediction can be made for at least one of the samples of the target block based on a result obtained by inputting a set of target samples into the mapping model or a set of results obtained.
[0554] At least one of the sample values of the target block may be changed based on a mapping model that computes the association between the independent sample set and the dependent sample set or the target sample set.
[0555] At least one of the sample values of the target block can be changed based on the result obtained by inputting a target sample set to the mapping model or the set of results obtained.
[0556]
[0557] Fig. 22 is a flowchart of an encoding method for a target block according to one embodiment.
[0558] The target block may be encoded by at least one of the steps of constructing a sample set and deriving a mapping model; applying the mapping model to the target block; or entropy encoding the encoding information.
[0559] The embodiment may be part of a method for encoding a target block or a method for encoding a video.
[0560] Fig. 23 is a flowchart of an encoding method for a target block according to one embodiment.
[0561] The target block may be encoded by including at least one of: a step of deriving a mapping model; a step of applying a mapping model; or a step of entropy encoding encoding information.
[0562] The embodiment may be part of a method for encoding a target block or a method for encoding a video.
[0563]
[0564] Fig. 24 is a flowchart of a decryption method for a target block according to one embodiment.
[0565] The target block can be decrypted by including at least one of the steps of entropy decoding the encoded information; constructing a sample set and deriving a mapping model; or applying the mapping model to the target block.
[0566] The embodiment may be part of a method for decrypting a target block or a method for decrypting a video.
[0567] Fig. 25 is a flowchart of a decryption method for a target block according to one embodiment.
[0568] The target block can be decrypted by including at least one of the steps of entropy decoding the encoded information; deriving a mapping model; or applying the mapping model.
[0569] The embodiment may be part of a method for decrypting a target block or a method for decrypting a video.
[0570]
[0571] A model-based prediction method may include at least one of the steps of: configuring at least one of an independent, dependent, or target sample set; configuring a mapping model input for each sample / location in the independent sample set; configuring a mapping model target output for each sample / location in the dependent sample set corresponding to each sample / location in the independent sample set; deriving coefficients of the mapping model to minimize a sum (or average) of differences between the input and the target output for all samples / locations in the independent sample set; configuring a mapping model input for each sample / location in the target sample set; or outputting a mapping model input and a result value from the mapping model for each sample / location in the target sample set, and then using the same to perform (at least one of prediction, restoration, or decoding) and / or (changing a value of at least one of prediction, restoration, or decoding) in a target block.
[0572]
[0573] The input structure may be about how to structure the input for a given sample (or location). The output structure may be about what form the output for a given input will take.
[0574] The input structure of the mapping model may be information including at least one of information about at least one input component of the mapping model (including gradient information of the input component), a relationship between at least two input components of the mapping model (e.g., a positional relationship between a first input component and a second input component; e.g., a method of deriving the second input component from the first input component), a relationship between at least one input component of the mapping model and at least one output component of the mapping model, or information about the number of input components of the mapping model (size of the input).
[0575] The output structure of the mapping model may be information including at least one of information about each output component of the mapping model, a relationship between at least two output components of the mapping model, a relationship between at least one input component of the mapping model and at least one output component of the mapping model, and information about the number of output components of the mapping model (size of the output).
[0576] Information about a specific input (or, output) component may be information including at least one of a type of the input (or, output) component, a method of deriving the input (or, output) component, a method of determining the input (or, output) component, a relationship with other input (or, output) components (e.g., a positional relationship, a method of derivation), or a relationship with at least one output (or, input) component.
[0577] The type of a particular input (or output) component may include at least one of: a value of a sample and / or a value based thereon; a location of a sample and / or a value based thereon; or a bias.
[0578] The above sample may be (at least one of a prediction sample, a reconstruction sample, a residual sample or a decoded sample) of (at least one of a luminance component or a chrominance component) of (at least one of a target block, a neighboring block of the target block, a reference block of the target block or a neighboring block of a reference block of the target block).
[0579] A value based on the value of a particular sample may mean the result of performing a particular operation on the value of a particular sample or on values that contain the value of a particular sample.
[0580] A value based on the location of a particular sample may mean the result of performing a particular operation on the location of a particular sample or on values containing the location of a particular sample.
[0581] For example, an input structure may have four input components. When configuring an input for a specific sample, the four input components may be the sample, the left sample of the sample, the right sample of the sample, and a bias, respectively.
[0582]
[0583] Figure 26 illustrates an embodiment for a first input structure and a second input structure.
[0584] When the first input structure includes the second input structure, it can mean that when constructing inputs for the same sample (or location) using the first input structure and the second input structure, the input using the first input structure includes all input components of the input using the second input structure.
[0585] Alternatively, the first input structure including the second input structure may mean that when configuring inputs for the same sample (or location) using the first input structure and the second input structure, the input using the first input structure includes at least one input component of the input using the second input structure.
[0586] Bias can be used interchangeably and can represent motion information and / or the target of a target block.
[0587] In this specification, the bias and the bias value may be values determined based on at least one of the coding parameters of the block, the size of the target block, the range of values that the luminance component of the target block can have, the range of values that the chrominance component of the target block can have, the samples of the target block, the samples of the call block of the target block, the availability of the surrounding blocks of the target block, or the coding parameters of the surrounding blocks of the target block or the surrounding samples of the target block.
[0588] For example, at least one of the bias values may be a value that divides the size of the range of values that the luminance component (or chrominance component) of the target block can have by a specific value. The specific value may be 2, 4, or a positive integer.
[0589] For example, at least one of the bias values may be an intermediate value of the values that the luminance component (or chrominance component) of the target block can have.
[0590] For example, at least one of the bias values may be the value of a sample present at a specific location relative to the target block or the value of a sample present at a specific location relative to the call block.
[0591] Figure 27 is a drawing to explain a specific location.
[0592] Referring to FIG. 27, at least one of the bias values may be a value of a sample present at at least one of the shaded locations relative to the target block and the shaded locations relative to the call block in FIG. 27.
[0593] The size of a block may mean at least one of the width of the block, the height of the block, or the number of samples within the block.
[0594] In this specification, a particular operation may include at least one of exponentiation, weighted average, weighted sum, arithmetic operation, or filtering.
[0595] For example, a particular operation may include at least one of a weighted average, a weighted sum, or an arithmetic operation with a particular value.
[0596] The above specific value may be determined based on at least one of a prediction mode of the target block, motion information of the target block, coding parameters of the target block, a size of the target block, a range of values that the luminance component of the target block can have, a range of values that the chrominance component of the target block can have, availability of surrounding blocks of the target block, coding parameters of surrounding blocks of the target block, or surrounding samples of the target block.
[0597] For example, the particular value may be a value of a sample present at at least one of the shaded locations in FIG. 27.
[0598] For example, the specific value may be a middle value in the range of values that the luminance component (or chrominance component) of the target block can have.
[0599] The location of a sample may refer to a relative location from the top left sample of the target block or a relative location from the top left sample of the image. The location in the image may refer to a relative location from the top left sample of the image.
[0600] For example, the specific value may be the x-component and / or y-component of the position of the upper left sample of the target block.
[0601] For example, by using a second value, which is the result of performing a specific operation (e.g., subtraction, multiplication, division) on the first value instead of the first value, the dynamic range of values calculated during the derivation of the mapping model can be limited. This reduces the complexity of the operation and limits the size of the memory storage required for the operation.
[0602] For example, by using a second value that is the result of performing a particular operation (e.g., raising to a power) on the first value instead of the first value, the mapping model can have the effect of allowing more complex relationships to be expressed.
[0603]
[0604] In this specification, a value based on a first value may mean one of the first value and / or a result value of performing a specific operation on the first value.
[0605]
[0606] Constructing a sample set may include selecting at least one sample.
[0607] Alternatively, forming a sample set may include determining a region of the samples, and using at least one of: a value of at least one sample within the region; position information of at least one sample; a value of at least one sample; motion information of at least one sample; or a value based on motion information and / or position information of a position of at least one sample; to determine the region of the samples in the derivation of a mapping model.
[0608] Figure 28 illustrates the reference area used to derive the mapping model.
[0609] Constructing a sample set using samples within a reference region may include determining a reference region as shown in FIG. 28 and using the values of at least one sample within the region to derive a mapping model to determine the reference region. The sample set may mean at least one of an independent sample set, a dependent sample set, or a target sample set.
[0610] Information for determining at least one of the independent sample set, the dependent sample set, or the target sample set may be predefined in the encoder and decoder. According to the predefined rules in the encoder and decoder, a sample set for deriving a mapping model may be constructed; and / or a sample set to which a mapping model is to be applied may be constructed.
[0611] The input of the mapping model can be configured for each sample (or location) within (the independent sample set and / or the target sample set).
[0612] If the input of the mapping model is configured for each sample (or location) in the independent sample set, the target output for that input can be configured for each sample (or location) in the dependent sample set corresponding to each sample (or location) in the target sample set.
[0613] Figure 29 shows samples of the calculation of the mapping model output.
[0614] Referring to Figure 29, constructing the input of the mapping model for the target sample using the target sample and the samples around the target sample and calculating the output of the mapping model can be considered equivalent to performing cross-shaped filtering centered on the target sample location.
[0615] Each of the independent sample set, the dependent sample set, and the target sample set may include at least one of a sample of the reference area, a sample within the target block, or a sample within a block corresponding to the target block.
[0616] For example, the reference region may contain none, one, or more samples within the reference region of the target block.
[0617] For example, a reference region may contain zero or more samples within the reference region of a reference block.
[0618] For example, the reference area may be an area adjacent to at least one of the target block, the reference area, or a block corresponding to the target block.
[0619] In this specification, “adjacent” may not necessarily mean “in contact with.”
[0620] The reference area of FIG. 28 may represent a reference area in a model-based prediction method according to one embodiment.
[0621] For example, LINENUM_L, LINENUM_LB, LINENUM_A, and LINENUM_RA can each be 0, 1, 2, or a positive integer.
[0622] For example, LINENUM_L, LINENUM_LB, LINENUM_A, and LINENUM_RA can each be predefined values.
[0623] For example, LINENUM_MORE_X can be 0, 1, 2, or any positive integer (where X is A, B, L, or R).
[0624] For example, LINENUM_MORE_X can be a predefined value. Alternatively, information about LINENUM_MORE_X can be signaled / encoded / decoded.
[0625] For example, when configuring the input of a mapping model for a specific sample in an independent sample set of a mapping model, if a sample located at a position at most N away in a specific direction from the position of the sample is used, the value of LINENUM_MORE_X for the specific direction may be determined as N. N may be 0, 1, or a positive integer. The specific direction may include at least one of the top, bottom, left, or right.
[0626] The size and / or location of the reference region may be determined based on at least one of the prediction mode of the target block, motion information of the target block, coding parameters of the target block, the size of the target block, the range of values that the luminance component of the target block can have, the range of values that the chrominance component of the target block can have, the availability of surrounding blocks of the target block, coding parameters of surrounding blocks of the target block, surrounding samples of the target block, or a mapping model.
[0627] The size of the reference area may include at least one of LINENUM_L, LINENUM_LB, LINENUM_A, LINENUM_RA, or LINENUM_MORE_X.
[0628] For example, based on the input structure in a model-based prediction model, at least one of LINENUM_MORE_A, LINENUM_MORE_B, LINENUM_MORE_L, or LINENUM_MORE_R can be determined.
[0629] The configuration of the reference area may differ from that depicted. For example, in Figure 28, the reference area may be composed solely of the upper adjacent area, or solely of the left adjacent area. Depending on the target to be predicted through the matching model, the configuration of the reference area may vary.
[0630] A reference region may be configured so as not to be adjacent to a target block. In addition, after designating multiple reference region candidates, one of the multiple reference region candidates may be selected. The reference region candidate may be at least one of a region within the target image; a region within the reference image; or a region within the call image. For example, the availability of a region spaced apart by a predetermined distance from the target block may be determined, and if the region is available, the region may be inserted into the list as a reference region candidate. Here, the region spaced apart by a predetermined distance may be an region of a specific size, with a position spaced apart by a horizontal distance and a vertical distance from one of the top boundary and the left boundary of the current block by a unit distance as the center / upper left position. In another example, the availability of a region spaced apart by a predetermined distance from the call block may be determined, and if the region is available, the region may be inserted into the list as a reference region candidate. Here, the region spaced apart by a predetermined distance may be an region of a specific size, with a position spaced apart by a horizontal distance and a vertical distance from one of the top boundary and the left boundary of the call block by a unit distance as the center / upper left position. Here, the unit distance can be N, 2N, 3N, 4N, etc., and N can be 4, 8, 16, etc. The area of a specific size can be 4x4, 8x8, or 16x16.
[0631] When multiple candidates are inserted into the list, information indicating one of the multiple reference area candidates can be encoded and signaled.
[0632] Information indicating the configuration of a reference area may be encoded and signaled. The information may indicate whether at least one of a top adjacent area, a left adjacent area, an upper left adjacent area, or a lower right adjacent area is included in the reference area. For example, the information may be an index indicating one of configuration candidates of the reference area. The configuration candidates may include one of a candidate configured with an upper and left adjacent area, a candidate configured with only an upper adjacent area, a candidate configured with only a left adjacent area, a candidate configured with an upper area and an upper right area, or a candidate configured with a left area and a lower left area.
[0633] A block corresponding to a target block may mean at least one of a reference block of the target block; a chrominance component block corresponding to the target block when the target block is a luminance component block; or a luminance component block corresponding to the target block when the target block is a chrominance component block; but the type of block corresponding to the target block is not limited thereto.
[0634] The reference region in a model-based prediction method may be the same as the reference region in another prediction method. Alternatively, the reference region in a model-based prediction method may be different from the reference region in another prediction method. The other prediction method may include template matching.
[0635] In this specification, “specific information is determined based on a mapping model” may mean that the specific information is determined based on at least one of the MODEL_INPUT_NUM of the mapping model; the MODEL_OUTPUT_NUM of the mapping model; at least one bias value in the mapping model; a method for configuring an input of the mapping model; an input structure of the mapping model; an output structure of the mapping model; a method for performing (at least one of prediction, restoration, and decoding) of a sample in a target block from an output of the mapping model; or a method for changing a value of (at least one of prediction, restoration, and decoding) of a sample in a target block from an output of the mapping model; but the meaning of “specific information is determined based on the mapping model” is not limited thereto.
[0636] The independent sample set, the dependent sample set, and the target sample set may each include at least one of a prediction sample, a reconstruction sample, a residual sample, or a decoded sample from at least one of a target block, a neighboring block of the target block, a reference block of the target block, and a neighboring block of the reference block of the target block. In addition, the sample may be for at least one of a luminance component or a chrominance component.
[0637] That a particular sample is included in a particular sample set may mean that at least one of a sample value of the particular sample; motion information of the particular sample; coding parameters of the particular sample; prediction mode of the particular sample; an x-component of the position of the sample, a y-component of the position of the sample, motion information in a block including the particular sample, or motion information at the position of the particular sample is included in the particular sample set. Alternatively, that a particular sample is included in a particular sample set may mean that a value based on at least one of a sample value of the particular sample, motion information of the particular sample, coding parameters of the particular sample, a prediction mode of the particular sample, an x-component of the position of the sample, a y-component of the position of the sample, motion information in a block including the particular sample, and motion information at the position of the particular sample is included in the particular sample set.
[0638] “A specific sample is included in a specific sample set” and “A specific sample is used in the composition of a specific sample set” can be used interchangeably in the embodiments.
[0639] “A value based on a specific value” can mean the result of performing a specific operation on a specific value.
[0640] A prediction sample may refer to a luminance component prediction component and / or a chrominance component prediction component. A reconstruction sample may refer to a luminance component reconstruction component and / or a chrominance component reconstruction component. A residual sample may refer to a luminance component residual component and / or a chrominance component residual component. A decoded sample may refer to a luminance component decoded component and / or a chrominance component decoded component.
[0641] The reference block may include at least one of a reference block in the L0 direction in inter-screen prediction, a reference block in the L1 direction in inter-screen prediction, a reference block in intra-screen template matching, or a reference block in intra-screen block copying.
[0642] The in-screen template matching mode may mean a template matching method in which each of a reference block, a reference template, and a reference region includes at least one of a prediction sample, a restoration sample, a residual sample, or a decoded sample of a target image.
[0643] Information about how at least one of the independent sample set, the dependent sample set or the target sample set is constructed may be signaled / encoded / decoded.
[0644] The method of constructing a specific sample set may mean a method including at least one of 1) the number of samples used to construct the sample set and / or the maximum number of samples used to construct the sample set; 2) the size and / or location of the region in which the samples used to construct the sample set exist; 3) the shape, size and / or location of the region from which the samples used to construct the sample set are selected; 4) the type of at least one of the samples used to construct the sample set; 5) whether a bias value is included; 6) a method of determining a bias value; 7) a padding method in constructing the corresponding sample set; or 8) the size and / or location of a reference region.
[0645] The method of constructing a specific sample set may be distinguished based on 1) the number of samples used to construct the sample set and / or the maximum number of samples used to construct the sample set; 2) the size and / or location of the region in which the samples used to construct the sample set exist; 3) the shape, size and / or location of the region from which the samples used to construct the sample set are selected; 4) the type of at least one of the samples used to construct the sample set; 5) whether a bias value is included; 6) a method of determining the bias value; 7) a padding method in constructing the sample set; or 8) the size and / or location of a reference region.
[0646] Information on the method of constructing the above sample set may be information including at least one of 1) the number of samples used to construct the sample set and / or the maximum number of samples used to construct the sample set; 2) the size and / or location of the region in which the samples used to construct the sample set exist; 3) the shape, size and / or location of the region from which the samples used to construct the sample set are selected; 4) the type of at least one of the samples used to construct the sample set; 5) whether a bias value is included; 6) a method of determining the bias value; 7) a padding method in constructing the corresponding sample set; or 8) the size and / or location of the reference region.
[0647] Information on how to construct at least one of the independent sample set, the dependent sample set, or the target sample set can be determined based on at least one of the prediction mode of the target block, the motion information of the target block, the coding parameters of the target block, the size of the target block, the range of values that the luminance component of the target block can have, the range of values that the chrominance component of the target block can have, the availability of the surrounding blocks of the target block, the coding parameters of the surrounding blocks of the target block, or the surrounding samples of the target block.
[0648] For example, information on how to construct at least one of the independent sample set, the dependent sample set, or the target sample set can be determined without signaling / encoding / decoding based on at least one of the prediction mode of the target block, motion information of the target block, coding parameters of the target block, a size of the target block, a range of values that the luminance component of the target block can have, a range of values that the chrominance component of the target block can have, availability of neighboring blocks of the target block, coding parameters of neighboring blocks of the target block, neighboring samples of the target block, or a mapping model.
[0649] For example, a method of constructing at least one of the independent sample set, the dependent sample set, or the target sample set can be determined based on whether surrounding blocks in a specific direction are available for the target block.
[0650] The above availability may include presence or absence. The specific direction may be one of left-above, above, right-above, left, right, left-below, below, or right-below.
[0651] In forming at least one of an independent sample set, a dependent sample set, or a target sample set, it may be determined whether to include at least one of the samples in a specific direction in the sample set based on whether at least one surrounding block located in a specific direction with respect to the target block is available.
[0652] For example, based on the ratio of the width and height of the target block, the composition method of at least one of the independent sample set, the dependent sample set, or the target sample set can be determined.
[0653] In forming at least one of an independent sample set, a dependent sample set, or a target sample set, it may be determined whether to include at least one of the samples in a specific direction in the sample set based on a ratio of the width and height of the target block.
[0654] The above specific direction can be one of left-above, above, right-above, left, right, left-below, below, and right-below.
[0655] In forming at least one of the independent sample set, the dependent sample set, or the target sample set, the size and / or location of the reference region may be determined based on the ratio of the width and height of the target block.
[0656] For example, a method of composing at least one sample set among the independent sample set, the dependent sample set, or the target sample set can be determined based on at least one of the prediction mode, motion information, or coding parameters of the target block.
[0657] In constructing at least one of the independent sample set, the dependent sample set, or the target sample set, the type of at least one of the samples used to construct the sample set can be determined based on at least one of the prediction mode, motion information, or coding parameters of the target block.
[0658] The type of the above sample may include at least one of a prediction sample, a restoration sample, a residual sample, or a decoded sample; at least one of a luminance component and a chrominance component of at least one of a target block, a neighboring block of the target block, a reference block of the target block, or a neighboring block of a reference block of the target block; or at least one bias value.
[0659] For example, if the target block is in geometric partition mode, a method of composing at least one sample set among the independent sample set, the dependent sample set, or the target sample set can be determined.
[0660] For example, if the target block is in a geometric segmentation mode, at least one of the independent sample sets or the dependent sample sets of the target sample sets can be determined based on at least one of the information about the geometric segmentation mode.
[0661] Information about the geometric segmentation mode may mean at least one of a segmentation boundary, a segmentation mode, a segmentation angle, or a segmentation offset of the geometric segmentation mode, but the information about the geometric segmentation mode is not limited thereto.
[0662] For example, for a specific directional boundary of a target block, it can be determined whether to use the specific directional surrounding samples for composing at least one of the independent sample set, the dependent sample set, or the target sample set based on the sample value of at least one of the surrounding samples within the adjacent BOUND_LINE_NUM rows / columns and / or at least one of the samples within the BOUND_LINE_NUM rows / columns within the target block.
[0663] BOUND_LINE_NUM can be 1, 2, or a positive integer. BOUND_LINE_NUM can be determined based on at least one of the motion information of the target block, the coding parameters of the target block, the size of the target block, the range of values that the luminance component of the target block can have, the range of values that the chrominance component of the target block can have, the availability of surrounding blocks of the target block, the coding parameters of surrounding blocks of the target block, or the surrounding samples of the target block.
[0664] Figure 30 is a diagram for explaining the surrounding samples within the target block and BOUND_LINE_NUM rows / columns and the samples within BOUND_LINE_NUM rows / columns within the target block.
[0665] FIG. 31 illustrates an embodiment of determining whether to use upper peripheral samples in constructing various sample sets based on at least one of peripheral samples within the upper two rows / columns of a target block or samples within two rows / columns within the target block.
[0666] Referring to FIG. 31, for the upper boundary surface of the target block, it is possible to determine whether to use the upper peripheral samples for at least one of the independent sample set, the dependent sample set, or the target sample set based on the sample value of at least one of the peripheral samples within two adjacent rows / columns and / or at least one of the samples within two rows / columns within the target block.
[0667] In Fig. 31 If the value is greater than a certain threshold, the surrounding samples in the upper direction of the target block may not be used to construct the independent sample set, dependent sample set, and target sample set. For example, if If the value is less than a certain threshold, at least one of the surrounding samples in the upper direction of the target block can be used to construct at least one of the independent sample set, the dependent sample set, or the target sample set.
[0668] In the above embodiment, since the block size is 8x8, x has values from 0 to 7. However, even if the block size is 8x8, x may have values in a different range, and may have values determined at intervals greater than 1 (e.g., 0, 2, 4, 6).
[0669] The mapping model can be a regression model. For example, the mapping model can be a filter.
[0670] For example, a mapping model can be derived through regression analysis.
[0671] For example, to reduce complexity in deriving a mapping model, at least one of LU decomposition, LDL decomposition, or Gaussian elimination may be used.
[0672] A mapping model can be a model that outputs a result value having MODEL_OUTPUT_NUM components from an input consisting of MODEL_INPUT_NUM components.
[0673] That a specific sample is included in the input of the mapping model may mean that at least one of a sample value of the specific sample; motion information of the specific sample; coding parameters of the specific sample; prediction mode of the specific sample; an x-component of the position of the sample, a y-component of the position of the sample, motion information in a block including the specific sample, or motion information at the position of the specific sample is included in the specific sample set. Alternatively, that a specific sample is included in the specific sample set may mean that a value based on at least one of a sample value of the specific sample, motion information of the specific sample, coding parameters of the specific sample, a prediction mode of the specific sample, an x-component of the position of the sample, a y-component of the position of the sample, motion information in a block including the specific sample, or motion information at the position of the specific sample is included in the input.
[0674] “The input includes a specific sample” and “the input is composed of a specific sample” can be used interchangeably in the embodiments and can be used interchangeably.
[0675] “Result of the mapping model” and “output of the mapping model” can be used interchangeably in the embodiments.
[0676] MODEL_INPUT_NUM and MODEL_OUTPUT_NUM can each be a positive integer.
[0677] MODEL_INPUT_NUM and MODEL_OUTPUT_NUM can each be a predefined value. Alternatively, information about at least one of MODEL_INPUT_NUM or MODEL_OUTPUT_NUM can be signaled / encoded / decoded.
[0678] The mapping model can be a linear model. Alternatively, the mapping model can be a non-linear model.
[0679] Mapping model f, input and result values The relationship can be expressed as in the examples below.
[0680]
[0681]
[0682]
[0683] ...
[0684]
[0685]
[0686] can mean the coefficient of the mapping model f.
[0687] i can have a value from 1 to MODEL_INPUT_NUM.
[0688] j can have a value from 1 to MODEL_OUTPUT_NUM.
[0689] Saying that a mapping model f is derived may mean that at least one of the coefficients of the mapping model f is derived.
[0690]
[0691] For a particular sample in a set of independent samples, an input can be determined that consists of MODEL_INPUT_NUM components, including at least one of the sample; a surrounding sample adjacent to the sample; a non-adjacent (non-touching) surrounding sample to the sample; a bias value; or a result of performing a particular operation on at least one of the aforementioned elements.
[0692] For example, at least one of the adjacent surrounding samples and / or at least one of the bias values used to construct the input for a particular sample within the set of independent samples may not be included in the set of independent samples.
[0693] For example, the input may include a bias value that is independent of the particular sample.
[0694] For a particular sample in the set of independent samples, a target output can be determined that consists of MODEL_OUTPUT_NUM components, including at least one of: a sample in the set of dependent samples corresponding to the sample; a neighboring sample adjacent to the sample in the set of dependent samples corresponding to the sample; a non-adjacent (non-touching) neighboring sample in the set of dependent samples corresponding to the sample; or a bias value.
[0695] A mapping model can be a model that computes the association between input and target output for each sample in a set of independent samples.
[0696] The mapping model can be derived such that when the input and target output are determined for each sample in the independent sample set, the output value of the mapping model for the input for the entire sample becomes similar to the target output on average.
[0697] For a specific sample within a set of independent samples, when using a surrounding sample of the sample as input, if the specific surrounding sample is not available, a sample determined based on at least one of the available sample(s) closest to the location of the surrounding sample may be used as input in place of the specific surrounding sample. This process can be expressed as performing padding on the surrounding sample.
[0698] A sample in a set of dependent samples corresponding to a particular sample in a set of independent samples may mean at least one of a sample in a set of dependent samples corresponding to a location of that sample; and / or at least one of the target outputs determined for that sample.
[0699] For example, when constructing an independent sample set and / or a dependent sample set, NUM_SAMPLE_TO_REF samples can be used.
[0700] The above NUM_SAMPLE_TO_REF may be a fixed constant value. Alternatively, the NUM_SAMPLE_TO_REF may be a value that is adaptively determined based on at least one of the prediction mode of the target block, the motion information of the target block, the coding parameters of the target block, the size of the target block, the range of values that the luminance component of the target block can have, the range of values that the chrominance component of the target block can have, the availability of the surrounding blocks of the target block, the coding parameters of the surrounding blocks of the target block, or the surrounding samples of the target block.
[0701] For example, if the size of the target block is less than a certain value, it can have the value of NUM_SAMPLE_TO_REF=(H+W), and if not, it can have the value of NUM_SAMPLE_TO_REF=(H+W) / STEP_TO_REF.
[0702] STEP_TO_REF can be 2, 4, 8, or any positive integer.
[0703] Alternatively, for example, if the target block size is less than or equal to a certain value, it may have a value of NUM_SAMPLE_TO_REF=(H+W), otherwise it may have a value of NUM_SAMPLE_TO_REF= NUM_SAMPLE_TO_REF_CONST.
[0704] NUM_SAMPLE_TO_REF_CONST can be 8, 16, 32, 64, 128, or any positive integer.
[0705] The size of the target block may mean at least one of the height, width, product of height and width, sum of height and width, larger value of height and width, smaller value of height and width, or diagonal length of the target block.
[0706]
[0707] For a particular sample in a set of dependent samples, a target output can be determined that consists of MODEL_OUTPUT_NUM components, including at least one of the sample; a surrounding sample adjacent to the sample; a non-adjacent (non-touching) surrounding sample to the sample; a bias value; or a result of performing a particular operation on at least one of the aforementioned elements.
[0708] For example, at least one of the adjacent surrounding samples and / or at least one of the bias values used to construct the input for a particular sample within the dependent sample set may not be included in the independent sample set.
[0709] For a particular sample in a dependent sample set, an input can be determined that consists of MODEL_INPUT_NUM components, including at least one of: a sample in a corresponding independent sample set; a neighboring sample adjacent to a sample in a corresponding independent sample set; a non-adjacent (non-touching) neighboring sample in a corresponding dependent sample set; a bias value; or a result of performing a particular operation on at least one of the aforementioned elements.
[0710] A mapping model can be a model that computes the association between input and target output for each sample in a set of dependent samples.
[0711] The mapping model can be derived such that when the input and target output are determined for each sample in the dependent sample set, the output value of the mapping model for the input for all samples is similar to the target output on average.
[0712] For a specific sample within a set of dependent samples, when using a surrounding sample of the sample as the target output, if the specific surrounding sample is not available, a sample determined based on at least one of the available sample(s) closest to the location of the surrounding sample may be used as the target output instead of the specific surrounding sample. This process can be expressed as performing padding on the surrounding sample.
[0713] A sample in the set of independent samples corresponding to a particular sample in the set of dependent samples may mean at least one of a sample in the set of independent samples corresponding to the location of that sample; and / or at least one of the inputs determined for that sample.
[0714] Mapping model f, input and target output The relationship can be expressed as in the examples below. can mean the error between the output value of the mapping model for the input and the target output.
[0715]
[0716] The mapping model f is for all samples in the dependent sample set or for some samples in the dependent sample set. can be derived to minimize the sum or average of .
[0717] For example, in deriving a mapping model, at least one coefficient of the mapping model can be determined as one value selected from a candidate list consisting of predefined DEFAULT_COEF_NUM values. The DEFAULT_COEF_NUM can be 1, 2, 3, or a positive integer. The value of DEFAULT_COEF_NUM can be predefined, or information about DEFAULT_COEF_NUM can be signaled / encoded / decoded. For example, information about which candidate value among the DEFAULT_COEF_NUM candidate values is used to determine the coefficient of the mapping model can be signaled / encoded / decoded.
[0718] The input of the mapping model may include at least one of: 1) a value of at least one sample in the independent sample set and / or a value based thereon; 2) a location of at least one sample in the independent sample set and / or a value based thereon; 3) a value of at least one sample in the target sample set and / or a value based thereon; 4) a location of at least one sample in the target sample set and / or a value based thereon; or 5) a bias.
[0719] Information about a model-based prediction method in a target block can be stored. The model-based prediction method can be performed in a block encoded / decoded after the target block based on the information about the model-based prediction method stored in the target block. The model-based prediction method can be performed in the target block based on the information about the model-based prediction method in a block encoded / decoded before the target block.
[0720] The information may include at least one of: whether to perform a model-based prediction method in the target block and / or an indicator indicating whether to perform the method; a method for configuring at least one of an independent sample set, a dependent sample set, or a target sample set in the target block; at least one of a sample, a location, or a sample value included in the independent / dependent / target sample set in the target block; a method for determining a reference area in the target block; mapping model information in the target block; whether to use multiple mapping models in the target block and / or an indicator indicating whether to use multiple mapping models; or the number and / or the maximum number of mapping models in the target block.
[0721] The mapping model information may be information including at least one of the MODEL_INPUT_NUM of the mapping model; the MODEL_OUTPUT_NUM of the mapping model; at least one coefficient of the mapping model; the input structure of the mapping model; or the output structure of the mapping model.
[0722] The type of a particular variable may be determined by its components. For example, the type of a particular variable may be determined based on at least one of the following: whether an operation is performed, the type of operation performed, or the type of its components.
[0723] The type of the component may include at least one of a target block, a neighboring block of the target block, a reference block of the target block, or a neighboring block of the reference block of the target block; at least one of a prediction sample, a reconstruction sample, a residual sample, or a decoded sample; or at least one bias value; at least one of a luminance component and a chrominance component of at least one of the target block, a neighboring block of the target block, a reference block of the target block, or a neighboring block of the reference block of the target block.
[0724] The model-based prediction method in the first block may be performed based on information about the model-based prediction method stored in the second block that is encoded / decoded prior to the first block. Alternatively, information about the model-based prediction method in the first block may be determined based on information about the model-based prediction method stored in the second block that is encoded / decoded prior to the first block.
[0725] In this specification, “inheriting information about a model-based prediction method in a second block from a first block” may refer to that the model-based prediction method in the first block is performed based on information about the model-based prediction method stored in a second block that is encoded / decoded before the first block. Alternatively, in this specification, “inheriting information about the model-based prediction method in a second block from a first block” may refer to that information about the model-based prediction method in the first block is determined based on information about the model-based prediction method stored in a second block that is encoded / decoded before the first block.
[0726] For example, at least one coefficient of at least one mapping model included in the information on the model-based prediction method stored in the second block may be determined as one of the coefficients of the mapping model in the first block.
[0727] The mapping model f in block 1 can be considered as inheriting information about the model-based prediction method in block 2 from block 1.
[0728] For example, some of the coefficients of at least one mapping model included in the information about the model-based prediction method stored in the second block may be determined as some of the coefficients of the mapping model in the first block. Thereafter, the remaining coefficients of the mapping model in the first block may be derived through regression analysis.
[0729] Information about the model-based prediction method of the current block can be inherited from at least one candidate block. The candidate block may include at least one of a neighboring block adjacent to the current block or a non-adjacent block not adjacent to the current block.
[0730] For example, an adjacent block may include at least one of the blocks adjacent to the top, top left, top right, left, or bottom left of the current block, as illustrated in FIG. 27.
[0731] Figure 32 is a diagram illustrating non-adjacent blocks of the current block. A non-adjacent block may include a block whose distance from at least one of the top or left borders of the current block is N, as in the example illustrated in Figure 32. N may be an integer such as 4, 8, or 16. After deriving merge candidates from adjacent blocks, merge candidates may be derived using non-adjacent blocks.
[0732] Alternatively, the non-adjacent block may be a block indicated by at least one of a block vector of the target block, a motion vector of the target block, a block vector of a luminance component block corresponding to the target block if the target block is a chrominance component block, a motion vector of a luminance component block corresponding to the target block if the target block is a chrominance component block, a block vector of a neighboring block, a motion vector of the neighboring block, a block vector around the target block, or a motion vector around the target block. For example, the neighboring block may be an adjacent block.
[0733] For example, for at least two blocks among the block vector of the target block, the motion vector of the target block, the block vector of the luminance component block corresponding to the target block if the target block is a chrominance component block, the motion vector of the luminance component block corresponding to the target block if the target block is a chrominance component block, the block vector of the neighboring block, the motion vector of the neighboring block, the block vector around the target block, or the blocks indicated by the motion vector around the target block, a merge candidate can be derived from N blocks having the lowest template matching cost among these.
[0734] Merge candidates can also be derived from temporally adjacent blocks. The temporally adjacent block may be a block (called block) corresponding to the position of the current block within the called picture, as in the example illustrated in Fig. 27, or may be an adjacent block of the called block.
[0735] For example, deriving a merge candidate using a specific candidate block may mean using the specific candidate block as a merge candidate. Alternatively, deriving a merge candidate using a specific candidate block may mean using the mapping models used in the specific candidate block or a portion thereof as a merge candidate.
[0736]
[0737] Merge candidates can also be derived from temporally adjacent blocks. The temporally adjacent block may be a block (called block) corresponding to the position of the current block within the called picture, as in the example illustrated in Fig. 27, or may be an adjacent block of the called block.
[0738] For example, a temporally adjacent block may be a block located to the right, bottom, bottom right, top left, or bottom left of a call block.
[0739] There can be N temporally adjacent blocks for deriving merge candidates for the target block. N can be 0, 1, 2, 3, 6, 12, or a positive integer. In addition, there can be M merge candidates derived from temporally adjacent blocks in the target block. M can be 0, 1, 2, 3, 6, 12, or a positive integer.
[0740] The number of temporal adjacent blocks may be adaptively determined depending on the number of available spatial adjacent blocks.
[0741] Merge candidates can also be derived from non-adjacent blocks of a call block. For example, merge candidates can be derived based on temporal blocks whose horizontal or vertical distances are at least unit distance or N times the unit distance from the upper left position of the call block. For example, if the upper left position of the call block is (x, y), merge candidates can be derived from temporal blocks whose upper left positions are (x + (N*horizontal), y), (x, y +((N*vertical)) or (x + (N* horizontal), y + (N*vertical)).
[0742] Here, horizontal represents the unit distance in the horizontal direction, and vertical represents the unit distance in the vertical direction. The unit distance can be determined based on the size of the target block. For example, the horizontal unit distance and the vertical unit distance can be set equal to the width and height of the target block, respectively.
[0743] N can be a natural number greater than or equal to 1. If the temporal block derived when the first value is applied to N is unavailable, N can be increased by 1 to search for a temporal block.
[0744] A merge candidate may also be derived from a block at a shifted position of a temporal block (hereinafter referred to as a shifted temporal block). Here, the shifted temporal block may be located at a position spaced apart by a motion vector from the position of the temporal block. Here, the motion vector may be a motion vector of a spatially adjacent block of the target block. For example, the shifted temporal block may be determined based on the motion vector of the left or upper neighboring block of the target block. Alternatively, when the spatial neighboring blocks of the target block are searched in a predefined order, the shifted temporal block may be determined based on the motion vector of the first searched available block. If there is no available block among the spatial neighboring blocks, shifting may not be performed and the temporal block at the original position may be used.
[0745] Whether a temporally adjacent block is available may be determined based on at least one of the picture / slice type (e.g., whether it is an I picture / I slice) or the type of the matching model.
[0746] A prediction method information merge list can be constructed based on information about the prediction method of at least one candidate block. In the prediction method information merge list, candidate blocks or information about the prediction method of a candidate block can be inserted as merge candidates.
[0747] Default prediction method information may be inserted into the prediction method information merge list. For example, the default prediction method information may be a default scaling parameter set predefined in the encoder / decoder. Alternatively, the default prediction method information may be derived by adding / differentiating a predefined offset to a merge candidate pre-inserted in the prediction method information merge candidate list. Here, the pre-inserted merge candidate may be a merge candidate having a smallest index or a largest index among the merge candidates inserted in the prediction method information merge candidate list. The default prediction method may be inserted when the number of merge candidates included in the prediction method information merge list is less than a threshold. The threshold may be a maximum number of merge candidates that the prediction method information merge list may include or a value M less than the maximum number. M may be an integer such as 1 or 2.
[0748] For example, even if the number of merge candidates is less than a threshold value after inserting them into the prediction method information merge list according to a predefined order, default prediction method information may be inserted into the prediction method information merge list. In one example, the predefined order may be the order of spatially adjacent blocks, spatially non-adjacent blocks, and prediction method information stored in the accumulated prediction method information table described below.
[0749] Here, a non-adjacent block may mean a block that is spaced apart by at least one of a horizontal distance or a vertical distance from a specific location of the target block or a specific location around the target block by a unit distance or N times the unit distance. For example, as in the example illustrated in FIG. 40, if the upper left location of the target block is (x, y), a merge candidate can be derived from a spatially non-adjacent block whose upper left location is (x - (N * horizontal), y), (x, y-(N * vertical)) or (x - (N * horizontal), y-(N * vertical)).
[0750] Here, horizontal represents the unit distance in the horizontal direction, and vertical represents the unit distance in the vertical direction. The unit distance can be determined based on the size of the target block. For example, the horizontal unit distance and the vertical unit distance can be set equal to the width and height of the target block, respectively.
[0751] N can be a natural number greater than or equal to 1. If spatially non-adjacent blocks are unavailable when the first value is applied to N, spatially non-adjacent blocks can be searched by increasing N by 1.
[0752] Prediction method information of a block predicted based on a mapping model can be accumulated and stored in a prediction method information table. For example, if a block is predicted based on a mapping model, the prediction method information table can be updated with the prediction method information of the block. The number of candidates included in the prediction method information table can be predefined in the encoder and decoder. The prediction method information table can be initialized in predefined units. Here, the predefined units can be CTUs, tiles, slices, CTU rows, or subpictures.
[0753] Alternatively, what is stored in the above prediction method information table may not be prediction method information of a block predicted based on a mapping model, but may be a block predicted based on a mapping model.
[0754] When constructing a prediction method information merge list, a prediction method information table may be utilized. For example, if the number of merge candidates included in the prediction method information table is less than a threshold, the prediction method information stored in the prediction method information table may be inserted into the prediction method information merge list as a new merged list.
[0755] When the prediction method information merge list includes multiple merge candidates, information specifying one of the multiple merge candidates can be encoded and signaled.
[0756] Alternatively, the prediction method information table itself can be used as a prediction method information merge list. If the prediction method information merge list includes multiple candidates, information specifying one of the multiple candidates can be encoded and signaled. For example, information indicating whether the prediction method information table itself is to be used as a prediction method information merge list can be signaled / encoded / decoded.
[0757] In the target block, information indicating whether a prediction method information merge list is used may be encoded and signaled. The information may be a 1-bit flag. If the information indicates that the prediction method information merge list is used, the prediction method information of the current block may be inherited from the merge candidate. If the information indicates that the prediction method information merge list is not used, the prediction method information of the current block may be derived from the reference region.
[0758] After restoration of the target block is completed, a mapping model for the target block can be derived based on samples of the restored target block.
[0759] In a block to be encoded / decoded after the target block, the mapping model of the derived target block can be referenced.
[0760] In a block that is encoded / decoded after the target block, information about a model-based prediction method can be inherited from the mapping model of the derived target block.
[0761] As an example, the mapping model for the target block may be a mapping model representing a relationship from an independent sample set including at least one of the luminance component prediction samples of the target block to a dependent sample set including at least one of the luminance component reconstruction samples of the target block. As another example, the mapping model for the target block may be a mapping model representing a relationship from an independent sample set including at least one of the luminance component reconstruction samples of the target block to a dependent sample set including at least one of the chrominance component reconstruction samples of the target block. As another example, the mapping model for the target block may be a mapping model representing a relationship from an independent sample set including at least one of the chrominance component prediction samples of the target block to a dependent sample set including at least one of the chrominance component reconstruction samples of the target block.
[0762]
[0763] At this time, the mapping model can be derived in the above manner only if the model-based prediction method has been performed on the target block. Alternatively, the mapping model can be derived in the above manner for all blocks, regardless of whether the model-based prediction method has been performed on the target block. Alternatively, the mapping model can be derived in the target block in the above manner if the target block satisfies certain conditions.
[0764] The specific condition may be at least one of a prediction mode of the target block; motion information of the target block; coding parameters of the target block; a size of the target block; a range of values that the luminance component of the target block can have; a range of values that the chrominance component of the target block can have; availability of neighboring blocks of the target block; coding parameters of neighboring blocks of the target block; neighboring samples of the target block; or a mapping model. As an example, the specific condition may be whether the prediction mode of the target block is inter-frame prediction. As an example, the specific condition may be whether the target block is a luminance component block.
[0765] In this specification, “a mapping model is derived for a specific block” may mean at least one of: 1) at least one mapping model is derived for the entire block; 2) the block is divided into specific units and at least one mapping model is derived for each of the divided blocks; or 3) the block is divided into specific units and at least one mapping model is derived for at least one of the divided blocks. In this case, the specific unit may include at least one of a TU unit and a sub-block unit having a size of NxM. N and M may be 1, 2, 4, 8, 16, 32 or a positive integer, respectively.
[0766] Prediction can be performed using a first mapping model on a target block. Thereafter, a second mapping model for the target block can be derived from a set of independent samples and / or a set of dependent samples containing restored samples of the target block, and the first mapping model can be replaced (or updated) with the second mapping model.
[0767] As an example, the second mapping model may be a mapping model representing a relationship from an independent sample set including at least one of the luminance component prediction samples of the target block to a dependent sample set including at least one of the luminance component reconstruction samples of the target block. As another example, the second mapping model may be a mapping model representing a relationship from an independent sample set including at least one of the luminance component reconstruction samples of the target block to a dependent sample set including at least one of the chrominance component reconstruction samples of the target block. As another example, the second mapping model may be a mapping model representing a relationship from an independent sample set including at least one of the chrominance component prediction samples of the target block to a dependent sample set including at least one of the chrominance component reconstruction samples of the target block.
[0768] In blocks that are encoded / decoded after the target block, the second mapping model of the target block can be referenced.
[0769] In blocks that are encoded / decoded after the target block, information about the model-based prediction method can be inherited from the second mapping model of the target block.
[0770] A mapping model for the target block can be derived and stored from a set of independent samples and / or a set of dependent samples containing restored samples of the target block.
[0771] A mapping model related to luminance component prediction and luminance component restoration can be stored.
[0772] For example, after restoration of luminance component samples of a target block (or restoration of a target block that is a luminance component block) is performed, a mapping model for the target block can be derived and stored from an independent sample set including luminance component prediction samples of the target block and a dependent sample set including luminance component restoration samples of the target block.
[0773] Information about a model-based prediction method can be inherited from the mapping model of the target block derived by the above method in the first block that is encoded / decoded after the target block. Thereafter, the value of at least one of the luminance component prediction samples of the first block can be changed based on a target sample set that includes at least one of the luminance component prediction samples of the first block.
[0774] In this case, there is an effect of predicting the residual signal of the first block luminance component and adding it to the luminance component prediction component of the first block, so that encoding efficiency can be improved.
[0775] A mapping model related to chrominance component prediction and chrominance component restoration can be stored.
[0776] For example, after restoration of the chrominance component samples of the target block (or restoration of the target block as a chrominance component block) is performed, a mapping model for the target block can be derived and stored from an independent sample set including chrominance component prediction samples of the target block and a dependent sample set including chrominance component restoration samples of the target block.
[0777] Information about a model-based prediction method can be inherited from the mapping model of the target block derived by the above method in the first block that is encoded / decoded after the target block. Thereafter, the value of at least one of the chrominance component prediction samples of the first block can be changed based on a target sample set that includes at least one of the chrominance component prediction samples of the first block.
[0778] In this case, there is an effect of predicting the residual signal of the first block chrominance component and adding it to the chrominance component prediction component of the first block, so that encoding efficiency can be improved.
[0779] Luminance component restoration and chrominance component restoration can be saved.
[0780] For example, after restoration of the chrominance component samples of the target block (or restoration of the target block as a chrominance component block) is performed, a mapping model for the target block can be derived and stored from an independent sample set including the luminance component restoration samples of the target block (or restoration samples of the luminance component block corresponding to the target block) and a dependent sample set including the chrominance component restoration samples of the target block.
[0781] Information about a model-based prediction method can be inherited from the mapping model of the target block derived by the above method in the first block that is encoded / decoded after the target block. Thereafter, the value of at least one of the luminance component prediction samples of the first block can be changed based on a target sample set that includes at least one of the luminance component restoration samples of the first block (or the restoration samples of the luminance component block corresponding to the target block).
[0782] In this case, encoding efficiency can be improved by utilizing the redundancy of information between the luminance component and the chrominance component.
[0783] When a prediction method information merge list is used in the target block, information for specifying a merge candidate to inherit the mapping model information to be used in the target block may be signaled / encoded / decoded.
[0784] For example, information for specifying a merge candidate to inherit mapping model information to be used in the target block may be an index of the merge candidate in the prediction method information merge list.
[0785] When a merge list of prediction method information is used in a target block, a merge candidate for inheriting mapping model information to be used in the target block can be determined based on at least one of the size of the target block, whether the target block is a luminance component block, whether the target block is a chrominance component block, the type of the target slice, a neighboring block of the target block, the availability of neighboring blocks of the target block, a neighboring sample of the target block, a luminance component sample of the target block, a chrominance component sample of the target block, the availability of neighboring samples of the target block, or a coding parameter of the target block.
[0786] There may be one or more merge candidates that inherit mapping model information from the above target block. For example, there may be six merge candidates.
[0787] Meanwhile, depending on the prediction mode of the target block and / or the luminance / chrominance component block corresponding to the target block, it may be determined whether or not to allow the performance of a mapping-based prediction method in the target block.
[0788] For example, a model-based prediction method in a target block can be performed only when the target block and / or a luminance / chrominance component block corresponding to the target block is encoded / decoded by intra-screen prediction.
[0789] As another example, a model-based prediction method may be performed on the target block even if the target block and / or the luminance / chrominance component block corresponding to the target block has been predicted via inter-screen prediction, IBC, or template-based intra prediction (intraTMP).
[0790] Depending on the encoding / decoding mode of the target block and / or the luminance / chrominance component block corresponding to the target block, at least one of the information for the model-based prediction method may be different.
[0791] For example, information about the model-based prediction method may mean at least one of a method of configuring at least one of independent / dependent / target sample sets, coefficients of a mapping model, an input structure of a mapping model, an output structure of a mapping model, a type of a mapping model, a method of deriving coefficients of a mapping model, or a method of deriving a mapping model.
[0792] For example, if the target block and / or the luminance / chrominance component block corresponding to the target block is predicted by inter-screen prediction, IBC, or intraTMP, a nonlinear model may be used as a mapping model in the target block, but a linear model may not be used.
[0793] For example, if the target block and / or the luminance / chrominance component block corresponding to the target block is predicted by inter-screen prediction, IBC, or intraTMP, a nonlinear model can be used invariably.
[0794] For example, if the target block and / or the luminance / chrominance component block corresponding to the target block is predicted by inter-screen prediction, IBC, or intraTMP, the method of selecting a mapping model using the merge candidate list may not be available.
[0795] At least one piece of information about the model-based prediction method may be different between cases where the target block and / or the luminance / chrominance component block corresponding to the target block is predicted by intra-screen prediction and cases where the target block and / or the luminance / chrominance component block corresponding to the target block is predicted by other prediction modes (i.e., inter-screen prediction, IBC, or intraTMP).
[0796] For example, at least one of the number of coefficients used in the mapping model or the method of deriving the coefficients may be different between cases where the target block and / or the luminance / chrominance component block corresponding to the target block is predicted by intra-screen prediction and cases where the target block and / or the luminance / chrominance component block corresponding to the target block is predicted by another prediction mode (i.e., inter-screen prediction, IBC, or intraTMP).
[0797] In this specification, the target block and the current block may be used with the same meaning and may be used interchangeably.
[0798] In constructing the merge candidate list, the available blocks can be restricted depending on the prediction mode of the independent sample set.
[0799] For example, if a set of independent samples for the current block is sub- / decoded with intra-screen prediction, only the spatio-temporal blocks that are sub- / decoded with intra-screen prediction among the spatio-temporal blocks can be used to derive merge candidates.
[0800] For example, if the independent sample set for the current block is predicted by inter-screen prediction, IBC, or intraTMP, only the spatio-temporal blocks predicted by inter-screen prediction, IBC, or IntraTMP among the spatio-temporal blocks can be used to derive merge candidates.
[0801] In constructing a merge candidate list, available blocks can be limited according to the prediction mode of the target block and / or the luminance / chrominance component block corresponding to the target block.
[0802] For example, if a target block and / or a luminance / chrominance component block corresponding to the target block is sub- / decoded by intra-screen prediction, only the spatiotemporal blocks in which the target block or the luminance / chrominance component block corresponding to the target block is sub- / decoded by intra-screen prediction can be used to derive merge candidates.
[0803] For example, if a target block and / or a luminance / chrominance component block corresponding to the target block is decoded / sub-decoded by at least one of inter-screen prediction, IBC, or intraTMP, only the spatiotemporal blocks of which the target block or the luminance / chrominance component block corresponding to the target block is decoded / sub-decoded by at least one of inter-screen prediction, IBC, or intraTMP can be used to derive merging candidates.
[0804] For example, if a target block and / or a luminance / chrominance component block corresponding to the target block is encoded / decoded by intra-screen prediction, only blocks included in the prediction method information table, among the blocks included in the prediction method information table, in which the block or a luminance / chrominance component block corresponding to the block is encoded / decoded by intra-screen prediction, can be used to derive merging candidates.
[0805] For example, if the target block and / or the luminance / chrominance component block corresponding to the target block is encoded / decoded by at least one of inter-screen prediction, IBC, or intraTMP, only the blocks included in the prediction method information table, among the blocks included in the prediction method information table, in which the block or the luminance / chrominance component block corresponding to the block is encoded / decoded by at least one of inter-screen prediction, IBC, or intraTMP, can be used to derive the merging candidate.
[0806] For example, if a target block and / or a luminance / chrominance component block corresponding to the target block is encoded / decoded by intra-screen prediction, only the prediction method information included in the prediction method information table, among the prediction method information included in the prediction method information table, for which the block in which the prediction method information is used or the luminance / chrominance component block corresponding to the block in which the prediction method information is used is encoded / decoded by intra-screen prediction, can be used to derive a merging candidate.
[0807] For example, if the target block and / or the luminance / chrominance component block corresponding to the target block is encoded / decoded by at least one of inter-screen prediction, IBC, or intraTMP, only the prediction method information included in the prediction method information table for a block in which the prediction method information is used or the prediction method information included in the prediction method information table for which the luminance / chrominance component block corresponding to the block in which the prediction method information is used is encoded / decoded by at least one of inter-screen prediction, IBC, or intraTMP can be used to derive a merging candidate.
[0808] Alternatively, for example, even if the target block and / or the luminance / chrominance component block corresponding to the target block is decoded / decoded by intra-screen prediction, not only the spatio-temporal blocks in which the target block or the luminance / chrominance component block corresponding to the target block is decoded / decoded by intra-screen prediction, but also the spatio-temporal blocks in which the target block or the luminance / chrominance component block corresponding to the target block is predicted by at least one of inter-screen prediction, IBC, or intraTMP can be used to derive merging candidates.
[0809] Alternatively, for example, even if the target block and / or the luminance / chrominance component block corresponding to the target block is sub-decoded by at least one of inter-screen prediction, IBC, or intraTMP, not only the spatio-temporal blocks in which the target block or the luminance / chrominance component block corresponding to the target block is predicted by at least one of inter-screen prediction, IBC, or intraTMP, but also the spatio-temporal blocks in which the target block or the luminance / chrominance component block corresponding to the target block is sub-decoded by intra-screen prediction can be used to derive merging candidates.
[0810] Alternatively, for example, even if the target block and / or the luminance / chrominance component block corresponding to the target block is decoded / decoded by intra-screen prediction, not only the blocks included in the spatiotemporal block and prediction method information table, in which the block or the luminance / chrominance component block corresponding to the block is decoded / decoded by intra-screen prediction, or the blocks included in the prediction method information table, but also the spatiotemporal blocks or blocks included in the prediction method information table, in which the block or the luminance / chrominance component block corresponding to the block is predicted by at least one of inter-screen prediction, IBC, or intraTMP, can be used to derive merging candidates.
[0811] Alternatively, for example, even if the target block and / or the luminance / chrominance component block corresponding to the target block is sub- / decoded by at least one of inter-screen prediction, IBC, or intraTMP, not only the blocks included in the spatiotemporal block and prediction method information table, in which the corresponding block or the luminance / chrominance component block corresponding to the corresponding block is predicted by at least one of inter-screen prediction, IBC, or intraTMP, or the blocks included in the prediction method information table, but also the spatiotemporal blocks included in the spatiotemporal block and prediction method information table, in which the corresponding block or the luminance / chrominance component block corresponding to the corresponding block is sub- / decoded by intra-screen prediction, or the blocks included in the prediction method information table, can be used to derive merging candidates.
[0812] Alternatively, for example, even if the target block and / or the luminance / chrominance component block corresponding to the target block is sub- / decoded by intra-screen prediction, not only the blocks in which the prediction method information is used among the prediction method information included in the prediction method information table or the luminance / chrominance component blocks corresponding to the blocks in which the prediction method information is used, but also the prediction method information included in the prediction method information table, in which the blocks in which the prediction method information is used among the prediction method information included in the prediction method information table or the luminance / chrominance component blocks corresponding to the blocks in which the prediction method information is used, are predicted by at least one of inter-screen prediction, IBC or intraTMP, can be used to derive merging candidates.
[0813] Alternatively, for example, even if the target block and / or the luminance / chrominance component block corresponding to the target block is decoded / subtracted by at least one of inter-screen prediction, IBC, or intraTMP, not only the blocks in which the prediction method information is used among the prediction method information included in the prediction method information table or the luminance / chrominance component blocks corresponding to the blocks in which the prediction method information is used are predicted by at least one of inter-screen prediction, IBC, or intraTMP or the blocks in the prediction method information table, but also the prediction method information included in the prediction method information table, the blocks in which the prediction method information is used among the prediction method information included in the prediction method information table or the luminance / chrominance component blocks corresponding to the blocks in which the prediction method information is used are decoded / subtracted by intra-screen prediction, can be used to derive merging candidates.
[0814] In this specification, a spatiotemporal block may include a spatiotemporal block adjacent to a target block and a spatiotemporal block non-adjacent to the target block.
[0815] When constructing a merge candidate list in a model-based prediction mode, the merge candidate list may be constructed so that at least one piece of information about the model-based prediction method used in all candidate blocks of the merge candidate list is identical. Alternatively, when constructing a merge candidate list in a model-based prediction mode, the merge candidate list may be constructed so that only blocks in which at least one piece of information about the model-based prediction method used is identical to the information about a specific model-based prediction method are used as candidate blocks.
[0816] For example, when constructing a merge candidate list in a model-based prediction mode, the merge candidate list can be constructed so that the input structures of the mapping models used in all candidate blocks of the merge candidate list are all identical.
[0817] For example, when constructing a merge candidate list in a model-based prediction mode, the merge candidate list can be constructed using only blocks for which a mapping model having an input structure having or including a specific input structure is used as candidate blocks.
[0818] The specific model-based prediction method may be a predefined model-based prediction method. Alternatively, the specific model-based prediction method may be adaptively determined based on at least one of a prediction mode of the target block, motion information of the target block, coding parameters of the target block, a size of the target block, a range of values that the luminance component of the target block can have, a range of values that the chrominance component of the target block can have, availability of surrounding blocks of the target block, coding parameters of surrounding blocks of the target block, or surrounding samples of the target block.
[0819] Alternatively, information about a common model-based prediction method may not exist for all candidate blocks in the merge candidate list in the model-based prediction mode. In other words, information about the model-based prediction method of each candidate block in the merge candidate list in the model-based prediction mode may be different.
[0820] For example, at least one of the input structures used in each candidate block in the merge candidate list of the model-based prediction mode may be different from each other.
[0821] Each merge candidate in the merge candidate list of the model-based prediction mode may include at least one of mapping model information for the luminance component, the Cb component, and the Cr component.
[0822] Alternatively, each merge candidate in the merge candidate list of the model-based prediction mode may include only a mapping model for one component among the mapping model information for the luminance component, the Cb component, and the Cr component.
[0823] For example, a first merge candidate list of the model-based prediction mode can be constructed using only the mapping model information for the Cb component, and a second merge candidate list of the model-based prediction mode can be constructed using only the mapping model information for the Cr component.
[0824] In specifying a merge candidate for inheriting mapping model information from a target block from a merge candidate list in a model-based prediction mode, the merge candidates for inheriting mapping model information for at least two of the luminance component, the Cb component, or the Cr component may always be the same.
[0825] For example, both the mapping model information for the Cb component and the mapping model information for the Cr component of a specified merge candidate can be inherited from the merge candidate list in the model-based prediction mode.
[0826] Alternatively, in specifying a merge candidate for inheriting mapping model information from a target block from a merge candidate list in a model-based prediction mode, the merge candidates for inheriting mapping model information for at least two of the luminance component, the Cb component, or the Cr component may be the same or different from each other.
[0827] For example, the mapping model information for the Cb component of a first merge candidate specified from the merge candidate list of the model-based prediction mode can be inherited, and the mapping model information for the Cr component of a second merge candidate specified from the merge candidate list of the model-based prediction mode can be inherited. At this time, the first merge candidate and the second merge candidate can be the same or different.
[0828] Mapping model information for a specific component may mean information of a mapping model used to at least one of predict, restore, or change a sample value of the component.
[0829] Alternatively, spatiotemporal blocks to which the mapping model is applied can be set as merge candidates, regardless of the prediction mode of the target block and / or the luminance / chrominance component block corresponding to the target block.
[0830] Meanwhile, as described above, at least one of the mapping model and / or the method of deriving the mapping model coefficients may be different depending on the prediction mode of the target block and / or the luminance / chrominance component block corresponding to the target block.
[0831] For example, if the target block and / or the luminance / chrominance component block corresponding to the target block is encoded with intra-picture prediction, a mapping model based on a linear model or a first nonlinear model may be applied to the current block. On the other hand, if the luminance / chrominance component block of the candidate block is predicted with inter-picture prediction, IBC, or intraTMP, a merge candidate derived from the candidate block may be a second nonlinear model. When a merge candidate derived from the candidate block is selected from the merge candidate list, only common information between a mapping model applicable to the current block (e.g., a linear model or the first nonlinear model) and a mapping model indicated by the merge candidate (e.g., the second nonlinear model) may be inherited.
[0832] For example, if the input structure of the mapping model used in the first model-based prediction mode includes the input structure of the mapping model used in the second model-based prediction mode, at least one of the information about the model-based prediction method used in the second model-based prediction mode can be inherited in the first model-based prediction mode.
[0833] For example, if the input structure of the mapping model used in the first model-based prediction mode includes the input structure of the mapping model used in the second model-based prediction mode, in the first model-based prediction mode, the block on which the second model-based prediction mode is performed can be used as a candidate block.
[0834] For example, when inheriting at least one piece of information about a model-based prediction method used in a second model-based prediction mode in a first model-based prediction mode, information about a model-based prediction method used in the first model-based prediction mode but not in the second model-based prediction mode may exist. In this case, the information may be determined to a predetermined value.
[0835] For example, when inheriting at least one piece of information about a model-based prediction method used in a second model-based prediction mode in a first model-based prediction mode, there may be at least one input component that is used in the first model-based prediction mode but not used in the second model-based prediction mode. In this case, the coefficients of the mapping model for the corresponding input type in the first model-based prediction mode may be determined and / or changed to a predetermined value.
[0836] Alternatively, for example, when inheriting at least one piece of information about a model-based prediction method used in a second model-based prediction mode in a first model-based prediction mode, there may be at least one input component that is used in the first model-based prediction mode but not used in the second model-based prediction mode. In this case, the input structure in the mapping model in the first model-based prediction mode may be determined and / or changed to an input structure that does not use the corresponding input type.
[0837] Alternatively, for example, when inheriting at least one piece of information about a model-based prediction method used in a second model-based prediction mode in a first model-based prediction mode, there may be at least one input component that is used in the first model-based prediction mode but not used in the second model-based prediction mode. In this case, in the input of the mapping model in the first model-based prediction mode, the value corresponding to the input component may always be determined as a predetermined value (for example, it may be replaced with a bias).
[0838] In the above-described embodiments, the predetermined value may be 0, 1, 2, 256, 512, 1024 or an integer.
[0839] For example, the first model-based prediction mode and the second model-based prediction mode may be model-based prediction modes that generate a prediction value of CHROMA_PIX by using as input at least one of: component 1) position or slope information of a specific sample CHROMA_PIX within the target chrominance component; component 2) information of a luminance component sample LUMA_PIX corresponding to CHROMA_PIX; component 3) surrounding luminance samples of LUMA_PIX; component 4) a result value obtained by applying a predetermined filter centered on a position of a luminance component corresponding to CHROMA_PIX; component 5) a bias value; or component 6) a result value obtained by performing a specific operation on at least one of component 1, component 2, component 3, component 4, or component 5; when performing a prediction on a target chrominance component block, respectively.
[0840] In components 1 to 4, LUMA_PIX may be a subsampled luminance component sample corresponding to CHROMA_PIX. Alternatively, in components 1 to 4, LUMA_PIX may be a non-subsampled luminance component sample corresponding to CHROMA_PIX.
[0841] Figure 33 illustrates a filter based on the luminance component position.
[0842] For example, the predetermined filter in the above component 4 may be a filter for calculating a gradient. For example, the predetermined filter in the above component 4 may be one of the filters in FIG. 33. In FIG. 33, C may denote a luminance component position corresponding to CHROMA_PIX.
[0843] The above embodiments may be applied when the input structure in the first model-based prediction mode includes the input structure in the second model-based prediction mode (or, when the input structure in the first model-based prediction mode includes the input structure in the second model-based prediction mode and the input structure in the first model-based prediction mode is different from the input structure in the second model-based prediction mode).
[0844] For example, the first model-based prediction mode may be a model-based prediction mode that uses components 1 to 6 as inputs to generate predicted values of CHROMA_PIX. On the other hand, the second model-based prediction mode may be a model-based prediction mode that uses only components 1 and 5 as inputs to generate predicted values of CHROMA_PIX.
[0845] As another example, the first model-based prediction mode may be a model-based prediction mode that always uses component 2 and component 5 as inputs, and may also use at least one of component 1, component 3, component 4, or component 6 as inputs in some cases. On the other hand, the second model-based prediction mode may be a model-based prediction mode that uses only component 1, component 2, and component 5 as inputs to generate predicted values of CHROMA_PIX.
[0846] The prediction method information merge list can be constructed by considering the components of the target block.
[0847] The above component may include at least one of a luminance component or a chrominance component.
[0848] The chrominance component may include at least one of a Cb component, a Cr component, an R component, a G component, or a B component.
[0849] The merged list of prediction method information can be constructed individually for each component. For example, if the target block is a Cb component block, the merged list of prediction method information can be constructed using only the mapping model used to predict the Cb component.
[0850] Alternatively, a unified prediction method information merge list can be constructed for multiple chrominance components. For example, a single prediction method information merge list can be constructed for the Cb component block and the Cr component block.
[0851] Information indicating whether a prediction method information merge list is used in a matching model can be signaled / encoded / decoded. At this time, whether a prediction method information merge list is used in a luminance component and whether a prediction method information merge list is used in a chrominance component can be determined from the same indicator.
[0852] Alternatively, at this time, whether to use the prediction method information merge list in the luminance component and whether to use the prediction method information merge list in the chrominance component can be determined from separate indicators. At this time, whether to use the prediction method information merge list in the Cb component and whether to use the prediction method information merge list in the Cr component can be determined from separate indicators.
[0853] In a matching model, information for specifying a merge candidate from a merge list of prediction method information can be signaled / encoded / decoded. At this time, the merge candidate for a model-based prediction method in the luminance component and the merge candidate for a model-based prediction method in the chrominance component can be determined from the same index.
[0854] Alternatively, at this time, the merge candidate of the model-based prediction method in the luminance component and the merge candidate of the model-based prediction method in the chrominance component can be determined from separate indices. At this time, the merge candidate of the model-based prediction method in the Cb component and the merge candidate of the model-based prediction method in the Cr component can be determined from separate indices.
[0855] A prediction block of the current block can be obtained by weighting multiple blocks. The multiple blocks may be generated based on multiple mapping models. Each block may be generated by a different mapping model. For example, the prediction block of the current block can be obtained by calculating the average / weighted sum of a first prediction block obtained based on a first mapping model and a second prediction block obtained based on a second mapping model.
[0856] For example, the first mapping model may be any one of a linear model, a nonlinear model, a regression model, and a filter, and the second mapping model may be any one of the others.
[0857] Information about whether multiple models are used, or at least one of the number of models used, may be signaled / encoded / decoded.
[0858] For example, a prediction block of the target block can be generated by performing a weighted sum of blocks generated by applying each mapping model to the target block.
[0859] The weighted sum may include a mean. The weight applied to each block may be 0, a real number greater than 0, or a negative real number less than 0.
[0860] For example, multiple mapping models may be determined as N merge candidates having the lowest index in the prediction method information merge list. Alternatively, for example, multiple mapping models may be determined as N merge candidates having the lowest mapping cost in the prediction method information merge list. N may be 2, 3, or a positive integer.
[0861] A new mapping model can be derived from multiple mapping models. For example, a new mapping model can be derived by weighting multiple mapping models. For example, predictions for target blocks can be made based on the derived mapping model. For example, the derived mapping model can be added to the merged list of prediction method information.
[0862] Alternatively, the final prediction block may be obtained by weighting a prediction block derived using a mapping model and a prediction block derived using a prediction method other than the mapping model (e.g., intra-screen prediction, inter-screen prediction, IBC, or intraTMP).
[0863] Meanwhile, a merge candidate consisting of a combination of multiple prediction models may be included in the merge candidate list. If the merge candidate is selected, a prediction block can be derived according to the above embodiment.
[0864] Alternatively, when selecting multiple mapping models, the first mapping model may be selected from a list of merge candidates, and the second mapping model may be determined using a predefined model or based on signaled information.
[0865] When performing weighted summation on two or more blocks, the weights for the weighted summation can be determined on a block-by-block basis, a predetermined area basis within a block, or a sample basis within a block.
[0866] For example, weights for a block may be determined based on a mapping model. Alternatively, weights for samples belonging to a block may be determined based on a mapping model.
[0867] Alternatively, weights for each block may be determined based on the cost for the template region of the target block for each mapping model. For example, a first mapping model is applied to the template region of the target block to obtain a first prediction signal and a first cost for the template region. For example, the first cost may be the SAD between the reconstruction signal in the template region and the first prediction signal. In addition, a second mapping model is applied to the template region of the target block to obtain a second prediction signal and a second cost for the template region. For example, the first cost may be the SAD between the reconstruction signal in the template region and the first prediction signal. Thereafter, the first cost and the second cost may be compared to determine weights for the first block obtained by the first mapping model and the second block obtained by the second mapping model, respectively.
[0868] For example, if the first cost is less than the second cost, the weight assigned to the first block may have a greater value than the weight assigned to the second block. Conversely, if the first cost is greater than the second cost, the weight assigned to the second block may have a greater value than the weight assigned to the first block.
[0869] Weights for blocks and / or weights for samples within blocks may be determined simultaneously. Alternatively, weights for blocks and / or weights for samples within blocks may be determined sequentially. Here, the order may include the scan order.
[0870] In this case, the dependent sample set may include a surrounding sample of the target block; a surrounding sample of at least one block whose weight has already been determined; or a sample value determined based on at least one of the weights of a block whose weight has already been determined. For example, weights for the same block may be determined more than once.
[0871] The order of blocks for which weights are determined may be determined based on at least one of the POC of the image to which each block belongs; the direction of the reference image to which each reference block belongs; the index of the motion information indicating each block; or the matching cost for each block.
[0872] The independent sample set may include at least one surrounding sample among the reference blocks of the target block. The dependent sample set may include a surrounding sample of the target block. The target sample set may include at least one sample among the reference blocks of the target block.
[0873] A prediction block can be modified by applying a filter to the prediction block derived based on at least one mapping model.
[0874] Information indicating whether to modify a predicted block can be encoded and signaled. This information can be a 1-bit flag. Alternatively, whether to modify a predicted block can be adaptively determined based on the size / shape of the current block and the type of mapping model used.
[0875] Figure 34 shows an example of a 3x3 sized low-pass filter for prediction sample correction.
[0876] Prediction samples can be corrected by applying a filter of a predetermined size / shape to the prediction block. The size / shape / type of the filter may be predefined in the encoder / decoder. For example, a 3x3 low-pass filter may be used.
[0877] Alternatively, the size / shape / type of the filter may be adaptively determined based on at least one of the size / shape of the current block, the type of the mapping model used, or the prediction mode / in-screen prediction mode of the independent sample set.
[0878] Alternatively, multiple filter type candidates can be defined and signaled by encoding an index that identifies one of the multiple filter type candidates.
[0879] When applying a filter to the left / top boundary of a block, filtering can be performed using previously reconstructed neighboring samples. When applying a filter to the right / bottom boundary, filtering can be performed by padding the predicted samples on the right / top boundary.
[0880] Alternatively, the size / shape of the filter can be set differently depending on the location of the prediction sample. Alternatively, if the prediction sample is located at a block boundary, application of the filter can be omitted.
[0881] When weighting prediction blocks derived from each of multiple mapping models, a filter can be applied to the weighted prediction blocks. Alternatively, a filter can be applied to each of the prediction blocks derived from each of multiple mapping models, and then the filtered prediction blocks can be weighted to obtain the final prediction block.
[0882] The order of merge candidates in the prediction method information merge list can be rearranged.
[0883] The rearrangement of the order of merge candidates in the merge list of prediction method information may be performed based on at least one of the type of merge candidate; mapping model information of the merge candidate; the target block; surrounding samples of the target block; reference blocks of the target block; or reference samples of the target block.
[0884] The types of merge candidates can be distinguished based on the method by which the merge candidates are derived. For example, the types of merge candidates can include at least one of: merge candidates derived from adjacent blocks; merge candidates derived from non-adjacent blocks; merge candidates derived from spatially adjacent blocks; merge candidates derived from temporally adjacent blocks; merge candidates derived from a prediction method information table; or merge candidates derived using default prediction method information.
[0885] The reordering order of merge candidates in the merge list of prediction method information can be determined based on the matching cost of each merge candidate.
[0886] For example, the reordering order of merge candidates in the prediction method information merge list may follow the ascending order of the matching cost of each merge candidate.
[0887] The matching cost of a specific merge candidate can be determined based on a second sample set and a third sample set obtained by applying the merge candidate to the first sample set.
[0888] For example, the matching cost of a particular merge candidate can be determined based on a second sample set and a third sample set obtained by applying the merge candidate to the first sample set.
[0889] For example, the coefficient to be corrected can be determined based on the difference between the second sample set and the third sample set.
[0890] For example, the first sample set may include surrounding luminance prediction / reconstruction samples of the target block, and the third sample set may include surrounding chrominance prediction / reconstruction samples of the target block.
[0891] For example, the first sample set may include surrounding luminance / chrominance prediction samples of the target block, and the third sample set may include surrounding luminance / chrominance restoration samples of the target block.
[0892] In order to perform a model-based prediction method on a target block, information for specifying at least one mapping model may be signaled / encoded / decoded from a prediction method information merge list. The model-based prediction method on the target block may be performed using the specified at least one mapping model.
[0893] Alternatively, for example, to perform a model-based prediction method on a target block, N mapping models having the lowest indices in the prediction method information merge list may be used. That is, a model-based prediction method on a target block may be performed using N mapping models having the lowest indices in the prediction method information merge list.
[0894] Alternatively, for example, to perform a model-based prediction method on a target block, N mapping models having the lowest matching costs in the prediction method information merge list may be used. That is, a model-based prediction method on a target block may be performed using N mapping models having the lowest matching costs in the prediction method information merge list.
[0895]
[0896] The model-based prediction merge mode may mean a mode in which information about a model-based prediction method used in a target block is determined based on at least one of: 1) a model-based prediction method of a block determined by a predefined rule; or 2) information about a model-based prediction method specified from a prediction method information merge list.
[0897] For example, the model-based prediction merge mode may mean a model-based prediction mode that inherits and uses at least one of 1) a model-based prediction method of a block determined by a predefined rule; or 2) information about a model-based prediction method specified from a prediction method information merge list.
[0898] An indicator indicating whether the target block is in model-based prediction merge mode can be signaled / encoded / decoded based on at least one of the size of the target block, whether the target block is a luminance component block, whether the target block is a chrominance component block, the type of the target slice, the surrounding blocks of the target block, the availability of surrounding blocks of the target block, the surrounding samples of the target block, the luminance component samples of the target block, the chrominance component samples of the target block, the availability of surrounding samples of the target block, or the coding parameters of the target block.
[0899] If the indicator indicating whether the model-based prediction merge mode is in effect has a first value, the target block may be determined to be in the model-based prediction merge mode. For example, the first value may be 1 or true.
[0900] If the indicator indicating whether the model-based prediction merge mode is in effect has a second value, the target block may be determined not to be in the model-based prediction merge mode. For example, the second value may be 0 or false.
[0901] For example, an indicator may be signaled / encoded / decoded that indicates whether the target block is in model-based prediction merge mode based on at least one of the availability of neighboring samples (or neighboring blocks) adjacent to the top boundary of the target block or the availability of neighboring samples (or neighboring blocks) adjacent to the left boundary.
[0902] For example, an indicator indicating whether a target block is in model-based prediction merge mode may be signaled / encoded / decoded only if both the surrounding samples (or surrounding blocks) adjacent to the top boundary of the target block and the surrounding samples (or surrounding blocks) adjacent to the left boundary of the target block are available.
[0903] For example, if an indicator indicating whether model-based prediction is performed on the target block is true, an indicator indicating whether the target block is in model-based prediction merge mode can be signaled / encoded / decoded.
[0904] When the target block is in model-based prediction merging mode, information for specifying at least one of the merging candidates in the merge candidate list of the block, mapping model information and / or model-based prediction mode, for inheriting at least one of the mapping model information from the target block, may be signaled / encoded / decoded. The information may include an indicator and / or an index for specifying the merging candidate in the merging candidate list.
[0905] For example, in the target block, both the mapping model information for the Cb component and the mapping model information for the Cr component can be inherited from the merge candidate specified from the index for specifying the merge candidate in the merge candidate list.
[0906] Alternatively, for example, in the target block, the mapping model information for the Cb component may be inherited from the first merge candidate specified from the first index for specifying the merge candidate in the merge candidate list, and the mapping model information for the Cr component may be inherited from the second merge candidate specified from the second index.
[0907] The first and second indices may be identical or different. Both the first and second indices may be signaled / encoded / decoded. The first and second merge candidates may be identical or different.
[0908]
[0909] When model-based prediction is performed on a target block, a mapping model adjustment-offset may be applied to the mapping model on the target block.
[0910] For example, when a model-based prediction method is performed on a target block, instead of performing the model-based prediction method using the first mapping model, a model-based prediction method may be performed using the second mapping model, which is the result of applying a mapping model adjustment-offset to the first mapping model.
[0911] That is, when a mapping model adjustment-offset is applied to a target block, at least one of the first mapping model used as a predictor, the mapping model adjustment-offset for the first mapping model, or the second mapping model that applies the mapping model adjustment-offset to the first mapping model may be (used, derived, or determined) in the target block.
[0912] The number of mapping models to which the mapping model adjustment-offset is applied in the target block may be one or multiple. The mapping models to which the mapping model adjustment-offset is applied in the target block may be mapping models determined based on the independent sample set and dependent sample set configured for the target block. Alternatively, the mapping models to which the mapping model adjustment-offset is applied in the target block may be mapping models determined in the model-based prediction merge mode.
[0913] When a mapping model adjustment-offset is applied to multiple mapping models in a target block, the same mapping model adjustment-offset may be applied to all mapping models. Alternatively, when a mapping model adjustment-offset is applied to multiple mapping models in a target block, the same mapping model adjustment-offset may be applied to all mapping models, or different mapping model adjustment-offsets may be applied to at least two of the mapping models.
[0914] In the target block, the mapping model adjustment-offset related information may be signaled / encoded / decoded based on at least one of the size of the target block, whether the target block is a luminance component block, whether the target block is a chrominance component block, the type of the target slice, the surrounding blocks of the target block, the availability of the surrounding blocks of the target block, the surrounding samples of the target block, the luminance component samples of the target block, the chrominance component samples of the target block, the availability of the surrounding samples of the target block, or the coding parameters of the target block.
[0915] For example, based on whether the target block is in model-based prediction merge mode, mapping model adjustment-offset related information can be signaled / encoded / decoded.
[0916] For example, mapping model adjustment-offset related information can be signaled / encoded / decoded based on an indicator indicating whether to perform model-based prediction merging mode on the target block.
[0917] The mapping model adjustment-offset related information may be information including at least one of a plurality of elements. Here, the plurality of elements may include: 1) an indicator indicating whether a mapping model adjustment-offset is applied to at least one mapping model in the target block; 2) an indicator indicating whether a mapping model adjustment-offset is applied to a mapping model for a specific component of the target block; 3) an indicator indicating whether a mapping model adjustment-offset is applied to both a mapping model for a Cb component and a mapping model for a Cr component of the target block; 4) a size of at least one mapping model adjustment-offset applied to a mapping model in the target block; 5) a sign of at least one mapping model adjustment-offset applied to a mapping model in the target block; 6) at least one mapping model adjustment-offset applied to a mapping model in the target block; 7) an index of at least one mapping model adjustment-offset applied to a mapping model in the target block; or 8) the number of mapping model adjustment-offsets applied to mapping models in the target block.
[0918] Additionally, when multiple mapping models are used in the target block (or, when the indicator indicating whether multiple mapping models are used has a value of true or 1), the plurality of elements may further include information for specifying the mapping model to which the 9) mapping model adjustment-offset is to be applied.
[0919] Additionally, when multiple mapping models are used in the target block (or, when an indicator indicating whether multiple mapping models are used has a value of true or 1), the plurality of elements may further include an indicator (N is 1, 2, ...) indicating whether a mapping model adjustment-offset is applied to the mapping model for a specific component in the Nth mapping model. The specific component may mean one of a luminance component, a Cb component, and a Cr component.
[0920]
[0921] For example, when a single mapping model is used in the target block, an indicator (OFFSET_BOTH0_FLAG) can be signaled / encoded / decoded to indicate whether mapping model adjustment-offset is applied to the first mapping model for the Cb component and the first mapping model for the Cr component.
[0922] For example, when a single mapping model is used in a target block, at least one of an indicator (OFFSET_Cr0_FLAG) indicating whether a mapping model adjustment-offset is applied to the first mapping model for the Cb component or an indicator (OFFSET_Cb0_FLAG) indicating whether a mapping model adjustment-offset is applied to the first mapping model for the Cr component may be signaled / encoded / decoded. Whether to perform signaling / encoding / decoding of OFFSET_Cr0_FLAG and OFFSET_Cb0_FLAG may be determined based on OFFSET_BOTH0_FLAG. For example, signaling / encoding / decoding of at least one of OFFSET_Cr0_FLAG or OFFSET_Cb0_FLAG may be performed only when OFFSET_BOTH0_FLAG has a value of false or 0. Whether signaling / encoding / decoding of OFFSET_Cr0_FLAG is performed can be determined based on OFFSET_Cb0_FLAG. For example, signaling / encoding / decoding of OFFSET_Cr0_FLAG can be performed only when OFFSET_Cb0_FLAG has a value of false or 0.
[0923] For example, when a single mapping model is used in the target block, OFFSET_BOTH0_FLAG can be signaled / encoded / decoded. When OFFSET_BOTH0_FLAG has a value of true or 1, the mapping model adjustment-offset can be applied to both the first mapping model for the Cb component and the first mapping model for the Cr component. When OFFSET_BOTH0_FLAG has a value of false or 0, OFFSET_Cb0_FLAG can be signaled / encoded / decoded. When OFFSET_Cb0_FLAG has a value of true or 1, the mapping model adjustment-offset can be applied to the first mapping model for the Cb component, and the mapping model adjustment-offset can not be applied to the first mapping model for the Cr component. If OFFSET_Cb0_FLAG is false or has a value of 0, no mapping model adjustment-offset is applied to the first mapping model for the Cb component, no mapping model adjustment-offset is applied to the first mapping model for the Cr component, and no mapping model adjustment-offset is applied to the first mapping model for the Cb component.
[0924]
[0925] For example, if a target block uses mapping models for two Cb components and two Cr components, an indicator (OFFSET_BOTH0_FLAG) can be signaled / encoded / decoded to indicate whether mapping model adjustment-offset is applied to the first mapping model for the Cb component and the first mapping model for the Cr component.
[0926] For example, when two mapping models for Cb components and two mapping models for Cr components are used in a target block, at least one of an indicator (OFFSET_Cr0_FLAG) indicating whether mapping model adjustment-offset is applied to the first mapping model for the Cb component or an indicator (OFFSET_Cb0_FLAG) indicating whether mapping model adjustment-offset is applied to the first mapping model for the Cr component can be signaled / encoded / decoded. Whether to perform signaling / encoding / decoding of OFFSET_Cr0_FLAG and OFFSET_Cb0_FLAG can be determined based on OFFSET_BOTH0_FLAG. For example, signaling / encoding / decoding of at least one of OFFSET_Cr0_FLAG or OFFSET_Cb0_FLAG can be performed only when OFFSET_BOTH0_FLAG has a value of false or 0. Whether signaling / encoding / decoding of OFFSET_Cr0_FLAG is performed can be determined based on OFFSET_Cb0_FLAG. For example, signaling / encoding / decoding of OFFSET_Cr0_FLAG can be performed only when OFFSET_Cb0_FLAG has a value of false or 0.
[0927] For example, if a target block uses mapping models for two Cb components and two Cr components, an indicator (OFFSET_BOTH1_FLAG) can be signaled / encoded / decoded to indicate whether mapping model adjustment-offsets are applied for the second mapping model for the Cb component and the second mapping model for the Cr component.
[0928] For example, when mapping models for two Cb components and mapping models for two Cr components are used in a target block, at least one of an indicator (OFFSET_Cr1_FLAG) indicating whether mapping model adjustment-offset is applied to the second mapping model for the Cb component or an indicator (OFFSET_Cb1_FLAG) indicating whether mapping model adjustment-offset is applied to the second mapping model for the Cr component can be signaled / encoded / decoded. Whether to perform signaling / encoding / decoding of OFFSET_Cr1_FLAG and OFFSET_Cb1_FLAG can be determined based on at least one of OFFSET_BOTH0_FLAG, OFFSET_Cr0_FLAG, OFFSET_Cb0_FLAG, and OFFSET_BOTH1_FLAG. For example, signaling / encoding / decoding of at least one of OFFSET_Cr1_FLAG or OFFSET_Cb1_FLAG may be performed only when OFFSET_BOTH1_FLAG has a value of false or 0. As another example, signaling / encoding / decoding of at least one of OFFSET_Cr1_FLAG or OFFSET_Cb1_FLAG may be performed only when OFFSET_BOTH0_FLAG, OFFSET_Cr0_FLAG, OFFSET_Cb0_FLAG, and OFFSET_BOTH1_FLAG all have a value of false or 0. Whether to perform signaling / encoding / decoding of OFFSET_Cr1_FLAG may be determined based on OFFSET_Cb1_FLAG. For example, signaling / encoding / decoding of OFFSET_Cr1_FLAG may be performed only when OFFSET_Cb1_FLAG has a value of false or 0.
[0929] For example, if two mapping models for Cb components and two mapping models for Cr components are used in the target block, OFFSET_BOTH0_FLAG can be signaled / encoded / decoded. When OFFSET_BOTH0_FLAG has a value of true or 1, the mapping model adjustment-offset can be applied to both the first mapping model for the Cb component and the first mapping model for the Cr component. When OFFSET_BOTH0_FLAG has a value of false or 0, OFFSET_Cb0_FLAG can be signaled / encoded / decoded. When OFFSET_Cb0_FLAG has a value of true or 1, the mapping model adjustment-offset can be applied to the first mapping model for the Cb component, and the mapping model adjustment-offset can not be applied to the first mapping model for the Cr component. If OFFSET_Cb0_FLAG is false or has a value of 0, OFFSET_Cr0_FLAG may be signaled / encoded / decoded without applying the mapping model adjustment-offset to the first mapping model for the Cb component. In the same or similar manner as above, at least one of whether to apply the mapping model adjustment-offset to the second mapping model for the Cb component of the target block or whether to apply the mapping model adjustment-offset to the second mapping model for the Cr component may be determined.
[0930] When a mapping model adjustment-offset is used in the target block, at least one of the information for specifying the size, sign or index of the mapping model adjustment-offset used in the target block may be signaled / encoded / decoded.
[0931] For example, an index for specifying at least one of the mapping model adjustment-offsets used in the target block from a given mapping model adjustment-offset list is signaled / encoded / decoded, and a value corresponding to the index in the mapping model adjustment-offset list can be used as the mapping model adjustment-offset.
[0932] For example, an index for specifying at least one of the mapping model adjustment-offsets used in the target block from a given mapping model adjustment-offset list is signaled / encoded / decoded, and the result of adding or multiplying (or subtracting or dividing) the value corresponding to the index from the mapping model adjustment-offset list by a given value can be used as the mapping model adjustment-offset.
[0933] For example, the predetermined mapping model adjustment-offset list may include integer values from -N to N. Or, for example, the predetermined mapping model adjustment-offset list may include the result of adding or multiplying (or subtracting or dividing) each of the integer values from -N to N by a predetermined value. Or, for example, the predetermined mapping model adjustment-offset list may include the result of adding or multiplying (or subtracting or dividing) each of the integer values from -N to N by a predetermined value plus 1.
[0934] For example, the predetermined mapping model adjustment-offset list may include integer values from -N to N, but may not include 0. Or, for example, the predetermined mapping model adjustment-offset list may include the result of adding or multiplying (or subtracting or dividing) each of the integer values from -N to N by a predetermined value, but may not include 0. Or, for example, the predetermined mapping model adjustment-offset list may include the result of adding or multiplying (or subtracting or dividing) each of the integer values from -N to N by a predetermined value plus 1, but may not include 0.
[0935] For example, the above-described mapping model adjustment-offset list is may include at least one of the following: or, for example, the above-described mapping model adjustment-offset list Each value may include at least one of the results of adding or multiplying, or subtracting or dividing, a predetermined value. Or, for example, the predetermined mapping model adjustment-offset list It may include at least one of the following: a value obtained by adding or multiplying each value by a given value plus 1, or a value obtained by subtracting or dividing each value by 1.
[0936]
[0937] Or, for example, the above-described mapping model adjustment-offset list may include at least one of and 0. Or, for example, the above-described mapping model adjustment-offset list Each value may include at least one of the results of adding or multiplying, subtracting or dividing a given value and 0. Or, for example, the above-described mapping model adjustment-offset list It may include at least one of the values obtained by adding or multiplying each value by a given value plus 1, or the value obtained by subtracting or dividing each value by 1, and 0.
[0938] The above A may be 2, 3, 4 or a positive integer. N may be 1, 2, 3, 4 or a positive integer. The above predetermined value may be 1, 2, 4, 8, 16, 32, 64 or an integer.
[0939] For example, if a mapping model adjustment-offset is used for the first and second components of the target block, the same mapping model adjustment-offset can always be appli...
Claims
1. A step of obtaining a prediction block of the target block by performing prediction of the target block based on the mapping model; and A step of restoring the target block based on the above prediction block, A method for decoding an image, wherein the above mapping model is determined by one of a plurality of mapping model candidates.
2. In paragraph 1, A method for decoding an image, wherein the plurality of mapping model candidates are determined based on at least one of a spatial adjacent block, a spatial non-adjacent block, or a temporal adjacent block of the target block.
3. In paragraph 2, A method for decoding an image, wherein the temporal adjacent block is a call block within a call picture corresponding to the position of the target block or a block adjacent to the call block.
4. In paragraph 3, A method for decoding an image, wherein a block adjacent to the call block is a block located to the right, bottom, or bottom right of the call block.
5. In paragraph 3, A block adjacent to the above call block is a block located at a position spaced apart by a motion vector from the position of the above call block, A method for decoding an image, wherein the above-mentioned separation is determined based on a motion vector surrounding the target block.
6. In paragraph 2, A method for decoding an image, wherein the spatially non-adjacent block is a block indicated by either a block vector of a luminance component block corresponding to the target block or a motion vector of a luminance component block when the target block is a chrominance component block.
7. In paragraph 2, A method for decoding an image, wherein the spatially adjacent block includes at least one of blocks adjacent to the top, top left, top right, left, or bottom left of the target block.
8. In paragraph 1, A method for decoding an image, wherein any one of the plurality of mapping model candidates is determined by an index signaled from a bitstream.
9. A step of obtaining a prediction block of the target block by performing prediction of the target block based on the mapping model; and A step of restoring the target block based on the above prediction block, A method for encoding an image, wherein the above mapping model is determined by one of a plurality of mapping model candidates.
10. In paragraph 9, A video encoding method, wherein the plurality of mapping model candidates are determined based on at least one of a spatial adjacent block, a spatial non-adjacent block, or a temporal adjacent block of the target block.
11. In paragraph 10, A method for encoding an image, wherein the temporal adjacent block is a call block within a call picture corresponding to the position of the target block or a block adjacent to the call block.
12. In paragraph 11, A method for encoding an image, wherein a block adjacent to the call block is a block located at the right, bottom, or bottom right of the call block.
13. In paragraph 11, A block adjacent to the above call block is a block located at a position spaced apart by a motion vector from the position of the above call block, A video encoding method, wherein the above separation is determined based on a surrounding motion vector of the target block.
14. In paragraph 10, A method for encoding an image, wherein the spatially non-adjacent block is a block indicated by either a block vector of a luminance component block corresponding to the target block or a motion vector of the luminance component block when the target block is a chrominance component block.
15. In paragraph 10, A method for encoding an image, wherein the spatially adjacent block includes at least one of blocks adjacent to the top, top left, top right, left, or bottom left of the target block.
16. In paragraph 9, A video encoding method, wherein an index indicating any one of the plurality of mapping model candidates is encoded in a bitstream.
17. In a computer-readable recording medium storing a bitstream generated by an encoding method, The above encoding method comprises: a step of obtaining a prediction block of the target block by performing prediction of the target block based on a mapping model; and A step of restoring the target block based on the above prediction block, A computer-readable recording medium, wherein the above mapping model is determined by one of a plurality of mapping model candidates.
Citation Information
Patent Citations
Adaptive cross component residual prediction
KR102519241B1
Method and apparatus of advanced intra prediction for chroma components in video coding
WO2017140211A1
An apparatus, a method and a computer program for cross-component parameter calculation
WO2023281158A1
KR20190107581A
